commit a7f03930ca497673e978518980ec214a760bc6ac Author: hupeng Date: Wed Nov 6 21:34:55 2019 +0800 1.0版本完成 diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..9845fd9c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +### IDEA ### +.idea/* +*.iml +*/target/* +*/*.iml \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..91e3c252 --- /dev/null +++ b/LICENSE @@ -0,0 +1,191 @@ +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: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +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 +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 2018 Elune + + 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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..f8dd8b6a --- /dev/null +++ b/README.md @@ -0,0 +1,83 @@ +

el-admin 后台管理系统

+
+ +[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/elunez/eladmin/blob/master/LICENSE) +[![star](https://gitee.com/elunez/eladmin/badge/star.svg?theme=white)](https://gitee.com/elunez/eladmin) +[![GitHub stars](https://img.shields.io/github/stars/elunez/eladmin.svg?style=social&label=Stars)](https://github.com/elunez/eladmin) +[![GitHub forks](https://img.shields.io/github/forks/elunez/eladmin.svg?style=social&label=Fork)](https://github.com/elunez/eladmin) + +
+ +#### 项目简介 +eladmin基于 Spring Boot 2.1.0 、 Jpa、 Spring Security、redis、Vue的前后端分离的后台管理系统, 权限控制的方式为RBAC,项目支持数据字典与数据权限管理,支持一键生成前后端代码,支持前端菜单动态路由 + +**开发文档** [https://docs.auauz.net/](https://docs.auauz.net) + +**体验地址** [https://auauz.net/](https://auauz.net/) + +**账号密码** ```admin/123456```(默认密码都是123456) + +#### 项目源码 + +| | 后端源码 | 前端源码 | +|--- |--- | --- | +| github | https://github.com/elunez/eladmin | https://github.com/elunez/eladmin-qd | +| 码云 | https://gitee.com/elunez/eladmin | https://gitee.com/elunez/eladmin-qt | + +#### 系统功能 +- 用户管理:提供用户的相关配置,新增用户后,默认密码为123456 +- 角色管理:对权限与菜单进行分配,可根据部门设置角色的数据权限 +- 权限管理:权限细化到接口,可以理解成按钮权限 +- 菜单管理:已实现菜单动态路由,后端可配置化,支持多级菜单 +- 部门管理:可配置系统组织架构,树形表格展示 +- 岗位管理:配置各个部门的职位 +- 字典管理:应广大码友的要求加入字典管理,可维护常用一些固定的数据,如:状态,性别等 +- 操作日志:记录用户操作的日志 +- 异常日志:记录异常日志,方便开发人员定位错误 +- 系统缓存:使用jedis将缓存操作可视化,并提供对redis的基本操作,可根据需求自行扩展 +- SQL监控:采用druid 监控数据库访问性能,默认用户名admin,密码123456 +- 定时任务:整合Quartz做定时任务,加入任务日志,任务运行情况一目了然 +- 代码生成:高灵活度一键生成前后端代码,减少百分之80左右的工作任务 +- 邮件工具:配合富文本,发送html格式的邮件 +- 免费图床:使用sm.ms图床,用作公共图片上传使用 +- 七牛云存储:可同步七牛云存储的数据到系统,无需登录七牛云直接操作云数据 +- 支付宝支付:整合了支付宝支付并且提供了测试账号,可自行测试 + +#### 项目结构 +项目采用分模块开发方式,将通用的配置放在公共模块,```system```模块为系统核心模块也是项目入口模块,```logging``` 模块为系统的日志模块,```tools``` 为第三方工具模块,包含了图床、邮件、七牛云、支付宝,```generator``` 为系统的代码生成模块 +- eladmin-common 公共模块 + - exception 项目统一异常的处理 + - mapper mapstruct的通用mapper + - redis redis缓存相关配置 + - swagger2 接口文档配置 + - utils 系统通用工具类 +- eladmin-system 系统核心模块(系统启动入口) + - config 配置跨域与静态资源,与数据权限 + - modules 系统相关模块(登录授权、定时任务等) +- eladmin-logging 系统日志模块 +- eladmin-tools 系统第三方工具模块 +- eladmin-generator 系统代码生成模块 + +#### 系统预览 + + + + + + + + + + + + + + + + +
+ +#### 项目捐赠 +项目的发展离不开你的支持,请作者喝杯咖啡吧 ☕! [Donate](https://docs.auauz.net/#/jz) +#### 反馈交流 +- QQ交流群:891137268 diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..6b44b94b --- /dev/null +++ b/pom.xml @@ -0,0 +1,246 @@ + + + 4.0.0 + + co.yixiang + yshop + pom + 1.0 + + + yshop-common + yshop-logging + yshop-system + yshop-tools + yshop-generator + yshop-api + yshop-mp + + + YSHOP商城管理系统 + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + 2.9.0 + 1.16 + 2.9.2 + 1.2.54 + 1.1.10 + 4.6.0 + 2.5.0 + 1.2.0.Final + + + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-security + + + + org.springframework.boot + spring-boot-starter-cache + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + + org.apache.commons + commons-pool2 + ${commons-pool2.version} + + + org.apache.commons + commons-lang3 + + + + + org.bgee.log4jdbc-log4j2 + log4jdbc-log4j2-jdbc4.1 + ${log4jdbc.version} + + + + + io.springfox + springfox-swagger2 + ${swagger.version} + + + io.swagger + swagger-annotations + + + io.swagger + swagger-models + + + + + io.springfox + springfox-swagger-ui + ${swagger.version} + + + io.swagger + swagger-annotations + 1.5.21 + + + io.swagger + swagger-models + 1.5.21 + + + + + mysql + mysql-connector-java + runtime + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + + org.projectlombok + lombok + true + + + + + cn.hutool + hutool-all + ${hutool.version} + + + + org.lionsoul + ip2region + 1.7.2 + + + org.apache.poi + poi + 3.17 + + + org.apache.poi + poi-ooxml + 3.17 + + + + xerces + xercesImpl + 2.11.0 + + + + + com.alibaba + fastjson + ${fastjson.version} + + + + org.mapstruct + mapstruct-jdk8 + ${mapstruct.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + provided + + + javax.inject + javax.inject + 1 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + + + + aliyun + aliyun-maven + http://maven.aliyun.com/nexus/content/groups/public/ + + + spring-milestones + Spring Milestones + https://maven.aliyun.com/repository/spring + + + central + maven-central + http://central.maven.org/maven2/ + + + + + + public + aliyun nexus + http://maven.aliyun.com/nexus/content/groups/public/ + + true + + + false + + + + diff --git a/shell/log.sh b/shell/log.sh new file mode 100644 index 00000000..a4737c51 --- /dev/null +++ b/shell/log.sh @@ -0,0 +1 @@ +tail -f nohup.out \ No newline at end of file diff --git a/shell/start.sh b/shell/start.sh new file mode 100644 index 00000000..9d711674 --- /dev/null +++ b/shell/start.sh @@ -0,0 +1 @@ +nohup java -jar yshop-api-1.0.jar --spring.profiles.active=prod & \ No newline at end of file diff --git a/shell/stop.sh b/shell/stop.sh new file mode 100644 index 00000000..eed3f60c --- /dev/null +++ b/shell/stop.sh @@ -0,0 +1,7 @@ +PID=$(ps -ef | grep yshop-api-1.0.jar | grep -v grep | awk '{ print $2 }') +if [ -z "$PID" ];then + echo Application is already stopped +else + echo kill $PID + kill $PID +fi diff --git a/spy.log b/spy.log new file mode 100644 index 00000000..ed5f0e84 --- /dev/null +++ b/spy.log @@ -0,0 +1,57 @@ +1571474393700|11|statement|connection 0|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select 1|select 1 +1571474393713|0|statement|connection 1|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select 1|select 1 +1571474393721|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select 1|select 1 +1571474399442|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select visits0_.id as id1_8_, visits0_.create_time as create_t2_8_, visits0_.date as date3_8_, visits0_.ip_counts as ip_count4_8_, visits0_.pv_counts as pv_count5_8_, visits0_.week_day as week_day6_8_ from visits visits0_ where visits0_.date=?|select visits0_.id as id1_8_, visits0_.create_time as create_t2_8_, visits0_.date as date3_8_, visits0_.ip_counts as ip_count4_8_, visits0_.pv_counts as pv_count5_8_, visits0_.week_day as week_day6_8_ from visits visits0_ where visits0_.date='2019-10-19' +1571474406194|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_banner') +1571474406203|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474406207|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_menus') +1571474406208|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474406211|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_activity') +1571474406212|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474406219|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,menu_name,sort,value,status FROM yx_system_config WHERE (menu_name = ?)|SELECT id,menu_name,sort,value,status FROM yx_system_config WHERE (menu_name = 'wechat_logo') +1571474406220|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474406233|2|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_best = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_best = 1) ORDER BY sort DESC +1571474406237|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474406241|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_benefit = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_benefit = 1) ORDER BY sort DESC +1571474406244|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474406247|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_hot = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_hot = 1) ORDER BY sort DESC +1571474406250|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474406252|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_menus') +1571474406254|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474486877|10|statement|connection 0|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select 1|select 1 +1571474486887|0|statement|connection 1|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select 1|select 1 +1571474486894|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select 1|select 1 +1571474491672|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select visits0_.id as id1_8_, visits0_.create_time as create_t2_8_, visits0_.date as date3_8_, visits0_.ip_counts as ip_count4_8_, visits0_.pv_counts as pv_count5_8_, visits0_.week_day as week_day6_8_ from visits visits0_ where visits0_.date=?|select visits0_.id as id1_8_, visits0_.create_time as create_t2_8_, visits0_.date as date3_8_, visits0_.ip_counts as ip_count4_8_, visits0_.pv_counts as pv_count5_8_, visits0_.week_day as week_day6_8_ from visits visits0_ where visits0_.date='2019-10-19' +1571474498217|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_banner') +1571474498227|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474498230|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_menus') +1571474498231|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474498234|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_activity') +1571474498234|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474498242|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,menu_name,sort,value,status FROM yx_system_config WHERE (menu_name = ?)|SELECT id,menu_name,sort,value,status FROM yx_system_config WHERE (menu_name = 'wechat_logo') +1571474498243|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474498254|2|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_best = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_best = 1) ORDER BY sort DESC +1571474498258|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474498261|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_benefit = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_benefit = 1) ORDER BY sort DESC +1571474498264|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474498266|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_hot = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_hot = 1) ORDER BY sort DESC +1571474498269|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474498272|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_menus') +1571474498273|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474664269|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|select 1|select 1 +1571474664274|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_banner') +1571474664276|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474664280|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_menus') +1571474664282|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474664285|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_activity') +1571474664286|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474664289|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,menu_name,sort,value,status FROM yx_system_config WHERE (menu_name = ?)|SELECT id,menu_name,sort,value,status FROM yx_system_config WHERE (menu_name = 'wechat_logo') +1571474664290|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474664293|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_best = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_best = 1) ORDER BY sort DESC +1571474664300|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474664303|0|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_benefit = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_benefit = 1) ORDER BY sort DESC +1571474664305|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474664309|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = ? AND is_show = ? AND is_hot = ?) ORDER BY sort DESC|SELECT id,add_time,ot_price,mer_use,description,is_postage,is_best,sales,price,is_bargain,vip_price,store_name,stock,keyword,image,cost,is_good,unit_name,is_benefit,give_integral,is_new,sort,slider_image,is_show,bar_code,postage,soure_link,code_path,cate_id,is_seckill,mer_id,ficti,store_info,is_del,is_hot,browse FROM yx_store_product WHERE (is_del = 0 AND is_show = 1 AND is_hot = 1) ORDER BY sort DESC +1571474664311|0|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| +1571474664316|1|statement|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = ?)|SELECT id,group_name,add_time,sort,value,status FROM yx_system_group_data WHERE (group_name = 'routine_home_menus') +1571474664319|1|commit|connection 2|url jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false|| diff --git a/sql/eladmin.sql b/sql/eladmin.sql new file mode 100644 index 00000000..ad7ee7d9 --- /dev/null +++ b/sql/eladmin.sql @@ -0,0 +1,683 @@ +/* + Navicat Premium Data Transfer + + Source Server : 本地 + Source Server Type : MySQL + Source Server Version : 50562 + Source Host : localhost:3306 + Source Schema : eladmin + + Target Server Type : MySQL + Target Server Version : 50562 + File Encoding : 65001 + + Date: 26/09/2019 17:41:39 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for alipay_config +-- ---------------------------- +DROP TABLE IF EXISTS `alipay_config`; +CREATE TABLE `alipay_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `app_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应用ID', + `charset` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码', + `format` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型 固定格式json', + `gateway_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '网关地址', + `notify_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '异步回调', + `private_key` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '私钥', + `public_key` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '公钥', + `return_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '回调地址', + `sign_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '签名方式', + `sys_service_provider_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商户号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of alipay_config +-- ---------------------------- +INSERT INTO `alipay_config` VALUES (1, '2016091700532697', 'utf-8', 'JSON', 'https://openapi.alipaydev.com/gateway.do', 'http://api.auauz.net/api/aliPay/notify', 'MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5js8sInU10AJ0cAQ8UMMyXrQ+oHZEkVt5lBwsStmTJ7YikVYgbskx1YYEXTojRsWCb+SH/kDmDU4pK/u91SJ4KFCRMF2411piYuXU/jF96zKrADznYh/zAraqT6hvAIVtQAlMHN53nx16rLzZ/8jDEkaSwT7+HvHiS+7sxSojnu/3oV7BtgISoUNstmSe8WpWHOaWv19xyS+Mce9MY4BfseFhzTICUymUQdd/8hXA28/H6osUfAgsnxAKv7Wil3aJSgaJczWuflYOve0dJ3InZkhw5Cvr0atwpk8YKBQjy5CdkoHqvkOcIB+cYHXJKzOE5tqU7inSwVbHzOLQ3XbnAgMBAAECggEAVJp5eT0Ixg1eYSqFs9568WdetUNCSUchNxDBu6wxAbhUgfRUGZuJnnAll63OCTGGck+EGkFh48JjRcBpGoeoHLL88QXlZZbC/iLrea6gcDIhuvfzzOffe1RcZtDFEj9hlotg8dQj1tS0gy9pN9g4+EBH7zeu+fyv+qb2e/v1l6FkISXUjpkD7RLQr3ykjiiEw9BpeKb7j5s7Kdx1NNIzhkcQKNqlk8JrTGDNInbDM6inZfwwIO2R1DHinwdfKWkvOTODTYa2MoAvVMFT9Bec9FbLpoWp7ogv1JMV9svgrcF9XLzANZ/OQvkbe9TV9GWYvIbxN6qwQioKCWO4GPnCAQKBgQDgW5MgfhX8yjXqoaUy/d1VjI8dHeIyw8d+OBAYwaxRSlCfyQ+tieWcR2HdTzPca0T0GkWcKZm0ei5xRURgxt4DUDLXNh26HG0qObbtLJdu/AuBUuCqgOiLqJ2f1uIbrz6OZUHns+bT/jGW2Ws8+C13zTCZkZt9CaQsrp3QOGDx5wKBgQDTul39hp3ZPwGNFeZdkGoUoViOSd5Lhowd5wYMGAEXWRLlU8z+smT5v0POz9JnIbCRchIY2FAPKRdVTICzmPk2EPJFxYTcwaNbVqL6lN7J2IlXXMiit5QbiLauo55w7plwV6LQmKm9KV7JsZs5XwqF7CEovI7GevFzyD3w+uizAQKBgC3LY1eRhOlpWOIAhpjG6qOoohmeXOphvdmMlfSHq6WYFqbWwmV4rS5d/6LNpNdL6fItXqIGd8I34jzql49taCmi+A2nlR/E559j0mvM20gjGDIYeZUz5MOE8k+K6/IcrhcgofgqZ2ZED1ksHdB/E8DNWCswZl16V1FrfvjeWSNnAoGAMrBplCrIW5xz+J0Hm9rZKrs+AkK5D4fUv8vxbK/KgxZ2KaUYbNm0xv39c+PZUYuFRCz1HDGdaSPDTE6WeWjkMQd5mS6ikl9hhpqFRkyh0d0fdGToO9yLftQKOGE/q3XUEktI1XvXF0xyPwNgUCnq0QkpHyGVZPtGFxwXiDvpvgECgYA5PoB+nY8iDiRaJNko9w0hL4AeKogwf+4TbCw+KWVEn6jhuJa4LFTdSqp89PktQaoVpwv92el/AhYjWOl/jVCm122f9b7GyoelbjMNolToDwe5pF5RnSpEuDdLy9MfE8LnE3PlbE7E5BipQ3UjSebkgNboLHH/lNZA5qvEtvbfvQ==', 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAut9evKRuHJ/2QNfDlLwvN/S8l9hRAgPbb0u61bm4AtzaTGsLeMtScetxTWJnVvAVpMS9luhEJjt+Sbk5TNLArsgzzwARgaTKOLMT1TvWAK5EbHyI+eSrc3s7Awe1VYGwcubRFWDm16eQLv0k7iqiw+4mweHSz/wWyvBJVgwLoQ02btVtAQErCfSJCOmt0Q/oJQjj08YNRV4EKzB19+f5A+HQVAKy72dSybTzAK+3FPtTtNen/+b5wGeat7c32dhYHnGorPkPeXLtsqqUTp1su5fMfd4lElNdZaoCI7osZxWWUo17vBCZnyeXc9fk0qwD9mK6yRAxNbrY72Xx5VqIqwIDAQAB', 'http://api.auauz.net/api/aliPay/return', 'RSA2', '2088102176044281'); + +-- ---------------------------- +-- Table structure for dept +-- ---------------------------- +DROP TABLE IF EXISTS `dept`; +CREATE TABLE `dept` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称', + `pid` bigint(20) NOT NULL COMMENT '上级部门', + `create_time` datetime NULL DEFAULT NULL, + `enabled` bit(1) NOT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of dept +-- ---------------------------- +INSERT INTO `dept` VALUES (1, 'eladmin', 0, '2019-03-25 09:14:05', b'1'); +INSERT INTO `dept` VALUES (2, '研发部', 7, '2019-03-25 09:15:32', b'1'); +INSERT INTO `dept` VALUES (5, '运维部', 7, '2019-03-25 09:20:44', b'1'); +INSERT INTO `dept` VALUES (6, '测试部', 8, '2019-03-25 09:52:18', b'1'); +INSERT INTO `dept` VALUES (7, '华南分部', 1, '2019-03-25 11:04:50', b'1'); +INSERT INTO `dept` VALUES (8, '华北分部', 1, '2019-03-25 11:04:53', b'1'); +INSERT INTO `dept` VALUES (9, '财务部', 7, '2019-03-25 11:05:34', b'1'); +INSERT INTO `dept` VALUES (10, '行政部', 8, '2019-03-25 11:05:58', b'1'); +INSERT INTO `dept` VALUES (11, '人事部', 8, '2019-03-25 11:07:58', b'1'); +INSERT INTO `dept` VALUES (12, '市场部', 7, '2019-03-25 11:10:24', b'0'); + +-- ---------------------------- +-- Table structure for dict +-- ---------------------------- +DROP TABLE IF EXISTS `dict`; +CREATE TABLE `dict` ( + `id` bigint(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典名称', + `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of dict +-- ---------------------------- +INSERT INTO `dict` VALUES (1, 'user_status', '用户状态'); +INSERT INTO `dict` VALUES (4, 'dept_status', '部门状态'); +INSERT INTO `dict` VALUES (5, 'job_status', '岗位状态'); + +-- ---------------------------- +-- Table structure for dict_detail +-- ---------------------------- +DROP TABLE IF EXISTS `dict_detail`; +CREATE TABLE `dict_detail` ( + `id` bigint(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典标签', + `value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典值', + `sort` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '排序', + `dict_id` bigint(11) NULL DEFAULT NULL COMMENT '字典id', + PRIMARY KEY (`id`) USING BTREE, + INDEX `FK5tpkputc6d9nboxojdbgnpmyb`(`dict_id`) USING BTREE, + CONSTRAINT `FK5tpkputc6d9nboxojdbgnpmyb` FOREIGN KEY (`dict_id`) REFERENCES `dict` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of dict_detail +-- ---------------------------- +INSERT INTO `dict_detail` VALUES (1, '激活', 'true', '1', 1); +INSERT INTO `dict_detail` VALUES (2, '锁定', 'false', '2', 1); +INSERT INTO `dict_detail` VALUES (11, '正常', 'true', '1', 4); +INSERT INTO `dict_detail` VALUES (12, '停用', 'false', '2', 4); +INSERT INTO `dict_detail` VALUES (13, '正常', 'true', '1', 5); +INSERT INTO `dict_detail` VALUES (14, '停用', 'false', '2', 5); + +-- ---------------------------- +-- Table structure for email_config +-- ---------------------------- +DROP TABLE IF EXISTS `email_config`; +CREATE TABLE `email_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `from_user` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收件人', + `host` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮件服务器SMTP地址', + `pass` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码', + `port` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '端口', + `user` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发件者用户名', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for gen_config +-- ---------------------------- +DROP TABLE IF EXISTS `gen_config`; +CREATE TABLE `gen_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `author` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '作者', + `cover` bit(1) NULL DEFAULT NULL COMMENT '是否覆盖', + `module_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模块名称', + `pack` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '至于哪个包下', + `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '前端代码生成的路径', + `api_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `prefix` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of gen_config +-- ---------------------------- +INSERT INTO `gen_config` VALUES (1, 'Zheng Jie', b'0', 'eladmin-system', 'co.yixiang.test', 'E:\\workspace\\me\\front\\eladmin-qt\\src\\views\\test1111', 'E:\\workspace\\me\\front\\eladmin-qt\\src\\api', NULL); + +-- ---------------------------- +-- Table structure for job +-- ---------------------------- +DROP TABLE IF EXISTS `job`; +CREATE TABLE `job` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `enabled` bit(1) NOT NULL, + `create_time` datetime NULL DEFAULT NULL, + `sort` bigint(20) NOT NULL, + `dept_id` bigint(20) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `FKmvhj0rogastlctflsxf1d6k3i`(`dept_id`) USING BTREE, + CONSTRAINT `FKmvhj0rogastlctflsxf1d6k3i` FOREIGN KEY (`dept_id`) REFERENCES `dept` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of job +-- ---------------------------- +INSERT INTO `job` VALUES (2, '董事长秘书', b'1', '2019-03-29 14:01:30', 2, 1); +INSERT INTO `job` VALUES (8, '人事专员', b'1', '2019-03-29 14:52:28', 3, 11); +INSERT INTO `job` VALUES (10, '产品经理', b'0', '2019-03-29 14:55:51', 4, 2); +INSERT INTO `job` VALUES (11, '全栈开发', b'1', '2019-03-31 13:39:30', 6, 2); +INSERT INTO `job` VALUES (12, '软件测试', b'1', '2019-03-31 13:39:43', 5, 2); +INSERT INTO `job` VALUES (19, '董事长', b'1', '2019-03-31 14:58:15', 1, 1); + +-- ---------------------------- +-- Table structure for local_storage +-- ---------------------------- +DROP TABLE IF EXISTS `local_storage`; +CREATE TABLE `local_storage` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `real_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名', + `suffix` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '后缀', + `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路径', + `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型', + `size` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '大小', + `operate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改日期', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for log +-- ---------------------------- +DROP TABLE IF EXISTS `log`; +CREATE TABLE `log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `create_time` datetime NULL DEFAULT NULL, + `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `exception_detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `log_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `method` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `params` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `request_ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `time` bigint(20) NULL DEFAULT NULL, + `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 14269 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for menu +-- ---------------------------- +DROP TABLE IF EXISTS `menu`; +CREATE TABLE `menu` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `i_frame` bit(1) NULL DEFAULT NULL COMMENT '是否外链', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称', + `component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件', + `pid` bigint(20) NOT NULL COMMENT '上级菜单ID', + `sort` bigint(20) NOT NULL COMMENT '排序', + `icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标', + `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接地址', + `cache` bit(1) NULL DEFAULT b'0', + `hidden` bit(1) NULL DEFAULT b'0', + `component_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '-', + PRIMARY KEY (`id`) USING BTREE, + INDEX `FKqcf9gem97gqa5qjm4d3elcqt5`(`pid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of menu +-- ---------------------------- +INSERT INTO `menu` VALUES (1, '2018-12-18 15:11:29', b'0', '系统管理', NULL, 0, 1, 'system', 'system', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (2, '2018-12-18 15:14:44', b'0', '用户管理', 'system/user/index', 1, 2, 'peoples', 'user', b'0', b'0', 'User'); +INSERT INTO `menu` VALUES (3, '2018-12-18 15:16:07', b'0', '角色管理', 'system/role/index', 1, 3, 'role', 'role', b'0', b'0', 'Role'); +INSERT INTO `menu` VALUES (4, '2018-12-18 15:16:45', b'0', '权限管理', 'system/permission/index', 1, 4, 'permission', 'permission', b'0', b'0', 'Permission'); +INSERT INTO `menu` VALUES (5, '2018-12-18 15:17:28', b'0', '菜单管理', 'system/menu/index', 1, 5, 'menu', 'menu', b'0', b'0', 'Menu'); +INSERT INTO `menu` VALUES (6, '2018-12-18 15:17:48', b'0', '系统监控', NULL, 0, 10, 'monitor', 'monitor', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (7, '2018-12-18 15:18:26', b'0', '操作日志', 'monitor/log/index', 6, 11, 'log', 'logs', b'1', b'0', 'Log'); +INSERT INTO `menu` VALUES (8, '2018-12-18 15:19:01', b'0', '系统缓存', 'monitor/redis/index', 6, 13, 'redis', 'redis', b'0', b'0', 'Redis'); +INSERT INTO `menu` VALUES (9, '2018-12-18 15:19:34', b'0', 'SQL监控', 'monitor/sql/index', 6, 14, 'sqlMonitor', 'druid', b'0', b'0', 'Sql'); +INSERT INTO `menu` VALUES (10, '2018-12-19 13:38:16', b'0', '组件管理', NULL, 0, 50, 'zujian', 'components', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (11, '2018-12-19 13:38:49', b'0', '图标库', 'components/IconSelect', 10, 51, 'icon', 'icon', b'0', b'0', 'Icons'); +INSERT INTO `menu` VALUES (14, '2018-12-27 10:13:09', b'0', '邮件工具', 'tools/email/index', 36, 24, 'email', 'email', b'0', b'0', 'Email'); +INSERT INTO `menu` VALUES (15, '2018-12-27 11:58:25', b'0', '富文本', 'components/Editor', 10, 52, 'fwb', 'tinymce', b'0', b'0', 'Editor'); +INSERT INTO `menu` VALUES (16, '2018-12-28 09:36:53', b'0', '图床管理', 'tools/picture/index', 36, 25, 'image', 'pictures', b'0', b'0', 'Pictures'); +INSERT INTO `menu` VALUES (17, '2018-12-28 15:09:49', b'1', '项目地址', '', 0, 0, 'github', 'https://github.com/elunez/eladmin', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (18, '2018-12-31 11:12:15', b'0', '存储管理', 'tools/storage/index', 36, 23, 'qiniu', 'storage', b'0', b'0', 'Storage'); +INSERT INTO `menu` VALUES (19, '2018-12-31 14:52:38', b'0', '支付宝工具', 'tools/aliPay/index', 36, 27, 'alipay', 'aliPay', b'0', b'0', 'AliPay'); +INSERT INTO `menu` VALUES (21, '2019-01-04 16:22:03', b'0', '多级菜单', '', 0, 900, 'menu', 'nested', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (22, '2019-01-04 16:23:29', b'0', '二级菜单1', 'nested/menu1/index', 21, 999, 'menu', 'menu1', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (23, '2019-01-04 16:23:57', b'0', '二级菜单2', 'nested/menu2/index', 21, 999, 'menu', 'menu2', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (24, '2019-01-04 16:24:48', b'0', '三级菜单1', 'nested/menu1/menu1-1', 22, 999, 'menu', 'menu1-1', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (27, '2019-01-07 17:27:32', b'0', '三级菜单2', 'nested/menu1/menu1-2', 22, 999, 'menu', 'menu1-2', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (28, '2019-01-07 20:34:40', b'0', '定时任务', 'system/timing/index', 36, 21, 'timing', 'timing', b'0', b'0', 'Timing'); +INSERT INTO `menu` VALUES (30, '2019-01-11 15:45:55', b'0', '代码生成', 'generator/index', 36, 22, 'dev', 'generator', b'0', b'0', 'GeneratorIndex'); +INSERT INTO `menu` VALUES (32, '2019-01-13 13:49:03', b'0', '异常日志', 'monitor/log/errorLog', 6, 12, 'error', 'errorLog', b'0', b'0', 'ErrorLog'); +INSERT INTO `menu` VALUES (33, '2019-03-08 13:46:44', b'0', 'Markdown', 'components/MarkDown', 10, 53, 'markdown', 'markdown', b'0', b'0', 'Markdown'); +INSERT INTO `menu` VALUES (34, '2019-03-08 15:49:40', b'0', 'Yaml编辑器', 'components/YamlEdit', 10, 54, 'dev', 'yaml', b'0', b'0', 'YamlEdit'); +INSERT INTO `menu` VALUES (35, '2019-03-25 09:46:00', b'0', '部门管理', 'system/dept/index', 1, 6, 'dept', 'dept', b'0', b'0', 'Dept'); +INSERT INTO `menu` VALUES (36, '2019-03-29 10:57:35', b'0', '系统工具', '', 0, 20, 'sys-tools', 'sys-tools', b'0', b'0', NULL); +INSERT INTO `menu` VALUES (37, '2019-03-29 13:51:18', b'0', '岗位管理', 'system/job/index', 1, 7, 'Steve-Jobs', 'job', b'0', b'0', 'Job'); +INSERT INTO `menu` VALUES (38, '2019-03-29 19:57:53', b'0', '接口文档', 'tools/swagger/index', 36, 26, 'swagger', 'swagger2', b'0', b'0', 'Swagger'); +INSERT INTO `menu` VALUES (39, '2019-04-10 11:49:04', b'0', '字典管理', 'system/dict/index', 1, 8, 'dictionary', 'dict', b'0', b'0', 'Dict'); + +-- ---------------------------- +-- Table structure for permission +-- ---------------------------- +DROP TABLE IF EXISTS `permission`; +CREATE TABLE `permission` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `alias` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '别名', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', + `pid` int(11) NOT NULL COMMENT '上级权限', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 60 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of permission +-- ---------------------------- +INSERT INTO `permission` VALUES (1, '超级管理员', '2018-12-03 12:27:48', 'ADMIN', 0); +INSERT INTO `permission` VALUES (2, '用户管理', '2018-12-03 12:28:19', 'USER_ALL', 0); +INSERT INTO `permission` VALUES (3, '用户查询', '2018-12-03 12:31:35', 'USER_SELECT', 2); +INSERT INTO `permission` VALUES (4, '用户创建', '2018-12-03 12:31:35', 'USER_CREATE', 2); +INSERT INTO `permission` VALUES (5, '用户编辑', '2018-12-03 12:31:35', 'USER_EDIT', 2); +INSERT INTO `permission` VALUES (6, '用户删除', '2018-12-03 12:31:35', 'USER_DELETE', 2); +INSERT INTO `permission` VALUES (7, '角色管理', '2018-12-03 12:28:19', 'ROLES_ALL', 0); +INSERT INTO `permission` VALUES (8, '角色查询', '2018-12-03 12:31:35', 'ROLES_SELECT', 7); +INSERT INTO `permission` VALUES (10, '角色创建', '2018-12-09 20:10:16', 'ROLES_CREATE', 7); +INSERT INTO `permission` VALUES (11, '角色编辑', '2018-12-09 20:10:42', 'ROLES_EDIT', 7); +INSERT INTO `permission` VALUES (12, '角色删除', '2018-12-09 20:11:07', 'ROLES_DELETE', 7); +INSERT INTO `permission` VALUES (13, '权限管理', '2018-12-09 20:11:37', 'PERMISSION_ALL', 0); +INSERT INTO `permission` VALUES (14, '权限查询', '2018-12-09 20:11:55', 'PERMISSION_SELECT', 13); +INSERT INTO `permission` VALUES (15, '权限创建', '2018-12-09 20:14:10', 'PERMISSION_CREATE', 13); +INSERT INTO `permission` VALUES (16, '权限编辑', '2018-12-09 20:15:44', 'PERMISSION_EDIT', 13); +INSERT INTO `permission` VALUES (17, '权限删除', '2018-12-09 20:15:59', 'PERMISSION_DELETE', 13); +INSERT INTO `permission` VALUES (18, '缓存管理', '2018-12-17 13:53:25', 'REDIS_ALL', 0); +INSERT INTO `permission` VALUES (20, '缓存查询', '2018-12-17 13:54:07', 'REDIS_SELECT', 18); +INSERT INTO `permission` VALUES (22, '缓存删除', '2018-12-17 13:55:04', 'REDIS_DELETE', 18); +INSERT INTO `permission` VALUES (23, '图床管理', '2018-12-27 20:31:49', 'PICTURE_ALL', 0); +INSERT INTO `permission` VALUES (24, '查询图片', '2018-12-27 20:32:04', 'PICTURE_SELECT', 23); +INSERT INTO `permission` VALUES (25, '上传图片', '2018-12-27 20:32:24', 'PICTURE_UPLOAD', 23); +INSERT INTO `permission` VALUES (26, '删除图片', '2018-12-27 20:32:45', 'PICTURE_DELETE', 23); +INSERT INTO `permission` VALUES (29, '菜单管理', '2018-12-28 17:34:31', 'MENU_ALL', 0); +INSERT INTO `permission` VALUES (30, '菜单查询', '2018-12-28 17:34:41', 'MENU_SELECT', 29); +INSERT INTO `permission` VALUES (31, '菜单创建', '2018-12-28 17:34:52', 'MENU_CREATE', 29); +INSERT INTO `permission` VALUES (32, '菜单编辑', '2018-12-28 17:35:20', 'MENU_EDIT', 29); +INSERT INTO `permission` VALUES (33, '菜单删除', '2018-12-28 17:35:29', 'MENU_DELETE', 29); +INSERT INTO `permission` VALUES (35, '定时任务管理', '2019-01-08 14:59:57', 'JOB_ALL', 0); +INSERT INTO `permission` VALUES (36, '任务查询', '2019-01-08 15:00:09', 'JOB_SELECT', 35); +INSERT INTO `permission` VALUES (37, '任务创建', '2019-01-08 15:00:20', 'JOB_CREATE', 35); +INSERT INTO `permission` VALUES (38, '任务编辑', '2019-01-08 15:00:33', 'JOB_EDIT', 35); +INSERT INTO `permission` VALUES (39, '任务删除', '2019-01-08 15:01:13', 'JOB_DELETE', 35); +INSERT INTO `permission` VALUES (40, '部门管理', '2019-03-29 17:06:55', 'DEPT_ALL', 0); +INSERT INTO `permission` VALUES (41, '部门查询', '2019-03-29 17:07:09', 'DEPT_SELECT', 40); +INSERT INTO `permission` VALUES (42, '部门创建', '2019-03-29 17:07:29', 'DEPT_CREATE', 40); +INSERT INTO `permission` VALUES (43, '部门编辑', '2019-03-29 17:07:52', 'DEPT_EDIT', 40); +INSERT INTO `permission` VALUES (44, '部门删除', '2019-03-29 17:08:14', 'DEPT_DELETE', 40); +INSERT INTO `permission` VALUES (45, '岗位管理', '2019-03-29 17:08:52', 'USERJOB_ALL', 0); +INSERT INTO `permission` VALUES (46, '岗位查询', '2019-03-29 17:10:27', 'USERJOB_SELECT', 45); +INSERT INTO `permission` VALUES (47, '岗位创建', '2019-03-29 17:10:55', 'USERJOB_CREATE', 45); +INSERT INTO `permission` VALUES (48, '岗位编辑', '2019-03-29 17:11:08', 'USERJOB_EDIT', 45); +INSERT INTO `permission` VALUES (49, '岗位删除', '2019-03-29 17:11:19', 'USERJOB_DELETE', 45); +INSERT INTO `permission` VALUES (50, '字典管理', '2019-04-10 16:24:51', 'DICT_ALL', 0); +INSERT INTO `permission` VALUES (51, '字典查询', '2019-04-10 16:25:16', 'DICT_SELECT', 50); +INSERT INTO `permission` VALUES (52, '字典创建', '2019-04-10 16:25:29', 'DICT_CREATE', 50); +INSERT INTO `permission` VALUES (53, '字典编辑', '2019-04-10 16:27:19', 'DICT_EDIT', 50); +INSERT INTO `permission` VALUES (54, '字典删除', '2019-04-10 16:27:30', 'DICT_DELETE', 50); +INSERT INTO `permission` VALUES (55, '文件管理', '2019-09-08 12:31:54', 'LOCALSTORAGE_ALL', 0); +INSERT INTO `permission` VALUES (56, '文件搜索', '2019-09-08 12:40:53', 'LOCALSTORAGE_SELECT', 55); +INSERT INTO `permission` VALUES (57, '文件上传', '2019-09-08 12:41:05', 'LOCALSTORAGE_CREATE', 55); +INSERT INTO `permission` VALUES (58, '文件编辑', '2019-09-08 12:41:19', 'LOCALSTORAGE_EDIT', 55); +INSERT INTO `permission` VALUES (59, '文件删除', '2019-09-08 12:41:29', 'LOCALSTORAGE_DELETE', 55); + +-- ---------------------------- +-- Table structure for picture +-- ---------------------------- +DROP TABLE IF EXISTS `picture`; +CREATE TABLE `picture` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `create_time` datetime NULL DEFAULT NULL COMMENT '上传日期', + `delete_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '删除的URL', + `filename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片名称', + `height` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片高度', + `size` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片大小', + `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片地址', + `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名称', + `width` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片宽度', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for qiniu_config +-- ---------------------------- +DROP TABLE IF EXISTS `qiniu_config`; +CREATE TABLE `qiniu_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `access_key` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'accessKey', + `bucket` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Bucket 识别符', + `host` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '外链域名', + `secret_key` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'secretKey', + `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '空间类型', + `zone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机房', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for qiniu_content +-- ---------------------------- +DROP TABLE IF EXISTS `qiniu_content`; +CREATE TABLE `qiniu_content` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `bucket` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Bucket 识别符', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称', + `size` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件大小', + `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件类型:私有或公开', + `update_time` datetime NULL DEFAULT NULL COMMENT '上传或同步的时间', + `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件url', + `suffix` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for quartz_job +-- ---------------------------- +DROP TABLE IF EXISTS `quartz_job`; +CREATE TABLE `quartz_job` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `bean_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Spring Bean名称', + `cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'cron 表达式', + `is_pause` bit(1) NULL DEFAULT NULL COMMENT '状态:1暂停、0启用', + `job_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务名称', + `method_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '方法名称', + `params` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数', + `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `update_time` datetime NULL DEFAULT NULL COMMENT '创建或更新日期', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of quartz_job +-- ---------------------------- +INSERT INTO `quartz_job` VALUES (1, 'visitsTask', '0 0 0 * * ?', b'0', '更新访客记录', 'run', NULL, '每日0点创建新的访客记录', '2019-01-08 14:53:31'); +INSERT INTO `quartz_job` VALUES (2, 'testTask', '0/5 * * * * ?', b'1', '测试1', 'run1', 'test', '带参测试,多参使用json', '2019-08-22 14:08:29'); +INSERT INTO `quartz_job` VALUES (3, 'testTask', '0/5 * * * * ?', b'1', '测试', 'run', '', '不带参测试', '2019-09-26 16:44:39'); + +-- ---------------------------- +-- Table structure for quartz_log +-- ---------------------------- +DROP TABLE IF EXISTS `quartz_log`; +CREATE TABLE `quartz_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `baen_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `create_time` datetime NULL DEFAULT NULL, + `cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `exception_detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `is_success` bit(1) NULL DEFAULT NULL, + `job_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `method_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `params` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `time` bigint(20) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 51 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for role +-- ---------------------------- +DROP TABLE IF EXISTS `role`; +CREATE TABLE `role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称', + `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `data_scope` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `level` int(255) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of role +-- ---------------------------- +INSERT INTO `role` VALUES (1, '2018-11-23 11:04:37', '超级管理员', '·', '全部', 1); +INSERT INTO `role` VALUES (2, '2018-11-23 13:09:06', '普通用户', '用于测试菜单与权限', '自定义', 3); +INSERT INTO `role` VALUES (4, '2019-05-13 14:16:15', '普通管理员', '普通管理员级别为2,使用该角色新增用户时只能赋予比普通管理员级别低的角色', '自定义', 2); + +-- ---------------------------- +-- Table structure for roles_depts +-- ---------------------------- +DROP TABLE IF EXISTS `roles_depts`; +CREATE TABLE `roles_depts` ( + `role_id` bigint(20) NOT NULL, + `dept_id` bigint(20) NOT NULL, + PRIMARY KEY (`role_id`, `dept_id`) USING BTREE, + INDEX `FK7qg6itn5ajdoa9h9o78v9ksur`(`dept_id`) USING BTREE, + CONSTRAINT `FK7qg6itn5ajdoa9h9o78v9ksur` FOREIGN KEY (`dept_id`) REFERENCES `dept` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `FKrg1ci4cxxfbja0sb0pddju7k` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of roles_depts +-- ---------------------------- +INSERT INTO `roles_depts` VALUES (2, 5); +INSERT INTO `roles_depts` VALUES (4, 6); +INSERT INTO `roles_depts` VALUES (4, 7); +INSERT INTO `roles_depts` VALUES (2, 8); +INSERT INTO `roles_depts` VALUES (2, 9); + +-- ---------------------------- +-- Table structure for roles_menus +-- ---------------------------- +DROP TABLE IF EXISTS `roles_menus`; +CREATE TABLE `roles_menus` ( + `menu_id` bigint(20) NOT NULL COMMENT '菜单ID', + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + PRIMARY KEY (`menu_id`, `role_id`) USING BTREE, + INDEX `FKcngg2qadojhi3a651a5adkvbq`(`role_id`) USING BTREE, + CONSTRAINT `FKo7wsmlrrxb2osfaoavp46rv2r` FOREIGN KEY (`menu_id`) REFERENCES `menu` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `FKtag324maketmxffly3pdyh193` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of roles_menus +-- ---------------------------- +INSERT INTO `roles_menus` VALUES (1, 1); +INSERT INTO `roles_menus` VALUES (2, 1); +INSERT INTO `roles_menus` VALUES (3, 1); +INSERT INTO `roles_menus` VALUES (4, 1); +INSERT INTO `roles_menus` VALUES (5, 1); +INSERT INTO `roles_menus` VALUES (6, 1); +INSERT INTO `roles_menus` VALUES (7, 1); +INSERT INTO `roles_menus` VALUES (8, 1); +INSERT INTO `roles_menus` VALUES (9, 1); +INSERT INTO `roles_menus` VALUES (10, 1); +INSERT INTO `roles_menus` VALUES (11, 1); +INSERT INTO `roles_menus` VALUES (14, 1); +INSERT INTO `roles_menus` VALUES (15, 1); +INSERT INTO `roles_menus` VALUES (16, 1); +INSERT INTO `roles_menus` VALUES (17, 1); +INSERT INTO `roles_menus` VALUES (18, 1); +INSERT INTO `roles_menus` VALUES (19, 1); +INSERT INTO `roles_menus` VALUES (21, 1); +INSERT INTO `roles_menus` VALUES (22, 1); +INSERT INTO `roles_menus` VALUES (23, 1); +INSERT INTO `roles_menus` VALUES (24, 1); +INSERT INTO `roles_menus` VALUES (27, 1); +INSERT INTO `roles_menus` VALUES (28, 1); +INSERT INTO `roles_menus` VALUES (30, 1); +INSERT INTO `roles_menus` VALUES (32, 1); +INSERT INTO `roles_menus` VALUES (33, 1); +INSERT INTO `roles_menus` VALUES (34, 1); +INSERT INTO `roles_menus` VALUES (35, 1); +INSERT INTO `roles_menus` VALUES (36, 1); +INSERT INTO `roles_menus` VALUES (37, 1); +INSERT INTO `roles_menus` VALUES (38, 1); +INSERT INTO `roles_menus` VALUES (39, 1); +INSERT INTO `roles_menus` VALUES (1, 2); +INSERT INTO `roles_menus` VALUES (2, 2); +INSERT INTO `roles_menus` VALUES (3, 2); +INSERT INTO `roles_menus` VALUES (4, 2); +INSERT INTO `roles_menus` VALUES (5, 2); +INSERT INTO `roles_menus` VALUES (6, 2); +INSERT INTO `roles_menus` VALUES (8, 2); +INSERT INTO `roles_menus` VALUES (9, 2); +INSERT INTO `roles_menus` VALUES (10, 2); +INSERT INTO `roles_menus` VALUES (11, 2); +INSERT INTO `roles_menus` VALUES (14, 2); +INSERT INTO `roles_menus` VALUES (15, 2); +INSERT INTO `roles_menus` VALUES (16, 2); +INSERT INTO `roles_menus` VALUES (17, 2); +INSERT INTO `roles_menus` VALUES (18, 2); +INSERT INTO `roles_menus` VALUES (19, 2); +INSERT INTO `roles_menus` VALUES (21, 2); +INSERT INTO `roles_menus` VALUES (22, 2); +INSERT INTO `roles_menus` VALUES (23, 2); +INSERT INTO `roles_menus` VALUES (24, 2); +INSERT INTO `roles_menus` VALUES (27, 2); +INSERT INTO `roles_menus` VALUES (28, 2); +INSERT INTO `roles_menus` VALUES (30, 2); +INSERT INTO `roles_menus` VALUES (33, 2); +INSERT INTO `roles_menus` VALUES (34, 2); +INSERT INTO `roles_menus` VALUES (35, 2); +INSERT INTO `roles_menus` VALUES (36, 2); +INSERT INTO `roles_menus` VALUES (37, 2); +INSERT INTO `roles_menus` VALUES (38, 2); +INSERT INTO `roles_menus` VALUES (39, 2); +INSERT INTO `roles_menus` VALUES (1, 4); +INSERT INTO `roles_menus` VALUES (2, 4); + +-- ---------------------------- +-- Table structure for roles_permissions +-- ---------------------------- +DROP TABLE IF EXISTS `roles_permissions`; +CREATE TABLE `roles_permissions` ( + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + `permission_id` bigint(20) NOT NULL COMMENT '权限ID', + PRIMARY KEY (`role_id`, `permission_id`) USING BTREE, + INDEX `FKboeuhl31go7wer3bpy6so7exi`(`permission_id`) USING BTREE, + CONSTRAINT `FK4hrolwj4ned5i7qe8kyiaak6m` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `FKboeuhl31go7wer3bpy6so7exi` FOREIGN KEY (`permission_id`) REFERENCES `permission` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of roles_permissions +-- ---------------------------- +INSERT INTO `roles_permissions` VALUES (1, 1); +INSERT INTO `roles_permissions` VALUES (2, 3); +INSERT INTO `roles_permissions` VALUES (4, 3); +INSERT INTO `roles_permissions` VALUES (4, 4); +INSERT INTO `roles_permissions` VALUES (4, 5); +INSERT INTO `roles_permissions` VALUES (2, 8); +INSERT INTO `roles_permissions` VALUES (2, 14); +INSERT INTO `roles_permissions` VALUES (2, 20); +INSERT INTO `roles_permissions` VALUES (2, 23); +INSERT INTO `roles_permissions` VALUES (2, 24); +INSERT INTO `roles_permissions` VALUES (2, 25); +INSERT INTO `roles_permissions` VALUES (2, 26); +INSERT INTO `roles_permissions` VALUES (2, 30); +INSERT INTO `roles_permissions` VALUES (2, 36); +INSERT INTO `roles_permissions` VALUES (2, 41); +INSERT INTO `roles_permissions` VALUES (2, 46); +INSERT INTO `roles_permissions` VALUES (2, 51); + +-- ---------------------------- +-- Table structure for user +-- ---------------------------- +DROP TABLE IF EXISTS `user`; +CREATE TABLE `user` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `avatar_id` bigint(20) NULL DEFAULT NULL COMMENT '头像', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱', + `enabled` bigint(20) NULL DEFAULT NULL COMMENT '状态:1启用、0禁用', + `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码', + `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名', + `last_password_reset_time` datetime NULL DEFAULT NULL COMMENT '最后修改密码的日期', + `dept_id` bigint(20) NULL DEFAULT NULL, + `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `job_id` bigint(20) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `UK_kpubos9gc2cvtkb0thktkbkes`(`email`) USING BTREE, + UNIQUE INDEX `username`(`username`) USING BTREE, + INDEX `FK5rwmryny6jthaaxkogownknqp`(`dept_id`) USING BTREE, + INDEX `FKfftoc2abhot8f2wu6cl9a5iky`(`job_id`) USING BTREE, + INDEX `FKpq2dhypk2qgt68nauh2by22jb`(`avatar_id`) USING BTREE, + CONSTRAINT `FK5rwmryny6jthaaxkogownknqp` FOREIGN KEY (`dept_id`) REFERENCES `dept` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `FKfftoc2abhot8f2wu6cl9a5iky` FOREIGN KEY (`job_id`) REFERENCES `job` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `FKpq2dhypk2qgt68nauh2by22jb` FOREIGN KEY (`avatar_id`) REFERENCES `user_avatar` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of user +-- ---------------------------- +INSERT INTO `user` VALUES (1, NULL, '2018-08-23 09:11:56', 'admin@eladmin.net', 1, 'e10adc3949ba59abbe56e057f20f883e', 'admin', '2019-05-18 17:34:21', 2, '18888888888', 11); +INSERT INTO `user` VALUES (3, NULL, '2018-12-27 20:05:26', 'test@eladmin.net', 1, 'e10adc3949ba59abbe56e057f20f883e', 'test', '2019-04-01 09:15:24', 2, '17777777777', 12); +INSERT INTO `user` VALUES (5, NULL, '2019-04-02 10:07:12', 'hr@eladmin.net', 1, 'e10adc3949ba59abbe56e057f20f883e', 'hr', NULL, 11, '15555555555', 8); + +-- ---------------------------- +-- Table structure for user_avatar +-- ---------------------------- +DROP TABLE IF EXISTS `user_avatar`; +CREATE TABLE `user_avatar` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `real_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `size` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for users_roles +-- ---------------------------- +DROP TABLE IF EXISTS `users_roles`; +CREATE TABLE `users_roles` ( + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + PRIMARY KEY (`user_id`, `role_id`) USING BTREE, + INDEX `FKq4eq273l04bpu4efj0jd0jb98`(`role_id`) USING BTREE, + CONSTRAINT `FKgd3iendaoyh04b95ykqise6qh` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `FKt4v0rrweyk393bdgt107vdx0x` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of users_roles +-- ---------------------------- +INSERT INTO `users_roles` VALUES (1, 1); +INSERT INTO `users_roles` VALUES (3, 2); +INSERT INTO `users_roles` VALUES (5, 4); + +-- ---------------------------- +-- Table structure for verification_code +-- ---------------------------- +DROP TABLE IF EXISTS `verification_code`; +CREATE TABLE `verification_code` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验证码', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `status` bit(1) NULL DEFAULT NULL COMMENT '状态:1有效、0过期', + `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '验证码类型:email或者短信', + `value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '接收邮箱或者手机号码', + `scenes` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务名称:如重置邮箱、重置密码等', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for visits +-- ---------------------------- +DROP TABLE IF EXISTS `visits`; +CREATE TABLE `visits` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `create_time` datetime NULL DEFAULT NULL, + `date` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ip_counts` bigint(20) NULL DEFAULT NULL, + `pv_counts` bigint(20) NULL DEFAULT NULL, + `week_day` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `UK_11aksgq87euk9bcyeesfs4vtp`(`date`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 96 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/sql/yixiang3.sql b/sql/yixiang3.sql new file mode 100644 index 00000000..b2c29789 --- /dev/null +++ b/sql/yixiang3.sql @@ -0,0 +1,3905 @@ +/* + Navicat Premium Data Transfer + + Source Server : localhost + Source Server Type : MySQL + Source Server Version : 50723 + Source Host : localhost:3306 + Source Schema : yixiang3 + + Target Server Type : MySQL + Target Server Version : 50723 + File Encoding : 65001 + + Date: 01/10/2019 16:45:46 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for yx_article +-- ---------------------------- +DROP TABLE IF EXISTS `yx_article`; +CREATE TABLE `yx_article` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '文章管理ID', + `cid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '分类id', + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章标题', + `author` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章作者', + `image_input` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章图片', + `synopsis` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章简介', + `share_title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章分享标题', + `share_synopsis` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章分享简介', + `visit` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '浏览次数', + `sort` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序', + `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原文链接', + `status` tinyint(1) UNSIGNED NOT NULL COMMENT '状态', + `add_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '添加时间', + `hide` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否隐藏', + `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '管理员id', + `mer_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '商户id', + `product_id` int(10) NOT NULL DEFAULT 0 COMMENT '产品关联id', + `is_hot` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否热门(小程序)', + `is_banner` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否轮播图(小程序)', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章管理表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_article_category +-- ---------------------------- +DROP TABLE IF EXISTS `yx_article_category`; +CREATE TABLE `yx_article_category` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '文章分类id', + `pid` int(11) NOT NULL DEFAULT 0 COMMENT '父级ID', + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章分类标题', + `intr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章分类简介', + `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章分类图片', + `status` tinyint(1) UNSIGNED NOT NULL COMMENT '状态', + `sort` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1删除0未删除', + `add_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '添加时间', + `hidden` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否隐藏', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章分类表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_article_content +-- ---------------------------- +DROP TABLE IF EXISTS `yx_article_content`; +CREATE TABLE `yx_article_content` ( + `nid` int(10) UNSIGNED NOT NULL COMMENT '文章id', + `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章内容', + UNIQUE INDEX `nid`(`nid`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章内容表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_cache +-- ---------------------------- +DROP TABLE IF EXISTS `yx_cache`; +CREATE TABLE `yx_cache` ( + `key` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `result` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '缓存数据', + `add_time` int(10) NULL DEFAULT NULL COMMENT '缓存时间', + PRIMARY KEY (`key`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信缓存表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_express +-- ---------------------------- +DROP TABLE IF EXISTS `yx_express`; +CREATE TABLE `yx_express` ( + `id` mediumint(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '快递公司id', + `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '快递公司简称', + `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '快递公司全称', + `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序', + `is_show` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `code`(`code`) USING BTREE, + INDEX `is_show`(`is_show`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 426 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '快递公司表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_express +-- ---------------------------- +INSERT INTO `yx_express` VALUES (1, 'LIMINWL', '利民物流', 1, 0); +INSERT INTO `yx_express` VALUES (2, 'XINTIAN', '鑫天顺物流', 1, 0); +INSERT INTO `yx_express` VALUES (3, 'henglu', '恒路物流', 1, 0); +INSERT INTO `yx_express` VALUES (4, 'klwl', '康力物流', 1, 0); +INSERT INTO `yx_express` VALUES (5, 'meiguo', '美国快递', 1, 0); +INSERT INTO `yx_express` VALUES (6, 'a2u', 'A2U速递', 1, 0); +INSERT INTO `yx_express` VALUES (7, 'benteng', '奔腾物流', 1, 0); +INSERT INTO `yx_express` VALUES (8, 'ahdf', '德方物流', 1, 0); +INSERT INTO `yx_express` VALUES (9, 'timedg', '万家通', 1, 0); +INSERT INTO `yx_express` VALUES (10, 'ztong', '智通物流', 1, 0); +INSERT INTO `yx_express` VALUES (11, 'xindan', '新蛋物流', 1, 0); +INSERT INTO `yx_express` VALUES (12, 'bgpyghx', '挂号信', 1, 0); +INSERT INTO `yx_express` VALUES (13, 'XFHONG', '鑫飞鸿物流快递', 1, 0); +INSERT INTO `yx_express` VALUES (14, 'ALP', '阿里物流', 1, 0); +INSERT INTO `yx_express` VALUES (15, 'BFWL', '滨发物流', 1, 0); +INSERT INTO `yx_express` VALUES (16, 'SJWL', '宋军物流', 1, 0); +INSERT INTO `yx_express` VALUES (17, 'SHUNFAWL', '顺发物流', 1, 0); +INSERT INTO `yx_express` VALUES (18, 'TIANHEWL', '天河物流', 1, 0); +INSERT INTO `yx_express` VALUES (19, 'YBWL', '邮联物流', 1, 0); +INSERT INTO `yx_express` VALUES (20, 'SWHY', '盛旺货运', 1, 0); +INSERT INTO `yx_express` VALUES (21, 'TSWL', '汤氏物流', 1, 0); +INSERT INTO `yx_express` VALUES (22, 'YUANYUANWL', '圆圆物流', 1, 0); +INSERT INTO `yx_express` VALUES (23, 'BALIANGWL', '八梁物流', 1, 0); +INSERT INTO `yx_express` VALUES (24, 'ZGWL', '振刚物流', 1, 0); +INSERT INTO `yx_express` VALUES (25, 'JIAYU', '佳宇物流', 1, 0); +INSERT INTO `yx_express` VALUES (26, 'SHHX', '昊昕物流', 1, 0); +INSERT INTO `yx_express` VALUES (27, 'ande', '安得物流', 1, 0); +INSERT INTO `yx_express` VALUES (28, 'ppbyb', '贝邮宝', 1, 0); +INSERT INTO `yx_express` VALUES (29, 'dida', '递达快递', 1, 0); +INSERT INTO `yx_express` VALUES (30, 'jppost', '日本邮政', 1, 0); +INSERT INTO `yx_express` VALUES (31, 'intmail', '中国邮政', 96, 0); +INSERT INTO `yx_express` VALUES (32, 'HENGCHENGWL', '恒诚物流', 1, 0); +INSERT INTO `yx_express` VALUES (33, 'HENGFENGWL', '恒丰物流', 1, 0); +INSERT INTO `yx_express` VALUES (34, 'gdems', '广东ems快递', 1, 0); +INSERT INTO `yx_express` VALUES (35, 'xlyt', '祥龙运通', 1, 0); +INSERT INTO `yx_express` VALUES (36, 'gjbg', '国际包裹', 1, 0); +INSERT INTO `yx_express` VALUES (37, 'uex', 'UEX', 1, 0); +INSERT INTO `yx_express` VALUES (38, 'singpost', '新加坡邮政', 1, 0); +INSERT INTO `yx_express` VALUES (39, 'guangdongyouzhengwuliu', '广东邮政', 1, 0); +INSERT INTO `yx_express` VALUES (40, 'bht', 'BHT', 1, 0); +INSERT INTO `yx_express` VALUES (41, 'cces', 'CCES快递', 1, 0); +INSERT INTO `yx_express` VALUES (42, 'cloudexpress', 'CE易欧通国际速递', 1, 0); +INSERT INTO `yx_express` VALUES (43, 'dasu', '达速物流', 1, 0); +INSERT INTO `yx_express` VALUES (44, 'pfcexpress', '皇家物流', 1, 0); +INSERT INTO `yx_express` VALUES (45, 'hjs', '猴急送', 1, 0); +INSERT INTO `yx_express` VALUES (46, 'huilian', '辉联物流', 1, 0); +INSERT INTO `yx_express` VALUES (47, 'huanqiu', '环球速运', 1, 0); +INSERT INTO `yx_express` VALUES (48, 'huada', '华达快运', 1, 0); +INSERT INTO `yx_express` VALUES (49, 'htwd', '华通务达物流', 1, 0); +INSERT INTO `yx_express` VALUES (50, 'hipito', '海派通', 1, 0); +INSERT INTO `yx_express` VALUES (51, 'hqtd', '环球通达', 1, 0); +INSERT INTO `yx_express` VALUES (52, 'airgtc', '航空快递', 1, 0); +INSERT INTO `yx_express` VALUES (53, 'haoyoukuai', '好又快物流', 1, 0); +INSERT INTO `yx_express` VALUES (54, 'hanrun', '韩润物流', 1, 0); +INSERT INTO `yx_express` VALUES (55, 'ccd', '河南次晨达', 1, 0); +INSERT INTO `yx_express` VALUES (56, 'hfwuxi', '和丰同城', 1, 0); +INSERT INTO `yx_express` VALUES (57, 'Sky', '荷兰', 1, 0); +INSERT INTO `yx_express` VALUES (58, 'hongxun', '鸿讯物流', 1, 0); +INSERT INTO `yx_express` VALUES (59, 'hongjie', '宏捷国际物流', 1, 0); +INSERT INTO `yx_express` VALUES (60, 'httx56', '汇通天下物流', 1, 0); +INSERT INTO `yx_express` VALUES (61, 'lqht', '恒通快递', 1, 0); +INSERT INTO `yx_express` VALUES (62, 'jinguangsudikuaijian', '京广速递快件', 1, 0); +INSERT INTO `yx_express` VALUES (63, 'junfengguoji', '骏丰国际速递', 1, 0); +INSERT INTO `yx_express` VALUES (64, 'jiajiatong56', '佳家通', 1, 0); +INSERT INTO `yx_express` VALUES (65, 'jrypex', '吉日优派', 1, 0); +INSERT INTO `yx_express` VALUES (66, 'jinchengwuliu', '锦程国际物流', 1, 0); +INSERT INTO `yx_express` VALUES (67, 'jgwl', '景光物流', 1, 0); +INSERT INTO `yx_express` VALUES (68, 'pzhjst', '急顺通', 1, 0); +INSERT INTO `yx_express` VALUES (69, 'ruexp', '捷网俄全通', 1, 0); +INSERT INTO `yx_express` VALUES (70, 'jmjss', '金马甲', 1, 0); +INSERT INTO `yx_express` VALUES (71, 'lanhu', '蓝弧快递', 1, 0); +INSERT INTO `yx_express` VALUES (72, 'ltexp', '乐天速递', 1, 0); +INSERT INTO `yx_express` VALUES (73, 'lutong', '鲁通快运', 1, 0); +INSERT INTO `yx_express` VALUES (74, 'ledii', '乐递供应链', 1, 0); +INSERT INTO `yx_express` VALUES (75, 'lundao', '论道国际物流', 1, 0); +INSERT INTO `yx_express` VALUES (76, 'mailikuaidi', '麦力快递', 1, 0); +INSERT INTO `yx_express` VALUES (77, 'mchy', '木春货运', 1, 0); +INSERT INTO `yx_express` VALUES (78, 'meiquick', '美快国际物流', 1, 0); +INSERT INTO `yx_express` VALUES (79, 'valueway', '美通快递', 1, 0); +INSERT INTO `yx_express` VALUES (80, 'nuoyaao', '偌亚奥国际', 1, 0); +INSERT INTO `yx_express` VALUES (81, 'euasia', '欧亚专线', 1, 0); +INSERT INTO `yx_express` VALUES (82, 'pca', '澳大利亚PCA快递', 1, 0); +INSERT INTO `yx_express` VALUES (83, 'pingandatengfei', '平安达腾飞', 1, 0); +INSERT INTO `yx_express` VALUES (84, 'pjbest', '品骏快递', 1, 0); +INSERT INTO `yx_express` VALUES (85, 'qbexpress', '秦邦快运', 1, 0); +INSERT INTO `yx_express` VALUES (86, 'quanxintong', '全信通快递', 1, 0); +INSERT INTO `yx_express` VALUES (87, 'quansutong', '全速通国际快递', 1, 0); +INSERT INTO `yx_express` VALUES (88, 'qinyuan', '秦远物流', 1, 0); +INSERT INTO `yx_express` VALUES (89, 'qichen', '启辰国际物流', 1, 0); +INSERT INTO `yx_express` VALUES (90, 'quansu', '全速快运', 1, 0); +INSERT INTO `yx_express` VALUES (91, 'qzx56', '全之鑫物流', 1, 0); +INSERT INTO `yx_express` VALUES (92, 'qskdyxgs', '千顺快递', 1, 0); +INSERT INTO `yx_express` VALUES (93, 'runhengfeng', '全时速运', 1, 0); +INSERT INTO `yx_express` VALUES (94, 'rytsd', '日益通速递', 1, 0); +INSERT INTO `yx_express` VALUES (95, 'ruidaex', '瑞达国际速递', 1, 0); +INSERT INTO `yx_express` VALUES (96, 'shiyun', '世运快递', 1, 0); +INSERT INTO `yx_express` VALUES (97, 'sfift', '十方通物流', 1, 0); +INSERT INTO `yx_express` VALUES (98, 'stkd', '顺通快递', 1, 0); +INSERT INTO `yx_express` VALUES (99, 'bgn', '布谷鸟快递', 1, 0); +INSERT INTO `yx_express` VALUES (100, 'jiahuier', '佳惠尔快递', 1, 0); +INSERT INTO `yx_express` VALUES (101, 'pingyou', '小包', 1, 0); +INSERT INTO `yx_express` VALUES (102, 'yumeijie', '誉美捷快递', 1, 0); +INSERT INTO `yx_express` VALUES (103, 'meilong', '美龙快递', 1, 0); +INSERT INTO `yx_express` VALUES (104, 'guangtong', '广通速递', 1, 0); +INSERT INTO `yx_express` VALUES (105, 'STARS', '星晨急便', 1, 0); +INSERT INTO `yx_express` VALUES (106, 'NANHANG', '中国南方航空股份有限公司', 1, 0); +INSERT INTO `yx_express` VALUES (107, 'lanbiao', '蓝镖快递', 1, 0); +INSERT INTO `yx_express` VALUES (109, 'baotongda', '宝通达物流', 1, 0); +INSERT INTO `yx_express` VALUES (110, 'dashun', '大顺物流', 1, 0); +INSERT INTO `yx_express` VALUES (111, 'dada', '大达物流', 1, 0); +INSERT INTO `yx_express` VALUES (112, 'fangfangda', '方方达物流', 1, 0); +INSERT INTO `yx_express` VALUES (113, 'hebeijianhua', '河北建华物流', 1, 0); +INSERT INTO `yx_express` VALUES (114, 'haolaiyun', '好来运快递', 1, 0); +INSERT INTO `yx_express` VALUES (115, 'jinyue', '晋越快递', 1, 0); +INSERT INTO `yx_express` VALUES (116, 'kuaitao', '快淘快递', 1, 0); +INSERT INTO `yx_express` VALUES (117, 'peixing', '陪行物流', 1, 0); +INSERT INTO `yx_express` VALUES (118, 'hkpost', '香港邮政', 1, 0); +INSERT INTO `yx_express` VALUES (119, 'ytfh', '一统飞鸿快递', 1, 0); +INSERT INTO `yx_express` VALUES (120, 'zhongxinda', '中信达快递', 1, 0); +INSERT INTO `yx_express` VALUES (121, 'zhongtian', '中天快运', 1, 0); +INSERT INTO `yx_express` VALUES (122, 'zuochuan', '佐川急便', 1, 0); +INSERT INTO `yx_express` VALUES (123, 'chengguang', '程光快递', 1, 0); +INSERT INTO `yx_express` VALUES (124, 'cszx', '城市之星', 1, 0); +INSERT INTO `yx_express` VALUES (125, 'chuanzhi', '传志快递', 1, 0); +INSERT INTO `yx_express` VALUES (126, 'feibao', '飞豹快递', 1, 0); +INSERT INTO `yx_express` VALUES (127, 'huiqiang', '汇强快递', 1, 0); +INSERT INTO `yx_express` VALUES (128, 'lejiedi', '乐捷递', 1, 0); +INSERT INTO `yx_express` VALUES (129, 'lijisong', '成都立即送快递', 1, 0); +INSERT INTO `yx_express` VALUES (130, 'minbang', '民邦速递', 1, 0); +INSERT INTO `yx_express` VALUES (131, 'ocs', 'OCS国际快递', 1, 0); +INSERT INTO `yx_express` VALUES (132, 'santai', '三态速递', 1, 0); +INSERT INTO `yx_express` VALUES (133, 'saiaodi', '赛澳递', 1, 0); +INSERT INTO `yx_express` VALUES (134, 'jingdong', '京东快递', 1, 0); +INSERT INTO `yx_express` VALUES (135, 'zengyi', '增益快递', 1, 0); +INSERT INTO `yx_express` VALUES (136, 'fanyu', '凡宇速递', 1, 0); +INSERT INTO `yx_express` VALUES (137, 'fengda', '丰达快递', 1, 0); +INSERT INTO `yx_express` VALUES (138, 'coe', '东方快递', 1, 0); +INSERT INTO `yx_express` VALUES (139, 'ees', '百福东方快递', 1, 0); +INSERT INTO `yx_express` VALUES (140, 'disifang', '递四方速递', 1, 0); +INSERT INTO `yx_express` VALUES (141, 'rufeng', '如风达快递', 1, 0); +INSERT INTO `yx_express` VALUES (142, 'changtong', '长通物流', 1, 0); +INSERT INTO `yx_express` VALUES (143, 'chengshi100', '城市100快递', 1, 0); +INSERT INTO `yx_express` VALUES (144, 'feibang', '飞邦物流', 1, 0); +INSERT INTO `yx_express` VALUES (145, 'haosheng', '昊盛物流', 1, 0); +INSERT INTO `yx_express` VALUES (146, 'yinsu', '音速速运', 1, 0); +INSERT INTO `yx_express` VALUES (147, 'kuanrong', '宽容物流', 1, 0); +INSERT INTO `yx_express` VALUES (148, 'tongcheng', '通成物流', 1, 0); +INSERT INTO `yx_express` VALUES (149, 'tonghe', '通和天下物流', 1, 0); +INSERT INTO `yx_express` VALUES (150, 'zhima', '芝麻开门', 1, 0); +INSERT INTO `yx_express` VALUES (151, 'ririshun', '日日顺物流', 1, 0); +INSERT INTO `yx_express` VALUES (152, 'anxun', '安迅物流', 1, 0); +INSERT INTO `yx_express` VALUES (153, 'baiqian', '百千诚国际物流', 1, 0); +INSERT INTO `yx_express` VALUES (154, 'chukouyi', '出口易', 1, 0); +INSERT INTO `yx_express` VALUES (155, 'diantong', '店通快递', 1, 0); +INSERT INTO `yx_express` VALUES (156, 'dajin', '大金物流', 1, 0); +INSERT INTO `yx_express` VALUES (157, 'feite', '飞特物流', 1, 0); +INSERT INTO `yx_express` VALUES (159, 'gnxb', '国内小包', 1, 0); +INSERT INTO `yx_express` VALUES (160, 'huacheng', '华诚物流', 1, 0); +INSERT INTO `yx_express` VALUES (161, 'huahan', '华翰物流', 1, 0); +INSERT INTO `yx_express` VALUES (162, 'hengyu', '恒宇运通', 1, 0); +INSERT INTO `yx_express` VALUES (163, 'huahang', '华航快递', 1, 0); +INSERT INTO `yx_express` VALUES (164, 'jiuyi', '久易快递', 1, 0); +INSERT INTO `yx_express` VALUES (165, 'jiete', '捷特快递', 1, 0); +INSERT INTO `yx_express` VALUES (166, 'jingshi', '京世物流', 1, 0); +INSERT INTO `yx_express` VALUES (167, 'kuayue', '跨越快递', 1, 0); +INSERT INTO `yx_express` VALUES (168, 'mengsu', '蒙速快递', 1, 0); +INSERT INTO `yx_express` VALUES (169, 'nanbei', '南北快递', 1, 0); +INSERT INTO `yx_express` VALUES (171, 'pinganda', '平安达快递', 1, 0); +INSERT INTO `yx_express` VALUES (172, 'ruifeng', '瑞丰速递', 1, 0); +INSERT INTO `yx_express` VALUES (173, 'rongqing', '荣庆物流', 1, 0); +INSERT INTO `yx_express` VALUES (174, 'suijia', '穗佳物流', 1, 0); +INSERT INTO `yx_express` VALUES (175, 'simai', '思迈快递', 1, 0); +INSERT INTO `yx_express` VALUES (176, 'suteng', '速腾快递', 1, 0); +INSERT INTO `yx_express` VALUES (177, 'shengbang', '晟邦物流', 1, 0); +INSERT INTO `yx_express` VALUES (178, 'suchengzhaipei', '速呈宅配', 1, 0); +INSERT INTO `yx_express` VALUES (179, 'wuhuan', '五环速递', 1, 0); +INSERT INTO `yx_express` VALUES (180, 'xingchengzhaipei', '星程宅配', 1, 0); +INSERT INTO `yx_express` VALUES (181, 'yinjie', '顺捷丰达', 1, 0); +INSERT INTO `yx_express` VALUES (183, 'yanwen', '燕文物流', 1, 0); +INSERT INTO `yx_express` VALUES (184, 'zongxing', '纵行物流', 1, 0); +INSERT INTO `yx_express` VALUES (185, 'aae', 'AAE快递', 1, 0); +INSERT INTO `yx_express` VALUES (186, 'dhl', 'DHL快递', 1, 0); +INSERT INTO `yx_express` VALUES (187, 'feihu', '飞狐快递', 1, 0); +INSERT INTO `yx_express` VALUES (188, 'shunfeng', '顺丰速运', 92, 1); +INSERT INTO `yx_express` VALUES (189, 'spring', '春风物流', 1, 0); +INSERT INTO `yx_express` VALUES (190, 'yidatong', '易达通快递', 1, 0); +INSERT INTO `yx_express` VALUES (191, 'PEWKEE', '彪记快递', 1, 0); +INSERT INTO `yx_express` VALUES (192, 'PHOENIXEXP', '凤凰快递', 1, 0); +INSERT INTO `yx_express` VALUES (193, 'CNGLS', 'GLS快递', 1, 0); +INSERT INTO `yx_express` VALUES (194, 'BHTEXP', '华慧快递', 1, 0); +INSERT INTO `yx_express` VALUES (195, 'B2B', '卡行天下', 1, 0); +INSERT INTO `yx_express` VALUES (196, 'PEISI', '配思货运', 1, 0); +INSERT INTO `yx_express` VALUES (197, 'SUNDAPOST', '上大物流', 1, 0); +INSERT INTO `yx_express` VALUES (198, 'SUYUE', '苏粤货运', 1, 0); +INSERT INTO `yx_express` VALUES (199, 'F5XM', '伍圆速递', 1, 0); +INSERT INTO `yx_express` VALUES (200, 'GZWENJIE', '文捷航空速递', 1, 0); +INSERT INTO `yx_express` VALUES (201, 'yuancheng', '远成物流', 1, 0); +INSERT INTO `yx_express` VALUES (202, 'dpex', 'DPEX快递', 1, 0); +INSERT INTO `yx_express` VALUES (203, 'anjie', '安捷快递', 1, 0); +INSERT INTO `yx_express` VALUES (204, 'jldt', '嘉里大通', 1, 0); +INSERT INTO `yx_express` VALUES (205, 'yousu', '优速快递', 1, 0); +INSERT INTO `yx_express` VALUES (206, 'wanbo', '万博快递', 1, 0); +INSERT INTO `yx_express` VALUES (207, 'sure', '速尔物流', 1, 0); +INSERT INTO `yx_express` VALUES (208, 'sutong', '速通物流', 1, 0); +INSERT INTO `yx_express` VALUES (209, 'JUNCHUANWL', '骏川物流', 1, 0); +INSERT INTO `yx_express` VALUES (210, 'guada', '冠达快递', 1, 0); +INSERT INTO `yx_express` VALUES (211, 'dsu', 'D速快递', 1, 0); +INSERT INTO `yx_express` VALUES (212, 'LONGSHENWL', '龙胜物流', 1, 0); +INSERT INTO `yx_express` VALUES (213, 'abc', '爱彼西快递', 1, 0); +INSERT INTO `yx_express` VALUES (214, 'eyoubao', 'E邮宝', 1, 0); +INSERT INTO `yx_express` VALUES (215, 'aol', 'AOL快递', 1, 0); +INSERT INTO `yx_express` VALUES (216, 'jixianda', '急先达物流', 1, 0); +INSERT INTO `yx_express` VALUES (217, 'haihong', '山东海红快递', 1, 0); +INSERT INTO `yx_express` VALUES (218, 'feiyang', '飞洋快递', 1, 0); +INSERT INTO `yx_express` VALUES (219, 'rpx', 'RPX保时达', 1, 0); +INSERT INTO `yx_express` VALUES (220, 'zhaijisong', '宅急送', 1, 0); +INSERT INTO `yx_express` VALUES (221, 'tiantian', '天天快递', 99, 0); +INSERT INTO `yx_express` VALUES (222, 'yunwuliu', '云物流', 1, 0); +INSERT INTO `yx_express` VALUES (223, 'jiuye', '九曳供应链', 1, 0); +INSERT INTO `yx_express` VALUES (224, 'bsky', '百世快运', 1, 0); +INSERT INTO `yx_express` VALUES (225, 'higo', '黑狗物流', 1, 0); +INSERT INTO `yx_express` VALUES (226, 'arke', '方舟速递', 1, 0); +INSERT INTO `yx_express` VALUES (227, 'zwsy', '中外速运', 1, 0); +INSERT INTO `yx_express` VALUES (228, 'jxy', '吉祥邮', 1, 0); +INSERT INTO `yx_express` VALUES (229, 'aramex', 'Aramex', 1, 0); +INSERT INTO `yx_express` VALUES (230, 'guotong', '国通快递', 1, 0); +INSERT INTO `yx_express` VALUES (231, 'jiayi', '佳怡物流', 1, 0); +INSERT INTO `yx_express` VALUES (232, 'longbang', '龙邦快运', 1, 0); +INSERT INTO `yx_express` VALUES (233, 'minhang', '民航快递', 1, 0); +INSERT INTO `yx_express` VALUES (234, 'quanyi', '全一快递', 1, 0); +INSERT INTO `yx_express` VALUES (235, 'quanchen', '全晨快递', 1, 0); +INSERT INTO `yx_express` VALUES (236, 'usps', 'USPS快递', 1, 0); +INSERT INTO `yx_express` VALUES (237, 'xinbang', '新邦物流', 1, 0); +INSERT INTO `yx_express` VALUES (238, 'yuanzhi', '元智捷诚快递', 1, 0); +INSERT INTO `yx_express` VALUES (239, 'zhongyou', '中邮物流', 1, 0); +INSERT INTO `yx_express` VALUES (240, 'yuxin', '宇鑫物流', 1, 0); +INSERT INTO `yx_express` VALUES (241, 'cnpex', '中环快递', 1, 0); +INSERT INTO `yx_express` VALUES (242, 'shengfeng', '盛丰物流', 1, 0); +INSERT INTO `yx_express` VALUES (243, 'yuantong', '圆通速递', 97, 1); +INSERT INTO `yx_express` VALUES (244, 'jiayunmei', '加运美物流', 1, 0); +INSERT INTO `yx_express` VALUES (245, 'ywfex', '源伟丰快递', 1, 0); +INSERT INTO `yx_express` VALUES (246, 'xinfeng', '信丰物流', 1, 0); +INSERT INTO `yx_express` VALUES (247, 'wanxiang', '万象物流', 1, 0); +INSERT INTO `yx_express` VALUES (248, 'menduimen', '门对门', 1, 0); +INSERT INTO `yx_express` VALUES (249, 'mingliang', '明亮物流', 1, 0); +INSERT INTO `yx_express` VALUES (250, 'fengxingtianxia', '风行天下', 1, 0); +INSERT INTO `yx_express` VALUES (251, 'gongsuda', '共速达物流', 1, 0); +INSERT INTO `yx_express` VALUES (252, 'zhongtong', '中通快递', 100, 1); +INSERT INTO `yx_express` VALUES (253, 'quanritong', '全日通快递', 1, 0); +INSERT INTO `yx_express` VALUES (254, 'ems', 'EMS', 1, 1); +INSERT INTO `yx_express` VALUES (255, 'wanjia', '万家物流', 1, 0); +INSERT INTO `yx_express` VALUES (256, 'yuntong', '运通快递', 1, 0); +INSERT INTO `yx_express` VALUES (257, 'feikuaida', '飞快达物流', 1, 0); +INSERT INTO `yx_express` VALUES (258, 'haimeng', '海盟速递', 1, 0); +INSERT INTO `yx_express` VALUES (259, 'zhongsukuaidi', '中速快件', 1, 0); +INSERT INTO `yx_express` VALUES (260, 'yuefeng', '越丰快递', 1, 0); +INSERT INTO `yx_express` VALUES (261, 'shenghui', '盛辉物流', 1, 0); +INSERT INTO `yx_express` VALUES (262, 'datian', '大田物流', 1, 0); +INSERT INTO `yx_express` VALUES (263, 'quanjitong', '全际通快递', 1, 0); +INSERT INTO `yx_express` VALUES (264, 'longlangkuaidi', '隆浪快递', 1, 0); +INSERT INTO `yx_express` VALUES (265, 'neweggozzo', '新蛋奥硕物流', 1, 0); +INSERT INTO `yx_express` VALUES (266, 'shentong', '申通快递', 95, 1); +INSERT INTO `yx_express` VALUES (267, 'haiwaihuanqiu', '海外环球', 1, 0); +INSERT INTO `yx_express` VALUES (268, 'yad', '源安达快递', 1, 0); +INSERT INTO `yx_express` VALUES (269, 'jindawuliu', '金大物流', 1, 0); +INSERT INTO `yx_express` VALUES (270, 'sevendays', '七天连锁', 1, 0); +INSERT INTO `yx_express` VALUES (271, 'tnt', 'TNT快递', 1, 0); +INSERT INTO `yx_express` VALUES (272, 'huayu', '天地华宇物流', 1, 0); +INSERT INTO `yx_express` VALUES (273, 'lianhaotong', '联昊通快递', 1, 0); +INSERT INTO `yx_express` VALUES (274, 'nengda', '港中能达快递', 1, 0); +INSERT INTO `yx_express` VALUES (275, 'LBWL', '联邦物流', 1, 0); +INSERT INTO `yx_express` VALUES (276, 'ontrac', 'onTrac', 1, 0); +INSERT INTO `yx_express` VALUES (277, 'feihang', '原飞航快递', 1, 0); +INSERT INTO `yx_express` VALUES (278, 'bangsongwuliu', '邦送物流', 1, 0); +INSERT INTO `yx_express` VALUES (279, 'huaxialong', '华夏龙物流', 1, 0); +INSERT INTO `yx_express` VALUES (280, 'ztwy', '中天万运快递', 1, 0); +INSERT INTO `yx_express` VALUES (281, 'fkd', '飞康达物流', 1, 0); +INSERT INTO `yx_express` VALUES (282, 'anxinda', '安信达快递', 1, 0); +INSERT INTO `yx_express` VALUES (283, 'quanfeng', '全峰快递', 1, 0); +INSERT INTO `yx_express` VALUES (284, 'shengan', '圣安物流', 1, 0); +INSERT INTO `yx_express` VALUES (285, 'jiaji', '佳吉物流', 1, 0); +INSERT INTO `yx_express` VALUES (286, 'yunda', '韵达快运', 94, 0); +INSERT INTO `yx_express` VALUES (287, 'ups', 'UPS快递', 1, 0); +INSERT INTO `yx_express` VALUES (288, 'debang', '德邦物流', 1, 0); +INSERT INTO `yx_express` VALUES (289, 'yafeng', '亚风速递', 1, 0); +INSERT INTO `yx_express` VALUES (290, 'kuaijie', '快捷速递', 98, 0); +INSERT INTO `yx_express` VALUES (291, 'huitong', '百世快递', 93, 0); +INSERT INTO `yx_express` VALUES (293, 'aolau', 'AOL澳通速递', 1, 0); +INSERT INTO `yx_express` VALUES (294, 'anneng', '安能物流', 1, 0); +INSERT INTO `yx_express` VALUES (295, 'auexpress', '澳邮中国快运', 1, 0); +INSERT INTO `yx_express` VALUES (296, 'exfresh', '安鲜达', 1, 0); +INSERT INTO `yx_express` VALUES (297, 'bcwelt', 'BCWELT', 1, 0); +INSERT INTO `yx_express` VALUES (298, 'youzhengguonei', '挂号信', 1, 0); +INSERT INTO `yx_express` VALUES (299, 'xiaohongmao', '北青小红帽', 1, 0); +INSERT INTO `yx_express` VALUES (300, 'lbbk', '宝凯物流', 1, 0); +INSERT INTO `yx_express` VALUES (301, 'byht', '博源恒通', 1, 0); +INSERT INTO `yx_express` VALUES (302, 'idada', '百成大达物流', 1, 0); +INSERT INTO `yx_express` VALUES (303, 'baitengwuliu', '百腾物流', 1, 0); +INSERT INTO `yx_express` VALUES (304, 'birdex', '笨鸟海淘', 1, 0); +INSERT INTO `yx_express` VALUES (305, 'bsht', '百事亨通', 1, 0); +INSERT INTO `yx_express` VALUES (306, 'dayang', '大洋物流快递', 1, 0); +INSERT INTO `yx_express` VALUES (307, 'dechuangwuliu', '德创物流', 1, 0); +INSERT INTO `yx_express` VALUES (308, 'donghanwl', '东瀚物流', 1, 0); +INSERT INTO `yx_express` VALUES (309, 'dfpost', '达方物流', 1, 0); +INSERT INTO `yx_express` VALUES (310, 'dongjun', '东骏快捷物流', 1, 0); +INSERT INTO `yx_express` VALUES (311, 'dindon', '叮咚澳洲转运', 1, 0); +INSERT INTO `yx_express` VALUES (312, 'dazhong', '大众佐川急便', 1, 0); +INSERT INTO `yx_express` VALUES (313, 'decnlh', '德中快递', 1, 0); +INSERT INTO `yx_express` VALUES (314, 'dekuncn', '德坤供应链', 1, 0); +INSERT INTO `yx_express` VALUES (315, 'eshunda', '俄顺达', 1, 0); +INSERT INTO `yx_express` VALUES (316, 'ewe', 'EWE全球快递', 1, 0); +INSERT INTO `yx_express` VALUES (317, 'fedexuk', 'FedEx英国', 1, 0); +INSERT INTO `yx_express` VALUES (318, 'fox', 'FOX国际速递', 1, 0); +INSERT INTO `yx_express` VALUES (319, 'rufengda', '凡客如风达', 1, 0); +INSERT INTO `yx_express` VALUES (320, 'fandaguoji', '颿达国际快递', 1, 0); +INSERT INTO `yx_express` VALUES (321, 'hnfy', '飞鹰物流', 1, 0); +INSERT INTO `yx_express` VALUES (322, 'flysman', '飞力士物流', 1, 0); +INSERT INTO `yx_express` VALUES (323, 'sccod', '丰程物流', 1, 0); +INSERT INTO `yx_express` VALUES (324, 'farlogistis', '泛远国际物流', 1, 0); +INSERT INTO `yx_express` VALUES (325, 'gsm', 'GSM', 1, 0); +INSERT INTO `yx_express` VALUES (326, 'gaticn', 'GATI快递', 1, 0); +INSERT INTO `yx_express` VALUES (327, 'gts', 'GTS快递', 1, 0); +INSERT INTO `yx_express` VALUES (328, 'gangkuai', '港快速递', 1, 0); +INSERT INTO `yx_express` VALUES (329, 'gtsd', '高铁速递', 1, 0); +INSERT INTO `yx_express` VALUES (330, 'tiandihuayu', '华宇物流', 1, 0); +INSERT INTO `yx_express` VALUES (331, 'huangmajia', '黄马甲快递', 1, 0); +INSERT INTO `yx_express` VALUES (332, 'ucs', '合众速递', 1, 0); +INSERT INTO `yx_express` VALUES (333, 'huoban', '伙伴物流', 1, 0); +INSERT INTO `yx_express` VALUES (334, 'nedahm', '红马速递', 1, 0); +INSERT INTO `yx_express` VALUES (335, 'huiwen', '汇文配送', 1, 0); +INSERT INTO `yx_express` VALUES (336, 'nmhuahe', '华赫物流', 1, 0); +INSERT INTO `yx_express` VALUES (337, 'hangyu', '航宇快递', 1, 0); +INSERT INTO `yx_express` VALUES (338, 'minsheng', '闽盛物流', 1, 0); +INSERT INTO `yx_express` VALUES (339, 'riyu', '日昱物流', 1, 0); +INSERT INTO `yx_express` VALUES (340, 'sxhongmajia', '山西红马甲', 1, 0); +INSERT INTO `yx_express` VALUES (341, 'syjiahuier', '沈阳佳惠尔', 1, 0); +INSERT INTO `yx_express` VALUES (342, 'shlindao', '上海林道货运', 1, 0); +INSERT INTO `yx_express` VALUES (343, 'shunjiefengda', '顺捷丰达', 1, 0); +INSERT INTO `yx_express` VALUES (344, 'subida', '速必达物流', 1, 0); +INSERT INTO `yx_express` VALUES (345, 'bphchina', '速方国际物流', 1, 0); +INSERT INTO `yx_express` VALUES (346, 'sendtochina', '速递中国', 1, 0); +INSERT INTO `yx_express` VALUES (347, 'suning', '苏宁快递', 1, 0); +INSERT INTO `yx_express` VALUES (348, 'sihaiet', '四海快递', 1, 0); +INSERT INTO `yx_express` VALUES (349, 'tianzong', '天纵物流', 1, 0); +INSERT INTO `yx_express` VALUES (350, 'chinatzx', '同舟行物流', 1, 0); +INSERT INTO `yx_express` VALUES (351, 'nntengda', '腾达速递', 1, 0); +INSERT INTO `yx_express` VALUES (352, 'sd138', '泰国138', 1, 0); +INSERT INTO `yx_express` VALUES (353, 'tongdaxing', '通达兴物流', 1, 0); +INSERT INTO `yx_express` VALUES (354, 'tlky', '天联快运', 1, 0); +INSERT INTO `yx_express` VALUES (355, 'youshuwuliu', 'UC优速快递', 1, 0); +INSERT INTO `yx_express` VALUES (356, 'ueq', 'UEQ快递', 1, 0); +INSERT INTO `yx_express` VALUES (357, 'weitepai', '微特派快递', 1, 0); +INSERT INTO `yx_express` VALUES (358, 'wtdchina', '威时沛运', 1, 0); +INSERT INTO `yx_express` VALUES (359, 'wzhaunyun', '微转运', 1, 0); +INSERT INTO `yx_express` VALUES (360, 'gswtkd', '万通快递', 1, 0); +INSERT INTO `yx_express` VALUES (361, 'wotu', '渥途国际速运', 1, 0); +INSERT INTO `yx_express` VALUES (362, 'xiyoute', '希优特快递', 1, 0); +INSERT INTO `yx_express` VALUES (363, 'xilaikd', '喜来快递', 1, 0); +INSERT INTO `yx_express` VALUES (364, 'xsrd', '鑫世锐达', 1, 0); +INSERT INTO `yx_express` VALUES (365, 'xtb', '鑫通宝物流', 1, 0); +INSERT INTO `yx_express` VALUES (366, 'xintianjie', '信天捷快递', 1, 0); +INSERT INTO `yx_express` VALUES (367, 'xaetc', '西安胜峰', 1, 0); +INSERT INTO `yx_express` VALUES (368, 'xianfeng', '先锋快递', 1, 0); +INSERT INTO `yx_express` VALUES (369, 'sunspeedy', '新速航', 1, 0); +INSERT INTO `yx_express` VALUES (370, 'xipost', '西邮寄', 1, 0); +INSERT INTO `yx_express` VALUES (371, 'sinatone', '信联通', 1, 0); +INSERT INTO `yx_express` VALUES (372, 'sunjex', '新杰物流', 1, 0); +INSERT INTO `yx_express` VALUES (373, 'yundaexus', '韵达美国件', 1, 0); +INSERT INTO `yx_express` VALUES (374, 'yxwl', '宇鑫物流', 1, 0); +INSERT INTO `yx_express` VALUES (375, 'yitongda', '易通达', 1, 0); +INSERT INTO `yx_express` VALUES (376, 'yiqiguojiwuliu', '一柒物流', 1, 0); +INSERT INTO `yx_express` VALUES (377, 'yilingsuyun', '亿领速运', 1, 0); +INSERT INTO `yx_express` VALUES (378, 'yujiawuliu', '煜嘉物流', 1, 0); +INSERT INTO `yx_express` VALUES (379, 'gml', '英脉物流', 1, 0); +INSERT INTO `yx_express` VALUES (380, 'leopard', '云豹国际货运', 1, 0); +INSERT INTO `yx_express` VALUES (381, 'czwlyn', '云南中诚', 1, 0); +INSERT INTO `yx_express` VALUES (382, 'sdyoupei', '优配速运', 1, 0); +INSERT INTO `yx_express` VALUES (383, 'yongchang', '永昌物流', 1, 0); +INSERT INTO `yx_express` VALUES (384, 'yufeng', '御风速运', 1, 0); +INSERT INTO `yx_express` VALUES (385, 'yamaxunwuliu', '亚马逊物流', 1, 0); +INSERT INTO `yx_express` VALUES (386, 'yousutongda', '优速通达', 1, 0); +INSERT INTO `yx_express` VALUES (387, 'yishunhang', '亿顺航', 1, 0); +INSERT INTO `yx_express` VALUES (388, 'yongwangda', '永旺达快递', 1, 0); +INSERT INTO `yx_express` VALUES (389, 'ecmscn', '易满客', 1, 0); +INSERT INTO `yx_express` VALUES (390, 'yingchao', '英超物流', 1, 0); +INSERT INTO `yx_express` VALUES (391, 'edlogistics', '益递物流', 1, 0); +INSERT INTO `yx_express` VALUES (392, 'yyexpress', '远洋国际', 1, 0); +INSERT INTO `yx_express` VALUES (393, 'onehcang', '一号仓', 1, 0); +INSERT INTO `yx_express` VALUES (394, 'ycgky', '远成快运', 1, 0); +INSERT INTO `yx_express` VALUES (395, 'lineone', '一号线', 1, 0); +INSERT INTO `yx_express` VALUES (396, 'ypsd', '壹品速递', 1, 0); +INSERT INTO `yx_express` VALUES (397, 'vipexpress', '鹰运国际速递', 1, 0); +INSERT INTO `yx_express` VALUES (398, 'el56', '易联通达物流', 1, 0); +INSERT INTO `yx_express` VALUES (399, 'yyqc56', '一运全成物流', 1, 0); +INSERT INTO `yx_express` VALUES (400, 'zhongtie', '中铁快运', 1, 0); +INSERT INTO `yx_express` VALUES (401, 'ZTKY', '中铁物流', 1, 0); +INSERT INTO `yx_express` VALUES (402, 'zzjh', '郑州建华快递', 1, 0); +INSERT INTO `yx_express` VALUES (403, 'zhongruisudi', '中睿速递', 1, 0); +INSERT INTO `yx_express` VALUES (404, 'zhongwaiyun', '中外运速递', 1, 0); +INSERT INTO `yx_express` VALUES (405, 'zengyisudi', '增益速递', 1, 0); +INSERT INTO `yx_express` VALUES (406, 'sujievip', '郑州速捷', 1, 0); +INSERT INTO `yx_express` VALUES (407, 'zhichengtongda', '至诚通达快递', 1, 0); +INSERT INTO `yx_express` VALUES (408, 'zhdwl', '众辉达物流', 1, 0); +INSERT INTO `yx_express` VALUES (409, 'kuachangwuliu', '直邮易', 1, 0); +INSERT INTO `yx_express` VALUES (410, 'topspeedex', '中运全速', 1, 0); +INSERT INTO `yx_express` VALUES (411, 'otobv', '中欧快运', 1, 0); +INSERT INTO `yx_express` VALUES (412, 'zsky123', '准实快运', 1, 0); +INSERT INTO `yx_express` VALUES (413, 'donghong', '东红物流', 1, 0); +INSERT INTO `yx_express` VALUES (414, 'kuaiyouda', '快优达速递', 1, 0); +INSERT INTO `yx_express` VALUES (415, 'balunzhi', '巴伦支快递', 1, 0); +INSERT INTO `yx_express` VALUES (416, 'hutongwuliu', '户通物流', 1, 0); +INSERT INTO `yx_express` VALUES (417, 'xianchenglian', '西安城联速递', 1, 0); +INSERT INTO `yx_express` VALUES (418, 'youbijia', '邮必佳', 1, 0); +INSERT INTO `yx_express` VALUES (419, 'feiyuan', '飞远物流', 1, 0); +INSERT INTO `yx_express` VALUES (420, 'chengji', '城际速递', 1, 0); +INSERT INTO `yx_express` VALUES (421, 'huaqi', '华企快运', 1, 0); +INSERT INTO `yx_express` VALUES (422, 'yibang', '一邦快递', 1, 0); +INSERT INTO `yx_express` VALUES (423, 'citylink', 'CityLink快递', 1, 0); +INSERT INTO `yx_express` VALUES (424, 'meixi', '美西快递', 1, 0); +INSERT INTO `yx_express` VALUES (425, 'acs', 'ACS', 1, 0); + +-- ---------------------------- +-- Table structure for yx_routine_access_token +-- ---------------------------- +DROP TABLE IF EXISTS `yx_routine_access_token`; +CREATE TABLE `yx_routine_access_token` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '小程序access_token表ID', + `access_token` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'openid', + `stop_time` int(11) UNSIGNED NOT NULL COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '小程序access_token表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_routine_access_token +-- ---------------------------- +INSERT INTO `yx_routine_access_token` VALUES (1, '20_z3MAutcbznCSyQPqMVOQVRUktcvLYUXAAICpCMXkpu5rLoVnBB0u88rnJr1sWDJlwj-S6aVhmswmLdW86e9Bg2ugd3BOayE6ntY6FfckSXWgvW2y5N0bLkBxHpCjJH2bQpuvnmMIZr08G32hWSQfACAZVT', 1554809658); + +-- ---------------------------- +-- Table structure for yx_routine_form_id +-- ---------------------------- +DROP TABLE IF EXISTS `yx_routine_form_id`; +CREATE TABLE `yx_routine_form_id` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '表单ID表ID', + `uid` int(11) NULL DEFAULT 0 COMMENT '用户uid', + `form_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '表单ID', + `stop_time` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '表单ID失效时间', + `status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态1 未使用 2不能使用', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '表单id表记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_routine_qrcode +-- ---------------------------- +DROP TABLE IF EXISTS `yx_routine_qrcode`; +CREATE TABLE `yx_routine_qrcode` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '微信二维码ID', + `third_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '二维码类型 spread(用户推广) product_spread(产品推广)', + `third_id` int(11) UNSIGNED NOT NULL COMMENT '用户id', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态 0不可用 1可用', + `add_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '添加时间', + `page` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '小程序页面路径带参数', + `qrcode_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '小程序二维码路径', + `url_time` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '二维码添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '小程序二维码管理表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_routine_template +-- ---------------------------- +DROP TABLE IF EXISTS `yx_routine_template`; +CREATE TABLE `yx_routine_template` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '模板id', + `tempkey` char(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '模板编号', + `name` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '模板名', + `content` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '回复内容', + `tempid` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模板ID', + `add_time` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '添加时间', + `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE, + INDEX `tempkey`(`tempkey`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信模板' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_routine_template +-- ---------------------------- +INSERT INTO `yx_routine_template` VALUES (13, 'AT0007', '订单发货提醒', '订单号{{keyword1.DATA}}\n快递公司{{keyword2.DATA}}\n快递单号{{keyword3.DATA}}\n发货时间{{keyword4.DATA}}\n备注{{keyword5.DATA}}', 'fLsTVQmI2AE9q48BL58tffLRcyCnPLC9guSFrEHXbR8', '1534469928', 1); +INSERT INTO `yx_routine_template` VALUES (14, 'AT0787', '退款成功通知', '订单号{{keyword1.DATA}}\n退款时间{{keyword2.DATA}}\n退款金额{{keyword3.DATA}}\n退款方式{{keyword4.DATA}}\n备注{{keyword5.DATA}}', 'vgTj1nk1A1bVObCX0Fw3h9WbXvay1URcHMITjGW13cc', '1534469993', 1); +INSERT INTO `yx_routine_template` VALUES (15, 'AT0009', '订单支付成功通知', '单号{{keyword1.DATA}}\n下单时间{{keyword2.DATA}}\n订单状态{{keyword3.DATA}}\n支付金额{{keyword4.DATA}}\n支付方式{{keyword5.DATA}}', 'Rwt2QIz3zHbQGPXCH3E8nBneWzgFFBMiMI6EShTBLpI', '1534470043', 1); +INSERT INTO `yx_routine_template` VALUES (16, 'AT1173', '砍价成功通知', '商品名称{{keyword1.DATA}}\n砍价金额{{keyword2.DATA}}\n底价{{keyword3.DATA}}\n砍掉价格{{keyword4.DATA}}\n支付金额{{keyword5.DATA}}\n备注{{keyword6.DATA}}', 'qu3nRoV9lTmmvVWOdgf-2uz8NPT3w71cOx7UDJ5Uryo', '1534470085', 1); +INSERT INTO `yx_routine_template` VALUES (17, 'AT0036', '退款通知', '订单编号{{keyword1.DATA}}\n退款原因{{keyword2.DATA}}\n退款时间{{keyword3.DATA}}\n退款金额{{keyword4.DATA}}\n退款方式{{keyword5.DATA}}', 'gYYXx5nz8eWHPd_zp42EdR9UzhdynOo8Eq5GDb4dTrc', '1534470134', 1); +INSERT INTO `yx_routine_template` VALUES (19, 'AT2430', '拼团取消通知', '活动名称{{keyword1.DATA}}\n订单编号{{keyword2.DATA}}\n订单金额{{keyword3.DATA}}', 'OmzyMqsWJFn3L68DmEcZqV9FdSHrr2ThHYe6Czs8iaM', '1553910500', 1); +INSERT INTO `yx_routine_template` VALUES (20, 'AT0310', '拼团失败通知', '商品名称{{keyword1.DATA}}\n失败原因{{keyword2.DATA}}\n订单号{{keyword3.DATA}}\n开团时间{{keyword4.DATA}}\n退款金额{{keyword5.DATA}}', 'GRpTaZ1-tHoLvrfM-iEsBBbVSIXgh7bO17b7Z2AUpKM', '1553910844', 1); +INSERT INTO `yx_routine_template` VALUES (21, 'AT0051', '拼团成功通知', '活动名称{{keyword1.DATA}}\n团长{{keyword2.DATA}}\n成团时间{{keyword3.DATA}}\n拼团价{{keyword4.DATA}}', 'dlYqzgGLrVgRq-Ealw31wCy5PV-rGof-99OppSZhWxY', '1553911022', 1); +INSERT INTO `yx_routine_template` VALUES (22, 'AT0541', '开团成功提醒', '开团时间{{keyword1.DATA}}\n截至时间{{keyword2.DATA}}\n产品名称{{keyword3.DATA}}\n单号{{keyword4.DATA}}\n支付金额{{keyword5.DATA}}', 'E2NURfqs4MnciPB1YzvjtMDZCMfCCOHOwCdKFl7XigU', '1555133496', 1); +INSERT INTO `yx_routine_template` VALUES (23, 'AT0241', '确认收货通知', '订单编号{{keyword1.DATA}}\n商品详情{{keyword2.DATA}}\n支付金额{{keyword3.DATA}}\n确认收货时间{{keyword4.DATA}}', '4-DQPQMVsJfHjiKhEACz0ofcs_PHupy3xHTX1N1tzTo', '1557384781', 1); +INSERT INTO `yx_routine_template` VALUES (24, 'AT0329', '退款失败通知', '订单号{{keyword1.DATA}}\n商品名称{{keyword2.DATA}}\n退款金额{{keyword3.DATA}}\n失败原因{{keyword4.DATA}}', 'rlOEIDa0s6PMG4L_CkDLpBWCPf_mGci3z86UC5LmXCc', '1557384804', 1); +INSERT INTO `yx_routine_template` VALUES (25, 'AT1242', '提现失败通知', '失败原因{{keyword1.DATA}}\n提现金额{{keyword2.DATA}}\n提现方式{{keyword3.DATA}}\n审核时间{{keyword4.DATA}}', 'MsVoI7IV4CTFObS9XoJYTjMWPh8zjbNRK5-Z_II0Dnk', '1558918703', 1); +INSERT INTO `yx_routine_template` VALUES (26, 'AT1330', ' 提现成功通知', '提现金额{{keyword1.DATA}}\n提现状态{{keyword2.DATA}}\n审核时间{{keyword3.DATA}}\n提现方式{{keyword4.DATA}}', 'Twp4EWZTRUF2mps0J5Inw55_DpbNEfqqdKvfEx_ihos', '1558918767', 1); + +-- ---------------------------- +-- Table structure for yx_store_bargain +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_bargain`; +CREATE TABLE `yx_store_bargain` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '砍价产品ID', + `product_id` int(11) UNSIGNED NOT NULL COMMENT '关联产品ID', + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '砍价活动名称', + `image` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '砍价活动图片', + `unit_name` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位名称', + `stock` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '库存', + `sales` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '销量', + `images` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '砍价产品轮播图', + `start_time` int(11) UNSIGNED NOT NULL COMMENT '砍价开启时间', + `stop_time` int(11) UNSIGNED NOT NULL COMMENT '砍价结束时间', + `store_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '砍价产品名称', + `price` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '砍价金额', + `min_price` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '砍价商品最低价', + `num` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '每次购买的砍价产品数量', + `bargain_max_price` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '用户每次砍价的最大金额', + `bargain_min_price` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '用户每次砍价的最小金额', + `bargain_num` int(11) UNSIGNED NOT NULL DEFAULT 1 COMMENT '用户每次砍价的次数', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '砍价状态 0(到砍价时间不自动开启) 1(到砍价时间自动开启时间)', + `description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '砍价详情', + `give_integral` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '反多少积分', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '砍价活动简介', + `cost` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '成本价', + `sort` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序', + `is_hot` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否推荐0不推荐1推荐', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除 0未删除 1删除', + `add_time` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '添加时间', + `is_postage` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否包邮 0不包邮 1包邮', + `postage` decimal(10, 2) UNSIGNED NULL DEFAULT NULL COMMENT '邮费', + `rule` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '砍价规则', + `look` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '砍价产品浏览量', + `share` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '砍价产品分享量', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '砍价表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_bargain_user +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_bargain_user`; +CREATE TABLE `yx_store_bargain_user` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户参与砍价表ID', + `uid` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '用户ID', + `bargain_id` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '砍价产品id', + `bargain_price_min` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '砍价的最低价', + `bargain_price` decimal(8, 2) NULL DEFAULT NULL COMMENT '砍价金额', + `price` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '砍掉的价格', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态 1参与中 2 活动结束参与失败 3活动结束参与成功', + `add_time` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '参与时间', + `is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否取消', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户参与砍价表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_bargain_user_help +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_bargain_user_help`; +CREATE TABLE `yx_store_bargain_user_help` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '砍价用户帮助表ID', + `uid` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '帮助的用户id', + `bargain_id` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '砍价产品ID', + `bargain_user_id` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '用户参与砍价表id', + `price` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '帮助砍价多少金额', + `add_time` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '砍价用户帮助表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_cart +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_cart`; +CREATE TABLE `yx_store_cart` ( + `id` bigint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '购物车表ID', + `uid` int(10) UNSIGNED NOT NULL COMMENT '用户ID', + `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型', + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID', + `product_attr_unique` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品属性', + `cart_num` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品数量', + `add_time` int(10) UNSIGNED NOT NULL COMMENT '添加时间', + `is_pay` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0 = 未购买 1 = 已购买', + `is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除', + `is_new` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否为立即购买', + `combination_id` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '拼团id', + `seckill_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '秒杀产品ID', + `bargain_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '砍价id', + PRIMARY KEY (`id`) USING BTREE, + INDEX `user_id`(`uid`) USING BTREE, + INDEX `goods_id`(`product_id`) USING BTREE, + INDEX `uid`(`uid`, `is_pay`) USING BTREE, + INDEX `uid_2`(`uid`, `is_del`) USING BTREE, + INDEX `uid_3`(`uid`, `is_new`) USING BTREE, + INDEX `type`(`type`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '购物车表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_category +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_category`; +CREATE TABLE `yx_store_category` ( + `id` mediumint(11) NOT NULL AUTO_INCREMENT COMMENT '商品分类表ID', + `pid` mediumint(11) NOT NULL COMMENT '父id', + `cate_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '分类名称', + `sort` mediumint(11) NOT NULL COMMENT '排序', + `pic` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '图标', + `is_show` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否推荐', + `add_time` int(11) NOT NULL COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `pid`(`pid`) USING BTREE, + INDEX `is_base`(`is_show`) USING BTREE, + INDEX `sort`(`sort`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品分类表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_category +-- ---------------------------- +INSERT INTO `yx_store_category` VALUES (1, 0, '热门推荐', 2, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3db8b933d92.jpg', 1, 1547205038); +INSERT INTO `yx_store_category` VALUES (2, 1, '热门促销', 0, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dba1366885.jpg', 1, 1547205055); +INSERT INTO `yx_store_category` VALUES (3, 1, '折扣专区', 0, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dc0ef27068.jpg', 1, 1547550363); +INSERT INTO `yx_store_category` VALUES (4, 1, '新品上线', 0, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dbc6a38fab.jpg', 1, 1553783295); +INSERT INTO `yx_store_category` VALUES (6, 0, '居家生活', 1, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3db8b933d92.jpg', 1, 1553783609); +INSERT INTO `yx_store_category` VALUES (7, 6, '床垫', 1, 'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9de8b7c5cc5.png', 1, 1553784473); +INSERT INTO `yx_store_category` VALUES (8, 6, '灯具', 0, 'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9def00c2882.png', 1, 1553784490); +INSERT INTO `yx_store_category` VALUES (9, 0, '家电电器', 3, '', 1, 1553852206); +INSERT INTO `yx_store_category` VALUES (10, 0, '手机数码', 4, '', 1, 1553852227); +INSERT INTO `yx_store_category` VALUES (11, 0, '智能设备', 5, '', 1, 1553852259); +INSERT INTO `yx_store_category` VALUES (12, 0, '影音音响', 6, '', 1, 1553852288); +INSERT INTO `yx_store_category` VALUES (13, 0, '服饰鞋帽', 7, '', 1, 1553852314); +INSERT INTO `yx_store_category` VALUES (14, 0, '餐厨厨房', 8, '', 1, 1553852353); +INSERT INTO `yx_store_category` VALUES (15, 0, '洗护健康', 9, '', 1, 1553852370); +INSERT INTO `yx_store_category` VALUES (16, 0, '日杂用品', 10, '', 1, 1553852390); +INSERT INTO `yx_store_category` VALUES (17, 0, '出行交通', 11, '', 1, 1553852413); +INSERT INTO `yx_store_category` VALUES (18, 0, '配件设备', 13, 'http://kaifa.crmeb.net/uploads/attach/2019/08/20190809/6801781ff4403bdbb6764f4182394729.png', 1, 1553852458); +INSERT INTO `yx_store_category` VALUES (19, 6, '家具', 0, 'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9def5fa968c.png', 1, 1553854308); +INSERT INTO `yx_store_category` VALUES (20, 6, '床品件套', 0, 'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9df11e13742.png', 1, 1553854755); +INSERT INTO `yx_store_category` VALUES (21, 6, '家饰花卉', 0, 'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9df170010cb.png', 1, 1553854835); +INSERT INTO `yx_store_category` VALUES (22, 6, '布艺软装', 0, 'http://datong.crmeb.net/public/uploads/attach/2019/03/29/5c9df1b8f0a7a.png', 1, 1553854908); +INSERT INTO `yx_store_category` VALUES (23, 0, '测试', 0, 'http://kaifa.crmeb.net/uploads/attach/2019/08/20190805/887db984b5f1138e08e1d9b069af766e.jpg', 1, 1565158900); +INSERT INTO `yx_store_category` VALUES (24, 23, '测试1', 0, 'http://kaifa.crmeb.net/uploads/attach/2019/08/20190805/887db984b5f1138e08e1d9b069af766e.jpg', 1, 1565158917); +INSERT INTO `yx_store_category` VALUES (25, 0, '测试2', 0, '', 1, 1565158947); +INSERT INTO `yx_store_category` VALUES (26, 25, '测试22', 0, 'http://kaifa.crmeb.net/uploads/attach/2019/08/20190805/887db984b5f1138e08e1d9b069af766e.jpg', 1, 1565158963); + +-- ---------------------------- +-- Table structure for yx_store_combination +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_combination`; +CREATE TABLE `yx_store_combination` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品id', + `mer_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '商户id', + `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '推荐图', + `images` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '轮播图', + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '活动标题', + `attr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '活动属性', + `people` int(2) UNSIGNED NOT NULL COMMENT '参团人数', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '简介', + `price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '价格', + `sort` int(10) UNSIGNED NOT NULL COMMENT '排序', + `sales` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '销量', + `stock` int(10) UNSIGNED NOT NULL COMMENT '库存', + `add_time` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '添加时间', + `is_host` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '推荐', + `is_show` tinyint(1) UNSIGNED NOT NULL COMMENT '产品状态', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0, + `combination` tinyint(1) UNSIGNED NOT NULL DEFAULT 1, + `mer_use` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '商户是否可用1可用0不可用', + `is_postage` tinyint(1) UNSIGNED NOT NULL COMMENT '是否包邮1是0否', + `postage` decimal(10, 2) UNSIGNED NOT NULL COMMENT '邮费', + `description` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '拼团内容', + `start_time` int(11) UNSIGNED NOT NULL COMMENT '拼团开始时间', + `stop_time` int(11) UNSIGNED NOT NULL COMMENT '拼团结束时间', + `effective_time` int(11) NOT NULL DEFAULT 0 COMMENT '拼团订单有效时间', + `cost` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '拼图产品成本', + `browse` int(11) NULL DEFAULT 0 COMMENT '浏览量', + `unit_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '单位名', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '拼团产品表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_combination_attr +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_combination_attr`; +CREATE TABLE `yx_store_combination_attr` ( + `product_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品ID', + `attr_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '属性名', + `attr_values` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '属性值', + INDEX `store_id`(`product_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_combination_attr_result +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_combination_attr_result`; +CREATE TABLE `yx_store_combination_attr_result` ( + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID', + `result` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品属性参数', + `change_time` int(10) UNSIGNED NOT NULL COMMENT '上次修改时间', + UNIQUE INDEX `product_id`(`product_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性详情表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_combination_attr_value +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_combination_attr_value`; +CREATE TABLE `yx_store_combination_attr_value` ( + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID', + `suk` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品属性索引值 (attr_value|attr_value[|....])', + `stock` int(10) UNSIGNED NOT NULL COMMENT '属性对应的库存', + `sales` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '销量', + `price` decimal(8, 2) UNSIGNED NOT NULL COMMENT '属性金额', + `image` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片', + `unique` char(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '唯一值', + `cost` decimal(8, 2) UNSIGNED NOT NULL COMMENT '成本价', + UNIQUE INDEX `unique`(`unique`, `suk`) USING BTREE, + INDEX `store_id`(`product_id`, `suk`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性值表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_coupon +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_coupon`; +CREATE TABLE `yx_store_coupon` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '优惠券表ID', + `title` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '优惠券名称', + `integral` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '兑换消耗积分值', + `coupon_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '兑换的优惠券面值', + `use_min_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '最低消费多少金额可用优惠券', + `coupon_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠券有效期限(单位:天)', + `sort` int(11) UNSIGNED NOT NULL DEFAULT 1 COMMENT '排序', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态(0:关闭,1:开启)', + `add_time` int(11) UNSIGNED NOT NULL COMMENT '兑换项目添加时间', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除', + PRIMARY KEY (`id`) USING BTREE, + INDEX `state`(`status`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `coupon_time`(`coupon_time`) USING BTREE, + INDEX `is_del`(`is_del`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_coupon_issue +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_coupon_issue`; +CREATE TABLE `yx_store_coupon_issue` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `cid` int(10) NULL DEFAULT NULL COMMENT '优惠券ID', + `start_time` int(10) NULL DEFAULT NULL COMMENT '优惠券领取开启时间', + `end_time` int(10) NULL DEFAULT NULL COMMENT '优惠券领取结束时间', + `total_count` int(10) NULL DEFAULT NULL COMMENT '优惠券领取数量', + `remain_count` int(10) NULL DEFAULT NULL COMMENT '优惠券剩余领取数量', + `is_permanent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否无限张数', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1 正常 0 未开启 -1 已无效', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0, + `add_time` int(10) NULL DEFAULT NULL COMMENT '优惠券添加时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `cid`(`cid`) USING BTREE, + INDEX `start_time`(`start_time`, `end_time`) USING BTREE, + INDEX `remain_count`(`remain_count`) USING BTREE, + INDEX `status`(`status`) USING BTREE, + INDEX `is_del`(`is_del`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券前台领取表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_coupon_issue_user +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_coupon_issue_user`; +CREATE TABLE `yx_store_coupon_issue_user` ( + `uid` int(10) NULL DEFAULT NULL COMMENT '领取优惠券用户ID', + `issue_coupon_id` int(10) NULL DEFAULT NULL COMMENT '优惠券前台领取ID', + `add_time` int(10) NULL DEFAULT NULL COMMENT '领取时间', + UNIQUE INDEX `uid`(`uid`, `issue_coupon_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券前台用户领取记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_coupon_user +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_coupon_user`; +CREATE TABLE `yx_store_coupon_user` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '优惠券发放记录id', + `cid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '兑换的项目id', + `uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠券所属用户', + `coupon_title` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '优惠券名称', + `coupon_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '优惠券的面值', + `use_min_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '最低消费多少金额可用优惠券', + `add_time` int(11) UNSIGNED NOT NULL COMMENT '优惠券创建时间', + `end_time` int(11) UNSIGNED NOT NULL COMMENT '优惠券结束时间', + `use_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使用时间', + `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'send' COMMENT '获取方式', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态(0:未使用,1:已使用, 2:已过期)', + `is_fail` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否有效', + PRIMARY KEY (`id`) USING BTREE, + INDEX `cid`(`cid`) USING BTREE, + INDEX `uid`(`uid`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `end_time`(`end_time`) USING BTREE, + INDEX `status`(`status`) USING BTREE, + INDEX `is_fail`(`is_fail`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券发放记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_order +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_order`; +CREATE TABLE `yx_store_order` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '订单ID', + `order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '订单号', + `uid` int(11) UNSIGNED NOT NULL COMMENT '用户id', + `real_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户姓名', + `user_phone` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户电话', + `user_address` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '详细地址', + `cart_id` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '[]' COMMENT '购物车id', + `freight_price` decimal(8, 2) NOT NULL DEFAULT 0.00 COMMENT '运费金额', + `total_num` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单商品总数', + `total_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '订单总价', + `total_postage` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '邮费', + `pay_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '实际支付金额', + `pay_postage` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '支付邮费', + `deduction_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '抵扣金额', + `coupon_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠券id', + `coupon_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '优惠券金额', + `paid` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '支付状态', + `pay_time` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '支付时间', + `pay_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '支付方式', + `add_time` int(11) UNSIGNED NOT NULL COMMENT '创建时间', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款)', + `refund_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0 未退款 1 申请中 2 已退款', + `refund_reason_wap_img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '退款图片', + `refund_reason_wap_explain` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '退款用户说明', + `refund_reason_time` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '退款时间', + `refund_reason_wap` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '前台退款原因', + `refund_reason` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '不退款的理由', + `refund_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '退款金额', + `delivery_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '快递名称/送货人姓名', + `delivery_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发货类型', + `delivery_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '快递单号/手机号', + `gain_integral` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '消费赚取积分', + `use_integral` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '使用积分', + `back_integral` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '给用户退了多少积分', + `mark` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除', + `unique` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '唯一id(md5加密)类似id', + `remark` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '管理员备注', + `mer_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商户ID', + `is_mer_check` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, + `combination_id` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '拼团产品id0一般产品', + `pink_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '拼团id 0没有拼团', + `cost` decimal(8, 2) UNSIGNED NOT NULL COMMENT '成本价', + `seckill_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '秒杀产品ID', + `bargain_id` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '砍价id', + `verify_code` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '核销码', + `store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id', + `shipping_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '配送方式 1=快递 ,2=门店自提', + `is_channel` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '支付渠道(0微信公众号1微信小程序)', + `is_remind` tinyint(1) UNSIGNED NULL DEFAULT 0, + `is_system_del` tinyint(1) NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `order_id_2`(`order_id`, `uid`) USING BTREE, + UNIQUE INDEX `unique`(`unique`) USING BTREE, + INDEX `uid`(`uid`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `pay_price`(`pay_price`) USING BTREE, + INDEX `paid`(`paid`) USING BTREE, + INDEX `pay_time`(`pay_time`) USING BTREE, + INDEX `pay_type`(`pay_type`) USING BTREE, + INDEX `status`(`status`) USING BTREE, + INDEX `is_del`(`is_del`) USING BTREE, + INDEX `coupon_id`(`coupon_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_order_cart_info +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_order_cart_info`; +CREATE TABLE `yx_store_order_cart_info` ( + `oid` int(11) UNSIGNED NOT NULL COMMENT '订单id', + `cart_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '购物车id', + `product_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品ID', + `cart_info` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '购买东西的详细信息', + `unique` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '唯一id', + UNIQUE INDEX `oid`(`oid`, `unique`) USING BTREE, + INDEX `cart_id`(`cart_id`) USING BTREE, + INDEX `product_id`(`product_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单购物详情表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_order_status +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_order_status`; +CREATE TABLE `yx_store_order_status` ( + `oid` int(10) UNSIGNED NOT NULL COMMENT '订单id', + `change_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作类型', + `change_message` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作备注', + `change_time` int(10) UNSIGNED NOT NULL COMMENT '操作时间', + INDEX `oid`(`oid`) USING BTREE, + INDEX `change_type`(`change_type`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单操作记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_pink +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_pink`; +CREATE TABLE `yx_store_pink` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `uid` int(10) UNSIGNED NOT NULL COMMENT '用户id', + `order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '订单id 生成', + `order_id_key` int(10) UNSIGNED NOT NULL COMMENT '订单id 数据库', + `total_num` int(10) UNSIGNED NOT NULL COMMENT '购买商品个数', + `total_price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '购买总金额', + `cid` int(10) UNSIGNED NOT NULL COMMENT '拼团产品id', + `pid` int(10) UNSIGNED NOT NULL COMMENT '产品id', + `people` int(10) UNSIGNED NOT NULL COMMENT '拼图总人数', + `price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '拼团产品单价', + `add_time` varchar(24) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '开始时间', + `stop_time` varchar(24) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `k_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '团长id 0为团长', + `is_tpl` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否发送模板消息0未发送1已发送', + `is_refund` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否退款 0未退款 1已退款', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态1进行中2已完成3未完成', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '拼团表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_product +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product`; +CREATE TABLE `yx_store_product` ( + `id` mediumint(11) NOT NULL AUTO_INCREMENT COMMENT '商品id', + `mer_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商户Id(0为总后台管理员创建,不为0的时候是商户后台创建)', + `image` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品图片', + `slider_image` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '轮播图', + `store_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品名称', + `store_info` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品简介', + `keyword` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '关键字', + `bar_code` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '产品条码(一维码)', + `cate_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '分类id', + `price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '商品价格', + `vip_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '会员价格', + `ot_price` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '市场价', + `postage` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '邮费', + `unit_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '单位名', + `sort` smallint(11) NOT NULL DEFAULT 0 COMMENT '排序', + `sales` mediumint(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '销量', + `stock` mediumint(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '库存', + `is_show` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态(0:未上架,1:上架)', + `is_hot` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否热卖', + `is_benefit` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否优惠', + `is_best` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否精品', + `is_new` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否新品', + `description` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '产品描述', + `add_time` int(11) UNSIGNED NOT NULL COMMENT '添加时间', + `is_postage` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否包邮', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除', + `mer_use` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商户是否代理 0不可代理1可代理', + `give_integral` decimal(8, 2) UNSIGNED NOT NULL COMMENT '获得积分', + `cost` decimal(8, 2) UNSIGNED NOT NULL COMMENT '成本价', + `is_seckill` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '秒杀状态 0 未开启 1已开启', + `is_bargain` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '砍价状态 0未开启 1开启', + `is_good` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否优品推荐', + `ficti` mediumint(11) NULL DEFAULT 100 COMMENT '虚拟销量', + `browse` int(11) NULL DEFAULT 0 COMMENT '浏览量', + `code_path` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '产品二维码地址(用户小程序海报)', + `soure_link` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '淘宝京东1688类型', + PRIMARY KEY (`id`) USING BTREE, + INDEX `cate_id`(`cate_id`) USING BTREE, + INDEX `is_hot`(`is_hot`) USING BTREE, + INDEX `is_benefit`(`is_benefit`) USING BTREE, + INDEX `is_best`(`is_best`) USING BTREE, + INDEX `is_new`(`is_new`) USING BTREE, + INDEX `toggle_on_sale, is_del`(`is_del`) USING BTREE, + INDEX `price`(`price`) USING BTREE, + INDEX `is_show`(`is_show`) USING BTREE, + INDEX `sort`(`sort`) USING BTREE, + INDEX `sales`(`sales`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `is_postage`(`is_postage`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product +-- ---------------------------- +INSERT INTO `yx_store_product` VALUES (1, 0, 'https://record-1251018669.cos.ap-chengdu.myqcloud.com/0ee17201905151741257691.png', '[\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dba1366885.jpg\",\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dba4187461.jpg\",\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3db9de2b73a.jpg\"]', '无线吸尘器F8 玫瑰金礼盒版', '【年货节活动价1699元,领取吸尘器优惠券再减50元,到手价仅1649元】', '无线吸尘器', '', '2,7', 0.01, 0.00, 1699.00, 1.00, '件', 1, 293, 330, 0, 1, 0, 1, 1, '

', 1547205504, 0, 0, 0, 1699.00, 100.00, 0, 0, 0, 81, 0, '', NULL); +INSERT INTO `yx_store_product` VALUES (2, 0, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dbc27c69c7.jpg', '[\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dbc27c69c7.jpg\",\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dbc6a38fab.jpg\"]', '智能马桶盖 AI版', '智能马桶盖 AI版', '智能马桶', '', '3,2', 0.01, 0.00, 1999.00, 5.00, '件', 0, 212, 938, 1, 1, 1, 1, 1, '

', 1547516202, 1, 0, 0, 1999.00, 1500.00, 0, 0, 0, 20, 0, '', NULL); +INSERT INTO `yx_store_product` VALUES (3, 0, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dc0ef27068.jpg', '[\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dc0ef27068.jpg\",\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dc15ba1972.jpg\"]', '智米加湿器 白色', '智米加湿器 白色', '加湿器', '', '3,2', 249.00, 0.00, 299.00, 0.00, '件', 0, 110, 3949, 1, 1, 1, 1, 1, '

', 1547551009, 1, 0, 0, 249.00, 10.00, 0, 0, 0, 8, 0, '', NULL); +INSERT INTO `yx_store_product` VALUES (4, 0, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dc23646fff.jpg', '[\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dc23646fff.jpg\",\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dc15ba1972.jpg\",\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dc0ef27068.jpg\"]', '互联网电热水器1A', '3000w双管速热,动态360L热水用量,双重漏电保护,智能APP操控', '电热水器', '', '3,2', 999.00, 0.00, 1599.00, 0.00, '件', 0, 86, 414, 0, 1, 1, 0, 1, '

', 1547551346, 1, 0, 0, 999.00, 888.00, 0, 0, 0, 10, 0, '', NULL); +INSERT INTO `yx_store_product` VALUES (5, 0, 'http://datong.crmeb.net/public/uploads/editor/20190115/5c3dbb513b06f.jpeg', '[\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/editor\\/20190115\\/5c3dc294a9a0a.jpg\",\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/editor\\/20190115\\/5c3dbb513b06f.jpeg\"]', '测试', '阿萨德啊', '去', '', '4,7,2,3,19', 1.00, 0.00, 1.00, 0.00, '件', 0, 7, 94, 1, 1, 0, 1, 0, '', 1554863537, 0, 1, 0, 1.00, 1.00, 0, NULL, 0, 1, 0, '', NULL); +INSERT INTO `yx_store_product` VALUES (6, 0, 'https://activityu.crmeb.net//ed0437125c6a0b03313c95c180ad82cd.jpg', '[\"https:\\/\\/activityu.crmeb.net\\/\\/ed0437125c6a0b03313c95c180ad82cd.jpg\",\"https:\\/\\/activityu.crmeb.net\\/\\/ed5a330b2e4df8743e7c8747d2ba077d.jpg\",\"https:\\/\\/activityu.crmeb.net\\/\\/982ee257498f8ab6e757c09cbf2f6865.jpg\",\"https:\\/\\/activityu.crmeb.net\\/\\/ecc9f0b3ae923da5ec116a9b40bd851c.jpg\",\"https:\\/\\/activityu.crmeb.net\\/\\/2ca5fd434e88a579238aeaf31389e2ab.jpg\",\"https:\\/\\/activityu.crmeb.net\\/\\/33f86af708018fbaeead7220642c6e83.jpg\"]', '【小米小米9】小米94800万超广角三摄6GB+128GB全息幻彩蓝骁龙855全网通4G双卡双待水滴全面屏拍照游戏智能手机', '【小米小米9】小米94800万超广角三摄6GB+128GB全息幻彩蓝骁龙855全网通4G双卡双待水滴全面屏拍照游戏智能手机', '小米9', '', '2', 3999.00, 0.00, 3999.00, 0.00, '件', 0, 0, 100, 0, 1, 0, 0, 0, '
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n\n
\n

', 1558580351, 0, 0, 0, 0.00, 3999.00, 0, NULL, 0, 123, 0, '', 'https://item.jd.com/7437708.html'); +INSERT INTO `yx_store_product` VALUES (7, 0, 'http://activity.crmeb.net/public/uploads/attach/2019/05/29//6f2a1ece45e307f274e3384410a3bd3a.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/6f2a1ece45e307f274e3384410a3bd3a.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/ec8484e93ac49309b5576bb5f96d202f.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/60fff157d277d17154d738403870a489.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/3bfee3357bbf0091c2cdfe7aa1da5eec.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/6f2bbcd0dffd379c6f91e95a308bcfb6.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/f92383a6a1be19a7588ccd227e458afd.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/353d754027763daf1ce61d94f7c3709a.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/5f273c529aa59d313f08a36a50a20380.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/27cf255f9990535ed3b333009f1df52c.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/a7dbbc6d4a2ecf16b592b880d937a770.jpg\"]', '【华为畅享9S】华为HUAWEI畅享9S6GB+64GB珊瑚红全网通2400万超广角三摄珍珠屏大存储移动联通电信4G手机双卡双待', '【华为畅享9S】华为HUAWEI畅享9S6GB+64GB珊瑚红全网通2400万超广角三摄珍珠屏大存储移动联通电信4G手机双卡双待', '件', '', '2', 100.00, 0.00, 2000.00, 0.00, '件', 0, 25, 76, 1, 1, 0, 1, 0, '
\n
\n
\n
\n \n\n \n\n \n
\n
\n
\n


', 1559101322, 0, 0, 0, 10.00, 1000.00, 0, NULL, 0, 0, 0, '', 'https://item.jd.com/100005088680.html'); +INSERT INTO `yx_store_product` VALUES (8, 0, 'http://activity.crmeb.net/public/uploads/attach/2019/05/29//71e85589cb7d3398d08f0d55bdb9031d.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/71e85589cb7d3398d08f0d55bdb9031d.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/996c4bad976844b4f3bcf73cbd6e0f15.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/e47f51861c11fc648a298b16c24d8627.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/105cf3b5bbe2e1c7e6366d09b71e88b2.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/e275a4c451e06248cecc0cfb2ed24fed.jpg\"]', '【AppleiPhone8】AppleiPhone8(A1863)256GB深空灰色移动联通电信4G手机', '【AppleiPhone8】AppleiPhone8(A1863)256GB深空灰色移动联通电信4G手机', '件', '', '2', 0.00, 0.00, 1000.00, 0.00, '件', 0, 20, 982, 1, 1, 0, 0, 0, '
\"\"
\"\"
\"\"
\"\"


', 1559101359, 0, 0, 0, 0.00, 1000.00, 0, NULL, 0, 0, 0, '', 'https://item.jd.com/5089241.html'); +INSERT INTO `yx_store_product` VALUES (9, 0, 'http://activity.crmeb.net/public/uploads/attach/2019/05/29//51308e61ace45968fdef953b2ac6c241.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/51308e61ace45968fdef953b2ac6c241.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/d3f3999622cb39eddb966d8cc041cb79.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/c2a01686bee0024c0ae3d08367ef9836.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/7121d81126a84b20a4f8b7e1252d0306.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/a6cc4157d0cf8e79f5b4a7cac1423f25.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/391618fe80748151243ce5e8650ee3bb.jpg\"]', '【雷神911Air星战】雷神(ThundeRobot)911Air星战二代旗舰版15.6英寸窄边框游戏笔记本电脑i79750H512GSSDRGB键盘GTX1650', '【雷神911Air星战】雷神(ThundeRobot)911Air星战二代旗舰版15.6英寸窄边框游戏笔记本电脑i79750H512GSSDRGB键盘GTX1650', '件', '', '2', 1000.00, 0.00, 1000.00, 0.00, '件', 0, 23, 983, 1, 1, 0, 0, 1, '
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n\n
\n

', 1559110455, 0, 0, 0, 0.00, 1000.00, 0, NULL, 0, 20, 0, '', 'https://item.jd.com/100005518258.html'); +INSERT INTO `yx_store_product` VALUES (10, 0, 'http://activity.crmeb.net/public/uploads/attach/2019/05/30//b58f452dc89775b344bade7fdc3ede14.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/b58f452dc89775b344bade7fdc3ede14.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/fe90dcb696cfcef739565894f9e93d9d.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/75a24145aac82bce88931019f91e928a.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/cdbc02ce7907670aa099c486f8959154.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/f8c0ffa71bfc8efae28082bf05c8969a.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/5fda52231265c835f853dd284d7437f9.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/0eaba55adaedcd7d0b17c7202225eed9.jpg\"]', '【华为华为10000mAh快充移动电源/充电宝】华为10000毫安充电宝/移动电源18W双向快充MicroUSB口输入白色适用于安卓/苹果/平板等', '【华为华为10000mAh快充移动电源/充电宝】华为10000毫安充电宝/移动电源18W双向快充MicroUSB口输入白色适用于安卓/苹果/平板等', '', '', '4', 300.00, 0.00, 300.00, 0.00, '件', 0, 0, 100, 0, 1, 0, 1, 0, '
\n \n


', 1559198939, 0, 0, 0, 0.00, 400.00, 0, NULL, 0, 50, 0, '', 'https://item.jd.com/100002611539.html'); +INSERT INTO `yx_store_product` VALUES (11, 0, 'http://activity.crmeb.net/public/uploads/attach/2019/05/30//0eecbfbca9ebc315c2882590fd55a209.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/0eecbfbca9ebc315c2882590fd55a209.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/1a730a7edcb0c373f8188b4d6090999e.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/1da1cff5adc9c053022373596032cbb4.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/d116eb69f06169eed8efd06fcd4dcb90.jpg\",\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/30\\/\\/33f645b107441db0b05eaa428a888ac6.jpg\"]', '伊利酸奶畅轻整箱装乳酸菌燕麦黄桃草莓早餐奶250克9瓶风味发酵乳', '伊利酸奶畅轻整箱装乳酸菌燕麦黄桃草莓早餐奶250克9瓶风味发酵乳', '', '', '4', 80.00, 0.00, 80.00, 0.00, '件', 0, 63, 937, 1, 1, 0, 1, 0, '
', 1559199293, 0, 0, 0, 0.00, 90.00, 0, NULL, 0, 10, 0, '', 'https://detail.tmall.com/item.htm?spm=a1z10.5-b-s.w4011-19034888351.47.551172542eL9Go&id=569589000841&rn=cdeb08db2601055d6c446c7400b0057f&abbucket=3'); +INSERT INTO `yx_store_product` VALUES (12, 0, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\"]', '测撒测试', '测撒测试', '测撒测试', '', '3', 10.00, 0.00, 10.00, 0.00, '件', 0, 4, 996, 1, 1, 1, 1, 1, '', 1560650420, 1, 1, 0, 0.00, 5.00, 0, NULL, 0, 100, 0, '', ''); +INSERT INTO `yx_store_product` VALUES (13, 0, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\"]', '测撒测试', '测撒测试', '测撒测试', '', '3', 10.00, 0.00, 10.00, 0.00, '件', 0, 1, 999, 1, 1, 1, 1, 1, '', 1560650420, 1, 1, 0, 0.00, 5.00, 0, NULL, 0, 100, 0, '', ''); +INSERT INTO `yx_store_product` VALUES (14, 0, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\"]', '测撒测试', '测撒测试', '测撒测试', '', '3', 10.00, 0.00, 10.00, 0.00, '件', 0, 3, 997, 1, 1, 1, 1, 1, '', 1560650420, 1, 1, 0, 0.00, 5.00, 0, NULL, 0, 100, 0, '', ''); +INSERT INTO `yx_store_product` VALUES (15, 0, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', '[\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\"]', '测撒测试', '测撒测试', '测撒测试', '', '3', 10.00, 0.00, 10.00, 0.00, '件', 0, 15, 998, 1, 1, 1, 1, 1, '', 1560650420, 1, 1, 0, 0.00, 5.00, 0, NULL, 0, 100, 0, '', ''); +INSERT INTO `yx_store_product` VALUES (17, 0, 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/69eb5f09f947ff53244a57d5c021b817.jpg', '[\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/07\\/30\\/69eb5f09f947ff53244a57d5c021b817.jpg\",\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/07\\/30\\/ce0a2ed478552ca0bfc7092f337c8d10.jpg\",\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/07\\/30\\/13efc762f7fdfec35ad2eeedc541db4b.jpg\",\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/07\\/30\\/4d280506de9f99621d6c9257abb00002.jpg\",\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/07\\/30\\/b07e8708977de9c820d7d97958776f8d.jpg\"]', '微信小程序公众号商城源码模板开发定制作拼团购带后台教程CRMEB', '微信小程序公众号商城源码模板开发定制作拼团购带后台教程CRMEB', '', '', '4', 498.00, 0.00, 498.00, 0.00, '件', 0, 0, 498, 1, 0, 0, 0, 0, '



添加影藏字符
', 1564471319, 0, 0, 0, 0.00, 498.00, 0, NULL, 0, 498, 0, '', 'https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-10814341800.8.26d7346bMJoug6&id=575636560349'); +INSERT INTO `yx_store_product` VALUES (18, 0, 'http://kaifa.crmeb.net/uploads/attach/2019/08/20190805/887db984b5f1138e08e1d9b069af766e.jpg', '[\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190805\\/887db984b5f1138e08e1d9b069af766e.jpg\"]', '111', '111', '111', '', '', 20.00, 0.00, 20.00, 0.00, '件', 0, 0, 20, 0, 0, 0, 0, 0, '', 1565148206, 0, 0, 0, 0.00, 0.00, 0, NULL, 0, 0, 0, '', ''); +INSERT INTO `yx_store_product` VALUES (19, 0, 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/4e3396f4248e9e5ef2eab5505216ade0.jpg', '[\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/13\\/4e3396f4248e9e5ef2eab5505216ade0.jpg\",\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/13\\/5653627e73313cf61c9620725c45a376.jpg\",\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/13\\/1d9d4158d2d7c7f0466e78207246e845.jpg\",\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/13\\/3f9bfd12b76f290d3ed82ea44ebb399a.jpg\",\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/13\\/e8c9d50e6b7cef371fe742ab08abd6a4.jpg\"]', '【直营】ZOJIRUSHI象印进口不锈钢便携保温杯KB48480ml日本tmall.hk天猫国际', '【直营】ZOJIRUSHI象印进口不锈钢便携保温杯KB48480ml日本tmall.hk天猫国际', '', '', '4', 22.00, 0.00, 56.00, 0.00, '件', 0, 0, 222, 1, 0, 0, 0, 0, '
 
 
', 1565687845, 0, 0, 0, 0.00, 22.00, 0, NULL, 0, 22, 0, '', 'https://detail.tmall.hk/hk/item.htm?spm=a1z10.1-b.w4004-21302208419.5.46261c5bwAUxpO&pvid=b786cf12-f690-4910-9535-e0fe5825e8f6&pos=2&acm=03068.1003.1.702815&id=586996993214&scm=1007.12941.28043.100200300000000'); + +-- ---------------------------- +-- Table structure for yx_store_product_attr +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_attr`; +CREATE TABLE `yx_store_product_attr` ( + `product_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品ID', + `attr_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '属性名', + `attr_values` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '属性值', + INDEX `store_id`(`product_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product_attr +-- ---------------------------- +INSERT INTO `yx_store_product_attr` VALUES (3, '容量', '3L,4L'); +INSERT INTO `yx_store_product_attr` VALUES (3, '颜色', '白色,黑色'); +INSERT INTO `yx_store_product_attr` VALUES (15, '颜色', '黑色,白色,紫色'); +INSERT INTO `yx_store_product_attr` VALUES (15, '规则', '大,小'); +INSERT INTO `yx_store_product_attr` VALUES (2, '孔距', '30cm,40cm'); +INSERT INTO `yx_store_product_attr` VALUES (2, '材质', '陶瓷,不锈钢'); +INSERT INTO `yx_store_product_attr` VALUES (7, '1', '2,3'); +INSERT INTO `yx_store_product_attr` VALUES (7, '3', '1'); +INSERT INTO `yx_store_product_attr` VALUES (8, '1', '1,3'); +INSERT INTO `yx_store_product_attr` VALUES (8, '2', '2'); + +-- ---------------------------- +-- Table structure for yx_store_product_attr_result +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_attr_result`; +CREATE TABLE `yx_store_product_attr_result` ( + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID', + `result` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品属性参数', + `change_time` int(10) UNSIGNED NOT NULL COMMENT '上次修改时间', + UNIQUE INDEX `product_id`(`product_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性详情表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product_attr_result +-- ---------------------------- +INSERT INTO `yx_store_product_attr_result` VALUES (2, '{\"attr\":[{\"value\":\"\\u5b54\\u8ddd\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"30cm\",\"40cm\"]},{\"value\":\"\\u6750\\u8d28\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"\\u9676\\u74f7\",\"\\u4e0d\\u9508\\u94a2\"]}],\"value\":[{\"detail\":{\"\\u5b54\\u8ddd\":\"30cm\",\"\\u6750\\u8d28\":\"\\u9676\\u74f7\"},\"cost\":\"1500.00\",\"price\":0.02,\"sales\":936,\"pic\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dbc27c69c7.jpg\",\"check\":false},{\"detail\":{\"\\u5b54\\u8ddd\":\"30cm\",\"\\u6750\\u8d28\":\"\\u4e0d\\u9508\\u94a2\"},\"cost\":\"1500.00\",\"price\":0.03,\"sales\":936,\"pic\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dbc27c69c7.jpg\",\"check\":false},{\"detail\":{\"\\u5b54\\u8ddd\":\"40cm\",\"\\u6750\\u8d28\":\"\\u9676\\u74f7\"},\"cost\":\"1500.00\",\"price\":\"0.01\",\"sales\":938,\"pic\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dbc27c69c7.jpg\",\"check\":false},{\"detail\":{\"\\u5b54\\u8ddd\":\"40cm\",\"\\u6750\\u8d28\":\"\\u4e0d\\u9508\\u94a2\"},\"cost\":\"1500.00\",\"price\":\"0.01\",\"sales\":937,\"pic\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dbc27c69c7.jpg\",\"check\":false}]}', 1565600373); +INSERT INTO `yx_store_product_attr_result` VALUES (3, '{\"attr\":[{\"value\":\"\\u5bb9\\u91cf\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"3L\",\"4L\"]},{\"value\":\"\\u989c\\u8272\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"\\u767d\\u8272\",\"\\u9ed1\\u8272\"]}],\"value\":[{\"detail\":{\"\\u5bb9\\u91cf\":\"3L\",\"\\u989c\\u8272\":\"\\u9ed1\\u8272\"},\"cost\":\"10.00\",\"price\":249,\"sales\":20,\"pic\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dc15ba1972.jpg\",\"check\":false},{\"detail\":{\"\\u5bb9\\u91cf\":\"4L\",\"\\u989c\\u8272\":\"\\u9ed1\\u8272\"},\"cost\":\"10.00\",\"price\":299,\"sales\":999,\"pic\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dc15ba1972.jpg\",\"check\":false}]}', 1559378824); +INSERT INTO `yx_store_product_attr_result` VALUES (7, '{\"attr\":[{\"value\":\"1\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"2\",\"3\"]},{\"value\":\"3\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"1\"]}],\"value\":[{\"detail\":{\"1\":\"2\",\"3\":\"1\"},\"cost\":\"1000.00\",\"price\":\"100.00\",\"sales\":76,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/6f2a1ece45e307f274e3384410a3bd3a.jpg\",\"check\":false},{\"detail\":{\"1\":\"3\",\"3\":\"1\"},\"cost\":\"1000.00\",\"price\":\"100.00\",\"sales\":76,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/6f2a1ece45e307f274e3384410a3bd3a.jpg\",\"check\":false}]}', 1565665933); +INSERT INTO `yx_store_product_attr_result` VALUES (8, '{\"attr\":[{\"value\":\"1\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"1\",\"3\"]},{\"value\":\"2\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"2\"]}],\"value\":[{\"detail\":{\"1\":\"1\",\"2\":\"2\"},\"cost\":\"1000.00\",\"price\":\"0.00\",\"sales\":982,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/71e85589cb7d3398d08f0d55bdb9031d.jpg\",\"check\":false},{\"detail\":{\"1\":\"3\",\"2\":\"2\"},\"cost\":\"1000.00\",\"price\":\"0.00\",\"sales\":982,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/71e85589cb7d3398d08f0d55bdb9031d.jpg\",\"check\":false}]}', 1565680773); +INSERT INTO `yx_store_product_attr_result` VALUES (9, '{\"attr\":[{\"value\":\"\\u914d\\u7f6e\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"i7-9750H 512GSSD RGB\\u952e\\u76d8 GTX1650\",\"i7-9750H 8G 512GSSD GTX1050\",\"i5-9300H 8G 512GSSD GTX1050)\"]}],\"value\":[{\"detail\":{\"\\u914d\\u7f6e\":\"i7-9750H 512GSSD RGB\\u952e\\u76d8 GTX1650\"},\"cost\":\"1000.00\",\"price\":\"1000.00\",\"sales\":984,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/51308e61ace45968fdef953b2ac6c241.jpg\",\"check\":false},{\"detail\":{\"\\u914d\\u7f6e\":\"i7-9750H 8G 512GSSD GTX1050\"},\"cost\":\"1000.00\",\"price\":900,\"sales\":984,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/51308e61ace45968fdef953b2ac6c241.jpg\",\"check\":false},{\"detail\":{\"\\u914d\\u7f6e\":\"i5-9300H 8G 512GSSD GTX1050)\"},\"cost\":\"1000.00\",\"price\":800,\"sales\":984,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/05\\/29\\/\\/51308e61ace45968fdef953b2ac6c241.jpg\",\"check\":false}]}', 1565172349); +INSERT INTO `yx_store_product_attr_result` VALUES (15, '{\"attr\":[{\"value\":\"\\u989c\\u8272\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"\\u9ed1\\u8272\",\"\\u767d\\u8272\",\"\\u7d2b\\u8272\"]},{\"value\":\"\\u89c4\\u5219\",\"detailValue\":\"\",\"attrHidden\":true,\"detail\":[\"\\u5927\",\"\\u5c0f\"]}],\"value\":[{\"detail\":{\"\\u989c\\u8272\":\"\\u9ed1\\u8272\",\"\\u89c4\\u5219\":\"\\u5927\"},\"price\":70,\"cost\":\"5.00\",\"sales\":998,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\",\"check\":false},{\"detail\":{\"\\u989c\\u8272\":\"\\u9ed1\\u8272\",\"\\u89c4\\u5219\":\"\\u5c0f\"},\"cost\":\"5.00\",\"price\":60,\"sales\":998,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\",\"check\":false},{\"detail\":{\"\\u989c\\u8272\":\"\\u767d\\u8272\",\"\\u89c4\\u5219\":\"\\u5927\"},\"cost\":\"5.00\",\"price\":50,\"sales\":998,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\",\"check\":false},{\"detail\":{\"\\u989c\\u8272\":\"\\u767d\\u8272\",\"\\u89c4\\u5219\":\"\\u5c0f\"},\"cost\":\"5.00\",\"price\":40,\"sales\":998,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\",\"check\":false},{\"detail\":{\"\\u989c\\u8272\":\"\\u7d2b\\u8272\",\"\\u89c4\\u5219\":\"\\u5927\"},\"cost\":\"5.00\",\"price\":10,\"sales\":202,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\",\"check\":false},{\"detail\":{\"\\u989c\\u8272\":\"\\u7d2b\\u8272\",\"\\u89c4\\u5219\":\"\\u5c0f\"},\"cost\":\"5.00\",\"price\":20,\"sales\":200,\"pic\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\",\"check\":false}]}', 1563346586); + +-- ---------------------------- +-- Table structure for yx_store_product_attr_value +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_attr_value`; +CREATE TABLE `yx_store_product_attr_value` ( + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID', + `suk` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品属性索引值 (attr_value|attr_value[|....])', + `stock` int(10) UNSIGNED NOT NULL COMMENT '属性对应的库存', + `sales` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '销量', + `price` decimal(8, 2) UNSIGNED NOT NULL COMMENT '属性金额', + `image` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片', + `unique` char(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '唯一值', + `cost` decimal(8, 2) UNSIGNED NOT NULL COMMENT '成本价', + UNIQUE INDEX `unique`(`unique`, `suk`) USING BTREE, + INDEX `store_id`(`product_id`, `suk`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性值表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product_attr_value +-- ---------------------------- +INSERT INTO `yx_store_product_attr_value` VALUES (15, '小,白色', 997, 1, 40.00, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', '08af4c92', 5.00); +INSERT INTO `yx_store_product_attr_value` VALUES (15, '大,黑色', 993, 5, 70.00, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', '1bf9fad8', 5.00); +INSERT INTO `yx_store_product_attr_value` VALUES (8, '1,2', 980, 2, 0.00, 'http://activity.crmeb.net/public/uploads/attach/2019/05/29//71e85589cb7d3398d08f0d55bdb9031d.jpg', '304d1fc7', 1000.00); +INSERT INTO `yx_store_product_attr_value` VALUES (2, '40cm,不锈钢', 937, 0, 0.01, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dbc27c69c7.jpg', '39b97621', 1500.00); +INSERT INTO `yx_store_product_attr_value` VALUES (2, '30cm,不锈钢', 936, 0, 0.03, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dbc27c69c7.jpg', '51c7f751', 1500.00); +INSERT INTO `yx_store_product_attr_value` VALUES (8, '2,3', 982, 0, 0.00, 'http://activity.crmeb.net/public/uploads/attach/2019/05/29//71e85589cb7d3398d08f0d55bdb9031d.jpg', '5fe3af25', 1000.00); +INSERT INTO `yx_store_product_attr_value` VALUES (2, '30cm,陶瓷', 924, 12, 0.02, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dbc27c69c7.jpg', '63912ead', 1500.00); +INSERT INTO `yx_store_product_attr_value` VALUES (7, '1,2', 75, 1, 100.00, 'http://activity.crmeb.net/public/uploads/attach/2019/05/29//6f2a1ece45e307f274e3384410a3bd3a.jpg', '76862ff5', 1000.00); +INSERT INTO `yx_store_product_attr_value` VALUES (15, '大,紫色', 202, 0, 10.00, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', '7a06e7f9', 5.00); +INSERT INTO `yx_store_product_attr_value` VALUES (2, '40cm,陶瓷', 938, 0, 0.01, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dbc27c69c7.jpg', 'a6c4ecd2', 1500.00); +INSERT INTO `yx_store_product_attr_value` VALUES (3, '4L,黑色', 967, 32, 299.00, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dc15ba1972.jpg', 'aa5915e8', 10.00); +INSERT INTO `yx_store_product_attr_value` VALUES (3, '3L,黑色', 0, 20, 249.00, 'http://datong.crmeb.net/public/uploads/attach/2019/01/15/5c3dc15ba1972.jpg', 'c1fd48a6', 10.00); +INSERT INTO `yx_store_product_attr_value` VALUES (15, '小,紫色', 195, 5, 20.00, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', 'd630e29a', 5.00); +INSERT INTO `yx_store_product_attr_value` VALUES (7, '1,3', 76, 0, 100.00, 'http://activity.crmeb.net/public/uploads/attach/2019/05/29//6f2a1ece45e307f274e3384410a3bd3a.jpg', 'd7b47f88', 1000.00); +INSERT INTO `yx_store_product_attr_value` VALUES (15, '小,黑色', 997, 1, 60.00, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', 'e4d9a758', 5.00); +INSERT INTO `yx_store_product_attr_value` VALUES (15, '大,白色', 997, 1, 50.00, 'http://activity.crmeb.net/public/uploads/editor/20190605/5cf737bf264e4.jpg', 'f208c727', 5.00); + +-- ---------------------------- +-- Table structure for yx_store_product_cate +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_cate`; +CREATE TABLE `yx_store_product_cate` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `product_id` int(11) NOT NULL DEFAULT 0 COMMENT '产品id', + `cate_id` int(11) NOT NULL DEFAULT 0 COMMENT '分类id', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 73 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品分类辅助表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product_cate +-- ---------------------------- +INSERT INTO `yx_store_product_cate` VALUES (14, 6, 2, 1558580351); +INSERT INTO `yx_store_product_cate` VALUES (24, 4, 3, 1559110372); +INSERT INTO `yx_store_product_cate` VALUES (25, 4, 2, 1559110372); +INSERT INTO `yx_store_product_cate` VALUES (28, 3, 3, 1559110403); +INSERT INTO `yx_store_product_cate` VALUES (29, 3, 2, 1559110403); +INSERT INTO `yx_store_product_cate` VALUES (38, 12, 3, 1560650420); +INSERT INTO `yx_store_product_cate` VALUES (49, 5, 4, 1562729229); +INSERT INTO `yx_store_product_cate` VALUES (50, 5, 7, 1562729229); +INSERT INTO `yx_store_product_cate` VALUES (51, 5, 2, 1562729229); +INSERT INTO `yx_store_product_cate` VALUES (52, 5, 3, 1562729229); +INSERT INTO `yx_store_product_cate` VALUES (53, 5, 19, 1562729229); +INSERT INTO `yx_store_product_cate` VALUES (55, 11, 4, 1562729250); +INSERT INTO `yx_store_product_cate` VALUES (59, 10, 4, 1562741711); +INSERT INTO `yx_store_product_cate` VALUES (60, 1, 2, 1562835320); +INSERT INTO `yx_store_product_cate` VALUES (61, 1, 7, 1562835320); +INSERT INTO `yx_store_product_cate` VALUES (64, 17, 4, 1564471319); +INSERT INTO `yx_store_product_cate` VALUES (65, 2, 3, 1565148046); +INSERT INTO `yx_store_product_cate` VALUES (66, 2, 2, 1565148046); +INSERT INTO `yx_store_product_cate` VALUES (67, 18, 0, 1565148206); +INSERT INTO `yx_store_product_cate` VALUES (68, 9, 2, 1565148922); +INSERT INTO `yx_store_product_cate` VALUES (70, 8, 2, 1565426114); +INSERT INTO `yx_store_product_cate` VALUES (71, 7, 2, 1565600246); +INSERT INTO `yx_store_product_cate` VALUES (72, 19, 4, 1565687845); + +-- ---------------------------- +-- Table structure for yx_store_product_relation +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_relation`; +CREATE TABLE `yx_store_product_relation` ( + `uid` int(10) UNSIGNED NOT NULL COMMENT '用户ID', + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID', + `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型(收藏(collect)、点赞(like))', + `category` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '某种类型的商品(普通商品、秒杀商品)', + `add_time` int(10) UNSIGNED NOT NULL COMMENT '添加时间', + UNIQUE INDEX `uid`(`uid`, `product_id`, `type`, `category`) USING BTREE, + INDEX `type`(`type`) USING BTREE, + INDEX `category`(`category`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品点赞和收藏表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_product_reply +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_reply`; +CREATE TABLE `yx_store_product_reply` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '评论ID', + `uid` int(11) NOT NULL COMMENT '用户ID', + `oid` int(11) NOT NULL COMMENT '订单ID', + `unique` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '唯一id', + `product_id` int(11) NOT NULL COMMENT '产品id', + `reply_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'product' COMMENT '某种商品类型(普通商品、秒杀商品)', + `product_score` tinyint(1) NOT NULL COMMENT '商品分数', + `service_score` tinyint(1) NOT NULL COMMENT '服务分数', + `comment` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '评论内容', + `pics` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '评论图片', + `add_time` int(11) NOT NULL COMMENT '评论时间', + `merchant_reply_content` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '管理员回复内容', + `merchant_reply_time` int(11) NULL DEFAULT NULL COMMENT '管理员回复时间', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0未删除1已删除', + `is_reply` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0未回复1已回复', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `order_id_2`(`oid`, `unique`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `parent_id`(`reply_type`) USING BTREE, + INDEX `is_del`(`is_del`) USING BTREE, + INDEX `product_score`(`product_score`) USING BTREE, + INDEX `service_score`(`service_score`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '评论表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_seckill +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_seckill`; +CREATE TABLE `yx_store_seckill` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '商品秒杀产品表id', + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品id', + `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '推荐图', + `images` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '轮播图', + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '活动标题', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '简介', + `price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '价格', + `cost` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '成本', + `ot_price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '原价', + `give_integral` decimal(10, 2) UNSIGNED NOT NULL COMMENT '返多少积分', + `sort` int(10) UNSIGNED NOT NULL COMMENT '排序', + `stock` int(10) UNSIGNED NOT NULL COMMENT '库存', + `sales` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '销量', + `unit_name` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '单位名', + `postage` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '邮费', + `description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '内容', + `start_time` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '开始时间', + `stop_time` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '结束时间', + `add_time` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '添加时间', + `status` tinyint(1) UNSIGNED NOT NULL COMMENT '产品状态', + `is_postage` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否包邮', + `is_hot` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '热门推荐', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除 0未删除1已删除', + `num` int(11) UNSIGNED NOT NULL COMMENT '最多秒杀几个', + `is_show` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '显示', + PRIMARY KEY (`id`) USING BTREE, + INDEX `product_id`(`product_id`) USING BTREE, + INDEX `start_time`(`start_time`, `stop_time`) USING BTREE, + INDEX `is_del`(`is_del`) USING BTREE, + INDEX `is_hot`(`is_hot`) USING BTREE, + INDEX `is_show`(`status`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `sort`(`sort`) USING BTREE, + INDEX `is_postage`(`is_postage`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品秒杀产品表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_seckill_attr +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_seckill_attr`; +CREATE TABLE `yx_store_seckill_attr` ( + `product_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品ID', + `attr_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '属性名', + `attr_values` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '属性值', + INDEX `store_id`(`product_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '秒杀商品属性表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_seckill_attr_result +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_seckill_attr_result`; +CREATE TABLE `yx_store_seckill_attr_result` ( + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID', + `result` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品属性参数', + `change_time` int(10) UNSIGNED NOT NULL COMMENT '上次修改时间', + UNIQUE INDEX `product_id`(`product_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '秒杀商品属性详情表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_seckill_attr_value +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_seckill_attr_value`; +CREATE TABLE `yx_store_seckill_attr_value` ( + `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID', + `suk` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商品属性索引值 (attr_value|attr_value[|....])', + `stock` int(10) UNSIGNED NOT NULL COMMENT '属性对应的库存', + `sales` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '销量', + `price` decimal(8, 2) UNSIGNED NOT NULL COMMENT '属性金额', + `image` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片', + `unique` char(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '唯一值', + `cost` decimal(8, 2) UNSIGNED NOT NULL COMMENT '成本价', + UNIQUE INDEX `unique`(`unique`, `suk`) USING BTREE, + INDEX `store_id`(`product_id`, `suk`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '秒杀商品属性值表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_service +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_service`; +CREATE TABLE `yx_store_service` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '客服id', + `mer_id` int(11) NOT NULL DEFAULT 0 COMMENT '商户id', + `uid` int(11) NOT NULL COMMENT '客服uid', + `avatar` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客服头像', + `nickname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '代理名称', + `add_time` int(11) NOT NULL COMMENT '添加时间', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '0隐藏1显示', + `notify` int(2) NULL DEFAULT 0 COMMENT '订单通知1开启0关闭', + `customer` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否展示统计管理', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '客服表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_service_log +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_service_log`; +CREATE TABLE `yx_store_service_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '客服用户对话记录表ID', + `mer_id` int(11) NOT NULL DEFAULT 0 COMMENT '商户id', + `msn` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '消息内容', + `uid` int(11) NOT NULL COMMENT '发送人uid', + `to_uid` int(11) NOT NULL COMMENT '接收人uid', + `add_time` int(11) NOT NULL COMMENT '发送时间', + `type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已读(0:否;1:是;)', + `remind` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否提醒过', + `msn_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '消息类型 1=文字 2=表情 3=图片 4=语音', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '客服用户对话记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_store_visit +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_visit`; +CREATE TABLE `yx_store_visit` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `product_id` int(11) NULL DEFAULT NULL COMMENT '产品ID', + `product_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品类型', + `cate_id` int(11) NULL DEFAULT NULL COMMENT '产品分类ID', + `type` char(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品类型', + `uid` int(11) NULL DEFAULT NULL COMMENT '用户ID', + `count` int(11) NULL DEFAULT NULL COMMENT '访问次数', + `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注描述', + `add_time` int(11) NULL DEFAULT NULL COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品浏览分析表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_system_admin +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_admin`; +CREATE TABLE `yx_system_admin` ( + `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '后台管理员表ID', + `account` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '后台管理员账号', + `pwd` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '后台管理员密码', + `real_name` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '后台管理员姓名', + `roles` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '后台管理员权限(menus_id)', + `last_ip` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '后台管理员最后一次登录ip', + `last_time` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '后台管理员最后一次登录时间', + `add_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '后台管理员添加时间', + `login_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '登录次数', + `level` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '后台管理员级别', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '后台管理员状态 1有效0无效', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE, + INDEX `account`(`account`) USING BTREE, + INDEX `status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台管理员表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_admin +-- ---------------------------- +INSERT INTO `yx_system_admin` VALUES (1, 'admin', '0192023a7bbd73250516f069df18b500', 'admin', '1', '127.0.0.1', 1569919508, 1569919508, 0, 0, 1, 0); + +-- ---------------------------- +-- Table structure for yx_system_attachment +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_attachment`; +CREATE TABLE `yx_system_attachment` ( + `att_id` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '附件名称', + `att_dir` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '附件路径', + `satt_dir` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '压缩图片路径', + `att_size` char(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '附件大小', + `att_type` char(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '附件类型', + `pid` int(10) NOT NULL DEFAULT 0 COMMENT '分类ID0编辑器,1产品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图', + `time` int(11) NOT NULL DEFAULT 0 COMMENT '上传时间', + `image_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '图片上传类型 1本地 2七牛云 3OSS 4COS ', + `module_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '图片上传模块类型 1 后台上传 2 用户生成', + PRIMARY KEY (`att_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1204 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '附件管理表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_attachment +-- ---------------------------- +INSERT INTO `yx_system_attachment` VALUES (12, '168_1_user.jpg', '/uploads/routine/spread/code/168_1_user.jpg', '/uploads/routine/spread/code/168_1_user.jpg', '50431', 'image/jpeg', 1, 1563177732, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (13, '2b6d620190715160332336066.jpg', '/uploads/routine/spread/poster/2b6d620190715160332336066.jpg', '/uploads/routine/spread/poster/2b6d620190715160332336066.jpg', '82774', 'image/jpeg', 1, 1563177812, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (14, 'b5b0d20190715160333254748.jpg', '/uploads/routine/spread/poster/b5b0d20190715160333254748.jpg', '/uploads/routine/spread/poster/b5b0d20190715160333254748.jpg', '54643', 'image/jpeg', 1, 1563177813, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (15, '4409220190715160333270310.jpg', '/uploads/routine/spread/poster/4409220190715160333270310.jpg', '/uploads/routine/spread/poster/4409220190715160333270310.jpg', '75479', 'image/jpeg', 1, 1563177813, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (16, '3_168_1_pink_share.jpg', '/uploads/routine/activity/pink/code/3_168_1_pink_share.jpg', '/uploads/routine/activity/pink/code/3_168_1_pink_share.jpg', '48726', 'image/jpeg', 1, 1563273359, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (17, 'dfea020190716183820281488.jpg', '/uploads/routine/activity/pink/poster/dfea020190716183820281488.jpg', '/uploads/routine/activity/pink/poster/dfea020190716183820281488.jpg', '45247', 'image/jpeg', 1, 1563273500, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (18, '6e66320190716183925393446.jpg', '/uploads/routine/activity/pink/poster/6e66320190716183925393446.jpg', '/uploads/routine/activity/pink/poster/6e66320190716183925393446.jpg', '45247', 'image/jpeg', 1, 1563273565, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (19, '3b24120190716183958426296.jpg', '/uploads/routine/activity/pink/poster/3b24120190716183958426296.jpg', '/uploads/routine/activity/pink/poster/3b24120190716183958426296.jpg', '45247', 'image/jpeg', 1, 1563273598, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (21, 'c142dc6f250734afe28f3341d196a580.jpg', '/uploads/store/comment/20190718\\c142dc6f250734afe28f3341d196a580.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190718\\s_c142dc6f250734afe28f3341d196a580.jpg', '8773', 'image/jpeg', 1, 1563420555, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (22, '10___bargain_share.jpg', '/uploads/routine/activity/bargain/code/10___bargain_share.jpg', '/uploads/routine/activity/bargain/code/10___bargain_share.jpg', '53629', 'image/jpeg', 1, 1563439726, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (23, '10_168_1_bargain_share.jpg', '/uploads/routine/activity/bargain/code/10_168_1_bargain_share.jpg', '/uploads/routine/activity/bargain/code/10_168_1_bargain_share.jpg', '54706', 'image/jpeg', 1, 1563439783, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (24, '663682019071816501132703.jpg', '/uploads/routine/activity/bargain/poster/663682019071816501132703.jpg', '/uploads/routine/activity/bargain/poster/663682019071816501132703.jpg', '46096', 'image/jpeg', 1, 1563439811, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (25, 'eaa5220190718165029826312.jpg', '/uploads/routine/activity/bargain/poster/eaa5220190718165029826312.jpg', '/uploads/routine/activity/bargain/poster/eaa5220190718165029826312.jpg', '46096', 'image/jpeg', 1, 1563439829, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (26, '10_1_0_bargain_share.jpg', '/uploads/routine/activity/bargain/code/10_1_0_bargain_share.jpg', '/uploads/routine/activity/bargain/code/10_1_0_bargain_share.jpg', '55184', 'image/jpeg', 1, 1563440060, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (27, 'b049020190718165420905273.jpg', '/uploads/routine/activity/bargain/poster/b049020190718165420905273.jpg', '/uploads/routine/activity/bargain/poster/b049020190718165420905273.jpg', '46130', 'image/jpeg', 1, 1563440060, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (28, '58a2f2019071816550128018.jpg', '/uploads/routine/activity/bargain/poster/58a2f2019071816550128018.jpg', '/uploads/routine/activity/bargain/poster/58a2f2019071816550128018.jpg', '46130', 'image/jpeg', 1, 1563440101, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (29, '285a220190718170251156695.jpg', '/uploads/routine/activity/bargain/poster/285a220190718170251156695.jpg', '/uploads/routine/activity/bargain/poster/285a220190718170251156695.jpg', '46130', 'image/jpeg', 1, 1563440571, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (33, '8744c20190718170531488631.jpg', '/uploads/routine/activity/bargain/poster/8744c20190718170531488631.jpg', '/uploads/routine/activity/bargain/poster/8744c20190718170531488631.jpg', '46130', 'image/jpeg', 1, 1563440731, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (34, '0704220190718172553515311.jpg', '/uploads/routine/activity/bargain/poster/0704220190718172553515311.jpg', '/uploads/routine/activity/bargain/poster/0704220190718172553515311.jpg', '46130', 'image/jpeg', 1, 1563441953, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (35, '7_1_0_pink_share.jpg', '/uploads/routine/activity/pink/code/7_1_0_pink_share.jpg', '/uploads/routine/activity/pink/code/7_1_0_pink_share.jpg', '48636', 'image/jpeg', 1, 1563504328, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (36, '6_1_0_pink_share.jpg', '/uploads/routine/activity/pink/code/6_1_0_pink_share.jpg', '/uploads/routine/activity/pink/code/6_1_0_pink_share.jpg', '49412', 'image/jpeg', 1, 1563504466, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (37, 'f80ff20190719104746932275.jpg', '/uploads/routine/activity/pink/poster/f80ff20190719104746932275.jpg', '/uploads/routine/activity/pink/poster/f80ff20190719104746932275.jpg', '45127', 'image/jpeg', 1, 1563504466, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (38, 'afa2920190719104752727792.jpg', '/uploads/routine/activity/pink/poster/afa2920190719104752727792.jpg', '/uploads/routine/activity/pink/poster/afa2920190719104752727792.jpg', '45127', 'image/jpeg', 1, 1563504472, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (39, 'ba9a520190719104831534994.jpg', '/uploads/routine/activity/pink/poster/ba9a520190719104831534994.jpg', '/uploads/routine/activity/pink/poster/ba9a520190719104831534994.jpg', '45127', 'image/jpeg', 1, 1563504511, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (40, '050492019071910483639409.jpg', '/uploads/routine/activity/pink/poster/050492019071910483639409.jpg', '/uploads/routine/activity/pink/poster/050492019071910483639409.jpg', '45127', 'image/jpeg', 1, 1563504516, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (41, 'f0e6b20190719104923546522.jpg', '/uploads/routine/activity/pink/poster/f0e6b20190719104923546522.jpg', '/uploads/routine/activity/pink/poster/f0e6b20190719104923546522.jpg', '45127', 'image/jpeg', 1, 1563504563, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (42, 'd17e620190719104953992864.jpg', '/uploads/routine/activity/pink/poster/d17e620190719104953992864.jpg', '/uploads/routine/activity/pink/poster/d17e620190719104953992864.jpg', '45127', 'image/jpeg', 1, 1563504593, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (43, 'bdc8b20190719105133834434.jpg', '/uploads/routine/activity/pink/poster/bdc8b20190719105133834434.jpg', '/uploads/routine/activity/pink/poster/bdc8b20190719105133834434.jpg', '45127', 'image/jpeg', 1, 1563504693, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (44, '87f4d20190719105137310521.jpg', '/uploads/routine/activity/pink/poster/87f4d20190719105137310521.jpg', '/uploads/routine/activity/pink/poster/87f4d20190719105137310521.jpg', '45127', 'image/jpeg', 1, 1563504697, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (45, 'f93fefadd6424621601198bed88e2ea3.png', '/uploads/store/comment/20190719\\f93fefadd6424621601198bed88e2ea3.png', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_f93fefadd6424621601198bed88e2ea3.png', '608612', 'image/png', 1, 1563508598, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (46, '6f3169dcdb59144a81b06ba82c07618a.jpg', '/uploads/store/comment/20190719\\6f3169dcdb59144a81b06ba82c07618a.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_6f3169dcdb59144a81b06ba82c07618a.jpg', '6172', 'image/jpeg', 1, 1563508629, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (47, '1f712a266283991d9ab09bab09045193.jpg', '/uploads/store/comment/20190719\\1f712a266283991d9ab09bab09045193.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_1f712a266283991d9ab09bab09045193.jpg', '6172', 'image/jpeg', 1, 1563508686, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (48, '2bc128a4e1095c754e8452faadceb6e9.jpg', '/uploads/store/comment/20190719\\2bc128a4e1095c754e8452faadceb6e9.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_2bc128a4e1095c754e8452faadceb6e9.jpg', '7278', 'image/jpeg', 1, 1563508700, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (49, 'a082028fe47056b4989026e84241ee64.jpg', '/uploads/store/comment/20190719\\a082028fe47056b4989026e84241ee64.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_a082028fe47056b4989026e84241ee64.jpg', '7278', 'image/jpeg', 1, 1563522863, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (50, 'bc5922f4c6293ee19baf506a41b018f9.jpg', '/uploads/store/comment/20190719\\bc5922f4c6293ee19baf506a41b018f9.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_bc5922f4c6293ee19baf506a41b018f9.jpg', '6172', 'image/jpeg', 1, 1563522868, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (51, 'e364e279736147ee751d52890384c180.jpg', '/uploads/store/comment/20190719\\e364e279736147ee751d52890384c180.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_e364e279736147ee751d52890384c180.jpg', '6172', 'image/jpeg', 1, 1563522872, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (52, 'ff531ee1821d1337b49ef54d72c64275.jpg', '/uploads/store/comment/20190719\\ff531ee1821d1337b49ef54d72c64275.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_ff531ee1821d1337b49ef54d72c64275.jpg', '7278', 'image/jpeg', 1, 1563523815, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (53, 'e69a1c8fde5f2c2e7a03cf73760e376e.jpg', '/uploads/store/comment/20190719\\e69a1c8fde5f2c2e7a03cf73760e376e.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_e69a1c8fde5f2c2e7a03cf73760e376e.jpg', '7278', 'image/jpeg', 1, 1563524060, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (54, 'e92ae2a03194838b9b8493b46fab11eb.jpg', '/uploads/store/comment/20190719\\e92ae2a03194838b9b8493b46fab11eb.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_e92ae2a03194838b9b8493b46fab11eb.jpg', '6172', 'image/jpeg', 1, 1563524064, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (55, '54b4b97b44e32120567ebb49fdf66326.jpg', '/uploads/store/comment/20190719\\54b4b97b44e32120567ebb49fdf66326.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_54b4b97b44e32120567ebb49fdf66326.jpg', '7278', 'image/jpeg', 1, 1563524092, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (56, '25ae78adfae15270772cfa0e104b5f50.jpg', '/uploads/store/comment/20190719\\25ae78adfae15270772cfa0e104b5f50.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_25ae78adfae15270772cfa0e104b5f50.jpg', '7278', 'image/jpeg', 1, 1563525515, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (57, '87589beb60c343247d37e6e1c6e7b6f8.jpg', '/uploads/store/comment/20190719\\87589beb60c343247d37e6e1c6e7b6f8.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_87589beb60c343247d37e6e1c6e7b6f8.jpg', '7278', 'image/jpeg', 1, 1563525596, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (58, 'c6feb426f18fc3d45f9742d118ea6121.jpg', '/uploads/store/comment/20190719\\c6feb426f18fc3d45f9742d118ea6121.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_c6feb426f18fc3d45f9742d118ea6121.jpg', '6172', 'image/jpeg', 1, 1563525608, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (59, '2ea30591046534a53ccfc84bd1bed2eb.jpg', '/uploads/store/comment/20190719\\2ea30591046534a53ccfc84bd1bed2eb.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_2ea30591046534a53ccfc84bd1bed2eb.jpg', '7278', 'image/jpeg', 1, 1563525659, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (60, 'e8e87ce4d9384676449038d6a9740638.jpg', '/uploads/store/comment/20190719\\e8e87ce4d9384676449038d6a9740638.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_e8e87ce4d9384676449038d6a9740638.jpg', '7278', 'image/jpeg', 1, 1563525663, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (61, 'ac9d5e1b645472781086c14e68a22b8b.jpg', '/uploads/store/comment/20190719\\ac9d5e1b645472781086c14e68a22b8b.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_ac9d5e1b645472781086c14e68a22b8b.jpg', '7278', 'image/jpeg', 1, 1563527983, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (62, 'd244c78f753094ee1d3e4f5b5f43baa4.jpg', '/uploads/store/comment/20190719\\d244c78f753094ee1d3e4f5b5f43baa4.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_d244c78f753094ee1d3e4f5b5f43baa4.jpg', '7278', 'image/jpeg', 1, 1563528763, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (63, '7c22643a6e26fe2144a0b046db20d540.jpg', '/uploads/store/comment/20190719\\7c22643a6e26fe2144a0b046db20d540.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_7c22643a6e26fe2144a0b046db20d540.jpg', '7278', 'image/jpeg', 1, 1563528767, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (64, 'c48faf58ba34bb00ee4b25712bb65096.jpg', '/uploads/store/comment/20190719\\c48faf58ba34bb00ee4b25712bb65096.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_c48faf58ba34bb00ee4b25712bb65096.jpg', '6172', 'image/jpeg', 1, 1563528773, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (65, '0feb6696dc8a7c29d7eaa2907a6e3567.jpg', '/uploads/store/comment/20190719\\0feb6696dc8a7c29d7eaa2907a6e3567.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_0feb6696dc8a7c29d7eaa2907a6e3567.jpg', '7278', 'image/jpeg', 1, 1563528777, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (66, '95b3f6e01a34af6d2f2f7b3de2e92efa.jpg', '/uploads/store/comment/20190719\\95b3f6e01a34af6d2f2f7b3de2e92efa.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_95b3f6e01a34af6d2f2f7b3de2e92efa.jpg', '7278', 'image/jpeg', 1, 1563528781, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (67, '0584f0181b2adfb55063b666e3ce4a61.jpg', '/uploads/store/comment/20190719\\0584f0181b2adfb55063b666e3ce4a61.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_0584f0181b2adfb55063b666e3ce4a61.jpg', '6172', 'image/jpeg', 1, 1563528785, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (68, 'db5ee5d0ef70cc542b73f139a275ebb3.jpg', '/uploads/store/comment/20190719\\db5ee5d0ef70cc542b73f139a275ebb3.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_db5ee5d0ef70cc542b73f139a275ebb3.jpg', '7278', 'image/jpeg', 1, 1563528789, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (69, 'd6599f99cbb92a682bb3d81c8f7fd060.jpg', '/uploads/store/comment/20190719\\d6599f99cbb92a682bb3d81c8f7fd060.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_d6599f99cbb92a682bb3d81c8f7fd060.jpg', '7278', 'image/jpeg', 1, 1563528793, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (70, 'c85548b7f053a3d75da82d2be605de85.jpg', '/uploads/store/comment/20190719\\c85548b7f053a3d75da82d2be605de85.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_c85548b7f053a3d75da82d2be605de85.jpg', '6172', 'image/jpeg', 1, 1563528797, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (71, '9c850ec634ed40c3fc02e1f1cb9a2508.jpg', '/uploads/store/comment/20190719\\9c850ec634ed40c3fc02e1f1cb9a2508.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_9c850ec634ed40c3fc02e1f1cb9a2508.jpg', '7278', 'image/jpeg', 1, 1563528803, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (72, '82dbe0434dea05ca0f0715f8d3cb35fd.jpg', '/uploads/store/comment/20190719\\82dbe0434dea05ca0f0715f8d3cb35fd.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_82dbe0434dea05ca0f0715f8d3cb35fd.jpg', '6172', 'image/jpeg', 1, 1563528858, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (73, '72aaa441cea74e0a957607ba17cc0faa.jpg', '/uploads/store/comment/20190719\\72aaa441cea74e0a957607ba17cc0faa.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_72aaa441cea74e0a957607ba17cc0faa.jpg', '7278', 'image/jpeg', 1, 1563528863, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (74, '211ced8d324833e549d373edc8ce6b43.jpg', '/uploads/store/comment/20190719\\211ced8d324833e549d373edc8ce6b43.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_211ced8d324833e549d373edc8ce6b43.jpg', '7278', 'image/jpeg', 1, 1563528867, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (75, '6c7a06ecd120db937c7abd1faf3cc3cc.jpg', '/uploads/store/comment/20190719\\6c7a06ecd120db937c7abd1faf3cc3cc.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_6c7a06ecd120db937c7abd1faf3cc3cc.jpg', '6172', 'image/jpeg', 1, 1563528871, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (76, '3129356b64b1a5f370797aa08691a5a3.jpg', '/uploads/store/comment/20190719\\3129356b64b1a5f370797aa08691a5a3.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_3129356b64b1a5f370797aa08691a5a3.jpg', '6172', 'image/jpeg', 1, 1563528875, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (77, '8926036586719f259e17c571087b5da7.jpg', '/uploads/store/comment/20190719\\8926036586719f259e17c571087b5da7.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_8926036586719f259e17c571087b5da7.jpg', '6172', 'image/jpeg', 1, 1563528879, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (78, '217743808cee281958bd9b611d82e296.jpg', '/uploads/store/comment/20190719\\217743808cee281958bd9b611d82e296.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_217743808cee281958bd9b611d82e296.jpg', '6172', 'image/jpeg', 1, 1563528883, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (79, 'c211c2adf28fec4128fc042bdf717622.jpg', '/uploads/store/comment/20190719\\c211c2adf28fec4128fc042bdf717622.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_c211c2adf28fec4128fc042bdf717622.jpg', '6172', 'image/jpeg', 1, 1563528888, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (80, '0a34a244b905d3f2c0fa6673494adc86.jpg', '/uploads/store/comment/20190719\\0a34a244b905d3f2c0fa6673494adc86.jpg', '\\I:\\tk_pr\\gitee\\crmeb\\v3.0\\public/uploads\\store/comment/20190719\\s_0a34a244b905d3f2c0fa6673494adc86.jpg', '6172', 'image/jpeg', 1, 1563528933, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (84, '168_1_user_wap.jpg', '/uploads/qrcode/168_1_user_wap.jpg', '/uploads/qrcode/168_1_user_wap.jpg', '421', 'image/jpeg', 1, 1564016788, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (85, 'b887d20190725090628451287.jpg', '/uploads/wap/spread/poster/b887d20190725090628451287.jpg', '/uploads/wap/spread/poster/b887d20190725090628451287.jpg', '83093', 'image/jpeg', 1, 1564016788, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (86, '6e3ad20190725090628356976.jpg', '/uploads/wap/spread/poster/6e3ad20190725090628356976.jpg', '/uploads/wap/spread/poster/6e3ad20190725090628356976.jpg', '55451', 'image/jpeg', 1, 1564016788, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (87, '585212019072509062889453.jpg', '/uploads/wap/spread/poster/585212019072509062889453.jpg', '/uploads/wap/spread/poster/585212019072509062889453.jpg', '76106', 'image/jpeg', 1, 1564016788, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (88, '1354b20190725090803837532.jpg', '/uploads/wap/spread/poster/1354b20190725090803837532.jpg', '/uploads/wap/spread/poster/1354b20190725090803837532.jpg', '83093', 'image/jpeg', 1, 1564016883, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (89, 'fc9e62019072509080377138.jpg', '/uploads/wap/spread/poster/fc9e62019072509080377138.jpg', '/uploads/wap/spread/poster/fc9e62019072509080377138.jpg', '55451', 'image/jpeg', 1, 1564016883, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (90, '4fc7e20190725090803943808.jpg', '/uploads/wap/spread/poster/4fc7e20190725090803943808.jpg', '/uploads/wap/spread/poster/4fc7e20190725090803943808.jpg', '76106', 'image/jpeg', 1, 1564016883, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (91, '9185f20190725090821497180.jpg', '/uploads/wap/spread/poster/9185f20190725090821497180.jpg', '/uploads/wap/spread/poster/9185f20190725090821497180.jpg', '83093', 'image/jpeg', 1, 1564016901, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (92, '97ffc20190725090822518170.jpg', '/uploads/wap/spread/poster/97ffc20190725090822518170.jpg', '/uploads/wap/spread/poster/97ffc20190725090822518170.jpg', '55451', 'image/jpeg', 1, 1564016902, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (93, '5eb2a20190725090822621288.jpg', '/uploads/wap/spread/poster/5eb2a20190725090822621288.jpg', '/uploads/wap/spread/poster/5eb2a20190725090822621288.jpg', '76106', 'image/jpeg', 1, 1564016902, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (94, '5c81b6e9ffcb98526bec8d5cf60d00c0.jpeg', '/uploads/store/comment/20190725/5c81b6e9ffcb98526bec8d5cf60d00c0.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190725/s_5c81b6e9ffcb98526bec8d5cf60d00c0.jpeg', '100202', 'image/jpeg', 1, 1564017826, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (95, '928598dc46edb4b3feb13996ca921c57.jpeg', '/uploads/store/comment/20190725/928598dc46edb4b3feb13996ca921c57.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190725/s_928598dc46edb4b3feb13996ca921c57.jpeg', '72063', 'image/jpeg', 1, 1564017936, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (99, '06a5020190725103009603176.jpg', '/uploads/wap/spread/poster/06a5020190725103009603176.jpg', '/uploads/wap/spread/poster/06a5020190725103009603176.jpg', '83093', 'image/jpeg', 1, 1564021809, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (100, '9bb6d20190725103009254090.jpg', '/uploads/wap/spread/poster/9bb6d20190725103009254090.jpg', '/uploads/wap/spread/poster/9bb6d20190725103009254090.jpg', '55451', 'image/jpeg', 1, 1564021809, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (101, '0a3b620190725103009951704.jpg', '/uploads/wap/spread/poster/0a3b620190725103009951704.jpg', '/uploads/wap/spread/poster/0a3b620190725103009951704.jpg', '76106', 'image/jpeg', 1, 1564021809, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (102, '16c2420190725103032875048.jpg', '/uploads/wap/spread/poster/16c2420190725103032875048.jpg', '/uploads/wap/spread/poster/16c2420190725103032875048.jpg', '83093', 'image/jpeg', 1, 1564021832, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (103, '2288f20190725103033901964.jpg', '/uploads/wap/spread/poster/2288f20190725103033901964.jpg', '/uploads/wap/spread/poster/2288f20190725103033901964.jpg', '55451', 'image/jpeg', 1, 1564021833, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (104, '209a320190725103035674032.jpg', '/uploads/wap/spread/poster/209a320190725103035674032.jpg', '/uploads/wap/spread/poster/209a320190725103035674032.jpg', '76106', 'image/jpeg', 1, 1564021835, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (105, 'edfbe20190725103039704048.jpg', '/uploads/wap/spread/poster/edfbe20190725103039704048.jpg', '/uploads/wap/spread/poster/edfbe20190725103039704048.jpg', '83093', 'image/jpeg', 1, 1564021839, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (106, 'd9ff920190725103039329861.jpg', '/uploads/wap/spread/poster/d9ff920190725103039329861.jpg', '/uploads/wap/spread/poster/d9ff920190725103039329861.jpg', '55451', 'image/jpeg', 1, 1564021839, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (107, '2c60e20190725103040774523.jpg', '/uploads/wap/spread/poster/2c60e20190725103040774523.jpg', '/uploads/wap/spread/poster/2c60e20190725103040774523.jpg', '76106', 'image/jpeg', 1, 1564021840, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (108, 'e355a20190725103044575205.jpg', '/uploads/wap/spread/poster/e355a20190725103044575205.jpg', '/uploads/wap/spread/poster/e355a20190725103044575205.jpg', '83093', 'image/jpeg', 1, 1564021844, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (109, 'be74820190725103044442080.jpg', '/uploads/wap/spread/poster/be74820190725103044442080.jpg', '/uploads/wap/spread/poster/be74820190725103044442080.jpg', '55451', 'image/jpeg', 1, 1564021844, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (110, '230e420190725103044422594.jpg', '/uploads/wap/spread/poster/230e420190725103044422594.jpg', '/uploads/wap/spread/poster/230e420190725103044422594.jpg', '76106', 'image/jpeg', 1, 1564021844, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (111, '0967620190725103102348703.jpg', '/uploads/wap/spread/poster/0967620190725103102348703.jpg', '/uploads/wap/spread/poster/0967620190725103102348703.jpg', '83093', 'image/jpeg', 1, 1564021862, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (112, '29c0c20190725103102815254.jpg', '/uploads/wap/spread/poster/29c0c20190725103102815254.jpg', '/uploads/wap/spread/poster/29c0c20190725103102815254.jpg', '55451', 'image/jpeg', 1, 1564021862, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (113, '2cd4e201907251031023259.jpg', '/uploads/wap/spread/poster/2cd4e201907251031023259.jpg', '/uploads/wap/spread/poster/2cd4e201907251031023259.jpg', '76106', 'image/jpeg', 1, 1564021862, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (114, '9683c20190725103106590255.jpg', '/uploads/wap/spread/poster/9683c20190725103106590255.jpg', '/uploads/wap/spread/poster/9683c20190725103106590255.jpg', '83093', 'image/jpeg', 1, 1564021866, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (115, '34ed020190725103106490094.jpg', '/uploads/wap/spread/poster/34ed020190725103106490094.jpg', '/uploads/wap/spread/poster/34ed020190725103106490094.jpg', '55451', 'image/jpeg', 1, 1564021866, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (116, 'c20a720190725103109723264.jpg', '/uploads/wap/spread/poster/c20a720190725103109723264.jpg', '/uploads/wap/spread/poster/c20a720190725103109723264.jpg', '76106', 'image/jpeg', 1, 1564021869, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (117, '3eb6520190725103111358281.jpg', '/uploads/wap/spread/poster/3eb6520190725103111358281.jpg', '/uploads/wap/spread/poster/3eb6520190725103111358281.jpg', '83093', 'image/jpeg', 1, 1564021871, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (118, 'eefc920190725103112724098.jpg', '/uploads/wap/spread/poster/eefc920190725103112724098.jpg', '/uploads/wap/spread/poster/eefc920190725103112724098.jpg', '55451', 'image/jpeg', 1, 1564021872, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (119, '2c27a20190725103113931634.jpg', '/uploads/wap/spread/poster/2c27a20190725103113931634.jpg', '/uploads/wap/spread/poster/2c27a20190725103113931634.jpg', '76106', 'image/jpeg', 1, 1564021873, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (120, 'cc8b620190725103115360579.jpg', '/uploads/wap/spread/poster/cc8b620190725103115360579.jpg', '/uploads/wap/spread/poster/cc8b620190725103115360579.jpg', '83093', 'image/jpeg', 1, 1564021875, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (121, 'e48e120190725103115257436.jpg', '/uploads/wap/spread/poster/e48e120190725103115257436.jpg', '/uploads/wap/spread/poster/e48e120190725103115257436.jpg', '55451', 'image/jpeg', 1, 1564021875, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (122, '846c220190725103115834202.jpg', '/uploads/wap/spread/poster/846c220190725103115834202.jpg', '/uploads/wap/spread/poster/846c220190725103115834202.jpg', '76106', 'image/jpeg', 1, 1564021875, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (123, '2adaf20190725103118352406.jpg', '/uploads/wap/spread/poster/2adaf20190725103118352406.jpg', '/uploads/wap/spread/poster/2adaf20190725103118352406.jpg', '83093', 'image/jpeg', 1, 1564021878, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (124, '9d94920190725103118285539.jpg', '/uploads/wap/spread/poster/9d94920190725103118285539.jpg', '/uploads/wap/spread/poster/9d94920190725103118285539.jpg', '55451', 'image/jpeg', 1, 1564021878, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (125, '767b220190725103118406366.jpg', '/uploads/wap/spread/poster/767b220190725103118406366.jpg', '/uploads/wap/spread/poster/767b220190725103118406366.jpg', '76106', 'image/jpeg', 1, 1564021878, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (126, 'bcc2b20190725103121323658.jpg', '/uploads/wap/spread/poster/bcc2b20190725103121323658.jpg', '/uploads/wap/spread/poster/bcc2b20190725103121323658.jpg', '83093', 'image/jpeg', 1, 1564021881, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (127, '3d60020190725103121306997.jpg', '/uploads/wap/spread/poster/3d60020190725103121306997.jpg', '/uploads/wap/spread/poster/3d60020190725103121306997.jpg', '55451', 'image/jpeg', 1, 1564021881, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (128, 'c678a20190725103121167568.jpg', '/uploads/wap/spread/poster/c678a20190725103121167568.jpg', '/uploads/wap/spread/poster/c678a20190725103121167568.jpg', '76106', 'image/jpeg', 1, 1564021881, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (129, '2e6d920190725103124111367.jpg', '/uploads/wap/spread/poster/2e6d920190725103124111367.jpg', '/uploads/wap/spread/poster/2e6d920190725103124111367.jpg', '83093', 'image/jpeg', 1, 1564021884, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (130, 'b810220190725103124980137.jpg', '/uploads/wap/spread/poster/b810220190725103124980137.jpg', '/uploads/wap/spread/poster/b810220190725103124980137.jpg', '55451', 'image/jpeg', 1, 1564021884, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (131, 'c2ddc2019072510312443353.jpg', '/uploads/wap/spread/poster/c2ddc2019072510312443353.jpg', '/uploads/wap/spread/poster/c2ddc2019072510312443353.jpg', '76106', 'image/jpeg', 1, 1564021884, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (132, 'd7aab20190725103125667273.jpg', '/uploads/wap/spread/poster/d7aab20190725103125667273.jpg', '/uploads/wap/spread/poster/d7aab20190725103125667273.jpg', '83093', 'image/jpeg', 1, 1564021885, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (133, '4da0420190725103125862279.jpg', '/uploads/wap/spread/poster/4da0420190725103125862279.jpg', '/uploads/wap/spread/poster/4da0420190725103125862279.jpg', '55451', 'image/jpeg', 1, 1564021885, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (134, '9c3b120190725103125550133.jpg', '/uploads/wap/spread/poster/9c3b120190725103125550133.jpg', '/uploads/wap/spread/poster/9c3b120190725103125550133.jpg', '76106', 'image/jpeg', 1, 1564021885, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (135, 'd18f620190725103126976393.jpg', '/uploads/wap/spread/poster/d18f620190725103126976393.jpg', '/uploads/wap/spread/poster/d18f620190725103126976393.jpg', '83093', 'image/jpeg', 1, 1564021886, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (136, 'a1a6020190725103126610529.jpg', '/uploads/wap/spread/poster/a1a6020190725103126610529.jpg', '/uploads/wap/spread/poster/a1a6020190725103126610529.jpg', '55451', 'image/jpeg', 1, 1564021886, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (137, '7ae2620190725103126370491.jpg', '/uploads/wap/spread/poster/7ae2620190725103126370491.jpg', '/uploads/wap/spread/poster/7ae2620190725103126370491.jpg', '76106', 'image/jpeg', 1, 1564021886, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (138, '8d6dc20190725103129563595.jpg', '/uploads/wap/spread/poster/8d6dc20190725103129563595.jpg', '/uploads/wap/spread/poster/8d6dc20190725103129563595.jpg', '83093', 'image/jpeg', 1, 1564021889, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (139, '8207f20190725103129551352.jpg', '/uploads/wap/spread/poster/8207f20190725103129551352.jpg', '/uploads/wap/spread/poster/8207f20190725103129551352.jpg', '55451', 'image/jpeg', 1, 1564021889, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (140, '93d6520190725103130932096.jpg', '/uploads/wap/spread/poster/93d6520190725103130932096.jpg', '/uploads/wap/spread/poster/93d6520190725103130932096.jpg', '76106', 'image/jpeg', 1, 1564021890, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (141, '2f4cc20190725103133814588.jpg', '/uploads/wap/spread/poster/2f4cc20190725103133814588.jpg', '/uploads/wap/spread/poster/2f4cc20190725103133814588.jpg', '83093', 'image/jpeg', 1, 1564021893, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (142, 'c696920190725103133223397.jpg', '/uploads/wap/spread/poster/c696920190725103133223397.jpg', '/uploads/wap/spread/poster/c696920190725103133223397.jpg', '55451', 'image/jpeg', 1, 1564021893, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (143, 'd339a20190725103133521876.jpg', '/uploads/wap/spread/poster/d339a20190725103133521876.jpg', '/uploads/wap/spread/poster/d339a20190725103133521876.jpg', '76106', 'image/jpeg', 1, 1564021893, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (144, 'a385d20190725103135259206.jpg', '/uploads/wap/spread/poster/a385d20190725103135259206.jpg', '/uploads/wap/spread/poster/a385d20190725103135259206.jpg', '83093', 'image/jpeg', 1, 1564021895, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (145, '68d3020190725103135804087.jpg', '/uploads/wap/spread/poster/68d3020190725103135804087.jpg', '/uploads/wap/spread/poster/68d3020190725103135804087.jpg', '55451', 'image/jpeg', 1, 1564021895, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (146, 'cdbc920190725103135555936.jpg', '/uploads/wap/spread/poster/cdbc920190725103135555936.jpg', '/uploads/wap/spread/poster/cdbc920190725103135555936.jpg', '76106', 'image/jpeg', 1, 1564021895, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (147, '5073720190725103137154415.jpg', '/uploads/wap/spread/poster/5073720190725103137154415.jpg', '/uploads/wap/spread/poster/5073720190725103137154415.jpg', '83093', 'image/jpeg', 1, 1564021897, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (148, 'c571620190725103137880402.jpg', '/uploads/wap/spread/poster/c571620190725103137880402.jpg', '/uploads/wap/spread/poster/c571620190725103137880402.jpg', '55451', 'image/jpeg', 1, 1564021897, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (149, 'c92382019072510313799122.jpg', '/uploads/wap/spread/poster/c92382019072510313799122.jpg', '/uploads/wap/spread/poster/c92382019072510313799122.jpg', '76106', 'image/jpeg', 1, 1564021897, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (150, '1e8a12019072510314087772.jpg', '/uploads/wap/spread/poster/1e8a12019072510314087772.jpg', '/uploads/wap/spread/poster/1e8a12019072510314087772.jpg', '83093', 'image/jpeg', 1, 1564021900, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (151, '058d620190725103140182102.jpg', '/uploads/wap/spread/poster/058d620190725103140182102.jpg', '/uploads/wap/spread/poster/058d620190725103140182102.jpg', '55451', 'image/jpeg', 1, 1564021900, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (152, '2adaf2019072510314070746.jpg', '/uploads/wap/spread/poster/2adaf2019072510314070746.jpg', '/uploads/wap/spread/poster/2adaf2019072510314070746.jpg', '76106', 'image/jpeg', 1, 1564021900, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (153, '2f01878e82f58bc6c3688d480b4ff62f.png', '/uploads/attach/2019/07/25/20190725/2f01878e82f58bc6c3688d480b4ff62f.png', '//web/wwwroot/kaifa1.crmeb.net/public/uploads/attach/2019/07/25/20190725/s_2f01878e82f58bc6c3688d480b4ff62f.png', '2932', 'image/png', 27, 1564021944, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (154, '2ae7e3d0027e077eb739752d759b039a.png', '/uploads/attach/2019/07/25/20190725/2ae7e3d0027e077eb739752d759b039a.png', '//web/wwwroot/kaifa1.crmeb.net/public/uploads/attach/2019/07/25/20190725/s_2ae7e3d0027e077eb739752d759b039a.png', '2932', 'image/png', 1, 1564040316, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (155, 'cef5562c16589bde42744a071f8efc85.png', '/uploads/attach/2019/07/25/20190725/cef5562c16589bde42744a071f8efc85.png', '//web/wwwroot/kaifa1.crmeb.net/public/uploads/attach/2019/07/25/20190725/s_cef5562c16589bde42744a071f8efc85.png', '203044', 'image/png', 1, 1564040317, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (156, '08c99f544853c964e6dc8822f76a5ac7.png', '/uploads/attach/2019/07/25/20190725/08c99f544853c964e6dc8822f76a5ac7.png', '//web/wwwroot/kaifa1.crmeb.net/public/uploads/attach/2019/07/25/20190725/s_08c99f544853c964e6dc8822f76a5ac7.png', '215271', 'image/png', 1, 1564040317, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (162, 'f63f620190726145146576117.jpg', '/uploads/wap/spread/poster/f63f620190726145146576117.jpg', '/uploads/wap/spread/poster/f63f620190726145146576117.jpg', '83093', 'image/jpeg', 1, 1564123906, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (163, '285da20190726145146173998.jpg', '/uploads/wap/spread/poster/285da20190726145146173998.jpg', '/uploads/wap/spread/poster/285da20190726145146173998.jpg', '55451', 'image/jpeg', 1, 1564123906, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (164, '2f29b20190726145146899053.jpg', '/uploads/wap/spread/poster/2f29b20190726145146899053.jpg', '/uploads/wap/spread/poster/2f29b20190726145146899053.jpg', '76106', 'image/jpeg', 1, 1564123906, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (165, 'fb48970129a9e8ed7ce5ea8531c0e801.jpeg', '/uploads/store/comment/20190726/fb48970129a9e8ed7ce5ea8531c0e801.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190726/s_fb48970129a9e8ed7ce5ea8531c0e801.jpeg', '16028', 'image/jpeg', 1, 1564124345, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (166, 'b80e2722c2b3a20adce252e0bd3b1d5f.jpeg', '/uploads/store/comment/20190726/b80e2722c2b3a20adce252e0bd3b1d5f.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190726/s_b80e2722c2b3a20adce252e0bd3b1d5f.jpeg', '16028', 'image/jpeg', 1, 1564124356, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (167, '25a53906cc1746c707a101b1ff84a364.png', '/uploads/attach/2019/07/26/20190726/25a53906cc1746c707a101b1ff84a364.png', '//Users/xurongyao/web/gitee/taobao/DTv3.0/public/uploads/attach/2019/07/26/20190726/s_25a53906cc1746c707a101b1ff84a364.png', '2932', 'image/png', 27, 1564126849, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (169, 'fa73320190726215651473142.jpg', '/uploads/wap/spread/poster/fa73320190726215651473142.jpg', '/uploads/wap/spread/poster/fa73320190726215651473142.jpg', '83093', 'image/jpeg', 1, 1564149411, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (170, 'cd81c20190726215651940809.jpg', '/uploads/wap/spread/poster/cd81c20190726215651940809.jpg', '/uploads/wap/spread/poster/cd81c20190726215651940809.jpg', '55451', 'image/jpeg', 1, 1564149411, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (171, '9ef2e20190726215651491201.jpg', '/uploads/wap/spread/poster/9ef2e20190726215651491201.jpg', '/uploads/wap/spread/poster/9ef2e20190726215651491201.jpg', '76106', 'image/jpeg', 1, 1564149411, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (172, '177_0_user_wap.jpg', '/uploads/qrcode/177_0_user_wap.jpg', '/uploads/qrcode/177_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564194059, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (173, '2ead820190727102100533715.jpg', '/uploads/wap/spread/poster/2ead820190727102100533715.jpg', '/uploads/wap/spread/poster/2ead820190727102100533715.jpg', '83309', 'image/jpeg', 1, 1564194060, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (174, 'b555f20190727102100477057.jpg', '/uploads/wap/spread/poster/b555f20190727102100477057.jpg', '/uploads/wap/spread/poster/b555f20190727102100477057.jpg', '55685', 'image/jpeg', 1, 1564194060, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (175, '273f520190727102100246201.jpg', '/uploads/wap/spread/poster/273f520190727102100246201.jpg', '/uploads/wap/spread/poster/273f520190727102100246201.jpg', '76324', 'image/jpeg', 1, 1564194060, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (176, '189_0_user_wap.jpg', '/uploads/qrcode/189_0_user_wap.jpg', '/uploads/qrcode/189_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564199087, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (177, '1e9f62019072711444725565.jpg', '/uploads/wap/spread/poster/1e9f62019072711444725565.jpg', '/uploads/wap/spread/poster/1e9f62019072711444725565.jpg', '82072', 'image/jpeg', 1, 1564199087, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (178, 'd1dc320190727114447940792.jpg', '/uploads/wap/spread/poster/d1dc320190727114447940792.jpg', '/uploads/wap/spread/poster/d1dc320190727114447940792.jpg', '54459', 'image/jpeg', 1, 1564199087, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (179, 'd693d20190727114447975887.jpg', '/uploads/wap/spread/poster/d693d20190727114447975887.jpg', '/uploads/wap/spread/poster/d693d20190727114447975887.jpg', '75107', 'image/jpeg', 1, 1564199087, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (180, '200_0_user_wap.jpg', '/uploads/qrcode/200_0_user_wap.jpg', '/uploads/qrcode/200_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564204071, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (181, '961f120190727130751470142.jpg', '/uploads/wap/spread/poster/961f120190727130751470142.jpg', '/uploads/wap/spread/poster/961f120190727130751470142.jpg', '82978', 'image/jpeg', 1, 1564204071, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (182, '0172d20190727130751944501.jpg', '/uploads/wap/spread/poster/0172d20190727130751944501.jpg', '/uploads/wap/spread/poster/0172d20190727130751944501.jpg', '55332', 'image/jpeg', 1, 1564204071, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (183, 'cd7c2201907271307514953.jpg', '/uploads/wap/spread/poster/cd7c2201907271307514953.jpg', '/uploads/wap/spread/poster/cd7c2201907271307514953.jpg', '75989', 'image/jpeg', 1, 1564204071, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (184, '201_0_user_wap.jpg', '/uploads/qrcode/201_0_user_wap.jpg', '/uploads/qrcode/201_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564204958, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (185, 'c6e1920190727132238818099.jpg', '/uploads/wap/spread/poster/c6e1920190727132238818099.jpg', '/uploads/wap/spread/poster/c6e1920190727132238818099.jpg', '84470', 'image/jpeg', 1, 1564204958, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (186, '24ac820190727132238790103.jpg', '/uploads/wap/spread/poster/24ac820190727132238790103.jpg', '/uploads/wap/spread/poster/24ac820190727132238790103.jpg', '56853', 'image/jpeg', 1, 1564204958, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (187, '41a6f20190727132238588020.jpg', '/uploads/wap/spread/poster/41a6f20190727132238588020.jpg', '/uploads/wap/spread/poster/41a6f20190727132238588020.jpg', '77511', 'image/jpeg', 1, 1564204958, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (188, '213_0_user_wap.jpg', '/uploads/qrcode/213_0_user_wap.jpg', '/uploads/qrcode/213_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564218643, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (189, '810bf20190727171043430468.jpg', '/uploads/wap/spread/poster/810bf20190727171043430468.jpg', '/uploads/wap/spread/poster/810bf20190727171043430468.jpg', '82272', 'image/jpeg', 1, 1564218643, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (190, 'eca3320190727171044353338.jpg', '/uploads/wap/spread/poster/eca3320190727171044353338.jpg', '/uploads/wap/spread/poster/eca3320190727171044353338.jpg', '54640', 'image/jpeg', 1, 1564218644, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (191, '5d0d520190727171044866607.jpg', '/uploads/wap/spread/poster/5d0d520190727171044866607.jpg', '/uploads/wap/spread/poster/5d0d520190727171044866607.jpg', '75290', 'image/jpeg', 1, 1564218644, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (192, '216_0_user_wap.jpg', '/uploads/qrcode/216_0_user_wap.jpg', '/uploads/qrcode/216_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564220495, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (193, '4c12320190727174136790578.jpg', '/uploads/wap/spread/poster/4c12320190727174136790578.jpg', '/uploads/wap/spread/poster/4c12320190727174136790578.jpg', '82102', 'image/jpeg', 1, 1564220496, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (194, '24b1620190727174136327219.jpg', '/uploads/wap/spread/poster/24b1620190727174136327219.jpg', '/uploads/wap/spread/poster/24b1620190727174136327219.jpg', '54478', 'image/jpeg', 1, 1564220496, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (195, '48a7920190727174136512089.jpg', '/uploads/wap/spread/poster/48a7920190727174136512089.jpg', '/uploads/wap/spread/poster/48a7920190727174136512089.jpg', '75116', 'image/jpeg', 1, 1564220496, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (196, '225_0_user_wap.jpg', '/uploads/qrcode/225_0_user_wap.jpg', '/uploads/qrcode/225_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564227377, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (197, '3e9842019072719361747726.jpg', '/uploads/wap/spread/poster/3e9842019072719361747726.jpg', '/uploads/wap/spread/poster/3e9842019072719361747726.jpg', '83012', 'image/jpeg', 1, 1564227377, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (198, '37ecd20190727193618557283.jpg', '/uploads/wap/spread/poster/37ecd20190727193618557283.jpg', '/uploads/wap/spread/poster/37ecd20190727193618557283.jpg', '55377', 'image/jpeg', 1, 1564227378, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (199, 'f395720190727193618378539.jpg', '/uploads/wap/spread/poster/f395720190727193618378539.jpg', '/uploads/wap/spread/poster/f395720190727193618378539.jpg', '76025', 'image/jpeg', 1, 1564227378, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (200, '09eb220190727201657241797.jpg', '/uploads/wap/spread/poster/09eb220190727201657241797.jpg', '/uploads/wap/spread/poster/09eb220190727201657241797.jpg', '82102', 'image/jpeg', 1, 1564229817, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (201, '5cc3720190727201658664279.jpg', '/uploads/wap/spread/poster/5cc3720190727201658664279.jpg', '/uploads/wap/spread/poster/5cc3720190727201658664279.jpg', '54478', 'image/jpeg', 1, 1564229818, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (202, '3210d20190727201658561359.jpg', '/uploads/wap/spread/poster/3210d20190727201658561359.jpg', '/uploads/wap/spread/poster/3210d20190727201658561359.jpg', '75116', 'image/jpeg', 1, 1564229818, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (203, '3e4196a22c587d98a97545e23b7e9b96.jpeg', '/uploads/store/comment/20190727/3e4196a22c587d98a97545e23b7e9b96.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_3e4196a22c587d98a97545e23b7e9b96.jpeg', '56868', 'image/jpeg', 1, 1564236234, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (204, '7c02220190727220836771494.jpg', '/uploads/wap/spread/poster/7c02220190727220836771494.jpg', '/uploads/wap/spread/poster/7c02220190727220836771494.jpg', '82102', 'image/jpeg', 1, 1564236516, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (205, '1054020190727220837818070.jpg', '/uploads/wap/spread/poster/1054020190727220837818070.jpg', '/uploads/wap/spread/poster/1054020190727220837818070.jpg', '54478', 'image/jpeg', 1, 1564236517, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (206, '5b69b2019072722083711108.jpg', '/uploads/wap/spread/poster/5b69b2019072722083711108.jpg', '/uploads/wap/spread/poster/5b69b2019072722083711108.jpg', '75116', 'image/jpeg', 1, 1564236517, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (207, '564ac01c77211c432c7f314396cfdaaa.jpeg', '/uploads/store/comment/20190727/564ac01c77211c432c7f314396cfdaaa.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_564ac01c77211c432c7f314396cfdaaa.jpeg', '54749', 'image/jpeg', 1, 1564237187, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (208, '1517c20190727222709296020.jpg', '/uploads/wap/spread/poster/1517c20190727222709296020.jpg', '/uploads/wap/spread/poster/1517c20190727222709296020.jpg', '83093', 'image/jpeg', 1, 1564237629, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (209, '1340320190727222709958158.jpg', '/uploads/wap/spread/poster/1340320190727222709958158.jpg', '/uploads/wap/spread/poster/1340320190727222709958158.jpg', '55451', 'image/jpeg', 1, 1564237629, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (210, 'f2b5e20190727222709759190.jpg', '/uploads/wap/spread/poster/f2b5e20190727222709759190.jpg', '/uploads/wap/spread/poster/f2b5e20190727222709759190.jpg', '76106', 'image/jpeg', 1, 1564237629, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (211, 'c8fbb20190727222722745905.jpg', '/uploads/wap/spread/poster/c8fbb20190727222722745905.jpg', '/uploads/wap/spread/poster/c8fbb20190727222722745905.jpg', '83093', 'image/jpeg', 1, 1564237642, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (212, '45e8120190727222722944820.jpg', '/uploads/wap/spread/poster/45e8120190727222722944820.jpg', '/uploads/wap/spread/poster/45e8120190727222722944820.jpg', '55451', 'image/jpeg', 1, 1564237642, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (213, '7895f2019072722272219051.jpg', '/uploads/wap/spread/poster/7895f2019072722272219051.jpg', '/uploads/wap/spread/poster/7895f2019072722272219051.jpg', '76106', 'image/jpeg', 1, 1564237642, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (214, 'a09265a70ba58d27410ffa85e341d073.jpg', '/uploads/store/comment/20190727/a09265a70ba58d27410ffa85e341d073.jpg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_a09265a70ba58d27410ffa85e341d073.jpg', '395313', 'image/jpeg', 1, 1564238100, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (215, '7cdb4c9d08adacf5821cfb7352fefa4b.jpeg', '/uploads/store/comment/20190727/7cdb4c9d08adacf5821cfb7352fefa4b.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_7cdb4c9d08adacf5821cfb7352fefa4b.jpeg', '60094', 'image/jpeg', 1, 1564238125, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (216, '0576cebf516bb522a09f418cb274eb4c.jpeg', '/uploads/store/comment/20190727/0576cebf516bb522a09f418cb274eb4c.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_0576cebf516bb522a09f418cb274eb4c.jpeg', '79176', 'image/jpeg', 1, 1564238160, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (217, 'cb9e20560a1b43ca0169533a6b44bbd2.png', '/uploads/store/comment/20190727/cb9e20560a1b43ca0169533a6b44bbd2.png', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_cb9e20560a1b43ca0169533a6b44bbd2.png', '1190154', 'image/png', 1, 1564238208, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (218, 'cf74474c19c2b0f9d7c5cafce28c07ba.jpeg', '/uploads/store/comment/20190727/cf74474c19c2b0f9d7c5cafce28c07ba.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_cf74474c19c2b0f9d7c5cafce28c07ba.jpeg', '102985', 'image/jpeg', 1, 1564238251, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (219, '398dc479ad9c9d5c897d0d20d3b4f821.jpeg', '/uploads/store/comment/20190727/398dc479ad9c9d5c897d0d20d3b4f821.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_398dc479ad9c9d5c897d0d20d3b4f821.jpeg', '60094', 'image/jpeg', 1, 1564238258, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (220, '23294c4ff25358904525b410efab6ab2.jpg', '/uploads/store/comment/20190727/23294c4ff25358904525b410efab6ab2.jpg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_23294c4ff25358904525b410efab6ab2.jpg', '329700', 'image/jpeg', 1, 1564238272, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (221, 'b71e0aea2413139abb3d98f73868198c.jpeg', '/uploads/store/comment/20190727/b71e0aea2413139abb3d98f73868198c.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_b71e0aea2413139abb3d98f73868198c.jpeg', '404614', 'image/jpeg', 1, 1564238315, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (222, '4796e8852edba27fd1932ca4f8eb1930.jpg', '/uploads/store/comment/20190727/4796e8852edba27fd1932ca4f8eb1930.jpg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190727/s_4796e8852edba27fd1932ca4f8eb1930.jpg', '448829', 'image/jpeg', 1, 1564238535, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (223, '244_0_user_wap.jpg', '/uploads/qrcode/244_0_user_wap.jpg', '/uploads/qrcode/244_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564242085, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (224, 'acc3e201907272341258018.jpg', '/uploads/wap/spread/poster/acc3e201907272341258018.jpg', '/uploads/wap/spread/poster/acc3e201907272341258018.jpg', '82062', 'image/jpeg', 1, 1564242085, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (225, 'fd4f220190727234126701352.jpg', '/uploads/wap/spread/poster/fd4f220190727234126701352.jpg', '/uploads/wap/spread/poster/fd4f220190727234126701352.jpg', '54419', 'image/jpeg', 1, 1564242086, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (226, 'eb86d20190727234126141312.jpg', '/uploads/wap/spread/poster/eb86d20190727234126141312.jpg', '/uploads/wap/spread/poster/eb86d20190727234126141312.jpg', '75071', 'image/jpeg', 1, 1564242086, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (227, '246_0_user_wap.jpg', '/uploads/qrcode/246_0_user_wap.jpg', '/uploads/qrcode/246_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564243483, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (228, '5fa5a20190728000443278752.jpg', '/uploads/wap/spread/poster/5fa5a20190728000443278752.jpg', '/uploads/wap/spread/poster/5fa5a20190728000443278752.jpg', '83136', 'image/jpeg', 1, 1564243483, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (229, '0ef0320190728000443301158.jpg', '/uploads/wap/spread/poster/0ef0320190728000443301158.jpg', '/uploads/wap/spread/poster/0ef0320190728000443301158.jpg', '55503', 'image/jpeg', 1, 1564243483, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (230, '1a32d20190728000443689441.jpg', '/uploads/wap/spread/poster/1a32d20190728000443689441.jpg', '/uploads/wap/spread/poster/1a32d20190728000443689441.jpg', '76163', 'image/jpeg', 1, 1564243483, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (231, '247_0_user_wap.jpg', '/uploads/qrcode/247_0_user_wap.jpg', '/uploads/qrcode/247_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564246280, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (232, '977852019072800512088894.jpg', '/uploads/wap/spread/poster/977852019072800512088894.jpg', '/uploads/wap/spread/poster/977852019072800512088894.jpg', '82146', 'image/jpeg', 1, 1564246280, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (233, 'b73df2019072800512091536.jpg', '/uploads/wap/spread/poster/b73df2019072800512091536.jpg', '/uploads/wap/spread/poster/b73df2019072800512091536.jpg', '54530', 'image/jpeg', 1, 1564246280, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (234, '1e8c320190728005120601998.jpg', '/uploads/wap/spread/poster/1e8c320190728005120601998.jpg', '/uploads/wap/spread/poster/1e8c320190728005120601998.jpg', '75164', 'image/jpeg', 1, 1564246280, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (235, 'f8d2e20190728005414808393.jpg', '/uploads/wap/spread/poster/f8d2e20190728005414808393.jpg', '/uploads/wap/spread/poster/f8d2e20190728005414808393.jpg', '82146', 'image/jpeg', 1, 1564246454, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (236, '5d15120190728005414129183.jpg', '/uploads/wap/spread/poster/5d15120190728005414129183.jpg', '/uploads/wap/spread/poster/5d15120190728005414129183.jpg', '54530', 'image/jpeg', 1, 1564246454, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (237, '4082620190728005414162573.jpg', '/uploads/wap/spread/poster/4082620190728005414162573.jpg', '/uploads/wap/spread/poster/4082620190728005414162573.jpg', '75164', 'image/jpeg', 1, 1564246454, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (238, '40795cee20f67a4e80591523a8100925.jpg', '/uploads/store/comment/20190728/40795cee20f67a4e80591523a8100925.jpg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190728/s_40795cee20f67a4e80591523a8100925.jpg', '530568', 'image/jpeg', 1, 1564271957, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (239, '3de43e99887a2f6d6326b5cae44be6aa.png', '/uploads/store/comment/20190728/3de43e99887a2f6d6326b5cae44be6aa.png', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190728/s_3de43e99887a2f6d6326b5cae44be6aa.png', '445628', 'image/png', 1, 1564272443, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (240, '68764296da451aebbdc5e3c54afdb185.jpg', '/uploads/store/comment/20190728/68764296da451aebbdc5e3c54afdb185.jpg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190728/s_68764296da451aebbdc5e3c54afdb185.jpg', '490444', 'image/jpeg', 1, 1564272452, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (241, '04c7ef680604f69f54cd95873c5db243.jpeg', '/uploads/store/comment/20190728/04c7ef680604f69f54cd95873c5db243.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190728/s_04c7ef680604f69f54cd95873c5db243.jpeg', '772453', 'image/jpeg', 1, 1564272471, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (242, 'a75cef3d665f7e9ad1255c1019cc7625.png', '/uploads/store/comment/20190728/a75cef3d665f7e9ad1255c1019cc7625.png', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190728/s_a75cef3d665f7e9ad1255c1019cc7625.png', '321666', 'image/png', 1, 1564273400, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (243, '264_0_user_wap.jpg', '/uploads/qrcode/264_0_user_wap.jpg', '/uploads/qrcode/264_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564292696, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (244, '37d7920190728134456438274.jpg', '/uploads/wap/spread/poster/37d7920190728134456438274.jpg', '/uploads/wap/spread/poster/37d7920190728134456438274.jpg', '82208', 'image/jpeg', 1, 1564292696, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (245, 'e928720190728134456574790.jpg', '/uploads/wap/spread/poster/e928720190728134456574790.jpg', '/uploads/wap/spread/poster/e928720190728134456574790.jpg', '54594', 'image/jpeg', 1, 1564292696, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (246, '23e5820190728134456670292.jpg', '/uploads/wap/spread/poster/23e5820190728134456670292.jpg', '/uploads/wap/spread/poster/23e5820190728134456670292.jpg', '75232', 'image/jpeg', 1, 1564292696, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (247, '279_0_user_wap.jpg', '/uploads/qrcode/279_0_user_wap.jpg', '/uploads/qrcode/279_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564306461, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (248, '32bd420190728173421315131.jpg', '/uploads/wap/spread/poster/32bd420190728173421315131.jpg', '/uploads/wap/spread/poster/32bd420190728173421315131.jpg', '82291', 'image/jpeg', 1, 1564306461, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (249, '3a07720190728173421634603.jpg', '/uploads/wap/spread/poster/3a07720190728173421634603.jpg', '/uploads/wap/spread/poster/3a07720190728173421634603.jpg', '54674', 'image/jpeg', 1, 1564306461, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (250, 'dbec02019072817342187907.jpg', '/uploads/wap/spread/poster/dbec02019072817342187907.jpg', '/uploads/wap/spread/poster/dbec02019072817342187907.jpg', '75328', 'image/jpeg', 1, 1564306461, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (251, '287_0_user_wap.jpg', '/uploads/qrcode/287_0_user_wap.jpg', '/uploads/qrcode/287_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564324263, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (252, '3eae620190728223103166972.jpg', '/uploads/wap/spread/poster/3eae620190728223103166972.jpg', '/uploads/wap/spread/poster/3eae620190728223103166972.jpg', '82489', 'image/jpeg', 1, 1564324263, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (253, '1f44720190728223103173215.jpg', '/uploads/wap/spread/poster/1f44720190728223103173215.jpg', '/uploads/wap/spread/poster/1f44720190728223103173215.jpg', '54845', 'image/jpeg', 1, 1564324263, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (254, '6ebb620190728223104696739.jpg', '/uploads/wap/spread/poster/6ebb620190728223104696739.jpg', '/uploads/wap/spread/poster/6ebb620190728223104696739.jpg', '75512', 'image/jpeg', 1, 1564324264, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (255, 'ff14120190728232201368421.jpg', '/uploads/wap/spread/poster/ff14120190728232201368421.jpg', '/uploads/wap/spread/poster/ff14120190728232201368421.jpg', '82489', 'image/jpeg', 1, 1564327321, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (256, '6c8db20190728232201618359.jpg', '/uploads/wap/spread/poster/6c8db20190728232201618359.jpg', '/uploads/wap/spread/poster/6c8db20190728232201618359.jpg', '54845', 'image/jpeg', 1, 1564327321, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (257, '32f6c20190728232202370019.jpg', '/uploads/wap/spread/poster/32f6c20190728232202370019.jpg', '/uploads/wap/spread/poster/32f6c20190728232202370019.jpg', '75512', 'image/jpeg', 1, 1564327322, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (258, '205_0_user_wap.jpg', '/uploads/qrcode/205_0_user_wap.jpg', '/uploads/qrcode/205_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564327947, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (259, 'f516d20190728233227366269.jpg', '/uploads/wap/spread/poster/f516d20190728233227366269.jpg', '/uploads/wap/spread/poster/f516d20190728233227366269.jpg', '81800', 'image/jpeg', 1, 1564327947, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (260, 'e924520190728233227319247.jpg', '/uploads/wap/spread/poster/e924520190728233227319247.jpg', '/uploads/wap/spread/poster/e924520190728233227319247.jpg', '54182', 'image/jpeg', 1, 1564327947, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (261, '4edaa20190728233227849878.jpg', '/uploads/wap/spread/poster/4edaa20190728233227849878.jpg', '/uploads/wap/spread/poster/4edaa20190728233227849878.jpg', '74811', 'image/jpeg', 1, 1564327947, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (262, '894db20190728233525187998.jpg', '/uploads/wap/spread/poster/894db20190728233525187998.jpg', '/uploads/wap/spread/poster/894db20190728233525187998.jpg', '81800', 'image/jpeg', 1, 1564328125, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (263, '50abc20190728233525277763.jpg', '/uploads/wap/spread/poster/50abc20190728233525277763.jpg', '/uploads/wap/spread/poster/50abc20190728233525277763.jpg', '54182', 'image/jpeg', 1, 1564328125, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (264, '442cd20190728233526676459.jpg', '/uploads/wap/spread/poster/442cd20190728233526676459.jpg', '/uploads/wap/spread/poster/442cd20190728233526676459.jpg', '74811', 'image/jpeg', 1, 1564328126, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (265, '294_0_user_wap.jpg', '/uploads/qrcode/294_0_user_wap.jpg', '/uploads/qrcode/294_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564339023, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (266, '21be92019072902370415484.jpg', '/uploads/wap/spread/poster/21be92019072902370415484.jpg', '/uploads/wap/spread/poster/21be92019072902370415484.jpg', '83179', 'image/jpeg', 1, 1564339024, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (267, 'e2eab20190729023704914230.jpg', '/uploads/wap/spread/poster/e2eab20190729023704914230.jpg', '/uploads/wap/spread/poster/e2eab20190729023704914230.jpg', '55539', 'image/jpeg', 1, 1564339024, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (268, '6150c20190729023704106732.jpg', '/uploads/wap/spread/poster/6150c20190729023704106732.jpg', '/uploads/wap/spread/poster/6150c20190729023704106732.jpg', '76190', 'image/jpeg', 1, 1564339024, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (269, '314_0_user_wap.jpg', '/uploads/qrcode/314_0_user_wap.jpg', '/uploads/qrcode/314_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564371730, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (270, '73f1220190729114211764053.jpg', '/uploads/wap/spread/poster/73f1220190729114211764053.jpg', '/uploads/wap/spread/poster/73f1220190729114211764053.jpg', '82294', 'image/jpeg', 1, 1564371731, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (271, 'b19aa20190729114211524438.jpg', '/uploads/wap/spread/poster/b19aa20190729114211524438.jpg', '/uploads/wap/spread/poster/b19aa20190729114211524438.jpg', '54662', 'image/jpeg', 1, 1564371731, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (272, '475cc20190729114211191252.jpg', '/uploads/wap/spread/poster/475cc20190729114211191252.jpg', '/uploads/wap/spread/poster/475cc20190729114211191252.jpg', '75318', 'image/jpeg', 1, 1564371731, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (273, '106cf7d2473a65caea57d4400db2293b.png', '/uploads/attach/2019/07/29/20190729/106cf7d2473a65caea57d4400db2293b.png', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/attach/2019/07/29/20190729/s_106cf7d2473a65caea57d4400db2293b.png', '2932', 'image/png', 26, 1564394584, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (274, 'd73aa4b4f1add2f22698e7e9aa75d25c.gif', '/uploads/Users/xurongyao/web/gitee/taobao/DTv3.0/app/admin//attach/2019/07/20190729/d73aa4b4f1add2f22698e7e9aa75d25c.gif', '//Users/xurongyao/web/gitee/taobao/DTv3.0/public/uploads/Users/xurongyao/web/gitee/taobao/DTv3.0/app/admin//attach/2019/07/20190729/s_d73aa4b4f1add2f22698e7e9aa75d25c.gif', '132546', 'image/gif', 26, 1564394873, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (275, '04fc4307e1668868b4e54a8f970621c2.png', '/uploads/attach/2019/07/29/20190729/04fc4307e1668868b4e54a8f970621c2.png', '//Users/xurongyao/web/gitee/taobao/DTv3.0/public/uploads/attach/2019/07/29/20190729/s_04fc4307e1668868b4e54a8f970621c2.png', '2932', 'image/png', 26, 1564394958, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (276, 'b707bf9713d6c89d9200a9353d2d7cf9.gif', '/uploads/attach/2019/07/20190729/b707bf9713d6c89d9200a9353d2d7cf9.gif', '//Users/xurongyao/web/gitee/taobao/DTv3.0/public/uploads/attach/2019/07/20190729/s_b707bf9713d6c89d9200a9353d2d7cf9.gif', '132546', 'image/gif', 26, 1564395021, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (277, 'f99bbe0a729a7f795180c0b9ba380347.gif', '/uploads/attach/2019/07/20190729/f99bbe0a729a7f795180c0b9ba380347.gif', '//Users/xurongyao/web/gitee/taobao/DTv3.0/public/uploads/attach/2019/07/20190729/s_f99bbe0a729a7f795180c0b9ba380347.gif', '164200', 'image/gif', 26, 1564395547, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (278, '352_0_user_wap.jpg', '/uploads/qrcode/352_0_user_wap.jpg', '/uploads/qrcode/352_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564397815, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (279, 'd91ca20190729185656918616.jpg', '/uploads/wap/spread/poster/d91ca20190729185656918616.jpg', '/uploads/wap/spread/poster/d91ca20190729185656918616.jpg', '81833', 'image/jpeg', 1, 1564397816, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (280, '80f2f20190729185656885349.jpg', '/uploads/wap/spread/poster/80f2f20190729185656885349.jpg', '/uploads/wap/spread/poster/80f2f20190729185656885349.jpg', '54212', 'image/jpeg', 1, 1564397816, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (281, 'e92e120190729185656984253.jpg', '/uploads/wap/spread/poster/e92e120190729185656984253.jpg', '/uploads/wap/spread/poster/e92e120190729185656984253.jpg', '74860', 'image/jpeg', 1, 1564397816, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (282, '94e7020190729185703860551.jpg', '/uploads/wap/spread/poster/94e7020190729185703860551.jpg', '/uploads/wap/spread/poster/94e7020190729185703860551.jpg', '81833', 'image/jpeg', 1, 1564397823, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (283, '88bfc20190729185703924079.jpg', '/uploads/wap/spread/poster/88bfc20190729185703924079.jpg', '/uploads/wap/spread/poster/88bfc20190729185703924079.jpg', '54212', 'image/jpeg', 1, 1564397824, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (284, 'ab24c20190729185704604459.jpg', '/uploads/wap/spread/poster/ab24c20190729185704604459.jpg', '/uploads/wap/spread/poster/ab24c20190729185704604459.jpg', '74860', 'image/jpeg', 1, 1564397824, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (285, '9741620190729211128463392.jpg', '/uploads/wap/spread/poster/9741620190729211128463392.jpg', '/uploads/wap/spread/poster/9741620190729211128463392.jpg', '82978', 'image/jpeg', 1, 1564405888, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (286, '3ae4f20190729211128320428.jpg', '/uploads/wap/spread/poster/3ae4f20190729211128320428.jpg', '/uploads/wap/spread/poster/3ae4f20190729211128320428.jpg', '55332', 'image/jpeg', 1, 1564405888, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (287, '959a520190729211128507631.jpg', '/uploads/wap/spread/poster/959a520190729211128507631.jpg', '/uploads/wap/spread/poster/959a520190729211128507631.jpg', '75989', 'image/jpeg', 1, 1564405888, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (288, '6852120190729211132619955.jpg', '/uploads/wap/spread/poster/6852120190729211132619955.jpg', '/uploads/wap/spread/poster/6852120190729211132619955.jpg', '82978', 'image/jpeg', 1, 1564405892, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (289, 'f52db20190729211132743628.jpg', '/uploads/wap/spread/poster/f52db20190729211132743628.jpg', '/uploads/wap/spread/poster/f52db20190729211132743628.jpg', '55332', 'image/jpeg', 1, 1564405892, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (290, '88fcf20190729211132682614.jpg', '/uploads/wap/spread/poster/88fcf20190729211132682614.jpg', '/uploads/wap/spread/poster/88fcf20190729211132682614.jpg', '75989', 'image/jpeg', 1, 1564405892, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (291, '371_0_user_wap.jpg', '/uploads/qrcode/371_0_user_wap.jpg', '/uploads/qrcode/371_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564449555, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (292, '9a83e20190730091915509816.jpg', '/uploads/wap/spread/poster/9a83e20190730091915509816.jpg', '/uploads/wap/spread/poster/9a83e20190730091915509816.jpg', '82122', 'image/jpeg', 1, 1564449555, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (293, 'b0da920190730091915740518.jpg', '/uploads/wap/spread/poster/b0da920190730091915740518.jpg', '/uploads/wap/spread/poster/b0da920190730091915740518.jpg', '54486', 'image/jpeg', 1, 1564449555, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (294, 'd3a0320190730091915104142.jpg', '/uploads/wap/spread/poster/d3a0320190730091915104142.jpg', '/uploads/wap/spread/poster/d3a0320190730091915104142.jpg', '75147', 'image/jpeg', 1, 1564449555, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (295, 'ff3f3882ddf869802b5aff952a8f3c1a.jpeg', '/uploads/store/comment/20190730/ff3f3882ddf869802b5aff952a8f3c1a.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190730/s_ff3f3882ddf869802b5aff952a8f3c1a.jpeg', '47685', 'image/jpeg', 1, 1564468139, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (296, '6325dabdb6dbc5fbbcea9cd010e40234.jpeg', '/uploads/store/comment/20190730/6325dabdb6dbc5fbbcea9cd010e40234.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190730/s_6325dabdb6dbc5fbbcea9cd010e40234.jpeg', '34796', 'image/jpeg', 1, 1564468175, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (297, '933118f15adcb81397f41d221811a33d.png', '/uploads/store/comment/20190730/933118f15adcb81397f41d221811a33d.png', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190730/s_933118f15adcb81397f41d221811a33d.png', '2531', 'image/png', 1, 1564468746, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (298, 'c5ad720190730150450233974.jpg', '/uploads/wap/spread/poster/c5ad720190730150450233974.jpg', '/uploads/wap/spread/poster/c5ad720190730150450233974.jpg', '83037', 'image/jpeg', 1, 1564470290, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (299, '72f6720190730150450892545.jpg', '/uploads/wap/spread/poster/72f6720190730150450892545.jpg', '/uploads/wap/spread/poster/72f6720190730150450892545.jpg', '55417', 'image/jpeg', 1, 1564470290, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (300, '23ce120190730150450992758.jpg', '/uploads/wap/spread/poster/23ce120190730150450992758.jpg', '/uploads/wap/spread/poster/23ce120190730150450992758.jpg', '76071', 'image/jpeg', 1, 1564470290, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (301, '705f220190730150503481328.jpg', '/uploads/wap/spread/poster/705f220190730150503481328.jpg', '/uploads/wap/spread/poster/705f220190730150503481328.jpg', '83037', 'image/jpeg', 1, 1564470303, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (302, 'ec20020190730150503417174.jpg', '/uploads/wap/spread/poster/ec20020190730150503417174.jpg', '/uploads/wap/spread/poster/ec20020190730150503417174.jpg', '55417', 'image/jpeg', 1, 1564470303, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (303, '257de20190730150503671162.jpg', '/uploads/wap/spread/poster/257de20190730150503671162.jpg', '/uploads/wap/spread/poster/257de20190730150503671162.jpg', '76071', 'image/jpeg', 1, 1564470303, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (304, '8caa320190730150506802564.jpg', '/uploads/wap/spread/poster/8caa320190730150506802564.jpg', '/uploads/wap/spread/poster/8caa320190730150506802564.jpg', '83037', 'image/jpeg', 1, 1564470306, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (305, '48c002019073015050658568.jpg', '/uploads/wap/spread/poster/48c002019073015050658568.jpg', '/uploads/wap/spread/poster/48c002019073015050658568.jpg', '55417', 'image/jpeg', 1, 1564470306, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (306, '96bea20190730150506801451.jpg', '/uploads/wap/spread/poster/96bea20190730150506801451.jpg', '/uploads/wap/spread/poster/96bea20190730150506801451.jpg', '76071', 'image/jpeg', 1, 1564470306, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (307, '2_product_detail_wap.jpg', '/uploads/qrcode/2_product_detail_wap.jpg', '/uploads/qrcode/2_product_detail_wap.jpg', '510', 'image/jpeg', 1, 1564470318, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (308, '3_product_detail_wap.jpg', '/uploads/qrcode/3_product_detail_wap.jpg', '/uploads/qrcode/3_product_detail_wap.jpg', '515', 'image/jpeg', 1, 1564470340, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (309, '5_product_detail_wap.jpg', '/uploads/qrcode/5_product_detail_wap.jpg', '/uploads/qrcode/5_product_detail_wap.jpg', '509', 'image/jpeg', 1, 1564470506, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (310, '13_product_detail_wap.jpg', '/uploads/qrcode/13_product_detail_wap.jpg', '/uploads/qrcode/13_product_detail_wap.jpg', '507', 'image/jpeg', 1, 1564470717, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (311, '13_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/13_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/13_product_detail_168_is_promoter_1.wap.jpg', '600', 'image/jpeg', 1, 1564470719, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (312, 'd9825854de8e1955645b36c2d22a2a2f.jpg', '/uploads/attach/2019/07/20190730/d9825854de8e1955645b36c2d22a2a2f.jpg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/attach/2019/07/20190730/s_d9825854de8e1955645b36c2d22a2a2f.jpg', '48755', 'image/jpeg', 28, 1564470906, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (335, '13_seckill_detail_wap.jpg', '/uploads/qrcode/13_seckill_detail_wap.jpg', '/uploads/qrcode/13_seckill_detail_wap.jpg', '695', 'image/jpeg', 1, 1564471303, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (336, '69eb5f09f947ff53244a57d5c021b817.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/69eb5f09f947ff53244a57d5c021b817.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/69eb5f09f947ff53244a57d5c021b817.jpg', '377824', 'image/jpeg', 9, 1564471315, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (337, '69eb5f09f947ff53244a57d5c021b817.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/69eb5f09f947ff53244a57d5c021b817.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/69eb5f09f947ff53244a57d5c021b817.jpg', '377824', 'image/jpeg', 9, 1564471315, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (338, 'ce0a2ed478552ca0bfc7092f337c8d10.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/ce0a2ed478552ca0bfc7092f337c8d10.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/ce0a2ed478552ca0bfc7092f337c8d10.jpg', '196474', 'image/jpeg', 9, 1564471315, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (339, '13efc762f7fdfec35ad2eeedc541db4b.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/13efc762f7fdfec35ad2eeedc541db4b.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/13efc762f7fdfec35ad2eeedc541db4b.jpg', '196646', 'image/jpeg', 9, 1564471315, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (340, '4d280506de9f99621d6c9257abb00002.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/4d280506de9f99621d6c9257abb00002.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/4d280506de9f99621d6c9257abb00002.jpg', '166156', 'image/jpeg', 9, 1564471315, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (341, 'b07e8708977de9c820d7d97958776f8d.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/b07e8708977de9c820d7d97958776f8d.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/b07e8708977de9c820d7d97958776f8d.jpg', '238765', 'image/jpeg', 9, 1564471316, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (342, '60a1b15d3a76d624e8fe4f29d6405329.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/60a1b15d3a76d624e8fe4f29d6405329.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/60a1b15d3a76d624e8fe4f29d6405329.jpg', '235698', 'image/jpeg', 9, 1564471316, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (343, '4d756807800de48cf64515abde691858.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/4d756807800de48cf64515abde691858.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/4d756807800de48cf64515abde691858.jpg', '208245', 'image/jpeg', 9, 1564471316, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (344, '6eb36373e34467b616caf8ebd628b8a9.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/6eb36373e34467b616caf8ebd628b8a9.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/6eb36373e34467b616caf8ebd628b8a9.jpg', '68136', 'image/jpeg', 9, 1564471316, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (345, '9fd1c33715375d14a910dc6ac16a1f01.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/9fd1c33715375d14a910dc6ac16a1f01.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/9fd1c33715375d14a910dc6ac16a1f01.jpg', '234315', 'image/jpeg', 9, 1564471316, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (346, 'cf82af05b3627661f7311b437fd4ef75.png', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/cf82af05b3627661f7311b437fd4ef75.png', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/cf82af05b3627661f7311b437fd4ef75.png', '724918', 'image/png', 9, 1564471317, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (347, '6a199d8d05c1ade1d9d9d430af0c2135.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/6a199d8d05c1ade1d9d9d430af0c2135.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/6a199d8d05c1ade1d9d9d430af0c2135.jpg', '368263', 'image/jpeg', 9, 1564471317, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (348, 'ba7b6671f1ab84b7d1ff9f7ae483db97.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/ba7b6671f1ab84b7d1ff9f7ae483db97.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/ba7b6671f1ab84b7d1ff9f7ae483db97.jpg', '388901', 'image/jpeg', 9, 1564471317, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (349, '17c4918d59ef74b5f15b63ce905cc301.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/17c4918d59ef74b5f15b63ce905cc301.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/17c4918d59ef74b5f15b63ce905cc301.jpg', '496157', 'image/jpeg', 9, 1564471317, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (350, '29bcd8aeffa602b6bc37c9ea219f54a1.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/29bcd8aeffa602b6bc37c9ea219f54a1.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/29bcd8aeffa602b6bc37c9ea219f54a1.jpg', '213140', 'image/jpeg', 9, 1564471317, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (351, '5ccce7202973e32e7b2086010e29038b.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/5ccce7202973e32e7b2086010e29038b.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/5ccce7202973e32e7b2086010e29038b.jpg', '244587', 'image/jpeg', 9, 1564471318, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (352, 'dc887ac553f4ea66365e69a626b4f030.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/dc887ac553f4ea66365e69a626b4f030.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/dc887ac553f4ea66365e69a626b4f030.jpg', '281625', 'image/jpeg', 9, 1564471318, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (353, '77aedb47edfd4f9f3fe4d0be51bb2994.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/77aedb47edfd4f9f3fe4d0be51bb2994.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/77aedb47edfd4f9f3fe4d0be51bb2994.jpg', '415317', 'image/jpeg', 9, 1564471318, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (354, 'c57055e3fbd06b6947e49da47751ed7e.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/c57055e3fbd06b6947e49da47751ed7e.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/c57055e3fbd06b6947e49da47751ed7e.jpg', '351565', 'image/jpeg', 9, 1564471318, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (355, 'efdf887ad14277311c8f373197bd95ad.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/efdf887ad14277311c8f373197bd95ad.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/efdf887ad14277311c8f373197bd95ad.jpg', '301960', 'image/jpeg', 9, 1564471318, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (356, '39154c06e825503436d4e488aecfc466.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/39154c06e825503436d4e488aecfc466.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/39154c06e825503436d4e488aecfc466.jpg', '195113', 'image/jpeg', 9, 1564471319, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (357, '3bbf70c1bbebee6dec6717700a1a0fb1.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/3bbf70c1bbebee6dec6717700a1a0fb1.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/07/30/3bbf70c1bbebee6dec6717700a1a0fb1.jpg', '580964', 'image/jpeg', 9, 1564471319, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (358, '17_product_detail_wap.jpg', '/uploads/qrcode/17_product_detail_wap.jpg', '/uploads/qrcode/17_product_detail_wap.jpg', '515', 'image/jpeg', 1, 1564471378, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (359, '15_product_detail_wap.jpg', '/uploads/qrcode/15_product_detail_wap.jpg', '/uploads/qrcode/15_product_detail_wap.jpg', '503', 'image/jpeg', 1, 1564471548, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (360, '877a02bb7784829a8228a5acb176fc4e.jpeg', '/uploads/store/comment/20190730/877a02bb7784829a8228a5acb176fc4e.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190730/s_877a02bb7784829a8228a5acb176fc4e.jpeg', '34796', 'image/jpeg', 1, 1564471601, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (361, '15_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/15_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/15_product_detail_168_is_promoter_1.wap.jpg', '597', 'image/jpeg', 1, 1564471759, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (362, '9_product_detail_wap.jpg', '/uploads/qrcode/9_product_detail_wap.jpg', '/uploads/qrcode/9_product_detail_wap.jpg', '505', 'image/jpeg', 1, 1564471851, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (363, '11_product_detail_wap.jpg', '/uploads/qrcode/11_product_detail_wap.jpg', '/uploads/qrcode/11_product_detail_wap.jpg', '507', 'image/jpeg', 1, 1564471867, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (364, '7_combination_detail_wap.jpg', '/uploads/qrcode/7_combination_detail_wap.jpg', '/uploads/qrcode/7_combination_detail_wap.jpg', '701', 'image/jpeg', 1, 1564471947, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (365, '14_product_detail_wap.jpg', '/uploads/qrcode/14_product_detail_wap.jpg', '/uploads/qrcode/14_product_detail_wap.jpg', '508', 'image/jpeg', 1, 1564472782, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (366, '12_product_detail_wap.jpg', '/uploads/qrcode/12_product_detail_wap.jpg', '/uploads/qrcode/12_product_detail_wap.jpg', '506', 'image/jpeg', 1, 1564473217, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (367, 'abcc8565c09de61b2cc05a00a787c493.jpeg', '/uploads/store/comment/20190730/abcc8565c09de61b2cc05a00a787c493.jpeg', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/store/comment/20190730/s_abcc8565c09de61b2cc05a00a787c493.jpeg', '255441', 'image/jpeg', 1, 1564473381, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (368, '8_product_detail_wap.jpg', '/uploads/qrcode/8_product_detail_wap.jpg', '/uploads/qrcode/8_product_detail_wap.jpg', '507', 'image/jpeg', 1, 1564474013, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (369, '7_product_detail_wap.jpg', '/uploads/qrcode/7_product_detail_wap.jpg', '/uploads/qrcode/7_product_detail_wap.jpg', '508', 'image/jpeg', 1, 1564474410, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (370, '0ded3d3f72d654fb33c8c9f30a268c97.png', '/uploads/attach/2019/07/20190730/0ded3d3f72d654fb33c8c9f30a268c97.png', '//web/wwwroot/kaifa.crmeb.net/CRMEB/public/uploads/attach/2019/07/20190730/s_0ded3d3f72d654fb33c8c9f30a268c97.png', '1520', 'image/png', 4, 1564482007, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (371, '415_0_user_wap.jpg', '/uploads/qrcode/415_0_user_wap.jpg', '/uploads/qrcode/415_0_user_wap.jpg', '421', 'image/jpeg', 1, 1564493992, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (372, 'dd17e20190730213952987055.jpg', '/uploads/wap/spread/poster/dd17e20190730213952987055.jpg', '/uploads/wap/spread/poster/dd17e20190730213952987055.jpg', '82221', 'image/jpeg', 1, 1564493992, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (373, 'b691320190730213952751597.jpg', '/uploads/wap/spread/poster/b691320190730213952751597.jpg', '/uploads/wap/spread/poster/b691320190730213952751597.jpg', '54599', 'image/jpeg', 1, 1564493992, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (374, '3f68920190730213953417231.jpg', '/uploads/wap/spread/poster/3f68920190730213953417231.jpg', '/uploads/wap/spread/poster/3f68920190730213953417231.jpg', '75246', 'image/jpeg', 1, 1564493993, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (375, '3_425_0_bargain_share_wap.jpg', '/uploads/qrcode/3_425_0_bargain_share_wap.jpg', '/uploads/qrcode/3_425_0_bargain_share_wap.jpg', '693', 'image/jpeg', 1, 1564537331, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (376, '0e4a220190731094211638237.jpg', '/uploads/wap/activity/bargain/poster/0e4a220190731094211638237.jpg', '/uploads/wap/activity/bargain/poster/0e4a220190731094211638237.jpg', '49868', 'image/jpeg', 1, 1564537331, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (377, '3_204_0_bargain_share_wap.jpg', '/uploads/qrcode/3_204_0_bargain_share_wap.jpg', '/uploads/qrcode/3_204_0_bargain_share_wap.jpg', '688', 'image/jpeg', 1, 1564537378, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (378, 'd81f220190731094258162370.jpg', '/uploads/wap/activity/bargain/poster/d81f220190731094258162370.jpg', '/uploads/wap/activity/bargain/poster/d81f220190731094258162370.jpg', '49691', 'image/jpeg', 1, 1564537378, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (379, '1769320190731094332310972.jpg', '/uploads/wap/activity/bargain/poster/1769320190731094332310972.jpg', '/uploads/wap/activity/bargain/poster/1769320190731094332310972.jpg', '49691', 'image/jpeg', 1, 1564537412, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (380, '5f26820190731094348129377.jpg', '/uploads/wap/activity/bargain/poster/5f26820190731094348129377.jpg', '/uploads/wap/activity/bargain/poster/5f26820190731094348129377.jpg', '49691', 'image/jpeg', 1, 1564537428, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (381, '02f0620190731094507277981.jpg', '/uploads/wap/activity/bargain/poster/02f0620190731094507277981.jpg', '/uploads/wap/activity/bargain/poster/02f0620190731094507277981.jpg', '49691', 'image/jpeg', 1, 1564537507, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (382, 'b200420190731094638251493.jpg', '/uploads/wap/activity/bargain/poster/b200420190731094638251493.jpg', '/uploads/wap/activity/bargain/poster/b200420190731094638251493.jpg', '49691', 'image/jpeg', 1, 1564537598, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (383, '6_combination_detail_wap.jpg', '/uploads/qrcode/6_combination_detail_wap.jpg', '/uploads/qrcode/6_combination_detail_wap.jpg', '704', 'image/jpeg', 1, 1564538325, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (384, '3_395_0_bargain_share_wap.jpg', '/uploads/qrcode/3_395_0_bargain_share_wap.jpg', '/uploads/qrcode/3_395_0_bargain_share_wap.jpg', '691', 'image/jpeg', 1, 1564538706, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (385, 'b20052019073110050785470.jpg', '/uploads/wap/activity/bargain/poster/b20052019073110050785470.jpg', '/uploads/wap/activity/bargain/poster/b20052019073110050785470.jpg', '50195', 'image/jpeg', 1, 1564538707, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (386, '5_395_0_bargain_share_wap.jpg', '/uploads/qrcode/5_395_0_bargain_share_wap.jpg', '/uploads/qrcode/5_395_0_bargain_share_wap.jpg', '689', 'image/jpeg', 1, 1564538865, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (387, '6098e20190731100746153509.jpg', '/uploads/wap/activity/bargain/poster/6098e20190731100746153509.jpg', '/uploads/wap/activity/bargain/poster/6098e20190731100746153509.jpg', '53472', 'image/jpeg', 1, 1564538866, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (388, '3_436_0_bargain_share_wap.jpg', '/uploads/qrcode/3_436_0_bargain_share_wap.jpg', '/uploads/qrcode/3_436_0_bargain_share_wap.jpg', '703', 'image/jpeg', 1, 1564542315, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (389, '15d4e20190731110515161770.jpg', '/uploads/wap/activity/bargain/poster/15d4e20190731110515161770.jpg', '/uploads/wap/activity/bargain/poster/15d4e20190731110515161770.jpg', '49981', 'image/jpeg', 1, 1564542315, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (390, '07458ad91b07fe421f8617d4fa937874.png', '/uploads/attach/2019/07/20190731/07458ad91b07fe421f8617d4fa937874.png', '/./uploads/attach/2019/07/20190731/s_07458ad91b07fe421f8617d4fa937874.png', '2932', 'image/png', 26, 1564555904, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (391, '3_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/3_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/3_product_detail_168_is_promoter_1.wap.jpg', '596', 'image/jpeg', 1, 1564560003, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (392, '19_168_1_pink_share_wap.jpg', '/uploads/qrcode/19_168_1_pink_share_wap.jpg', '/uploads/qrcode/19_168_1_pink_share_wap.jpg', '704', 'image/jpeg', 1, 1564561106, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (393, '0325520190731161827831800.jpg', '/uploads/wap/activity/pink/poster/0325520190731161827831800.jpg', '/uploads/wap/activity/pink/poster/0325520190731161827831800.jpg', '53521', 'image/jpeg', 1, 1564561107, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (394, '6_168_1_bargain_share_wap.jpg', '/uploads/qrcode/6_168_1_bargain_share_wap.jpg', '/uploads/qrcode/6_168_1_bargain_share_wap.jpg', '688', 'image/jpeg', 1, 1564561316, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (395, '9e9a32019073116215657375.jpg', '/uploads/wap/activity/bargain/poster/9e9a32019073116215657375.jpg', '/uploads/wap/activity/bargain/poster/9e9a32019073116215657375.jpg', '51590', 'image/jpeg', 1, 1564561316, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (396, '5_168_1_bargain_share_wap.jpg', '/uploads/qrcode/5_168_1_bargain_share_wap.jpg', '/uploads/qrcode/5_168_1_bargain_share_wap.jpg', '694', 'image/jpeg', 1, 1564561330, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (397, '583cf20190731162210232404.jpg', '/uploads/wap/activity/bargain/poster/583cf20190731162210232404.jpg', '/uploads/wap/activity/bargain/poster/583cf20190731162210232404.jpg', '53276', 'image/jpeg', 1, 1564561330, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (398, '4e46e20190731162213519296.jpg', '/uploads/wap/activity/bargain/poster/4e46e20190731162213519296.jpg', '/uploads/wap/activity/bargain/poster/4e46e20190731162213519296.jpg', '53276', 'image/jpeg', 1, 1564561333, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (399, '70d3120190731162218376.jpg', '/uploads/wap/activity/bargain/poster/70d3120190731162218376.jpg', '/uploads/wap/activity/bargain/poster/70d3120190731162218376.jpg', '51590', 'image/jpeg', 1, 1564561338, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (400, '5ea1620190731163024676497.jpg', '/uploads/wap/activity/pink/poster/5ea1620190731163024676497.jpg', '/uploads/wap/activity/pink/poster/5ea1620190731163024676497.jpg', '53521', 'image/jpeg', 1, 1564561824, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (401, 'aee922019073116302747985.jpg', '/uploads/wap/activity/pink/poster/aee922019073116302747985.jpg', '/uploads/wap/activity/pink/poster/aee922019073116302747985.jpg', '53521', 'image/jpeg', 1, 1564561827, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (402, 'cec6f20190731163107641673.jpg', '/uploads/wap/spread/poster/cec6f20190731163107641673.jpg', '/uploads/wap/spread/poster/cec6f20190731163107641673.jpg', '83037', 'image/jpeg', 1, 1564561867, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (403, 'abdeb20190731163107912404.jpg', '/uploads/wap/spread/poster/abdeb20190731163107912404.jpg', '/uploads/wap/spread/poster/abdeb20190731163107912404.jpg', '55417', 'image/jpeg', 1, 1564561867, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (404, '2b5152019073116310859207.jpg', '/uploads/wap/spread/poster/2b5152019073116310859207.jpg', '/uploads/wap/spread/poster/2b5152019073116310859207.jpg', '76071', 'image/jpeg', 1, 1564561868, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (405, '799fc20190731180659979508.jpg', '/uploads/wap/spread/poster/799fc20190731180659979508.jpg', '/uploads/wap/spread/poster/799fc20190731180659979508.jpg', '83037', 'image/jpeg', 1, 1564567619, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (406, 'd296c20190731180659489101.jpg', '/uploads/wap/spread/poster/d296c20190731180659489101.jpg', '/uploads/wap/spread/poster/d296c20190731180659489101.jpg', '55417', 'image/jpeg', 1, 1564567619, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (407, '884d720190731180659390579.jpg', '/uploads/wap/spread/poster/884d720190731180659390579.jpg', '/uploads/wap/spread/poster/884d720190731180659390579.jpg', '76071', 'image/jpeg', 1, 1564567619, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (408, '3_168_1_bargain_share_wap.jpg', '/uploads/qrcode/3_168_1_bargain_share_wap.jpg', '/uploads/qrcode/3_168_1_bargain_share_wap.jpg', '697', 'image/jpeg', 1, 1564567647, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (409, '4f16420190731180727576491.jpg', '/uploads/wap/activity/bargain/poster/4f16420190731180727576491.jpg', '/uploads/wap/activity/bargain/poster/4f16420190731180727576491.jpg', '50223', 'image/jpeg', 1, 1564567647, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (410, '5_combination_detail_wap.jpg', '/uploads/qrcode/5_combination_detail_wap.jpg', '/uploads/qrcode/5_combination_detail_wap.jpg', '707', 'image/jpeg', 1, 1564582398, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (411, '7c66482c00732e44c87af7e29196ddd8.jpeg', '/uploads/store/comment/20190801/7c66482c00732e44c87af7e29196ddd8.jpeg', '/./uploads/store/comment/20190801/s_7c66482c00732e44c87af7e29196ddd8.jpeg', '79481', 'image/jpeg', 1, 1564644698, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (412, 'ea1ba34d69b83ce1d5e28098816541fa.jpg', '/uploads/store/comment/20190801/ea1ba34d69b83ce1d5e28098816541fa.jpg', '/./uploads/store/comment/20190801/s_ea1ba34d69b83ce1d5e28098816541fa.jpg', '248362', 'image/jpeg', 1, 1564647303, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (413, 'deb30359d22c0b80f3cece86cb462104.png', '/uploads/attach/2019/08/20190801/deb30359d22c0b80f3cece86cb462104.png', '/./uploads/attach/2019/08/20190801/s_deb30359d22c0b80f3cece86cb462104.png', '2932', 'image/png', 24, 1564651414, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (414, 'af69ee46c79ec68b578afea61b5a37e4.jpg', '/uploads/attach/2019/08/20190801/af69ee46c79ec68b578afea61b5a37e4.jpg', '/./uploads/attach/2019/08/20190801/s_af69ee46c79ec68b578afea61b5a37e4.jpg', '57080', 'image/jpeg', 29, 1564653739, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (415, 'babe42d3a353d81b3a2a766dddf11208.jpg', '/uploads/attach/2019/08/20190801/babe42d3a353d81b3a2a766dddf11208.jpg', '/./uploads/attach/2019/08/20190801/s_babe42d3a353d81b3a2a766dddf11208.jpg', '74513', 'image/jpeg', 29, 1564653981, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (416, 'e27e3110eef4b0338368f2203eab8a0b.jpg', '/uploads/attach/2019/08/20190801/e27e3110eef4b0338368f2203eab8a0b.jpg', '/./uploads/attach/2019/08/20190801/s_e27e3110eef4b0338368f2203eab8a0b.jpg', '34604', 'image/jpeg', 29, 1564654207, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (418, '4b642ff5685eaf9f2bf205987b13c546.jpg', '/uploads/attach/2019/08/20190801/4b642ff5685eaf9f2bf205987b13c546.jpg', '/./uploads/attach/2019/08/20190801/s_4b642ff5685eaf9f2bf205987b13c546.jpg', '50247', 'image/jpeg', 29, 1564654405, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (419, '4_combination_detail_wap.jpg', '/uploads/qrcode/4_combination_detail_wap.jpg', '/uploads/qrcode/4_combination_detail_wap.jpg', '704', 'image/jpeg', 1, 1564657492, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (420, '419_0_user_wap.jpg', '/uploads/qrcode/419_0_user_wap.jpg', '/uploads/qrcode/419_0_user_wap.jpg', '509', 'image/jpeg', 1, 1564677147, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (421, '9bdb820190802003228575917.jpg', '/uploads/wap/spread/poster/9bdb820190802003228575917.jpg', '/uploads/wap/spread/poster/9bdb820190802003228575917.jpg', '82815', 'image/jpeg', 1, 1564677148, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (422, '1fd6c20190802003228154299.jpg', '/uploads/wap/spread/poster/1fd6c20190802003228154299.jpg', '/uploads/wap/spread/poster/1fd6c20190802003228154299.jpg', '55194', 'image/jpeg', 1, 1564677148, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (423, 'ce11620190802003228417224.jpg', '/uploads/wap/spread/poster/ce11620190802003228417224.jpg', '/uploads/wap/spread/poster/ce11620190802003228417224.jpg', '75830', 'image/jpeg', 1, 1564677148, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (424, 'eeb6920190802071402746172.jpg', '/uploads/wap/spread/poster/eeb6920190802071402746172.jpg', '/uploads/wap/spread/poster/eeb6920190802071402746172.jpg', '82815', 'image/jpeg', 1, 1564701242, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (425, 'f5c1520190802071403159910.jpg', '/uploads/wap/spread/poster/f5c1520190802071403159910.jpg', '/uploads/wap/spread/poster/f5c1520190802071403159910.jpg', '55194', 'image/jpeg', 1, 1564701243, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (426, '995f520190802071403443279.jpg', '/uploads/wap/spread/poster/995f520190802071403443279.jpg', '/uploads/wap/spread/poster/995f520190802071403443279.jpg', '75830', 'image/jpeg', 1, 1564701243, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (427, 'dc4c42019080208484862611.jpg', '/uploads/wap/spread/poster/dc4c42019080208484862611.jpg', '/uploads/wap/spread/poster/dc4c42019080208484862611.jpg', '83037', 'image/jpeg', 1, 1564706928, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (428, 'a34ba20190802084849473129.jpg', '/uploads/wap/spread/poster/a34ba20190802084849473129.jpg', '/uploads/wap/spread/poster/a34ba20190802084849473129.jpg', '55417', 'image/jpeg', 1, 1564706929, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (429, '2012520190802084849927297.jpg', '/uploads/wap/spread/poster/2012520190802084849927297.jpg', '/uploads/wap/spread/poster/2012520190802084849927297.jpg', '76071', 'image/jpeg', 1, 1564706929, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (430, 'bf0612eb1e2c2dd8294396ab50305812.gif', '/uploads/store/comment/20190802/bf0612eb1e2c2dd8294396ab50305812.gif', '/./uploads/store/comment/20190802/s_bf0612eb1e2c2dd8294396ab50305812.gif', '1079593', 'image/gif', 1, 1564707895, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (431, '3_product_detail_443_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_443_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_443_is_promoter_0.wap.jpg', '613', 'image/jpeg', 1, 1564710493, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (432, 'd388a1de318fa8549f35112dff426a02.jpeg', '/uploads/store/comment/20190802/d388a1de318fa8549f35112dff426a02.jpeg', '/./uploads/store/comment/20190802/s_d388a1de318fa8549f35112dff426a02.jpeg', '84273', 'image/jpeg', 1, 1564716732, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (433, '2bcab2019080309425955023.jpg', '/uploads/wap/activity/bargain/poster/2bcab2019080309425955023.jpg', '/uploads/wap/activity/bargain/poster/2bcab2019080309425955023.jpg', '50223', 'image/jpeg', 1, 1564796579, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (434, '3_189_0_bargain_share_wap.jpg', '/uploads/qrcode/3_189_0_bargain_share_wap.jpg', '/uploads/qrcode/3_189_0_bargain_share_wap.jpg', '805', 'image/jpeg', 1, 1564835273, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (435, 'f037020190803202754648738.jpg', '/uploads/wap/activity/bargain/poster/f037020190803202754648738.jpg', '/uploads/wap/activity/bargain/poster/f037020190803202754648738.jpg', '50493', 'image/jpeg', 1, 1564835274, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (436, '1ab60201908032027575049.jpg', '/uploads/wap/activity/bargain/poster/1ab60201908032027575049.jpg', '/uploads/wap/activity/bargain/poster/1ab60201908032027575049.jpg', '50493', 'image/jpeg', 1, 1564835277, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (437, 'e362820190804170307134451.jpg', '/uploads/wap/spread/poster/e362820190804170307134451.jpg', '/uploads/wap/spread/poster/e362820190804170307134451.jpg', '83136', 'image/jpeg', 1, 1564909387, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (438, '0741720190804170307431588.jpg', '/uploads/wap/spread/poster/0741720190804170307431588.jpg', '/uploads/wap/spread/poster/0741720190804170307431588.jpg', '55503', 'image/jpeg', 1, 1564909387, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (439, '6a66120190804170307325610.jpg', '/uploads/wap/spread/poster/6a66120190804170307325610.jpg', '/uploads/wap/spread/poster/6a66120190804170307325610.jpg', '76163', 'image/jpeg', 1, 1564909387, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (440, '576e520190804170837710738.jpg', '/uploads/wap/spread/poster/576e520190804170837710738.jpg', '/uploads/wap/spread/poster/576e520190804170837710738.jpg', '83136', 'image/jpeg', 1, 1564909717, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (441, '170f620190804170837300050.jpg', '/uploads/wap/spread/poster/170f620190804170837300050.jpg', '/uploads/wap/spread/poster/170f620190804170837300050.jpg', '55503', 'image/jpeg', 1, 1564909717, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (442, 'ca3a920190804170837558790.jpg', '/uploads/wap/spread/poster/ca3a920190804170837558790.jpg', '/uploads/wap/spread/poster/ca3a920190804170837558790.jpg', '76163', 'image/jpeg', 1, 1564909717, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (443, '3_product_detail_195_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_195_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_195_is_promoter_0.wap.jpg', '594', 'image/jpeg', 1, 1564927310, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (444, '68c4bc506d0ce62678e5ad0b5186f444.jpeg', '/uploads/store/comment/20190805/68c4bc506d0ce62678e5ad0b5186f444.jpeg', '/./uploads/store/comment/20190805/s_68c4bc506d0ce62678e5ad0b5186f444.jpeg', '50775', 'image/jpeg', 1, 1564963901, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (445, '4e77a1a4eb8484c819811315892b9612.jpeg', '/uploads/store/comment/20190805/4e77a1a4eb8484c819811315892b9612.jpeg', '/./uploads/store/comment/20190805/s_4e77a1a4eb8484c819811315892b9612.jpeg', '50775', 'image/jpeg', 1, 1564964012, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (446, 'fdbe78bb1d6d8d73b2248199b95ac44b.jpeg', '/uploads/store/comment/20190805/fdbe78bb1d6d8d73b2248199b95ac44b.jpeg', '/./uploads/store/comment/20190805/s_fdbe78bb1d6d8d73b2248199b95ac44b.jpeg', '50775', 'image/jpeg', 1, 1564964050, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (447, '4795120190805081433691633.jpg', '/uploads/wap/spread/poster/4795120190805081433691633.jpg', '/uploads/wap/spread/poster/4795120190805081433691633.jpg', '83037', 'image/jpeg', 1, 1564964073, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (448, '110e720190805081433747728.jpg', '/uploads/wap/spread/poster/110e720190805081433747728.jpg', '/uploads/wap/spread/poster/110e720190805081433747728.jpg', '55417', 'image/jpeg', 1, 1564964073, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (449, 'a115120190805081434892661.jpg', '/uploads/wap/spread/poster/a115120190805081434892661.jpg', '/uploads/wap/spread/poster/a115120190805081434892661.jpg', '76071', 'image/jpeg', 1, 1564964074, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (450, '260c22019080508200126861.jpg', '/uploads/wap/spread/poster/260c22019080508200126861.jpg', '/uploads/wap/spread/poster/260c22019080508200126861.jpg', '82086', 'image/jpeg', 1, 1564964401, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (451, '0ebcc20190805082002357931.jpg', '/uploads/wap/spread/poster/0ebcc20190805082002357931.jpg', '/uploads/wap/spread/poster/0ebcc20190805082002357931.jpg', '54464', 'image/jpeg', 1, 1564964402, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (452, '94f6d20190805082002613912.jpg', '/uploads/wap/spread/poster/94f6d20190805082002613912.jpg', '/uploads/wap/spread/poster/94f6d20190805082002613912.jpg', '75100', 'image/jpeg', 1, 1564964402, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (453, '2edfe20190805082030308267.jpg', '/uploads/wap/spread/poster/2edfe20190805082030308267.jpg', '/uploads/wap/spread/poster/2edfe20190805082030308267.jpg', '82086', 'image/jpeg', 1, 1564964430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (454, 'b83aa20190805082030551873.jpg', '/uploads/wap/spread/poster/b83aa20190805082030551873.jpg', '/uploads/wap/spread/poster/b83aa20190805082030551873.jpg', '54464', 'image/jpeg', 1, 1564964430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (455, 'a729d2019080508203145821.jpg', '/uploads/wap/spread/poster/a729d2019080508203145821.jpg', '/uploads/wap/spread/poster/a729d2019080508203145821.jpg', '75100', 'image/jpeg', 1, 1564964431, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (456, '76c5320190805082037481844.jpg', '/uploads/wap/spread/poster/76c5320190805082037481844.jpg', '/uploads/wap/spread/poster/76c5320190805082037481844.jpg', '82086', 'image/jpeg', 1, 1564964437, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (457, '309a820190805082037537577.jpg', '/uploads/wap/spread/poster/309a820190805082037537577.jpg', '/uploads/wap/spread/poster/309a820190805082037537577.jpg', '54464', 'image/jpeg', 1, 1564964437, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (458, '0266e20190805082037363218.jpg', '/uploads/wap/spread/poster/0266e20190805082037363218.jpg', '/uploads/wap/spread/poster/0266e20190805082037363218.jpg', '75100', 'image/jpeg', 1, 1564964437, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (459, 'c1eeb99308ae0e019ff45a835f3ca8e0.jpeg', '/uploads/store/comment/20190805/c1eeb99308ae0e019ff45a835f3ca8e0.jpeg', '/./uploads/store/comment/20190805/s_c1eeb99308ae0e019ff45a835f3ca8e0.jpeg', '50775', 'image/jpeg', 1, 1564967607, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (460, '455_0_user_wap.jpg', '/uploads/qrcode/455_0_user_wap.jpg', '/uploads/qrcode/455_0_user_wap.jpg', '507', 'image/jpeg', 1, 1564967633, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (461, '3123520190805091353485731.jpg', '/uploads/wap/spread/poster/3123520190805091353485731.jpg', '/uploads/wap/spread/poster/3123520190805091353485731.jpg', '82722', 'image/jpeg', 1, 1564967633, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (462, '0e57020190805091353912692.jpg', '/uploads/wap/spread/poster/0e57020190805091353912692.jpg', '/uploads/wap/spread/poster/0e57020190805091353912692.jpg', '55089', 'image/jpeg', 1, 1564967633, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (463, '1ff8a20190805091353617086.jpg', '/uploads/wap/spread/poster/1ff8a20190805091353617086.jpg', '/uploads/wap/spread/poster/1ff8a20190805091353617086.jpg', '75751', 'image/jpeg', 1, 1564967633, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (464, 'c15de8387d8d946c3ffb7ce24bb5023c.jpg', '/uploads/store/comment/20190805/c15de8387d8d946c3ffb7ce24bb5023c.jpg', '/./uploads/store/comment/20190805/s_c15de8387d8d946c3ffb7ce24bb5023c.jpg', '248684', 'image/jpeg', 1, 1564967974, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (465, '2ebf87df26dfdfaaf8b3f99e0c6159c7.jpg', '/uploads/store/comment/20190805/2ebf87df26dfdfaaf8b3f99e0c6159c7.jpg', '/./uploads/store/comment/20190805/s_2ebf87df26dfdfaaf8b3f99e0c6159c7.jpg', '264573', 'image/jpeg', 1, 1564967988, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (466, 'dd5fab7c85393e4ae1966641dd7278b2.jpeg', '/uploads/store/comment/20190805/dd5fab7c85393e4ae1966641dd7278b2.jpeg', '/./uploads/store/comment/20190805/s_dd5fab7c85393e4ae1966641dd7278b2.jpeg', '36133', 'image/jpeg', 1, 1564968162, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (467, '887db984b5f1138e08e1d9b069af766e.jpg', '/uploads/attach/2019/08/20190805/887db984b5f1138e08e1d9b069af766e.jpg', '/./uploads/attach/2019/08/20190805/s_887db984b5f1138e08e1d9b069af766e.jpg', '16250', 'image/jpeg', 0, 1564974592, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (468, '10_seckill_detail_wap.jpg', '/uploads/qrcode/10_seckill_detail_wap.jpg', '/uploads/qrcode/10_seckill_detail_wap.jpg', '707', 'image/jpeg', 1, 1564975074, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (469, '6_169_0_bargain_share_wap.jpg', '/uploads/qrcode/6_169_0_bargain_share_wap.jpg', '/uploads/qrcode/6_169_0_bargain_share_wap.jpg', '810', 'image/jpeg', 1, 1564989125, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (470, '4d28920190805151206105655.jpg', '/uploads/wap/activity/bargain/poster/4d28920190805151206105655.jpg', '/uploads/wap/activity/bargain/poster/4d28920190805151206105655.jpg', '51846', 'image/jpeg', 1, 1564989126, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (471, '9b82920190805151230870826.jpg', '/uploads/wap/activity/bargain/poster/9b82920190805151230870826.jpg', '/uploads/wap/activity/bargain/poster/9b82920190805151230870826.jpg', '51846', 'image/jpeg', 1, 1564989150, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (472, '0baf120190805151311797500.jpg', '/uploads/wap/activity/bargain/poster/0baf120190805151311797500.jpg', '/uploads/wap/activity/bargain/poster/0baf120190805151311797500.jpg', '51846', 'image/jpeg', 1, 1564989191, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (473, '6_166_0_bargain_share_wap.jpg', '/uploads/qrcode/6_166_0_bargain_share_wap.jpg', '/uploads/qrcode/6_166_0_bargain_share_wap.jpg', '819', 'image/jpeg', 1, 1564989194, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (474, '63dc720190805151314746533.jpg', '/uploads/wap/activity/bargain/poster/63dc720190805151314746533.jpg', '/uploads/wap/activity/bargain/poster/63dc720190805151314746533.jpg', '51292', 'image/jpeg', 1, 1564989194, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (475, '486fb2019080515132563825.jpg', '/uploads/wap/activity/bargain/poster/486fb2019080515132563825.jpg', '/uploads/wap/activity/bargain/poster/486fb2019080515132563825.jpg', '51292', 'image/jpeg', 1, 1564989205, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (476, 'f0f6c20190805151401832055.jpg', '/uploads/wap/activity/bargain/poster/f0f6c20190805151401832055.jpg', '/uploads/wap/activity/bargain/poster/f0f6c20190805151401832055.jpg', '51846', 'image/jpeg', 1, 1564989241, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (477, '8c51420190805151437227740.jpg', '/uploads/wap/activity/bargain/poster/8c51420190805151437227740.jpg', '/uploads/wap/activity/bargain/poster/8c51420190805151437227740.jpg', '51846', 'image/jpeg', 1, 1564989277, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (478, 'd0b4e20190805151609318496.jpg', '/uploads/wap/activity/bargain/poster/d0b4e20190805151609318496.jpg', '/uploads/wap/activity/bargain/poster/d0b4e20190805151609318496.jpg', '51846', 'image/jpeg', 1, 1564989369, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (479, 'da94b20190805153415199651.jpg', '/uploads/wap/activity/bargain/poster/da94b20190805153415199651.jpg', '/uploads/wap/activity/bargain/poster/da94b20190805153415199651.jpg', '51590', 'image/jpeg', 1, 1564990455, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (480, '594ca20190805153427519518.jpg', '/uploads/wap/activity/bargain/poster/594ca20190805153427519518.jpg', '/uploads/wap/activity/bargain/poster/594ca20190805153427519518.jpg', '51590', 'image/jpeg', 1, 1564990467, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (481, 'a263920190805161950390936.jpg', '/uploads/wap/spread/poster/a263920190805161950390936.jpg', '/uploads/wap/spread/poster/a263920190805161950390936.jpg', '82086', 'image/jpeg', 1, 1564993190, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (482, '4415120190805161950329113.jpg', '/uploads/wap/spread/poster/4415120190805161950329113.jpg', '/uploads/wap/spread/poster/4415120190805161950329113.jpg', '54464', 'image/jpeg', 1, 1564993190, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (483, 'eeaeb20190805161950901671.jpg', '/uploads/wap/spread/poster/eeaeb20190805161950901671.jpg', '/uploads/wap/spread/poster/eeaeb20190805161950901671.jpg', '75100', 'image/jpeg', 1, 1564993190, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (484, 'c5eee20190805162127521745.jpg', '/uploads/wap/spread/poster/c5eee20190805162127521745.jpg', '/uploads/wap/spread/poster/c5eee20190805162127521745.jpg', '82086', 'image/jpeg', 1, 1564993287, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (485, 'd91ca20190805162127692693.jpg', '/uploads/wap/spread/poster/d91ca20190805162127692693.jpg', '/uploads/wap/spread/poster/d91ca20190805162127692693.jpg', '54464', 'image/jpeg', 1, 1564993287, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (486, '90a8220190805162128186772.jpg', '/uploads/wap/spread/poster/90a8220190805162128186772.jpg', '/uploads/wap/spread/poster/90a8220190805162128186772.jpg', '75100', 'image/jpeg', 1, 1564993288, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (487, '913a16ef51d525b5d8e96cff7ebd1f8c.jpeg', '/uploads/store/comment/20190805/913a16ef51d525b5d8e96cff7ebd1f8c.jpeg', '/./uploads/store/comment/20190805/s_913a16ef51d525b5d8e96cff7ebd1f8c.jpeg', '126907', 'image/jpeg', 1, 1564993319, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (488, 'ec82e755fababcb24d4e7fd3b57e2e5f.jpeg', '/uploads/store/comment/20190805/ec82e755fababcb24d4e7fd3b57e2e5f.jpeg', '/./uploads/store/comment/20190805/s_ec82e755fababcb24d4e7fd3b57e2e5f.jpeg', '7713', 'image/jpeg', 1, 1564993374, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (489, '220_0_user_wap.jpg', '/uploads/qrcode/220_0_user_wap.jpg', '/uploads/qrcode/220_0_user_wap.jpg', '507', 'image/jpeg', 1, 1564993452, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (490, '4324e20190805162412674706.jpg', '/uploads/wap/spread/poster/4324e20190805162412674706.jpg', '/uploads/wap/spread/poster/4324e20190805162412674706.jpg', '82244', 'image/jpeg', 1, 1564993452, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (491, '333cb20190805162412319381.jpg', '/uploads/wap/spread/poster/333cb20190805162412319381.jpg', '/uploads/wap/spread/poster/333cb20190805162412319381.jpg', '54616', 'image/jpeg', 1, 1564993452, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (492, '39d3520190805162412311868.jpg', '/uploads/wap/spread/poster/39d3520190805162412311868.jpg', '/uploads/wap/spread/poster/39d3520190805162412311868.jpg', '75274', 'image/jpeg', 1, 1564993452, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (493, '8bafe32d13bc393dd4b7d08f697e3130.jpeg', '/uploads/store/comment/20190806/8bafe32d13bc393dd4b7d08f697e3130.jpeg', '/./uploads/store/comment/20190806/s_8bafe32d13bc393dd4b7d08f697e3130.jpeg', '113249', 'image/jpeg', 1, 1565059461, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (494, '43c2b9a9c96729ce73875f58a878fef6.png', '/uploads/store/comment/20190806/43c2b9a9c96729ce73875f58a878fef6.png', '/./uploads/store/comment/20190806/s_43c2b9a9c96729ce73875f58a878fef6.png', '18482', 'image/png', 1, 1565059501, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (495, 'f06367fa70980d2b538b26ea136b1aea.jpeg', '/uploads/store/comment/20190806/f06367fa70980d2b538b26ea136b1aea.jpeg', '/./uploads/store/comment/20190806/s_f06367fa70980d2b538b26ea136b1aea.jpeg', '85013', 'image/jpeg', 1, 1565064411, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (496, 'ddbc820190806152013205362.jpg', '/uploads/wap/spread/poster/ddbc820190806152013205362.jpg', '/uploads/wap/spread/poster/ddbc820190806152013205362.jpg', '82146', 'image/jpeg', 1, 1565076013, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (497, 'c8ecf20190806152013103599.jpg', '/uploads/wap/spread/poster/c8ecf20190806152013103599.jpg', '/uploads/wap/spread/poster/c8ecf20190806152013103599.jpg', '54530', 'image/jpeg', 1, 1565076013, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (498, 'caf1a20190806152015699470.jpg', '/uploads/wap/spread/poster/caf1a20190806152015699470.jpg', '/uploads/wap/spread/poster/caf1a20190806152015699470.jpg', '75164', 'image/jpeg', 1, 1565076015, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (499, '459_0_user_wap.jpg', '/uploads/qrcode/459_0_user_wap.jpg', '/uploads/qrcode/459_0_user_wap.jpg', '497', 'image/jpeg', 1, 1565076213, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (500, '93c8320190806152333279539.jpg', '/uploads/wap/spread/poster/93c8320190806152333279539.jpg', '/uploads/wap/spread/poster/93c8320190806152333279539.jpg', '83290', 'image/jpeg', 1, 1565076213, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (501, 'd282e20190806152334850732.jpg', '/uploads/wap/spread/poster/d282e20190806152334850732.jpg', '/uploads/wap/spread/poster/d282e20190806152334850732.jpg', '55665', 'image/jpeg', 1, 1565076214, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (502, 'af3b620190806152334477915.jpg', '/uploads/wap/spread/poster/af3b620190806152334477915.jpg', '/uploads/wap/spread/poster/af3b620190806152334477915.jpg', '76308', 'image/jpeg', 1, 1565076214, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (503, '4612320190806152346755887.jpg', '/uploads/wap/spread/poster/4612320190806152346755887.jpg', '/uploads/wap/spread/poster/4612320190806152346755887.jpg', '83290', 'image/jpeg', 1, 1565076226, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (504, '3610720190806152346499432.jpg', '/uploads/wap/spread/poster/3610720190806152346499432.jpg', '/uploads/wap/spread/poster/3610720190806152346499432.jpg', '55665', 'image/jpeg', 1, 1565076226, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (505, '0000320190806152347729911.jpg', '/uploads/wap/spread/poster/0000320190806152347729911.jpg', '/uploads/wap/spread/poster/0000320190806152347729911.jpg', '76308', 'image/jpeg', 1, 1565076227, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (506, 'b28d720190806154721105629.jpg', '/uploads/wap/spread/poster/b28d720190806154721105629.jpg', '/uploads/wap/spread/poster/b28d720190806154721105629.jpg', '83136', 'image/jpeg', 1, 1565077641, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (507, 'a86c420190806154722369121.jpg', '/uploads/wap/spread/poster/a86c420190806154722369121.jpg', '/uploads/wap/spread/poster/a86c420190806154722369121.jpg', '55503', 'image/jpeg', 1, 1565077642, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (508, '4f16420190806154722892554.jpg', '/uploads/wap/spread/poster/4f16420190806154722892554.jpg', '/uploads/wap/spread/poster/4f16420190806154722892554.jpg', '76163', 'image/jpeg', 1, 1565077642, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (509, '3_266_0_bargain_share_wap.jpg', '/uploads/qrcode/3_266_0_bargain_share_wap.jpg', '/uploads/qrcode/3_266_0_bargain_share_wap.jpg', '798', 'image/jpeg', 1, 1565103821, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (510, '6152920190806230341614852.jpg', '/uploads/wap/activity/bargain/poster/6152920190806230341614852.jpg', '/uploads/wap/activity/bargain/poster/6152920190806230341614852.jpg', '50566', 'image/jpeg', 1, 1565103821, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (511, '3_169_0_bargain_share_wap.jpg', '/uploads/qrcode/3_169_0_bargain_share_wap.jpg', '/uploads/qrcode/3_169_0_bargain_share_wap.jpg', '806', 'image/jpeg', 1, 1565146110, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (512, '6855420190807104830591301.jpg', '/uploads/wap/activity/bargain/poster/6855420190807104830591301.jpg', '/uploads/wap/activity/bargain/poster/6855420190807104830591301.jpg', '50468', 'image/jpeg', 1, 1565146110, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (513, '3_product_detail_461_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_461_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_461_is_promoter_0.wap.jpg', '596', 'image/jpeg', 1, 1565149756, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (514, '480_0_user_wap.jpg', '/uploads/qrcode/480_0_user_wap.jpg', '/uploads/qrcode/480_0_user_wap.jpg', '514', 'image/jpeg', 1, 1565150826, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (515, '0f65c20190807120706479545.jpg', '/uploads/wap/spread/poster/0f65c20190807120706479545.jpg', '/uploads/wap/spread/poster/0f65c20190807120706479545.jpg', '83254', 'image/jpeg', 1, 1565150826, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (516, '3a08420190807120706115743.jpg', '/uploads/wap/spread/poster/3a08420190807120706115743.jpg', '/uploads/wap/spread/poster/3a08420190807120706115743.jpg', '55618', 'image/jpeg', 1, 1565150826, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (517, 'd490d20190807120706976772.jpg', '/uploads/wap/spread/poster/d490d20190807120706976772.jpg', '/uploads/wap/spread/poster/d490d20190807120706976772.jpg', '76289', 'image/jpeg', 1, 1565150826, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (518, 'f854820190807121015787271.jpg', '/uploads/wap/spread/poster/f854820190807121015787271.jpg', '/uploads/wap/spread/poster/f854820190807121015787271.jpg', '82173', 'image/jpeg', 1, 1565151015, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (519, 'ab2b4201908071210155882.jpg', '/uploads/wap/spread/poster/ab2b4201908071210155882.jpg', '/uploads/wap/spread/poster/ab2b4201908071210155882.jpg', '54547', 'image/jpeg', 1, 1565151015, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (520, '42ffc20190807121016294381.jpg', '/uploads/wap/spread/poster/42ffc20190807121016294381.jpg', '/uploads/wap/spread/poster/42ffc20190807121016294381.jpg', '75186', 'image/jpeg', 1, 1565151016, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (521, '7fea620190807121432220854.jpg', '/uploads/wap/spread/poster/7fea620190807121432220854.jpg', '/uploads/wap/spread/poster/7fea620190807121432220854.jpg', '82734', 'image/jpeg', 1, 1565151272, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (522, 'd653920190807121432702847.jpg', '/uploads/wap/spread/poster/d653920190807121432702847.jpg', '/uploads/wap/spread/poster/d653920190807121432702847.jpg', '55096', 'image/jpeg', 1, 1565151272, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (523, '6925f20190807121432490492.jpg', '/uploads/wap/spread/poster/6925f20190807121432490492.jpg', '/uploads/wap/spread/poster/6925f20190807121432490492.jpg', '75745', 'image/jpeg', 1, 1565151272, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (524, '6d0ee3bb80da7ab64c3a336daaf57d6d.jpeg', '/uploads/store/comment/20190807/6d0ee3bb80da7ab64c3a336daaf57d6d.jpeg', '/./uploads/store/comment/20190807/s_6d0ee3bb80da7ab64c3a336daaf57d6d.jpeg', '46130', 'image/jpeg', 1, 1565151287, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (525, 'fb105d5f0de947abcf70624ad8cab385.jpg', '/uploads/store/comment/20190807/fb105d5f0de947abcf70624ad8cab385.jpg', '/./uploads/store/comment/20190807/s_fb105d5f0de947abcf70624ad8cab385.jpg', '247992', 'image/jpeg', 1, 1565151742, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (526, '484_0_user_wap.jpg', '/uploads/qrcode/484_0_user_wap.jpg', '/uploads/qrcode/484_0_user_wap.jpg', '507', 'image/jpeg', 1, 1565151756, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (527, 'a7f5920190807122236428668.jpg', '/uploads/wap/spread/poster/a7f5920190807122236428668.jpg', '/uploads/wap/spread/poster/a7f5920190807122236428668.jpg', '83210', 'image/jpeg', 1, 1565151756, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (528, 'ec5aa20190807122236455554.jpg', '/uploads/wap/spread/poster/ec5aa20190807122236455554.jpg', '/uploads/wap/spread/poster/ec5aa20190807122236455554.jpg', '55569', 'image/jpeg', 1, 1565151756, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (529, 'b4d2220190807122236696235.jpg', '/uploads/wap/spread/poster/b4d2220190807122236696235.jpg', '/uploads/wap/spread/poster/b4d2220190807122236696235.jpg', '76249', 'image/jpeg', 1, 1565151756, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (530, '603008c2d343faaea1a424eaff3a2368.jpg', '/uploads/store/comment/20190807/603008c2d343faaea1a424eaff3a2368.jpg', '/./uploads/store/comment/20190807/s_603008c2d343faaea1a424eaff3a2368.jpg', '10308', 'image/jpeg', 1, 1565152540, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (531, '489_0_user_wap.jpg', '/uploads/qrcode/489_0_user_wap.jpg', '/uploads/qrcode/489_0_user_wap.jpg', '521', 'image/jpeg', 1, 1565153106, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (532, '4d6da20190807124506469176.jpg', '/uploads/wap/spread/poster/4d6da20190807124506469176.jpg', '/uploads/wap/spread/poster/4d6da20190807124506469176.jpg', '82235', 'image/jpeg', 1, 1565153106, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (533, '2866720190807124506465311.jpg', '/uploads/wap/spread/poster/2866720190807124506465311.jpg', '/uploads/wap/spread/poster/2866720190807124506465311.jpg', '54602', 'image/jpeg', 1, 1565153106, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (534, 'f169b20190807124506305816.jpg', '/uploads/wap/spread/poster/f169b20190807124506305816.jpg', '/uploads/wap/spread/poster/f169b20190807124506305816.jpg', '75253', 'image/jpeg', 1, 1565153106, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (535, '3_485_0_bargain_share_wap.jpg', '/uploads/qrcode/3_485_0_bargain_share_wap.jpg', '/uploads/qrcode/3_485_0_bargain_share_wap.jpg', '822', 'image/jpeg', 1, 1565153238, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (536, '1086720190807124718353676.jpg', '/uploads/wap/activity/bargain/poster/1086720190807124718353676.jpg', '/uploads/wap/activity/bargain/poster/1086720190807124718353676.jpg', '50400', 'image/jpeg', 1, 1565153238, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (537, '20_425_0_pink_share_wap.jpg', '/uploads/qrcode/20_425_0_pink_share_wap.jpg', '/uploads/qrcode/20_425_0_pink_share_wap.jpg', '697', 'image/jpeg', 1, 1565153943, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (538, '0b24d20190807125903672279.jpg', '/uploads/wap/activity/pink/poster/0b24d20190807125903672279.jpg', '/uploads/wap/activity/pink/poster/0b24d20190807125903672279.jpg', '53119', 'image/jpeg', 1, 1565153943, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (539, 'b85d620190807125915869899.jpg', '/uploads/wap/activity/pink/poster/b85d620190807125915869899.jpg', '/uploads/wap/activity/pink/poster/b85d620190807125915869899.jpg', '53119', 'image/jpeg', 1, 1565153955, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (540, '66e15da59d29c937949dfbdd07a2ff08.jpeg', '/uploads/store/comment/20190807/66e15da59d29c937949dfbdd07a2ff08.jpeg', '/./uploads/store/comment/20190807/s_66e15da59d29c937949dfbdd07a2ff08.jpeg', '102985', 'image/jpeg', 1, 1565154546, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (541, '98dce20190807131333747386.jpg', '/uploads/wap/spread/poster/98dce20190807131333747386.jpg', '/uploads/wap/spread/poster/98dce20190807131333747386.jpg', '82140', 'image/jpeg', 1, 1565154813, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (542, '4669d20190807131333938842.jpg', '/uploads/wap/spread/poster/4669d20190807131333938842.jpg', '/uploads/wap/spread/poster/4669d20190807131333938842.jpg', '54494', 'image/jpeg', 1, 1565154813, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (543, '988f920190807131333720360.jpg', '/uploads/wap/spread/poster/988f920190807131333720360.jpg', '/uploads/wap/spread/poster/988f920190807131333720360.jpg', '75160', 'image/jpeg', 1, 1565154813, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (544, 'a0b59537f16e3b4c9d145d2c062a81c4.jpg', '/uploads/store/comment/20190807/a0b59537f16e3b4c9d145d2c062a81c4.jpg', '/./uploads/store/comment/20190807/s_a0b59537f16e3b4c9d145d2c062a81c4.jpg', '200789', 'image/jpeg', 1, 1565154844, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (545, 'c207320190807133116168378.jpg', '/uploads/wap/activity/pink/poster/c207320190807133116168378.jpg', '/uploads/wap/activity/pink/poster/c207320190807133116168378.jpg', '53156', 'image/jpeg', 1, 1565155876, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (546, '723adbdd4e49a0f9394dfc700ab5dba3.png', '/uploads/attach/2019/08/20190807/723adbdd4e49a0f9394dfc700ab5dba3.png', '/./uploads/attach/2019/08/20190807/s_723adbdd4e49a0f9394dfc700ab5dba3.png', '7127', 'image/png', 24, 1565158498, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (547, '3ccb0466eb40b5971dc09d5ec7098392.jpg', '/uploads/store/comment/20190807/3ccb0466eb40b5971dc09d5ec7098392.jpg', '/./uploads/store/comment/20190807/s_3ccb0466eb40b5971dc09d5ec7098392.jpg', '114868', 'image/jpeg', 1, 1565159187, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (548, '5_502_0_bargain_share_wap.jpg', '/uploads/qrcode/5_502_0_bargain_share_wap.jpg', '/uploads/qrcode/5_502_0_bargain_share_wap.jpg', '802', 'image/jpeg', 1, 1565162145, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (549, 'd2a2720190807151545388721.jpg', '/uploads/wap/activity/bargain/poster/d2a2720190807151545388721.jpg', '/uploads/wap/activity/bargain/poster/d2a2720190807151545388721.jpg', '52739', 'image/jpeg', 1, 1565162145, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (550, '3_499_0_bargain_share_wap.jpg', '/uploads/qrcode/3_499_0_bargain_share_wap.jpg', '/uploads/qrcode/3_499_0_bargain_share_wap.jpg', '808', 'image/jpeg', 1, 1565163122, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (551, '92fb020190807153202388226.jpg', '/uploads/wap/activity/bargain/poster/92fb020190807153202388226.jpg', '/uploads/wap/activity/bargain/poster/92fb020190807153202388226.jpg', '50204', 'image/jpeg', 1, 1565163122, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (552, '12_seckill_detail_wap.jpg', '/uploads/qrcode/12_seckill_detail_wap.jpg', '/uploads/qrcode/12_seckill_detail_wap.jpg', '706', 'image/jpeg', 1, 1565165529, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (553, '3_504_0_bargain_share_wap.jpg', '/uploads/qrcode/3_504_0_bargain_share_wap.jpg', '/uploads/qrcode/3_504_0_bargain_share_wap.jpg', '804', 'image/jpeg', 1, 1565166918, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (554, '77b9120190807163518789651.jpg', '/uploads/wap/activity/bargain/poster/77b9120190807163518789651.jpg', '/uploads/wap/activity/bargain/poster/77b9120190807163518789651.jpg', '50631', 'image/jpeg', 1, 1565166918, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (555, '99a4020190807163535453510.jpg', '/uploads/wap/activity/bargain/poster/99a4020190807163535453510.jpg', '/uploads/wap/activity/bargain/poster/99a4020190807163535453510.jpg', '50631', 'image/jpeg', 1, 1565166935, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (556, '1fb3320190807163549217410.jpg', '/uploads/wap/activity/bargain/poster/1fb3320190807163549217410.jpg', '/uploads/wap/activity/bargain/poster/1fb3320190807163549217410.jpg', '50631', 'image/jpeg', 1, 1565166949, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (557, '9e74020190807170721119438.jpg', '/uploads/wap/activity/bargain/poster/9e74020190807170721119438.jpg', '/uploads/wap/activity/bargain/poster/9e74020190807170721119438.jpg', '50223', 'image/jpeg', 1, 1565168841, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (558, '566f020190807170732986724.jpg', '/uploads/wap/activity/bargain/poster/566f020190807170732986724.jpg', '/uploads/wap/activity/bargain/poster/566f020190807170732986724.jpg', '50223', 'image/jpeg', 1, 1565168852, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (559, '5_504_0_bargain_share_wap.jpg', '/uploads/qrcode/5_504_0_bargain_share_wap.jpg', '/uploads/qrcode/5_504_0_bargain_share_wap.jpg', '806', 'image/jpeg', 1, 1565169010, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (560, '68a6420190807171011633892.jpg', '/uploads/wap/activity/bargain/poster/68a6420190807171011633892.jpg', '/uploads/wap/activity/bargain/poster/68a6420190807171011633892.jpg', '53730', 'image/jpeg', 1, 1565169011, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (561, '9c16f20190807171019633097.jpg', '/uploads/wap/activity/bargain/poster/9c16f20190807171019633097.jpg', '/uploads/wap/activity/bargain/poster/9c16f20190807171019633097.jpg', '50223', 'image/jpeg', 1, 1565169019, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (562, 'f0dd420190807175709429001.jpg', '/uploads/wap/activity/bargain/poster/f0dd420190807175709429001.jpg', '/uploads/wap/activity/bargain/poster/f0dd420190807175709429001.jpg', '50223', 'image/jpeg', 1, 1565171829, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (563, '9e95220190807180456196926.jpg', '/uploads/wap/spread/poster/9e95220190807180456196926.jpg', '/uploads/wap/spread/poster/9e95220190807180456196926.jpg', '82267', 'image/jpeg', 1, 1565172296, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (564, '2122c20190807180457210530.jpg', '/uploads/wap/spread/poster/2122c20190807180457210530.jpg', '/uploads/wap/spread/poster/2122c20190807180457210530.jpg', '54643', 'image/jpeg', 1, 1565172297, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (565, '366ce2019080718045776914.jpg', '/uploads/wap/spread/poster/366ce2019080718045776914.jpg', '/uploads/wap/spread/poster/366ce2019080718045776914.jpg', '75275', 'image/jpeg', 1, 1565172297, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (566, '0680020190807184757573025.jpg', '/uploads/wap/activity/bargain/poster/0680020190807184757573025.jpg', '/uploads/wap/activity/bargain/poster/0680020190807184757573025.jpg', '53730', 'image/jpeg', 1, 1565174877, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (567, '68ae74deaa577114653c5d98e9765629.jpeg', '/uploads/store/comment/20190807/68ae74deaa577114653c5d98e9765629.jpeg', '/./uploads/store/comment/20190807/s_68ae74deaa577114653c5d98e9765629.jpeg', '4693', 'image/jpeg', 1, 1565174940, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (568, '455a99f8578c7ad694564e1b63c185d6.jpeg', '/uploads/store/comment/20190807/455a99f8578c7ad694564e1b63c185d6.jpeg', '/./uploads/store/comment/20190807/s_455a99f8578c7ad694564e1b63c185d6.jpeg', '2009', 'image/jpeg', 1, 1565174958, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (569, '3_515_0_bargain_share_wap.jpg', '/uploads/qrcode/3_515_0_bargain_share_wap.jpg', '/uploads/qrcode/3_515_0_bargain_share_wap.jpg', '807', 'image/jpeg', 1, 1565186981, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (570, 'db60b20190807220941616603.jpg', '/uploads/wap/activity/bargain/poster/db60b20190807220941616603.jpg', '/uploads/wap/activity/bargain/poster/db60b20190807220941616603.jpg', '50643', 'image/jpeg', 1, 1565186981, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (571, 'deee920190807220958295849.jpg', '/uploads/wap/activity/bargain/poster/deee920190807220958295849.jpg', '/uploads/wap/activity/bargain/poster/deee920190807220958295849.jpg', '50643', 'image/jpeg', 1, 1565186998, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (572, '22e4ebc8625fd25755e6e7f905183cfa.jpg', '/uploads/store/comment/20190808/22e4ebc8625fd25755e6e7f905183cfa.jpg', '/./uploads/store/comment/20190808/s_22e4ebc8625fd25755e6e7f905183cfa.jpg', '5195', 'image/jpeg', 1, 1565225425, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (573, '3_product_detail_252_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_252_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_252_is_promoter_0.wap.jpg', '601', 'image/jpeg', 1, 1565225770, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (574, '3_546_0_bargain_share_wap.jpg', '/uploads/qrcode/3_546_0_bargain_share_wap.jpg', '/uploads/qrcode/3_546_0_bargain_share_wap.jpg', '808', 'image/jpeg', 1, 1565230290, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (575, '13f9820190808101130974883.jpg', '/uploads/wap/activity/bargain/poster/13f9820190808101130974883.jpg', '/uploads/wap/activity/bargain/poster/13f9820190808101130974883.jpg', '50238', 'image/jpeg', 1, 1565230290, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (576, 'e467020190808101140533702.jpg', '/uploads/wap/activity/bargain/poster/e467020190808101140533702.jpg', '/uploads/wap/activity/bargain/poster/e467020190808101140533702.jpg', '50238', 'image/jpeg', 1, 1565230300, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (577, 'a6e4f20190808101151187086.jpg', '/uploads/wap/activity/bargain/poster/a6e4f20190808101151187086.jpg', '/uploads/wap/activity/bargain/poster/a6e4f20190808101151187086.jpg', '50238', 'image/jpeg', 1, 1565230311, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (578, '3_548_0_bargain_share_wap.jpg', '/uploads/qrcode/3_548_0_bargain_share_wap.jpg', '/uploads/qrcode/3_548_0_bargain_share_wap.jpg', '811', 'image/jpeg', 1, 1565230501, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (579, 'c75e120190808101501179707.jpg', '/uploads/wap/activity/bargain/poster/c75e120190808101501179707.jpg', '/uploads/wap/activity/bargain/poster/c75e120190808101501179707.jpg', '50531', 'image/jpeg', 1, 1565230501, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (580, '7d23242e4964754eca55e8736f3d8eb1.png', '/uploads/store/comment/20190808/7d23242e4964754eca55e8736f3d8eb1.png', '/./uploads/store/comment/20190808/s_7d23242e4964754eca55e8736f3d8eb1.png', '7127', 'image/png', 1, 1565234020, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (581, '3_563_0_bargain_share_wap.jpg', '/uploads/qrcode/3_563_0_bargain_share_wap.jpg', '/uploads/qrcode/3_563_0_bargain_share_wap.jpg', '811', 'image/jpeg', 1, 1565237610, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (582, '146f720190808121330814896.jpg', '/uploads/wap/activity/bargain/poster/146f720190808121330814896.jpg', '/uploads/wap/activity/bargain/poster/146f720190808121330814896.jpg', '50724', 'image/jpeg', 1, 1565237610, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (583, '3_566_0_bargain_share_wap.jpg', '/uploads/qrcode/3_566_0_bargain_share_wap.jpg', '/uploads/qrcode/3_566_0_bargain_share_wap.jpg', '799', 'image/jpeg', 1, 1565243001, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (584, '8216120190808134321426521.jpg', '/uploads/wap/activity/bargain/poster/8216120190808134321426521.jpg', '/uploads/wap/activity/bargain/poster/8216120190808134321426521.jpg', '50025', 'image/jpeg', 1, 1565243001, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (585, 'ccc72a0d04bf04adaacbcafe71839856.png', '/uploads/store/comment/20190808/ccc72a0d04bf04adaacbcafe71839856.png', '/./uploads/store/comment/20190808/s_ccc72a0d04bf04adaacbcafe71839856.png', '955925', 'image/png', 1, 1565245737, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (586, '579_1_user_wap.jpg', '/uploads/qrcode/579_1_user_wap.jpg', '/uploads/qrcode/579_1_user_wap.jpg', '514', 'image/jpeg', 1, 1565246746, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (587, '9473920190808144546960552.jpg', '/uploads/wap/spread/poster/9473920190808144546960552.jpg', '/uploads/wap/spread/poster/9473920190808144546960552.jpg', '82630', 'image/jpeg', 1, 1565246746, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (588, 'ad8ed20190808144546944061.jpg', '/uploads/wap/spread/poster/ad8ed20190808144546944061.jpg', '/uploads/wap/spread/poster/ad8ed20190808144546944061.jpg', '54999', 'image/jpeg', 1, 1565246746, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (589, 'bb16620190808144546536747.jpg', '/uploads/wap/spread/poster/bb16620190808144546536747.jpg', '/uploads/wap/spread/poster/bb16620190808144546536747.jpg', '75643', 'image/jpeg', 1, 1565246746, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (590, 'b65dd37fc436b2e36d6e33f3df40199d.png', '/uploads/store/comment/20190808/b65dd37fc436b2e36d6e33f3df40199d.png', '/./uploads/store/comment/20190808/s_b65dd37fc436b2e36d6e33f3df40199d.png', '2402', 'image/png', 1, 1565247248, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (591, '3_581_0_bargain_share_wap.jpg', '/uploads/qrcode/3_581_0_bargain_share_wap.jpg', '/uploads/qrcode/3_581_0_bargain_share_wap.jpg', '810', 'image/jpeg', 1, 1565247527, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (592, '4b00920190808145847432060.jpg', '/uploads/wap/activity/bargain/poster/4b00920190808145847432060.jpg', '/uploads/wap/activity/bargain/poster/4b00920190808145847432060.jpg', '49639', 'image/jpeg', 1, 1565247527, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (593, '2_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/2_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/2_product_detail_168_is_promoter_1.wap.jpg', '599', 'image/jpeg', 1, 1565249347, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (594, '9_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/9_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/9_product_detail_168_is_promoter_1.wap.jpg', '608', 'image/jpeg', 1, 1565249380, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (595, '077f98b643e5ddf0bc67766790d24615.jpg', '/uploads/store/comment/20190808/077f98b643e5ddf0bc67766790d24615.jpg', '/./uploads/store/comment/20190808/s_077f98b643e5ddf0bc67766790d24615.jpg', '63749', 'image/jpeg', 1, 1565250443, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (596, '7_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/7_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/7_product_detail_168_is_promoter_1.wap.jpg', '603', 'image/jpeg', 1, 1565250489, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (597, '3cb3b7b5a0e12d838b84a6e3d0fb3105.jpg', '/uploads/store/comment/20190808/3cb3b7b5a0e12d838b84a6e3d0fb3105.jpg', '/./uploads/store/comment/20190808/s_3cb3b7b5a0e12d838b84a6e3d0fb3105.jpg', '100759', 'image/jpeg', 1, 1565250606, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (598, '11_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/11_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/11_product_detail_168_is_promoter_1.wap.jpg', '593', 'image/jpeg', 1, 1565250677, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (599, 'c25c9c347246dce45f83e9daa38753e4.jpeg', '/uploads/store/comment/20190808/c25c9c347246dce45f83e9daa38753e4.jpeg', '/./uploads/store/comment/20190808/s_c25c9c347246dce45f83e9daa38753e4.jpeg', '102985', 'image/jpeg', 1, 1565255407, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (600, '602_1_user_wap.jpg', '/uploads/qrcode/602_1_user_wap.jpg', '/uploads/qrcode/602_1_user_wap.jpg', '511', 'image/jpeg', 1, 1565255657, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (601, '9950320190808171417419761.jpg', '/uploads/wap/spread/poster/9950320190808171417419761.jpg', '/uploads/wap/spread/poster/9950320190808171417419761.jpg', '82914', 'image/jpeg', 1, 1565255657, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (602, 'f516d20190808171417527425.jpg', '/uploads/wap/spread/poster/f516d20190808171417527425.jpg', '/uploads/wap/spread/poster/f516d20190808171417527425.jpg', '55278', 'image/jpeg', 1, 1565255657, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (603, 'b02f020190808171417302334.jpg', '/uploads/wap/spread/poster/b02f020190808171417302334.jpg', '/uploads/wap/spread/poster/b02f020190808171417302334.jpg', '75940', 'image/jpeg', 1, 1565255657, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (604, '2bee3a5dc9f19820a3b14e684a1d5360.jpeg', '/uploads/store/comment/20190808/2bee3a5dc9f19820a3b14e684a1d5360.jpeg', '/./uploads/store/comment/20190808/s_2bee3a5dc9f19820a3b14e684a1d5360.jpeg', '102985', 'image/jpeg', 1, 1565255711, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (605, '9_product_detail_608_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_608_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_608_is_promoter_0.wap.jpg', '593', 'image/jpeg', 1, 1565256303, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (606, '3_product_detail_601_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_601_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_601_is_promoter_0.wap.jpg', '605', 'image/jpeg', 1, 1565256873, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (607, '87a240841283cb614f3ba308fd299866.png', '/uploads/attach/2019/08/20190808/87a240841283cb614f3ba308fd299866.png', '/./uploads/attach/2019/08/20190808/s_87a240841283cb614f3ba308fd299866.png', '1177', 'image/png', 4, 1565259172, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (608, '9_product_detail_619_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_619_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_619_is_promoter_0.wap.jpg', '593', 'image/jpeg', 1, 1565259181, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (609, '11_product_detail_608_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_608_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_608_is_promoter_0.wap.jpg', '594', 'image/jpeg', 1, 1565261723, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (610, '3_636_0_bargain_share_wap.jpg', '/uploads/qrcode/3_636_0_bargain_share_wap.jpg', '/uploads/qrcode/3_636_0_bargain_share_wap.jpg', '792', 'image/jpeg', 1, 1565268994, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (611, 'b874720190808205634605586.jpg', '/uploads/wap/activity/bargain/poster/b874720190808205634605586.jpg', '/uploads/wap/activity/bargain/poster/b874720190808205634605586.jpg', '50285', 'image/jpeg', 1, 1565268994, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (612, '3_625_0_bargain_share_wap.jpg', '/uploads/qrcode/3_625_0_bargain_share_wap.jpg', '/uploads/qrcode/3_625_0_bargain_share_wap.jpg', '804', 'image/jpeg', 1, 1565279470, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (613, 'd714d20190808235110884688.jpg', '/uploads/wap/activity/bargain/poster/d714d20190808235110884688.jpg', '/uploads/wap/activity/bargain/poster/d714d20190808235110884688.jpg', '50056', 'image/jpeg', 1, 1565279470, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (614, 'b34c9cddc56b8bc7e22334485a2655c8.png', '/uploads/store/comment/20190808/b34c9cddc56b8bc7e22334485a2655c8.png', '/./uploads/store/comment/20190808/s_b34c9cddc56b8bc7e22334485a2655c8.png', '536325', 'image/png', 1, 1565279560, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (615, '6801781ff4403bdbb6764f4182394729.png', '/uploads/attach/2019/08/20190809/6801781ff4403bdbb6764f4182394729.png', '/./uploads/attach/2019/08/20190809/s_6801781ff4403bdbb6764f4182394729.png', '14174', 'image/png', 32, 1565311043, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (616, '3_product_detail_581_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_581_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_581_is_promoter_0.wap.jpg', '594', 'image/jpeg', 1, 1565312928, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (617, '11_seckill_detail_wap.jpg', '/uploads/qrcode/11_seckill_detail_wap.jpg', '/uploads/qrcode/11_seckill_detail_wap.jpg', '702', 'image/jpeg', 1, 1565314985, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (618, '7_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_607_is_promoter_0.wap.jpg', '612', 'image/jpeg', 1, 1565316804, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (619, '959462d373393a327ede87e51680c07e.jpg', '/uploads/store/comment/20190809/959462d373393a327ede87e51680c07e.jpg', '/./uploads/store/comment/20190809/s_959462d373393a327ede87e51680c07e.jpg', '13877', 'image/jpeg', 1, 1565317285, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (620, '7ba5e7e9bcd1ed480fdd432b49a3161a.gif', '/uploads/attach/2019/08/20190809/7ba5e7e9bcd1ed480fdd432b49a3161a.gif', '/./uploads/attach/2019/08/20190809/s_7ba5e7e9bcd1ed480fdd432b49a3161a.gif', '105770', 'image/gif', 5, 1565317737, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (621, '7_product_detail_672_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_672_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_672_is_promoter_0.wap.jpg', '609', 'image/jpeg', 1, 1565318539, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (622, '3_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_607_is_promoter_0.wap.jpg', '605', 'image/jpeg', 1, 1565318624, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (623, '9_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_607_is_promoter_0.wap.jpg', '606', 'image/jpeg', 1, 1565318720, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (624, '11_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_607_is_promoter_0.wap.jpg', '602', 'image/jpeg', 1, 1565318786, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (625, '11_product_detail_672_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_672_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_672_is_promoter_0.wap.jpg', '589', 'image/jpeg', 1, 1565318805, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (626, '2_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_607_is_promoter_0.wap.jpg', '603', 'image/jpeg', 1, 1565319659, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (627, '52bfadd8769a6d359c144613b2000954.jpg', '/uploads/store/comment/20190809/52bfadd8769a6d359c144613b2000954.jpg', '/./uploads/store/comment/20190809/s_52bfadd8769a6d359c144613b2000954.jpg', '22640', 'image/jpeg', 1, 1565319929, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (628, '26_607_0_pink_share_wap.jpg', '/uploads/qrcode/26_607_0_pink_share_wap.jpg', '/uploads/qrcode/26_607_0_pink_share_wap.jpg', '703', 'image/jpeg', 1, 1565320222, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (629, '4a71e20190809111022357555.jpg', '/uploads/wap/activity/pink/poster/4a71e20190809111022357555.jpg', '/uploads/wap/activity/pink/poster/4a71e20190809111022357555.jpg', '49901', 'image/jpeg', 1, 1565320222, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (630, '8_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_607_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_607_is_promoter_0.wap.jpg', '597', 'image/jpeg', 1, 1565321381, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (631, '11_product_detail_697_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_697_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_697_is_promoter_0.wap.jpg', '596', 'image/jpeg', 1, 1565323200, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (632, '5_637_0_bargain_share_wap.jpg', '/uploads/qrcode/5_637_0_bargain_share_wap.jpg', '/uploads/qrcode/5_637_0_bargain_share_wap.jpg', '797', 'image/jpeg', 1, 1565325822, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (633, 'a96b620190809124342745231.jpg', '/uploads/wap/activity/bargain/poster/a96b620190809124342745231.jpg', '/uploads/wap/activity/bargain/poster/a96b620190809124342745231.jpg', '53265', 'image/jpeg', 1, 1565325822, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (634, '3_559_0_bargain_share_wap.jpg', '/uploads/qrcode/3_559_0_bargain_share_wap.jpg', '/uploads/qrcode/3_559_0_bargain_share_wap.jpg', '821', 'image/jpeg', 1, 1565329525, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (635, 'eaa5220190809134525129638.jpg', '/uploads/wap/activity/bargain/poster/eaa5220190809134525129638.jpg', '/uploads/wap/activity/bargain/poster/eaa5220190809134525129638.jpg', '50413', 'image/jpeg', 1, 1565329525, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (636, '559_1_user_wap.jpg', '/uploads/qrcode/559_1_user_wap.jpg', '/uploads/qrcode/559_1_user_wap.jpg', '507', 'image/jpeg', 1, 1565329886, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (637, '8e52320190809135126411578.jpg', '/uploads/wap/spread/poster/8e52320190809135126411578.jpg', '/uploads/wap/spread/poster/8e52320190809135126411578.jpg', '82594', 'image/jpeg', 1, 1565329886, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (638, '7736920190809135126720011.jpg', '/uploads/wap/spread/poster/7736920190809135126720011.jpg', '/uploads/wap/spread/poster/7736920190809135126720011.jpg', '54967', 'image/jpeg', 1, 1565329886, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (639, '68fc2201908091351267899.jpg', '/uploads/wap/spread/poster/68fc2201908091351267899.jpg', '/uploads/wap/spread/poster/68fc2201908091351267899.jpg', '75624', 'image/jpeg', 1, 1565329886, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (640, '8d33620190809135326936003.jpg', '/uploads/wap/spread/poster/8d33620190809135326936003.jpg', '/uploads/wap/spread/poster/8d33620190809135326936003.jpg', '82594', 'image/jpeg', 1, 1565330006, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (641, '5b8e420190809135326273294.jpg', '/uploads/wap/spread/poster/5b8e420190809135326273294.jpg', '/uploads/wap/spread/poster/5b8e420190809135326273294.jpg', '54967', 'image/jpeg', 1, 1565330006, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (642, '14e422019080913532761875.jpg', '/uploads/wap/spread/poster/14e422019080913532761875.jpg', '/uploads/wap/spread/poster/14e422019080913532761875.jpg', '75624', 'image/jpeg', 1, 1565330007, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (643, '3_712_0_bargain_share_wap.jpg', '/uploads/qrcode/3_712_0_bargain_share_wap.jpg', '/uploads/qrcode/3_712_0_bargain_share_wap.jpg', '808', 'image/jpeg', 1, 1565331265, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (644, 'ba20320190809141425960268.jpg', '/uploads/wap/activity/bargain/poster/ba20320190809141425960268.jpg', '/uploads/wap/activity/bargain/poster/ba20320190809141425960268.jpg', '50710', 'image/jpeg', 1, 1565331265, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (645, '712_0_user_wap.jpg', '/uploads/qrcode/712_0_user_wap.jpg', '/uploads/qrcode/712_0_user_wap.jpg', '505', 'image/jpeg', 1, 1565331519, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (646, 'bdd8820190809141841250890.jpg', '/uploads/wap/spread/poster/bdd8820190809141841250890.jpg', '/uploads/wap/spread/poster/bdd8820190809141841250890.jpg', '82343', 'image/jpeg', 1, 1565331521, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (647, 'f9beb20190809141843107330.jpg', '/uploads/wap/spread/poster/f9beb20190809141843107330.jpg', '/uploads/wap/spread/poster/f9beb20190809141843107330.jpg', '54694', 'image/jpeg', 1, 1565331523, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (648, 'd575620190809141845783047.jpg', '/uploads/wap/spread/poster/d575620190809141845783047.jpg', '/uploads/wap/spread/poster/d575620190809141845783047.jpg', '75355', 'image/jpeg', 1, 1565331525, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (649, 'f1e2b20190809141850920888.jpg', '/uploads/wap/spread/poster/f1e2b20190809141850920888.jpg', '/uploads/wap/spread/poster/f1e2b20190809141850920888.jpg', '82343', 'image/jpeg', 1, 1565331530, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (650, 'ad82120190809141850893909.jpg', '/uploads/wap/spread/poster/ad82120190809141850893909.jpg', '/uploads/wap/spread/poster/ad82120190809141850893909.jpg', '54694', 'image/jpeg', 1, 1565331530, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (651, '1cfea20190809141850542021.jpg', '/uploads/wap/spread/poster/1cfea20190809141850542021.jpg', '/uploads/wap/spread/poster/1cfea20190809141850542021.jpg', '75355', 'image/jpeg', 1, 1565331530, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (652, 'f81de20190809141926185054.jpg', '/uploads/wap/spread/poster/f81de20190809141926185054.jpg', '/uploads/wap/spread/poster/f81de20190809141926185054.jpg', '82343', 'image/jpeg', 1, 1565331566, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (653, '5dbc820190809141926340540.jpg', '/uploads/wap/spread/poster/5dbc820190809141926340540.jpg', '/uploads/wap/spread/poster/5dbc820190809141926340540.jpg', '54694', 'image/jpeg', 1, 1565331566, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (654, 'c0e8520190809141926611140.jpg', '/uploads/wap/spread/poster/c0e8520190809141926611140.jpg', '/uploads/wap/spread/poster/c0e8520190809141926611140.jpg', '75355', 'image/jpeg', 1, 1565331566, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (655, 'cedab3e1e432f673a25dfbe73ed3fe03.jpg', '/uploads/store/comment/20190809/cedab3e1e432f673a25dfbe73ed3fe03.jpg', '/./uploads/store/comment/20190809/s_cedab3e1e432f673a25dfbe73ed3fe03.jpg', '30209', 'image/jpeg', 1, 1565331950, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (656, '9_product_detail_697_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_697_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_697_is_promoter_0.wap.jpg', '605', 'image/jpeg', 1, 1565333208, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (657, '11_product_detail_726_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_726_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_726_is_promoter_0.wap.jpg', '592', 'image/jpeg', 1, 1565338275, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (658, '9_product_detail_728_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_728_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_728_is_promoter_0.wap.jpg', '610', 'image/jpeg', 1, 1565338277, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (659, '3_product_detail_726_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_726_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_726_is_promoter_0.wap.jpg', '599', 'image/jpeg', 1, 1565338395, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (660, '44f6820190809163849115573.jpg', '/uploads/wap/spread/poster/44f6820190809163849115573.jpg', '/uploads/wap/spread/poster/44f6820190809163849115573.jpg', '82594', 'image/jpeg', 1, 1565339929, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (661, 'be16d20190809163849372602.jpg', '/uploads/wap/spread/poster/be16d20190809163849372602.jpg', '/uploads/wap/spread/poster/be16d20190809163849372602.jpg', '54967', 'image/jpeg', 1, 1565339929, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (662, '17d1820190809163849853914.jpg', '/uploads/wap/spread/poster/17d1820190809163849853914.jpg', '/uploads/wap/spread/poster/17d1820190809163849853914.jpg', '75624', 'image/jpeg', 1, 1565339929, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (663, '9_product_detail_737_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_737_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_737_is_promoter_0.wap.jpg', '612', 'image/jpeg', 1, 1565340217, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (664, '738_1_user_wap.jpg', '/uploads/qrcode/738_1_user_wap.jpg', '/uploads/qrcode/738_1_user_wap.jpg', '509', 'image/jpeg', 1, 1565340430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (665, 'c5c1c20190809164710245338.jpg', '/uploads/wap/spread/poster/c5c1c20190809164710245338.jpg', '/uploads/wap/spread/poster/c5c1c20190809164710245338.jpg', '82448', 'image/jpeg', 1, 1565340430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (666, '2436820190809164710970121.jpg', '/uploads/wap/spread/poster/2436820190809164710970121.jpg', '/uploads/wap/spread/poster/2436820190809164710970121.jpg', '54817', 'image/jpeg', 1, 1565340430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (667, 'cc58f20190809164710336065.jpg', '/uploads/wap/spread/poster/cc58f20190809164710336065.jpg', '/uploads/wap/spread/poster/cc58f20190809164710336065.jpg', '75473', 'image/jpeg', 1, 1565340430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (668, 'fe670900d78c607e843d8da4ae39e99e.jpg', '/uploads/store/comment/20190809/fe670900d78c607e843d8da4ae39e99e.jpg', '/./uploads/store/comment/20190809/s_fe670900d78c607e843d8da4ae39e99e.jpg', '57187', 'image/jpeg', 1, 1565341017, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (669, '7_product_detail_743_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_743_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_743_is_promoter_0.wap.jpg', '605', 'image/jpeg', 1, 1565342706, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (670, '11_product_detail_743_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_743_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_743_is_promoter_0.wap.jpg', '599', 'image/jpeg', 1, 1565342710, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (671, '6_168_1_bargain_share_routine.jpg', '/uploads/routine/activity/bargain/code/6_168_1_bargain_share_routine.jpg', '/uploads/routine/activity/bargain/code/6_168_1_bargain_share_routine.jpg', '53858', 'image/jpeg', 1, 1565342728, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (672, 'c7a2a20190809172529424314.jpg', '/uploads/routine/activity/bargain/poster/c7a2a20190809172529424314.jpg', '/uploads/routine/activity/bargain/poster/c7a2a20190809172529424314.jpg', '48246', 'image/jpeg', 1, 1565342729, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (673, 'b4f1e20190809172700300194.jpg', '/uploads/routine/activity/bargain/poster/b4f1e20190809172700300194.jpg', '/uploads/routine/activity/bargain/poster/b4f1e20190809172700300194.jpg', '48246', 'image/jpeg', 1, 1565342820, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (674, '8daf692fa69664b4818f28397efd9ed2.jpg', '/uploads/store/comment/20190809/8daf692fa69664b4818f28397efd9ed2.jpg', '/./uploads/store/comment/20190809/s_8daf692fa69664b4818f28397efd9ed2.jpg', '60582', 'image/jpeg', 1, 1565344762, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (675, '3_602_1_bargain_share_wap.jpg', '/uploads/qrcode/3_602_1_bargain_share_wap.jpg', '/uploads/qrcode/3_602_1_bargain_share_wap.jpg', '807', 'image/jpeg', 1, 1565347218, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (676, '170002019080918401912048.jpg', '/uploads/wap/activity/bargain/poster/170002019080918401912048.jpg', '/uploads/wap/activity/bargain/poster/170002019080918401912048.jpg', '50364', 'image/jpeg', 1, 1565347219, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (677, '6_602_1_bargain_share_wap.jpg', '/uploads/qrcode/6_602_1_bargain_share_wap.jpg', '/uploads/qrcode/6_602_1_bargain_share_wap.jpg', '808', 'image/jpeg', 1, 1565347281, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (678, '72e6d20190809184121468304.jpg', '/uploads/wap/activity/bargain/poster/72e6d20190809184121468304.jpg', '/uploads/wap/activity/bargain/poster/72e6d20190809184121468304.jpg', '51934', 'image/jpeg', 1, 1565347281, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (679, '11_product_detail_699_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_699_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_699_is_promoter_0.wap.jpg', '609', 'image/jpeg', 1, 1565350498, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (680, '3_product_detail_777_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_777_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_777_is_promoter_0.wap.jpg', '606', 'image/jpeg', 1, 1565368396, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (681, '7_product_detail_699_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_699_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_699_is_promoter_0.wap.jpg', '601', 'image/jpeg', 1, 1565372392, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (682, '3_product_detail_699_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_699_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_699_is_promoter_0.wap.jpg', '609', 'image/jpeg', 1, 1565372619, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (683, '9_product_detail_699_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_699_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_699_is_promoter_0.wap.jpg', '609', 'image/jpeg', 1, 1565372643, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (684, '9447a7d33b0b85b4c9b323ba6a28fac4.jpeg', '/uploads/store/comment/20190810/9447a7d33b0b85b4c9b323ba6a28fac4.jpeg', '/./uploads/store/comment/20190810/s_9447a7d33b0b85b4c9b323ba6a28fac4.jpeg', '317264', 'image/jpeg', 1, 1565395644, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (685, 'af79e26154db729b8e01561d362c50eb.jpeg', '/uploads/store/comment/20190810/af79e26154db729b8e01561d362c50eb.jpeg', '/./uploads/store/comment/20190810/s_af79e26154db729b8e01561d362c50eb.jpeg', '102985', 'image/jpeg', 1, 1565396034, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (686, '94acc6f395ac0b1e663c1e29079e00ef.jpeg', '/uploads/store/comment/20190810/94acc6f395ac0b1e663c1e29079e00ef.jpeg', '/./uploads/store/comment/20190810/s_94acc6f395ac0b1e663c1e29079e00ef.jpeg', '46130', 'image/jpeg', 1, 1565396051, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (687, '27f53ef75884b0606ad36844992cf5bd.jpeg', '/uploads/store/comment/20190810/27f53ef75884b0606ad36844992cf5bd.jpeg', '/./uploads/store/comment/20190810/s_27f53ef75884b0606ad36844992cf5bd.jpeg', '32819', 'image/jpeg', 1, 1565396274, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (688, '3_168_1_bargain_share_routine.jpg', '/uploads/routine/activity/bargain/code/3_168_1_bargain_share_routine.jpg', '/uploads/routine/activity/bargain/code/3_168_1_bargain_share_routine.jpg', '54798', 'image/jpeg', 1, 1565398626, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (689, 'a378820190810085706909969.jpg', '/uploads/routine/activity/bargain/poster/a378820190810085706909969.jpg', '/uploads/routine/activity/bargain/poster/a378820190810085706909969.jpg', '46985', 'image/jpeg', 1, 1565398626, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (690, '8_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/8_product_detail_168_is_promoter_1.wap.jpg', '/uploads/qrcode/8_product_detail_168_is_promoter_1.wap.jpg', '600', 'image/jpeg', 1, 1565398698, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (691, '5_605_0_bargain_share_wap.jpg', '/uploads/qrcode/5_605_0_bargain_share_wap.jpg', '/uploads/qrcode/5_605_0_bargain_share_wap.jpg', '805', 'image/jpeg', 1, 1565399693, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (692, '05f1720190810091453805843.jpg', '/uploads/wap/activity/bargain/poster/05f1720190810091453805843.jpg', '/uploads/wap/activity/bargain/poster/05f1720190810091453805843.jpg', '53531', 'image/jpeg', 1, 1565399693, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (693, '6_605_0_bargain_share_wap.jpg', '/uploads/qrcode/6_605_0_bargain_share_wap.jpg', '/uploads/qrcode/6_605_0_bargain_share_wap.jpg', '805', 'image/jpeg', 1, 1565399710, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (694, 'b1a5920190810091510239757.jpg', '/uploads/wap/activity/bargain/poster/b1a5920190810091510239757.jpg', '/uploads/wap/activity/bargain/poster/b1a5920190810091510239757.jpg', '50868', 'image/jpeg', 1, 1565399710, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (695, '11b9820190810091542394109.jpg', '/uploads/wap/activity/bargain/poster/11b9820190810091542394109.jpg', '/uploads/wap/activity/bargain/poster/11b9820190810091542394109.jpg', '50868', 'image/jpeg', 1, 1565399742, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (696, '3_605_0_bargain_share_wap.jpg', '/uploads/qrcode/3_605_0_bargain_share_wap.jpg', '/uploads/qrcode/3_605_0_bargain_share_wap.jpg', '790', 'image/jpeg', 1, 1565399977, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (697, 'eef6f20190810091937474252.jpg', '/uploads/wap/activity/bargain/poster/eef6f20190810091937474252.jpg', '/uploads/wap/activity/bargain/poster/eef6f20190810091937474252.jpg', '50556', 'image/jpeg', 1, 1565399977, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (698, '3a20f20190810091941712733.jpg', '/uploads/wap/activity/bargain/poster/3a20f20190810091941712733.jpg', '/uploads/wap/activity/bargain/poster/3a20f20190810091941712733.jpg', '50556', 'image/jpeg', 1, 1565399981, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (699, '3191720190810092001209579.jpg', '/uploads/wap/activity/bargain/poster/3191720190810092001209579.jpg', '/uploads/wap/activity/bargain/poster/3191720190810092001209579.jpg', '50556', 'image/jpeg', 1, 1565400001, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (700, 'e2eab20190810092005742729.jpg', '/uploads/wap/activity/bargain/poster/e2eab20190810092005742729.jpg', '/uploads/wap/activity/bargain/poster/e2eab20190810092005742729.jpg', '50556', 'image/jpeg', 1, 1565400005, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (701, 'e458220190810092103985540.jpg', '/uploads/wap/activity/bargain/poster/e458220190810092103985540.jpg', '/uploads/wap/activity/bargain/poster/e458220190810092103985540.jpg', '50556', 'image/jpeg', 1, 1565400063, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (702, '3_product_detail_605_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_605_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_605_is_promoter_0.wap.jpg', '604', 'image/jpeg', 1, 1565400097, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (703, '33cc6da52ac10b555de91bc91d752e74.jpg', '/uploads/store/comment/20190810/33cc6da52ac10b555de91bc91d752e74.jpg', '/./uploads/store/comment/20190810/s_33cc6da52ac10b555de91bc91d752e74.jpg', '261169', 'image/jpeg', 1, 1565400845, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (704, 'f739e9a7a35173cb9d4c2a7c297fe0a9.jpg', '/uploads/store/comment/20190810/f739e9a7a35173cb9d4c2a7c297fe0a9.jpg', '/./uploads/store/comment/20190810/s_f739e9a7a35173cb9d4c2a7c297fe0a9.jpg', '290790', 'image/jpeg', 1, 1565401139, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (705, '3_166_0_bargain_share_wap.jpg', '/uploads/qrcode/3_166_0_bargain_share_wap.jpg', '/uploads/qrcode/3_166_0_bargain_share_wap.jpg', '812', 'image/jpeg', 1, 1565401716, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (706, '3cc5720190810094836966763.jpg', '/uploads/wap/activity/bargain/poster/3cc5720190810094836966763.jpg', '/uploads/wap/activity/bargain/poster/3cc5720190810094836966763.jpg', '50467', 'image/jpeg', 1, 1565401716, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (707, '34ed02019081009535136145.jpg', '/uploads/wap/activity/bargain/poster/34ed02019081009535136145.jpg', '/uploads/wap/activity/bargain/poster/34ed02019081009535136145.jpg', '50467', 'image/jpeg', 1, 1565402031, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (708, '587_1_user_wap.jpg', '/uploads/qrcode/587_1_user_wap.jpg', '/uploads/qrcode/587_1_user_wap.jpg', '502', 'image/jpeg', 1, 1565402278, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (709, '0fd6020190810095758714780.jpg', '/uploads/wap/spread/poster/0fd6020190810095758714780.jpg', '/uploads/wap/spread/poster/0fd6020190810095758714780.jpg', '83183', 'image/jpeg', 1, 1565402278, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (710, 'b706820190810095758324299.jpg', '/uploads/wap/spread/poster/b706820190810095758324299.jpg', '/uploads/wap/spread/poster/b706820190810095758324299.jpg', '55553', 'image/jpeg', 1, 1565402278, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (711, '52b7320190810095758116635.jpg', '/uploads/wap/spread/poster/52b7320190810095758116635.jpg', '/uploads/wap/spread/poster/52b7320190810095758116635.jpg', '76208', 'image/jpeg', 1, 1565402278, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (712, '927b02019081010110367889.jpg', '/uploads/wap/spread/poster/927b02019081010110367889.jpg', '/uploads/wap/spread/poster/927b02019081010110367889.jpg', '83037', 'image/jpeg', 1, 1565403063, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (713, '4f16c2019081010110314606.jpg', '/uploads/wap/spread/poster/4f16c2019081010110314606.jpg', '/uploads/wap/spread/poster/4f16c2019081010110314606.jpg', '55417', 'image/jpeg', 1, 1565403063, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (714, 'df4fe20190810101104270751.jpg', '/uploads/wap/spread/poster/df4fe20190810101104270751.jpg', '/uploads/wap/spread/poster/df4fe20190810101104270751.jpg', '76071', 'image/jpeg', 1, 1565403064, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (715, '623a4c225738606e4c65f93217050c86.jpg', '/uploads/attach/2019/08/20190810/623a4c225738606e4c65f93217050c86.jpg', '/./uploads/attach/2019/08/20190810/s_623a4c225738606e4c65f93217050c86.jpg', '97039', 'image/jpeg', 8, 1565403240, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (716, '887960975abc9a89e410db82e0089680.jpg', '/uploads/attach/2019/08/20190810/887960975abc9a89e410db82e0089680.jpg', '/./uploads/attach/2019/08/20190810/s_887960975abc9a89e410db82e0089680.jpg', '154063', 'image/jpeg', 8, 1565403240, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (717, '93669bff568cf8eb967670d9cd3ca78c.jpg', '/uploads/attach/2019/08/20190810/93669bff568cf8eb967670d9cd3ca78c.jpg', '/./uploads/attach/2019/08/20190810/s_93669bff568cf8eb967670d9cd3ca78c.jpg', '165730', 'image/jpeg', 8, 1565403240, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (718, '6e27120190810101432669653.jpg', '/uploads/wap/spread/poster/6e27120190810101432669653.jpg', '/uploads/wap/spread/poster/6e27120190810101432669653.jpg', '83037', 'image/jpeg', 1, 1565403272, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (719, '80a9e20190810101432298242.jpg', '/uploads/wap/spread/poster/80a9e20190810101432298242.jpg', '/uploads/wap/spread/poster/80a9e20190810101432298242.jpg', '55417', 'image/jpeg', 1, 1565403272, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (720, '79713201908101014327798.jpg', '/uploads/wap/spread/poster/79713201908101014327798.jpg', '/uploads/wap/spread/poster/79713201908101014327798.jpg', '76071', 'image/jpeg', 1, 1565403272, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (721, '3c77820190810101453167481.jpg', '/uploads/wap/spread/poster/3c77820190810101453167481.jpg', '/uploads/wap/spread/poster/3c77820190810101453167481.jpg', '83037', 'image/jpeg', 1, 1565403293, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (722, 'b16e820190810101453218969.jpg', '/uploads/wap/spread/poster/b16e820190810101453218969.jpg', '/uploads/wap/spread/poster/b16e820190810101453218969.jpg', '55417', 'image/jpeg', 1, 1565403293, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (723, '0a93020190810101453586145.jpg', '/uploads/wap/spread/poster/0a93020190810101453586145.jpg', '/uploads/wap/spread/poster/0a93020190810101453586145.jpg', '76071', 'image/jpeg', 1, 1565403293, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (724, '300be20190810101526403189.jpg', '/uploads/wap/spread/poster/300be20190810101526403189.jpg', '/uploads/wap/spread/poster/300be20190810101526403189.jpg', '83037', 'image/jpeg', 1, 1565403326, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (725, 'cca2820190810101526436866.jpg', '/uploads/wap/spread/poster/cca2820190810101526436866.jpg', '/uploads/wap/spread/poster/cca2820190810101526436866.jpg', '55417', 'image/jpeg', 1, 1565403326, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (726, 'a684e201908101015263440.jpg', '/uploads/wap/spread/poster/a684e201908101015263440.jpg', '/uploads/wap/spread/poster/a684e201908101015263440.jpg', '76071', 'image/jpeg', 1, 1565403326, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (727, '75a7c20190810101626996721.jpg', '/uploads/wap/spread/poster/75a7c20190810101626996721.jpg', '/uploads/wap/spread/poster/75a7c20190810101626996721.jpg', '83037', 'image/jpeg', 1, 1565403386, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (728, '0690520190810101626285628.jpg', '/uploads/wap/spread/poster/0690520190810101626285628.jpg', '/uploads/wap/spread/poster/0690520190810101626285628.jpg', '55417', 'image/jpeg', 1, 1565403386, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (729, 'ae5022019081010162665927.jpg', '/uploads/wap/spread/poster/ae5022019081010162665927.jpg', '/uploads/wap/spread/poster/ae5022019081010162665927.jpg', '76071', 'image/jpeg', 1, 1565403386, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (730, '168_1_user_routine.jpg', '/uploads/routine/spread/code/168_1_user_routine.jpg', '/uploads/routine/spread/code/168_1_user_routine.jpg', '50419', 'image/jpeg', 1, 1565403495, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (731, '0d77020190810101815824444.jpg', '/uploads/routine/spread/poster/0d77020190810101815824444.jpg', '/uploads/routine/spread/poster/0d77020190810101815824444.jpg', '82112', 'image/jpeg', 1, 1565403495, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (732, '5272020190810101815680677.jpg', '/uploads/routine/spread/poster/5272020190810101815680677.jpg', '/uploads/routine/spread/poster/5272020190810101815680677.jpg', '54479', 'image/jpeg', 1, 1565403495, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (733, 'ddb3020190810101816222053.jpg', '/uploads/routine/spread/poster/ddb3020190810101816222053.jpg', '/uploads/routine/spread/poster/ddb3020190810101816222053.jpg', '75132', 'image/jpeg', 1, 1565403496, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (734, 'd943720190810102023909829.jpg', '/uploads/routine/spread/poster/d943720190810102023909829.jpg', '/uploads/routine/spread/poster/d943720190810102023909829.jpg', '82112', 'image/jpeg', 1, 1565403623, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (735, '9960720190810102023772823.jpg', '/uploads/routine/spread/poster/9960720190810102023772823.jpg', '/uploads/routine/spread/poster/9960720190810102023772823.jpg', '54479', 'image/jpeg', 1, 1565403623, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (736, 'fba9d20190810102023333152.jpg', '/uploads/routine/spread/poster/fba9d20190810102023333152.jpg', '/uploads/routine/spread/poster/fba9d20190810102023333152.jpg', '75132', 'image/jpeg', 1, 1565403623, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (737, '15f9920190810102656233207.jpg', '/uploads/wap/activity/bargain/poster/15f9920190810102656233207.jpg', '/uploads/wap/activity/bargain/poster/15f9920190810102656233207.jpg', '50467', 'image/jpeg', 1, 1565404016, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (738, '0163c20190810102720117158.jpg', '/uploads/wap/activity/bargain/poster/0163c20190810102720117158.jpg', '/uploads/wap/activity/bargain/poster/0163c20190810102720117158.jpg', '50467', 'image/jpeg', 1, 1565404040, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (739, '0502a20190810102724205893.jpg', '/uploads/wap/activity/bargain/poster/0502a20190810102724205893.jpg', '/uploads/wap/activity/bargain/poster/0502a20190810102724205893.jpg', '50467', 'image/jpeg', 1, 1565404044, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (740, '99ef020190810102734771881.jpg', '/uploads/wap/activity/bargain/poster/99ef020190810102734771881.jpg', '/uploads/wap/activity/bargain/poster/99ef020190810102734771881.jpg', '50467', 'image/jpeg', 1, 1565404054, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (741, '8963920190810103437416321.jpg', '/uploads/wap/spread/poster/8963920190810103437416321.jpg', '/uploads/wap/spread/poster/8963920190810103437416321.jpg', '83037', 'image/jpeg', 1, 1565404477, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (742, '3f8e820190810103437865217.jpg', '/uploads/wap/spread/poster/3f8e820190810103437865217.jpg', '/uploads/wap/spread/poster/3f8e820190810103437865217.jpg', '55417', 'image/jpeg', 1, 1565404477, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (743, 'b0c7a20190810103438547815.jpg', '/uploads/wap/spread/poster/b0c7a20190810103438547815.jpg', '/uploads/wap/spread/poster/b0c7a20190810103438547815.jpg', '76071', 'image/jpeg', 1, 1565404478, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (744, 'c76fc20190810103519598997.jpg', '/uploads/routine/spread/poster/c76fc20190810103519598997.jpg', '/uploads/routine/spread/poster/c76fc20190810103519598997.jpg', '82112', 'image/jpeg', 1, 1565404519, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (745, '8d0ea20190810103519341564.jpg', '/uploads/routine/spread/poster/8d0ea20190810103519341564.jpg', '/uploads/routine/spread/poster/8d0ea20190810103519341564.jpg', '54479', 'image/jpeg', 1, 1565404519, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (746, 'afb7920190810103519952760.jpg', '/uploads/routine/spread/poster/afb7920190810103519952760.jpg', '/uploads/routine/spread/poster/afb7920190810103519952760.jpg', '75132', 'image/jpeg', 1, 1565404519, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (747, '11_product_detail_788_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_788_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_788_is_promoter_0.wap.jpg', '604', 'image/jpeg', 1, 1565404768, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (748, '2_168_1_product.jpg', '/uploads/routine/product/2_168_1_product.jpg', '/uploads/routine/product/2_168_1_product.jpg', '48453', 'image/jpeg', 1, 1565405007, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (749, '3_168_1_product.jpg', '/uploads/routine/product/3_168_1_product.jpg', '/uploads/routine/product/3_168_1_product.jpg', '48570', 'image/jpeg', 1, 1565405331, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (750, '11_product_detail_791_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_791_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_791_is_promoter_0.wap.jpg', '588', 'image/jpeg', 1, 1565405474, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (751, '3_607_0_bargain_share_wap.jpg', '/uploads/qrcode/3_607_0_bargain_share_wap.jpg', '/uploads/qrcode/3_607_0_bargain_share_wap.jpg', '811', 'image/jpeg', 1, 1565405708, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (752, '975e620190810105508186846.jpg', '/uploads/wap/activity/bargain/poster/975e620190810105508186846.jpg', '/uploads/wap/activity/bargain/poster/975e620190810105508186846.jpg', '50896', 'image/jpeg', 1, 1565405708, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (753, '7_168_1_product.jpg', '/uploads/routine/product/7_168_1_product.jpg', '/uploads/routine/product/7_168_1_product.jpg', '49574', 'image/jpeg', 1, 1565405848, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (754, '11_168_1_product.jpg', '/uploads/routine/product/11_168_1_product.jpg', '/uploads/routine/product/11_168_1_product.jpg', '49205', 'image/jpeg', 1, 1565405950, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (755, '69cb986f474b77338991c43bd23b10e1.jpg', '/uploads/store/comment/20190810/69cb986f474b77338991c43bd23b10e1.jpg', '/./uploads/store/comment/20190810/s_69cb986f474b77338991c43bd23b10e1.jpg', '191710', 'image/jpeg', 1, 1565407656, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (756, '9_product_detail_804_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_804_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_804_is_promoter_0.wap.jpg', '603', 'image/jpeg', 1, 1565417740, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (757, '3_579_1_bargain_share_wap.jpg', '/uploads/qrcode/3_579_1_bargain_share_wap.jpg', '/uploads/qrcode/3_579_1_bargain_share_wap.jpg', '802', 'image/jpeg', 1, 1565417767, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (758, 'ef0ef20190810141607639100.jpg', '/uploads/wap/activity/bargain/poster/ef0ef20190810141607639100.jpg', '/uploads/wap/activity/bargain/poster/ef0ef20190810141607639100.jpg', '50198', 'image/jpeg', 1, 1565417767, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (759, '3_807_0_bargain_share_wap.jpg', '/uploads/qrcode/3_807_0_bargain_share_wap.jpg', '/uploads/qrcode/3_807_0_bargain_share_wap.jpg', '812', 'image/jpeg', 1, 1565418899, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (760, '6e92320190810143500632067.jpg', '/uploads/wap/activity/bargain/poster/6e92320190810143500632067.jpg', '/uploads/wap/activity/bargain/poster/6e92320190810143500632067.jpg', '50389', 'image/jpeg', 1, 1565418900, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (761, '28_607_0_pink_share_wap.jpg', '/uploads/qrcode/28_607_0_pink_share_wap.jpg', '/uploads/qrcode/28_607_0_pink_share_wap.jpg', '703', 'image/jpeg', 1, 1565419172, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (762, '6a9ae20190810143932941735.jpg', '/uploads/wap/activity/pink/poster/6a9ae20190810143932941735.jpg', '/uploads/wap/activity/pink/poster/6a9ae20190810143932941735.jpg', '49880', 'image/jpeg', 1, 1565419172, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (763, '84f473add2215e083f55ece765cd8401.gif', '/uploads/store/comment/20190810/84f473add2215e083f55ece765cd8401.gif', '/./uploads/store/comment/20190810/s_84f473add2215e083f55ece765cd8401.gif', '572309', 'image/gif', 1, 1565419356, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (764, 'd1c3720190810145545515469.jpg', '/uploads/routine/spread/poster/d1c3720190810145545515469.jpg', '/uploads/routine/spread/poster/d1c3720190810145545515469.jpg', '82112', 'image/jpeg', 1, 1565420145, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (765, 'b56a120190810145545930668.jpg', '/uploads/routine/spread/poster/b56a120190810145545930668.jpg', '/uploads/routine/spread/poster/b56a120190810145545930668.jpg', '54479', 'image/jpeg', 1, 1565420145, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (766, '1011220190810145546654242.jpg', '/uploads/routine/spread/poster/1011220190810145546654242.jpg', '/uploads/routine/spread/poster/1011220190810145546654242.jpg', '75132', 'image/jpeg', 1, 1565420146, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (767, 'd0f3c20190810154531656240.jpg', '/uploads/wap/activity/bargain/poster/d0f3c20190810154531656240.jpg', '/uploads/wap/activity/bargain/poster/d0f3c20190810154531656240.jpg', '50198', 'image/jpeg', 1, 1565423131, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (768, '62606bed11941e221d9aa6fc4c1a7d3b.jpeg', '/uploads/store/comment/20190810/62606bed11941e221d9aa6fc4c1a7d3b.jpeg', '/./uploads/store/comment/20190810/s_62606bed11941e221d9aa6fc4c1a7d3b.jpeg', '4693', 'image/jpeg', 1, 1565426401, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (769, '3_product_detail_753_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_753_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_753_is_promoter_0.wap.jpg', '602', 'image/jpeg', 1, 1565426870, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (770, '29_676_0_pink_share_wap.jpg', '/uploads/qrcode/29_676_0_pink_share_wap.jpg', '/uploads/qrcode/29_676_0_pink_share_wap.jpg', '709', 'image/jpeg', 1, 1565428808, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (771, '4c07f20190810172008309835.jpg', '/uploads/wap/activity/pink/poster/4c07f20190810172008309835.jpg', '/uploads/wap/activity/pink/poster/4c07f20190810172008309835.jpg', '53096', 'image/jpeg', 1, 1565428808, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (772, '1a04f20190810172125197716.jpg', '/uploads/wap/activity/bargain/poster/1a04f20190810172125197716.jpg', '/uploads/wap/activity/bargain/poster/1a04f20190810172125197716.jpg', '53276', 'image/jpeg', 1, 1565428885, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (773, 'c696920190810172144649013.jpg', '/uploads/wap/activity/bargain/poster/c696920190810172144649013.jpg', '/uploads/wap/activity/bargain/poster/c696920190810172144649013.jpg', '53276', 'image/jpeg', 1, 1565428904, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (774, '31_168_1_pink_share_wap.jpg', '/uploads/qrcode/31_168_1_pink_share_wap.jpg', '/uploads/qrcode/31_168_1_pink_share_wap.jpg', '706', 'image/jpeg', 1, 1565428947, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (775, '9f87820190810172227536462.jpg', '/uploads/wap/activity/pink/poster/9f87820190810172227536462.jpg', '/uploads/wap/activity/pink/poster/9f87820190810172227536462.jpg', '53111', 'image/jpeg', 1, 1565428947, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (776, '79937339d66b6ba5b5474fd6bb71990f.jpg', '/uploads/store/comment/20190810/79937339d66b6ba5b5474fd6bb71990f.jpg', '/./uploads/store/comment/20190810/s_79937339d66b6ba5b5474fd6bb71990f.jpg', '66163', 'image/jpeg', 1, 1565428950, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (777, '33_169_0_pink_share_wap.jpg', '/uploads/qrcode/33_169_0_pink_share_wap.jpg', '/uploads/qrcode/33_169_0_pink_share_wap.jpg', '695', 'image/jpeg', 1, 1565429032, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (778, 'c0db120190810172352532036.jpg', '/uploads/wap/activity/pink/poster/c0db120190810172352532036.jpg', '/uploads/wap/activity/pink/poster/c0db120190810172352532036.jpg', '49789', 'image/jpeg', 1, 1565429032, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (779, 'c2d3ff995f949200d28b3d89d1672cb6.png', '/uploads/store/comment/20190810/c2d3ff995f949200d28b3d89d1672cb6.png', '/./uploads/store/comment/20190810/s_c2d3ff995f949200d28b3d89d1672cb6.png', '432873', 'image/png', 1, 1565429071, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (780, '34_166_0_pink_share_wap.jpg', '/uploads/qrcode/34_166_0_pink_share_wap.jpg', '/uploads/qrcode/34_166_0_pink_share_wap.jpg', '700', 'image/jpeg', 1, 1565429124, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (781, '0eac620190810172524694550.jpg', '/uploads/wap/activity/pink/poster/0eac620190810172524694550.jpg', '/uploads/wap/activity/pink/poster/0eac620190810172524694550.jpg', '53216', 'image/jpeg', 1, 1565429124, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (782, '11_product_detail_823_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_823_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_823_is_promoter_0.wap.jpg', '594', 'image/jpeg', 1, 1565429500, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (783, '3_822_0_bargain_share_wap.jpg', '/uploads/qrcode/3_822_0_bargain_share_wap.jpg', '/uploads/qrcode/3_822_0_bargain_share_wap.jpg', '816', 'image/jpeg', 1, 1565429538, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (784, '2438920190810173218811257.jpg', '/uploads/wap/activity/bargain/poster/2438920190810173218811257.jpg', '/uploads/wap/activity/bargain/poster/2438920190810173218811257.jpg', '50549', 'image/jpeg', 1, 1565429538, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (785, '3_691_0_bargain_share_wap.jpg', '/uploads/qrcode/3_691_0_bargain_share_wap.jpg', '/uploads/qrcode/3_691_0_bargain_share_wap.jpg', '809', 'image/jpeg', 1, 1565429663, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (786, '760ab20190810173424626585.jpg', '/uploads/wap/activity/bargain/poster/760ab20190810173424626585.jpg', '/uploads/wap/activity/bargain/poster/760ab20190810173424626585.jpg', '50124', 'image/jpeg', 1, 1565429664, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (787, '8193330a02617b7cbecafc3a57bbd61b.jpg', '/uploads/store/comment/20190810/8193330a02617b7cbecafc3a57bbd61b.jpg', '/./uploads/store/comment/20190810/s_8193330a02617b7cbecafc3a57bbd61b.jpg', '2352', 'image/jpeg', 1, 1565429716, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (788, '50d2d20190810173616867740.jpg', '/uploads/wap/activity/bargain/poster/50d2d20190810173616867740.jpg', '/uploads/wap/activity/bargain/poster/50d2d20190810173616867740.jpg', '50223', 'image/jpeg', 1, 1565429776, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (789, '5_676_0_bargain_share_wap.jpg', '/uploads/qrcode/5_676_0_bargain_share_wap.jpg', '/uploads/qrcode/5_676_0_bargain_share_wap.jpg', '792', 'image/jpeg', 1, 1565429777, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (790, '6637720190810173617423855.jpg', '/uploads/wap/activity/bargain/poster/6637720190810173617423855.jpg', '/uploads/wap/activity/bargain/poster/6637720190810173617423855.jpg', '53766', 'image/jpeg', 1, 1565429777, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (791, '559cb2019081017365468042.jpg', '/uploads/wap/activity/bargain/poster/559cb2019081017365468042.jpg', '/uploads/wap/activity/bargain/poster/559cb2019081017365468042.jpg', '53239', 'image/jpeg', 1, 1565429814, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (792, '6d90f7b30563731f9f079d635584c138.png', '/uploads/store/comment/20190810/6d90f7b30563731f9f079d635584c138.png', '/./uploads/store/comment/20190810/s_6d90f7b30563731f9f079d635584c138.png', '672449', 'image/png', 1, 1565429997, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (793, '3_product_detail_169_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_169_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_169_is_promoter_0.wap.jpg', '608', 'image/jpeg', 1, 1565430005, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (794, '3e9e320190810174051623599.jpg', '/uploads/wap/activity/bargain/poster/3e9e320190810174051623599.jpg', '/uploads/wap/activity/bargain/poster/3e9e320190810174051623599.jpg', '50223', 'image/jpeg', 1, 1565430051, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (795, 'b19aa20190810174051234834.jpg', '/uploads/wap/activity/bargain/poster/b19aa20190810174051234834.jpg', '/uploads/wap/activity/bargain/poster/b19aa20190810174051234834.jpg', '51846', 'image/jpeg', 1, 1565430051, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (796, 'd324a20190810174103480034.jpg', '/uploads/wap/activity/bargain/poster/d324a20190810174103480034.jpg', '/uploads/wap/activity/bargain/poster/d324a20190810174103480034.jpg', '50223', 'image/jpeg', 1, 1565430063, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (797, 'c44be20190810174126739853.jpg', '/uploads/routine/activity/bargain/poster/c44be20190810174126739853.jpg', '/uploads/routine/activity/bargain/poster/c44be20190810174126739853.jpg', '46985', 'image/jpeg', 1, 1565430086, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (798, '6_822_0_bargain_share_wap.jpg', '/uploads/qrcode/6_822_0_bargain_share_wap.jpg', '/uploads/qrcode/6_822_0_bargain_share_wap.jpg', '805', 'image/jpeg', 1, 1565430089, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (799, '128ac20190810174129669553.jpg', '/uploads/wap/activity/bargain/poster/128ac20190810174129669553.jpg', '/uploads/wap/activity/bargain/poster/128ac20190810174129669553.jpg', '51796', 'image/jpeg', 1, 1565430089, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (800, '3_558_0_bargain_share_wap.jpg', '/uploads/qrcode/3_558_0_bargain_share_wap.jpg', '/uploads/qrcode/3_558_0_bargain_share_wap.jpg', '797', 'image/jpeg', 1, 1565430113, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (801, '9b04d20190810174153250192.jpg', '/uploads/wap/activity/bargain/poster/9b04d20190810174153250192.jpg', '/uploads/wap/activity/bargain/poster/9b04d20190810174153250192.jpg', '50300', 'image/jpeg', 1, 1565430113, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (802, '37_607_0_pink_share_wap.jpg', '/uploads/qrcode/37_607_0_pink_share_wap.jpg', '/uploads/qrcode/37_607_0_pink_share_wap.jpg', '707', 'image/jpeg', 1, 1565430114, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (803, '19d1920190810174154767709.jpg', '/uploads/wap/activity/pink/poster/19d1920190810174154767709.jpg', '/uploads/wap/activity/pink/poster/19d1920190810174154767709.jpg', '49860', 'image/jpeg', 1, 1565430114, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (804, 'd425420190810174214992112.jpg', '/uploads/routine/activity/bargain/poster/d425420190810174214992112.jpg', '/uploads/routine/activity/bargain/poster/d425420190810174214992112.jpg', '47382', 'image/jpeg', 1, 1565430134, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (805, 'a36b020190810174229384386.jpg', '/uploads/wap/activity/bargain/poster/a36b020190810174229384386.jpg', '/uploads/wap/activity/bargain/poster/a36b020190810174229384386.jpg', '51494', 'image/jpeg', 1, 1565430149, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (806, '6c34920190810174246281748.jpg', '/uploads/wap/activity/bargain/poster/6c34920190810174246281748.jpg', '/uploads/wap/activity/bargain/poster/6c34920190810174246281748.jpg', '51292', 'image/jpeg', 1, 1565430166, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (807, 'bb57620190810174250562589.jpg', '/uploads/wap/activity/bargain/poster/bb57620190810174250562589.jpg', '/uploads/wap/activity/bargain/poster/bb57620190810174250562589.jpg', '51292', 'image/jpeg', 1, 1565430170, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (808, '2c62020190810174312807385.jpg', '/uploads/wap/activity/bargain/poster/2c62020190810174312807385.jpg', '/uploads/wap/activity/bargain/poster/2c62020190810174312807385.jpg', '51292', 'image/jpeg', 1, 1565430192, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (809, '4e02220190810174326126788.jpg', '/uploads/wap/activity/bargain/poster/4e02220190810174326126788.jpg', '/uploads/wap/activity/bargain/poster/4e02220190810174326126788.jpg', '51292', 'image/jpeg', 1, 1565430206, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (810, '5_169_0_bargain_share_wap.jpg', '/uploads/qrcode/5_169_0_bargain_share_wap.jpg', '/uploads/qrcode/5_169_0_bargain_share_wap.jpg', '808', 'image/jpeg', 1, 1565430353, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (811, '6ea2e20190810174553173463.jpg', '/uploads/wap/activity/bargain/poster/6ea2e20190810174553173463.jpg', '/uploads/wap/activity/bargain/poster/6ea2e20190810174553173463.jpg', '53634', 'image/jpeg', 1, 1565430353, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (812, '5_621_0_bargain_share_wap.jpg', '/uploads/qrcode/5_621_0_bargain_share_wap.jpg', '/uploads/qrcode/5_621_0_bargain_share_wap.jpg', '810', 'image/jpeg', 1, 1565430372, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (813, '9df8120190810174612343416.jpg', '/uploads/wap/activity/bargain/poster/9df8120190810174612343416.jpg', '/uploads/wap/activity/bargain/poster/9df8120190810174612343416.jpg', '53200', 'image/jpeg', 1, 1565430372, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (814, '6a61d20190810174617161654.jpg', '/uploads/wap/activity/bargain/poster/6a61d20190810174617161654.jpg', '/uploads/wap/activity/bargain/poster/6a61d20190810174617161654.jpg', '53407', 'image/jpeg', 1, 1565430377, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (815, '60b2120190810174702718330.jpg', '/uploads/wap/activity/bargain/poster/60b2120190810174702718330.jpg', '/uploads/wap/activity/bargain/poster/60b2120190810174702718330.jpg', '53634', 'image/jpeg', 1, 1565430422, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (816, 'e0c7c20190810174704338601.jpg', '/uploads/wap/activity/bargain/poster/e0c7c20190810174704338601.jpg', '/uploads/wap/activity/bargain/poster/e0c7c20190810174704338601.jpg', '53407', 'image/jpeg', 1, 1565430424, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (817, 'bb44c2019081017473020165.jpg', '/uploads/wap/activity/bargain/poster/bb44c2019081017473020165.jpg', '/uploads/wap/activity/bargain/poster/bb44c2019081017473020165.jpg', '53634', 'image/jpeg', 1, 1565430450, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (818, 'ec2002019081017481290256.jpg', '/uploads/wap/activity/bargain/poster/ec2002019081017481290256.jpg', '/uploads/wap/activity/bargain/poster/ec2002019081017481290256.jpg', '53407', 'image/jpeg', 1, 1565430492, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (819, 'd5b0320190810174841818950.jpg', '/uploads/wap/activity/bargain/poster/d5b0320190810174841818950.jpg', '/uploads/wap/activity/bargain/poster/d5b0320190810174841818950.jpg', '53413', 'image/jpeg', 1, 1565430521, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (820, '5_166_0_bargain_share_wap.jpg', '/uploads/qrcode/5_166_0_bargain_share_wap.jpg', '/uploads/qrcode/5_166_0_bargain_share_wap.jpg', '801', 'image/jpeg', 1, 1565430535, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (821, '5ca3e20190810174855824519.jpg', '/uploads/wap/activity/bargain/poster/5ca3e20190810174855824519.jpg', '/uploads/wap/activity/bargain/poster/5ca3e20190810174855824519.jpg', '53168', 'image/jpeg', 1, 1565430535, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (822, '5_607_0_bargain_share_wap.jpg', '/uploads/qrcode/5_607_0_bargain_share_wap.jpg', '/uploads/qrcode/5_607_0_bargain_share_wap.jpg', '805', 'image/jpeg', 1, 1565430540, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (823, '0c29c201908101749009394.jpg', '/uploads/wap/activity/bargain/poster/0c29c201908101749009394.jpg', '/uploads/wap/activity/bargain/poster/0c29c201908101749009394.jpg', '53208', 'image/jpeg', 1, 1565430540, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (824, 'f858020190810174909414752.jpg', '/uploads/wap/activity/bargain/poster/f858020190810174909414752.jpg', '/uploads/wap/activity/bargain/poster/f858020190810174909414752.jpg', '53413', 'image/jpeg', 1, 1565430549, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (825, '282bb20190810174940286798.jpg', '/uploads/wap/activity/bargain/poster/282bb20190810174940286798.jpg', '/uploads/wap/activity/bargain/poster/282bb20190810174940286798.jpg', '53488', 'image/jpeg', 1, 1565430580, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (826, 'b59a520190810174953911082.jpg', '/uploads/wap/activity/bargain/poster/b59a520190810174953911082.jpg', '/uploads/wap/activity/bargain/poster/b59a520190810174953911082.jpg', '53168', 'image/jpeg', 1, 1565430593, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (827, '6d60820190810175106117864.jpg', '/uploads/wap/activity/bargain/poster/6d60820190810175106117864.jpg', '/uploads/wap/activity/bargain/poster/6d60820190810175106117864.jpg', '53568', 'image/jpeg', 1, 1565430666, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (828, '3_product_detail_621_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_621_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_621_is_promoter_0.wap.jpg', '589', 'image/jpeg', 1, 1565430671, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (829, '50956c13bc953c1ee01ceec733970729.jpeg', '/uploads/store/comment/20190810/50956c13bc953c1ee01ceec733970729.jpeg', '/./uploads/store/comment/20190810/s_50956c13bc953c1ee01ceec733970729.jpeg', '55803', 'image/jpeg', 1, 1565430793, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (830, 'eab9c20190810175319884307.jpg', '/uploads/wap/activity/bargain/poster/eab9c20190810175319884307.jpg', '/uploads/wap/activity/bargain/poster/eab9c20190810175319884307.jpg', '53168', 'image/jpeg', 1, 1565430799, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (831, '7d466f8ed8baebde3d9a06f7af32ca0d.jpeg', '/uploads/store/comment/20190810/7d466f8ed8baebde3d9a06f7af32ca0d.jpeg', '/./uploads/store/comment/20190810/s_7d466f8ed8baebde3d9a06f7af32ca0d.jpeg', '37003', 'image/jpeg', 1, 1565430833, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (832, 'a57220d0edcd9768170ba94a09f61135.jpeg', '/uploads/store/comment/20190810/a57220d0edcd9768170ba94a09f61135.jpeg', '/./uploads/store/comment/20190810/s_a57220d0edcd9768170ba94a09f61135.jpeg', '261554', 'image/jpeg', 1, 1565430869, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (833, 'fc563b9d787633aa239fc04b5ecb63ba.jpeg', '/uploads/store/comment/20190810/fc563b9d787633aa239fc04b5ecb63ba.jpeg', '/./uploads/store/comment/20190810/s_fc563b9d787633aa239fc04b5ecb63ba.jpeg', '294700', 'image/jpeg', 1, 1565430896, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (834, '76e84ae859cf97edfbe3247610688878.png', '/uploads/store/comment/20190810/76e84ae859cf97edfbe3247610688878.png', '/./uploads/store/comment/20190810/s_76e84ae859cf97edfbe3247610688878.png', '672449', 'image/png', 1, 1565430905, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (835, '12a0922a968e27a416c615cb64d89a0d.jpg', '/uploads/store/comment/20190810/12a0922a968e27a416c615cb64d89a0d.jpg', '/./uploads/store/comment/20190810/s_12a0922a968e27a416c615cb64d89a0d.jpg', '16709', 'image/jpeg', 1, 1565430959, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (836, 'f6e7920190810175713361268.jpg', '/uploads/wap/activity/bargain/poster/f6e7920190810175713361268.jpg', '/uploads/wap/activity/bargain/poster/f6e7920190810175713361268.jpg', '50896', 'image/jpeg', 1, 1565431033, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (837, 'c886220190810175728373739.jpg', '/uploads/wap/activity/bargain/poster/c886220190810175728373739.jpg', '/uploads/wap/activity/bargain/poster/c886220190810175728373739.jpg', '50896', 'image/jpeg', 1, 1565431048, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (838, '9161a20190810175742469281.jpg', '/uploads/wap/activity/bargain/poster/9161a20190810175742469281.jpg', '/uploads/wap/activity/bargain/poster/9161a20190810175742469281.jpg', '50896', 'image/jpeg', 1, 1565431062, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (839, '20b0220190810175837540346.jpg', '/uploads/wap/activity/bargain/poster/20b0220190810175837540346.jpg', '/uploads/wap/activity/bargain/poster/20b0220190810175837540346.jpg', '50896', 'image/jpeg', 1, 1565431117, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (840, '5265d2019081017591615627.jpg', '/uploads/wap/activity/bargain/poster/5265d2019081017591615627.jpg', '/uploads/wap/activity/bargain/poster/5265d2019081017591615627.jpg', '53168', 'image/jpeg', 1, 1565431156, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (841, '29a9f2019081018003190755.jpg', '/uploads/wap/activity/bargain/poster/29a9f2019081018003190755.jpg', '/uploads/wap/activity/bargain/poster/29a9f2019081018003190755.jpg', '53168', 'image/jpeg', 1, 1565431231, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (842, '0db695b6f4e80436f35eeed9c4559236.jpg', '/uploads/store/comment/20190810/0db695b6f4e80436f35eeed9c4559236.jpg', '/./uploads/store/comment/20190810/s_0db695b6f4e80436f35eeed9c4559236.jpg', '16709', 'image/jpeg', 1, 1565431294, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (843, 'ad0f72019081018020735350.jpg', '/uploads/wap/spread/poster/ad0f72019081018020735350.jpg', '/uploads/wap/spread/poster/ad0f72019081018020735350.jpg', '83037', 'image/jpeg', 1, 1565431327, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (844, 'f0d7020190810180207520549.jpg', '/uploads/wap/spread/poster/f0d7020190810180207520549.jpg', '/uploads/wap/spread/poster/f0d7020190810180207520549.jpg', '55417', 'image/jpeg', 1, 1565431327, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (845, '9024820190810180208817599.jpg', '/uploads/wap/spread/poster/9024820190810180208817599.jpg', '/uploads/wap/spread/poster/9024820190810180208817599.jpg', '76071', 'image/jpeg', 1, 1565431328, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (846, '032dd20190810180220774681.jpg', '/uploads/wap/spread/poster/032dd20190810180220774681.jpg', '/uploads/wap/spread/poster/032dd20190810180220774681.jpg', '83037', 'image/jpeg', 1, 1565431340, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (847, 'e074120190810180220304932.jpg', '/uploads/wap/spread/poster/e074120190810180220304932.jpg', '/uploads/wap/spread/poster/e074120190810180220304932.jpg', '55417', 'image/jpeg', 1, 1565431340, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (848, 'f827920190810180220465888.jpg', '/uploads/wap/spread/poster/f827920190810180220465888.jpg', '/uploads/wap/spread/poster/f827920190810180220465888.jpg', '76071', 'image/jpeg', 1, 1565431340, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (849, '3_815_0_bargain_share_wap.jpg', '/uploads/qrcode/3_815_0_bargain_share_wap.jpg', '/uploads/qrcode/3_815_0_bargain_share_wap.jpg', '805', 'image/jpeg', 1, 1565431432, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (850, 'e105420190810180353850271.jpg', '/uploads/wap/activity/bargain/poster/e105420190810180353850271.jpg', '/uploads/wap/activity/bargain/poster/e105420190810180353850271.jpg', '49962', 'image/jpeg', 1, 1565431433, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (851, 'b7c4bd3f844fb3fd672c252791046f08.jpeg', '/uploads/store/comment/20190810/b7c4bd3f844fb3fd672c252791046f08.jpeg', '/./uploads/store/comment/20190810/s_b7c4bd3f844fb3fd672c252791046f08.jpeg', '294700', 'image/jpeg', 1, 1565431453, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (852, '9f62b20190810180441933865.jpg', '/uploads/routine/activity/bargain/poster/9f62b20190810180441933865.jpg', '/uploads/routine/activity/bargain/poster/9f62b20190810180441933865.jpg', '47382', 'image/jpeg', 1, 1565431481, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (853, '8804f20190810180544523407.jpg', '/uploads/wap/activity/bargain/poster/8804f20190810180544523407.jpg', '/uploads/wap/activity/bargain/poster/8804f20190810180544523407.jpg', '50896', 'image/jpeg', 1, 1565431544, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (854, '7082120190810180544399839.jpg', '/uploads/wap/activity/bargain/poster/7082120190810180544399839.jpg', '/uploads/wap/activity/bargain/poster/7082120190810180544399839.jpg', '50647', 'image/jpeg', 1, 1565431544, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (855, 'ddb1b20190810180612176891.jpg', '/uploads/wap/activity/bargain/poster/ddb1b20190810180612176891.jpg', '/uploads/wap/activity/bargain/poster/ddb1b20190810180612176891.jpg', '50896', 'image/jpeg', 1, 1565431572, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (856, 'f169b20190810180613147159.jpg', '/uploads/wap/activity/bargain/poster/f169b20190810180613147159.jpg', '/uploads/wap/activity/bargain/poster/f169b20190810180613147159.jpg', '50647', 'image/jpeg', 1, 1565431573, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (857, '88f7777cef66e25e59f283d41f4c0f37.jpg', '/uploads/store/comment/20190810/88f7777cef66e25e59f283d41f4c0f37.jpg', '/./uploads/store/comment/20190810/s_88f7777cef66e25e59f283d41f4c0f37.jpg', '209569', 'image/jpeg', 1, 1565431576, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (858, '3_824_0_bargain_share_wap.jpg', '/uploads/qrcode/3_824_0_bargain_share_wap.jpg', '/uploads/qrcode/3_824_0_bargain_share_wap.jpg', '800', 'image/jpeg', 1, 1565431587, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (859, 'bc6fe20190810180628781294.jpg', '/uploads/wap/activity/bargain/poster/bc6fe20190810180628781294.jpg', '/uploads/wap/activity/bargain/poster/bc6fe20190810180628781294.jpg', '50596', 'image/jpeg', 1, 1565431588, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (860, '60fdf01fd6726f63fbd4848ed26635e4.jpeg', '/uploads/store/comment/20190810/60fdf01fd6726f63fbd4848ed26635e4.jpeg', '/./uploads/store/comment/20190810/s_60fdf01fd6726f63fbd4848ed26635e4.jpeg', '89094', 'image/jpeg', 1, 1565431635, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (861, '8fe0420190810180717368312.jpg', '/uploads/wap/activity/bargain/poster/8fe0420190810180717368312.jpg', '/uploads/wap/activity/bargain/poster/8fe0420190810180717368312.jpg', '50669', 'image/jpeg', 1, 1565431637, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (862, '74d5ba43cb04b7057e525a2af18a212e.jpeg', '/uploads/store/comment/20190810/74d5ba43cb04b7057e525a2af18a212e.jpeg', '/./uploads/store/comment/20190810/s_74d5ba43cb04b7057e525a2af18a212e.jpeg', '823019', 'image/jpeg', 1, 1565431649, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (863, '2710bc043d8bac9b1ad150b228184120.jpeg', '/uploads/store/comment/20190810/2710bc043d8bac9b1ad150b228184120.jpeg', '/./uploads/store/comment/20190810/s_2710bc043d8bac9b1ad150b228184120.jpeg', '12745', 'image/jpeg', 1, 1565431675, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (864, '9f7d8b60167edcd29d3e668ee62dc812.jpeg', '/uploads/store/comment/20190810/9f7d8b60167edcd29d3e668ee62dc812.jpeg', '/./uploads/store/comment/20190810/s_9f7d8b60167edcd29d3e668ee62dc812.jpeg', '79481', 'image/jpeg', 1, 1565431698, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (865, 'fe235cf087a68cd1985d7314e35f7020.jpeg', '/uploads/store/comment/20190810/fe235cf087a68cd1985d7314e35f7020.jpeg', '/./uploads/store/comment/20190810/s_fe235cf087a68cd1985d7314e35f7020.jpeg', '431493', 'image/jpeg', 1, 1565431712, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (866, '87be66d6cdf049ba46effdcd9a0e156e.jpeg', '/uploads/store/comment/20190810/87be66d6cdf049ba46effdcd9a0e156e.jpeg', '/./uploads/store/comment/20190810/s_87be66d6cdf049ba46effdcd9a0e156e.jpeg', '37003', 'image/jpeg', 1, 1565431713, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (867, 'ef67f20190810181038541116.jpg', '/uploads/wap/activity/bargain/poster/ef67f20190810181038541116.jpg', '/uploads/wap/activity/bargain/poster/ef67f20190810181038541116.jpg', '50386', 'image/jpeg', 1, 1565431838, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (868, '828162e9e8a9a4e6a16dfe95cbe7e3fa.png', '/uploads/store/comment/20190810/828162e9e8a9a4e6a16dfe95cbe7e3fa.png', '/./uploads/store/comment/20190810/s_828162e9e8a9a4e6a16dfe95cbe7e3fa.png', '457134', 'image/png', 1, 1565432068, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (869, '34_168_1_pink_share_wap.jpg', '/uploads/qrcode/34_168_1_pink_share_wap.jpg', '/uploads/qrcode/34_168_1_pink_share_wap.jpg', '699', 'image/jpeg', 1, 1565432115, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (870, '2451020190810181515111267.jpg', '/uploads/wap/activity/pink/poster/2451020190810181515111267.jpg', '/uploads/wap/activity/pink/poster/2451020190810181515111267.jpg', '53184', 'image/jpeg', 1, 1565432115, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (871, '331312019081018161045131.jpg', '/uploads/wap/activity/bargain/poster/331312019081018161045131.jpg', '/uploads/wap/activity/bargain/poster/331312019081018161045131.jpg', '49910', 'image/jpeg', 1, 1565432170, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (872, '0a3ae3954797617a0775a057d86fc593.jpg', '/uploads/store/comment/20190810/0a3ae3954797617a0775a057d86fc593.jpg', '/./uploads/store/comment/20190810/s_0a3ae3954797617a0775a057d86fc593.jpg', '320008', 'image/jpeg', 1, 1565432260, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (873, 'f777257f46df041d20c94867d43bd946.jpg', '/uploads/store/comment/20190810/f777257f46df041d20c94867d43bd946.jpg', '/./uploads/store/comment/20190810/s_f777257f46df041d20c94867d43bd946.jpg', '218000', 'image/jpeg', 1, 1565432280, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (874, 'e2403ab6803f2cae0f9546e0ca85812a.jpg', '/uploads/store/comment/20190810/e2403ab6803f2cae0f9546e0ca85812a.jpg', '/./uploads/store/comment/20190810/s_e2403ab6803f2cae0f9546e0ca85812a.jpg', '277998', 'image/jpeg', 1, 1565432311, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (875, '8038d20190810181913265267.jpg', '/uploads/wap/activity/bargain/poster/8038d20190810181913265267.jpg', '/uploads/wap/activity/bargain/poster/8038d20190810181913265267.jpg', '50002', 'image/jpeg', 1, 1565432353, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (876, '17_168_1_product.jpg', '/uploads/routine/product/17_168_1_product.jpg', '/uploads/routine/product/17_168_1_product.jpg', '49854', 'image/jpeg', 1, 1565432614, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (877, '2c5fa07812b5d4627500fe2de455b569.jpg', '/uploads/store/comment/20190810/2c5fa07812b5d4627500fe2de455b569.jpg', '/./uploads/store/comment/20190810/s_2c5fa07812b5d4627500fe2de455b569.jpg', '267511', 'image/jpeg', 1, 1565432619, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (878, '3_product_detail_831_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_831_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_831_is_promoter_0.wap.jpg', '591', 'image/jpeg', 1, 1565432650, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (879, '9_168_1_product.jpg', '/uploads/routine/product/9_168_1_product.jpg', '/uploads/routine/product/9_168_1_product.jpg', '48709', 'image/jpeg', 1, 1565432680, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (880, '34_168_1_pink_share_routine.jpg', '/uploads/routine/activity/pink/code/34_168_1_pink_share_routine.jpg', '/uploads/routine/activity/pink/code/34_168_1_pink_share_routine.jpg', '49212', 'image/jpeg', 1, 1565432808, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (881, 'b27d520190810182648985600.jpg', '/uploads/routine/activity/pink/poster/b27d520190810182648985600.jpg', '/uploads/routine/activity/pink/poster/b27d520190810182648985600.jpg', '49286', 'image/jpeg', 1, 1565432808, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (882, '32_168_1_pink_share_routine.jpg', '/uploads/routine/activity/pink/code/32_168_1_pink_share_routine.jpg', '/uploads/routine/activity/pink/code/32_168_1_pink_share_routine.jpg', '49277', 'image/jpeg', 1, 1565432814, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (883, '934b520190810182654976422.jpg', '/uploads/routine/activity/pink/poster/934b520190810182654976422.jpg', '/uploads/routine/activity/pink/poster/934b520190810182654976422.jpg', '49261', 'image/jpeg', 1, 1565432814, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (884, '084a820190810183018463595.jpg', '/uploads/routine/activity/pink/poster/084a820190810183018463595.jpg', '/uploads/routine/activity/pink/poster/084a820190810183018463595.jpg', '49286', 'image/jpeg', 1, 1565433018, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (885, '83263201908101830213497.jpg', '/uploads/routine/activity/pink/poster/83263201908101830213497.jpg', '/uploads/routine/activity/pink/poster/83263201908101830213497.jpg', '49286', 'image/jpeg', 1, 1565433021, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (886, 'c7e1220190810183023848627.jpg', '/uploads/routine/activity/pink/poster/c7e1220190810183023848627.jpg', '/uploads/routine/activity/pink/poster/c7e1220190810183023848627.jpg', '49286', 'image/jpeg', 1, 1565433023, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (887, '11_833_0_product.jpg', '/uploads/routine/product/11_833_0_product.jpg', '/uploads/routine/product/11_833_0_product.jpg', '50279', 'image/jpeg', 1, 1565433832, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (888, '3_833_0_product.jpg', '/uploads/routine/product/3_833_0_product.jpg', '/uploads/routine/product/3_833_0_product.jpg', '49860', 'image/jpeg', 1, 1565433949, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (889, '2_833_0_product.jpg', '/uploads/routine/product/2_833_0_product.jpg', '/uploads/routine/product/2_833_0_product.jpg', '49263', 'image/jpeg', 1, 1565433971, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (890, '7_product_detail_839_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_839_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_839_is_promoter_0.wap.jpg', '605', 'image/jpeg', 1, 1565450580, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (891, '2_product_detail_839_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_839_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_839_is_promoter_0.wap.jpg', '602', 'image/jpeg', 1, 1565450613, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (892, '845_0_user_wap.jpg', '/uploads/qrcode/845_0_user_wap.jpg', '/uploads/qrcode/845_0_user_wap.jpg', '510', 'image/jpeg', 1, 1565453013, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (893, '1195320190811000333993251.jpg', '/uploads/wap/spread/poster/1195320190811000333993251.jpg', '/uploads/wap/spread/poster/1195320190811000333993251.jpg', '82234', 'image/jpeg', 1, 1565453013, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (894, '8124620190811000333502155.jpg', '/uploads/wap/spread/poster/8124620190811000333502155.jpg', '/uploads/wap/spread/poster/8124620190811000333502155.jpg', '54591', 'image/jpeg', 1, 1565453013, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (895, 'a8f1220190811000334815907.jpg', '/uploads/wap/spread/poster/a8f1220190811000334815907.jpg', '/uploads/wap/spread/poster/a8f1220190811000334815907.jpg', '75249', 'image/jpeg', 1, 1565453014, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (896, 'd40d320190811000731776773.jpg', '/uploads/wap/spread/poster/d40d320190811000731776773.jpg', '/uploads/wap/spread/poster/d40d320190811000731776773.jpg', '82234', 'image/jpeg', 1, 1565453251, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (897, '5cde620190811000731363087.jpg', '/uploads/wap/spread/poster/5cde620190811000731363087.jpg', '/uploads/wap/spread/poster/5cde620190811000731363087.jpg', '54591', 'image/jpeg', 1, 1565453251, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (898, '3e89e20190811000731385928.jpg', '/uploads/wap/spread/poster/3e89e20190811000731385928.jpg', '/uploads/wap/spread/poster/3e89e20190811000731385928.jpg', '75249', 'image/jpeg', 1, 1565453251, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (899, '1074c20190811000855922812.jpg', '/uploads/wap/spread/poster/1074c20190811000855922812.jpg', '/uploads/wap/spread/poster/1074c20190811000855922812.jpg', '82234', 'image/jpeg', 1, 1565453335, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (900, '5bd842019081100085574690.jpg', '/uploads/wap/spread/poster/5bd842019081100085574690.jpg', '/uploads/wap/spread/poster/5bd842019081100085574690.jpg', '54591', 'image/jpeg', 1, 1565453335, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (901, '44feb20190811000855146371.jpg', '/uploads/wap/spread/poster/44feb20190811000855146371.jpg', '/uploads/wap/spread/poster/44feb20190811000855146371.jpg', '75249', 'image/jpeg', 1, 1565453335, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (902, '7_product_detail_847_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_847_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_847_is_promoter_0.wap.jpg', '597', 'image/jpeg', 1, 1565454509, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (903, '8_product_detail_847_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_847_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_847_is_promoter_0.wap.jpg', '598', 'image/jpeg', 1, 1565454518, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (904, '11_product_detail_848_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_848_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_848_is_promoter_0.wap.jpg', '599', 'image/jpeg', 1, 1565454570, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (905, '3_product_detail_848_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_848_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_848_is_promoter_0.wap.jpg', '602', 'image/jpeg', 1, 1565454579, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (906, '2_product_detail_848_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_848_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_848_is_promoter_0.wap.jpg', '597', 'image/jpeg', 1, 1565454583, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (907, '9_product_detail_848_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_848_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_848_is_promoter_0.wap.jpg', '607', 'image/jpeg', 1, 1565454587, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (908, '8_product_detail_849_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_849_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_849_is_promoter_0.wap.jpg', '601', 'image/jpeg', 1, 1565454777, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (909, '7_product_detail_849_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_849_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_849_is_promoter_0.wap.jpg', '606', 'image/jpeg', 1, 1565454781, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (910, '3_product_detail_849_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_849_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_849_is_promoter_0.wap.jpg', '599', 'image/jpeg', 1, 1565454790, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (911, '2_product_detail_849_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_849_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_849_is_promoter_0.wap.jpg', '597', 'image/jpeg', 1, 1565454794, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (912, '8_product_detail_850_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_850_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_850_is_promoter_0.wap.jpg', '603', 'image/jpeg', 1, 1565454803, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (913, '17_product_detail_853_is_promoter_0.wap.jpg', '/uploads/qrcode/17_product_detail_853_is_promoter_0.wap.jpg', '/uploads/qrcode/17_product_detail_853_is_promoter_0.wap.jpg', '589', 'image/jpeg', 1, 1565455146, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (914, '11_product_detail_857_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_857_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_857_is_promoter_0.wap.jpg', '588', 'image/jpeg', 1, 1565455866, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (915, '3_860_0_bargain_share_wap.jpg', '/uploads/qrcode/3_860_0_bargain_share_wap.jpg', '/uploads/qrcode/3_860_0_bargain_share_wap.jpg', '802', 'image/jpeg', 1, 1565471498, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (916, '8a44820190811051139438328.jpg', '/uploads/wap/activity/bargain/poster/8a44820190811051139438328.jpg', '/uploads/wap/activity/bargain/poster/8a44820190811051139438328.jpg', '50600', 'image/jpeg', 1, 1565471499, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (917, 'ecf5620190811051201864300.jpg', '/uploads/wap/activity/bargain/poster/ecf5620190811051201864300.jpg', '/uploads/wap/activity/bargain/poster/ecf5620190811051201864300.jpg', '50600', 'image/jpeg', 1, 1565471521, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (918, '3_product_detail_620_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_620_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_620_is_promoter_0.wap.jpg', '597', 'image/jpeg', 1, 1565490692, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (919, '3_product_detail_867_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_867_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_867_is_promoter_0.wap.jpg', '602', 'image/jpeg', 1, 1565493144, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (920, '6_656_0_bargain_share_wap.jpg', '/uploads/qrcode/6_656_0_bargain_share_wap.jpg', '/uploads/qrcode/6_656_0_bargain_share_wap.jpg', '805', 'image/jpeg', 1, 1565496148, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (921, '2290a20190811120228670209.jpg', '/uploads/wap/activity/bargain/poster/2290a20190811120228670209.jpg', '/uploads/wap/activity/bargain/poster/2290a20190811120228670209.jpg', '51770', 'image/jpeg', 1, 1565496148, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (922, '3_product_detail_870_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_870_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_870_is_promoter_0.wap.jpg', '598', 'image/jpeg', 1, 1565498982, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (923, '3_870_0_bargain_share_wap.jpg', '/uploads/qrcode/3_870_0_bargain_share_wap.jpg', '/uploads/qrcode/3_870_0_bargain_share_wap.jpg', '796', 'image/jpeg', 1, 1565499160, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (924, 'ff0ab2019081112524033110.jpg', '/uploads/wap/activity/bargain/poster/ff0ab2019081112524033110.jpg', '/uploads/wap/activity/bargain/poster/ff0ab2019081112524033110.jpg', '50594', 'image/jpeg', 1, 1565499160, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (925, '5_656_0_bargain_share_wap.jpg', '/uploads/qrcode/5_656_0_bargain_share_wap.jpg', '/uploads/qrcode/5_656_0_bargain_share_wap.jpg', '788', 'image/jpeg', 1, 1565502332, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (926, '0531120190811134532649336.jpg', '/uploads/wap/activity/bargain/poster/0531120190811134532649336.jpg', '/uploads/wap/activity/bargain/poster/0531120190811134532649336.jpg', '53373', 'image/jpeg', 1, 1565502332, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (927, '3_656_0_bargain_share_wap.jpg', '/uploads/qrcode/3_656_0_bargain_share_wap.jpg', '/uploads/qrcode/3_656_0_bargain_share_wap.jpg', '802', 'image/jpeg', 1, 1565502364, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (928, '90aef20190811134604538896.jpg', '/uploads/wap/activity/bargain/poster/90aef20190811134604538896.jpg', '/uploads/wap/activity/bargain/poster/90aef20190811134604538896.jpg', '50601', 'image/jpeg', 1, 1565502364, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (929, '7171e20190811134631279604.jpg', '/uploads/wap/activity/bargain/poster/7171e20190811134631279604.jpg', '/uploads/wap/activity/bargain/poster/7171e20190811134631279604.jpg', '50601', 'image/jpeg', 1, 1565502391, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (930, '7_product_detail_876_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_876_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_876_is_promoter_0.wap.jpg', '594', 'image/jpeg', 1, 1565503241, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (931, '9_product_detail_876_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_876_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_876_is_promoter_0.wap.jpg', '608', 'image/jpeg', 1, 1565503271, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (932, '3_product_detail_880_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_880_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_880_is_promoter_0.wap.jpg', '614', 'image/jpeg', 1, 1565508444, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (933, '886_0_user_wap.jpg', '/uploads/qrcode/886_0_user_wap.jpg', '/uploads/qrcode/886_0_user_wap.jpg', '506', 'image/jpeg', 1, 1565522673, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (934, '2812e20190811192434460488.jpg', '/uploads/wap/spread/poster/2812e20190811192434460488.jpg', '/uploads/wap/spread/poster/2812e20190811192434460488.jpg', '82690', 'image/jpeg', 1, 1565522674, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (935, 'cc63820190811192434353152.jpg', '/uploads/wap/spread/poster/cc63820190811192434353152.jpg', '/uploads/wap/spread/poster/cc63820190811192434353152.jpg', '55067', 'image/jpeg', 1, 1565522674, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (936, '38af820190811192434654393.jpg', '/uploads/wap/spread/poster/38af820190811192434654393.jpg', '/uploads/wap/spread/poster/38af820190811192434654393.jpg', '75721', 'image/jpeg', 1, 1565522674, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (937, '3_product_detail_889_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_889_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_889_is_promoter_0.wap.jpg', '596', 'image/jpeg', 1, 1565525065, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (938, '889_0_user_wap.jpg', '/uploads/qrcode/889_0_user_wap.jpg', '/uploads/qrcode/889_0_user_wap.jpg', '511', 'image/jpeg', 1, 1565525449, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (939, '2ba2520190811201049160920.jpg', '/uploads/wap/spread/poster/2ba2520190811201049160920.jpg', '/uploads/wap/spread/poster/2ba2520190811201049160920.jpg', '83147', 'image/jpeg', 1, 1565525449, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (940, 'ec20020190811201049559680.jpg', '/uploads/wap/spread/poster/ec20020190811201049559680.jpg', '/uploads/wap/spread/poster/ec20020190811201049559680.jpg', '55522', 'image/jpeg', 1, 1565525449, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (941, '9fdef20190811201049635931.jpg', '/uploads/wap/spread/poster/9fdef20190811201049635931.jpg', '/uploads/wap/spread/poster/9fdef20190811201049635931.jpg', '76166', 'image/jpeg', 1, 1565525449, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (942, '3_889_0_bargain_share_wap.jpg', '/uploads/qrcode/3_889_0_bargain_share_wap.jpg', '/uploads/qrcode/3_889_0_bargain_share_wap.jpg', '791', 'image/jpeg', 1, 1565525551, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (943, 'daa9620190811201232770083.jpg', '/uploads/wap/activity/bargain/poster/daa9620190811201232770083.jpg', '/uploads/wap/activity/bargain/poster/daa9620190811201232770083.jpg', '50223', 'image/jpeg', 1, 1565525552, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (944, '2_product_detail_894_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_894_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_894_is_promoter_0.wap.jpg', '595', 'image/jpeg', 1, 1565530353, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (945, '3_product_detail_894_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_894_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_894_is_promoter_0.wap.jpg', '607', 'image/jpeg', 1, 1565530387, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (946, '42_889_0_pink_share_wap.jpg', '/uploads/qrcode/42_889_0_pink_share_wap.jpg', '/uploads/qrcode/42_889_0_pink_share_wap.jpg', '698', 'image/jpeg', 1, 1565533822, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (947, 'd09bf20190811223022831039.jpg', '/uploads/wap/activity/pink/poster/d09bf20190811223022831039.jpg', '/uploads/wap/activity/pink/poster/d09bf20190811223022831039.jpg', '53186', 'image/jpeg', 1, 1565533822, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (948, 'bf2fb20190811223039931258.jpg', '/uploads/wap/activity/pink/poster/bf2fb20190811223039931258.jpg', '/uploads/wap/activity/pink/poster/bf2fb20190811223039931258.jpg', '53186', 'image/jpeg', 1, 1565533839, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (949, '02aff20190811223730776088.jpg', '/uploads/wap/activity/bargain/poster/02aff20190811223730776088.jpg', '/uploads/wap/activity/bargain/poster/02aff20190811223730776088.jpg', '50223', 'image/jpeg', 1, 1565534250, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (950, '542_0_user_wap.jpg', '/uploads/qrcode/542_0_user_wap.jpg', '/uploads/qrcode/542_0_user_wap.jpg', '510', 'image/jpeg', 1, 1565536324, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (951, '3d01720190811231204288392.jpg', '/uploads/wap/spread/poster/3d01720190811231204288392.jpg', '/uploads/wap/spread/poster/3d01720190811231204288392.jpg', '82185', 'image/jpeg', 1, 1565536324, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (952, '70feb20190811231205974151.jpg', '/uploads/wap/spread/poster/70feb20190811231205974151.jpg', '/uploads/wap/spread/poster/70feb20190811231205974151.jpg', '54551', 'image/jpeg', 1, 1565536325, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (953, 'ba2fd20190811231205780691.jpg', '/uploads/wap/spread/poster/ba2fd20190811231205780691.jpg', '/uploads/wap/spread/poster/ba2fd20190811231205780691.jpg', '75204', 'image/jpeg', 1, 1565536325, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (954, '3_product_detail_542_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_542_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_542_is_promoter_0.wap.jpg', '599', 'image/jpeg', 1, 1565536500, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (955, '3_902_0_bargain_share_wap.jpg', '/uploads/qrcode/3_902_0_bargain_share_wap.jpg', '/uploads/qrcode/3_902_0_bargain_share_wap.jpg', '797', 'image/jpeg', 1, 1565544490, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (956, 'c457d2019081201281088652.jpg', '/uploads/wap/activity/bargain/poster/c457d2019081201281088652.jpg', '/uploads/wap/activity/bargain/poster/c457d2019081201281088652.jpg', '50639', 'image/jpeg', 1, 1565544490, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (957, '3_product_detail_905_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_905_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_905_is_promoter_0.wap.jpg', '605', 'image/jpeg', 1, 1565554145, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (958, '9_product_detail_907_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_907_is_promoter_0.wap.jpg', '/uploads/qrcode/9_product_detail_907_is_promoter_0.wap.jpg', '599', 'image/jpeg', 1, 1565555301, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (959, '7_product_detail_910_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_910_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_910_is_promoter_0.wap.jpg', '601', 'image/jpeg', 1, 1565556639, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (960, '11_product_detail_853_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_853_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_853_is_promoter_0.wap.jpg', '596', 'image/jpeg', 1, 1565560359, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (961, '2_product_detail_913_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_913_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_913_is_promoter_0.wap.jpg', '599', 'image/jpeg', 1, 1565561165, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (962, '590_0_user_wap.jpg', '/uploads/qrcode/590_0_user_wap.jpg', '/uploads/qrcode/590_0_user_wap.jpg', '515', 'image/jpeg', 1, 1565561704, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (963, 'e03082019081206150434985.jpg', '/uploads/wap/spread/poster/e03082019081206150434985.jpg', '/uploads/wap/spread/poster/e03082019081206150434985.jpg', '82959', 'image/jpeg', 1, 1565561704, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (964, 'ff49c20190812061504688476.jpg', '/uploads/wap/spread/poster/ff49c20190812061504688476.jpg', '/uploads/wap/spread/poster/ff49c20190812061504688476.jpg', '55333', 'image/jpeg', 1, 1565561704, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (965, '4a53320190812061504359870.jpg', '/uploads/wap/spread/poster/4a53320190812061504359870.jpg', '/uploads/wap/spread/poster/4a53320190812061504359870.jpg', '75989', 'image/jpeg', 1, 1565561704, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (966, '11_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/11_product_detail_915_is_promoter_0.wap.jpg', '600', 'image/jpeg', 1, 1565562252, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (967, '17_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/17_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/17_product_detail_915_is_promoter_0.wap.jpg', '602', 'image/jpeg', 1, 1565562257, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (968, '7_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/7_product_detail_915_is_promoter_0.wap.jpg', '597', 'image/jpeg', 1, 1565562277, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (969, '2_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/2_product_detail_915_is_promoter_0.wap.jpg', '600', 'image/jpeg', 1, 1565562291, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (970, '3_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_915_is_promoter_0.wap.jpg', '597', 'image/jpeg', 1, 1565562303, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (971, '8_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_915_is_promoter_0.wap.jpg', '/uploads/qrcode/8_product_detail_915_is_promoter_0.wap.jpg', '593', 'image/jpeg', 1, 1565562317, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (972, '3_919_0_bargain_share_wap.jpg', '/uploads/qrcode/3_919_0_bargain_share_wap.jpg', '/uploads/qrcode/3_919_0_bargain_share_wap.jpg', '809', 'image/jpeg', 1, 1565566703, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (973, '2c8ef20190812073823929053.jpg', '/uploads/wap/activity/bargain/poster/2c8ef20190812073823929053.jpg', '/uploads/wap/activity/bargain/poster/2c8ef20190812073823929053.jpg', '49925', 'image/jpeg', 1, 1565566703, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (974, '919_0_user.jpg', '/uploads/routine/spread/code/919_0_user.jpg', '/uploads/routine/spread/code/919_0_user.jpg', '50422', 'image/jpeg', 1, 1565570689, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (975, 'dfa0320190812084709170125.jpg', '/uploads/wap/spread/poster/dfa0320190812084709170125.jpg', '/uploads/wap/spread/poster/dfa0320190812084709170125.jpg', '82690', 'image/jpeg', 1, 1565570829, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (976, '7f14120190812084709227906.jpg', '/uploads/wap/spread/poster/7f14120190812084709227906.jpg', '/uploads/wap/spread/poster/7f14120190812084709227906.jpg', '55067', 'image/jpeg', 1, 1565570829, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (977, 'cdf1e20190812084709897368.jpg', '/uploads/wap/spread/poster/cdf1e20190812084709897368.jpg', '/uploads/wap/spread/poster/cdf1e20190812084709897368.jpg', '75721', 'image/jpeg', 1, 1565570829, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (978, 'ebd6d20190812090408364338.jpg', '/uploads/wap/spread/poster/ebd6d20190812090408364338.jpg', '/uploads/wap/spread/poster/ebd6d20190812090408364338.jpg', '82690', 'image/jpeg', 1, 1565571848, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (979, '8804f20190812090408578257.jpg', '/uploads/wap/spread/poster/8804f20190812090408578257.jpg', '/uploads/wap/spread/poster/8804f20190812090408578257.jpg', '55067', 'image/jpeg', 1, 1565571848, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (980, '7e33120190812090408213683.jpg', '/uploads/wap/spread/poster/7e33120190812090408213683.jpg', '/uploads/wap/spread/poster/7e33120190812090408213683.jpg', '75721', 'image/jpeg', 1, 1565571848, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (981, '540_0_user_wap.jpg', '/uploads/qrcode/540_0_user_wap.jpg', '/uploads/qrcode/540_0_user_wap.jpg', '507', 'image/jpeg', 1, 1565573895, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (982, '35fa420190812093815785442.jpg', '/uploads/wap/spread/poster/35fa420190812093815785442.jpg', '/uploads/wap/spread/poster/35fa420190812093815785442.jpg', '82171', 'image/jpeg', 1, 1565573895, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (983, '0ae0b20190812093815566253.jpg', '/uploads/wap/spread/poster/0ae0b20190812093815566253.jpg', '/uploads/wap/spread/poster/0ae0b20190812093815566253.jpg', '54539', 'image/jpeg', 1, 1565573895, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (984, '9b89b20190812093815116572.jpg', '/uploads/wap/spread/poster/9b89b20190812093815116572.jpg', '/uploads/wap/spread/poster/9b89b20190812093815116572.jpg', '75195', 'image/jpeg', 1, 1565573895, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (985, '3_product_detail_540_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_540_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_540_is_promoter_0.wap.jpg', '605', 'image/jpeg', 1, 1565574033, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (986, '3_537_0_bargain_share_wap.jpg', '/uploads/qrcode/3_537_0_bargain_share_wap.jpg', '/uploads/qrcode/3_537_0_bargain_share_wap.jpg', '809', 'image/jpeg', 1, 1565574158, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (987, 'e25cf20190812094238721752.jpg', '/uploads/wap/activity/bargain/poster/e25cf20190812094238721752.jpg', '/uploads/wap/activity/bargain/poster/e25cf20190812094238721752.jpg', '50736', 'image/jpeg', 1, 1565574158, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (988, '43_537_0_pink_share_wap.jpg', '/uploads/qrcode/43_537_0_pink_share_wap.jpg', '/uploads/qrcode/43_537_0_pink_share_wap.jpg', '681', 'image/jpeg', 1, 1565574829, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (989, '38a7720190812095349249477.jpg', '/uploads/wap/activity/pink/poster/38a7720190812095349249477.jpg', '/uploads/wap/activity/pink/poster/38a7720190812095349249477.jpg', '58229', 'image/jpeg', 1, 1565574829, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (990, '605_0_user_wap.jpg', '/uploads/qrcode/605_0_user_wap.jpg', '/uploads/qrcode/605_0_user_wap.jpg', '512', 'image/jpeg', 1, 1565576532, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (991, '65d9020190812102212692546.jpg', '/uploads/wap/spread/poster/65d9020190812102212692546.jpg', '/uploads/wap/spread/poster/65d9020190812102212692546.jpg', '82205', 'image/jpeg', 1, 1565576532, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (992, 'c793b2019081210221357868.jpg', '/uploads/wap/spread/poster/c793b2019081210221357868.jpg', '/uploads/wap/spread/poster/c793b2019081210221357868.jpg', '54568', 'image/jpeg', 1, 1565576533, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (993, 'de70920190812102213973153.jpg', '/uploads/wap/spread/poster/de70920190812102213973153.jpg', '/uploads/wap/spread/poster/de70920190812102213973153.jpg', '75222', 'image/jpeg', 1, 1565576533, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (994, 'ee38920190812102318352786.jpg', '/uploads/wap/spread/poster/ee38920190812102318352786.jpg', '/uploads/wap/spread/poster/ee38920190812102318352786.jpg', '82205', 'image/jpeg', 1, 1565576598, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (995, '91f5720190812102318718301.jpg', '/uploads/wap/spread/poster/91f5720190812102318718301.jpg', '/uploads/wap/spread/poster/91f5720190812102318718301.jpg', '54568', 'image/jpeg', 1, 1565576598, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (996, 'dd50e20190812102318408274.jpg', '/uploads/wap/spread/poster/dd50e20190812102318408274.jpg', '/uploads/wap/spread/poster/dd50e20190812102318408274.jpg', '75222', 'image/jpeg', 1, 1565576598, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (997, '699_0_user_routine.jpg', '/uploads/routine/spread/code/699_0_user_routine.jpg', '/uploads/routine/spread/code/699_0_user_routine.jpg', '49180', 'image/jpeg', 1, 1565579307, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (998, '2f3c620190812110827838514.jpg', '/uploads/routine/spread/poster/2f3c620190812110827838514.jpg', '/uploads/routine/spread/poster/2f3c620190812110827838514.jpg', '81246', 'image/jpeg', 1, 1565579307, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (999, '0ec2920190812110827464474.jpg', '/uploads/routine/spread/poster/0ec2920190812110827464474.jpg', '/uploads/routine/spread/poster/0ec2920190812110827464474.jpg', '53615', 'image/jpeg', 1, 1565579307, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1000, '6c4bb20190812110827192077.jpg', '/uploads/routine/spread/poster/6c4bb20190812110827192077.jpg', '/uploads/routine/spread/poster/6c4bb20190812110827192077.jpg', '74265', 'image/jpeg', 1, 1565579307, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1001, 'ded65c06121d291c75d605b956fbe473.jpeg', '/uploads/store/comment/20190812/ded65c06121d291c75d605b956fbe473.jpeg', '/./uploads/store/comment/20190812/s_ded65c06121d291c75d605b956fbe473.jpeg', '102985', 'image/jpeg', 1, 1565579742, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1002, '603_1_user_wap.jpg', '/uploads/qrcode/603_1_user_wap.jpg', '/uploads/qrcode/603_1_user_wap.jpg', '510', 'image/jpeg', 1, 1565579806, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1003, '2c2fb20190812111646208765.jpg', '/uploads/wap/spread/poster/2c2fb20190812111646208765.jpg', '/uploads/wap/spread/poster/2c2fb20190812111646208765.jpg', '82104', 'image/jpeg', 1, 1565579806, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1004, 'f4e362019081211164613665.jpg', '/uploads/wap/spread/poster/f4e362019081211164613665.jpg', '/uploads/wap/spread/poster/f4e362019081211164613665.jpg', '54475', 'image/jpeg', 1, 1565579806, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1005, 'e4d8120190812111647944050.jpg', '/uploads/wap/spread/poster/e4d8120190812111647944050.jpg', '/uploads/wap/spread/poster/e4d8120190812111647944050.jpg', '75131', 'image/jpeg', 1, 1565579807, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1006, '3_937_0_bargain_share_wap.jpg', '/uploads/qrcode/3_937_0_bargain_share_wap.jpg', '/uploads/qrcode/3_937_0_bargain_share_wap.jpg', '813', 'image/jpeg', 1, 1565580519, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1007, '6938620190812112840524560.jpg', '/uploads/wap/activity/bargain/poster/6938620190812112840524560.jpg', '/uploads/wap/activity/bargain/poster/6938620190812112840524560.jpg', '51121', 'image/jpeg', 1, 1565580520, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1008, '0bfce20190812112856858662.jpg', '/uploads/wap/activity/bargain/poster/0bfce20190812112856858662.jpg', '/uploads/wap/activity/bargain/poster/0bfce20190812112856858662.jpg', '51121', 'image/jpeg', 1, 1565580536, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1009, '3_942_0_bargain_share_routine.jpg', '/uploads/routine/activity/bargain/code/3_942_0_bargain_share_routine.jpg', '/uploads/routine/activity/bargain/code/3_942_0_bargain_share_routine.jpg', '54397', 'image/jpeg', 1, 1565581718, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1010, 'b427420190812114838539019.jpg', '/uploads/routine/activity/bargain/poster/b427420190812114838539019.jpg', '/uploads/routine/activity/bargain/poster/b427420190812114838539019.jpg', '46901', 'image/jpeg', 1, 1565581718, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1011, 'd048620190812114845242988.jpg', '/uploads/routine/activity/bargain/poster/d048620190812114845242988.jpg', '/uploads/routine/activity/bargain/poster/d048620190812114845242988.jpg', '46901', 'image/jpeg', 1, 1565581725, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1012, '077fd20190812114850527915.jpg', '/uploads/routine/activity/bargain/poster/077fd20190812114850527915.jpg', '/uploads/routine/activity/bargain/poster/077fd20190812114850527915.jpg', '46901', 'image/jpeg', 1, 1565581730, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1013, 'da6ea2019081211485640638.jpg', '/uploads/routine/activity/bargain/poster/da6ea2019081211485640638.jpg', '/uploads/routine/activity/bargain/poster/da6ea2019081211485640638.jpg', '46901', 'image/jpeg', 1, 1565581736, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1014, 'bbcbf20190812114859421028.jpg', '/uploads/routine/activity/bargain/poster/bbcbf20190812114859421028.jpg', '/uploads/routine/activity/bargain/poster/bbcbf20190812114859421028.jpg', '46901', 'image/jpeg', 1, 1565581739, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1015, '676_0_user_routine.jpg', '/uploads/routine/spread/code/676_0_user_routine.jpg', '/uploads/routine/spread/code/676_0_user_routine.jpg', '48486', 'image/jpeg', 1, 1565581750, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1016, 'bcc2b20190812114910785849.jpg', '/uploads/routine/spread/poster/bcc2b20190812114910785849.jpg', '/uploads/routine/spread/poster/bcc2b20190812114910785849.jpg', '80757', 'image/jpeg', 1, 1565581750, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1017, 'f330420190812114910477986.jpg', '/uploads/routine/spread/poster/f330420190812114910477986.jpg', '/uploads/routine/spread/poster/f330420190812114910477986.jpg', '53132', 'image/jpeg', 1, 1565581750, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1018, 'af8d120190812114911160419.jpg', '/uploads/routine/spread/poster/af8d120190812114911160419.jpg', '/uploads/routine/spread/poster/af8d120190812114911160419.jpg', '73774', 'image/jpeg', 1, 1565581751, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1019, '3_942_0_bargain_share_wap.jpg', '/uploads/qrcode/3_942_0_bargain_share_wap.jpg', '/uploads/qrcode/3_942_0_bargain_share_wap.jpg', '801', 'image/jpeg', 1, 1565581948, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1020, '3f2df20190812115229656263.jpg', '/uploads/wap/activity/bargain/poster/3f2df20190812115229656263.jpg', '/uploads/wap/activity/bargain/poster/3f2df20190812115229656263.jpg', '50486', 'image/jpeg', 1, 1565581949, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1021, '562_0_user_wap.jpg', '/uploads/qrcode/562_0_user_wap.jpg', '/uploads/qrcode/562_0_user_wap.jpg', '507', 'image/jpeg', 1, 1565582371, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1022, '4fd5a20190812115931198262.jpg', '/uploads/wap/spread/poster/4fd5a20190812115931198262.jpg', '/uploads/wap/spread/poster/4fd5a20190812115931198262.jpg', '82416', 'image/jpeg', 1, 1565582371, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1023, 'f64b220190812115932401236.jpg', '/uploads/wap/spread/poster/f64b220190812115932401236.jpg', '/uploads/wap/spread/poster/f64b220190812115932401236.jpg', '54794', 'image/jpeg', 1, 1565582372, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1024, '7369f2019081211593214602.jpg', '/uploads/wap/spread/poster/7369f2019081211593214602.jpg', '/uploads/wap/spread/poster/7369f2019081211593214602.jpg', '75437', 'image/jpeg', 1, 1565582372, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1025, '6_815_0_bargain_share_wap.jpg', '/uploads/qrcode/6_815_0_bargain_share_wap.jpg', '/uploads/qrcode/6_815_0_bargain_share_wap.jpg', '802', 'image/jpeg', 1, 1565582393, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1026, '0e18920190812115953358608.jpg', '/uploads/wap/activity/bargain/poster/0e18920190812115953358608.jpg', '/uploads/wap/activity/bargain/poster/0e18920190812115953358608.jpg', '51083', 'image/jpeg', 1, 1565582393, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1027, 'd5d7f20190812120004827894.jpg', '/uploads/wap/activity/bargain/poster/d5d7f20190812120004827894.jpg', '/uploads/wap/activity/bargain/poster/d5d7f20190812120004827894.jpg', '51083', 'image/jpeg', 1, 1565582404, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1028, '82f5e2019081212001246371.jpg', '/uploads/wap/activity/bargain/poster/82f5e2019081212001246371.jpg', '/uploads/wap/activity/bargain/poster/82f5e2019081212001246371.jpg', '51083', 'image/jpeg', 1, 1565582412, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1029, 'b4f8e20190812120028725695.jpg', '/uploads/wap/activity/bargain/poster/b4f8e20190812120028725695.jpg', '/uploads/wap/activity/bargain/poster/b4f8e20190812120028725695.jpg', '51083', 'image/jpeg', 1, 1565582428, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1030, '9183120190812120054602859.jpg', '/uploads/wap/activity/bargain/poster/9183120190812120054602859.jpg', '/uploads/wap/activity/bargain/poster/9183120190812120054602859.jpg', '51083', 'image/jpeg', 1, 1565582454, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1031, '3_943_0_product.jpg', '/uploads/routine/product/3_943_0_product.jpg', '/uploads/routine/product/3_943_0_product.jpg', '48092', 'image/jpeg', 1, 1565582837, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1032, '2_943_0_product.jpg', '/uploads/routine/product/2_943_0_product.jpg', '/uploads/routine/product/2_943_0_product.jpg', '49042', 'image/jpeg', 1, 1565582843, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1033, '699_0_user_wap.jpg', '/uploads/qrcode/699_0_user_wap.jpg', '/uploads/qrcode/699_0_user_wap.jpg', '510', 'image/jpeg', 1, 1565591430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1034, '494ba20190812143030558680.jpg', '/uploads/wap/spread/poster/494ba20190812143030558680.jpg', '/uploads/wap/spread/poster/494ba20190812143030558680.jpg', '82213', 'image/jpeg', 1, 1565591430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1035, 'aafd820190812143030365946.jpg', '/uploads/wap/spread/poster/aafd820190812143030365946.jpg', '/uploads/wap/spread/poster/aafd820190812143030365946.jpg', '54581', 'image/jpeg', 1, 1565591430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1036, '88ccf20190812143030726635.jpg', '/uploads/wap/spread/poster/88ccf20190812143030726635.jpg', '/uploads/wap/spread/poster/88ccf20190812143030726635.jpg', '75241', 'image/jpeg', 1, 1565591430, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1037, '9_951_0_product.jpg', '/uploads/routine/product/9_951_0_product.jpg', '/uploads/routine/product/9_951_0_product.jpg', '47632', 'image/jpeg', 1, 1565591862, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1038, '7_950_0_product.jpg', '/uploads/routine/product/7_950_0_product.jpg', '/uploads/routine/product/7_950_0_product.jpg', '50420', 'image/jpeg', 1, 1565592002, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1039, '17_955_0_product.jpg', '/uploads/routine/product/17_955_0_product.jpg', '/uploads/routine/product/17_955_0_product.jpg', '49362', 'image/jpeg', 1, 1565596373, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1040, '8_789_0_product.jpg', '/uploads/routine/product/8_789_0_product.jpg', '/uploads/routine/product/8_789_0_product.jpg', '49092', 'image/jpeg', 1, 1565605610, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1041, '3_789_0_product.jpg', '/uploads/routine/product/3_789_0_product.jpg', '/uploads/routine/product/3_789_0_product.jpg', '48001', 'image/jpeg', 1, 1565605613, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1042, '11_969_0_product.jpg', '/uploads/routine/product/11_969_0_product.jpg', '/uploads/routine/product/11_969_0_product.jpg', '49494', 'image/jpeg', 1, 1565605810, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1043, '972_0_user_routine.jpg', '/uploads/routine/spread/code/972_0_user_routine.jpg', '/uploads/routine/spread/code/972_0_user_routine.jpg', '50814', 'image/jpeg', 1, 1565608747, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1044, 'ba2fd20190812191907219032.jpg', '/uploads/routine/spread/poster/ba2fd20190812191907219032.jpg', '/uploads/routine/spread/poster/ba2fd20190812191907219032.jpg', '81724', 'image/jpeg', 1, 1565608747, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1045, '1680820190812191908277791.jpg', '/uploads/routine/spread/poster/1680820190812191908277791.jpg', '/uploads/routine/spread/poster/1680820190812191908277791.jpg', '54092', 'image/jpeg', 1, 1565608748, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1046, '4e68120190812191908412073.jpg', '/uploads/routine/spread/poster/4e68120190812191908412073.jpg', '/uploads/routine/spread/poster/4e68120190812191908412073.jpg', '74737', 'image/jpeg', 1, 1565608748, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1047, '11_972_0_product.jpg', '/uploads/routine/product/11_972_0_product.jpg', '/uploads/routine/product/11_972_0_product.jpg', '49410', 'image/jpeg', 1, 1565609028, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1048, '9_972_0_product.jpg', '/uploads/routine/product/9_972_0_product.jpg', '/uploads/routine/product/9_972_0_product.jpg', '47840', 'image/jpeg', 1, 1565609039, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1049, '9547a20190812200928992941.jpg', '/uploads/routine/spread/poster/9547a20190812200928992941.jpg', '/uploads/routine/spread/poster/9547a20190812200928992941.jpg', '81724', 'image/jpeg', 1, 1565611768, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1050, '6451720190812200929589618.jpg', '/uploads/routine/spread/poster/6451720190812200929589618.jpg', '/uploads/routine/spread/poster/6451720190812200929589618.jpg', '54092', 'image/jpeg', 1, 1565611769, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1051, '11f522019081220092991035.jpg', '/uploads/routine/spread/poster/11f522019081220092991035.jpg', '/uploads/routine/spread/poster/11f522019081220092991035.jpg', '74737', 'image/jpeg', 1, 1565611769, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1052, '9d26820190812201438728214.jpg', '/uploads/routine/spread/poster/9d26820190812201438728214.jpg', '/uploads/routine/spread/poster/9d26820190812201438728214.jpg', '81724', 'image/jpeg', 1, 1565612078, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1053, 'f182220190812201438739047.jpg', '/uploads/routine/spread/poster/f182220190812201438739047.jpg', '/uploads/routine/spread/poster/f182220190812201438739047.jpg', '54092', 'image/jpeg', 1, 1565612078, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1054, '4fc4120190812201439330707.jpg', '/uploads/routine/spread/poster/4fc4120190812201439330707.jpg', '/uploads/routine/spread/poster/4fc4120190812201439330707.jpg', '74737', 'image/jpeg', 1, 1565612079, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1055, '8_972_0_product.jpg', '/uploads/routine/product/8_972_0_product.jpg', '/uploads/routine/product/8_972_0_product.jpg', '47851', 'image/jpeg', 1, 1565612717, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1056, '0554620190812222200156460.jpg', '/uploads/routine/spread/poster/0554620190812222200156460.jpg', '/uploads/routine/spread/poster/0554620190812222200156460.jpg', '81246', 'image/jpeg', 1, 1565619720, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1057, 'ada5e20190812222200994498.jpg', '/uploads/routine/spread/poster/ada5e20190812222200994498.jpg', '/uploads/routine/spread/poster/ada5e20190812222200994498.jpg', '53615', 'image/jpeg', 1, 1565619720, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1058, 'c11cb20190812222201668983.jpg', '/uploads/routine/spread/poster/c11cb20190812222201668983.jpg', '/uploads/routine/spread/poster/c11cb20190812222201668983.jpg', '74265', 'image/jpeg', 1, 1565619721, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1059, '987_0_user_routine.jpg', '/uploads/routine/spread/code/987_0_user_routine.jpg', '/uploads/routine/spread/code/987_0_user_routine.jpg', '49001', 'image/jpeg', 1, 1565630688, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1060, '426bf2019081301244949270.jpg', '/uploads/routine/spread/poster/426bf2019081301244949270.jpg', '/uploads/routine/spread/poster/426bf2019081301244949270.jpg', '81302', 'image/jpeg', 1, 1565630689, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1061, 'f99952019081301244910992.jpg', '/uploads/routine/spread/poster/f99952019081301244910992.jpg', '/uploads/routine/spread/poster/f99952019081301244910992.jpg', '53675', 'image/jpeg', 1, 1565630689, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1062, '9a84a2019081301244941716.jpg', '/uploads/routine/spread/poster/9a84a2019081301244941716.jpg', '/uploads/routine/spread/poster/9a84a2019081301244941716.jpg', '74325', 'image/jpeg', 1, 1565630689, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1063, '04fcc20190813012953604889.jpg', '/uploads/routine/spread/poster/04fcc20190813012953604889.jpg', '/uploads/routine/spread/poster/04fcc20190813012953604889.jpg', '81302', 'image/jpeg', 1, 1565630993, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1064, '45c1620190813012953732828.jpg', '/uploads/routine/spread/poster/45c1620190813012953732828.jpg', '/uploads/routine/spread/poster/45c1620190813012953732828.jpg', '53675', 'image/jpeg', 1, 1565630993, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1065, '3bf7520190813012954615331.jpg', '/uploads/routine/spread/poster/3bf7520190813012954615331.jpg', '/uploads/routine/spread/poster/3bf7520190813012954615331.jpg', '74325', 'image/jpeg', 1, 1565630994, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1066, '3_542_0_bargain_share_wap.jpg', '/uploads/qrcode/3_542_0_bargain_share_wap.jpg', '/uploads/qrcode/3_542_0_bargain_share_wap.jpg', '805', 'image/jpeg', 1, 1565632318, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1067, 'b628320190813015158624684.jpg', '/uploads/wap/activity/bargain/poster/b628320190813015158624684.jpg', '/uploads/wap/activity/bargain/poster/b628320190813015158624684.jpg', '50437', 'image/jpeg', 1, 1565632318, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1068, 'a9cf420190813015220437554.jpg', '/uploads/wap/activity/bargain/poster/a9cf420190813015220437554.jpg', '/uploads/wap/activity/bargain/poster/a9cf420190813015220437554.jpg', '50437', 'image/jpeg', 1, 1565632340, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1069, '0379320190813015224643794.jpg', '/uploads/wap/activity/bargain/poster/0379320190813015224643794.jpg', '/uploads/wap/activity/bargain/poster/0379320190813015224643794.jpg', '50437', 'image/jpeg', 1, 1565632344, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1070, '3_988_0_product.jpg', '/uploads/routine/product/3_988_0_product.jpg', '/uploads/routine/product/3_988_0_product.jpg', '50083', 'image/jpeg', 1, 1565637717, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1071, '2_988_0_product.jpg', '/uploads/routine/product/2_988_0_product.jpg', '/uploads/routine/product/2_988_0_product.jpg', '49634', 'image/jpeg', 1, 1565637742, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1072, '9_990_0_product.jpg', '/uploads/routine/product/9_990_0_product.jpg', '/uploads/routine/product/9_990_0_product.jpg', '49286', 'image/jpeg', 1, 1565638574, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1073, '9_992_0_product.jpg', '/uploads/routine/product/9_992_0_product.jpg', '/uploads/routine/product/9_992_0_product.jpg', '47839', 'image/jpeg', 1, 1565641272, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1074, '2_995_0_product.jpg', '/uploads/routine/product/2_995_0_product.jpg', '/uploads/routine/product/2_995_0_product.jpg', '47728', 'image/jpeg', 1, 1565642558, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1075, '3_996_0_product.jpg', '/uploads/routine/product/3_996_0_product.jpg', '/uploads/routine/product/3_996_0_product.jpg', '49407', 'image/jpeg', 1, 1565642904, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1076, '17_997_0_product.jpg', '/uploads/routine/product/17_997_0_product.jpg', '/uploads/routine/product/17_997_0_product.jpg', '48691', 'image/jpeg', 1, 1565644929, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1077, '11_997_0_product.jpg', '/uploads/routine/product/11_997_0_product.jpg', '/uploads/routine/product/11_997_0_product.jpg', '49112', 'image/jpeg', 1, 1565644935, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1078, '8_997_0_product.jpg', '/uploads/routine/product/8_997_0_product.jpg', '/uploads/routine/product/8_997_0_product.jpg', '49628', 'image/jpeg', 1, 1565644953, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1079, '7_997_0_product.jpg', '/uploads/routine/product/7_997_0_product.jpg', '/uploads/routine/product/7_997_0_product.jpg', '48648', 'image/jpeg', 1, 1565644966, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1080, '9_997_0_product.jpg', '/uploads/routine/product/9_997_0_product.jpg', '/uploads/routine/product/9_997_0_product.jpg', '48576', 'image/jpeg', 1, 1565644984, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1081, '3_997_0_product.jpg', '/uploads/routine/product/3_997_0_product.jpg', '/uploads/routine/product/3_997_0_product.jpg', '48090', 'image/jpeg', 1, 1565644997, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1082, '8_999_0_product.jpg', '/uploads/routine/product/8_999_0_product.jpg', '/uploads/routine/product/8_999_0_product.jpg', '47820', 'image/jpeg', 1, 1565645445, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1083, '7_1003_0_product.jpg', '/uploads/routine/product/7_1003_0_product.jpg', '/uploads/routine/product/7_1003_0_product.jpg', '49305', 'image/jpeg', 1, 1565650132, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1084, 'd728520190813101258428972.jpg', '/uploads/wap/activity/bargain/poster/d728520190813101258428972.jpg', '/uploads/wap/activity/bargain/poster/d728520190813101258428972.jpg', '50468', 'image/jpeg', 1, 1565662378, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1085, 'ba3c720190813101520670747.jpg', '/uploads/wap/activity/bargain/poster/ba3c720190813101520670747.jpg', '/uploads/wap/activity/bargain/poster/ba3c720190813101520670747.jpg', '50549', 'image/jpeg', 1, 1565662520, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1086, 'dd10120190813101647171912.jpg', '/uploads/wap/activity/bargain/poster/dd10120190813101647171912.jpg', '/uploads/wap/activity/bargain/poster/dd10120190813101647171912.jpg', '50549', 'image/jpeg', 1, 1565662607, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1087, 'd935920190813102427641575.jpg', '/uploads/wap/activity/bargain/poster/d935920190813102427641575.jpg', '/uploads/wap/activity/bargain/poster/d935920190813102427641575.jpg', '50549', 'image/jpeg', 1, 1565663067, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1088, 'eaa3220190813102452150266.jpg', '/uploads/wap/activity/bargain/poster/eaa3220190813102452150266.jpg', '/uploads/wap/activity/bargain/poster/eaa3220190813102452150266.jpg', '50979', 'image/jpeg', 1, 1565663092, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1089, '71ddb20190813102508669841.jpg', '/uploads/wap/activity/bargain/poster/71ddb20190813102508669841.jpg', '/uploads/wap/activity/bargain/poster/71ddb20190813102508669841.jpg', '50549', 'image/jpeg', 1, 1565663108, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1090, 'c6e8120190813102610920888.jpg', '/uploads/wap/activity/bargain/poster/c6e8120190813102610920888.jpg', '/uploads/wap/activity/bargain/poster/c6e8120190813102610920888.jpg', '50467', 'image/jpeg', 1, 1565663170, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1091, '11_1011_0_product.jpg', '/uploads/routine/product/11_1011_0_product.jpg', '/uploads/routine/product/11_1011_0_product.jpg', '48552', 'image/jpeg', 1, 1565663368, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1092, 'c429420190813110028404621.jpg', '/uploads/wap/spread/poster/c429420190813110028404621.jpg', '/uploads/wap/spread/poster/c429420190813110028404621.jpg', '82690', 'image/jpeg', 1, 1565665228, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1093, 'dba1c20190813110028315787.jpg', '/uploads/wap/spread/poster/dba1c20190813110028315787.jpg', '/uploads/wap/spread/poster/dba1c20190813110028315787.jpg', '55067', 'image/jpeg', 1, 1565665228, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1094, '3bf7520190813110028180293.jpg', '/uploads/wap/spread/poster/3bf7520190813110028180293.jpg', '/uploads/wap/spread/poster/3bf7520190813110028180293.jpg', '75721', 'image/jpeg', 1, 1565665228, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1095, '1017_0_user_wap.jpg', '/uploads/qrcode/1017_0_user_wap.jpg', '/uploads/qrcode/1017_0_user_wap.jpg', '525', 'image/jpeg', 1, 1565666771, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1096, 'ac8a920190813112611551322.jpg', '/uploads/wap/spread/poster/ac8a920190813112611551322.jpg', '/uploads/wap/spread/poster/ac8a920190813112611551322.jpg', '84524', 'image/jpeg', 1, 1565666771, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1097, '201252019081311261165495.jpg', '/uploads/wap/spread/poster/201252019081311261165495.jpg', '/uploads/wap/spread/poster/201252019081311261165495.jpg', '56892', 'image/jpeg', 1, 1565666771, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1098, 'f4e3c20190813112612587382.jpg', '/uploads/wap/spread/poster/f4e3c20190813112612587382.jpg', '/uploads/wap/spread/poster/f4e3c20190813112612587382.jpg', '77544', 'image/jpeg', 1, 1565666772, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1099, '3_613_0_product.jpg', '/uploads/routine/product/3_613_0_product.jpg', '/uploads/routine/product/3_613_0_product.jpg', '146', 'text/html', 1, 1565667337, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1100, '11_1021_0_product.jpg', '/uploads/routine/product/11_1021_0_product.jpg', '/uploads/routine/product/11_1021_0_product.jpg', '49942', 'image/jpeg', 1, 1565668070, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1101, '3_product_detail_1023_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_1023_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_1023_is_promoter_0.wap.jpg', '603', 'image/jpeg', 1, 1565668170, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1102, '2_613_0_product.jpg', '/uploads/routine/product/2_613_0_product.jpg', '/uploads/routine/product/2_613_0_product.jpg', '146', 'text/html', 1, 1565668179, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1103, '2cfd420190813115055398658.jpg', '/uploads/wap/spread/poster/2cfd420190813115055398658.jpg', '/uploads/wap/spread/poster/2cfd420190813115055398658.jpg', '82205', 'image/jpeg', 1, 1565668255, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1104, 'ce78d20190813115055553728.jpg', '/uploads/wap/spread/poster/ce78d20190813115055553728.jpg', '/uploads/wap/spread/poster/ce78d20190813115055553728.jpg', '54568', 'image/jpeg', 1, 1565668255, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1105, 'f466620190813115055114005.jpg', '/uploads/wap/spread/poster/f466620190813115055114005.jpg', '/uploads/wap/spread/poster/f466620190813115055114005.jpg', '75222', 'image/jpeg', 1, 1565668255, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1106, '3_774_0_bargain_share_wap.jpg', '/uploads/qrcode/3_774_0_bargain_share_wap.jpg', '/uploads/qrcode/3_774_0_bargain_share_wap.jpg', '795', 'image/jpeg', 1, 1565668282, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1107, '4f16420190813115122265187.jpg', '/uploads/wap/activity/bargain/poster/4f16420190813115122265187.jpg', '/uploads/wap/activity/bargain/poster/4f16420190813115122265187.jpg', '50681', 'image/jpeg', 1, 1565668282, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1108, '11_955_0_product.jpg', '/uploads/routine/product/11_955_0_product.jpg', '/uploads/routine/product/11_955_0_product.jpg', '49052', 'image/jpeg', 1, 1565668588, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1109, '96e7052d173868cf4c04bc2be75de973.jpg', '/uploads/wechat/image/20190813/96e7052d173868cf4c04bc2be75de973.jpg', '/./uploads/wechat/image/20190813/s_96e7052d173868cf4c04bc2be75de973.jpg', '97071', 'image/jpeg', 0, 1565668892, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1110, '2_1026_0_product.jpg', '/uploads/routine/product/2_1026_0_product.jpg', '/uploads/routine/product/2_1026_0_product.jpg', '48222', 'image/jpeg', 1, 1565669001, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1111, '8_1026_0_product.jpg', '/uploads/routine/product/8_1026_0_product.jpg', '/uploads/routine/product/8_1026_0_product.jpg', '49347', 'image/jpeg', 1, 1565669006, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1112, '9_955_0_product.jpg', '/uploads/routine/product/9_955_0_product.jpg', '/uploads/routine/product/9_955_0_product.jpg', '48471', 'image/jpeg', 1, 1565675291, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1113, '8_1034_0_product.jpg', '/uploads/routine/product/8_1034_0_product.jpg', '/uploads/routine/product/8_1034_0_product.jpg', '49824', 'image/jpeg', 1, 1565676749, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1114, '7_1034_0_product.jpg', '/uploads/routine/product/7_1034_0_product.jpg', '/uploads/routine/product/7_1034_0_product.jpg', '49649', 'image/jpeg', 1, 1565676854, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1115, '1035_0_user_routine.jpg', '/uploads/routine/spread/code/1035_0_user_routine.jpg', '/uploads/routine/spread/code/1035_0_user_routine.jpg', '49447', 'image/jpeg', 1, 1565677010, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1116, '56dc020190813141651638037.jpg', '/uploads/routine/spread/poster/56dc020190813141651638037.jpg', '/uploads/routine/spread/poster/56dc020190813141651638037.jpg', '81162', 'image/jpeg', 1, 1565677011, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1117, 'ddf9020190813141651330766.jpg', '/uploads/routine/spread/poster/ddf9020190813141651330766.jpg', '/uploads/routine/spread/poster/ddf9020190813141651330766.jpg', '53536', 'image/jpeg', 1, 1565677011, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1118, '1f97020190813141651424333.jpg', '/uploads/routine/spread/poster/1f97020190813141651424333.jpg', '/uploads/routine/spread/poster/1f97020190813141651424333.jpg', '74186', 'image/jpeg', 1, 1565677011, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1119, '3_product_detail_1037_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_1037_is_promoter_0.wap.jpg', '/uploads/qrcode/3_product_detail_1037_is_promoter_0.wap.jpg', '611', 'image/jpeg', 1, 1565677289, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1120, 'd1aeac651bfa32b2a57ebac1b0263cb6.jpg', '/uploads/wechat/image/20190813/d1aeac651bfa32b2a57ebac1b0263cb6.jpg', '/./uploads/wechat/image/20190813/s_d1aeac651bfa32b2a57ebac1b0263cb6.jpg', '97071', 'image/jpeg', 0, 1565679313, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1121, '590_1_user_wap.jpg', '/uploads/qrcode/590_1_user_wap.jpg', '/uploads/qrcode/590_1_user_wap.jpg', '515', 'image/jpeg', 1, 1565680771, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1122, '3e88320190813151932934652.jpg', '/uploads/wap/spread/poster/3e88320190813151932934652.jpg', '/uploads/wap/spread/poster/3e88320190813151932934652.jpg', '82959', 'image/jpeg', 1, 1565680772, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1123, '9b89b20190813151932678271.jpg', '/uploads/wap/spread/poster/9b89b20190813151932678271.jpg', '/uploads/wap/spread/poster/9b89b20190813151932678271.jpg', '55333', 'image/jpeg', 1, 1565680772, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1124, 'd79c820190813151932649423.jpg', '/uploads/wap/spread/poster/d79c820190813151932649423.jpg', '/uploads/wap/spread/poster/d79c820190813151932649423.jpg', '75989', 'image/jpeg', 1, 1565680772, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1125, 'ca91820190813151954439982.jpg', '/uploads/wap/spread/poster/ca91820190813151954439982.jpg', '/uploads/wap/spread/poster/ca91820190813151954439982.jpg', '82959', 'image/jpeg', 1, 1565680794, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1126, '3acb220190813151954933426.jpg', '/uploads/wap/spread/poster/3acb220190813151954933426.jpg', '/uploads/wap/spread/poster/3acb220190813151954933426.jpg', '55333', 'image/jpeg', 1, 1565680794, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1127, 'd714d20190813151954946218.jpg', '/uploads/wap/spread/poster/d714d20190813151954946218.jpg', '/uploads/wap/spread/poster/d714d20190813151954946218.jpg', '75989', 'image/jpeg', 1, 1565680794, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1128, '2996920190813152014137187.jpg', '/uploads/wap/spread/poster/2996920190813152014137187.jpg', '/uploads/wap/spread/poster/2996920190813152014137187.jpg', '82959', 'image/jpeg', 1, 1565680814, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1129, '0e99920190813152014180875.jpg', '/uploads/wap/spread/poster/0e99920190813152014180875.jpg', '/uploads/wap/spread/poster/0e99920190813152014180875.jpg', '55333', 'image/jpeg', 1, 1565680814, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1130, 'c846120190813152015352135.jpg', '/uploads/wap/spread/poster/c846120190813152015352135.jpg', '/uploads/wap/spread/poster/c846120190813152015352135.jpg', '75989', 'image/jpeg', 1, 1565680815, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1131, '1359a20190813152120803670.jpg', '/uploads/wap/spread/poster/1359a20190813152120803670.jpg', '/uploads/wap/spread/poster/1359a20190813152120803670.jpg', '82959', 'image/jpeg', 1, 1565680880, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1132, '17a3120190813152120985638.jpg', '/uploads/wap/spread/poster/17a3120190813152120985638.jpg', '/uploads/wap/spread/poster/17a3120190813152120985638.jpg', '55333', 'image/jpeg', 1, 1565680880, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1133, '3f00f20190813152120871488.jpg', '/uploads/wap/spread/poster/3f00f20190813152120871488.jpg', '/uploads/wap/spread/poster/3f00f20190813152120871488.jpg', '75989', 'image/jpeg', 1, 1565680880, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1134, '00ec52019081315230832415.jpg', '/uploads/wap/spread/poster/00ec52019081315230832415.jpg', '/uploads/wap/spread/poster/00ec52019081315230832415.jpg', '82959', 'image/jpeg', 1, 1565680988, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1135, '1cc8a20190813152308142141.jpg', '/uploads/wap/spread/poster/1cc8a20190813152308142141.jpg', '/uploads/wap/spread/poster/1cc8a20190813152308142141.jpg', '55333', 'image/jpeg', 1, 1565680988, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1136, 'b132e20190813152308972825.jpg', '/uploads/wap/spread/poster/b132e20190813152308972825.jpg', '/uploads/wap/spread/poster/b132e20190813152308972825.jpg', '75989', 'image/jpeg', 1, 1565680988, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1137, '4f1f220190813152313628797.jpg', '/uploads/wap/spread/poster/4f1f220190813152313628797.jpg', '/uploads/wap/spread/poster/4f1f220190813152313628797.jpg', '82959', 'image/jpeg', 1, 1565680993, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1138, '1f87a20190813152313158896.jpg', '/uploads/wap/spread/poster/1f87a20190813152313158896.jpg', '/uploads/wap/spread/poster/1f87a20190813152313158896.jpg', '55333', 'image/jpeg', 1, 1565680993, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1139, 'fc39420190813152313895150.jpg', '/uploads/wap/spread/poster/fc39420190813152313895150.jpg', '/uploads/wap/spread/poster/fc39420190813152313895150.jpg', '75989', 'image/jpeg', 1, 1565680993, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1140, '3_955_0_product.jpg', '/uploads/routine/product/3_955_0_product.jpg', '/uploads/routine/product/3_955_0_product.jpg', '49092', 'image/jpeg', 1, 1565681005, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1141, '7_955_0_product.jpg', '/uploads/routine/product/7_955_0_product.jpg', '/uploads/routine/product/7_955_0_product.jpg', '50025', 'image/jpeg', 1, 1565681012, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1142, '8_955_0_product.jpg', '/uploads/routine/product/8_955_0_product.jpg', '/uploads/routine/product/8_955_0_product.jpg', '48602', 'image/jpeg', 1, 1565681490, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1143, '2_955_0_product.jpg', '/uploads/routine/product/2_955_0_product.jpg', '/uploads/routine/product/2_955_0_product.jpg', '49247', 'image/jpeg', 1, 1565681569, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1144, '1047_0_user_routine.jpg', '/uploads/routine/spread/code/1047_0_user_routine.jpg', '/uploads/routine/spread/code/1047_0_user_routine.jpg', '49666', 'image/jpeg', 1, 1565684834, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1145, '23fc42019081316271454086.jpg', '/uploads/routine/spread/poster/23fc42019081316271454086.jpg', '/uploads/routine/spread/poster/23fc42019081316271454086.jpg', '81907', 'image/jpeg', 1, 1565684834, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1146, '5d40920190813162714983793.jpg', '/uploads/routine/spread/poster/5d40920190813162714983793.jpg', '/uploads/routine/spread/poster/5d40920190813162714983793.jpg', '54281', 'image/jpeg', 1, 1565684834, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1147, '44feb20190813162715424606.jpg', '/uploads/routine/spread/poster/44feb20190813162715424606.jpg', '/uploads/routine/spread/poster/44feb20190813162715424606.jpg', '74928', 'image/jpeg', 1, 1565684835, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1148, '9_1047_0_product.jpg', '/uploads/routine/product/9_1047_0_product.jpg', '/uploads/routine/product/9_1047_0_product.jpg', '49427', 'image/jpeg', 1, 1565684878, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1149, '3_882_0_bargain_share_wap.jpg', '/uploads/qrcode/3_882_0_bargain_share_wap.jpg', '/uploads/qrcode/3_882_0_bargain_share_wap.jpg', '812', 'image/jpeg', 1, 1565685004, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1150, 'c88d820190813163005738195.jpg', '/uploads/wap/activity/bargain/poster/c88d820190813163005738195.jpg', '/uploads/wap/activity/bargain/poster/c88d820190813163005738195.jpg', '50809', 'image/jpeg', 1, 1565685005, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1151, '47e3320190813164734983108.jpg', '/uploads/wap/spread/poster/47e3320190813164734983108.jpg', '/uploads/wap/spread/poster/47e3320190813164734983108.jpg', '82343', 'image/jpeg', 1, 1565686054, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1152, '8e68c2019081316473427010.jpg', '/uploads/wap/spread/poster/8e68c2019081316473427010.jpg', '/uploads/wap/spread/poster/8e68c2019081316473427010.jpg', '54694', 'image/jpeg', 1, 1565686054, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1153, '05ee420190813164734538417.jpg', '/uploads/wap/spread/poster/05ee420190813164734538417.jpg', '/uploads/wap/spread/poster/05ee420190813164734538417.jpg', '75355', 'image/jpeg', 1, 1565686054, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1154, 'd1ff120190813165431257530.jpg', '/uploads/wap/activity/bargain/poster/d1ff120190813165431257530.jpg', '/uploads/wap/activity/bargain/poster/d1ff120190813165431257530.jpg', '50585', 'image/jpeg', 1, 1565686471, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1155, '69cd220190813165440701612.jpg', '/uploads/wap/activity/bargain/poster/69cd220190813165440701612.jpg', '/uploads/wap/activity/bargain/poster/69cd220190813165440701612.jpg', '50585', 'image/jpeg', 1, 1565686480, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1156, '8c66b20190813165457295263.jpg', '/uploads/wap/activity/bargain/poster/8c66b20190813165457295263.jpg', '/uploads/wap/activity/bargain/poster/8c66b20190813165457295263.jpg', '50585', 'image/jpeg', 1, 1565686497, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1157, '7985620190813165508515056.jpg', '/uploads/wap/activity/bargain/poster/7985620190813165508515056.jpg', '/uploads/wap/activity/bargain/poster/7985620190813165508515056.jpg', '50585', 'image/jpeg', 1, 1565686508, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1158, '8e44320190813165520983930.jpg', '/uploads/wap/activity/bargain/poster/8e44320190813165520983930.jpg', '/uploads/wap/activity/bargain/poster/8e44320190813165520983930.jpg', '50585', 'image/jpeg', 1, 1565686520, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1159, '3_1019_0_bargain_share_wap.jpg', '/uploads/qrcode/3_1019_0_bargain_share_wap.jpg', '/uploads/qrcode/3_1019_0_bargain_share_wap.jpg', '918', 'image/jpeg', 1, 1565687129, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1160, '856fc20190813170529971403.jpg', '/uploads/wap/activity/bargain/poster/856fc20190813170529971403.jpg', '/uploads/wap/activity/bargain/poster/856fc20190813170529971403.jpg', '50517', 'image/jpeg', 1, 1565687129, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1161, '1050_0_user_wap.jpg', '/uploads/qrcode/1050_0_user_wap.jpg', '/uploads/qrcode/1050_0_user_wap.jpg', '507', 'image/jpeg', 1, 1565687313, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1162, 'b99d120190813170833643072.jpg', '/uploads/wap/spread/poster/b99d120190813170833643072.jpg', '/uploads/wap/spread/poster/b99d120190813170833643072.jpg', '82177', 'image/jpeg', 1, 1565687313, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1163, 'da3fd20190813170833723331.jpg', '/uploads/wap/spread/poster/da3fd20190813170833723331.jpg', '/uploads/wap/spread/poster/da3fd20190813170833723331.jpg', '54546', 'image/jpeg', 1, 1565687313, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1164, '236f120190813170833559161.jpg', '/uploads/wap/spread/poster/236f120190813170833559161.jpg', '/uploads/wap/spread/poster/236f120190813170833559161.jpg', '75209', 'image/jpeg', 1, 1565687313, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1165, '7900720190813171322753912.jpg', '/uploads/wap/spread/poster/7900720190813171322753912.jpg', '/uploads/wap/spread/poster/7900720190813171322753912.jpg', '82177', 'image/jpeg', 1, 1565687602, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1166, 'b32e820190813171322204686.jpg', '/uploads/wap/spread/poster/b32e820190813171322204686.jpg', '/uploads/wap/spread/poster/b32e820190813171322204686.jpg', '54546', 'image/jpeg', 1, 1565687602, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1167, '4734420190813171322101422.jpg', '/uploads/wap/spread/poster/4734420190813171322101422.jpg', '/uploads/wap/spread/poster/4734420190813171322101422.jpg', '75209', 'image/jpeg', 1, 1565687602, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1168, '4e3396f4248e9e5ef2eab5505216ade0.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/4e3396f4248e9e5ef2eab5505216ade0.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/4e3396f4248e9e5ef2eab5505216ade0.jpg', '19245', 'image/jpeg', 9, 1565687843, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1169, '4e3396f4248e9e5ef2eab5505216ade0.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/4e3396f4248e9e5ef2eab5505216ade0.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/4e3396f4248e9e5ef2eab5505216ade0.jpg', '19245', 'image/jpeg', 9, 1565687843, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1170, '5653627e73313cf61c9620725c45a376.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/5653627e73313cf61c9620725c45a376.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/5653627e73313cf61c9620725c45a376.jpg', '6641', 'image/jpeg', 9, 1565687843, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1171, '1d9d4158d2d7c7f0466e78207246e845.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/1d9d4158d2d7c7f0466e78207246e845.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/1d9d4158d2d7c7f0466e78207246e845.jpg', '36653', 'image/jpeg', 9, 1565687843, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1172, '3f9bfd12b76f290d3ed82ea44ebb399a.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/3f9bfd12b76f290d3ed82ea44ebb399a.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/3f9bfd12b76f290d3ed82ea44ebb399a.jpg', '14501', 'image/jpeg', 9, 1565687844, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1173, 'e8c9d50e6b7cef371fe742ab08abd6a4.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/e8c9d50e6b7cef371fe742ab08abd6a4.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/e8c9d50e6b7cef371fe742ab08abd6a4.jpg', '29431', 'image/jpeg', 9, 1565687844, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1174, 'e882d4dffdca67b65a7a1e66fb209c4c.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/e882d4dffdca67b65a7a1e66fb209c4c.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/e882d4dffdca67b65a7a1e66fb209c4c.jpg', '147861', 'image/jpeg', 9, 1565687844, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1175, 'feb565a57f5d42c370c54df7bdacb050.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/feb565a57f5d42c370c54df7bdacb050.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/feb565a57f5d42c370c54df7bdacb050.jpg', '68050', 'image/jpeg', 9, 1565687844, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1176, '12709ee798ac2dd5c21d7ab030aa4e13.png', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/12709ee798ac2dd5c21d7ab030aa4e13.png', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/12709ee798ac2dd5c21d7ab030aa4e13.png', '428042', 'image/png', 9, 1565687844, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1177, '5cc24febd1722f8c7ec7d5cf74262743.png', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/5cc24febd1722f8c7ec7d5cf74262743.png', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/5cc24febd1722f8c7ec7d5cf74262743.png', '808887', 'image/png', 9, 1565687844, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1178, '28ccd5e15404129a793045f57049f149.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/28ccd5e15404129a793045f57049f149.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/28ccd5e15404129a793045f57049f149.jpg', '226404', 'image/jpeg', 9, 1565687845, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1179, '42cc797e7005e47baf26cc33655b4667.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/42cc797e7005e47baf26cc33655b4667.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/42cc797e7005e47baf26cc33655b4667.jpg', '51540', 'image/jpeg', 9, 1565687845, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1180, '0a8d0d2e2cb85c94c0d5380058603c56.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/0a8d0d2e2cb85c94c0d5380058603c56.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/0a8d0d2e2cb85c94c0d5380058603c56.jpg', '112097', 'image/jpeg', 9, 1565687845, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1181, '26b2896f313fb594884fb992e33c5fa8.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/26b2896f313fb594884fb992e33c5fa8.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/26b2896f313fb594884fb992e33c5fa8.jpg', '75331', 'image/jpeg', 9, 1565687845, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1182, '7d1991d9b7bf33e84782c6cd942224f6.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/7d1991d9b7bf33e84782c6cd942224f6.jpg', 'http://kaifa.crmeb.net/uploads/attach/2019/08/13/7d1991d9b7bf33e84782c6cd942224f6.jpg', '94600', 'image/jpeg', 9, 1565687845, 1, 1); +INSERT INTO `yx_system_attachment` VALUES (1183, 'fc49020190813173926971674.jpg', '/uploads/wap/activity/bargain/poster/fc49020190813173926971674.jpg', '/uploads/wap/activity/bargain/poster/fc49020190813173926971674.jpg', '50585', 'image/jpeg', 1, 1565689166, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1184, '9b8b520190813173933680624.jpg', '/uploads/wap/activity/bargain/poster/9b8b520190813173933680624.jpg', '/uploads/wap/activity/bargain/poster/9b8b520190813173933680624.jpg', '50585', 'image/jpeg', 1, 1565689173, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1185, 'a96d320190813173945331757.jpg', '/uploads/wap/activity/bargain/poster/a96d320190813173945331757.jpg', '/uploads/wap/activity/bargain/poster/a96d320190813173945331757.jpg', '50585', 'image/jpeg', 1, 1565689185, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1186, '8_1054_0_product.jpg', '/uploads/routine/product/8_1054_0_product.jpg', '/uploads/routine/product/8_1054_0_product.jpg', '50250', 'image/jpeg', 1, 1565690275, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1187, '7_706_0_product.jpg', '/uploads/routine/product/7_706_0_product.jpg', '/uploads/routine/product/7_706_0_product.jpg', '49417', 'image/jpeg', 1, 1565693728, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1188, '9_1067_0_product.jpg', '/uploads/routine/product/9_1067_0_product.jpg', '/uploads/routine/product/9_1067_0_product.jpg', '49450', 'image/jpeg', 1, 1565704981, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1189, '2_1067_0_product.jpg', '/uploads/routine/product/2_1067_0_product.jpg', '/uploads/routine/product/2_1067_0_product.jpg', '47542', 'image/jpeg', 1, 1565705091, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1190, '11_1055_0_product.jpg', '/uploads/routine/product/11_1055_0_product.jpg', '/uploads/routine/product/11_1055_0_product.jpg', '47620', 'image/jpeg', 1, 1565705123, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1191, '11_1068_0_product.jpg', '/uploads/routine/product/11_1068_0_product.jpg', '/uploads/routine/product/11_1068_0_product.jpg', '50204', 'image/jpeg', 1, 1565705863, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1192, '2_1080_0_product.jpg', '/uploads/routine/product/2_1080_0_product.jpg', '/uploads/routine/product/2_1080_0_product.jpg', '48454', 'image/jpeg', 1, 1565735982, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1193, '9_1081_0_product.jpg', '/uploads/routine/product/9_1081_0_product.jpg', '/uploads/routine/product/9_1081_0_product.jpg', '49207', 'image/jpeg', 1, 1565737409, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1194, '1083_0_user_wap.jpg', '/uploads/qrcode/1083_0_user_wap.jpg', '/uploads/qrcode/1083_0_user_wap.jpg', '516', 'image/jpeg', 1, 1565740922, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1195, '57cd320190814080202137284.jpg', '/uploads/wap/spread/poster/57cd320190814080202137284.jpg', '/uploads/wap/spread/poster/57cd320190814080202137284.jpg', '82649', 'image/jpeg', 1, 1565740922, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1196, 'db98d20190814080202710804.jpg', '/uploads/wap/spread/poster/db98d20190814080202710804.jpg', '/uploads/wap/spread/poster/db98d20190814080202710804.jpg', '55020', 'image/jpeg', 1, 1565740922, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1197, 'cedeb20190814080202903131.jpg', '/uploads/wap/spread/poster/cedeb20190814080202903131.jpg', '/uploads/wap/spread/poster/cedeb20190814080202903131.jpg', '75681', 'image/jpeg', 1, 1565740922, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1198, 'f5bf02019081408194197811.jpg', '/uploads/wap/spread/poster/f5bf02019081408194197811.jpg', '/uploads/wap/spread/poster/f5bf02019081408194197811.jpg', '82205', 'image/jpeg', 1, 1565741981, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1199, 'b06b520190814081941398479.jpg', '/uploads/wap/spread/poster/b06b520190814081941398479.jpg', '/uploads/wap/spread/poster/b06b520190814081941398479.jpg', '54568', 'image/jpeg', 1, 1565741981, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1200, '8c19f20190814081941113779.jpg', '/uploads/wap/spread/poster/8c19f20190814081941113779.jpg', '/uploads/wap/spread/poster/8c19f20190814081941113779.jpg', '75222', 'image/jpeg', 1, 1565741981, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1201, '7b83b4ca2001251426bc68934cd15a68.jpeg', '/uploads/store/comment/20190814/7b83b4ca2001251426bc68934cd15a68.jpeg', '/./uploads/store/comment/20190814/s_7b83b4ca2001251426bc68934cd15a68.jpeg', '102985', 'image/jpeg', 1, 1565742047, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1202, '00ee55387e99fe382ad73a8a0d6cf395.jpeg', '/uploads/store/comment/20190814/00ee55387e99fe382ad73a8a0d6cf395.jpeg', '/./uploads/store/comment/20190814/s_00ee55387e99fe382ad73a8a0d6cf395.jpeg', '102985', 'image/jpeg', 1, 1565742153, 1, 2); +INSERT INTO `yx_system_attachment` VALUES (1203, 'd7b7bafb3a2994d0910ba747dad36f9b.jpeg', '/uploads/store/comment/20190814/d7b7bafb3a2994d0910ba747dad36f9b.jpeg', '/./uploads/store/comment/20190814/s_d7b7bafb3a2994d0910ba747dad36f9b.jpeg', '102985', 'image/jpeg', 1, 1565743086, 1, 2); + +-- ---------------------------- +-- Table structure for yx_system_attachment_category +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_attachment_category`; +CREATE TABLE `yx_system_attachment_category` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `pid` int(11) NULL DEFAULT 0 COMMENT '父级ID', + `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分类名称', + `enname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类目录', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `id`(`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '附件分类表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_system_config +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_config`; +CREATE TABLE `yx_system_config` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '配置id', + `menu_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字段名称', + `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '类型(文本框,单选按钮...)', + `input_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'input' COMMENT '表单类型', + `config_tab_id` int(10) UNSIGNED NOT NULL COMMENT '配置分类id', + `parameter` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规则 单选框和多选框', + `upload_type` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '上传文件格式1单图2多图3文件', + `required` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规则', + `width` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '多行文本框的宽度', + `high` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '多行文框的高度', + `value` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '默认值', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '配置名称', + `desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '配置简介', + `sort` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否隐藏', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 157 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '配置表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_config +-- ---------------------------- +INSERT INTO `yx_system_config` VALUES (1, 'site_name', 'text', 'input', 1, '', 0, 'required:true', 100, 0, '\"\"', '网站名称', '网站名称', 0, 1); +INSERT INTO `yx_system_config` VALUES (2, 'site_url', 'text', 'input', 1, '', 0, 'required:true,url:true', 100, 0, '\"http://api.testxcx.com\"', '网站地址', '网站地址', 0, 1); +INSERT INTO `yx_system_config` VALUES (3, 'site_logo', 'upload', NULL, 1, NULL, 1, NULL, 0, 0, '\"\"', '后台LOGO', '左上角logo,建议尺寸[170*50]', 0, 1); +INSERT INTO `yx_system_config` VALUES (4, 'site_phone', 'text', 'input', 1, '', 0, '', 100, 0, '\"\"', '联系电话', '联系电话', 0, 1); +INSERT INTO `yx_system_config` VALUES (5, 'seo_title', 'text', 'input', 1, '', 0, 'required:true', 100, 0, '\"\"', 'SEO标题', 'SEO标题', 0, 1); +INSERT INTO `yx_system_config` VALUES (6, 'site_email', 'text', 'input', 1, '', 0, 'email:true', 100, 0, '\"\"', '联系邮箱', '联系邮箱', 0, 1); +INSERT INTO `yx_system_config` VALUES (7, 'site_qq', 'text', 'input', 1, '', 0, 'qq:true', 100, 0, '\"\"', '联系QQ', '联系QQ', 0, 1); +INSERT INTO `yx_system_config` VALUES (8, 'site_close', 'radio', 'input', 1, '0=>开启\n1=>PC端关闭\n2=>WAP端关闭(含微信)\n3=>全部关闭', 0, '', 0, 0, '\"0\"', '网站关闭', '网站后台、商家中心不受影响。关闭网站也可访问', 0, 2); +INSERT INTO `yx_system_config` VALUES (9, 'close_system', 'radio', 'input', 1, '0=>开启\n1=>关闭', 0, '', 0, 0, '\"0\"', '关闭后台', '关闭后台', 0, 2); +INSERT INTO `yx_system_config` VALUES (10, 'wechat_name', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\"\"', '公众号名称', '公众号的名称', 0, 1); +INSERT INTO `yx_system_config` VALUES (11, 'wechat_id', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\"\"', '微信号', '微信号', 0, 1); +INSERT INTO `yx_system_config` VALUES (12, 'wechat_sourceid', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\"\"', '公众号原始id', '公众号原始id', 0, 1); +INSERT INTO `yx_system_config` VALUES (13, 'wechat_appid', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\"\"', 'AppID', 'AppID', 0, 1); +INSERT INTO `yx_system_config` VALUES (14, 'wechat_appsecret', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\"\"', 'AppSecret', 'AppSecret', 0, 1); +INSERT INTO `yx_system_config` VALUES (15, 'wechat_token', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\"\"', '微信验证TOKEN', '微信验证TOKEN', 0, 1); +INSERT INTO `yx_system_config` VALUES (16, 'wechat_encode', 'radio', 'input', 2, '0=>明文模式\n1=>兼容模式\n2=>安全模式', 0, '', 0, 0, '\"0\"', '消息加解密方式', '如需使用安全模式请在管理中心修改,仅限服务号和认证订阅号', 0, 1); +INSERT INTO `yx_system_config` VALUES (17, 'wechat_encodingaeskey', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\"\"', 'EncodingAESKey', '公众号消息加解密Key,在使用安全模式情况下要填写该值,请先在管理中心修改,然后填写该值,仅限服务号和认证订阅号', 0, 1); +INSERT INTO `yx_system_config` VALUES (18, 'wechat_share_img', 'upload', NULL, 2, NULL, 1, NULL, 0, 0, '\"\"', '微信分享图片', '若填写此图片地址,则分享网页出去时会分享此图片。可有效防止分享图片变形', 0, 1); +INSERT INTO `yx_system_config` VALUES (19, 'wechat_qrcode', 'upload', 'input', 2, '', 1, '', 0, 0, '\"\"', '公众号二维码', '您的公众号二维码', 0, 1); +INSERT INTO `yx_system_config` VALUES (20, 'wechat_type', 'radio', 'input', 2, '0=>服务号\n1=>订阅号', 0, '', 0, 0, '\"0\"', '公众号类型', '公众号的类型', 0, 1); +INSERT INTO `yx_system_config` VALUES (21, 'wechat_share_title', 'text', 'input', 2, NULL, NULL, 'required:true', 100, 0, '\"CRMEB\"', '微信分享标题', '微信分享标题', 0, 1); +INSERT INTO `yx_system_config` VALUES (22, 'wechat_share_synopsis', 'textarea', NULL, 2, NULL, NULL, NULL, 100, 5, '\"CRMEB\"', '微信分享简介', '微信分享简介', 0, 1); +INSERT INTO `yx_system_config` VALUES (23, 'pay_weixin_appid', 'text', 'input', 4, '', 0, '', 100, 0, '\"\"', 'Appid', '微信公众号身份的唯一标识。审核通过后,在微信发送的邮件中查看。', 0, 1); +INSERT INTO `yx_system_config` VALUES (24, 'pay_weixin_appsecret', 'text', 'input', 4, '', 0, '', 100, 0, '\"\"', 'Appsecret', 'JSAPI接口中获取openid,审核后在公众平台开启开发模式后可查看。', 0, 1); +INSERT INTO `yx_system_config` VALUES (25, 'pay_weixin_mchid', 'text', 'input', 4, '', 0, '', 100, 0, '\"\"', 'Mchid', '受理商ID,身份标识', 0, 1); +INSERT INTO `yx_system_config` VALUES (26, 'pay_weixin_client_cert', 'upload', 'input', 4, '', 3, '', 0, 0, '\"\"', '微信支付证书', '微信支付证书,在微信商家平台中可以下载!文件名一般为apiclient_cert.pem', 0, 1); +INSERT INTO `yx_system_config` VALUES (27, 'pay_weixin_client_key', 'upload', 'input', 4, '', 3, '', 0, 0, '\"\"', '微信支付证书密钥', '微信支付证书密钥,在微信商家平台中可以下载!文件名一般为apiclient_key.pem', 0, 1); +INSERT INTO `yx_system_config` VALUES (28, 'pay_weixin_key', 'text', 'input', 4, '', 0, '', 100, 0, '\"\"', 'Key', '商户支付密钥Key。审核通过后,在微信发送的邮件中查看。', 0, 1); +INSERT INTO `yx_system_config` VALUES (29, 'pay_weixin_open', 'radio', 'input', 4, '1=>开启\n0=>关闭', 0, '', 0, 0, '\"1\"', '开启', '是否启用微信支付', 0, 1); +INSERT INTO `yx_system_config` VALUES (31, 'store_postage', 'text', 'input', 10, '', 0, 'number:true,min:0', 100, 0, '\"0\"', '邮费基础价', '商品邮费基础价格,最终金额为(基础价 + 商品1邮费 + 商品2邮费)', 0, 1); +INSERT INTO `yx_system_config` VALUES (32, 'store_free_postage', 'text', 'input', 5, '', 0, 'number:true,min:-1', 100, 0, '\"\"', '满额包邮', '商城商品满多少金额即可包邮', 0, 1); +INSERT INTO `yx_system_config` VALUES (33, 'offline_postage', 'radio', 'input', 10, '0=>不包邮\n1=>包邮', 0, '', 0, 0, '\"0\"', '线下支付是否包邮', '用户选择线下支付时是否包邮', 0, 1); +INSERT INTO `yx_system_config` VALUES (34, 'integral_ratio', 'text', 'input', 11, '', 0, 'number:true', 100, 0, '\"1\"', '积分抵用比例', '积分抵用比例(1积分抵多少金额)', 0, 1); +INSERT INTO `yx_system_config` VALUES (35, 'site_service_phone', 'text', 'input', 1, '', 0, '', 100, 0, '\"\"', '客服电话', '客服联系电话', 0, 1); +INSERT INTO `yx_system_config` VALUES (44, 'store_user_min_recharge', 'text', 'input', 5, '', 0, 'required:true,number:true,min:0', 100, 0, '\"0.01\"', '用户最低充值金额', '用户单次最低充值金额', 0, 0); +INSERT INTO `yx_system_config` VALUES (45, 'site_store_admin_uids', 'text', 'input', 5, '', 0, '', 100, 0, '\"4\"', '管理员用户ID', '管理员用户ID,用于接收商城订单提醒,到微信用户中查找编号,多个英文‘,’隔开', 0, 1); +INSERT INTO `yx_system_config` VALUES (46, 'system_express_app_code', 'text', 'input', 10, '', 0, '', 100, 0, '\"\"', '快递查询密钥', '阿里云快递查询接口密钥购买地址:https://market.aliyun.com/products/56928004/cmapi021863.html', 0, 1); +INSERT INTO `yx_system_config` VALUES (47, 'main_business', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\" IT\\u79d1\\u6280 \\u4e92\\u8054\\u7f51|\\u7535\\u5b50\\u5546\\u52a1\"', '微信模板消息_主营行业', '微信公众号模板消息中选择开通的主营行业', 0, 0); +INSERT INTO `yx_system_config` VALUES (48, 'vice_business', 'text', 'input', 2, '', 0, 'required:true', 100, 0, '\"IT\\u79d1\\u6280 IT\\u8f6f\\u4ef6\\u4e0e\\u670d\\u52a1 \"', '微信模板消息_副营行业', '微信公众号模板消息中选择开通的副营行业', 0, 0); +INSERT INTO `yx_system_config` VALUES (49, 'store_brokerage_ratio', 'text', 'input', 9, '', 0, 'required:true,min:0,max:100,number:true', 100, 0, '\"80\"', '一级返佣比例', '订单交易成功后给上级返佣的比例0 - 100,例:5 = 反订单金额的5%', 5, 1); +INSERT INTO `yx_system_config` VALUES (50, 'wechat_first_sub_give_coupon', 'text', 'input', 12, '', 0, 'requred:true,digits:true,min:0', 100, 0, '\"\"', '首次关注赠送优惠券ID', '首次关注赠送优惠券ID,0为不赠送', 0, 1); +INSERT INTO `yx_system_config` VALUES (51, 'store_give_con_min_price', 'text', 'input', 12, '', 0, 'requred:true,digits:true,min:0', 100, 0, '\"0.01\"', '消费满多少赠送优惠券', '消费满多少赠送优惠券,0为不赠送', 0, 1); +INSERT INTO `yx_system_config` VALUES (52, 'store_order_give_coupon', 'text', 'input', 12, '', 0, 'requred:true,digits:true,min:0', 100, 0, '\"\"', '消费赠送优惠劵ID', '消费赠送优惠劵ID,0为不赠送', 0, 1); +INSERT INTO `yx_system_config` VALUES (53, 'user_extract_min_price', 'text', 'input', 9, '', 0, 'required:true,number:true,min:0', 100, 0, '\"100\"', '提现最低金额', '用户提现最低金额', 0, 1); +INSERT INTO `yx_system_config` VALUES (54, 'sx_sign_min_int', 'text', 'input', 11, '', 0, 'required:true,number:true,min:0', 100, 0, '\"1\"', '签到奖励最低积分', '签到奖励最低积分', 0, 1); +INSERT INTO `yx_system_config` VALUES (55, 'sx_sign_max_int', 'text', 'input', 11, '', 0, 'required:true,number:true,min:0', 100, 0, '\"5\"', '签到奖励最高积分', '签到奖励最高积分', 0, 1); +INSERT INTO `yx_system_config` VALUES (56, 'store_home_pink', 'upload', 'input', 5, '', 1, '', 0, 0, '\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190801\\/af69ee46c79ec68b578afea61b5a37e4.jpg\"', '首页拼团广告图', '首页拼团广告图', 0, 1); +INSERT INTO `yx_system_config` VALUES (57, 'about_us', 'upload', NULL, 1, NULL, 1, NULL, 0, 0, '\"\"', '关于我们', '系统的标识', 0, 2); +INSERT INTO `yx_system_config` VALUES (58, 'replenishment_num', 'text', 'input', 5, '', 0, 'required:true,number:true,min:0', 100, 0, '\"20\"', '待补货数量', '产品待补货数量低于多少时,提示补货', 0, 1); +INSERT INTO `yx_system_config` VALUES (59, 'routine_appId', 'text', 'input', 7, '', 0, '', 100, 0, '\"\"', 'appId', '小程序appID', 0, 1); +INSERT INTO `yx_system_config` VALUES (60, 'routine_appsecret', 'text', 'input', 7, '', 0, '', 100, 0, '\"\"', 'AppSecret', '小程序AppSecret', 0, 1); +INSERT INTO `yx_system_config` VALUES (61, 'api', 'text', 'input', 2, '', 0, '', 100, 0, '\"\\/api\\/wechat\\/serve\"', '接口地址', '微信接口例如:http://www.abc.com/api/wechat/serve', 0, 1); +INSERT INTO `yx_system_config` VALUES (62, 'paydir', 'textarea', 'input', 4, '', 0, '', 100, 5, '\"\"', '配置目录', '支付目录配置系统不调用提示作用', 0, 1); +INSERT INTO `yx_system_config` VALUES (73, 'routine_logo', 'upload', NULL, 7, NULL, 1, NULL, 0, 0, '\"\"', '小程序logo', '小程序logo', 0, 1); +INSERT INTO `yx_system_config` VALUES (74, 'routine_name', 'text', 'input', 7, '', 0, '', 100, 0, '\"CRMEB\"', '小程序名称', '小程序名称', 0, 1); +INSERT INTO `yx_system_config` VALUES (76, 'routine_style', 'text', 'color', 7, NULL, NULL, NULL, 100, 0, '\"#F02D5A\"', '小程序风格', '小程序颜色', 0, 1); +INSERT INTO `yx_system_config` VALUES (77, 'store_stock', 'text', 'input', 5, '', 0, '', 100, 0, '\"2\"', '警戒库存', '警戒库存提醒值', 0, 1); +INSERT INTO `yx_system_config` VALUES (85, 'stor_reason', 'textarea', 'input', 5, '', 0, '', 100, 8, '\"\\u6536\\u8d27\\u5730\\u5740\\u586b\\u9519\\u4e86\\r\\n\\u4e0e\\u63cf\\u8ff0\\u4e0d\\u7b26\\r\\n\\u4fe1\\u606f\\u586b\\u9519\\u4e86\\uff0c\\u91cd\\u65b0\\u62cd\\r\\n\\u6536\\u5230\\u5546\\u54c1\\u635f\\u574f\\u4e86\\r\\n\\u672a\\u6309\\u9884\\u5b9a\\u65f6\\u95f4\\u53d1\\u8d27\\r\\n\\u5176\\u5b83\\u539f\\u56e0\"', '退货理由', '配置退货理由,一行一个理由', 0, 1); +INSERT INTO `yx_system_config` VALUES (87, 'store_brokerage_two', 'text', 'input', 9, '', 0, 'required:true,min:0,max:100,number:true', 100, 0, '\"60\"', '二级返佣比例', '订单交易成功后给上级返佣的比例0 - 100,例:5 = 反订单金额的5%', 4, 1); +INSERT INTO `yx_system_config` VALUES (88, 'store_brokerage_statu', 'radio', 'input', 9, '1=>指定分销\n2=>人人分销', 0, '', 0, 0, '\"2\"', '分销模式', '人人分销默认每个人都可以分销,制定人分销后台制定人开启分销', 10, 1); +INSERT INTO `yx_system_config` VALUES (89, 'pay_routine_appid', 'text', 'input', 14, '', 0, 'required:true', 100, 0, '\"\"', 'Appid', '小程序Appid', 0, 1); +INSERT INTO `yx_system_config` VALUES (90, 'pay_routine_appsecret', 'text', 'input', 14, '', 0, 'required:true', 100, 0, '\"\"', 'Appsecret', '小程序Appsecret', 0, 1); +INSERT INTO `yx_system_config` VALUES (91, 'pay_routine_mchid', 'text', 'input', 14, '', 0, 'required:true', 100, 0, '\"\"', 'Mchid', '商户号', 0, 1); +INSERT INTO `yx_system_config` VALUES (92, 'pay_routine_key', 'text', 'input', 14, '', 0, 'required:true', 100, 0, '\"\"', 'Key', '商户key', 0, 1); +INSERT INTO `yx_system_config` VALUES (93, 'pay_routine_client_cert', 'upload', 'input', 14, '', 3, '', 0, 0, '\"\"', '小程序支付证书', '小程序支付证书', 0, 1); +INSERT INTO `yx_system_config` VALUES (94, 'pay_routine_client_key', 'upload', 'input', 14, '', 3, '', 0, 0, '\"\"', '小程序支付证书密钥', '小程序支付证书密钥', 0, 1); +INSERT INTO `yx_system_config` VALUES (98, 'wechat_avatar', 'upload', 'input', 2, '', 1, '', 0, 0, '\"\"', '公众号logo', '公众号logo', 0, 1); +INSERT INTO `yx_system_config` VALUES (99, 'user_extract_bank', 'textarea', 'input', 9, '', 0, '', 100, 5, '\"\\u4e2d\\u56fd\\u519c\\u884c\\r\\n\\u4e2d\\u56fd\\u5efa\\u8bbe\\u94f6\\u884c\\r\\n\\u5de5\\u5546\\u94f6\\u884c\"', '提现银行卡', '提现银行卡,每个银行换行', 0, 1); +INSERT INTO `yx_system_config` VALUES (100, 'fast_info', 'text', 'input', 16, NULL, NULL, '', 100, NULL, '\"\\u4e0a\\u767e\\u79cd\\u5546\\u54c1\\u5206\\u7c7b\\u4efb\\u60a8\\u9009\\u62e9\"', '快速选择简介', '首页配置快速选择简介', 0, 1); +INSERT INTO `yx_system_config` VALUES (101, 'bast_info', 'text', 'input', 16, NULL, NULL, '', 100, NULL, '\"\\u8001\\u674e\\u8bda\\u610f\\u63a8\\u8350\\u54c1\\u8d28\\u5546\\u54c1\"', '精品推荐简介', '首页配置精品推荐简介', 0, 1); +INSERT INTO `yx_system_config` VALUES (102, 'first_info', 'text', 'input', 16, NULL, NULL, '', 100, NULL, '\"\\u591a\\u4e2a\\u4f18\\u8d28\\u5546\\u54c1\\u6700\\u65b0\\u4e0a\\u67b6\"', '首发新品简介', '首页配置首发新品简介', 0, 1); +INSERT INTO `yx_system_config` VALUES (103, 'sales_info', 'text', 'input', 16, NULL, NULL, '', 100, NULL, '\"\\u5e93\\u5b58\\u5546\\u54c1\\u4f18\\u60e0\\u4fc3\\u9500\\u6d3b\\u52a8\"', '促销单品简介', '首页配置促销单品简介', 0, 1); +INSERT INTO `yx_system_config` VALUES (104, 'fast_number', 'text', 'input', 16, NULL, NULL, 'required:true,digits:true,min:1', 100, NULL, '\"10\"', '快速选择分类个数', '首页配置快速选择分类个数', 0, 1); +INSERT INTO `yx_system_config` VALUES (105, 'bast_number', 'text', 'input', 16, NULL, NULL, 'required:true,digits:true,min:1', 100, NULL, '\"10\"', '精品推荐个数', '首页配置精品推荐个数', 0, 1); +INSERT INTO `yx_system_config` VALUES (106, 'first_number', 'text', 'input', 16, NULL, NULL, 'required:true,digits:true,min:1', 100, NULL, '\"10\"', '首发新品个数', '首页配置首发新品个数', 0, 1); +INSERT INTO `yx_system_config` VALUES (107, 'routine_index_logo', 'upload', NULL, 5, NULL, 1, NULL, NULL, NULL, '\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190801\\/deb30359d22c0b80f3cece86cb462104.png\"', '主页logo图标', '主页logo图标尺寸(127*45)', 0, 1); +INSERT INTO `yx_system_config` VALUES (108, 'upload_type', 'radio', 'input', 17, '1=>本地存储\n2=>七牛云存储\n3=>阿里云OSS\n4=>腾讯COS', NULL, NULL, NULL, NULL, '\"1\"', '上传类型', '文件上传的类型', 0, 1); +INSERT INTO `yx_system_config` VALUES (109, 'uploadUrl', 'text', 'input', 17, NULL, NULL, 'url:true', 100, NULL, '\"\"', '空间域名 Domain', '空间域名 Domain', 0, 1); +INSERT INTO `yx_system_config` VALUES (110, 'accessKey', 'text', 'input', 17, NULL, NULL, '', 100, NULL, '\"\"', 'accessKey', 'accessKey', 0, 1); +INSERT INTO `yx_system_config` VALUES (111, 'secretKey', 'text', 'input', 17, NULL, NULL, '', 100, NULL, '\"\"', 'secretKey', 'secretKey', 0, 1); +INSERT INTO `yx_system_config` VALUES (112, 'storage_name', 'text', 'input', 17, NULL, NULL, '', 100, NULL, '\"\"', '存储空间名称', '存储空间名称', 0, 1); +INSERT INTO `yx_system_config` VALUES (113, 'order_cancel_time', 'text', 'input', 5, NULL, NULL, '', 100, NULL, '\"0.1\"', '普通商品未支付取消订单时间', '普通商品未支付取消订单时间,单位(小时)', 0, 1); +INSERT INTO `yx_system_config` VALUES (114, 'order_activity_time', 'text', 'input', 5, NULL, NULL, '', 100, NULL, '\"2\"', '活动商品未支付取消订单时间', '活动商品未支付取消订单时间,单位(小时)', 0, 1); +INSERT INTO `yx_system_config` VALUES (115, 'order_bargain_time', 'text', 'input', 5, NULL, NULL, NULL, 100, NULL, '\"\"', '砍价未支付取消订单时间', '砍价未支付默认取消订单时间,单位(小时),如果为0将使用默认活动取消时间,优先使用单独活动配置', 0, 1); +INSERT INTO `yx_system_config` VALUES (116, 'order_seckill_time', 'text', 'input', 5, NULL, NULL, NULL, 100, NULL, '\"\"', '秒杀未支付订单取消时间', '秒杀未支付订单取消时间,单位(小时),如果为0将使用默认活动取消时间,优先使用单独活动配置', 0, 1); +INSERT INTO `yx_system_config` VALUES (117, 'order_pink_time', 'text', 'input', 5, NULL, NULL, NULL, 100, NULL, '\"\"', '拼团未支付取消订单时间', '拼团未支付取消订单时间,单位(小时),如果为0将使用默认活动取消时间,优先使用单独活动配置', 0, 1); +INSERT INTO `yx_system_config` VALUES (118, 'storage_region', 'text', 'input', 17, NULL, NULL, '', 100, NULL, '\"\"', '所属地域', '所属地域(腾讯COS时填写)', 0, 1); +INSERT INTO `yx_system_config` VALUES (119, 'vip_open', 'radio', 'input', 5, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"1\"', '会员功能是否开启', '会员功能是否开启', 0, 1); +INSERT INTO `yx_system_config` VALUES (120, 'new_order_audio_link', 'upload', 'input', 5, NULL, 3, NULL, NULL, NULL, '\"\\/public\\/uploads\\/config\\/file\\/5cedd83eedba2.mp3\"', '新订单语音提示', '新订单语音提示', 0, 1); +INSERT INTO `yx_system_config` VALUES (121, 'seckill_header_banner', 'upload', 'input', 5, NULL, 1, NULL, NULL, NULL, '\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190805\\/887db984b5f1138e08e1d9b069af766e.jpg\"', '秒杀头部banner', '秒杀头部banner', 0, 1); +INSERT INTO `yx_system_config` VALUES (122, 'system_delivery_time', 'text', 'input', 5, NULL, NULL, 'required:true,digits:true,min:0', 100, NULL, '\"1\"', '自动收货时间', '系统自动收货时间(0为不设置自动收货)', 0, 1); +INSERT INTO `yx_system_config` VALUES (123, 'sms_account', 'text', 'input', 18, NULL, NULL, '', 100, NULL, '\"\"', '账号', '短信后台的登录账号', 0, 1); +INSERT INTO `yx_system_config` VALUES (137, 'sms_token', 'text', 'input', 18, NULL, NULL, '', 100, NULL, '\"\"', 'token/密码', 'token(注册时候的密码)', 0, 1); +INSERT INTO `yx_system_config` VALUES (138, 'h5_avatar', 'upload', NULL, 1, NULL, 1, NULL, 0, 0, '\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190807\\/723adbdd4e49a0f9394dfc700ab5dba3.png\"', '用户H5默认头像', '用户H5默认头像尺寸(80*80)', 0, 1); +INSERT INTO `yx_system_config` VALUES (139, 'offline_pay_status', 'radio', NULL, 5, '1=>开启\n2=>关闭', NULL, NULL, NULL, NULL, '\"2\"', '线下支付状态', '线下支付状态', 0, 1); +INSERT INTO `yx_system_config` VALUES (140, 'news_slides_limit', 'text', 'number', 1, NULL, NULL, 'required:true,digits:true,min:1', 100, NULL, '\"5\"', '新闻幻灯片限制数量', '新闻幻灯片限制数量', 0, 1); +INSERT INTO `yx_system_config` VALUES (141, 'recharge_switch', 'radio', 'input', 5, '1=>开启\n0=>关闭', NULL, NULL, NULL, NULL, '\"1\"', '充值开关', '充值开关', 0, 1); +INSERT INTO `yx_system_config` VALUES (142, 'tengxun_map_key', 'text', 'input', 10, NULL, NULL, '', 100, NULL, '', '腾讯地图KEY', '腾讯地图KEY', 0, 1); +INSERT INTO `yx_system_config` VALUES (143, 'store_self_mention', 'radio', NULL, 10, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"1\"', '是否开启门店自提', '是否开启门店自提', 0, 1); +INSERT INTO `yx_system_config` VALUES (144, 'cache_config', 'text', 'input', 19, NULL, NULL, '', 100, NULL, '\"86400\"', '网站缓存时间', '配置全局缓存时间(秒),默认留空为永久缓存', 0, 1); +INSERT INTO `yx_system_config` VALUES (145, 'pay_success_printing_switch', 'radio', NULL, 21, '0=>关\n1=>开', NULL, NULL, NULL, NULL, '\"1\"', '支付成功订单打印开关', '支付成功订单打印开关', 0, 1); +INSERT INTO `yx_system_config` VALUES (146, 'develop_id', 'text', 'input', 21, NULL, NULL, '', 100, NULL, '\"\"', '开发者ID', '易联云开发者ID', 0, 1); +INSERT INTO `yx_system_config` VALUES (147, 'printing_api_key', 'text', 'input', 21, NULL, NULL, '', 100, NULL, '\"\"', '应用密钥', '易联应用密钥', 0, 1); +INSERT INTO `yx_system_config` VALUES (148, 'printing_client_id', 'text', 'input', 21, NULL, NULL, '', 100, NULL, '\"\"', '应用ID', '易联应用ID', 0, 1); +INSERT INTO `yx_system_config` VALUES (149, 'terminal_number', 'text', 'input', 21, NULL, NULL, '', 100, NULL, '\"\"', '终端号', '易联云打印机终端号', 0, 1); +INSERT INTO `yx_system_config` VALUES (150, 'lower_order_switch', 'radio', NULL, 20, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"0\"', '支付成功提醒开关', '支付成功提醒开关', 0, 1); +INSERT INTO `yx_system_config` VALUES (151, 'deliver_goods_switch', 'radio', NULL, 20, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"0\"', '发货提醒开关', '发货提醒开关', 0, 1); +INSERT INTO `yx_system_config` VALUES (152, 'confirm_take_over_switch', 'radio', NULL, 20, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"0\"', '确认收货提醒开关', '确认收货提醒开关', 0, 1); +INSERT INTO `yx_system_config` VALUES (153, 'admin_lower_order_switch', 'radio', NULL, 20, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"0\"', '用户下单管理员提醒开关', '用户下单管理员提醒开关', 0, 1); +INSERT INTO `yx_system_config` VALUES (154, 'admin_pay_success_switch', 'radio', NULL, 20, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"0\"', '用户支付成功管理员提醒开关', '用户支付成功管理员提醒开关', 0, 1); +INSERT INTO `yx_system_config` VALUES (155, 'admin_refund_switch', 'radio', NULL, 20, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"0\"', '用户退款管理员提醒开关', '用户退款管理员提醒开关', 0, 1); +INSERT INTO `yx_system_config` VALUES (156, 'admin_confirm_take_over_switch', 'radio', NULL, 20, '0=>关闭\n1=>开启', NULL, NULL, NULL, NULL, '\"0\"', '用户确认收货管理员短信提醒', '用户确认收货管理员短信提醒', 0, 1); + +-- ---------------------------- +-- Table structure for yx_system_config_tab +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_config_tab`; +CREATE TABLE `yx_system_config_tab` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '配置分类id', + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '配置分类名称', + `eng_title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '配置分类英文名称', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '配置分类状态', + `info` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '配置分类是否显示', + `icon` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标', + `type` int(2) NULL DEFAULT 0 COMMENT '配置类型', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '配置分类表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_config_tab +-- ---------------------------- +INSERT INTO `yx_system_config_tab` VALUES (1, '基础配置', 'basics', 1, 0, 'cog', 0); +INSERT INTO `yx_system_config_tab` VALUES (2, '公众号配置', 'wechat', 1, 0, 'weixin', 1); +INSERT INTO `yx_system_config_tab` VALUES (4, '公众号支付配置', 'pay', 1, 0, 'jpy', 2); +INSERT INTO `yx_system_config_tab` VALUES (5, '商城配置', 'store', 1, 0, 'shopping-cart', 0); +INSERT INTO `yx_system_config_tab` VALUES (7, '小程序配置', 'routine', 1, 0, 'weixin', 1); +INSERT INTO `yx_system_config_tab` VALUES (9, '分销配置', 'fenxiao', 1, 0, 'sitemap', 3); +INSERT INTO `yx_system_config_tab` VALUES (10, '物流配置', 'express', 1, 0, 'motorcycle', 0); +INSERT INTO `yx_system_config_tab` VALUES (11, '积分配置', 'point', 1, 0, 'powerpoint-o', 3); +INSERT INTO `yx_system_config_tab` VALUES (12, '优惠券配置', 'coupon', 1, 0, 'heartbeat', 3); +INSERT INTO `yx_system_config_tab` VALUES (14, '小程序支付配置', 'routine_pay', 1, 0, 'jpy', 2); +INSERT INTO `yx_system_config_tab` VALUES (16, '首页配置', 'routine_index_page', 1, 1, 'home', 0); +INSERT INTO `yx_system_config_tab` VALUES (17, '文件上传配置', 'upload_set', 1, 0, 'cloud-upload', 0); +INSERT INTO `yx_system_config_tab` VALUES (18, '短信配置', 'system_sms', 1, 0, 'send', 3); +INSERT INTO `yx_system_config_tab` VALUES (19, '缓存配置', 'cache_config', 1, 0, 'cube', 0); +INSERT INTO `yx_system_config_tab` VALUES (20, '短信提醒开关', 'short_letter_switch', 1, 0, 'rss', 0); +INSERT INTO `yx_system_config_tab` VALUES (21, '小票打印配置', 'printing_deploy', 1, 0, 'plug', 0); + +-- ---------------------------- +-- Table structure for yx_system_file +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_file`; +CREATE TABLE `yx_system_file` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '文件对比ID', + `cthash` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件内容', + `filename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文价名称', + `atime` char(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '上次访问时间', + `mtime` char(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '上次修改时间', + `ctime` char(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '上次改变时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2187 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件对比表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_system_group +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_group`; +CREATE TABLE `yx_system_group` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '组合数据ID', + `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '数据组名称', + `info` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '数据提示', + `config_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '数据字段', + `fields` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '数据组字段以及类型(json数据)', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `config_name`(`config_name`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 62 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组合数据表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_group +-- ---------------------------- +INSERT INTO `yx_system_group` VALUES (37, '拼团、秒杀、砍价顶部banner图', '拼团、秒杀、砍价顶部banner图', 'routine_lovely', '[{\"name\":\"\\u56fe\\u7247\",\"title\":\"img\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u63cf\\u8ff0\",\"title\":\"comment\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (38, '砍价列表页左上小图标', '砍价列表页左上小图标', 'bargain_banner', '[{\"name\":\"banner\",\"title\":\"banner\",\"type\":\"upload\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (47, '首页分类图标', '首页分类图标', 'routine_home_menus', '[{\"name\":\"\\u5206\\u7c7b\\u540d\\u79f0\",\"title\":\"name\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u5206\\u7c7b\\u56fe\\u6807(90*90)\",\"title\":\"pic\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u5c0f\\u7a0b\\u5e8f\\u8df3\\u8f6c\\u8def\\u5f84\",\"title\":\"url\",\"type\":\"select\",\"param\":\"\\/pages\\/index\\/index=>\\u5546\\u57ce\\u9996\\u9875\\n\\/pages\\/user_spread_user\\/index=>\\u4e2a\\u4eba\\u63a8\\u5e7f\\n\\/pages\\/user_sgin\\/index=>\\u6211\\u8981\\u7b7e\\u5230\\n\\/pages\\/user_get_coupon\\/index=>\\u4f18\\u60e0\\u5238\\n\\/pages\\/user\\/user=>\\u4e2a\\u4eba\\u4e2d\\u5fc3\\n\\/pages\\/activity\\/goods_seckill\\/index=>\\u79d2\\u6740\\u5217\\u8868\\n\\/pages\\/activity\\/goods_combination\\/index=>\\u62fc\\u56e2\\u5217\\u8868\\u9875\\n\\/pages\\/activity\\/goods_bargain\\/index=>\\u780d\\u4ef7\\u5217\\u8868\\n\\/pages\\/goods_cate\\/goods_cate=>\\u5206\\u7c7b\\u9875\\u9762\\n\\/pages\\/user_address_list\\/index=>\\u5730\\u5740\\u5217\\u8868\\n\\/pages\\/user_cash\\/index=>\\u63d0\\u73b0\\u9875\\u9762\\n\\/pages\\/promoter-list\\/index=>\\u63a8\\u5e7f\\u7edf\\u8ba1\\n\\/pages\\/user_money\\/index=>\\u8d26\\u6237\\u91d1\\u989d\\n\\/pages\\/user_goods_collection\\/index=>\\u6211\\u7684\\u6536\\u85cf\\n\\/pages\\/promotion-card\\/promotion-card=>\\u63a8\\u5e7f\\u4e8c\\u7ef4\\u7801\\u9875\\u9762\\n\\/pages\\/order_addcart\\/order_addcart=>\\u8d2d\\u7269\\u8f66\\u9875\\u9762\\n\\/pages\\/order_list\\/index=>\\u8ba2\\u5355\\u5217\\u8868\\u9875\\u9762\\n\\/pages\\/news_list\\/index=>\\u6587\\u7ae0\\u5217\\u8868\\u9875\"},{\"name\":\"\\u5e95\\u90e8\\u83dc\\u5355\",\"title\":\"show\",\"type\":\"radio\",\"param\":\"1=>\\u662f\\n2=>\\u5426\"},{\"name\":\"\\u516c\\u4f17\\u53f7\\u8df3\\u8f6c\\u8def\\u5f84\",\"title\":\"wap_url\",\"type\":\"select\",\"param\":\"\\/=>\\u5546\\u57ce\\u9996\\u9875\\n\\/user\\/user_promotion=>\\u4e2a\\u4eba\\u63a8\\u5e7f\\n\\/user\\/sign=>\\u6211\\u8981\\u7b7e\\u5230\\n\\/user\\/get_coupon=>\\u4f18\\u60e0\\u5238\\n\\/user=>\\u4e2a\\u4eba\\u4e2d\\u5fc3\\n\\/activity\\/goods_seckill=>\\u79d2\\u6740\\u5217\\u8868\\n\\/activity\\/group=>\\u62fc\\u56e2\\u5217\\u8868\\u9875\\n\\/activity\\/bargain=>\\u780d\\u4ef7\\u5217\\u8868\\n\\/category=>\\u5206\\u7c7b\\u9875\\u9762\\n\\/user\\/add_manage=>\\u5730\\u5740\\u5217\\u8868\\n\\/user\\/user_cash=>\\u63d0\\u73b0\\u9875\\u9762\\n\\/user\\/promoter_list=>\\u63a8\\u5e7f\\u7edf\\u8ba1\\n\\/user\\/account=>\\u8d26\\u6237\\u91d1\\u989d\\n\\/collection=>\\u6211\\u7684\\u6536\\u85cf\\n\\/user\\/poster=>\\u63a8\\u5e7f\\u4e8c\\u7ef4\\u7801\\u9875\\u9762\\n\\/cart=>\\u8d2d\\u7269\\u8f66\\u9875\\u9762\\n\\/order\\/list\\/=>\\u8ba2\\u5355\\u5217\\u8868\\u9875\\u9762\\n\\/news_list=>\\u6587\\u7ae0\\u5217\\u8868\\u9875\"}]'); +INSERT INTO `yx_system_group` VALUES (48, '首页banner滚动图', '首页banner滚动图', 'routine_home_banner', '[{\"name\":\"\\u6807\\u9898\",\"title\":\"name\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u5c0f\\u7a0b\\u5e8f\\u94fe\\u63a5\",\"title\":\"url\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u56fe\\u7247(750*375)\",\"title\":\"pic\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u516c\\u4f17\\u53f7\\u94fe\\u63a5\",\"title\":\"wap_url\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (49, '秒杀时间段', '秒杀时间段', 'routine_seckill_time', '[{\"name\":\"\\u5f00\\u542f\\u65f6\\u95f4(\\u6574\\u6570\\u5c0f\\u65f6)\",\"title\":\"time\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u6301\\u7eed\\u65f6\\u95f4(\\u6574\\u6570\\u5c0f\\u65f6)\",\"title\":\"continued\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (50, '首页滚动新闻', '首页滚动新闻', 'routine_home_roll_news', '[{\"name\":\"\\u6eda\\u52a8\\u6587\\u5b57\",\"title\":\"info\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u5c0f\\u7a0b\\u5e8f\\u8df3\\u8f6c\\u8def\\u5f84\",\"title\":\"url\",\"type\":\"select\",\"param\":\"\\/pages\\/index\\/index=>\\u5546\\u57ce\\u9996\\u9875\\n\\/pages\\/user_spread_user\\/index=>\\u4e2a\\u4eba\\u63a8\\u5e7f\\n\\/pages\\/user_sgin\\/index=>\\u6211\\u8981\\u7b7e\\u5230\\n\\/pages\\/user_get_coupon\\/index=>\\u4f18\\u60e0\\u5238\\n\\/pages\\/user\\/user=>\\u4e2a\\u4eba\\u4e2d\\u5fc3\\n\\/pages\\/activity\\/goods_seckill\\/index=>\\u79d2\\u6740\\u5217\\u8868\\n\\/pages\\/activity\\/goods_combination\\/index=>\\u62fc\\u56e2\\u5217\\u8868\\u9875\\n\\/pages\\/activity\\/goods_bargain\\/index=>\\u780d\\u4ef7\\u5217\\u8868\\n\\/pages\\/goods_cate\\/goods_cate=>\\u5206\\u7c7b\\u9875\\u9762\\n\\/pages\\/user_address_list\\/index=>\\u5730\\u5740\\u5217\\u8868\\n\\/pages\\/user_cash\\/index=>\\u63d0\\u73b0\\u9875\\u9762\\n\\/pages\\/promoter-list\\/index=>\\u63a8\\u5e7f\\u7edf\\u8ba1\\n\\/pages\\/user_money\\/index=>\\u8d26\\u6237\\u91d1\\u989d\\n\\/pages\\/user_goods_collection\\/index=>\\u6211\\u7684\\u6536\\u85cf\\n\\/pages\\/promotion-card\\/promotion-card=>\\u63a8\\u5e7f\\u4e8c\\u7ef4\\u7801\\u9875\\u9762\\n\\/pages\\/order_addcart\\/order_addcart=>\\u8d2d\\u7269\\u8f66\\u9875\\u9762\\n\\/pages\\/order_list\\/index=>\\u8ba2\\u5355\\u5217\\u8868\\u9875\\u9762\\n\\/pages\\/news_list\\/index=>\\u6587\\u7ae0\\u5217\\u8868\\u9875\"},{\"name\":\"\\u5e95\\u90e8\\u83dc\\u5355\",\"title\":\"show\",\"type\":\"radio\",\"param\":\"1=>\\u662f\\n2=>\\u5426\"},{\"name\":\"\\u516c\\u4f17\\u53f7\\u8df3\\u8f6c\\u8def\\u5f84\",\"title\":\"wap_url\",\"type\":\"select\",\"param\":\"\\/=>\\u5546\\u57ce\\u9996\\u9875\\n\\/user\\/user_promotion=>\\u4e2a\\u4eba\\u63a8\\u5e7f\\n\\/user\\/sign=>\\u6211\\u8981\\u7b7e\\u5230\\n\\/user\\/get_coupon=>\\u4f18\\u60e0\\u5238\\n\\/user=>\\u4e2a\\u4eba\\u4e2d\\u5fc3\\n\\/activity\\/goods_seckill=>\\u79d2\\u6740\\u5217\\u8868\\n\\/activity\\/group=>\\u62fc\\u56e2\\u5217\\u8868\\u9875\\n\\/activity\\/bargain=>\\u780d\\u4ef7\\u5217\\u8868\\n\\/category=>\\u5206\\u7c7b\\u9875\\u9762\\n\\/user\\/add_manage=>\\u5730\\u5740\\u5217\\u8868\\n\\/user\\/user_cash=>\\u63d0\\u73b0\\u9875\\u9762\\n\\/user\\/promoter_list=>\\u63a8\\u5e7f\\u7edf\\u8ba1\\n\\/user\\/account=>\\u8d26\\u6237\\u91d1\\u989d\\n\\/collection=>\\u6211\\u7684\\u6536\\u85cf\\n\\/user\\/poster=>\\u63a8\\u5e7f\\u4e8c\\u7ef4\\u7801\\u9875\\u9762\\n\\/cart=>\\u8d2d\\u7269\\u8f66\\u9875\\u9762\\n\\/order\\/list\\/=>\\u8ba2\\u5355\\u5217\\u8868\\u9875\\u9762\\n\\/news_list=>\\u6587\\u7ae0\\u5217\\u8868\\u9875\"}]'); +INSERT INTO `yx_system_group` VALUES (51, '首页活动区域图片', '首页活动区域图片', 'routine_home_activity', '[{\"name\":\"\\u56fe\\u7247(260*260\\/416*214)\",\"title\":\"pic\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u6807\\u9898\",\"title\":\"title\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u7b80\\u4ecb\",\"title\":\"info\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u5c0f\\u7a0b\\u5e8f\\u94fe\\u63a5\",\"title\":\"link\",\"type\":\"select\",\"param\":\"\\/pages\\/activity\\/goods_seckill\\/index=>\\u79d2\\u6740\\u5217\\u8868\\n\\/pages\\/activity\\/goods_bargain\\/index=>\\u780d\\u4ef7\\u5217\\u8868\\n\\/pages\\/activity\\/goods_combination\\/index=>\\u62fc\\u56e2\\u5217\\u8868\"},{\"name\":\"\\u516c\\u4f17\\u53f7\\u94fe\\u63a5\",\"title\":\"wap_link\",\"type\":\"select\",\"param\":\"\\/activity\\/goods_seckill=>\\u79d2\\u6740\\u5217\\u8868\\n\\/activity\\/bargain=>\\u780d\\u4ef7\\u5217\\u8868\\n\\/activity\\/group=>\\u62fc\\u56e2\\u5217\\u8868\"}]'); +INSERT INTO `yx_system_group` VALUES (52, '首页精品推荐benner图', '首页精品推荐benner图', 'routine_home_bast_banner', '[{\"name\":\"\\u56fe\\u7247\",\"title\":\"img\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u63cf\\u8ff0\",\"title\":\"comment\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u5c0f\\u7a0b\\u5e8f\\u8df3\\u8f6c\\u94fe\\u63a5\",\"title\":\"link\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u516c\\u4f17\\u53f7\\u8df3\\u8f6c\\u94fe\\u63a5\",\"title\":\"wap_link\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (53, '订单详情状态图', '订单详情状态图', 'order_details_images', '[{\"name\":\"\\u8ba2\\u5355\\u72b6\\u6001\",\"title\":\"order_status\",\"type\":\"select\",\"param\":\"0=>\\u672a\\u652f\\u4ed8\\n1=>\\u5f85\\u53d1\\u8d27\\n2=>\\u5f85\\u6536\\u8d27\\n3=>\\u5f85\\u8bc4\\u4ef7\\n4=>\\u5df2\\u5b8c\\u6210\\n9=>\\u7ebf\\u4e0b\\u4ed8\\u6b3e\"},{\"name\":\"\\u56fe\\u6807\",\"title\":\"pic\",\"type\":\"upload\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (54, '个人中心菜单', '个人中心菜单', 'routine_my_menus', '[{\"name\":\"\\u83dc\\u5355\\u540d\",\"title\":\"name\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u56fe\\u6807(52*52)\",\"title\":\"pic\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u5c0f\\u7a0b\\u5e8f\\u8df3\\u8f6c\\u8def\\u5f84\",\"title\":\"url\",\"type\":\"select\",\"param\":\"\\/pages\\/user_address_list\\/index=>\\u5730\\u5740\\u7ba1\\u7406\\n\\/pages\\/user_vip\\/index=>\\u4f1a\\u5458\\u4e2d\\u5fc3\\n\\/pages\\/activity\\/user_goods_bargain_list\\/index=>\\u780d\\u4ef7\\u8bb0\\u5f55\\n\\/pages\\/user_spread_user\\/index=>\\u63a8\\u5e7f\\u4e2d\\u5fc3\\n\\/pages\\/user_money\\/index=>\\u6211\\u7684\\u4f59\\u989d\\n\\/pages\\/user_goods_collection\\/index=>\\u6211\\u7684\\u6536\\u85cf\\n\\/pages\\/user_coupon\\/index=>\\u4f18\\u60e0\\u5238\\n\\/pages\\/admin\\/index=>\\u540e\\u53f0\\u8ba2\\u5355\\u7ba1\\u7406\\n\\/pages\\/service\\/index=>\\u8054\\u7cfb\\u5ba2\\u670d\"},{\"name\":\"\\u516c\\u4f17\\u53f7\\u8df3\\u8f6c\\u8def\\u5f84\",\"title\":\"wap_url\",\"type\":\"select\",\"param\":\"\\/user\\/add_manage=>\\u5730\\u5740\\u7ba1\\u7406\\n\\/user\\/vip=>\\u4f1a\\u5458\\u4e2d\\u5fc3\\n\\/activity\\/bargain\\/record=>\\u780d\\u4ef7\\u8bb0\\u5f55\\n\\/user\\/user_promotion=>\\u63a8\\u5e7f\\u4e2d\\u5fc3\\n\\/user\\/account=>\\u6211\\u7684\\u4f59\\u989d\\n\\/collection=>\\u6211\\u7684\\u6536\\u85cf\\n\\/user\\/user_coupon=>\\u4f18\\u60e0\\u5238\\n\\/customer\\/list=>\\u5ba2\\u670d\\u5217\\u8868\\n\\/customer\\/index=>\\u540e\\u53f0\\u8ba2\\u5355\\u7ba1\\u7406\\n\\/order\\/order_cancellation=>\\u8ba2\\u5355\\u6838\\u9500\"}]'); +INSERT INTO `yx_system_group` VALUES (55, '签到天数配置', '签到天数配置', 'sign_day_num', '[{\"name\":\"\\u7b2c\\u51e0\\u5929\",\"title\":\"day\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u83b7\\u53d6\\u79ef\\u5206\",\"title\":\"sign_num\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (56, '热门搜索', '热门搜索', 'routine_hot_search', '[{\"name\":\"\\u6807\\u7b7e\",\"title\":\"title\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (57, '热门榜单推荐图片', '热门榜单推荐图片', 'routine_home_hot_banner', '[{\"name\":\"\\u56fe\\u7247\",\"title\":\"img\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u63cf\\u8ff0\",\"title\":\"comment\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (58, '首发新品推荐图片', '首发新品推荐图片', 'routine_home_new_banner', '[{\"name\":\"\\u56fe\\u7247\",\"title\":\"img\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u63cf\\u8ff0\",\"title\":\"comment\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u5c0f\\u7a0b\\u5e8f\\u8df3\\u8f6c\\u94fe\\u63a5\",\"title\":\"link\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u516c\\u4f17\\u53f7\\u8df3\\u8f6c\\u94fe\\u63a5\",\"title\":\"wap_link\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (59, '促销单品推荐图片', '促销单品推荐图片', 'routine_home_benefit_banner', '[{\"name\":\"\\u56fe\\u7247\",\"title\":\"img\",\"type\":\"upload\",\"param\":\"\"},{\"name\":\"\\u63cf\\u8ff0\",\"title\":\"comment\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u5c0f\\u7a0b\\u5e8f\\u8df3\\u8f6c\\u94fe\\u63a5\",\"title\":\"link\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u516c\\u4f17\\u53f7\\u8df3\\u8f6c\\u94fe\\u63a5\",\"title\":\"wap_link\",\"type\":\"input\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (60, '分享海报', '分享海报', 'routine_spread_banner', '[{\"name\":\"\\u540d\\u79f0\",\"title\":\"title\",\"type\":\"input\",\"param\":\"\"},{\"name\":\"\\u80cc\\u666f\\u56fe\",\"title\":\"pic\",\"type\":\"upload\",\"param\":\"\"}]'); +INSERT INTO `yx_system_group` VALUES (61, '首页文字配置', '首页文字配置', 'routine_index_page', '[{\"name\":\"\\u5feb\\u901f\\u9009\\u62e9\\u7b80\\u4ecb\",\"title\":\"fast_info\",\"type\":\"input\",\"param\":\"\\u4e0a\\u767e\\u79cd\\u5546\\u54c1\\u5206\\u7c7b\\u4efb\\u60a8\\u9009\\u62e9\"},{\"name\":\"\\u7cbe\\u54c1\\u63a8\\u8350\\u7b80\\u4ecb\",\"title\":\"bast_info\",\"type\":\"input\",\"param\":\"\\u8bda\\u610f\\u63a8\\u8350\\u54c1\\u8d28\\u5546\\u54c1\"},{\"name\":\"\\u9996\\u53d1\\u65b0\\u54c1\\u7b80\\u4ecb\",\"title\":\"first_info\",\"type\":\"input\",\"param\":\"\\u591a\\u4e2a\\u4f18\\u8d28\\u5546\\u54c1\\u6700\\u65b0\\u4e0a\\u67b6\"},{\"name\":\"\\u4fc3\\u9500\\u5355\\u54c1\\u7b80\\u4ecb\",\"title\":\"sales_info\",\"type\":\"input\",\"param\":\"\\u5e93\\u5b58\\u5546\\u54c1\\u4f18\\u60e0\\u4fc3\\u9500\\u6d3b\\u52a8\"},{\"name\":\"\\u5feb\\u901f\\u9009\\u62e9\\u5206\\u7c7b\\u4e2a\\u6570\",\"title\":\"fast_number\",\"type\":\"input\",\"param\":\"10\"},{\"name\":\"\\u7cbe\\u54c1\\u63a8\\u8350\\u4e2a\\u6570\",\"title\":\"bast_number\",\"type\":\"input\",\"param\":\"10\"},{\"name\":\"\\u9996\\u53d1\\u65b0\\u54c1\\u4e2a\\u6570\",\"title\":\"first_number\",\"type\":\"input\",\"param\":\"10\"}]'); + +-- ---------------------------- +-- Table structure for yx_system_group_data +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_group_data`; +CREATE TABLE `yx_system_group_data` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '组合数据详情ID', + `gid` int(11) NOT NULL DEFAULT 0 COMMENT '对应的数据组id', + `value` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据组对应的数据值(json数据)', + `add_time` int(10) NOT NULL DEFAULT 0 COMMENT '添加数据时间', + `sort` int(11) NOT NULL DEFAULT 0 COMMENT '数据排序', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态(1:开启;2:关闭;)', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 177 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组合数据详情表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_group_data +-- ---------------------------- +INSERT INTO `yx_system_group_data` VALUES (89, 38, '{\"banner\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/01\\/15\\/5c3dc730dead2.png\"}}', 1527153599, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (91, 37, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/www.crmeb3.net\\/uploads\\/config\\/image\\/20190712\\/9a79a97de87d099f4e3a07ddff11a229.png\"},\"comment\":{\"type\":\"input\",\"value\":\"\\u79d2\\u6740\\u5217\\u8868\\u9876\\u90e8baaner\"}}', 1528688012, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (99, 47, '{\"name\":{\"type\":\"input\",\"value\":\"\\u5546\\u54c1\\u5206\\u7c7b\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9ddc9f34bfd.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/goods_cate\\/goods_cate\"},\"show\":{\"type\":\"radio\",\"value\":\"1\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/category\"}}', 1533721963, 8, 1); +INSERT INTO `yx_system_group_data` VALUES (100, 47, '{\"name\":{\"type\":\"input\",\"value\":\"\\u9886\\u4f18\\u60e0\\u5238\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9ddccecb7f3.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_get_coupon\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/user\\/get_coupon\"}}', 1533722009, 7, 1); +INSERT INTO `yx_system_group_data` VALUES (101, 47, '{\"name\":{\"type\":\"input\",\"value\":\"\\u884c\\u4e1a\\u8d44\\u8baf\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9ddcec57a80.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/news_list\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/news_list\"}}', 1533722037, 6, 1); +INSERT INTO `yx_system_group_data` VALUES (102, 47, '{\"name\":{\"type\":\"input\",\"value\":\"\\u6211\\u8981\\u7b7e\\u5230\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9ddd570b8b3.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_sgin\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/user\\/sign\"}}', 1533722063, 5, 1); +INSERT INTO `yx_system_group_data` VALUES (104, 48, '{\"name\":{\"type\":\"input\",\"value\":\"banenr2\"},\"url\":{\"type\":\"input\",\"value\":\"\\/pages\\/pink-list\\/index?id=2\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9e015bdc6f5.jpg\"}}', 1533722286, 10, 1); +INSERT INTO `yx_system_group_data` VALUES (105, 47, '{\"name\":{\"type\":\"input\",\"value\":\"\\u6211\\u7684\\u6536\\u85cf\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9dddce0eac9.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_goods_collection\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/collection\"}}', 1533797064, 5, 1); +INSERT INTO `yx_system_group_data` VALUES (113, 49, '{\"time\":{\"type\":\"input\",\"value\":\"5\"},\"continued\":{\"type\":\"input\",\"value\":\"2\"}}', 1552443280, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (114, 49, '{\"time\":{\"type\":\"input\",\"value\":\"7\"},\"continued\":{\"type\":\"input\",\"value\":\"3\"}}', 1552443293, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (115, 49, '{\"time\":{\"type\":\"input\",\"value\":\"10\"},\"continued\":{\"type\":\"input\",\"value\":\"2\"}}', 1552443304, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (116, 49, '{\"time\":{\"type\":\"input\",\"value\":\"12\"},\"continued\":{\"type\":\"input\",\"value\":\"2\"}}', 1552481140, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (117, 49, '{\"time\":{\"type\":\"input\",\"value\":\"14\"},\"continued\":{\"type\":\"input\",\"value\":\"2\"}}', 1552481146, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (118, 49, '{\"time\":{\"type\":\"input\",\"value\":\"16\"},\"continued\":{\"type\":\"input\",\"value\":\"2\"}}', 1552481151, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (119, 49, '{\"time\":{\"type\":\"input\",\"value\":\"18\"},\"continued\":{\"type\":\"input\",\"value\":\"2\"}}', 1552481157, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (120, 49, '{\"time\":{\"type\":\"input\",\"value\":\"20\"},\"continued\":{\"type\":\"input\",\"value\":\"9\"}}', 1552481163, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (121, 50, '{\"info\":{\"type\":\"input\",\"value\":\"CRMEB\\u7535\\u5546\\u7cfb\\u7edf V 3.0 \\u5373\\u5c06\\u4e0a\\u7ebf\\uff01\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/news_list\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/news_list\"}}', 1552611989, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (122, 50, '{\"info\":{\"type\":\"input\",\"value\":\"CRMEB\\u7535\\u5546\\u7cfb\\u7edf V 3.0 \\u5373\\u5c06\\u4e0a\\u7ebf\\uff01\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/news_list\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/news_list\"}}', 1552612003, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (123, 50, '{\"info\":{\"type\":\"input\",\"value\":\"CRMEB\\u7535\\u5546\\u7cfb\\u7edf V 3.0 \\u5373\\u5c06\\u4e0a\\u7ebf\\uff01\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/news_list\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/news_list\"}}', 1552613047, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (124, 51, '{\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccf7e9f4d0.jpg\"},\"title\":{\"type\":\"input\",\"value\":\"\\u4e00\\u8d77\\u6765\\u62fc\\u56e2\"},\"info\":{\"type\":\"input\",\"value\":\"\\u4f18\\u60e0\\u591a\\u591a\"},\"link\":{\"type\":\"select\",\"value\":\"\\/pages\\/activity\\/goods_combination\\/index\"},\"wap_link\":{\"type\":\"select\",\"value\":\"\\/activity\\/group\"}}', 1552620002, 3, 1); +INSERT INTO `yx_system_group_data` VALUES (125, 51, '{\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccf7e97660.jpg\"},\"title\":{\"type\":\"input\",\"value\":\"\\u79d2\\u6740\\u4e13\\u533a\"},\"info\":{\"type\":\"input\",\"value\":\"\\u65b0\\u80fd\\u6e90\\u6c7d\\u8f66\\u706b\\u70ed\\u9500\\u552e\"},\"link\":{\"type\":\"select\",\"value\":\"\\/pages\\/activity\\/goods_seckill\\/index\"},\"wap_link\":{\"type\":\"select\",\"value\":\"\\/activity\\/goods_seckill\"}}', 1552620022, 2, 1); +INSERT INTO `yx_system_group_data` VALUES (126, 51, '{\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccfc86a6c1.jpg\"},\"title\":{\"type\":\"input\",\"value\":\"\\u780d\\u4ef7\\u6d3b\\u52a8\"},\"info\":{\"type\":\"input\",\"value\":\"\\u547c\\u670b\\u5524\\u53cb\\u6765\\u780d\\u4ef7~~~\"},\"link\":{\"type\":\"select\",\"value\":\"\\/pages\\/activity\\/goods_bargain\\/index\"},\"wap_link\":{\"type\":\"select\",\"value\":\"\\/activity\\/bargain\"}}', 1552620041, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (127, 52, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/04\\/13\\/5cb18e247a1a9.jpg\"},\"comment\":{\"type\":\"input\",\"value\":\"\\u7cbe\\u54c1\\u63a8\\u8350750*282\"},\"link\":{\"type\":\"input\",\"value\":\"\\/pages\\/first-new-product\\/index\"},\"wap_link\":{\"type\":\"input\",\"value\":\"\\/hot_new_goods\\/1\"}}', 1552633893, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (128, 52, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9e015bdc6f5.jpg\"},\"comment\":{\"type\":\"input\",\"value\":\"\\u7cbe\\u54c1\\u63a8\\u8350750*282\"},\"link\":{\"type\":\"input\",\"value\":\"\\/pages\\/first-new-product\\/index\"},\"wap_link\":{\"type\":\"input\",\"value\":\"\\/hot_new_goods\\/1\"}}', 1552633912, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (135, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u4f1a\\u5458\\u4e2d\\u5fc3\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccc9934a7c.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_vip\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/user\\/vip\"}}', 1553779918, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (136, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u780d\\u4ef7\\u8bb0\\u5f55\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccc9918091.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/activity\\/user_goods_bargain_list\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/activity\\/bargain\\/record\"}}', 1553779935, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (137, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u6211\\u7684\\u63a8\\u5e7f\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccc9943575.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_spread_user\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/user\\/user_promotion\"}}', 1553779950, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (138, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u6211\\u7684\\u4f59\\u989d\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccc992db31.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_money\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/user\\/account\"}}', 1553779973, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (139, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u5730\\u5740\\u4fe1\\u606f\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccc99101a8.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_address_list\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/user\\/add_manage\"}}', 1553779988, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (140, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u6211\\u7684\\u6536\\u85cf\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccc99269d1.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_goods_collection\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/collection\"}}', 1553780003, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (141, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u4f18\\u60e0\\u5238\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccc991f394.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/user_coupon\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/user\\/user_coupon\"}}', 1553780017, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (142, 53, '{\"order_status\":{\"type\":\"select\",\"value\":\"0\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccca151e99.gif\"}}', 1553780202, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (143, 53, '{\"order_status\":{\"type\":\"select\",\"value\":\"1\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccca12638a.gif\"}}', 1553780210, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (144, 53, '{\"order_status\":{\"type\":\"select\",\"value\":\"2\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccca1c78cd.gif\"}}', 1553780221, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (145, 53, '{\"order_status\":{\"type\":\"select\",\"value\":\"3\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccca178a67.gif\"}}', 1553780230, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (146, 53, '{\"order_status\":{\"type\":\"select\",\"value\":\"4\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccca1a01b6.gif\"}}', 1553780237, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (147, 55, '{\"day\":{\"type\":\"input\",\"value\":\"\\u7b2c\\u4e00\\u5929\"},\"sign_num\":{\"type\":\"input\",\"value\":\"10\"}}', 1553780276, 100, 1); +INSERT INTO `yx_system_group_data` VALUES (148, 55, '{\"day\":{\"type\":\"input\",\"value\":\"\\u7b2c\\u4e8c\\u5929\"},\"sign_num\":{\"type\":\"input\",\"value\":\"20\"}}', 1553780292, 99, 1); +INSERT INTO `yx_system_group_data` VALUES (149, 55, '{\"day\":{\"type\":\"input\",\"value\":\"\\u7b2c\\u4e09\\u5929\"},\"sign_num\":{\"type\":\"input\",\"value\":\"30\"}}', 1553780303, 90, 1); +INSERT INTO `yx_system_group_data` VALUES (150, 55, '{\"day\":{\"type\":\"input\",\"value\":\"\\u7b2c\\u56db\\u5929\"},\"sign_num\":{\"type\":\"input\",\"value\":\"40\"}}', 1553780334, 60, 1); +INSERT INTO `yx_system_group_data` VALUES (151, 55, '{\"day\":{\"type\":\"input\",\"value\":\"\\u7b2c\\u4e94\\u5929\"},\"sign_num\":{\"type\":\"input\",\"value\":\"50\"}}', 1553780351, 50, 1); +INSERT INTO `yx_system_group_data` VALUES (152, 55, '{\"day\":{\"type\":\"input\",\"value\":\"\\u7b2c\\u516d\\u5929\"},\"sign_num\":{\"type\":\"input\",\"value\":\"60\"}}', 1553780364, 40, 1); +INSERT INTO `yx_system_group_data` VALUES (153, 55, '{\"day\":{\"type\":\"input\",\"value\":\"\\u5956\\u52b1\"},\"sign_num\":{\"type\":\"input\",\"value\":\"110\"}}', 1553780389, 10, 1); +INSERT INTO `yx_system_group_data` VALUES (154, 57, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9cd03224d59.jpg\"},\"comment\":{\"type\":\"input\",\"value\":\"1\"}}', 1553780856, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (155, 58, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9cd03224d59.jpg\"},\"comment\":{\"type\":\"input\",\"value\":\"1\"},\"link\":{\"type\":\"input\",\"value\":\"#\"},\"wap_link\":{\"type\":\"input\",\"value\":\"#\"}}', 1553780869, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (156, 59, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9cd03224d59.jpg\"},\"comment\":{\"type\":\"input\",\"value\":\"1\"},\"link\":{\"type\":\"input\",\"value\":\"#\"}}', 1553780883, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (157, 56, '{\"title\":{\"type\":\"input\",\"value\":\"\\u5438\\u5c18\\u5668\"}}', 1553782153, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (158, 47, '{\"name\":{\"type\":\"input\",\"value\":\"\\u62fc\\u56e2\\u6d3b\\u52a8\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9dde013f63c.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/activity\\/goods_combination\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/activity\\/group\"}}', 1553849878, 3, 1); +INSERT INTO `yx_system_group_data` VALUES (159, 47, '{\"name\":{\"type\":\"input\",\"value\":\"\\u79d2\\u6740\\u6d3b\\u52a8\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9dde246ad96.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/activity\\/goods_seckill\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/activity\\/goods_seckill\"}}', 1553849905, 2, 1); +INSERT INTO `yx_system_group_data` VALUES (160, 47, '{\"name\":{\"type\":\"input\",\"value\":\"\\u780d\\u4ef7\\u6d3b\\u52a8\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/29\\/5c9ddedbed782.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/activity\\/goods_bargain\\/index\"},\"show\":{\"type\":\"radio\",\"value\":\"2\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/activity\\/bargain\"}}', 1553850093, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (161, 60, '{\"title\":{\"type\":\"input\",\"value\":\"\\u5206\\u4eab\\u6d77\\u62a5\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190810\\/887960975abc9a89e410db82e0089680.jpg\"}}', 1553866489, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (162, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u780d\\u4ef7\\u8bb0\\u5f55\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/datong.crmeb.net\\/public\\/uploads\\/attach\\/2019\\/03\\/28\\/5c9ccc9918091.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/activity\\/user_goods_bargain_list\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/activity\\/bargain\\/record\"}}', 1553866805, 1, 2); +INSERT INTO `yx_system_group_data` VALUES (163, 56, '{\"title\":{\"type\":\"input\",\"value\":\"\\u52a0\\u6e7f\\u5668\"}}', 1553869694, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (164, 56, '{\"title\":{\"type\":\"input\",\"value\":\"\\u9a6c\\u6876\"}}', 1553869701, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (165, 56, '{\"title\":{\"type\":\"input\",\"value\":\"\\u70ed\\u6c34\\u5668\"}}', 1553869710, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (167, 60, '{\"title\":{\"type\":\"input\",\"value\":\"1\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190810\\/623a4c225738606e4c65f93217050c86.jpg\"}}', 1555063900, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (168, 60, '{\"title\":{\"type\":\"input\",\"value\":\"2\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190810\\/93669bff568cf8eb967670d9cd3ca78c.jpg\"}}', 1555067377, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (169, 57, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/activity.crmeb.net\\/public\\/uploads\\/editor\\/20190605\\/5cf737bf264e4.jpg\"},\"comment\":{\"type\":\"input\",\"value\":\"asd\"}}', 1560149769, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (170, 37, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/www.crmeb3.net\\/uploads\\/config\\/image\\/20190712\\/9a79a97de87d099f4e3a07ddff11a229.png\"},\"comment\":{\"type\":\"input\",\"value\":\"\\u79d2\\u6740\\u5217\\u8868\\u9876\\u90e8baaner\"}}', 1562900433, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (171, 37, '{\"img\":{\"type\":\"upload\",\"value\":\"http:\\/\\/www.crmeb3.net\\/uploads\\/config\\/image\\/20190712\\/9a79a97de87d099f4e3a07ddff11a229.png\"},\"comment\":{\"type\":\"input\",\"value\":\"\\u780d\\u4ef7\\u5217\\u8868\\u9876\\u90e8baaner\"}}', 1562900852, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (172, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u8054\\u7cfb\\u5ba2\\u670d\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/07\\/20190730\\/0ded3d3f72d654fb33c8c9f30a268c97.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/service\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/customer\\/list\"}}', 1564482010, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (173, 61, '{\"fast_info\":{\"type\":\"input\",\"value\":\"\\u4e0a\\u767e\\u79cd\\u5546\\u54c1\\u5206\\u7c7b\\u4efb\\u60a8\\u9009\\u62e9\"},\"bast_info\":{\"type\":\"input\",\"value\":\"\\u8bda\\u610f\\u63a8\\u8350\\u54c1\\u8d28\\u5546\\u54c1\"},\"first_info\":{\"type\":\"input\",\"value\":\"\\u591a\\u4e2a\\u4f18\\u8d28\\u5546\\u54c1\\u6700\\u65b0\\u4e0a\\u67b6\"},\"sales_info\":{\"type\":\"input\",\"value\":\"\\u5e93\\u5b58\\u5546\\u54c1\\u4f18\\u60e0\\u4fc3\\u9500\\u6d3b\\u52a8\"},\"fast_number\":{\"type\":\"input\",\"value\":\"10\"},\"bast_number\":{\"type\":\"input\",\"value\":\"10\"},\"first_number\":{\"type\":\"input\",\"value\":\"10\"}}', 1565146071, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (174, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u7edf\\u8ba1\\u7ba1\\u7406\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190808\\/87a240841283cb614f3ba308fd299866.png\"},\"url\":{\"type\":\"select\",\"value\":\"\\/customer\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/customer\\/index\"}}', 1565259184, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (175, 53, '{\"order_status\":{\"type\":\"select\",\"value\":\"9\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/kaifa.crmeb.net\\/uploads\\/attach\\/2019\\/08\\/20190809\\/7ba5e7e9bcd1ed480fdd432b49a3161a.gif\"}}', 1565317740, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (176, 54, '{\"name\":{\"type\":\"input\",\"value\":\"\\u8ba2\\u5355\\u6838\\u9500\"},\"pic\":{\"type\":\"upload\",\"value\":\"http:\\/\\/crmeb30.net\\/uploads\\/attach\\/2019\\/09\\/19\\/0e79136c024cf1623acc42453beae1a8.jpg\"},\"url\":{\"type\":\"select\",\"value\":\"\\/pages\\/service\\/index\"},\"wap_url\":{\"type\":\"select\",\"value\":\"\\/order\\/order_cancellation\"}}', 1569382895, 1, 1); + +-- ---------------------------- +-- Table structure for yx_system_log +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_log`; +CREATE TABLE `yx_system_log` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '管理员操作记录ID', + `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '管理员id', + `admin_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '管理员姓名', + `path` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '链接', + `page` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '行为', + `method` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '访问类型', + `ip` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '登录IP', + `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '类型', + `add_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作时间', + `merchant_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商户id', + PRIMARY KEY (`id`) USING BTREE, + INDEX `admin_id`(`admin_id`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `type`(`type`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '管理员操作记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_system_menus +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_menus`; +CREATE TABLE `yx_system_menus` ( + `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '菜单ID', + `pid` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '父级id', + `icon` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '图标', + `menu_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '按钮名', + `module` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '模块名', + `controller` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '控制器', + `action` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '方法名', + `params` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '[]' COMMENT '参数', + `sort` tinyint(3) NOT NULL DEFAULT 1 COMMENT '排序', + `is_show` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否显示', + `access` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '子管理员是否可用', + PRIMARY KEY (`id`) USING BTREE, + INDEX `pid`(`pid`) USING BTREE, + INDEX `is_show`(`is_show`) USING BTREE, + INDEX `access`(`access`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 482 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_menus +-- ---------------------------- +INSERT INTO `yx_system_menus` VALUES (1, 289, '', '系统设置', 'admin', 'setting.systemConfig', 'index', '[]', 127, 1, 1); +INSERT INTO `yx_system_menus` VALUES (2, 153, '', '权限规则', 'admin', 'setting.systemMenus', 'index', '[]', 7, 1, 1); +INSERT INTO `yx_system_menus` VALUES (4, 153, '', '管理员列表', 'admin', 'setting.systemAdmin', 'index', '[]', 9, 1, 1); +INSERT INTO `yx_system_menus` VALUES (7, 467, '', '配置分类', 'admin', 'setting.systemConfigTab', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (8, 153, '', '身份管理', 'admin', 'setting.systemRole', 'index', '[]', 10, 1, 1); +INSERT INTO `yx_system_menus` VALUES (9, 467, '', '组合数据', 'admin', 'setting.systemGroup', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (11, 0, 'wechat', '公众号', 'admin', 'wechat', 'index', '[]', 91, 1, 1); +INSERT INTO `yx_system_menus` VALUES (12, 354, '', '微信关注回复', 'admin', 'wechat.reply', 'index', '{\"key\":\"subscribe\",\"title\":\"\\u7f16\\u8f91\\u65e0\\u914d\\u7f6e\\u9ed8\\u8ba4\\u56de\\u590d\"}', 86, 1, 1); +INSERT INTO `yx_system_menus` VALUES (17, 360, '', '微信菜单', 'admin', 'wechat.menus', 'index', '[]', 95, 1, 1); +INSERT INTO `yx_system_menus` VALUES (19, 11, '', '图文管理', 'admin', 'wechat.wechatNewsCategory', 'index', '[]', 60, 1, 1); +INSERT INTO `yx_system_menus` VALUES (21, 0, 'magic', '维护', 'admin', 'system', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (23, 0, 'laptop', '商品', 'admin', 'store', 'index', '[]', 110, 1, 1); +INSERT INTO `yx_system_menus` VALUES (24, 23, '', '商品管理', 'admin', 'store.storeProduct', 'index', '{\"type\":\"1\"}', 100, 1, 1); +INSERT INTO `yx_system_menus` VALUES (25, 23, '', '商品分类', 'admin', 'store.storeCategory', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (26, 285, '', '订单管理', 'admin', 'order.storeOrder', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (30, 354, '', '关键字回复', 'admin', 'wechat.reply', 'keyword', '[]', 85, 1, 1); +INSERT INTO `yx_system_menus` VALUES (31, 354, '', '无效关键词回复', 'admin', 'wechat.reply', 'index', '{\"key\":\"default\",\"title\":\"\\u7f16\\u8f91\\u65e0\\u6548\\u5173\\u952e\\u5b57\\u9ed8\\u8ba4\\u56de\\u590d\"}', 84, 1, 1); +INSERT INTO `yx_system_menus` VALUES (33, 284, '', '附加权限', 'admin', 'article.articleCategory', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (34, 33, '', '添加文章分类', 'admin', 'article.articleCategory', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (35, 33, '', '编辑文章分类', 'admin', 'article.articleCategory', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (36, 33, '', '删除文章分类', 'admin', 'article.articleCategory', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (37, 31, '', '附加权限', 'admin', 'wechat.reply', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (38, 283, '', '附加权限', 'admin', 'article.article', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (39, 38, '', '添加文章', 'admin', 'article. article', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (40, 38, '', '编辑文章', 'admin', 'article. article', 'add_new', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (41, 38, '', '删除文章', 'admin', 'article. article', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (42, 19, '', '附加权限', 'admin', 'wechat.wechatNewsCategory', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (43, 42, '', '添加图文消息', 'admin', 'wechat.wechatNewsCategory', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (44, 42, '', '编辑图文消息', 'admin', 'wechat.wechatNewsCategory', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (45, 42, '', '删除图文消息', 'admin', 'wechat.wechatNewsCategory', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (46, 7, '', '配置分类附加权限', 'admin', 'setting.systemConfigTab', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (47, 46, '', '添加配置分类', 'admin', 'setting.systemConfigTab', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (48, 117, '', '添加配置', 'admin', 'setting.systemConfig', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (49, 46, '', '编辑配置分类', 'admin', 'setting.systemConfigTab', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (50, 46, '', '删除配置分类', 'admin', 'setting.systemConfigTab', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (51, 46, '', '查看子字段', 'admin', 'system.systemConfigTab', 'sonConfigTab', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (52, 9, '', '组合数据附加权限', 'admin', 'setting.systemGroup', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (53, 468, '', '添加数据', 'admin', 'setting.systemGroupData', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (54, 468, '', '编辑数据', 'admin', 'setting.systemGroupData', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (55, 468, '', '删除数据', 'admin', 'setting.systemGroupData', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (56, 468, '', '数据列表', 'admin', 'setting.systemGroupData', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (57, 52, '', '添加数据组', 'admin', 'setting.systemGroup', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (58, 52, '', '删除数据组', 'admin', 'setting.systemGroup', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (59, 4, '', '管理员列表附加权限', 'admin', 'setting.systemAdmin', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (60, 59, '', '添加管理员', 'admin', 'setting.systemAdmin', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (61, 59, '', '编辑管理员', 'admin', 'setting.systemAdmin', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (62, 59, '', '删除管理员', 'admin', 'setting.systemAdmin', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (63, 8, '', '身份管理附加权限', 'admin', 'setting.systemRole', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (64, 63, '', '添加身份', 'admin', 'setting.systemRole', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (65, 63, '', '修改身份', 'admin', 'setting.systemRole', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (66, 63, '', '删除身份', 'admin', 'setting.systemRole', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (67, 8, '', '身份管理展示页', 'admin', 'setting.systemRole', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (68, 4, '', '管理员列表展示页', 'admin', 'setting.systemAdmin', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (69, 7, '', '配置分类展示页', 'admin', 'setting.systemConfigTab', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (70, 9, '', '组合数据展示页', 'admin', 'setting.systemGroup', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (71, 284, '', '文章分类管理展示页', 'admin', 'article.articleCategory', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (72, 283, '', '文章管理展示页', 'admin', 'article.article', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (73, 19, '', '图文消息展示页', 'admin', 'wechat.wechatNewsCategory', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (74, 2, '', '菜单管理附加权限', 'admin', 'setting.systemMenus', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (75, 74, '', '添加菜单', 'admin', 'setting.systemMenus', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (76, 74, '', '编辑菜单', 'admin', 'setting.systemMenus', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (77, 74, '', '删除菜单', 'admin', 'setting.systemMenus', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (78, 2, '', '菜单管理展示页', 'admin', 'setting.systemMenus', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (80, 0, 'leanpub', '内容', 'admin', 'article', 'index', '[]', 90, 1, 1); +INSERT INTO `yx_system_menus` VALUES (82, 11, '', '微信用户管理', 'admin', 'user', 'list', '[]', 5, 1, 1); +INSERT INTO `yx_system_menus` VALUES (84, 82, '', '用户标签', 'admin', 'wechat.wechatUser', 'tag', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (89, 30, '', '关键字回复附加权限', 'admin', 'wechat.reply', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (90, 89, '', '添加关键字', 'admin', 'wechat.reply', 'add_keyword', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (91, 89, '', '修改关键字', 'admin', 'wechat.reply', 'info_keyword', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (92, 89, '', '删除关键字', 'admin', 'wechat.reply', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (93, 30, '', '关键字回复展示页', 'admin', 'wechat.reply', 'keyword', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (94, 31, '', '无效关键词回复展示页', 'admin', 'wechat.reply', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (95, 31, '', '无效关键词回复附加权限', 'admin', 'wechat.reply', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (96, 95, '', '无效关键词回复提交按钮', 'admin', 'wechat.reply', 'save', '{\"key\":\"default\",\"title\":\"编辑无效关键字默认回复\"}', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (97, 12, '', '微信关注回复展示页', 'admin', 'wechat.reply', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (98, 12, '', '微信关注回复附加权限', 'admin', 'wechat.reply', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (99, 98, '', '微信关注回复提交按钮', 'admin', 'wechat.reply', 'save', '{\"key\":\"subscribe\",\"title\":\"编辑无配置默认回复\"}', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (100, 74, '', '添加提交菜单', 'admin', 'setting.systemMenus', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (101, 74, '', '编辑提交菜单', 'admin', 'setting.systemMenus', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (102, 59, '', '提交添加管理员', 'admin', 'setting.systemAdmin', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (103, 59, '', '提交修改管理员', 'admin', 'setting.systemAdmin', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (104, 63, '', '提交添加身份', 'admin', 'setting.systemRole', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (105, 63, '', '提交修改身份', 'admin', 'setting.systemRole', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (106, 46, '', '提交添加配置分类', 'admin', 'setting.systemConfigTab', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (107, 46, '', '提交修改配置分类', 'admin', 'setting.systemConfigTab', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (108, 117, '', '提交添加配置列表', 'admin', 'setting.systemConfig', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (109, 52, '', '提交添加数据组', 'admin', 'setting.systemGroup', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (110, 52, '', '提交修改数据组', 'admin', 'setting.systemGroup', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (111, 468, '', '提交添加数据', 'admin', 'setting.systemGroupData', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (112, 468, '', '提交修改数据', 'admin', 'setting.systemGroupData', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (113, 33, '', '提交添加文章分类', 'admin', 'article.articleCategory', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (114, 33, '', '提交添加文章分类', 'admin', 'article.articleCategory', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (115, 42, '', '提交添加图文消息', 'admin', 'wechat.wechatNewsCategory', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (116, 42, '', '提交编辑图文消息', 'admin', 'wechat.wechatNewsCategory', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (117, 1, '', '配置列表附加权限', 'admin', 'setting.systemConfig', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (118, 1, '', '配置列表展示页', 'admin', 'setting.systemConfig', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (119, 117, '', '提交保存配置列表', 'admin', 'setting.systemConfig', 'save_basics', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (123, 89, '', '提交添加关键字', 'admin', 'wechat.reply', 'save_keyword', '{\"dis\":\"1\"}', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (124, 89, '', '提交修改关键字', 'admin', 'wechat.reply', 'save_keyword', '{\"dis\":\"2\"}', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (126, 17, '', '微信菜单展示页', 'admin', 'wechat.menus', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (127, 17, '', '微信菜单附加权限', 'admin', 'wechat.menus', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (128, 127, '', '提交微信菜单按钮', 'admin', 'wechat.menus', 'save', '{\"dis\":\"1\"}', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (129, 82, '', '用户行为纪录', 'admin', 'wechat.wechatMessage', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (130, 469, '', '系统日志', 'admin', 'system.systemLog', 'index', '[]', 5, 1, 1); +INSERT INTO `yx_system_menus` VALUES (131, 130, '', '管理员操作记录展示页', 'admin', 'system.systemLog', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (132, 129, '', '微信用户行为纪录展示页', 'admin', 'wechat.wechatMessage', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (133, 82, '', '微信用户', 'admin', 'wechat.wechatUser', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (134, 133, '', '微信用户展示页', 'admin', 'wechat.wechatUser', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (137, 135, '', '添加通知模板', 'admin', 'system.systemNotice', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (138, 135, '', '编辑通知模板', 'admin', 'system.systemNotice', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (139, 135, '', '删除辑通知模板', 'admin', 'system.systemNotice', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (140, 135, '', '提交编辑辑通知模板', 'admin', 'system.systemNotice', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (141, 135, '', '提交添加辑通知模板', 'admin', 'system.systemNotice', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (142, 25, '', '产品分类展示页', 'admin', 'store.storeCategory', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (143, 25, '', '产品分类附加权限', 'admin', 'store.storeCategory', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (144, 117, '', '获取配置列表上传文件的名称', 'admin', 'setting.systemConfig', 'getimagename', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (145, 117, '', '配置列表上传文件', 'admin', 'setting.systemConfig', 'view_upload', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (146, 24, '', '产品管理展示页', 'admin', 'store.storeProduct', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (147, 24, '', '产品管理附加权限', 'admin', 'store.storeProduct', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (148, 286, '', '优惠券', '', '', '', '[]', 10, 1, 1); +INSERT INTO `yx_system_menus` VALUES (149, 148, '', '优惠券制作', 'admin', 'ump.storeCoupon', 'index', '[]', 5, 1, 1); +INSERT INTO `yx_system_menus` VALUES (150, 148, '', '会员领取记录', 'admin', 'ump.storeCouponUser', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (151, 0, 'user', '会员', 'admin', 'user', 'index', '[]', 107, 1, 1); +INSERT INTO `yx_system_menus` VALUES (153, 289, '', '管理权限', 'admin', 'setting.systemAdmin', '', '[]', 50, 1, 1); +INSERT INTO `yx_system_menus` VALUES (155, 154, '', '商户产品展示页', 'admin', 'store.storeMerchant', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (156, 154, '', '商户产品附加权限', 'admin', 'store.storeMerchant', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (158, 157, '', '商户文章管理展示页', 'admin', 'wechat.wechatNews', 'merchantIndex', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (159, 157, '', '商户文章管理附加权限', 'admin', 'wechat.wechatNews', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (170, 290, '', '评论管理', 'admin', 'store.store_product_reply', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (173, 469, '', '文件校验', 'admin', 'system.systemFile', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (174, 360, '', '微信模板消息', 'admin', 'wechat.wechatTemplate', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (175, 289, '', '客服管理', 'admin', 'wechat.storeService', 'index', '[]', 70, 1, 1); +INSERT INTO `yx_system_menus` VALUES (177, 151, '', '会员管理', 'admin', 'user.user', 'index', '[]', 10, 1, 1); +INSERT INTO `yx_system_menus` VALUES (179, 307, '', '充值记录', 'admin', 'finance.userRecharge', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (190, 26, '', '订单管理展示页', 'admin', 'order.storeOrder', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (191, 26, '', '订单管理附加权限', 'admin', 'order.storeOrder', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (192, 191, '', '订单管理去发货', 'admin', 'order.storeOrder', 'deliver_goods', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (193, 191, '', '订单管理备注', 'admin', 'order.storeOrder', 'remark', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (194, 191, '', '订单管理去送货', 'admin', 'order.storeOrder', 'delivery', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (195, 191, '', '订单管理已收货', 'admin', 'order.storeOrder', 'take_delivery', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (196, 191, '', '订单管理退款', 'admin', 'order.storeOrder', 'refund_y', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (197, 191, '', '订单管理修改订单', 'admin', 'order.storeOrder', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (198, 191, '', '订单管理修改订单提交', 'admin', 'order.storeOrder', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (199, 191, '', '订单管理退积分', 'admin', 'order.storeOrder', 'integral_back', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (200, 191, '', '订单管理退积分提交', 'admin', 'order.storeOrder', 'updateIntegralBack', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (201, 191, '', '订单管理立即支付', 'admin', 'order.storeOrder', 'offline', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (202, 191, '', '订单管理退款原因', 'admin', 'order.storeOrder', 'refund_n', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (203, 191, '', '订单管理退款原因提交', 'admin', 'order.storeOrder', 'updateRefundN', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (204, 191, '', '订单管理修改配送信息', 'admin', 'order.storeOrder', 'distribution', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (205, 191, '', '订单管理修改配送信息提交', 'admin', 'order.storeOrder', 'updateDistribution', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (206, 191, '', '订单管理退款提交', 'admin', 'order.storeOrder', 'updateRefundY', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (207, 191, '', '订单管理去发货提交', 'admin', 'order.storeOrder', 'updateDeliveryGoods', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (208, 191, '', '订单管理去送货提交', 'admin', 'order.storeOrder', 'updateDelivery', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (209, 175, '', '客服管理展示页', 'admin', 'store.storeService', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (210, 175, '', '客服管理附加权限', 'admin', 'store.storeService', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (211, 210, '', '客服管理添加', 'admin', 'store.storeService', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (212, 210, '', '客服管理添加提交', 'admin', 'store.storeService', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (213, 210, '', '客服管理编辑', 'admin', 'store.storeService', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (214, 210, '', '客服管理编辑提交', 'admin', 'store.storeService', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (215, 210, '', '客服管理删除', 'admin', 'store.storeService', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (216, 179, '', '用户充值记录展示页', 'admin', 'user.userRecharge', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (217, 179, '', '用户充值记录附加权限', 'admin', 'user.userRecharge', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (218, 217, '', '用户充值记录退款', 'admin', 'user.userRecharge', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (219, 217, '', '用户充值记录退款提交', 'admin', 'user.userRecharge', 'updaterefundy', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (220, 180, '', '预售卡管理批量修改预售卡金额', 'admin', 'presell.presellCard', 'batch_price', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (221, 180, '', '预售卡管理批量修改预售卡金额提交', 'admin', 'presell.presellCard', 'savebatch', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (222, 210, '', '客服管理聊天记录查询', 'admin', 'store.storeService', 'chat_user', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (223, 210, '', '客服管理聊天记录查询详情', 'admin', 'store.storeService', 'chat_list', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (224, 170, '', '评论管理展示页', 'admin', 'store.storeProductReply', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (225, 170, '', '评论管理附加权限', 'admin', 'store.storeProductReply', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (226, 225, '', '评论管理回复评论', 'admin', 'store.storeProductReply', 'set_reply', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (227, 225, '', '评论管理修改回复评论', 'admin', 'store.storeProductReply', 'edit_reply', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (228, 225, '', '评论管理删除评论', 'admin', 'store.storeProductReply', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (229, 149, '', '优惠券管理展示页', 'admin', 'store.storeCoupon', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (230, 149, '', '优惠券管理附加权限', 'admin', 'store.storeCoupon', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (231, 230, '', '优惠券管理添加', 'admin', 'store.storeCoupon', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (232, 230, '', '优惠券管理添加提交', 'admin', 'store.storeCoupon', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (233, 230, '', '优惠券管理删除', 'admin', 'store.storeCoupon', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (234, 230, '', '优惠券管理立即失效', 'admin', 'store.storeCoupon', 'status', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (235, 148, '', '已发布管理', 'admin', 'ump.storeCouponIssue', 'index', '[]', 3, 1, 1); +INSERT INTO `yx_system_menus` VALUES (236, 82, '', '用户分组', 'admin', 'wechat.wechatUser', 'group', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (237, 21, '', '刷新缓存', 'admin', 'system.clear', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (238, 272, '', '拼团产品', 'admin', 'ump.storeCombination', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (239, 306, '', '提现申请', 'admin', 'finance.user_extract', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (241, 273, '', '秒杀产品', 'admin', 'ump.storeSeckill', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (244, 294, '', '财务报表', 'admin', 'record.storeStatistics', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (246, 295, '', '用户统计', 'admin', 'user.user', 'user_analysis', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (247, 153, '', '个人资料', 'admin', 'setting.systemAdmin', 'admininfo', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (248, 247, '', '个人资料附加权限', 'admin', 'setting.systemAdmin', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (249, 248, '', '个人资料提交保存', 'admin', 'system.systemAdmin', 'setAdminInfo', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (250, 247, '', '个人资料展示页', 'admin', 'setting.systemAdmin', 'admininfo', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (252, 21, '', '在线更新', 'admin', 'system.systemUpgradeclient', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (254, 271, '', '砍价产品', 'admin', 'ump.storeBargain', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (255, 289, '', '后台通知', 'admin', 'setting.systemNotice', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (261, 147, '', '编辑产品', 'admin', 'store.storeproduct', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (262, 147, '', '添加产品', 'admin', 'store.storeproduct', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (263, 147, '', '编辑产品详情', 'admin', 'store.storeproduct', 'edit_content', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (264, 147, '', '开启秒杀', 'admin', 'store.storeproduct', 'seckill', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (265, 147, '', '开启秒杀', 'admin', 'store.store_product', 'bargain', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (266, 147, '', '产品编辑属性', 'admin', 'store.storeproduct', 'attr', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (269, 0, 'cubes', '小程序', 'admin', 'routine', 'index', '[]', 92, 1, 1); +INSERT INTO `yx_system_menus` VALUES (270, 289, '', '支付配置', 'admin', 'setting.systemConfig', 'index', '{\"type\":\"2\",\"tab_id\":\"4\"}', 120, 1, 1); +INSERT INTO `yx_system_menus` VALUES (271, 286, '', '砍价管理', 'admin', '', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (272, 286, '', '拼团管理', 'admin', '', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (273, 286, '', '秒杀管理', 'admin', '', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (276, 469, '', '附件管理', 'admin', 'widget.images', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (278, 469, '', '清除数据', 'admin', 'system.systemCleardata', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (283, 80, '', '文章管理', 'admin', 'article.article', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (284, 80, '', '文章分类', 'admin', 'article.article_category', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (285, 0, 'building-o', '订单', 'admin', 'order', 'index', '[]', 109, 1, 1); +INSERT INTO `yx_system_menus` VALUES (286, 0, 'paper-plane', '营销', 'admin', 'ump', 'index', '[]', 105, 1, 1); +INSERT INTO `yx_system_menus` VALUES (287, 0, 'money', '财务', 'admin', 'finance', 'index', '[]', 103, 1, 1); +INSERT INTO `yx_system_menus` VALUES (288, 0, 'line-chart', '数据', 'admin', 'record', 'index', '[]', 100, 1, 1); +INSERT INTO `yx_system_menus` VALUES (289, 0, 'gear', '设置', 'admin', 'setting', 'index', '[]', 90, 1, 1); +INSERT INTO `yx_system_menus` VALUES (290, 285, '', '售后服务', 'admin', '', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (293, 288, '', '交易数据', 'admin', '', '', '[]', 100, 1, 1); +INSERT INTO `yx_system_menus` VALUES (294, 288, '', '财务数据', 'admin', '', '', '[]', 80, 1, 1); +INSERT INTO `yx_system_menus` VALUES (295, 288, '', '会员数据', 'admin', '', '', '[]', 70, 1, 1); +INSERT INTO `yx_system_menus` VALUES (296, 288, '', '营销数据', 'admin', '', '', '[]', 90, 1, 1); +INSERT INTO `yx_system_menus` VALUES (297, 288, '', '排行榜', 'admin', '', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (300, 294, '', '提现统计', 'admin', 'record.record', 'chart_cash', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (301, 294, '', '充值统计', 'admin', 'record.record', 'chart_recharge', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (302, 294, '', '返佣统计', 'admin', 'record.record', 'chart_rebate', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (303, 295, '', '会员增长', 'admin', 'record.record', 'user_chart', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (304, 295, '', '会员业务', 'admin', 'record.record', 'user_business_chart', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (305, 295, '', '会员属性', 'admin', 'record.record', 'user_attr', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (306, 287, '', '财务操作', 'admin', '', '', '[]', 100, 1, 1); +INSERT INTO `yx_system_menus` VALUES (307, 287, '', '财务记录', 'admin', '', '', '[]', 50, 1, 1); +INSERT INTO `yx_system_menus` VALUES (308, 287, '', '佣金记录', 'admin', '', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (312, 307, '', '资金监控', 'admin', 'finance.finance', 'bill', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (313, 308, '', '佣金记录', 'admin', 'finance.finance', 'commission_list', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (314, 296, '', '积分统计', 'admin', 'record.record', 'chart_score', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (315, 296, '', '优惠券统计', 'admin', 'record.record', 'chart_coupon', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (316, 296, '', '拼团统计', 'admin', 'record.record', 'chart_combination', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (317, 296, '', '秒杀统计', 'admin', 'record.record', 'chart_seckill', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (318, 296, '', '砍价统计', 'admin', 'record.record', 'chart_bargain', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (319, 297, '', '产品销售排行', 'admin', 'record.record', 'ranking_saleslists', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (320, 297, '', '返佣排行', 'admin', 'record.record', 'ranking_commission', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (321, 297, '', '积分排行', 'admin', 'record.record', 'ranking_point', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (329, 285, '', '营销订单', 'admin', 'user', 'user', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (333, 272, '', '拼团列表', 'admin', 'ump.storeCombination', 'combina_list', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (334, 329, '', '秒杀订单', 'admin', 'user', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (335, 329, '', '积分兑换', 'admin', 'user', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (337, 0, 'users', '分销', 'admin', 'agent', 'index', '[]', 106, 1, 1); +INSERT INTO `yx_system_menus` VALUES (340, 293, '', '订单统计', 'admin', 'record.record', 'chart_order', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (341, 293, '', '产品统计', 'admin', 'record.record', 'chart_product', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (349, 286, '', '积分', 'admin', 'userPoint', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (350, 349, '', '积分配置', 'admin', 'setting.systemConfig', 'index', '{\"type\":\"3\",\"tab_id\":\"11\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (351, 349, '', '积分日志', 'admin', 'ump.userPoint', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (352, 148, '', '优惠券配置', 'admin', 'setting.systemConfig', 'index', '{\"type\":\"3\",\"tab_id\":\"12\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (353, 337, '', '分销配置', 'admin', 'setting.systemConfig', 'index', '{\"type\":\"3\",\"tab_id\":\"9\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (354, 11, '', '自动回复', '', '', '', '[]', 80, 1, 1); +INSERT INTO `yx_system_menus` VALUES (360, 11, '', '公众号配置', '', '', '', '[]', 100, 1, 1); +INSERT INTO `yx_system_menus` VALUES (361, 289, '', '应用配置', 'admin', 'setting.systemConfig', 'index', '{\"type\":\"1\",\"tab_id\":\"2\"}', 127, 1, 1); +INSERT INTO `yx_system_menus` VALUES (362, 276, '', '附加权限', 'admin', 'widget.images', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (363, 362, '', '上传图片', 'admin', 'widget.images', 'upload', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (364, 362, '', '删除图片', 'admin', 'widget.images', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (365, 362, '', '附件管理', 'admin', 'widget.images', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (366, 254, '', '其它权限管理', '', '', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (367, 366, '', '编辑砍价', 'admin', 'ump.storeBargain', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (368, 366, '', '砍价产品更新', 'admin', 'ump.storeBargain', 'update', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (369, 143, '', '添加产品分类', 'admin', 'store.storeCategory', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (370, 143, '', '编辑产品分类', 'admin', 'store.storeCategory', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (371, 337, '', '分销员管理', 'admin', 'agent.agentManage', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (372, 462, '', '首页幻灯片', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"48\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (373, 462, '', '首页导航按钮', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"47\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (374, 295, '', '分销会员业务', 'admin', 'record.record', 'user_distribution_chart', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (376, 269, '', '小程序模板消息', 'admin', 'routine.routineTemplate', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (377, 469, '', '数据备份', 'admin', 'system.systemDatabackup', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (378, 289, '', '物流公司', 'admin', 'system.express', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (379, 469, '', '文件管理', 'admin', 'system.systemFile', 'opendir', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (380, 379, '', '权限规则', 'admin', 'system.systemFile', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (381, 380, '', '打开文件', 'admin', 'system.systemFile', 'openfile', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (382, 380, '', '编辑文件', 'admin', 'system.systemFile', 'savefile', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (386, 362, '', '移动图片分类展示', 'admin', 'widget.images', 'moveimg', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (387, 362, '', '编辑分类', 'admin', 'widget.images', 'updatecate', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (388, 362, '', '添加分类', 'admin', 'widget.images', 'savecate', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (389, 362, '', '移动图片分类', 'admin', 'widget.images', 'moveimgcecate', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (390, 362, '', '编辑分类展示', 'admin', 'widget.images', 'editcate', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (392, 362, '', '删除分类', 'admin', 'widget.images', 'deletecate', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (393, 362, '', '添加分类展示', 'admin', 'widget.images', 'addcate', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (394, 191, '', '订单获取列表', 'admin', 'order.storeOrder', 'order_list', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (395, 82, '', '微信用户附加权限', 'admin', 'wechat.wechatUser', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (396, 395, '', '推送消息', 'admin', 'wechat.wechat_news_category', 'push', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (397, 395, '', '推送优惠券', 'admin', 'ump.storeCouponUser', 'grant', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (398, 177, '', '会员列表页', 'admin', 'user.user', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (399, 177, '', '会员附加权限', '', 'user.user', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (400, 399, '', '修改用户状态', '', 'user.user', 'set_status', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (401, 399, '', '编辑用户', 'admin', 'user.user', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (402, 399, '', '更新用户', 'admin', 'user.user', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (403, 399, '', '查看用户', 'admin', 'user.user', 'see', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (405, 399, '', '发优惠券', 'admin', 'ump.storeCouponUser', 'grant', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (406, 399, '', '推送图文', 'admin', 'wechat.wechatNewsCategory', 'push', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (407, 399, '', '发站内信', 'admin', 'user.userNotice', 'notice', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (415, 371, '', '分销管理附加权限', 'admin', 'agent.agentManage', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (416, 174, '', '微信模版消息附加权限', 'admin', 'wechat.wechatTemplate', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (417, 416, '', '添加模版消息', 'admin', 'wechat.wechatTemplate', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (418, 416, '', '添加模版消息展示', 'admin', 'wechat.wechatTemplate', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (419, 416, '', '编辑模版消息展示', 'admin', 'wechat.wechatTemplate', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (420, 416, '', '更新模版消息展示', 'admin', 'wechat.wechatTemplate', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (421, 416, '', '删除模版消息展示', 'admin', 'wechat.wechatTemplate', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (422, 376, '', '小程序模版消息附加权限', 'admin', 'routine.routineTemplate', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (423, 422, '', '添加模版消息展示', 'admin', 'routine.routineTemplate', 'create', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (424, 422, '', '添加模版消息', 'admin', 'routine.routineTemplate', 'save', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (425, 422, '', '编辑模版消息展示', 'admin', 'routine.routineTemplate', 'edit', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (426, 422, '', '编辑模版消息', 'admin', 'routine.routineTemplate', 'update', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (427, 422, '', '删除模版消息', 'admin', 'routine.routineTemplate', 'delete', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (439, 377, '', '数据库备份附加权限', 'admin', 'system.systemDatabackup', '', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (440, 439, '', '查看表结构', 'admin', 'system.systemDatabackup', 'seetable', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (441, 439, '', '优化表', 'admin', 'system.systemDatabackup', 'optimize', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (442, 439, '', '修复表', 'admin', 'system.systemDatabackup', 'repair', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (443, 439, '', '备份表', 'admin', 'system.systemDatabackup', 'backup', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (444, 439, '', '删除备份', 'admin', 'system.systemDatabackup', 'delFile', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (445, 439, '', '恢复备份', 'admin', 'system.systemDatabackup', 'import', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (446, 439, '', '下载备份', 'admin', 'system.systemDatabackup', 'downloadFile', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (447, 377, '', '数据备份展示页', 'admin', 'system.systemDatabackup', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (448, 379, '', '文件管理展示页', 'admin', 'system.systemFile', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (450, 371, '', '分销管理列表页', 'admin', 'agent.agentManage', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (451, 376, '', '小程序模版消息列表页', 'admin', 'routine.routineTemplate', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (452, 174, '', '微信模版消息列表页', 'admin', 'wechat.wechatTemplate', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (453, 276, '', '附件管理展示页', 'admin', 'widget.images', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (456, 151, '', '会员等级', 'admin', 'user.user_level', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (458, 462, '', '签到天数配置', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"55\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (459, 462, '', '订单详情动态图', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"53\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (460, 462, '', '个人中心菜单', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"54\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (461, 462, '', '小程序首页滚动新闻', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"50\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (462, 289, '', '数据配置', 'admin', '', '', '[]', 100, 1, 1); +INSERT INTO `yx_system_menus` VALUES (463, 462, '', '热门榜单推荐banner', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"57\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (464, 462, '', '首发新品推荐banner', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"58\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (465, 462, '', '促销单品推荐banner', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"59\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (466, 462, '', '个人中心分销海报', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"60\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (467, 21, '', '开发配置', 'admin', 'system', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (468, 1, '', '配置组合数据附加权限', 'admin', 'setting.systemGroupData', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (469, 21, '', '安全维护', 'admin', 'system', '', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (470, 1, '', '配置组合数据展示页', 'admin', 'setting.systemGroup', 'index', '[]', 0, 0, 1); +INSERT INTO `yx_system_menus` VALUES (471, 462, '', '小程序精品推荐', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"52\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (472, 462, '', '首页活动区域图片', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"51\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (473, 273, '', '秒杀配置', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"49\"}', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (474, 289, '', '短信设置', 'admin', 'sms', 'index', '[]', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (475, 474, '', '短信模板', 'admin', 'sms.smsTemplateApply', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (477, 474, '', '短信购买', 'admin', 'sms.smsPay', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (478, 474, '', '短信配置', 'admin', 'sms.smsConfig', 'index', '{\"type\":\"4\",\"tab_id\":\"18\"}', 1, 1, 1); +INSERT INTO `yx_system_menus` VALUES (479, 474, '', '公共短信模板', 'admin', 'sms.smsPublicTemp', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (480, 289, '', '门店设置', 'admin', 'system.system_store', 'index', '[]', 0, 1, 1); +INSERT INTO `yx_system_menus` VALUES (481, 462, '', '首页配置', 'admin', 'setting.system_group_data', 'index', '{\"gid\":\"61\"}', 0, 1, 1); + +-- ---------------------------- +-- Table structure for yx_system_notice +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_notice`; +CREATE TABLE `yx_system_notice` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '通知模板id', + `title` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '通知标题', + `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '通知类型', + `icon` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '图标', + `url` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '链接', + `table_title` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '通知数据', + `template` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '通知模板', + `push_admin` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '通知管理员id', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `type`(`type`) USING BTREE, + INDEX `status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '通知模板表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_system_notice_admin +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_notice_admin`; +CREATE TABLE `yx_system_notice_admin` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '通知记录ID', + `notice_type` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '通知类型', + `admin_id` smallint(5) UNSIGNED NOT NULL COMMENT '通知的管理员', + `link_id` int(10) UNSIGNED NOT NULL COMMENT '关联ID', + `table_data` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '通知的数据', + `is_click` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '点击次数', + `is_visit` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '访问次数', + `visit_time` int(11) NOT NULL COMMENT '访问时间', + `add_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '通知时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `admin_id`(`admin_id`, `notice_type`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `is_visit`(`is_visit`) USING BTREE, + INDEX `is_click`(`is_click`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '通知记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_system_role +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_role`; +CREATE TABLE `yx_system_role` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '身份管理id', + `role_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '身份管理名称', + `rules` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '身份管理权限(menus_id)', + `level` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE, + INDEX `status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '身份管理表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_role +-- ---------------------------- +INSERT INTO `yx_system_role` VALUES (1, '超级管理员', '23,24,146,147,264,265,266,263,261,262,25,142,143,369,370,285,26,190,191,394,208,207,206,198,199,200,201,202,203,204,205,197,196,192,193,194,195,329,334,335,290,170,224,225,226,227,228,151,177,398,399,407,406,400,401,402,403,405,176,449,408,409,410,411,412,413,456,337,353,371,450,415,286,148,149,229,230,231,232,233,234,235,150,352,271,254,366,368,367,272,333,238,273,473,241,349,351,350,287,306,239,307,179,217,219,218,216,312,308,313,288,293,341,340,296,318,317,316,315,314,294,300,301,302,244,295,305,304,303,374,246,297,319,321,320,269,376,451,422,423,424,425,426,427,11,360,17,127,128,126,174,452,416,421,420,417,418,419,355,356,357,358,359,354,12,97,98,99,30,93,89,124,92,91,90,123,31,94,95,96,37,19,73,42,115,116,43,44,45,82,133,134,395,396,397,84,236,129,132,289,1,470,468,112,111,53,54,55,56,117,119,108,48,144,145,118,361,270,462,471,472,466,458,459,460,461,463,464,465,372,373,153,8,63,104,105,64,65,66,67,4,68,59,102,103,62,61,60,2,74,100,75,76,77,101,78,247,248,249,250,474,478,475,476,477,479,378,255,80,283,72,38,41,39,40,284,71,33,113,114,34,35,36,175,209,210,222,223,211,212,213,214,215,21,469,130,131,173,276,362,365,364,363,386,387,388,389,390,392,393,453,278,377,447,439,444,445,446,443,442,441,440,379,448,380,382,381,467,9,52,109,110,57,58,70,7,46,106,107,47,49,50,51,69,252,237,0', 0, 1); + +-- ---------------------------- +-- Table structure for yx_system_store +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_store`; +CREATE TABLE `yx_system_store` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '门店名称', + `introduction` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '简介', + `phone` char(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号码', + `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '省市区', + `detailed_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '详细地址', + `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '门店logo', + `latitude` char(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '纬度', + `longitude` char(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '经度', + `valid_time` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '核销有效日期', + `day_time` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '每日营业开关时间', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', + `is_show` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示', + `is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除', + PRIMARY KEY (`id`) USING BTREE, + INDEX `phone`(`phone`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店自提' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_system_user_level +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_user_level`; +CREATE TABLE `yx_system_user_level` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `mer_id` int(11) NOT NULL DEFAULT 0 COMMENT '商户id', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '会员名称', + `money` decimal(8, 2) NOT NULL DEFAULT 0.00 COMMENT '购买金额', + `valid_date` int(11) NOT NULL DEFAULT 0 COMMENT '有效时间', + `is_forever` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否为永久会员', + `is_pay` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否购买,1=购买,0=不购买', + `is_show` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示 1=显示,0=隐藏', + `grade` int(11) NOT NULL DEFAULT 0 COMMENT '会员等级', + `discount` decimal(8, 2) NOT NULL DEFAULT 0.00 COMMENT '享受折扣', + `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '会员卡背景', + `icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '会员图标', + `explain` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '说明', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', + `is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除.1=删除,0=未删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设置用户等级表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_user_level +-- ---------------------------- +INSERT INTO `yx_system_user_level` VALUES (1, 0, '普通会员1', 20.00, 0, 1, 0, 1, 1, 99.00, 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8cd632.jpg', 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8bc1e0.png', '普通会员', 1553824559, 0); +INSERT INTO `yx_system_user_level` VALUES (2, 0, '青铜会员', 0.00, 0, 1, 0, 1, 2, 98.00, 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca904016.jpg', 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8f0a30.png', '青铜会员', 1553824639, 0); +INSERT INTO `yx_system_user_level` VALUES (3, 0, '黄铜会员', 0.00, 0, 1, 0, 1, 3, 95.00, 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8c3bff.jpg', 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8e9365.png', '黄铜会员', 1553824742, 0); +INSERT INTO `yx_system_user_level` VALUES (4, 0, '白银会员', 0.00, 0, 1, 0, 1, 4, 94.00, 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8d6ae1.jpg', 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8a27f0.png', '白银会员', 1553824797, 0); +INSERT INTO `yx_system_user_level` VALUES (5, 0, '黄金会员', 0.00, 0, 1, 0, 1, 5, 90.00, 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8b27f1.jpg', 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8aa5b9.png', '黄金会员', 1553824837, 0); +INSERT INTO `yx_system_user_level` VALUES (6, 0, '钻石会员', 0.00, 0, 1, 0, 1, 6, 88.00, 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8dfe16.jpg', 'http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca90d2d3.png', '钻石会员', 1553824871, 1); + +-- ---------------------------- +-- Table structure for yx_system_user_task +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_user_task`; +CREATE TABLE `yx_system_user_task` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '任务名称', + `real_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '配置原名', + `task_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '任务类型', + `number` int(11) NOT NULL DEFAULT 0 COMMENT '限定数', + `level_id` int(11) NOT NULL DEFAULT 0 COMMENT '等级id', + `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序', + `is_show` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示', + `is_must` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否务必达成任务,1务必达成,0=满足其一', + `illustrate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '任务说明', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '新增时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '等级任务设置' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_user_task +-- ---------------------------- +INSERT INTO `yx_system_user_task` VALUES (1, '满足积分100分', '积分数', 'SatisfactionIntegral', 100, 1, 0, 1, 1, '', 1553827616); +INSERT INTO `yx_system_user_task` VALUES (2, '消费满100元', '消费金额', 'ConsumptionAmount', 100, 1, 0, 1, 1, '', 1553827625); +INSERT INTO `yx_system_user_task` VALUES (3, '满足积分200分', '积分数', 'SatisfactionIntegral', 200, 2, 0, 1, 1, '', 1553827638); +INSERT INTO `yx_system_user_task` VALUES (4, '累计签到20天', '累计签到', 'CumulativeAttendance', 20, 2, 0, 1, 1, '', 1553827681); +INSERT INTO `yx_system_user_task` VALUES (5, '满足积分500分', '积分数', 'SatisfactionIntegral', 500, 3, 0, 1, 1, '', 1553827695); +INSERT INTO `yx_system_user_task` VALUES (6, '累计签到30天', '累计签到', 'CumulativeAttendance', 30, 3, 0, 1, 1, '', 1553827703); +INSERT INTO `yx_system_user_task` VALUES (7, '满足积分1000分', '积分数', 'SatisfactionIntegral', 1000, 4, 0, 1, 1, '', 1553827731); +INSERT INTO `yx_system_user_task` VALUES (8, '分享给朋友10次', '分享给朋友', 'SharingTimes', 10, 4, 0, 1, 1, '', 1553827740); +INSERT INTO `yx_system_user_task` VALUES (9, '满足积分1200分', '积分数', 'SatisfactionIntegral', 1200, 5, 0, 1, 1, '', 1553827759); +INSERT INTO `yx_system_user_task` VALUES (10, '累计签到60天', '累计签到', 'CumulativeAttendance', 60, 5, 0, 1, 1, '', 1553827768); +INSERT INTO `yx_system_user_task` VALUES (11, '消费5次', '消费次数', 'ConsumptionFrequency', 5, 5, 0, 1, 1, '', 1553827776); +INSERT INTO `yx_system_user_task` VALUES (12, '满足积分2000分', '积分数', 'SatisfactionIntegral', 2000, 6, 0, 1, 1, '', 1553827791); +INSERT INTO `yx_system_user_task` VALUES (13, '消费满10000元', '消费次数', 'ConsumptionAmount', 10000, 6, 0, 1, 1, '', 1553827803); +INSERT INTO `yx_system_user_task` VALUES (14, '累计签到100天', '累计签到', 'CumulativeAttendance', 100, 6, 0, 1, 1, '', 1553827814); + +-- ---------------------------- +-- Table structure for yx_user +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user`; +CREATE TABLE `yx_user` ( + `uid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户id', + `account` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户账号', + `pwd` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户密码', + `real_name` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '真实姓名', + `birthday` int(11) NOT NULL DEFAULT 0 COMMENT '生日', + `card_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '身份证号码', + `mark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户备注', + `partner_id` int(11) NOT NULL DEFAULT 0 COMMENT '合伙人id', + `group_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户分组id', + `nickname` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户昵称', + `avatar` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户头像', + `phone` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `add_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', + `add_ip` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '添加ip', + `last_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最后一次登录时间', + `last_ip` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '最后一次登录ip', + `now_money` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '用户余额', + `brokerage_price` decimal(8, 2) NOT NULL DEFAULT 0.00 COMMENT '佣金金额', + `integral` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '用户剩余积分', + `sign_num` int(11) NOT NULL DEFAULT 0 COMMENT '连续签到天数', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1为正常,0为禁止', + `level` tinyint(2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '等级', + `spread_uid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '推广元id', + `spread_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '推广员关联时间', + `user_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户类型', + `is_promoter` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否为推广员', + `pay_count` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '用户购买次数', + `spread_count` int(11) NULL DEFAULT 0 COMMENT '下级人数', + `clean_time` int(11) NULL DEFAULT 0 COMMENT '清理会员时间', + `addres` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '详细地址', + `adminid` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '管理员编号 ', + `login_type` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户登陆类型,h5,wechat,routine', + PRIMARY KEY (`uid`) USING BTREE, + INDEX `account`(`account`) USING BTREE, + INDEX `spreaduid`(`spread_uid`) USING BTREE, + INDEX `level`(`level`) USING BTREE, + INDEX `status`(`status`) USING BTREE, + INDEX `is_promoter`(`is_promoter`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_address +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_address`; +CREATE TABLE `yx_user_address` ( + `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户地址id', + `uid` int(10) UNSIGNED NOT NULL COMMENT '用户id', + `real_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '收货人姓名', + `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '收货人电话', + `province` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '收货人所在省', + `city` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '收货人所在市', + `district` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '收货人所在区', + `detail` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '收货人详细地址', + `post_code` int(10) UNSIGNED NOT NULL COMMENT '邮编', + `longitude` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '经度', + `latitude` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '纬度', + `is_default` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否默认', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除', + `add_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `uid`(`uid`) USING BTREE, + INDEX `is_default`(`is_default`) USING BTREE, + INDEX `is_del`(`is_del`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户地址表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_bill +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_bill`; +CREATE TABLE `yx_user_bill` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户账单id', + `uid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户uid', + `link_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '关联id', + `pm` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0 = 支出 1 = 获得', + `title` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账单标题', + `category` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '明细种类', + `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '明细类型', + `number` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '明细数字', + `balance` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '剩余', + `mark` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '备注', + `add_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '0 = 带确定 1 = 有效 -1 = 无效', + PRIMARY KEY (`id`) USING BTREE, + INDEX `openid`(`uid`) USING BTREE, + INDEX `status`(`status`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `pm`(`pm`) USING BTREE, + INDEX `type`(`category`, `type`, `link_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户账单表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_enter +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_enter`; +CREATE TABLE `yx_user_enter` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '商户申请ID', + `uid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户ID', + `province` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商户所在省', + `city` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商户所在市', + `district` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商户所在区', + `address` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商户详细地址', + `merchant_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商户名称', + `link_user` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', + `link_tel` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商户电话', + `charter` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商户证书', + `add_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', + `apply_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核时间', + `success_time` int(11) NOT NULL COMMENT '通过时间', + `fail_message` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '未通过原因', + `fail_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '未通过时间', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '-1 审核未通过 0未审核 1审核通过', + `is_lock` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0 = 开启 1= 关闭', + `is_del` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `uid`(`uid`) USING BTREE, + INDEX `province`(`province`, `city`, `district`) USING BTREE, + INDEX `is_lock`(`is_lock`) USING BTREE, + INDEX `is_del`(`is_del`) USING BTREE, + INDEX `status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户申请表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_extract +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_extract`; +CREATE TABLE `yx_user_extract` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `uid` int(10) UNSIGNED NULL DEFAULT NULL, + `real_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', + `extract_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'bank' COMMENT 'bank = 银行卡 alipay = 支付宝wx=微信', + `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '银行卡', + `bank_address` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '开户地址', + `alipay_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '支付宝账号', + `extract_price` decimal(8, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '提现金额', + `mark` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `balance` decimal(8, 2) UNSIGNED NULL DEFAULT 0.00, + `fail_msg` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '无效原因', + `fail_time` int(10) UNSIGNED NULL DEFAULT NULL, + `add_time` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '添加时间', + `status` tinyint(2) NULL DEFAULT 0 COMMENT '-1 未通过 0 审核中 1 已提现', + `wechat` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '微信号', + PRIMARY KEY (`id`) USING BTREE, + INDEX `extract_type`(`extract_type`) USING BTREE, + INDEX `status`(`status`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `openid`(`uid`) USING BTREE, + INDEX `fail_time`(`fail_time`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户提现表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_group +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_group`; +CREATE TABLE `yx_user_group` ( + `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, + `group_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户分组名称', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户分组表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_level +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_level`; +CREATE TABLE `yx_user_level` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL DEFAULT 0 COMMENT '用户uid', + `level_id` int(11) NOT NULL DEFAULT 0 COMMENT '等级vip', + `grade` int(11) NOT NULL DEFAULT 0 COMMENT '会员等级', + `valid_time` int(11) NOT NULL DEFAULT 0 COMMENT '过期时间', + `is_forever` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否永久', + `mer_id` int(11) NOT NULL DEFAULT 0 COMMENT '商户id', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0:禁止,1:正常', + `mark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '备注', + `remind` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已通知', + `is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除,0=未删除,1=删除', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', + `discount` int(11) NOT NULL DEFAULT 0 COMMENT '享受折扣', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `id`(`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户等级记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_notice +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_notice`; +CREATE TABLE `yx_user_notice` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '接收消息的用户id(类型:json数据)', + `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '消息通知类型(1:系统消息;2:用户通知)', + `user` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '发送人', + `title` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '通知消息的标题信息', + `content` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '通知消息的内容', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '通知消息发送的时间', + `is_send` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否发送(0:未发送;1:已发送)', + `send_time` int(11) NOT NULL COMMENT '发送时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户通知表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_notice_see +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_notice_see`; +CREATE TABLE `yx_user_notice_see` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `nid` int(11) NOT NULL DEFAULT 0 COMMENT '查看的通知id', + `uid` int(11) NOT NULL DEFAULT 0 COMMENT '查看通知的用户id', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '查看通知的时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户通知发送记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_recharge +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_recharge`; +CREATE TABLE `yx_user_recharge` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `uid` int(10) NULL DEFAULT NULL COMMENT '充值用户UID', + `order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '订单号', + `price` decimal(8, 2) NULL DEFAULT NULL COMMENT '充值金额', + `recharge_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '充值类型', + `paid` tinyint(1) NULL DEFAULT NULL COMMENT '是否充值', + `pay_time` int(10) NULL DEFAULT NULL COMMENT '充值支付时间', + `add_time` int(12) NULL DEFAULT NULL COMMENT '充值时间', + `refund_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '退款金额', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `order_id`(`order_id`) USING BTREE, + INDEX `uid`(`uid`) USING BTREE, + INDEX `recharge_type`(`recharge_type`) USING BTREE, + INDEX `paid`(`paid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户充值表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_sign +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_sign`; +CREATE TABLE `yx_user_sign` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL DEFAULT 0 COMMENT '用户uid', + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '签到说明', + `number` int(11) NOT NULL DEFAULT 0 COMMENT '获得积分', + `balance` int(11) NOT NULL DEFAULT 0 COMMENT '剩余积分', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `uid`(`uid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '签到记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_task_finish +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_task_finish`; +CREATE TABLE `yx_user_task_finish` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `task_id` int(11) NOT NULL DEFAULT 0 COMMENT '任务id', + `uid` int(11) NOT NULL DEFAULT 0 COMMENT '用户id', + `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否有效', + `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `id`(`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户任务完成记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_user_token +-- ---------------------------- +DROP TABLE IF EXISTS `yx_user_token`; +CREATE TABLE `yx_user_token` ( + `uid` int(10) UNSIGNED NOT NULL COMMENT '用户 id', + `token` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'token', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `expires_time` datetime(0) NOT NULL COMMENT '到期事件', + `login_ip` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录ip' +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_wechat_media +-- ---------------------------- +DROP TABLE IF EXISTS `yx_wechat_media`; +CREATE TABLE `yx_wechat_media` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '微信视频音频id', + `type` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '回复类型', + `path` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件路径', + `media_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '微信服务器返回的id', + `url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '地址', + `temporary` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否永久或者临时 0永久1临时', + `add_time` int(10) UNSIGNED NOT NULL COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `type`(`type`, `media_id`) USING BTREE, + INDEX `type_2`(`type`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信回复表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_wechat_message +-- ---------------------------- +DROP TABLE IF EXISTS `yx_wechat_message`; +CREATE TABLE `yx_wechat_message` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户行为记录id', + `openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户openid', + `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '操作类型', + `result` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '操作详细记录', + `add_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `openid`(`openid`) USING BTREE, + INDEX `type`(`type`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户行为记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_wechat_news_category +-- ---------------------------- +DROP TABLE IF EXISTS `yx_wechat_news_category`; +CREATE TABLE `yx_wechat_news_category` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '图文消息管理ID', + `cate_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '图文名称', + `sort` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态', + `new_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文章id', + `add_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '图文消息管理表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_wechat_news_category +-- ---------------------------- +INSERT INTO `yx_wechat_news_category` VALUES (21, '小程序商城前景分析', 0, 1, '51,52,58,59,60', '1565520433'); + +-- ---------------------------- +-- Table structure for yx_wechat_qrcode +-- ---------------------------- +DROP TABLE IF EXISTS `yx_wechat_qrcode`; +CREATE TABLE `yx_wechat_qrcode` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '微信二维码ID', + `third_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '二维码类型', + `third_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户id', + `ticket` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '二维码参数', + `expire_seconds` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '二维码有效时间', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态', + `add_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '添加时间', + `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '微信访问url', + `qrcode_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '微信二维码url', + `scan` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '被扫的次数', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `third_type`(`third_type`, `third_id`) USING BTREE, + INDEX `ticket`(`ticket`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信二维码管理表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_wechat_reply +-- ---------------------------- +DROP TABLE IF EXISTS `yx_wechat_reply`; +CREATE TABLE `yx_wechat_reply` ( + `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '微信关键字回复id', + `key` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '关键字', + `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '回复类型', + `data` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '回复数据', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '0=不可用 1 =可用', + `hide` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否隐藏', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `key`(`key`) USING BTREE, + INDEX `type`(`type`) USING BTREE, + INDEX `status`(`status`) USING BTREE, + INDEX `hide`(`hide`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信关键字回复表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yx_wechat_template +-- ---------------------------- +DROP TABLE IF EXISTS `yx_wechat_template`; +CREATE TABLE `yx_wechat_template` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '模板id', + `tempkey` char(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '模板编号', + `name` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '模板名', + `content` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '回复内容', + `tempid` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模板ID', + `add_time` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '添加时间', + `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE, + INDEX `tempkey`(`tempkey`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信模板' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_wechat_template +-- ---------------------------- +INSERT INTO `yx_wechat_template` VALUES (3, 'OPENTM200565259', '订单发货提醒', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n物流公司:{{keyword2.DATA}}\n物流单号:{{keyword3.DATA}}\n{{remark.DATA}}', 'KusKZOFc_4CrRU_gzuXMdMMTfFeR-OLVVuDiMyR5PiM', '1515052638', 1); +INSERT INTO `yx_wechat_template` VALUES (4, 'OPENTM413386489', '订单收货通知', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n订单状态:{{keyword2.DATA}}\n收货时间:{{keyword3.DATA}}\n商品详情:{{keyword4.DATA}}\n{{remark.DATA}}', 'UNyz81kgsn1WZHSqmwPiF9fUkcdZghfTZvN6qtDuu54', '1515052765', 1); +INSERT INTO `yx_wechat_template` VALUES (5, 'OPENTM410119152', '退款进度通知', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n订单金额:{{keyword2.DATA}}\n下单时间:{{keyword3.DATA}}\n{{remark.DATA}}', 'xrXtApBFv0L3-YXKkl9WYB89hJxFGfQo3jSsk2WpAwI', '1515053049', 1); +INSERT INTO `yx_wechat_template` VALUES (6, 'OPENTM405847076', '帐户资金变动提醒', '{{first.DATA}}\n变动类型:{{keyword1.DATA}}\n变动时间:{{keyword2.DATA}}\n变动金额:{{keyword3.DATA}}\n{{remark.DATA}}', 'Bk3XLd1Nwk9aNF1NIPBlyTDhrgNbzJW4H23OwVQdE-s', '1515053127', 1); +INSERT INTO `yx_wechat_template` VALUES (7, 'OPENTM207707249', '订单发货提醒', '\n{{first.DATA}}\n商品明细:{{keyword1.DATA}}\n下单时间:{{keyword2.DATA}}\n配送地址:{{keyword3.DATA}}\n配送人:{{keyword4.DATA}}\n联系电话:{{keyword5.DATA}}\n{{remark.DATA}}', 'KusKZOFc_4CrRU_gzuXMdMMTfFeR-OLVVuDiMyR5PiM', '1515053313', 1); +INSERT INTO `yx_wechat_template` VALUES (8, 'OPENTM408237350', '服务进度提醒', '{{first.DATA}}\n服务类型:{{keyword1.DATA}}\n服务状态:{{keyword2.DATA}}\n服务时间:{{keyword3.DATA}}\n{{remark.DATA}}', 'ul2g_y0oxqEhtWoSJBbLzmnPrUwtLnIAe30MTBRL7rw', '1515483915', 1); +INSERT INTO `yx_wechat_template` VALUES (9, 'OPENTM204431262', '客服通知提醒', '{{first.DATA}}\n客户名称:{{keyword1.DATA}}\n客服类型:{{keyword2.DATA}}\n提醒内容:{{keyword3.DATA}}\n通知时间:{{keyword4.DATA}}\n{{remark.DATA}}', 'j51mawxEmTuCCtMrXwSTnRfXH93qutoOebs5RG4MyHY', '1515484354', 1); +INSERT INTO `yx_wechat_template` VALUES (10, 'OPENTM407456411', '拼团成功通知', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n团购商品:{{keyword2.DATA}}\n{{remark.DATA}}', 'CNvCAz9GIoQri-ogSCODVRANCBUQjZIxWzWvizbHVoQ', '1520063823', 1); +INSERT INTO `yx_wechat_template` VALUES (11, 'OPENTM401113750', '拼团失败通知', '{{first.DATA}}\n拼团商品:{{keyword1.DATA}}\n商品金额:{{keyword2.DATA}}\n退款金额:{{keyword3.DATA}}\n{{remark.DATA}}', 'mSg4ZexW1qaQH3FCrFLe746EYMlTFsZhfTB6VI_ElYg', '1520064059', 1); +INSERT INTO `yx_wechat_template` VALUES (12, 'OPENTM205213550', '订单生成通知', '{{first.DATA}}\n时间:{{keyword1.DATA}}\n商品名称:{{keyword2.DATA}}\n订单号:{{keyword3.DATA}}\n{{remark.DATA}}', 'HYD99ERso6_PcA3hAT6pzH1RmO88H6IIe8crAVaXPRE', '1528966701', 1); +INSERT INTO `yx_wechat_template` VALUES (13, 'OPENTM207791277', '订单支付成功通知', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n支付金额:{{keyword2.DATA}}\n{{remark.DATA}}', 'hJV1d1OwWB_lbPrSaRHi9RGr5CFAF4PJcZdYeg73Mtg', '1528966759', 1); +INSERT INTO `yx_wechat_template` VALUES (14, 'OPENTM410292733', '砍价成功提醒', '{{first.DATA}}\n商品名称:{{keyword1.DATA}}\n底价:{{keyword2.DATA}}\n{{remark.DATA}}', 'SxBvid65JxK6PWOhlC2sgCG_mlopY1uKekEnEvAALp4', '1564566678', 1); +INSERT INTO `yx_wechat_template` VALUES (15, 'OPENTM414349441', '开团成功通知', '{{first.DATA}}\n拼团名称:{{keyword1.DATA}}\n团购价格:{{keyword2.DATA}}\n拼团人数:{{keyword3.DATA}}\n{{remark.DATA}}', 'VDTU6X1UiK438tu-qcHKc_I76CtsEWVx-_Pbf1voiws', '1564567037', 1); + +-- ---------------------------- +-- Table structure for yx_wechat_user +-- ---------------------------- +DROP TABLE IF EXISTS `yx_wechat_user`; +CREATE TABLE `yx_wechat_user` ( + `uid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '微信用户id', + `unionid` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段', + `openid` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户的标识,对当前公众号唯一', + `routine_openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '小程序唯一身份ID', + `nickname` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户的昵称', + `headimgurl` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户头像', + `sex` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户的性别,值为1时是男性,值为2时是女性,值为0时是未知', + `city` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户所在城市', + `language` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户的语言,简体中文为zh_CN', + `province` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户所在省份', + `country` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户所在国家', + `remark` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注', + `groupid` smallint(5) UNSIGNED NULL DEFAULT 0 COMMENT '用户所在的分组ID(兼容旧的用户分组接口)', + `tagid_list` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户被打上的标签ID列表', + `subscribe` tinyint(3) UNSIGNED NULL DEFAULT 1 COMMENT '用户是否订阅该公众号标识', + `subscribe_time` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '关注公众号时间', + `add_time` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '添加时间', + `stair` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '一级推荐人', + `second` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '二级推荐人', + `order_stair` int(11) NULL DEFAULT NULL COMMENT '一级推荐人订单', + `order_second` int(11) UNSIGNED NULL DEFAULT NULL COMMENT '二级推荐人订单', + `now_money` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '佣金', + `session_key` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '小程序用户会话密匙', + `user_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'wechat' COMMENT '用户类型', + PRIMARY KEY (`uid`) USING BTREE, + INDEX `groupid`(`groupid`) USING BTREE, + INDEX `subscribe_time`(`subscribe_time`) USING BTREE, + INDEX `add_time`(`add_time`) USING BTREE, + INDEX `subscribe`(`subscribe`) USING BTREE, + INDEX `unionid`(`unionid`) USING BTREE, + INDEX `openid`(`openid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信用户表' ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/yshop-api/pom.xml b/yshop-api/pom.xml new file mode 100644 index 00000000..7e4360cb --- /dev/null +++ b/yshop-api/pom.xml @@ -0,0 +1,118 @@ + + + + yshop + co.yixiang + 1.0 + + 4.0.0 + + yshop-api + API模块 + + + 0.9.1 + 3.2.0 + + + + + co.yixiang + yshop-common + 1.0 + + + + co.yixiang + yshop-tools + 1.0 + + + co.yixiang + yshop-mp + 1.0 + + + + + io.jsonwebtoken + jjwt + ${jjwt.version} + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus-boot-starter.version} + + + com.baomidou + mybatis-plus-generator + ${mybatis-plus-boot-starter.version} + + + org.apache.velocity + velocity-engine-core + 2.0 + + + + + + + + + + + + + + + + + + + + + + + + com.github.xiaoymin + swagger-bootstrap-ui + 1.9.3 + + + p6spy + p6spy + 3.8.1 + + + + + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + + + \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/ApiRun.java b/yshop-api/src/main/java/co/yixiang/ApiRun.java new file mode 100644 index 00000000..324036e1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/ApiRun.java @@ -0,0 +1,29 @@ +package co.yixiang; + +import co.yixiang.utils.SpringContextHolder; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * @author hupeng + * @date 2019/10/1 9:20:19 + */ +@EnableAsync +@SpringBootApplication +@EnableTransactionManagement +@MapperScan({"co.yixiang.modules.*.mapper"}) +public class ApiRun { + + public static void main(String[] args) { + SpringApplication.run(ApiRun.class, args); + } + + @Bean + public SpringContextHolder springContextHolder() { + return new SpringContextHolder(); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/common/api/ApiCode.java b/yshop-api/src/main/java/co/yixiang/common/api/ApiCode.java new file mode 100644 index 00000000..62731c15 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/api/ApiCode.java @@ -0,0 +1,61 @@ +package co.yixiang.common.api; + +/** + *

+ * REST API 响应码 + *

+ * + * @author hupeng + * @since 2019-10-16 + */ +public enum ApiCode { + + SUCCESS(200, "操作成功"), + + UNAUTHORIZED(401, "非法访问"), + + NOT_PERMISSION(403, "没有权限"), + + NOT_FOUND(404, "你请求的路径不存在"), + + FAIL(500, "操作失败"), + + SYSTEM_EXCEPTION(5000,"系统异常!"), + + PARAMETER_EXCEPTION(5001,"请求参数校验异常"), + + PARAMETER_PARSE_EXCEPTION(5002,"请求参数解析异常"), + + HTTP_MEDIA_TYPE_EXCEPTION(5003,"HTTP Media 类型异常"), + + SYSTEM_LOGIN_EXCEPTION(5005,"系统登录异常") + + ; + + private final int code; + private final String msg; + + ApiCode(final int code, final String msg) { + this.code = code; + this.msg = msg; + } + + public static ApiCode getApiCode(int code) { + ApiCode[] ecs = ApiCode.values(); + for (ApiCode ec : ecs) { + if (ec.getCode() == code) { + return ec; + } + } + return SUCCESS; + } + + public int getCode() { + return code; + } + + public String getMsg() { + return msg; + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/api/ApiController.java b/yshop-api/src/main/java/co/yixiang/common/api/ApiController.java new file mode 100644 index 00000000..40328bce --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/api/ApiController.java @@ -0,0 +1,53 @@ +package co.yixiang.common.api; + +import lombok.extern.slf4j.Slf4j; + +/** + *

+ * ApiResultEST API 公共控制器 + *

+ * + * @author hupeng + * @since 2019-10-16 + */ +@Slf4j +public class ApiController { + + /** + *

+ * 请求成功 + *

+ * + * @param data 数据内容 + * @param 对象泛型 + * @return + */ + protected ApiResult ok(T data) { + return ApiResult.ok(data); + } + + /** + *

+ * 请求失败 + *

+ * + * @param msg 提示内容 + * @return + */ + protected ApiResult fail(String msg) { + return ApiResult.fail(msg); + } + + /** + *

+ * 请求失败 + *

+ * + * @param apiCode 请求错误码 + * @return + */ + protected ApiResult fail(ApiCode apiCode) { + return ApiResult.fail(apiCode); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/api/ApiResult.java b/yshop-api/src/main/java/co/yixiang/common/api/ApiResult.java new file mode 100644 index 00000000..e116d311 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/api/ApiResult.java @@ -0,0 +1,113 @@ +package co.yixiang.common.api; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.experimental.Accessors; +import org.apache.commons.lang3.StringUtils; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + *

+ * REST API 返回结果 + *

+ * + * @author hupeng + * @since 2019-10-16 + */ +@Data +@Accessors(chain = true) +@Builder +@AllArgsConstructor +public class ApiResult implements Serializable { + + private int status; + + private T data; + + private String msg; + + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date time; + + public ApiResult() { + + } + + public static ApiResult result(boolean flag){ + if (flag){ + return ok(); + } + return fail(""); + } + + public static ApiResult result(ApiCode apiCode){ + return result(apiCode,null); + } + + public static ApiResult result(ApiCode apiCode,Object data){ + return result(apiCode,null,data); + } + + public static ApiResult result(ApiCode apiCode,String msg,Object data){ + String message = apiCode.getMsg(); + if (StringUtils.isNotBlank(msg)){ + message = msg; + } + return ApiResult.builder() + .status(apiCode.getCode()) + .msg(message) + .data(data) + .time(new Date()) + .build(); + } + + public static ApiResult ok(){ + return ok(null); + } + + public static ApiResult ok(Object data){ + return result(ApiCode.SUCCESS,data); + } + + public static ApiResult ok(Object data,String msg){ + return result(ApiCode.SUCCESS,msg,data); + } + + public static ApiResult ok(String key,Object value){ + Map map = new HashMap<>(); + map.put(key,value); + return ok(map); + } + + public static ApiResult fail(ApiCode apiCode){ + return result(apiCode,null); + } + + public static ApiResult fail(String msg){ + return result(ApiCode.FAIL,msg,null); + + } + + public static ApiResult fail(ApiCode apiCode,Object data){ + if (ApiCode.SUCCESS == apiCode){ + throw new RuntimeException("失败结果状态码不能为" + ApiCode.SUCCESS.getCode()); + } + return result(apiCode,data); + + } + + public static ApiResult fail(String key,Object value){ + Map map = new HashMap<>(); + map.put(key,value); + return result(ApiCode.FAIL,map); + } + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/common/api/Assert.java b/yshop-api/src/main/java/co/yixiang/common/api/Assert.java new file mode 100644 index 00000000..63f96e61 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/api/Assert.java @@ -0,0 +1,161 @@ +package co.yixiang.common.api; + +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.extension.api.IErrorCode; +import com.baomidou.mybatisplus.extension.exceptions.ApiException; + +import java.util.Collection; +import java.util.Map; + +/** + * REST API 业务断言< + * + * @author hupeng + * @since 2019-10-16 + */ +public class Assert { + + protected Assert() { + // to do noting + } + + /** + * 大于O + */ + public static void gtZero(Integer num, IErrorCode errorCode) { + if (num == null || num <= 0) { + Assert.fail(errorCode); + } + } + + /** + * 大于等于O + */ + public static void geZero(Integer num, IErrorCode errorCode) { + if (num == null || num < 0) { + Assert.fail(errorCode); + } + } + + /** + * num1大于num2 + */ + public static void gt(Integer num1, Integer num2, IErrorCode errorCode) { + if (num1 <= num2) { + Assert.fail(errorCode); + } + } + + /** + * num1大于等于num2 + */ + public static void ge(Integer num1, Integer num2, IErrorCode errorCode) { + if (num1 < num2) { + Assert.fail(errorCode); + } + } + + /** + * obj1 eq obj2 + */ + public static void eq(Object obj1, Object obj2, IErrorCode errorCode) { + if (!obj1.equals(obj2)) { + Assert.fail(errorCode); + } + } + + public static void isTrue(boolean condition, IErrorCode errorCode) { + if (!condition) { + Assert.fail(errorCode); + } + } + + public static void isFalse(boolean condition, IErrorCode errorCode) { + if (condition) { + Assert.fail(errorCode); + } + } + + public static void isNull(IErrorCode errorCode, Object... conditions) { + if (ObjectUtils.isNotNull(conditions)) { + Assert.fail(errorCode); + } + } + + public static void notNull(IErrorCode errorCode, Object... conditions) { + if (ObjectUtils.isNull(conditions)) { + Assert.fail(errorCode); + } + } + + /** + *

+ * 失败结果 + *

+ * + * @param errorCode 异常错误码 + */ + public static void fail(IErrorCode errorCode) { + throw new ApiException(errorCode); + } + + public static void fail(boolean condition, IErrorCode errorCode) { + if (condition) { + Assert.fail(errorCode); + } + } + + public static void fail(String message) { + throw new ApiException(message); + } + + public static void fail(boolean condition, String message) { + if (condition) { + Assert.fail(message); + } + } + + public static void notEmpty(Object[] array, IErrorCode errorCode) { + if (ObjectUtils.isEmpty(array)) { + Assert.fail(errorCode); + } + } + + public static void noNullElements(Object[] array, IErrorCode errorCode) { + if (array != null) { + for (Object element : array) { + if (element == null) { + Assert.fail(errorCode); + } + } + } + } + + public static void notEmpty(Collection collection, IErrorCode errorCode) { + if (CollectionUtils.isNotEmpty(collection)) { + Assert.fail(errorCode); + } + } + + public static void notEmpty(Map map, IErrorCode errorCode) { + if (ObjectUtils.isEmpty(map)) { + Assert.fail(errorCode); + } + } + + public static void isInstanceOf(Class type, Object obj, IErrorCode errorCode) { + Assert.notNull(errorCode, type); + if (!type.isInstance(obj)) { + Assert.fail(errorCode); + } + } + + public static void isAssignable(Class superType, Class subType, IErrorCode errorCode) { + Assert.notNull(errorCode, superType); + if (subType == null || !superType.isAssignableFrom(subType)) { + Assert.fail(errorCode); + } + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/constant/CacheKey.java b/yshop-api/src/main/java/co/yixiang/common/constant/CacheKey.java new file mode 100644 index 00000000..ddb1b20a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/constant/CacheKey.java @@ -0,0 +1,6 @@ +package co.yixiang.common.constant; + + +public interface CacheKey { + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/constant/CommonConstant.java b/yshop-api/src/main/java/co/yixiang/common/constant/CommonConstant.java new file mode 100644 index 00000000..718fd6fb --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/constant/CommonConstant.java @@ -0,0 +1,46 @@ +package co.yixiang.common.constant; + + +public interface CommonConstant { + + /** + * 默认页码为1 + */ + Integer DEFAULT_PAGE_INDEX = 1; + + /** + * 默认页大小为10 + */ + Integer DEFAULT_PAGE_SIZE = 10; + + /** + * 登录用户 + */ + String LOGIN_SYS_USER = "loginSysUser"; + + /** + * 登陆token + */ + String TOKEN = "token"; + /** + * 刷新token + */ + String REFRESH_TOKEN = "refresh_token"; + + /** + * 初始密码 + */ + String INIT_PWD = "123456"; + + /** + * 默认头像 + */ + String DEFAULT_HEAD_URL = ""; + + /** + * 管理员角色名称 + */ + String ADMIN_ROLE_NAME = "管理员"; + + String ADMIN_LOGIN = "adminLogin"; +} diff --git a/yshop-api/src/main/java/co/yixiang/common/constant/CommonRedisKey.java b/yshop-api/src/main/java/co/yixiang/common/constant/CommonRedisKey.java new file mode 100644 index 00000000..50fd702d --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/constant/CommonRedisKey.java @@ -0,0 +1,14 @@ +package co.yixiang.common.constant; + +public interface CommonRedisKey { + + /** + * 系统登录用户 + */ + String LOGIN_SYS_USER = "login:sys:user:%s"; + /** + * 系统登录token + */ + String LOGIN_TOKEN = "login:token"; + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/constant/DatePattern.java b/yshop-api/src/main/java/co/yixiang/common/constant/DatePattern.java new file mode 100644 index 00000000..c7d28ef3 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/constant/DatePattern.java @@ -0,0 +1,35 @@ +package co.yixiang.common.constant; + + +public interface DatePattern { + + /** + * 年-月-日 + */ + String yyyy_MM_dd = "yyyy-MM-dd"; + /** + * 年-月-日 时:分 + */ + String yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm"; + /** + * 年-月-日 时:分:秒 + */ + String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss"; + /** + * 年-月-日 时:分:秒:毫秒 + */ + String yyyy_MM_dd_HH_mm_ss_S = "yyyy-MM-dd HH:mm:ss.S"; + + /** + * 时:分 + */ + String HH_mm = "HH:mm"; + /** + * 时:分:秒 + */ + String HH_mm_ss = "HH:mm:ss"; + /** + * 时:分:秒:毫秒 + */ + String HH_mm_ss_S = "HH:mm:ss:S"; +} diff --git a/yshop-api/src/main/java/co/yixiang/common/entity/BaseEntity.java b/yshop-api/src/main/java/co/yixiang/common/entity/BaseEntity.java new file mode 100644 index 00000000..0f510aa7 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/entity/BaseEntity.java @@ -0,0 +1,10 @@ +package co.yixiang.common.entity; + +import io.swagger.annotations.ApiModel; + +import java.io.Serializable; + + +@ApiModel("BaseEntity") +public abstract class BaseEntity implements Serializable{ +} diff --git a/yshop-api/src/main/java/co/yixiang/common/service/BaseService.java b/yshop-api/src/main/java/co/yixiang/common/service/BaseService.java new file mode 100644 index 00000000..0367316e --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/service/BaseService.java @@ -0,0 +1,8 @@ +package co.yixiang.common.service; + +import com.baomidou.mybatisplus.extension.service.IService; + + +public interface BaseService extends IService { + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/service/impl/BaseServiceImpl.java b/yshop-api/src/main/java/co/yixiang/common/service/impl/BaseServiceImpl.java new file mode 100644 index 00000000..ee84ee48 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/service/impl/BaseServiceImpl.java @@ -0,0 +1,51 @@ +package co.yixiang.common.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import co.yixiang.common.service.BaseService; +import co.yixiang.common.web.param.QueryParam; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import co.yixiang.common.web.param.OrderQueryParam; + + +import java.util.Arrays; +import java.util.List; + +/** + * @author hupeng + * @since 2019-10-16 + */ +public abstract class BaseServiceImpl, T> extends ServiceImpl implements BaseService { + + protected Page setPageParam(QueryParam queryParam) { + return setPageParam(queryParam,null); + } + + protected Page setPageParam(QueryParam queryParam, OrderItem defaultOrder) { + Page page = new Page(); + // 设置当前页码 + page.setCurrent(queryParam.getCurrent()); + // 设置页大小 + page.setSize(queryParam.getSize()); + /** + * 如果是queryParam是OrderQueryParam,并且不为空,则使用前端排序 + * 否则使用默认排序 + */ + if (queryParam instanceof OrderQueryParam){ + OrderQueryParam orderQueryParam = (OrderQueryParam) queryParam; + List orderItems = orderQueryParam.getOrders(); + if (CollectionUtil.isEmpty(orderItems)){ + page.setOrders(Arrays.asList(defaultOrder)); + }else{ + page.setOrders(orderItems); + } + }else{ + page.setOrders(Arrays.asList(defaultOrder)); + } + + return page; + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/web/controller/ApiDocController.java b/yshop-api/src/main/java/co/yixiang/common/web/controller/ApiDocController.java new file mode 100644 index 00000000..bf0404d9 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/controller/ApiDocController.java @@ -0,0 +1,22 @@ +package co.yixiang.common.web.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import springfox.documentation.annotations.ApiIgnore; + + +@Controller +@RequestMapping("/docs") +@ApiIgnore +public class ApiDocController extends BaseController { + + /** + * swaggerUI + */ + @GetMapping("") + public String swaggerUI(){ + return "redirect:/swagger-ui.html"; + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/web/controller/BaseController.java b/yshop-api/src/main/java/co/yixiang/common/web/controller/BaseController.java new file mode 100644 index 00000000..dc38fed6 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/controller/BaseController.java @@ -0,0 +1,31 @@ +package co.yixiang.common.web.controller; + +import co.yixiang.common.api.ApiController; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +@Slf4j +public abstract class BaseController extends ApiController { + + /** + * 获取当前请求 + * + * @return request + */ + public HttpServletRequest getRequest() { + return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + } + /** + * 获取当前请求 + * + * @return response + */ + public HttpServletResponse getResponse() { + return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse(); + } +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/common/web/param/IdParam.java b/yshop-api/src/main/java/co/yixiang/common/web/param/IdParam.java new file mode 100644 index 00000000..ebdc9318 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/param/IdParam.java @@ -0,0 +1,17 @@ +package co.yixiang.common.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +@Data +@ApiModel("ID参数") +public class IdParam implements Serializable { + private static final long serialVersionUID = -5353973980674510450L; + + @NotBlank(message="ID不能为空") + private String id; +} diff --git a/yshop-api/src/main/java/co/yixiang/common/web/param/IdStatusParam.java b/yshop-api/src/main/java/co/yixiang/common/web/param/IdStatusParam.java new file mode 100644 index 00000000..3f05d33c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/param/IdStatusParam.java @@ -0,0 +1,41 @@ +package co.yixiang.common.web.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; + +@ApiModel("主键状态VO") +public class IdStatusParam implements Serializable { + private static final long serialVersionUID = -7581307955242965701L; + + @ApiModelProperty("主键ID") + private String id; + + @ApiModelProperty("状态,1:启用 0:禁用") + private Integer status; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + @Override + public String toString() { + return "IdStatusVo{" + + "id='" + id + '\'' + + ", status=" + status + + '}'; + } +} diff --git a/yshop-api/src/main/java/co/yixiang/common/web/param/NameParam.java b/yshop-api/src/main/java/co/yixiang/common/web/param/NameParam.java new file mode 100644 index 00000000..db3b9631 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/param/NameParam.java @@ -0,0 +1,30 @@ +package co.yixiang.common.web.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; + + +@ApiModel("名称参数") +public class NameParam implements Serializable { + private static final long serialVersionUID = -3710501706034574149L; + + @ApiModelProperty("名称") + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "NameParam{" + + "name='" + name + '\'' + + '}'; + } +} diff --git a/yshop-api/src/main/java/co/yixiang/common/web/param/OrderQueryParam.java b/yshop-api/src/main/java/co/yixiang/common/web/param/OrderQueryParam.java new file mode 100644 index 00000000..847743ce --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/param/OrderQueryParam.java @@ -0,0 +1,35 @@ +package co.yixiang.common.web.param; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +import java.util.Arrays; +import java.util.List; + + +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("可排序查询参数对象") +public abstract class OrderQueryParam extends QueryParam{ + private static final long serialVersionUID = 57714391204790143L; + + @ApiModelProperty(value = "排序") + private List orders; + + public void defaultOrder(OrderItem orderItem){ + this.defaultOrders(Arrays.asList(orderItem)); + } + + public void defaultOrders(List orderItems){ + if (CollectionUtil.isEmpty(orderItems)){ + return; + } + this.orders = orderItems; + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/web/param/QueryParam.java b/yshop-api/src/main/java/co/yixiang/common/web/param/QueryParam.java new file mode 100644 index 00000000..fa3b25ba --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/param/QueryParam.java @@ -0,0 +1,39 @@ +package co.yixiang.common.web.param; + +import co.yixiang.common.constant.CommonConstant; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + + +@Data +@ApiModel("查询参数对象") +public abstract class QueryParam implements Serializable{ + private static final long serialVersionUID = -3263921252635611410L; + + @ApiModelProperty(value = "页码,默认为1") + private Integer current = CommonConstant.DEFAULT_PAGE_INDEX; + @ApiModelProperty(value = "页大小,默认为10") + private Integer size = CommonConstant.DEFAULT_PAGE_SIZE; + @ApiModelProperty(value = "搜索字符串") + private String keyword; + + public void setCurrent(Integer current) { + if (current == null || current <= 0){ + this.current = CommonConstant.DEFAULT_PAGE_INDEX; + }else{ + this.current = current; + } + } + + public void setSize(Integer size) { + if (size == null || size <= 0){ + this.size = CommonConstant.DEFAULT_PAGE_SIZE; + }else{ + this.size = size; + } + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/web/vo/CommonIdName.java b/yshop-api/src/main/java/co/yixiang/common/web/vo/CommonIdName.java new file mode 100644 index 00000000..abd0aa4f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/vo/CommonIdName.java @@ -0,0 +1,58 @@ +package co.yixiang.common.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + +@ApiModel("ID-NAME-VO") +public class CommonIdName { + + @ApiModelProperty("id") + private String id; + + @ApiModelProperty("名称") + private String name; + + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CommonIdName(String id, String name) { + super(); + this.id = id; + this.name = name; + + } + + + public CommonIdName() { + super(); + } + + + @Override + public String toString() { + return "CommonIdName [id=" + id + ", name=" + name + "]"; + } + + + + +} diff --git a/yshop-api/src/main/java/co/yixiang/common/web/vo/Paging.java b/yshop-api/src/main/java/co/yixiang/common/web/vo/Paging.java new file mode 100644 index 00000000..51d70002 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/common/web/vo/Paging.java @@ -0,0 +1,59 @@ +package co.yixiang.common.web.vo; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; +import java.util.Collections; +import java.util.List; + + +@ApiModel("分页") +public class Paging implements Serializable { + private static final long serialVersionUID = -1683800405530086022L; + + @ApiModelProperty("总行数") + @JSONField(name = "total") + @JsonProperty("total") + private long total = 0; + + @ApiModelProperty("数据列表") + @JSONField(name = "records") + @JsonProperty("records") + private List records = Collections.emptyList(); + + public Paging() { + } + + public Paging(IPage page) { + this.total = page.getTotal(); + this.records = page.getRecords(); + } + + public long getTotal() { + return total; + } + + public void setTotal(long total) { + this.total = total; + } + + public List getRecords() { + return records; + } + + public void setRecords(List records) { + this.records = records; + } + + @Override + public String toString() { + return "Paging{" + + "total=" + total + + ", records=" + records + + '}'; + } +} diff --git a/yshop-api/src/main/java/co/yixiang/config/ConfigurerAdapter.java b/yshop-api/src/main/java/co/yixiang/config/ConfigurerAdapter.java new file mode 100644 index 00000000..9c448804 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/config/ConfigurerAdapter.java @@ -0,0 +1,44 @@ +package co.yixiang.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * WebMvcConfigurer + * + * @author hupeng + * @since 2019-10-16 + */ +@Configuration +@EnableWebMvc +public class ConfigurerAdapter implements WebMvcConfigurer { + + @Value("${file.path}") + private String path; + + @Value("${file.avatar}") + private String avatar; + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowCredentials(true) + .allowedHeaders("*") + .allowedOrigins("*") + .allowedMethods("GET","POST","PUT","DELETE"); + + } + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + String avatarUtl = "file:" + avatar.replace("\\","/"); + String pathUtl = "file:" + path.replace("\\","/"); + registry.addResourceHandler("/avatar/**").addResourceLocations(avatarUtl).setCachePeriod(0); + registry.addResourceHandler("/file/**").addResourceLocations(pathUtl).setCachePeriod(0); + registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/").setCachePeriod(0); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/config/DataScope.java b/yshop-api/src/main/java/co/yixiang/config/DataScope.java new file mode 100644 index 00000000..32a74056 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/config/DataScope.java @@ -0,0 +1,22 @@ +package co.yixiang.config; + + +import co.yixiang.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * 数据权限配置 + * @author hupeng + * @since 2019-10-16 + */ +@Component +public class DataScope { + + +} diff --git a/yshop-api/src/main/java/co/yixiang/config/MybatisPlusConfig.java b/yshop-api/src/main/java/co/yixiang/config/MybatisPlusConfig.java new file mode 100644 index 00000000..6b91c2cf --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/config/MybatisPlusConfig.java @@ -0,0 +1,24 @@ +package co.yixiang.config; + + +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * MybatisPlus配置 + * + */ +@Configuration +//@MapperScan(basePackages = {"com.ruoyi.app.common.persistence.dao"}) +public class MybatisPlusConfig { + + /** + * mybatis-plus分页插件 + */ + @Bean + public PaginationInterceptor paginationInterceptor() { + return new PaginationInterceptor(); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/config/SwaggerConfig.java b/yshop-api/src/main/java/co/yixiang/config/SwaggerConfig.java new file mode 100644 index 00000000..fdc9bd6f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/config/SwaggerConfig.java @@ -0,0 +1,63 @@ +package co.yixiang.config; + +import com.google.common.base.Predicates; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.ArrayList; +import java.util.List; + +/** + * api页面 /swagger-ui.html + * @author Zheng Jie + * @date 2018-11-23 + */ + +//@Configuration +//@EnableSwagger2 +public class SwaggerConfig { + + @Value("${jwt.header}") + private String tokenHeader; + + @Value("${swagger.enabled}") + private Boolean enabled; + + @Bean + public Docket createRestApi() { + ParameterBuilder ticketPar = new ParameterBuilder(); + List pars = new ArrayList(); + ticketPar.name(tokenHeader).description("token") + .modelRef(new ModelRef("string")) + .parameterType("header") + .defaultValue("Bearer ") + .required(true) + .build(); + pars.add(ticketPar.build()); + return new Docket(DocumentationType.SWAGGER_2) + .enable(enabled) + .apiInfo(apiInfo()) + .select() + .paths(Predicates.not(PathSelectors.regex("/error.*"))) + .build() + .globalOperationParameters(pars); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("eladmin 接口文档") + .version("2.1") + .build(); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/config/SwaggerConfig2.java b/yshop-api/src/main/java/co/yixiang/config/SwaggerConfig2.java new file mode 100644 index 00000000..ddae392d --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/config/SwaggerConfig2.java @@ -0,0 +1,65 @@ +package co.yixiang.config; + +import com.google.common.base.Predicates; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.ArrayList; +import java.util.List; + +/** + * api页面 /swagger-ui.html + * @author Zheng Jie + * @date 2018-11-23 + */ + +//@Configuration +//@EnableSwagger2 +public class SwaggerConfig2 { + + @Value("${jwt.header}") + private String tokenHeader; + + @Value("${swagger.enabled}") + private Boolean enabled; + + @Bean + public Docket createRestApi() { + ParameterBuilder ticketPar = new ParameterBuilder(); + List pars = new ArrayList(); + ticketPar.name(tokenHeader).description("token") + .modelRef(new ModelRef("string")) + .parameterType("header") + .defaultValue("Bearer ") + .required(true) + .build(); + pars.add(ticketPar.build()); + return new Docket(DocumentationType.SWAGGER_2) + .enable(enabled) + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors.basePackage("co.yixiang.modules")) + .paths(Predicates.not(PathSelectors.regex("/error.*"))) + .build() + .globalOperationParameters(pars); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("eladmin 接口文档2") + .version("2.1") + .build(); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/config/SwaggerConfiguration.java b/yshop-api/src/main/java/co/yixiang/config/SwaggerConfiguration.java new file mode 100644 index 00000000..eda5dba1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/config/SwaggerConfiguration.java @@ -0,0 +1,41 @@ +package co.yixiang.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** + * @ClassName SwaggerConfiguration + * @Author hupeng <610796224@qq.com> + * @Date 2019/6/28 + **/ + +@Configuration +@EnableSwagger2 +public class SwaggerConfiguration { + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors.basePackage("co.yixiang.modules")) + .paths(PathSelectors.any()) + .build(); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("Yshop商城API") + .description("Yshop商城API") + .termsOfServiceUrl("http://localhost:8009/") + .contact("610796224@qq.com") + .version("1.0") + .build(); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/config/VisitsInitialization.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/config/VisitsInitialization.java new file mode 100644 index 00000000..0c98c48f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/config/VisitsInitialization.java @@ -0,0 +1,25 @@ +package co.yixiang.modules.monitor.config; + +import co.yixiang.modules.monitor.service.VisitsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +/** + * 初始化站点统计 + * @author Zheng Jie + */ +@Component +public class VisitsInitialization implements ApplicationRunner { + + @Autowired + private VisitsService visitsService; + + @Override + public void run(ApplicationArguments args) throws Exception { + System.out.println("--------------- 初始化站点统计,如果存在今日统计则跳过 ---------------"); + visitsService.save(); + System.out.println("--------------- 初始化站点统计完成 ---------------"); + } +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/domain/Visits.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/domain/Visits.java new file mode 100644 index 00000000..b09903f9 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/domain/Visits.java @@ -0,0 +1,39 @@ +package co.yixiang.modules.monitor.domain; + +import lombok.Data; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import java.sql.Timestamp; + +/** + * pv 与 ip 统计 + * + * @author Zheng Jie + * @date 2018-12-13 + */ +@Entity +@Data +@Table(name = "visits") +public class Visits { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(unique = true) + private String date; + + @Column(name = "pv_counts") + private Long pvCounts; + + @Column(name = "ip_counts") + private Long ipCounts; + + @CreationTimestamp + @Column(name = "create_time") + private Timestamp createTime; + + @Column(name = "week_day") + private String weekDay; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/domain/vo/RedisVo.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/domain/vo/RedisVo.java new file mode 100644 index 00000000..02cd0caf --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/domain/vo/RedisVo.java @@ -0,0 +1,24 @@ +package co.yixiang.modules.monitor.domain.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author Zheng Jie + * @date 2018-12-10 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RedisVo implements Serializable { + + @NotBlank + private String key; + + @NotBlank + private String value; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/repository/VisitsRepository.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/repository/VisitsRepository.java new file mode 100644 index 00000000..41843b45 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/repository/VisitsRepository.java @@ -0,0 +1,33 @@ +package co.yixiang.modules.monitor.repository; + +import co.yixiang.modules.monitor.domain.Visits; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author Zheng Jie + * @date 2018-12-13 + */ +@Repository +public interface VisitsRepository extends JpaRepository { + + /** + * findByDate + * @param date + * @return + */ + Visits findByDate(String date); + + /** + * 获得一个时间段的记录 + * @param date1 + * @param date2 + * @return + */ + @Query(value = "select * FROM visits where " + + "create_time between ?1 and ?2",nativeQuery = true) + List findAllVisits(String date1, String date2); +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/LimitController.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/LimitController.java new file mode 100644 index 00000000..e753ff3f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/LimitController.java @@ -0,0 +1,27 @@ +package co.yixiang.modules.monitor.rest; + +import co.yixiang.annotation.Limit; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.concurrent.atomic.AtomicInteger; + +/** + * + * 接口限流测试类 + */ +@RestController +@RequestMapping("api") +public class LimitController { + private static final AtomicInteger ATOMIC_INTEGER = new AtomicInteger(); + + /** + * 测试限流注解,下面配置说明该接口 60秒内最多只能访问 10次,保存到redis的键名为 limit_test, + */ + @Limit(key = "test", period = 60, count = 10, name = "testLimit", prefix = "limit") + @GetMapping("/limit") + public int testLimit() { + return ATOMIC_INTEGER.incrementAndGet(); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/RedisController.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/RedisController.java new file mode 100644 index 00000000..f17daa52 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/RedisController.java @@ -0,0 +1,47 @@ +package co.yixiang.modules.monitor.rest; + +import co.yixiang.modules.monitor.domain.vo.RedisVo; +import co.yixiang.modules.monitor.service.RedisService; +import co.yixiang.aop.log.Log; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +/** + * @author Zheng Jie + * @date 2018-12-10 + */ +@RestController +@RequestMapping("api") +public class RedisController { + + @Autowired + private RedisService redisService; + + @Log("查询Redis缓存") + @GetMapping(value = "/redis") + @PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_SELECT')") + public ResponseEntity getRedis(String key, Pageable pageable){ + return new ResponseEntity(redisService.findByKey(key,pageable), HttpStatus.OK); + } + + @Log("删除Redis缓存") + @DeleteMapping(value = "/redis") + @PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')") + public ResponseEntity delete(@RequestBody RedisVo resources){ + redisService.delete(resources.getKey()); + return new ResponseEntity(HttpStatus.OK); + } + + @Log("清空Redis缓存") + @DeleteMapping(value = "/redis/all") + @PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')") + public ResponseEntity deleteAll(){ + redisService.flushdb(); + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/VisitsController.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/VisitsController.java new file mode 100644 index 00000000..51c9d315 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/VisitsController.java @@ -0,0 +1,39 @@ +package co.yixiang.modules.monitor.rest; + +import co.yixiang.modules.monitor.service.VisitsService; +import co.yixiang.utils.RequestHolder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author Zheng Jie + * @date 2018-12-13 + */ +@RestController +@RequestMapping("api") +public class VisitsController { + + @Autowired + private VisitsService visitsService; + + @PostMapping(value = "/visits") + public ResponseEntity create(){ + visitsService.count(RequestHolder.getHttpServletRequest()); + return new ResponseEntity(HttpStatus.CREATED); + } + + @GetMapping(value = "/visits") + public ResponseEntity get(){ + return new ResponseEntity(visitsService.get(),HttpStatus.OK); + } + + @GetMapping(value = "/visits/chartData") + public ResponseEntity getChartData(){ + return new ResponseEntity(visitsService.getChartData(),HttpStatus.OK); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/service/RedisService.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/service/RedisService.java new file mode 100644 index 00000000..7bd3e676 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/service/RedisService.java @@ -0,0 +1,46 @@ +package co.yixiang.modules.monitor.service; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +/** + * 可自行扩展 + * @author Zheng Jie + * @date 2018-12-10 + */ +public interface RedisService { + + /** + * findById + * @param key + * @return + */ + Page findByKey(String key, Pageable pageable); + + /** + * 查询验证码的值 + * @param key + * @return + */ + String getCodeVal(String key); + + Object getObj(String key); + + /** + * 保存验证码 + * @param key + * @param val + */ + void saveCode(String key, Object val,Long time); + + /** + * delete + * @param key + */ + void delete(String key); + + /** + * 清空所有缓存 + */ + void flushdb(); +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/service/VisitsService.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/service/VisitsService.java new file mode 100644 index 00000000..730b3c74 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/service/VisitsService.java @@ -0,0 +1,36 @@ +package co.yixiang.modules.monitor.service; + +import org.springframework.scheduling.annotation.Async; + +import javax.servlet.http.HttpServletRequest; + +/** + * @author Zheng Jie + * @date 2018-12-13 + */ +public interface VisitsService { + + /** + * 提供给定时任务,每天0点执行 + */ + void save(); + + /** + * 新增记录 + * @param request + */ + @Async + void count(HttpServletRequest request); + + /** + * 获取数据 + * @return + */ + Object get(); + + /** + * getChartData + * @return + */ + Object getChartData(); +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/service/impl/RedisServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/service/impl/RedisServiceImpl.java new file mode 100644 index 00000000..2d208d4e --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/service/impl/RedisServiceImpl.java @@ -0,0 +1,82 @@ +package co.yixiang.modules.monitor.service.impl; + +import co.yixiang.modules.monitor.domain.vo.RedisVo; +import co.yixiang.modules.monitor.service.RedisService; +import co.yixiang.utils.PageUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.Pageable; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author Zheng Jie + * @date 2018-12-10 + */ +@Service +public class RedisServiceImpl implements RedisService { + + @Autowired + RedisTemplate redisTemplate; + + @Value("${loginCode.expiration}") + private Long expiration; + + @Override + public Page findByKey(String key, Pageable pageable){ + List redisVos = new ArrayList<>(); + if(!"*".equals(key)){ + key = "*" + key + "*"; + } + for (Object s : redisTemplate.keys(key)) { + // 过滤掉权限的缓存 + if (s.toString().indexOf("role::loadPermissionByUser") != -1 || s.toString().indexOf("user::loadUserByUsername") != -1) { + continue; + } + RedisVo redisVo = new RedisVo(s.toString(),redisTemplate.opsForValue().get(s.toString()).toString()); + redisVos.add(redisVo); + } + Page page = new PageImpl( + PageUtil.toPage(pageable.getPageNumber(),pageable.getPageSize(),redisVos), + pageable, + redisVos.size()); + return page; + } + + @Override + public void delete(String key) { + redisTemplate.delete(key); + } + + @Override + public void flushdb() { + redisTemplate.getConnectionFactory().getConnection().flushDb(); + } + + @Override + public String getCodeVal(String key) { + try { + String value = redisTemplate.opsForValue().get(key).toString(); + return value; + }catch (Exception e){ + return ""; + } + } + + @Override + public Object getObj(String key) { + return redisTemplate.opsForValue().get(key); + } + + @Override + public void saveCode(String key, Object val,Long time) { + redisTemplate.opsForValue().set(key,val); + redisTemplate.expire(key,time, TimeUnit.SECONDS); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/monitor/service/impl/VisitsServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/monitor/service/impl/VisitsServiceImpl.java new file mode 100644 index 00000000..a9d4f4e7 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/monitor/service/impl/VisitsServiceImpl.java @@ -0,0 +1,89 @@ +package co.yixiang.modules.monitor.service.impl; + +import co.yixiang.modules.monitor.domain.Visits; +import co.yixiang.modules.monitor.repository.VisitsRepository; +import co.yixiang.modules.monitor.service.VisitsService; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.repository.LogRepository; +import co.yixiang.utils.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import java.time.LocalDate; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Zheng Jie + * @date 2018-12-13 + */ +@Slf4j +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class VisitsServiceImpl implements VisitsService { + + @Autowired + private VisitsRepository visitsRepository; + + @Autowired + private LogRepository logRepository; + + @Override + public void save() { + LocalDate localDate = LocalDate.now(); + Visits visits = visitsRepository.findByDate(localDate.toString()); + if(visits == null){ + visits = new Visits(); + visits.setWeekDay(StringUtils.getWeekDay()); + visits.setPvCounts(1L); + visits.setIpCounts(1L); + visits.setDate(localDate.toString()); + visitsRepository.save(visits); + } + } + + @Override + public void count(HttpServletRequest request) { + LocalDate localDate = LocalDate.now(); + Visits visits = visitsRepository.findByDate(localDate.toString()); + visits.setPvCounts(visits.getPvCounts()+1); + long ipCounts = logRepository.findIp(localDate.toString(), localDate.plusDays(1).toString()); + visits.setIpCounts(ipCounts); + visitsRepository.save(visits); + } + + @Override + public Object get() { + Map map = new HashMap(); + LocalDate localDate = LocalDate.now(); + Visits visits = visitsRepository.findByDate(localDate.toString()); + List list = visitsRepository.findAllVisits(localDate.minusDays(6).toString(),localDate.plusDays(1).toString()); + + long recentVisits = 0, recentIp = 0; + for (Visits data : list) { + recentVisits += data.getPvCounts(); + recentIp += data.getIpCounts(); + } + map.put("newVisits",visits.getPvCounts()); + map.put("newIp",visits.getIpCounts()); + map.put("recentVisits",recentVisits); + map.put("recentIp",recentIp); + return map; + } + + @Override + public Object getChartData() { + Map map = new HashMap(); + LocalDate localDate = LocalDate.now(); + List list = visitsRepository.findAllVisits(localDate.minusDays(6).toString(),localDate.plusDays(1).toString()); + map.put("weekDays",list.stream().map(Visits::getWeekDay).collect(Collectors.toList())); + map.put("visitsData",list.stream().map(Visits::getPvCounts).collect(Collectors.toList())); + map.put("ipData",list.stream().map(Visits::getIpCounts).collect(Collectors.toList())); + return map; + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrder.java b/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrder.java new file mode 100644 index 00000000..348816ac --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrder.java @@ -0,0 +1,183 @@ +package co.yixiang.modules.order.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 订单表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxStoreOrder对象", description = "订单表") +public class YxStoreOrder extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "订单ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "订单号") + private String orderId; + + @ApiModelProperty(value = "用户id") + private Integer uid; + + @ApiModelProperty(value = "用户姓名") + private String realName; + + @ApiModelProperty(value = "用户电话") + private String userPhone; + + @ApiModelProperty(value = "详细地址") + private String userAddress; + + @ApiModelProperty(value = "购物车id") + private String cartId; + + @ApiModelProperty(value = "运费金额") + private BigDecimal freightPrice; + + @ApiModelProperty(value = "订单商品总数") + private Integer totalNum; + + @ApiModelProperty(value = "订单总价") + private BigDecimal totalPrice; + + @ApiModelProperty(value = "邮费") + private BigDecimal totalPostage; + + @ApiModelProperty(value = "实际支付金额") + private BigDecimal payPrice; + + @ApiModelProperty(value = "支付邮费") + private BigDecimal payPostage; + + @ApiModelProperty(value = "抵扣金额") + private BigDecimal deductionPrice; + + @ApiModelProperty(value = "优惠券id") + private Integer couponId; + + @ApiModelProperty(value = "优惠券金额") + private BigDecimal couponPrice; + + @ApiModelProperty(value = "支付状态") + private Integer paid; + + @ApiModelProperty(value = "支付时间") + private Integer payTime; + + @ApiModelProperty(value = "支付方式") + private String payType; + + @ApiModelProperty(value = "创建时间") + private Integer addTime; + + @ApiModelProperty(value = "订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款)") + private Integer status; + + @ApiModelProperty(value = "0 未退款 1 申请中 2 已退款") + private Integer refundStatus; + + @ApiModelProperty(value = "退款图片") + private String refundReasonWapImg; + + @ApiModelProperty(value = "退款用户说明") + private String refundReasonWapExplain; + + @ApiModelProperty(value = "退款时间") + private Integer refundReasonTime; + + @ApiModelProperty(value = "前台退款原因") + private String refundReasonWap; + + @ApiModelProperty(value = "不退款的理由") + private String refundReason; + + @ApiModelProperty(value = "退款金额") + private BigDecimal refundPrice; + + @ApiModelProperty(value = "快递名称/送货人姓名") + private String deliveryName; + + @ApiModelProperty(value = "发货类型") + private String deliveryType; + + @ApiModelProperty(value = "快递单号/手机号") + private String deliveryId; + + @ApiModelProperty(value = "消费赚取积分") + private BigDecimal gainIntegral; + + @ApiModelProperty(value = "使用积分") + private BigDecimal useIntegral; + + @ApiModelProperty(value = "给用户退了多少积分") + private BigDecimal backIntegral; + + @ApiModelProperty(value = "备注") + private String mark; + + @ApiModelProperty(value = "是否删除") + private Integer isDel; + + @ApiModelProperty(value = "唯一id(md5加密)类似id") + @TableField(value = "`unique`") + private String unique; + + @ApiModelProperty(value = "管理员备注") + private String remark; + + @ApiModelProperty(value = "商户ID") + private Integer merId; + + private Integer isMerCheck; + + @ApiModelProperty(value = "拼团产品id0一般产品") + private Integer combinationId; + + @ApiModelProperty(value = "拼团id 0没有拼团") + private Integer pinkId; + + @ApiModelProperty(value = "成本价") + private BigDecimal cost; + + @ApiModelProperty(value = "秒杀产品ID") + private Integer seckillId; + + @ApiModelProperty(value = "砍价id") + private Integer bargainId; + + @ApiModelProperty(value = "核销码") + private String verifyCode; + + @ApiModelProperty(value = "门店id") + private Integer storeId; + + @ApiModelProperty(value = "配送方式 1=快递 ,2=门店自提") + private Integer shippingType; + + @ApiModelProperty(value = "支付渠道(0微信公众号1微信小程序)") + private Integer isChannel; + + private Integer isRemind; + + private Integer isSystemDel; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrderCartInfo.java b/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrderCartInfo.java new file mode 100644 index 00000000..7f36b471 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrderCartInfo.java @@ -0,0 +1,48 @@ +package co.yixiang.modules.order.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 订单购物详情表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxStoreOrderCartInfo对象", description = "订单购物详情表") +public class YxStoreOrderCartInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "订单id") + private Integer oid; + + @ApiModelProperty(value = "购物车id") + private Integer cartId; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "购买东西的详细信息") + private String cartInfo; + + @ApiModelProperty(value = "唯一id") + @TableField(value = "`unique`") + private String unique; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrderStatus.java b/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrderStatus.java new file mode 100644 index 00000000..74eb1367 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/entity/YxStoreOrderStatus.java @@ -0,0 +1,43 @@ +package co.yixiang.modules.order.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 订单操作记录表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxStoreOrderStatus对象", description = "订单操作记录表") +public class YxStoreOrderStatus extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "订单id") + private Integer oid; + + @ApiModelProperty(value = "操作类型") + private String changeType; + + @ApiModelProperty(value = "操作备注") + private String changeMessage; + + @ApiModelProperty(value = "操作时间") + private Integer changeTime; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderCartInfoMapper.java b/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderCartInfoMapper.java new file mode 100644 index 00000000..a8dca048 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderCartInfoMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.order.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.order.entity.YxStoreOrderCartInfo; +import co.yixiang.modules.order.web.param.YxStoreOrderCartInfoQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderCartInfoQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 订单购物详情表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxStoreOrderCartInfoMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreOrderCartInfoQueryVo getYxStoreOrderCartInfoById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreOrderCartInfoQueryParam + * @return + */ + IPage getYxStoreOrderCartInfoPageList(@Param("page") Page page, @Param("param") YxStoreOrderCartInfoQueryParam yxStoreOrderCartInfoQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderMapper.java b/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderMapper.java new file mode 100644 index 00000000..0f648329 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderMapper.java @@ -0,0 +1,45 @@ +package co.yixiang.modules.order.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.order.entity.YxStoreOrder; +import co.yixiang.modules.order.web.param.YxStoreOrderQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 订单表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxStoreOrderMapper extends BaseMapper { + + @Select("select IFNULL(sum(pay_price),0) from yx_store_order " + + "where paid=1 and is_del=0 and refund_status=0 and uid=#{uid}") + double sumPrice(@Param("uid") int uid); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreOrderQueryVo getYxStoreOrderById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreOrderQueryParam + * @return + */ + IPage getYxStoreOrderPageList(@Param("page") Page page, @Param("param") YxStoreOrderQueryParam yxStoreOrderQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderStatusMapper.java b/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderStatusMapper.java new file mode 100644 index 00000000..13ee4685 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/mapper/YxStoreOrderStatusMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.order.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.order.entity.YxStoreOrderStatus; +import co.yixiang.modules.order.web.param.YxStoreOrderStatusQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderStatusQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 订单操作记录表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxStoreOrderStatusMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreOrderStatusQueryVo getYxStoreOrderStatusById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreOrderStatusQueryParam + * @return + */ + IPage getYxStoreOrderStatusPageList(@Param("page") Page page, @Param("param") YxStoreOrderStatusQueryParam yxStoreOrderStatusQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/mapping/OrderMap.java b/yshop-api/src/main/java/co/yixiang/modules/order/mapping/OrderMap.java new file mode 100644 index 00000000..132fb9b4 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/mapping/OrderMap.java @@ -0,0 +1,17 @@ +package co.yixiang.modules.order.mapping; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.order.entity.YxStoreOrder; +import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + + +/** +* @author hupeng +* @date 2019-10-26 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface OrderMap extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderCartInfoService.java b/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderCartInfoService.java new file mode 100644 index 00000000..facca1ac --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderCartInfoService.java @@ -0,0 +1,28 @@ +package co.yixiang.modules.order.service; + +import co.yixiang.modules.order.entity.YxStoreOrderCartInfo; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.order.web.param.YxStoreOrderCartInfoQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderCartInfoQueryVo; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 订单购物详情表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxStoreOrderCartInfoService extends BaseService { + + void saveCartInfo(Integer oid, List cartInfo); + + YxStoreOrderCartInfo findByUni(String unique); + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java b/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java new file mode 100644 index 00000000..b4d2ac9a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java @@ -0,0 +1,81 @@ +package co.yixiang.modules.order.service; + +import co.yixiang.modules.order.entity.YxStoreOrder; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.order.web.dto.*; +import co.yixiang.modules.order.web.param.OrderParam; +import co.yixiang.modules.order.web.param.RefundParam; +import co.yixiang.modules.order.web.param.YxStoreOrderQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; +import com.github.binarywang.wxpay.exception.WxPayException; + + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 订单表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxStoreOrderService extends BaseService { + + void orderApplyRefund(RefundParam param,int uid); + + void removeOrder(String orderId,int uid); + + void gainUserIntegral(YxStoreOrderQueryVo order); + + void takeOrder(String orderId,int uid); + + List orderList(int uid,int type,int page,int limit); + + OrderCountDTO orderData(int uid); + + YxStoreOrderQueryVo handleOrder(YxStoreOrderQueryVo order); + + void paySuccess(String orderId,String payType); + + void yuePay(String orderId,int uid); + + WxPayMpOrderResult wxPay(String orderId) throws WxPayException; + + void delCacheOrderInfo(int uid, String key); + + YxStoreOrder createOrder(int uid, String key, OrderParam param); + + ComputeDTO computedOrder(int uid, String key, int couponId, + int useIntegral, int shippingType); + + YxStoreOrderQueryVo getOrderInfo(String unique,int uid); + + String cacheOrderInfo(int uid,List cartInfo, + PriceGroupDTO priceGroup,OtherDTO other); + + CacheDTO getCacheOrderInfo(int uid, String key); + + PriceGroupDTO getOrderPriceGroup(List cartInfo); + + Double getOrderSumPrice(List cartInfo,String key); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreOrderQueryVo getYxStoreOrderById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreOrderQueryParam + * @return + */ + Paging getYxStoreOrderPageList(YxStoreOrderQueryParam yxStoreOrderQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderStatusService.java b/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderStatusService.java new file mode 100644 index 00000000..4957dd78 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/service/YxStoreOrderStatusService.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.order.service; + +import co.yixiang.modules.order.entity.YxStoreOrderStatus; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.order.web.param.YxStoreOrderStatusQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderStatusQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 订单操作记录表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxStoreOrderStatusService extends BaseService { + + void create(int oid,String changetype,String changeMessage); +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderCartInfoServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderCartInfoServiceImpl.java new file mode 100644 index 00000000..cfc742d4 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderCartInfoServiceImpl.java @@ -0,0 +1,70 @@ +package co.yixiang.modules.order.service.impl; + +import cn.hutool.core.util.IdUtil; +import co.yixiang.modules.order.entity.YxStoreOrderCartInfo; +import co.yixiang.modules.order.mapper.YxStoreOrderCartInfoMapper; +import co.yixiang.modules.order.service.YxStoreOrderCartInfoService; +import co.yixiang.modules.order.web.param.YxStoreOrderCartInfoQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderCartInfoQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + *

+ * 订单购物详情表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreOrderCartInfoServiceImpl extends BaseServiceImpl implements YxStoreOrderCartInfoService { + + @Autowired + private YxStoreOrderCartInfoMapper yxStoreOrderCartInfoMapper; + + + @Override + public YxStoreOrderCartInfo findByUni(String unique) { + QueryWrapper wrapper= new QueryWrapper<>(); + wrapper.eq("`unique`",unique); + return yxStoreOrderCartInfoMapper.selectOne(wrapper); + } + + @Override + public void saveCartInfo(Integer oid, List cartInfo) { + + List list = new ArrayList<>(); + for (YxStoreCartQueryVo cart : cartInfo) { + YxStoreOrderCartInfo info = new YxStoreOrderCartInfo(); + info.setOid(oid); + info.setCartId(cart.getId().intValue()); + info.setProductId(cart.getProductId()); + info.setCartInfo(JSONObject.toJSON(cart).toString()); + info.setUnique(IdUtil.simpleUUID()); + list.add(info); + } + + saveBatch(list); + } + + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java new file mode 100644 index 00000000..02700f11 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java @@ -0,0 +1,798 @@ +package co.yixiang.modules.order.service.impl; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.exception.ErrorRequestException; +import co.yixiang.modules.monitor.service.RedisService; +import co.yixiang.modules.order.entity.YxStoreOrder; +import co.yixiang.modules.order.entity.YxStoreOrderCartInfo; +import co.yixiang.modules.order.mapper.YxStoreOrderMapper; +import co.yixiang.modules.order.mapping.OrderMap; +import co.yixiang.modules.order.service.YxStoreOrderCartInfoService; +import co.yixiang.modules.order.service.YxStoreOrderService; +import co.yixiang.modules.order.service.YxStoreOrderStatusService; +import co.yixiang.modules.order.web.dto.*; +import co.yixiang.modules.order.web.param.OrderParam; +import co.yixiang.modules.order.web.param.RefundParam; +import co.yixiang.modules.order.web.param.YxStoreOrderQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.entity.YxStoreCart; +import co.yixiang.modules.shop.mapper.YxStoreCartMapper; +import co.yixiang.modules.shop.service.YxStoreProductReplyService; +import co.yixiang.modules.shop.service.YxStoreProductService; +import co.yixiang.modules.shop.service.YxSystemConfigService; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import co.yixiang.modules.user.entity.YxUser; +import co.yixiang.modules.user.entity.YxUserAddress; +import co.yixiang.modules.user.entity.YxUserBill; +import co.yixiang.modules.user.entity.YxWechatUser; +import co.yixiang.modules.user.service.YxUserAddressService; +import co.yixiang.modules.user.service.YxUserBillService; +import co.yixiang.modules.user.service.YxUserService; +import co.yixiang.modules.user.service.YxWechatUserService; +import co.yixiang.modules.user.web.controller.UserAddressController; +import co.yixiang.modules.user.web.vo.YxUserAddressQueryVo; +import co.yixiang.modules.user.web.vo.YxUserQueryVo; +import co.yixiang.modules.user.web.vo.YxWechatUserQueryVo; +import co.yixiang.utils.OrderUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; +import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + +/** + *

+ * 订单表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreOrderServiceImpl extends BaseServiceImpl implements YxStoreOrderService { + + @Autowired + private YxStoreOrderMapper yxStoreOrderMapper; + + @Autowired + private YxSystemConfigService systemConfigService; + + @Autowired + private RedisService redisService; + + @Autowired + private OrderMap orderMap; + + @Autowired + private YxUserService userService; + + @Autowired + private YxUserAddressService userAddressService; + + @Autowired + private YxStoreProductService productService; + + @Autowired + private YxStoreOrderCartInfoService orderCartInfoService; + + @Autowired + private YxStoreCartMapper storeCartMapper; + + @Autowired + private YxStoreOrderStatusService orderStatusService; + + @Autowired + private YxUserBillService billService; + + @Autowired + private YxStoreProductReplyService storeProductReplyService; + + @Autowired + private WxPayService wxPayService; + + @Autowired + private YxWechatUserService wechatUserService; + + + /** + * 奖励积分 + * @param order + */ + @Override + public void gainUserIntegral(YxStoreOrderQueryVo order) { + if(order.getGainIntegral().intValue() > 0){ + YxUserQueryVo userQueryVo = userService + .getYxUserById(order.getUid()); + + YxUser user = new YxUser(); + + user.setIntegral(NumberUtil.add(userQueryVo.getIntegral(), + order.getGainIntegral())); + user.setUid(order.getUid()); + userService.updateById(user); + + YxUserBill userBill = new YxUserBill(); + userBill.setUid(order.getUid()); + userBill.setTitle("购买商品赠送积分"); + userBill.setLinkId(order.getId().toString()); + userBill.setCategory("integral"); + userBill.setType("gain"); + userBill.setNumber(order.getGainIntegral()); + userBill.setBalance(userQueryVo.getIntegral()); + userBill.setMark("购买商品赠送"); + userBill.setStatus(1); + userBill.setPm(1); + userBill.setAddTime(OrderUtil.getSecondTimestampTwo()); + billService.save(userBill); + + } + } + + + /** + * 删除订单 + * @param orderId + * @param uid + */ + @Override + public void removeOrder(String orderId, int uid) { + YxStoreOrderQueryVo order = getOrderInfo(orderId,uid); + if(ObjectUtil.isNull(order)) throw new ErrorRequestException("订单不存在"); + order = handleOrder(order); + if(!order.get_status().get_type().equals("0") && + !order.get_status().get_type().equals("-2") && + !order.get_status().get_type().equals("4")) { + throw new ErrorRequestException("该订单无法删除"); + } + + YxStoreOrder storeOrder = new YxStoreOrder(); + storeOrder.setIsDel(1); + storeOrder.setId(order.getId()); + yxStoreOrderMapper.updateById(storeOrder); + + //增加状态 + orderStatusService.create(order.getId(),"remove_order","删除订单"); + } + + /** + * 订单确认收货 + * @param orderId + * @param uid + */ + @Override + public void takeOrder(String orderId, int uid) { + YxStoreOrderQueryVo order = getOrderInfo(orderId,uid); + if(ObjectUtil.isNull(order)) throw new ErrorRequestException("订单不存在"); + order = handleOrder(order); + if(!order.get_status().get_type().equals("2")) throw new ErrorRequestException("订单状态错误"); + + YxStoreOrder storeOrder = new YxStoreOrder(); + storeOrder.setStatus(2); + storeOrder.setId(order.getId()); + yxStoreOrderMapper.updateById(storeOrder); + + //增加状态 + orderStatusService.create(order.getId(),"user_take_delivery","用户已收货"); + + //奖励积分 + gainUserIntegral(order); + + //todo 分销计算 + + } + + /** + * 申请退款 + * @param param + * @param uid + */ + @Override + public void orderApplyRefund(RefundParam param, int uid) { + YxStoreOrderQueryVo order = getOrderInfo(param.getUni(),uid); + if(ObjectUtil.isNull(order)) throw new ErrorRequestException("订单不存在"); + if(order.getRefundStatus() == 2) throw new ErrorRequestException("订单已退款"); + if(order.getRefundStatus() == 1) throw new ErrorRequestException("正在申请退款中"); + if(order.getStatus() == 1 ) throw new ErrorRequestException("订单当前无法退款"); + + YxStoreOrder storeOrder = new YxStoreOrder(); + storeOrder.setRefundStatus(1); + storeOrder.setRefundReasonTime(OrderUtil.getSecondTimestampTwo()); + storeOrder.setRefundReasonWapExplain(param.getRefund_reason_wap_explain()); + storeOrder.setRefundReasonWapImg(param.getRefund_reason_wap_img()); + storeOrder.setRefundReasonWap(param.getText()); + storeOrder.setId(order.getId()); + yxStoreOrderMapper.updateById(storeOrder); + + //增加状态 + orderStatusService.create(order.getId(),"apply_refund","用户申请退款,原因:"+param.getText()); + + //todo 推送 + } + + /** + * 订单列表 + * @param uid + * @param type + * @param page + * @param limit + * @return + */ + @Override + public List orderList(int uid, int type, int page, int limit) { + QueryWrapper wrapper= new QueryWrapper<>(); + wrapper.eq("is_del",0).eq("uid",uid).orderByDesc("add_time"); + + switch (type){ + case 0://未支付 + wrapper.eq("paid",0).eq("refund_status",0).eq("status",0); + break; + case 1://待发货 + wrapper.eq("paid",1).eq("refund_status",0).eq("status",0); + break; + case 2://待收货 + wrapper.eq("paid",1).eq("refund_status",0).eq("status",1); + break; + case 3://待评价 + wrapper.eq("paid",1).eq("refund_status",0).eq("status",2); + break; + case 4://已完成 + wrapper.eq("paid",1).eq("refund_status",0).eq("status",3); + break; + case -1://退款中 + wrapper.eq("paid",1).eq("refund_status",1); + break; + case -2://已退款 + wrapper.eq("paid",0).eq("refund_status",2); + break; + case -3://退款 + String[] strs = {"1","2"}; + wrapper.eq("paid",1).in("refund_status",strs); + break; + } + + Page pageModel = new Page<>(page, limit); + + IPage pageList = yxStoreOrderMapper.selectPage(pageModel,wrapper); + List list = orderMap.toDto(pageList.getRecords()); + List newList = new ArrayList<>(); + for (YxStoreOrderQueryVo order : list) { + YxStoreOrderQueryVo orderQueryVo = handleOrder(order); + newList.add(orderQueryVo); + } + + return newList; + } + + /** + * 获取某个用户的订单统计数据 + * @return + */ + @Override + public OrderCountDTO orderData(int uid) { + + OrderCountDTO countDTO = new OrderCountDTO(); + //订单支付没有退款 数量 + QueryWrapper wrapperOne = new QueryWrapper<>(); + wrapperOne.eq("is_del",0).eq("paid",1) + .eq("uid",uid).eq("refund_status",0); + countDTO.setOrderCount(yxStoreOrderMapper.selectCount(wrapperOne)); + + //订单支付没有退款 支付总金额 + countDTO.setSumPrice(yxStoreOrderMapper.sumPrice(uid)); + + //订单待支付 数量 + QueryWrapper wrapperTwo = new QueryWrapper<>(); + wrapperTwo.eq("is_del",0).eq("paid",0) + .eq("uid",uid).eq("refund_status",0).eq("status",0); + countDTO.setUnpaidCount(yxStoreOrderMapper.selectCount(wrapperTwo)); + + //订单待发货 数量 + QueryWrapper wrapperThree = new QueryWrapper<>(); + wrapperThree.eq("is_del",0).eq("paid",1) + .eq("uid",uid).eq("refund_status",0).eq("status",0); + countDTO.setUnshippedCount(yxStoreOrderMapper.selectCount(wrapperThree)); + + //订单待收货 数量 + QueryWrapper wrapperFour = new QueryWrapper<>(); + wrapperFour.eq("is_del",0).eq("paid",1) + .eq("uid",uid).eq("refund_status",0).eq("status",1); + countDTO.setReceivedCount(yxStoreOrderMapper.selectCount(wrapperFour)); + + //订单待评价 数量 + QueryWrapper wrapperFive = new QueryWrapper<>(); + wrapperFive.eq("is_del",0).eq("paid",1) + .eq("uid",uid).eq("refund_status",0).eq("status",2); + countDTO.setEvaluatedCount(yxStoreOrderMapper.selectCount(wrapperFive)); + + //订单已完成 数量 + QueryWrapper wrapperSix= new QueryWrapper<>(); + wrapperSix.eq("is_del",0).eq("paid",1) + .eq("uid",uid).eq("refund_status",0).eq("status",3); + countDTO.setCompleteCount(yxStoreOrderMapper.selectCount(wrapperSix)); + + //订单退款 + QueryWrapper wrapperSeven= new QueryWrapper<>(); + String[] strArr = {"1","2"}; + wrapperSeven.eq("is_del",0).eq("paid",1) + .eq("uid",uid).in("refund_status",strArr); + countDTO.setRefundCount(yxStoreOrderMapper.selectCount(wrapperSeven)); + + + return countDTO; + } + + /** + * 处理订单返回的状态 + * @param order order + * @return + */ + @Override + public YxStoreOrderQueryVo handleOrder(YxStoreOrderQueryVo order) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("oid",order.getId()); + List cartInfos = orderCartInfoService.list(wrapper); + + List cartInfo = new ArrayList<>(); + for (YxStoreOrderCartInfo info : cartInfos) { + YxStoreCartQueryVo cartQueryVo = JSON.parseObject(info.getCartInfo(),YxStoreCartQueryVo.class); + cartQueryVo.setUnique(info.getUnique()); + //新增是否评价字段 + cartQueryVo.setIsReply(storeProductReplyService.replyCount(info.getUnique())); + cartInfo.add(cartQueryVo); + } + order.setCartInfo(cartInfo); + StatusDTO statusDTO = new StatusDTO(); + if(order.getPaid() == 0){ + statusDTO.set_class("nobuy"); + statusDTO.set_msg("请完成支付"); + statusDTO.set_type("0"); + statusDTO.set_title("未支付"); + }else if(order.getRefundStatus() == 1){ + statusDTO.set_class("state-sqtk"); + statusDTO.set_msg("商家审核中,请耐心等待"); + statusDTO.set_type("-1"); + statusDTO.set_title("申请退款中"); + }else if(order.getRefundStatus() == 2){ + statusDTO.set_class("state-sqtk"); + statusDTO.set_msg("已为您退款,感谢您的支持"); + statusDTO.set_type("-2"); + statusDTO.set_title("已退款"); + }else if(order.getStatus() == 0){ + //todo 拼团 + //todo 店铺核销 + statusDTO.set_class("state-nfh"); + statusDTO.set_msg("商家未发货,请耐心等待"); + statusDTO.set_type("1"); + statusDTO.set_title("未发货"); + }else if(order.getStatus() == 1){ + statusDTO.set_class("state-ysh"); + statusDTO.set_msg("服务商已发货"); + statusDTO.set_type("2"); + statusDTO.set_title("待收货"); + }else if(order.getStatus() == 2){ + statusDTO.set_class("state-ypj"); + statusDTO.set_msg("已收货,快去评价一下吧"); + statusDTO.set_type("3"); + statusDTO.set_title("待评价"); + }else if(order.getStatus() == 3){ + statusDTO.set_class("state-ytk"); + statusDTO.set_msg("交易完成,感谢您的支持"); + statusDTO.set_type("4"); + statusDTO.set_title("交易完成"); + } + + if(order.getPayType().equals("weixin")){ + statusDTO.set_payType("微信支付"); + }else{ + statusDTO.set_payType("余额支付"); + } + + order.set_status(statusDTO); + + + return order; + } + + /** + * 支付成功后操作 + * @param orderId 订单号 + * @param payType 支付方式 + */ + @Override + public void paySuccess(String orderId, String payType) { + YxStoreOrderQueryVo orderInfo = getOrderInfo(orderId,0); + //System.out.println("orderInfo:"+orderInfo); + + //更新订单状态 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("order_id",orderId); + YxStoreOrder storeOrder = new YxStoreOrder(); + storeOrder.setPaid(1); + storeOrder.setPayType(payType); + storeOrder.setPayTime(OrderUtil.getSecondTimestampTwo()); + yxStoreOrderMapper.update(storeOrder,wrapper); + + //增加用户购买次数 + userService.incPayCount(orderInfo.getUid()); + //增加状态 + orderStatusService.create(orderInfo.getId(),"pay_success","用户付款成功"); + + //todo 拼团 + //todo 模板消息推送 + } + + /** + * 微信支付 + * @param orderId + */ + @Override + public WxPayMpOrderResult wxPay(String orderId) throws WxPayException { + YxStoreOrderQueryVo orderInfo = getOrderInfo(orderId,0); + if(ObjectUtil.isNull(orderInfo)) throw new ErrorRequestException("订单不存在"); + if(orderInfo.getPaid() == 1) throw new ErrorRequestException("该订单已支付"); + + if(orderInfo.getPayPrice().doubleValue() <= 0) throw new ErrorRequestException("该支付无需支付"); + + WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest(); + YxWechatUser wechatUser = wechatUserService.getById(orderInfo.getUid()); + if(ObjectUtil.isNull(wechatUser)) throw new ErrorRequestException("用户错误"); + orderRequest.setBody("商品购买"); + orderRequest.setOutTradeNo(orderId); + BigDecimal bigDecimal = new BigDecimal(100); + orderRequest.setTotalFee(bigDecimal.multiply(orderInfo.getPayPrice()).intValue());//元转成分 + orderRequest.setOpenid(wechatUser.getOpenid()); + orderRequest.setSpbillCreateIp("127.0.0.1"); + orderRequest.setNotifyUrl("https://h5api.dayouqiantu.cn/api/wechat/notify"); + orderRequest.setTradeType("JSAPI"); + + WxPayMpOrderResult orderResult = wxPayService.createOrder(orderRequest); + + return orderResult; + + } + + /** + * 余额支付 + * @param orderId 订单号 + * @param uid 用户id + */ + @Override + public void yuePay(String orderId, int uid) { + YxStoreOrderQueryVo orderInfo = getOrderInfo(orderId,uid); + if(ObjectUtil.isNull(orderInfo)) throw new ErrorRequestException("订单不存在"); + + if(orderInfo.getPaid() == 1) throw new ErrorRequestException("该订单已支付"); + + YxUserQueryVo userInfo = userService.getYxUserById(uid); + + if(userInfo.getNowMoney().doubleValue() < orderInfo.getPayPrice().doubleValue()){ + throw new ErrorRequestException("余额不足"); + } + + userService.decPrice(uid,orderInfo.getPayPrice().doubleValue()); + + YxUserBill userBill = new YxUserBill(); + userBill.setUid(uid); + userBill.setTitle("购买商品"); + userBill.setLinkId(orderInfo.getId().toString()); + userBill.setCategory("now_money"); + userBill.setType("pay_product"); + userBill.setNumber(orderInfo.getPayPrice()); + userBill.setBalance(userInfo.getNowMoney()); + userBill.setMark("余额支付"); + userBill.setStatus(1); + userBill.setPm(0); + userBill.setAddTime(OrderUtil.getSecondTimestampTwo()); + billService.save(userBill); + + //支付成功后处理 + paySuccess(orderInfo.getOrderId(),"yue"); + + } + + /** + * 创建订单 + * @param uid uid + * @param key key + * @param param param + * @return + */ + @Override + public YxStoreOrder createOrder(int uid, String key, OrderParam param) { + YxUserQueryVo userInfo = userService.getYxUserById(uid); + if(ObjectUtil.isNull(userInfo)) throw new ErrorRequestException("用户不存在"); + + CacheDTO cacheDTO = getCacheOrderInfo(uid,key); + if(ObjectUtil.isNull(cacheDTO)){ + throw new ErrorRequestException("订单已过期,请刷新当前页面"); + } + + List cartInfo = cacheDTO.getCartInfo(); + Double totalPrice = cacheDTO.getPriceGroup().getTotalPrice(); + Double payPrice = cacheDTO.getPriceGroup().getTotalPrice(); + Double payPostage = cacheDTO.getPriceGroup().getStorePostage(); + OtherDTO other = cacheDTO.getOther(); + YxUserAddressQueryVo userAddress = null; + if(param.getShippingType() == 1){ + if(StrUtil.isEmpty(param.getAddressId())) throw new ErrorRequestException("请选择收货地址"); + userAddress = userAddressService.getYxUserAddressById(param.getAddressId()); + if(ObjectUtil.isNull(userAddress)) throw new ErrorRequestException("地址选择有误"); + } + + Integer totalNum = 0; + Integer gainIntegral = 0; + List cartIds = new ArrayList<>(); + + for (YxStoreCartQueryVo cart : cartInfo) { + cartIds.add(cart.getId().toString()); + totalNum += cart.getCartNum(); + //计算积分 + BigDecimal cartInfoGainIntegral = BigDecimal.ZERO; + if(cart.getProductInfo().getGiveIntegral().intValue() > 0){ + cartInfoGainIntegral = NumberUtil.mul(cart.getCartNum(),cart. + getProductInfo().getGiveIntegral()); + } + gainIntegral = NumberUtil.add(gainIntegral,cartInfoGainIntegral).intValue(); + } + + //todo 优惠券 + int couponId = 0; + Double couponPrice = 0d; + if(ObjectUtil.isNotEmpty(param.getCouponId())){ + //todo + } + //todo 门店等二期 + + if(param.getShippingType() == 1){ + payPrice = NumberUtil.add(payPrice,payPostage); + } + + //todo 积分抵扣 + + if(payPrice <= 0) payPrice = 0d; + + //组合数据 + YxStoreOrder storeOrder = new YxStoreOrder(); + storeOrder.setUid(uid); + storeOrder.setOrderId(OrderUtil.orderSn()); + storeOrder.setRealName(userAddress.getRealName()); + storeOrder.setUserPhone(userAddress.getPhone()); + storeOrder.setUserAddress(userAddress.getProvince()+" "+userAddress.getCity()+ + " "+userAddress.getDistrict()+" "+userAddress.getDetail()); + storeOrder.setCartId(StrUtil.join(",",cartIds)); + storeOrder.setTotalNum(totalNum); + storeOrder.setTotalPrice(BigDecimal.valueOf(totalPrice)); + storeOrder.setTotalPostage(BigDecimal.valueOf(payPostage)); + storeOrder.setCouponId(couponId); + storeOrder.setCouponPrice(BigDecimal.valueOf(couponPrice)); + storeOrder.setPayPrice(BigDecimal.valueOf(payPrice)); + storeOrder.setPayPostage(BigDecimal.valueOf(payPostage)); + storeOrder.setDeductionPrice(BigDecimal.ZERO); + storeOrder.setPaid(0); + storeOrder.setPayType(param.getPayType()); + storeOrder.setUseIntegral(BigDecimal.valueOf(param.getUseIntegral())); + storeOrder.setGainIntegral(BigDecimal.valueOf(gainIntegral)); + storeOrder.setMark(param.getMark()); + storeOrder.setCombinationId(0); + storeOrder.setPinkId(0); + storeOrder.setSeckillId(0); + storeOrder.setBargainId(0); + storeOrder.setCost(BigDecimal.valueOf(cacheDTO.getPriceGroup().getCostPrice())); + storeOrder.setIsChannel(param.getIsChannel()); + storeOrder.setAddTime(OrderUtil.getSecondTimestampTwo()); + storeOrder.setUnique(key); + storeOrder.setShippingType(param.getShippingType()); + + boolean res = save(storeOrder); + if(!res) throw new ErrorRequestException("订单生成失败"); + + //减库存加销量 + for (YxStoreCartQueryVo cart : cartInfo) { + productService.decProductStock(cart.getCartNum(),cart.getProductId(), + cart.getProductAttrUnique()); + } + + //保存购物车商品信息 + orderCartInfoService.saveCartInfo(storeOrder.getId(),cartInfo); + + //购物车状态修改 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.in("id",cartIds); + YxStoreCart cartObj = new YxStoreCart(); + cartObj.setIsPay(1); + storeCartMapper.update(cartObj,wrapper); + + //删除缓存 + delCacheOrderInfo(uid,key); + + //增加状态 + orderStatusService.create(storeOrder.getId(),"cache_key_create_order","订单生成"); + + + + return storeOrder; + } + + /** + * 计算价格 + * @param key + * @param couponId + * @param useIntegral + * @param shippingType + * @return + */ + @Override + public ComputeDTO computedOrder(int uid, String key, int couponId, + int useIntegral, int shippingType) { + CacheDTO cacheDTO = getCacheOrderInfo(uid,key); + if(ObjectUtil.isNull(cacheDTO)){ + throw new ErrorRequestException("订单已过期,请刷新当前页面"); + } + ComputeDTO computeDTO = new ComputeDTO(); + computeDTO.setTotalPrice(cacheDTO.getPriceGroup().getTotalPrice()); + Double payPrice = cacheDTO.getPriceGroup().getTotalPrice(); + Double payPostage = cacheDTO.getPriceGroup().getStorePostage(); + //todo 优惠券 + + //todo 积分抵扣 + computeDTO.setPayPrice(payPrice); + computeDTO.setPayPostage(payPostage); + computeDTO.setCouponPrice(0d); + computeDTO.setDeductionPrice(0d); + + return computeDTO; + } + + /** + * 订单信息 + * @param unique + * @param uid + * @return + */ + @Override + public YxStoreOrderQueryVo getOrderInfo(String unique,int uid) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_del",0).and( + i->i.eq("order_id",unique).or().eq("`unique`",unique)); + if(uid > 0) wrapper.eq("uid",uid); + + return orderMap.toDto(yxStoreOrderMapper.selectOne(wrapper)); + } + + @Override + public CacheDTO getCacheOrderInfo(int uid, String key) { + + return (CacheDTO)redisService.getObj("user_order_"+uid+key); + } + + @Override + public void delCacheOrderInfo(int uid, String key) { + redisService.delete("user_order_"+uid+key); + } + + /** + * 缓存订单 + * @param uid uid + * @param cartInfo cartInfo + * @param priceGroup priceGroup + * @param other other + * @return + */ + @Override + public String cacheOrderInfo(int uid, List cartInfo, PriceGroupDTO priceGroup, OtherDTO other) { + String key = IdUtil.simpleUUID(); + CacheDTO cacheDTO = new CacheDTO(); + cacheDTO.setCartInfo(cartInfo); + cacheDTO.setPriceGroup(priceGroup); + cacheDTO.setOther(other); + redisService.saveCode("user_order_"+uid+key,cacheDTO,600L); + return key; + } + + /** + * 获取订单价格 + * @param cartInfo + * @return + */ + @Override + public PriceGroupDTO getOrderPriceGroup(List cartInfo) { + + String storePostageStr = systemConfigService.getData("store_postage");//邮费基础价 + Double storePostage = 0d; + if(StrUtil.isNotEmpty(storePostageStr)) storePostage = Double.valueOf(storePostageStr); + + String storeFreePostageStr = systemConfigService.getData("store_free_postage");//满额包邮 + Double storeFreePostage = 0d; + if(StrUtil.isNotEmpty(storeFreePostageStr)) storeFreePostage = Double.valueOf(storeFreePostageStr); + + Double totalPrice = getOrderSumPrice(cartInfo, "truePrice");//获取订单总金额 + Double costPrice = getOrderSumPrice(cartInfo, "costPrice");//获取订单成本价 + Double vipPrice = getOrderSumPrice(cartInfo, "vipTruePrice");//获取订单会员优惠金额 + + if(storeFreePostage == 0){//包邮 + storePostage = 0d; + }else{ + for (YxStoreCartQueryVo storeCart : cartInfo) { + if(storeCart.getProductInfo().getIsPostage() == 0){//不包邮 + storePostage = NumberUtil.add(storePostage + ,storeCart.getProductInfo().getPostage()).doubleValue(); + } + } + //如果总价大于等于满额包邮 邮费等于0 + if (storeFreePostage <= totalPrice) storePostage = 0d; + } + + PriceGroupDTO priceGroupDTO = new PriceGroupDTO(); + priceGroupDTO.setStorePostage(storePostage); + priceGroupDTO.setStoreFreePostage(storeFreePostage); + priceGroupDTO.setTotalPrice(totalPrice); + priceGroupDTO.setCostPrice(costPrice); + priceGroupDTO.setVipPrice(vipPrice); + + return priceGroupDTO; + } + + /** + * 获取某字段价格 + * @param cartInfo + * @param key + * @return + */ + @Override + public Double getOrderSumPrice(List cartInfo, String key) { + BigDecimal sumPrice = BigDecimal.ZERO; + + if(key.equals("truePrice")){ + for (YxStoreCartQueryVo storeCart : cartInfo) { + sumPrice = NumberUtil.add(sumPrice,NumberUtil.mul(storeCart.getCartNum(),storeCart.getTruePrice())); + } + }else if(key.equals("costPrice")){ + for (YxStoreCartQueryVo storeCart : cartInfo) { + sumPrice = NumberUtil.add(sumPrice, + NumberUtil.mul(storeCart.getCartNum(),storeCart.getCostPrice())); + } + }else if(key.equals("vipTruePrice")){ + for (YxStoreCartQueryVo storeCart : cartInfo) { + sumPrice = NumberUtil.add(sumPrice, + NumberUtil.mul(storeCart.getCartNum(),storeCart.getVipTruePrice())); + } + } + + //System.out.println("sumPrice:"+sumPrice); + return sumPrice.doubleValue(); + } + + @Override + public YxStoreOrderQueryVo getYxStoreOrderById(Serializable id) throws Exception{ + return yxStoreOrderMapper.getYxStoreOrderById(id); + } + + @Override + public Paging getYxStoreOrderPageList(YxStoreOrderQueryParam yxStoreOrderQueryParam) throws Exception{ + Page page = setPageParam(yxStoreOrderQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreOrderMapper.getYxStoreOrderPageList(page,yxStoreOrderQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderStatusServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderStatusServiceImpl.java new file mode 100644 index 00000000..3a65acbc --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderStatusServiceImpl.java @@ -0,0 +1,48 @@ +package co.yixiang.modules.order.service.impl; + +import co.yixiang.modules.order.entity.YxStoreOrderStatus; +import co.yixiang.modules.order.mapper.YxStoreOrderStatusMapper; +import co.yixiang.modules.order.service.YxStoreOrderStatusService; +import co.yixiang.modules.order.web.param.YxStoreOrderStatusQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderStatusQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.utils.OrderUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 订单操作记录表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreOrderStatusServiceImpl extends BaseServiceImpl implements YxStoreOrderStatusService { + + @Autowired + private YxStoreOrderStatusMapper yxStoreOrderStatusMapper; + + @Override + public void create(int oid, String changetype, String changeMessage) { + YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus(); + storeOrderStatus.setOid(oid); + storeOrderStatus.setChangeType(changetype); + storeOrderStatus.setChangeMessage(changeMessage); + storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo()); + + yxStoreOrderStatusMapper.insert(storeOrderStatus); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/controller/StoreOrderController.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/controller/StoreOrderController.java new file mode 100644 index 00000000..b794974e --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/controller/StoreOrderController.java @@ -0,0 +1,391 @@ +package co.yixiang.modules.order.web.controller; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.common.web.param.IdParam; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.exception.ErrorRequestException; +import co.yixiang.modules.order.entity.YxStoreOrder; +import co.yixiang.modules.order.entity.YxStoreOrderCartInfo; +import co.yixiang.modules.order.service.YxStoreOrderCartInfoService; +import co.yixiang.modules.order.service.YxStoreOrderService; +import co.yixiang.modules.order.service.YxStoreOrderStatusService; +import co.yixiang.modules.order.web.dto.*; +import co.yixiang.modules.order.web.param.OrderParam; +import co.yixiang.modules.order.web.param.RefundParam; +import co.yixiang.modules.order.web.param.YxStoreOrderQueryParam; +import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo; +import co.yixiang.modules.shop.entity.YxStoreProductReply; +import co.yixiang.modules.shop.service.YxStoreCartService; +import co.yixiang.modules.shop.service.YxStoreProductReplyService; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import co.yixiang.modules.user.service.YxUserAddressService; +import co.yixiang.modules.user.service.YxUserService; +import co.yixiang.utils.OrderUtil; +import co.yixiang.utils.SecurityUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; +import com.github.binarywang.wxpay.exception.WxPayException; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.parameters.P; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.*; + +/** + *

+ * 订单控制器 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@RestController +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@Api(value = "订单模块", tags = "订单模块", description = "订单模块") +public class StoreOrderController extends BaseController { + + private final YxStoreOrderService storeOrderService; + private final YxStoreCartService cartService; + private final YxUserService userService; + private final YxUserAddressService addressService; + private final YxStoreOrderCartInfoService orderCartInfoService; + private final YxStoreProductReplyService productReplyService; + private final YxStoreOrderStatusService orderStatusService; + + + /** + * 订单确认 + */ + @PostMapping("/order/confirm") + @ApiOperation(value = "订单确认",notes = "订单确认") + public ApiResult confirm(@RequestBody String jsonStr){ + JSONObject jsonObject = JSON.parseObject(jsonStr); + String cartId = jsonObject.getString("cartId"); + if(StrUtil.isEmpty(cartId)){ + return ApiResult.fail("请提交购买的商品"); + } + int uid = SecurityUtils.getUserId().intValue(); + Map cartGroup = cartService.getUserProductCartList(uid,cartId,1); + if(ObjectUtil.isNotEmpty(cartGroup.get("invalid"))){ + return ApiResult.fail("有失效的商品请重新提交"); + } + if(ObjectUtil.isEmpty(cartGroup.get("valid"))){ + return ApiResult.fail("请提交购买的商品"); + } + List cartInfo = (List)cartGroup.get("valid"); + PriceGroupDTO priceGroup = storeOrderService.getOrderPriceGroup(cartInfo); + + ConfirmOrderDTO confirmOrderDTO = new ConfirmOrderDTO(); + + //todo 积分抵扣下个版本 + + //todo 优惠券抵扣下个版本 + + //todo 拼团 砍价 秒杀 + + //todo 地址信息 + confirmOrderDTO.setAddressInfo(addressService.getUserDefaultAddress(uid)); + + confirmOrderDTO.setCartInfo(cartInfo); + confirmOrderDTO.setPriceGroup(priceGroup); + confirmOrderDTO.setOrderKey(storeOrderService.cacheOrderInfo(uid,cartInfo, + priceGroup,new OtherDTO())); + //todo VIP会员 + + confirmOrderDTO.setUserInfo(userService.getYxUserById(uid)); + + return ApiResult.ok(confirmOrderDTO); + } + + /** + * 订单创建 + */ + @PostMapping("/order/create/{key}") + @ApiOperation(value = "订单创建",notes = "订单创建") + public ApiResult create(@Valid @RequestBody OrderParam param, + @PathVariable String key){ + + Map map = new LinkedHashMap<>(); + int uid = SecurityUtils.getUserId().intValue(); + if(StrUtil.isEmpty(key)) return ApiResult.fail("参数错误"); + + YxStoreOrderQueryVo storeOrder = storeOrderService.getOrderInfo(key,uid); + if(ObjectUtil.isNotNull(storeOrder)){ + map.put("status","EXTEND_ORDER"); + OrderExtendDTO orderExtendDTO = new OrderExtendDTO(); + orderExtendDTO.setKey(key); + orderExtendDTO.setOrderId(storeOrder.getOrderId()); + map.put("result",orderExtendDTO); + return ApiResult.ok(map,"订单已生成"); + } + + //todo 砍价 + //todo 拼团 + + + if(param.getFrom().equals("weixin")) param.setIsChannel(0); + //创建订单 + YxStoreOrder order = storeOrderService.createOrder(uid,key,param); + + if(ObjectUtil.isNull(order)) throw new ErrorRequestException("订单生成失败"); + + String orderId = order.getOrderId(); + + OrderExtendDTO orderDTO = new OrderExtendDTO(); + orderDTO.setKey(key); + orderDTO.setOrderId(orderId); + map.put("status","SUCCESS"); + map.put("result",orderDTO); + //开始处理支付 + if(StrUtil.isNotEmpty(orderId)){ + switch (param.getPayType()){ + case "weixin": + try { + map.put("status","WECHAT_PAY"); + WxPayMpOrderResult wxPayMpOrderResult = storeOrderService + .wxPay(orderId); + //重新组装 + Map jsConfig = new HashMap<>(); + jsConfig.put("appId",wxPayMpOrderResult.getAppId()); + jsConfig.put("timestamp",wxPayMpOrderResult.getTimeStamp()); + jsConfig.put("nonceStr",wxPayMpOrderResult.getNonceStr()); + jsConfig.put("package",wxPayMpOrderResult.getPackageValue()); + jsConfig.put("signType",wxPayMpOrderResult.getSignType()); + jsConfig.put("paySign",wxPayMpOrderResult.getPaySign()); + orderDTO.setJsConfig(jsConfig); + map.put("result",orderDTO); + return ApiResult.ok(map,"订单创建成功"); + } catch (WxPayException e) { + return ApiResult.fail(e.getMessage()); + } + case "yue": + storeOrderService.yuePay(orderId,uid); + return ApiResult.ok(map,"余额支付成功"); + } + } + + + return ApiResult.fail("订单生成失败"); + } + + /** + * 订单详情 + */ + @GetMapping("/order/list") + @ApiOperation(value = "订单详情",notes = "订单详情") + public ApiResult> orderList(@RequestParam(value = "type",defaultValue = "0") int type, + @RequestParam(value = "page",defaultValue = "1") int page, + @RequestParam(value = "limit",defaultValue = "10") int limit){ + int uid = SecurityUtils.getUserId().intValue(); + + return ApiResult.ok(storeOrderService.orderList(uid,type,page,limit)); + } + + + /** + * 订单详情 + */ + @GetMapping("/order/detail/{key}") + @ApiOperation(value = "订单详情",notes = "订单详情") + public ApiResult detail(@PathVariable String key){ + int uid = SecurityUtils.getUserId().intValue(); + if(StrUtil.isEmpty(key)) return ApiResult.fail("参数错误"); + YxStoreOrderQueryVo storeOrder = storeOrderService.getOrderInfo(key,uid); + if(ObjectUtil.isNull(storeOrder)){ + return ApiResult.fail("订单不存在"); + } + //todo 门店核销 + + return ApiResult.ok(storeOrderService.handleOrder(storeOrder)); + } + + /** + * 计算订单金额 + */ + @PostMapping("/order/computed/{key}") + @ApiOperation(value = "计算订单金额",notes = "计算订单金额") + public ApiResult> computedOrder(@RequestBody String jsonStr, + @PathVariable String key){ + + Map map = new LinkedHashMap<>(); + int uid = SecurityUtils.getUserId().intValue(); + if(StrUtil.isEmpty(key)) return ApiResult.fail("参数错误"); + YxStoreOrderQueryVo storeOrder = storeOrderService.getOrderInfo(key,uid); + if(ObjectUtil.isNotNull(storeOrder)){ + map.put("status","EXTEND_ORDER"); + OrderExtendDTO orderExtendDTO = new OrderExtendDTO(); + orderExtendDTO.setKey(key); + orderExtendDTO.setOrderId(storeOrder.getOrderId()); + map.put("result",orderExtendDTO); + return ApiResult.ok(map,"订单已生成"); + } + + JSONObject jsonObject = JSON.parseObject(jsonStr); + String addressId = jsonObject.getString("addressId"); + String couponId = jsonObject.getString("couponId"); + String shippingType = jsonObject.getString("shipping_type"); + String useIntegral = jsonObject.getString("useIntegral"); + //todo 砍价 + //todo 拼团 + ComputeDTO computeDTO = storeOrderService.computedOrder(uid,key,Integer.valueOf(couponId), + Integer.valueOf(useIntegral),Integer.valueOf(shippingType)); + + map.put("result",computeDTO); + return ApiResult.ok(map); + } + + + /** + * 订单收货 + */ + @PostMapping("/order/take") + @ApiOperation(value = "订单收货",notes = "订单收货") + public ApiResult orderTake(@RequestBody String jsonStr){ + JSONObject jsonObject = JSON.parseObject(jsonStr); + String orderId = jsonObject.getString("uni"); + if(StrUtil.isEmpty(orderId)) return ApiResult.fail("参数错误"); + int uid = SecurityUtils.getUserId().intValue(); + storeOrderService.takeOrder(orderId,uid); + + return ApiResult.ok("ok"); + + } + + /** + * 订单产品信息 + */ + @PostMapping("/order/product") + @ApiOperation(value = "订单产品信息",notes = "订单产品信息") + public ApiResult product(@RequestBody String jsonStr){ + JSONObject jsonObject = JSON.parseObject(jsonStr); + String unique = jsonObject.getString("unique"); + if(StrUtil.isEmpty(unique)) return ApiResult.fail("参数错误"); + + YxStoreOrderCartInfo orderCartInfo = orderCartInfoService.findByUni(unique); + + YxStoreCartQueryVo cartInfo = JSONObject.parseObject(orderCartInfo.getCartInfo(), + YxStoreCartQueryVo.class); + + + OrderCartInfoDTO orderCartInfoDTO = new OrderCartInfoDTO(); + orderCartInfoDTO.setBargainId(cartInfo.getBargainId()); + orderCartInfoDTO.setCartNum(cartInfo.getCartNum()); + orderCartInfoDTO.setCombinationId(cartInfo.getCombinationId()); + orderCartInfoDTO.setOrderId(storeOrderService + .getById(orderCartInfo.getOid()).getOrderId()); + orderCartInfoDTO.setSeckillId(cartInfo.getSeckillId()); + + ProductDTO productDTO = new ProductDTO(); + productDTO.setImage(cartInfo.getProductInfo().getImage()); + productDTO.setPrice(cartInfo.getProductInfo().getPrice().doubleValue()); + productDTO.setStoreName(cartInfo.getProductInfo().getStoreName()); + if(ObjectUtil.isNotEmpty(cartInfo.getProductInfo().getAttrInfo())){ + ProductAttrDTO productAttrDTO = new ProductAttrDTO(); + productAttrDTO.setImage(cartInfo.getProductInfo().getAttrInfo().getImage()); + productAttrDTO.setPrice(cartInfo.getProductInfo().getAttrInfo().getPrice().doubleValue()); + productAttrDTO.setProductId(cartInfo.getProductInfo().getAttrInfo().getProductId()); + productAttrDTO.setSuk(cartInfo.getProductInfo().getAttrInfo().getSuk()); + productDTO.setAttrInfo(productAttrDTO); + } + + orderCartInfoDTO.setProductInfo(productDTO); + + + return ApiResult.ok(orderCartInfoDTO); + + } + + /** + * 订单评价 + */ + @PostMapping("/order/comment") + @ApiOperation(value = "订单评价",notes = "订单评价") + public ApiResult comment(@Valid @RequestBody YxStoreProductReply productReply){ + int uid = SecurityUtils.getUserId().intValue(); + YxStoreOrderCartInfo orderCartInfo = orderCartInfoService + .findByUni(productReply.getUnique()); + if(ObjectUtil.isEmpty(orderCartInfo)) return ApiResult.fail("评价产品不存在"); + + int count = productReplyService.getInfoCount(orderCartInfo.getOid() + ,productReply.getUnique()); + if(count > 0) return ApiResult.fail("该产品已评价"); + + if(productReply.getProductScore() < 1) return ApiResult.fail("请为产品评分"); + if(productReply.getServiceScore() < 1) return ApiResult.fail("请为商家服务评分"); + + productReply.setUid(uid); + productReply.setOid(orderCartInfo.getOid()); + productReply.setProductId(orderCartInfo.getProductId()); + productReply.setAddTime(OrderUtil.getSecondTimestampTwo()); + productReply.setReplyType("product"); + + productReplyService.save(productReply); + + YxStoreOrder storeOrder = new YxStoreOrder(); + storeOrder.setStatus(3); + storeOrder.setId(orderCartInfo.getOid()); + storeOrderService.updateById(storeOrder); + + orderStatusService.create(orderCartInfo.getOid(),"check_order_over","用户评价"); + + return ApiResult.ok("ok"); + + } + + + /** + * 订单删除 + */ + @PostMapping("/order/del") + @ApiOperation(value = "订单删除",notes = "订单删除") + public ApiResult orderDel(@RequestBody String jsonStr){ + JSONObject jsonObject = JSON.parseObject(jsonStr); + String orderId = jsonObject.getString("uni"); + if(StrUtil.isEmpty(orderId)) return ApiResult.fail("参数错误"); + int uid = SecurityUtils.getUserId().intValue(); + storeOrderService.removeOrder(orderId,uid); + + return ApiResult.ok("ok"); + + } + + /** + * 订单退款理由 + */ + @GetMapping("/order/refund/reason") + @ApiOperation(value = "订单退款理由",notes = "订单退款理由") + public ApiResult refundReason(){ + ArrayList list = new ArrayList<>(); + list.add("收货地址填错了"); + list.add("与描述不符"); + list.add("信了息填错,重新拍\\"); + list.add("收到商品损坏了"); + list.add("未按预定时间发货"); + list.add("其它原因"); + + return ApiResult.ok(list); + } + + /** + * 订单退款审核 + */ + @PostMapping("/order/refund/verify") + @ApiOperation(value = "订单退款审核",notes = "订单退款审核") + public ApiResult refundVerify(@RequestBody RefundParam param){ + int uid = SecurityUtils.getUserId().intValue(); + storeOrderService.orderApplyRefund(param,uid); + return ApiResult.ok("ok"); + } + +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/CacheDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/CacheDTO.java new file mode 100644 index 00000000..0998af9c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/CacheDTO.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.order.web.dto; + +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @ClassName CacheDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/27 + **/ +@Data +public class CacheDTO implements Serializable { + private List cartInfo; + private PriceGroupDTO priceGroup; + private OtherDTO other; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ComputeDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ComputeDTO.java new file mode 100644 index 00000000..f52512c1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ComputeDTO.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.order.web.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName ComputeDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/27 + **/ +@Data +public class ComputeDTO implements Serializable { + private Double couponPrice; + private Double deductionPrice; + private Double payPostage; + private Double payPrice; + private Double totalPrice; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ConfirmOrderDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ConfirmOrderDTO.java new file mode 100644 index 00000000..27517bd7 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ConfirmOrderDTO.java @@ -0,0 +1,52 @@ +package co.yixiang.modules.order.web.dto; + +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import co.yixiang.modules.user.entity.YxUserAddress; +import co.yixiang.modules.user.web.vo.YxUserQueryVo; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @ClassName ConfirmOrderDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/27 + **/ +@Data +public class ConfirmOrderDTO implements Serializable { + //地址信息 + private YxUserAddress addressInfo; + + //砍价id + private Integer bargainId = 0; + + private List cartInfo; + + private Integer combinationId = 0; + + //优惠券减 + private Boolean deduction = true; + + //积分抵扣 + private Integer integralRatio = 0; + + private String orderKey; + + private PriceGroupDTO priceGroup; + + private Integer seckillId = 0; + + //店铺自提 + private Integer storeSelfMention = 1; + + //店铺信息 + private List systemStore; + + private String usableCoupon; + + private YxUserQueryVo userInfo; + + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderCartInfoDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderCartInfoDTO.java new file mode 100644 index 00000000..0fc3de40 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderCartInfoDTO.java @@ -0,0 +1,43 @@ +package co.yixiang.modules.order.web.dto; + +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + *

+ * 订单商品对象 + *

+ * + * @author hupeng + * @date 2019-11-03 + */ +@Data +public class OrderCartInfoDTO implements Serializable { + private static final long serialVersionUID = 1L; + + + private String orderId; + + + private Integer productId; + + + private Integer cartNum; + + + private Integer combinationId; + + private Integer seckillId; + + private Integer bargainId; + + private ProductDTO productInfo; + + + + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderCountDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderCountDTO.java new file mode 100644 index 00000000..49739907 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderCountDTO.java @@ -0,0 +1,25 @@ +package co.yixiang.modules.order.web.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName OrderCountDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/30 + **/ +@Data +public class OrderCountDTO implements Serializable { + //订单支付没有退款 数量 + private Integer orderCount; + //订单支付没有退款 支付总金额 + private Double sumPrice; + //订单待支付 数量 + private Integer unpaidCount; + private Integer unshippedCount; //订单待发货 数量 + private Integer receivedCount; //订单待收货 数量 + private Integer evaluatedCount; //订单待评价 数量 + private Integer completeCount; //订单已完成 数量 + private Integer refundCount; //订单退款 +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderExtendDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderExtendDTO.java new file mode 100644 index 00000000..b636ce06 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OrderExtendDTO.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.order.web.dto; + +import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +/** + * @ClassName OrderExtendDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/28 + **/ +@Data +public class OrderExtendDTO implements Serializable { + private String key; + private String orderId; + private Map jsConfig; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OtherDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OtherDTO.java new file mode 100644 index 00000000..9dfe3560 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/OtherDTO.java @@ -0,0 +1,18 @@ +package co.yixiang.modules.order.web.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName OtherDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/27 + **/ +@Data +public class OtherDTO implements Serializable { + //线下包邮 + private String offlinePostage; + //积分抵扣 + private String integralRatio; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/PriceGroupDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/PriceGroupDTO.java new file mode 100644 index 00000000..4373a070 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/PriceGroupDTO.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.order.web.dto; + +import lombok.Data; + +/** + * @ClassName PriceGroup + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/27 + **/ +@Data +public class PriceGroupDTO { + + private Double costPrice; + private Double storeFreePostage; + private Double storePostage; + private Double totalPrice; + private Double vipPrice; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ProductAttrDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ProductAttrDTO.java new file mode 100644 index 00000000..37002010 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ProductAttrDTO.java @@ -0,0 +1,18 @@ +package co.yixiang.modules.order.web.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName ProductAttrDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/11/3 + **/ +@Data +public class ProductAttrDTO implements Serializable { + private Integer productId; + private String suk; + private Double price; + private String image; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ProductDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ProductDTO.java new file mode 100644 index 00000000..29666e2d --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/ProductDTO.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.order.web.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName ProductDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/11/3 + **/ +@Data +public class ProductDTO implements Serializable { + private String image; + private Double price; + private String storeName; + private ProductAttrDTO attrInfo; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/StatusDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/StatusDTO.java new file mode 100644 index 00000000..c3736de3 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/StatusDTO.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.order.web.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName StatusDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/30 + **/ +@Data +public class StatusDTO implements Serializable { + private String _class; + private String _msg; + private String _payType; + private String _title; + private String _type; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/WxPayResultDTO.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/WxPayResultDTO.java new file mode 100644 index 00000000..650ba610 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/dto/WxPayResultDTO.java @@ -0,0 +1,11 @@ +package co.yixiang.modules.order.web.dto; + +import java.io.Serializable; + +/** + * @ClassName WxPayResultDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/11/6 + **/ +public class WxPayResultDTO implements Serializable { +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/param/OrderParam.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/OrderParam.java new file mode 100644 index 00000000..48bf08ff --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/OrderParam.java @@ -0,0 +1,32 @@ +package co.yixiang.modules.order.web.param; + +import io.swagger.models.auth.In; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @ClassName OrderParam + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/28 + **/ +@Data +public class OrderParam implements Serializable { + private String addressId; + private Integer bargainId; + private Integer combinationId; + private Integer couponId; + private String from; + private String mark; + @NotBlank(message="请选择支付方式") + private String payType; + private String phone; + private Integer pinkId; + private String realName; + private Integer seckillId; + private Integer shippingType; + private Double useIntegral; + private Integer isChannel = 1; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/param/RefundParam.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/RefundParam.java new file mode 100644 index 00000000..1bc60993 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/RefundParam.java @@ -0,0 +1,21 @@ +package co.yixiang.modules.order.web.param; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @ClassName RefundParam + * @Author hupeng <610796224@qq.com> + * @Date 2019/11/6 + **/ +@Data +public class RefundParam implements Serializable { + private String refund_reason_wap_explain; + private String refund_reason_wap_img; + @NotBlank(message = "请填写退款原因") + private String text; + @NotBlank(message = "参数错误") + private String uni; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderCartInfoQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderCartInfoQueryParam.java new file mode 100644 index 00000000..c15f330d --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderCartInfoQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.order.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 订单购物详情表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreOrderCartInfoQueryParam对象", description="订单购物详情表查询参数") +public class YxStoreOrderCartInfoQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderQueryParam.java new file mode 100644 index 00000000..f45909b1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.order.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 订单表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreOrderQueryParam对象", description="订单表查询参数") +public class YxStoreOrderQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderStatusQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderStatusQueryParam.java new file mode 100644 index 00000000..2233cd81 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/param/YxStoreOrderStatusQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.order.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 订单操作记录表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreOrderStatusQueryParam对象", description="订单操作记录表查询参数") +public class YxStoreOrderStatusQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderCartInfoQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderCartInfoQueryVo.java new file mode 100644 index 00000000..ad7ba2a9 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderCartInfoQueryVo.java @@ -0,0 +1,41 @@ +package co.yixiang.modules.order.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 订单购物详情表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value = "YxStoreOrderCartInfoQueryVo对象", description = "订单购物详情表查询参数") +public class YxStoreOrderCartInfoQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + private Integer id; + + @ApiModelProperty(value = "订单id") + private Integer oid; + + @ApiModelProperty(value = "购物车id") + private Integer cartId; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "购买东西的详细信息") + private String cartInfo; + + @ApiModelProperty(value = "唯一id") + private String unique; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderQueryVo.java new file mode 100644 index 00000000..45dcd76c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderQueryVo.java @@ -0,0 +1,182 @@ +package co.yixiang.modules.order.web.vo; + +import co.yixiang.modules.order.web.dto.StatusDTO; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + *

+ * 订单表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value = "YxStoreOrderQueryVo对象", description = "订单表查询参数") +public class YxStoreOrderQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "订单ID") + private Integer id; + + @ApiModelProperty(value = "订单号") + private String orderId; + + @ApiModelProperty(value = "用户id") + private Integer uid; + + @ApiModelProperty(value = "用户姓名") + private String realName; + + @ApiModelProperty(value = "用户电话") + private String userPhone; + + @ApiModelProperty(value = "详细地址") + private String userAddress; + + @ApiModelProperty(value = "购物车id") + private String cartId; + + private List cartInfo; + + private StatusDTO _status; + + @ApiModelProperty(value = "运费金额") + private BigDecimal freightPrice; + + @ApiModelProperty(value = "订单商品总数") + private Integer totalNum; + + @ApiModelProperty(value = "订单总价") + private BigDecimal totalPrice; + + @ApiModelProperty(value = "邮费") + private BigDecimal totalPostage; + + @ApiModelProperty(value = "实际支付金额") + private BigDecimal payPrice; + + @ApiModelProperty(value = "支付邮费") + private BigDecimal payPostage; + + @ApiModelProperty(value = "抵扣金额") + private BigDecimal deductionPrice; + + @ApiModelProperty(value = "优惠券id") + private Integer couponId; + + @ApiModelProperty(value = "优惠券金额") + private BigDecimal couponPrice; + + @ApiModelProperty(value = "支付状态") + private Integer paid; + + @ApiModelProperty(value = "支付时间") + private Integer payTime; + + @ApiModelProperty(value = "支付方式") + private String payType; + + @ApiModelProperty(value = "创建时间") + private Integer addTime; + + @ApiModelProperty(value = "订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款)") + private Integer status; + + @ApiModelProperty(value = "0 未退款 1 申请中 2 已退款") + private Integer refundStatus; + + @ApiModelProperty(value = "退款图片") + private String refundReasonWapImg; + + @ApiModelProperty(value = "退款用户说明") + private String refundReasonWapExplain; + + @ApiModelProperty(value = "退款时间") + private Integer refundReasonTime; + + @ApiModelProperty(value = "前台退款原因") + private String refundReasonWap; + + @ApiModelProperty(value = "不退款的理由") + private String refundReason; + + @ApiModelProperty(value = "退款金额") + private BigDecimal refundPrice; + + @ApiModelProperty(value = "快递名称/送货人姓名") + private String deliveryName; + + @ApiModelProperty(value = "发货类型") + private String deliveryType; + + @ApiModelProperty(value = "快递单号/手机号") + private String deliveryId; + + @ApiModelProperty(value = "消费赚取积分") + private BigDecimal gainIntegral; + + @ApiModelProperty(value = "使用积分") + private BigDecimal useIntegral; + + @ApiModelProperty(value = "给用户退了多少积分") + private BigDecimal backIntegral; + + @ApiModelProperty(value = "备注") + private String mark; + + @ApiModelProperty(value = "是否删除") + private Integer isDel; + + @ApiModelProperty(value = "唯一id(md5加密)类似id") + private String unique; + + @ApiModelProperty(value = "管理员备注") + private String remark; + + @ApiModelProperty(value = "商户ID") + private Integer merId; + + private Integer isMerCheck; + + @ApiModelProperty(value = "拼团产品id0一般产品") + private Integer combinationId; + + @ApiModelProperty(value = "拼团id 0没有拼团") + private Integer pinkId; + + @ApiModelProperty(value = "成本价") + private BigDecimal cost; + + @ApiModelProperty(value = "秒杀产品ID") + private Integer seckillId; + + @ApiModelProperty(value = "砍价id") + private Integer bargainId; + + @ApiModelProperty(value = "核销码") + private String verifyCode; + + @ApiModelProperty(value = "门店id") + private Integer storeId; + + @ApiModelProperty(value = "配送方式 1=快递 ,2=门店自提") + private Integer shippingType; + + @ApiModelProperty(value = "支付渠道(0微信公众号1微信小程序)") + private Integer isChannel; + + private Integer isRemind; + + private Integer isSystemDel; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderStatusQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderStatusQueryVo.java new file mode 100644 index 00000000..41d7ea21 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/order/web/vo/YxStoreOrderStatusQueryVo.java @@ -0,0 +1,38 @@ +package co.yixiang.modules.order.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 订单操作记录表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value = "YxStoreOrderStatusQueryVo对象", description = "订单操作记录表查询参数") +public class YxStoreOrderStatusQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + private Integer id; + + @ApiModelProperty(value = "订单id") + private Integer oid; + + @ApiModelProperty(value = "操作类型") + private String changeType; + + @ApiModelProperty(value = "操作备注") + private String changeMessage; + + @ApiModelProperty(value = "操作时间") + private Integer changeTime; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/config/SecurityConfig.java b/yshop-api/src/main/java/co/yixiang/modules/security/config/SecurityConfig.java new file mode 100644 index 00000000..84988eb1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/config/SecurityConfig.java @@ -0,0 +1,143 @@ +package co.yixiang.modules.security.config; + +import co.yixiang.modules.security.security.JwtAuthorizationTokenFilter; +import co.yixiang.modules.security.service.JwtUserDetailsService; +import co.yixiang.modules.security.security.JwtAuthenticationEntryPoint; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.core.GrantedAuthorityDefaults; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +@Configuration +@EnableWebSecurity +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class SecurityConfig extends WebSecurityConfigurerAdapter { + + @Autowired + private JwtAuthenticationEntryPoint unauthorizedHandler; + + @Autowired + private JwtUserDetailsService jwtUserDetailsService; + + /** + * 自定义基于JWT的安全过滤器 + */ + @Autowired + JwtAuthorizationTokenFilter authenticationTokenFilter; + + @Value("${jwt.header}") + private String tokenHeader; + + @Value("${jwt.auth.path}") + private String loginPath; + + @Autowired + public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { + auth + .userDetailsService(jwtUserDetailsService) + .passwordEncoder(passwordEncoderBean()); + } + + @Bean + GrantedAuthorityDefaults grantedAuthorityDefaults() { + // Remove the ROLE_ prefix + return new GrantedAuthorityDefaults(""); + } + + @Bean + public PasswordEncoder passwordEncoderBean() { + return new BCryptPasswordEncoder(); + } + + @Bean + @Override + public AuthenticationManager authenticationManagerBean() throws Exception { + return super.authenticationManagerBean(); + } + + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception { + + httpSecurity + + // 禁用 CSRF + .csrf().disable() + + // 授权异常 + .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() + + // 不创建会话 + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() + + // 过滤请求 + .authorizeRequests() + .antMatchers( + HttpMethod.GET, + "/*.html", + "/**/*.html", + "/**/*.css", + "/**/*.js" + ).anonymous() + + .antMatchers( HttpMethod.POST,"/"+loginPath).anonymous() + //首页 + .antMatchers("/index").anonymous() + .antMatchers("/article/**").anonymous() + .antMatchers("/groom/list/*").anonymous() + .antMatchers("/search/keyword").anonymous() + //.antMatchers("/product/hot").anonymous() + .antMatchers("/products/**").anonymous() + .antMatchers("/product/hot").anonymous() + .antMatchers("/category").anonymous() + .antMatchers("/coupons/**").anonymous() + .antMatchers("/image_base64").anonymous() + .antMatchers("/register/verify").anonymous() + .antMatchers("/register").anonymous() + .antMatchers("/user/activity").anonymous() + //微信相关 + .antMatchers("/wechat/config").anonymous() + .antMatchers("/wechat/auth").anonymous() + .antMatchers("/share").anonymous() + .antMatchers("/wechat/notify").anonymous() + // 支付宝回调 + .antMatchers("/api/aliPay/return").anonymous() + .antMatchers("/api/aliPay/notify").anonymous() + + // swagger start + .antMatchers("/swagger-ui.html").anonymous() + .antMatchers("/swagger-resources/**").anonymous() + .antMatchers("/webjars/**").anonymous() + .antMatchers("/*/api-docs").anonymous() + // swagger end + + // 接口限流测试 + .antMatchers("/test/**").anonymous() + // 文件 + .antMatchers("/avatar/**").anonymous() + .antMatchers("/file/**").anonymous() + + // 放行OPTIONS请求 + .antMatchers(HttpMethod.OPTIONS, "/**").anonymous() + + .antMatchers("/druid/**").anonymous() + // 所有请求都需要认证 + .anyRequest().authenticated() + // 防止iframe 造成跨域 + .and().headers().frameOptions().disable(); + + httpSecurity + .addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/rest/AuthenticationController.java b/yshop-api/src/main/java/co/yixiang/modules/security/rest/AuthenticationController.java new file mode 100644 index 00000000..c1132804 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/rest/AuthenticationController.java @@ -0,0 +1,171 @@ +package co.yixiang.modules.security.rest; + + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.modules.monitor.service.RedisService; +import co.yixiang.modules.security.rest.param.RegParam; +import co.yixiang.modules.security.rest.param.VerityParam; +import co.yixiang.modules.security.security.JwtUser; +import co.yixiang.modules.user.entity.YxUser; +import co.yixiang.modules.user.service.YxUserService; +import co.yixiang.utils.EncryptUtils; +import co.yixiang.utils.OrderUtil; +import co.yixiang.utils.SecurityUtils; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.security.security.AuthenticationInfo; +import co.yixiang.modules.security.security.AuthorizationUser; +import co.yixiang.modules.security.utils.JwtTokenUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseEntity; +import org.springframework.security.authentication.AccountExpiredException; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; + + +/** + * @author hupeng + * @date 2019-10-01 + * 授权、根据token获取用户详细信息 + */ +@Slf4j +@RestController +public class AuthenticationController extends BaseController { + + @Value("${jwt.header}") + private String tokenHeader; + + @Autowired + private JwtTokenUtil jwtTokenUtil; + + + @Autowired + @Qualifier("jwtUserDetailsService") + private UserDetailsService userDetailsService; + + @Autowired + private RedisService redisService; + + @Autowired + private YxUserService userService; + + /** + * 登录授权 + * @param authorizationUser + * @return + */ + @Log("用户登录") + @PostMapping(value = "${jwt.auth.path}") + public ApiResult> login(@Validated @RequestBody AuthorizationUser authorizationUser){ + + final JwtUser jwtUser = (JwtUser) userDetailsService.loadUserByUsername(authorizationUser.getAccount()); + + if(!jwtUser.getPassword().equals(EncryptUtils.encryptPassword(authorizationUser.getPassword()))){ + throw new AccountExpiredException("密码错误"); + } + + if(!jwtUser.isEnabled()){ + throw new AccountExpiredException("账号已停用,请联系管理员"); + } + + // 生成令牌 + final String token = jwtTokenUtil.generateToken(jwtUser); + + Date expiresTime = jwtTokenUtil.getExpirationDateFromToken(token); + + String expiresTimeStr = DateUtil.formatDateTime(expiresTime); + + Map map = new LinkedHashMap<>(); + + map.put("token",token); + map.put("expires_time",expiresTimeStr); + + // 返回 token + return ApiResult.ok(map); + } + + @PostMapping("/register/verify") + @ApiOperation(value = "验证码发送",notes = "验证码发送") + public ApiResult verify(@Validated @RequestBody VerityParam param){ + Boolean isTest = true; + YxUser yxUser = userService.findByName(param.getPhone()); + if(param.getType().equals("register") && ObjectUtil.isNotNull(yxUser)){ + return ApiResult.fail("手机号已注册"); + } + if(param.getType().equals("login") && ObjectUtil.isNull(yxUser)){ + return ApiResult.fail("账号不存在"); + } + if(StrUtil.isNotEmpty(redisService.getCodeVal("code_"+param.getPhone()))){ + return ApiResult.fail("10分钟内有效:"+redisService.getCodeVal("code_"+param.getPhone())); + } + String code = RandomUtil.randomNumbers(6); + redisService.saveCode("code_"+param.getPhone(),code,600L); + if(isTest){ + return ApiResult.fail("测试阶段验证码:"+code); + } + return ApiResult.ok("发送成功"); + } + + @PostMapping("/register") + @ApiOperation(value = "H5注册新用户",notes = "H5注册新用户") + public ApiResult register(@Validated @RequestBody RegParam param){ + String code = redisService.getCodeVal("code_"+param.getAccount()); + if(StrUtil.isEmpty(code)){ + return ApiResult.fail("请先获取验证码"); + } + + if(!StrUtil.equals(code,param.getCaptcha())){ + return ApiResult.fail("验证码错误"); + } + + YxUser yxUser = userService.findByName(param.getAccount()); + if(ObjectUtil.isNotNull(yxUser)){ + return ApiResult.fail("用户已存在"); + } + + YxUser user = new YxUser(); + user.setAccount(param.getAccount()); + user.setUsername(param.getAccount()); + user.setPassword(EncryptUtils.encryptPassword(param.getPassword())); + user.setPwd(EncryptUtils.encryptPassword(param.getPassword())); + user.setPhone(param.getAccount()); + user.setUserType("h5"); + user.setAddTime(OrderUtil.getSecondTimestampTwo()); + user.setLastTime(OrderUtil.getSecondTimestampTwo()); + user.setNickname(param.getAccount()); + user.setAvatar("https://image.dayouqiantu.cn/5dc2c7f3a104c.png"); + user.setNowMoney(BigDecimal.ZERO); + user.setBrokeragePrice(BigDecimal.ZERO); + user.setIntegral(BigDecimal.ZERO); + + userService.save(user); + + return ApiResult.ok("注册成功"); + } + + + /** + * 退出登录 + * @return + */ + @PostMapping(value = "/auth/logout") + public ApiResult logout(){ + return ApiResult.ok("退出成功"); + } + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/rest/param/RegParam.java b/yshop-api/src/main/java/co/yixiang/modules/security/rest/param/RegParam.java new file mode 100644 index 00000000..d97a4e44 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/rest/param/RegParam.java @@ -0,0 +1,25 @@ +package co.yixiang.modules.security.rest.param; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @ClassName RegParam + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/25 + **/ +@Data +public class RegParam { + @NotBlank(message = "手机号必填") + private String account; + + @NotBlank + private String captcha; + + @NotBlank + private String password; + + //todo + private Integer spread; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/rest/param/VerityParam.java b/yshop-api/src/main/java/co/yixiang/modules/security/rest/param/VerityParam.java new file mode 100644 index 00000000..25db7548 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/rest/param/VerityParam.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.security.rest.param; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @ClassName VerityParam + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/25 + **/ +@Data +public class VerityParam { + @NotBlank(message = "手机号必填") + private String phone; + + @NotBlank + private String type; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/security/AuthenticationInfo.java b/yshop-api/src/main/java/co/yixiang/modules/security/security/AuthenticationInfo.java new file mode 100644 index 00000000..a54ef516 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/security/AuthenticationInfo.java @@ -0,0 +1,20 @@ +package co.yixiang.modules.security.security; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.io.Serializable; + +/** + * @author Zheng Jie + * @date 2018-11-23 + * 返回token + */ +@Getter +@AllArgsConstructor +public class AuthenticationInfo implements Serializable { + + private final String token; + + private final JwtUser user; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/security/AuthorizationUser.java b/yshop-api/src/main/java/co/yixiang/modules/security/security/AuthorizationUser.java new file mode 100644 index 00000000..6f1e4c2c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/security/AuthorizationUser.java @@ -0,0 +1,30 @@ +package co.yixiang.modules.security.security; + +import lombok.Getter; +import lombok.Setter; + +import javax.validation.constraints.NotBlank; + +/** + * @author Zheng Jie + * @date 2018-11-30 + */ +@Getter +@Setter +public class AuthorizationUser { + + @NotBlank + private String account; + + @NotBlank + private String password; + + private String code; + + private String uuid = ""; + + @Override + public String toString() { + return "{username=" + account + ", password= ******}"; + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/security/ImgResult.java b/yshop-api/src/main/java/co/yixiang/modules/security/security/ImgResult.java new file mode 100644 index 00000000..627f5deb --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/security/ImgResult.java @@ -0,0 +1,17 @@ +package co.yixiang.modules.security.security; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author Zheng Jie + * @date 2019-6-5 17:29:57 + */ +@Data +@AllArgsConstructor +public class ImgResult { + + private String img; + + private String uuid; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtAuthenticationEntryPoint.java b/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtAuthenticationEntryPoint.java new file mode 100644 index 00000000..c872396d --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtAuthenticationEntryPoint.java @@ -0,0 +1,26 @@ +package co.yixiang.modules.security.security; + +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.Serializable; + +@Component +public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint, Serializable { + + private static final long serialVersionUID = -8970718410437077606L; + + @Override + public void commence(HttpServletRequest request, + HttpServletResponse response, + AuthenticationException authException) throws IOException { + /** + * 当用户尝试访问安全的REST资源而不提供任何凭据时,将调用此方法发送401 响应 + */ + response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException==null?"Unauthorized":authException.getMessage()); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtAuthorizationTokenFilter.java b/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtAuthorizationTokenFilter.java new file mode 100644 index 00000000..c87c6f46 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtAuthorizationTokenFilter.java @@ -0,0 +1,67 @@ +package co.yixiang.modules.security.security; + +import io.jsonwebtoken.ExpiredJwtException; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.modules.security.utils.JwtTokenUtil; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@Slf4j +@Component +public class JwtAuthorizationTokenFilter extends OncePerRequestFilter { + + private final UserDetailsService userDetailsService; + private final JwtTokenUtil jwtTokenUtil; + private final String tokenHeader; + + public JwtAuthorizationTokenFilter(@Qualifier("jwtUserDetailsService") UserDetailsService userDetailsService, JwtTokenUtil jwtTokenUtil, @Value("${jwt.header}") String tokenHeader) { + this.userDetailsService = userDetailsService; + this.jwtTokenUtil = jwtTokenUtil; + this.tokenHeader = tokenHeader; + } + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { + + final String requestHeader = request.getHeader(this.tokenHeader); + + String username = null; + String authToken = null; + if (requestHeader != null && requestHeader.startsWith("Bearer ")) { + authToken = requestHeader.substring(7); + try { + username = jwtTokenUtil.getUsernameFromToken(authToken); + } catch (ExpiredJwtException e) { + log.error(e.getMessage()); + } + } + + if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) { + + // It is not compelling necessary to load the use details from the database. You could also store the information + // in the token and read it from it. It's up to you ;) + JwtUser userDetails = (JwtUser)this.userDetailsService.loadUserByUsername(username); + + // For simple validation it is completely sufficient to just check the token integrity. You don't have to call + // the database compellingly. Again it's up to you ;) + if (jwtTokenUtil.validateToken(authToken, userDetails)) { + UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities()); + authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); + SecurityContextHolder.getContext().setAuthentication(authentication); + } + } + chain.doFilter(request, response); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtUser.java b/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtUser.java new file mode 100644 index 00000000..52bcb772 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/security/JwtUser.java @@ -0,0 +1,76 @@ +package co.yixiang.modules.security.security; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; + +import java.sql.Timestamp; +import java.util.Collection; +import java.util.Date; +import java.util.stream.Collectors; + +/** + * @author hupeng + * @since 2019-10-16 + */ +@Getter +@AllArgsConstructor +public class JwtUser implements UserDetails { + + @JsonIgnore + private final Long id; + + private final String username; + + @JsonIgnore + private final String password; + + private final String avatar; + + + private final String phone; + + + @JsonIgnore + private final Collection authorities; + + + private Boolean status; + + + private Integer addTime; + + + @JsonIgnore + @Override + public boolean isAccountNonExpired() { + return true; + } + + @JsonIgnore + @Override + public boolean isAccountNonLocked() { + return true; + } + + @JsonIgnore + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + @JsonIgnore + @Override + public String getPassword() { + return password; + } + + @Override + public boolean isEnabled() { + return status; + } + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/service/JwtPermissionService.java b/yshop-api/src/main/java/co/yixiang/modules/security/service/JwtPermissionService.java new file mode 100644 index 00000000..1931eb5b --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/service/JwtPermissionService.java @@ -0,0 +1,36 @@ +package co.yixiang.modules.security.service; + + +import co.yixiang.modules.user.entity.YxUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Set; +import java.util.stream.Collectors; + +@Service +//@CacheConfig(cacheNames = "role") +public class JwtPermissionService { + + + /** + * key的名称如有修改,请同步修改 UserServiceImpl 中的 update 方法 + * @param user + * @return + */ + //@Cacheable(key = "'loadPermissionByUser:' + #p0.username") + public Collection mapToGrantedAuthorities(YxUser user) { + + System.out.println("--------------------loadPermissionByUser:" + user.getUsername() + "---------------------"); + + //Set roles = roleRepository.findByUsers_Id(user.getId()); + + return new ArrayList<>(); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/service/JwtUserDetailsService.java b/yshop-api/src/main/java/co/yixiang/modules/security/service/JwtUserDetailsService.java new file mode 100644 index 00000000..c677f41c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/service/JwtUserDetailsService.java @@ -0,0 +1,54 @@ +package co.yixiang.modules.security.service; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.modules.security.security.JwtUser; +import co.yixiang.modules.user.entity.YxUser; +import co.yixiang.modules.user.service.YxUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Optional; + +/** + * @author hupeng + * @since 2019-10-16 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class JwtUserDetailsService implements UserDetailsService { + + + @Autowired + private YxUserService yxUserService; + + @Autowired + private JwtPermissionService permissionService; + + @Override + public UserDetails loadUserByUsername(String username){ + + YxUser user = yxUserService.findByName(username); + if (user == null) { + throw new BadRequestException("账号不存在"); + } else { + return createJwtUser(user); + } + } + + public UserDetails createJwtUser(YxUser user) { + return new JwtUser( + user.getUid().longValue(), + user.getUsername(), + user.getPassword(), + user.getAvatar(), + user.getPhone(), + permissionService.mapToGrantedAuthorities(user), + user.getStatus(), + user.getAddTime() + ); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/utils/JwtTokenUtil.java b/yshop-api/src/main/java/co/yixiang/modules/security/utils/JwtTokenUtil.java new file mode 100644 index 00000000..2ab1eb3e --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/utils/JwtTokenUtil.java @@ -0,0 +1,123 @@ +package co.yixiang.modules.security.utils; + +import co.yixiang.modules.security.security.JwtUser; +import io.jsonwebtoken.*; +import io.jsonwebtoken.impl.DefaultClock; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.stereotype.Component; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +@Component +public class JwtTokenUtil implements Serializable { + + private static final long serialVersionUID = -3301605591108950415L; + private Clock clock = DefaultClock.INSTANCE; + + @Value("${jwt.secret}") + private String secret; + + @Value("${jwt.expiration}") + private Long expiration; + + @Value("${jwt.header}") + private String tokenHeader; + + public String getUsernameFromToken(String token) { + return getClaimFromToken(token, Claims::getSubject); + } + + public Date getIssuedAtDateFromToken(String token) { + return getClaimFromToken(token, Claims::getIssuedAt); + } + + public Date getExpirationDateFromToken(String token) { + return getClaimFromToken(token, Claims::getExpiration); + } + + public T getClaimFromToken(String token, Function claimsResolver) { + final Claims claims = getAllClaimsFromToken(token); + return claimsResolver.apply(claims); + } + + private Claims getAllClaimsFromToken(String token) { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + } + + private Boolean isTokenExpired(String token) { + final Date expiration = getExpirationDateFromToken(token); + return expiration.before(clock.now()); + } + + private Boolean isCreatedBeforeLastPasswordReset(Date created, Date lastPasswordReset) { + return (lastPasswordReset != null && created.before(lastPasswordReset)); + } + + private Boolean ignoreTokenExpiration(String token) { + // here you specify tokens, for that the expiration is ignored + return false; + } + + public String generateToken(UserDetails userDetails) { + Map claims = new HashMap<>(); + return doGenerateToken(claims, userDetails.getUsername()); + } + + private String doGenerateToken(Map claims, String subject) { + final Date createdDate = clock.now(); + final Date expirationDate = calculateExpirationDate(createdDate); + + return Jwts.builder() + .setClaims(claims) + .setSubject(subject) + .setIssuedAt(createdDate) + .setExpiration(expirationDate) + .signWith(SignatureAlgorithm.HS512, secret) + .compact(); + } + + public Boolean canTokenBeRefreshed(String token, Date lastPasswordReset) { + final Date created = getIssuedAtDateFromToken(token); + return !isCreatedBeforeLastPasswordReset(created, lastPasswordReset) + && (!isTokenExpired(token) || ignoreTokenExpiration(token)); + } + + public String refreshToken(String token) { + final Date createdDate = clock.now(); + final Date expirationDate = calculateExpirationDate(createdDate); + + final Claims claims = getAllClaimsFromToken(token); + claims.setIssuedAt(createdDate); + claims.setExpiration(expirationDate); + + return Jwts.builder() + .setClaims(claims) + .signWith(SignatureAlgorithm.HS512, secret) + .compact(); + } + + public Boolean validateToken(String token, UserDetails userDetails) { + JwtUser user = (JwtUser) userDetails; + final Date created = getIssuedAtDateFromToken(token); +// final Date expiration = getExpirationDateFromToken(token); +// 如果token存在,且token创建日期 > 最后修改密码的日期 则代表token有效 +// return (!isTokenExpired(token) +// && !isCreatedBeforeLastPasswordReset(created, user.getLastPasswordResetDate()) +// ); + + return !isTokenExpired(token); + } + + private Date calculateExpirationDate(Date createdDate) { + return new Date(createdDate.getTime() + expiration); + } +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/utils/VerifyCodeUtils.java b/yshop-api/src/main/java/co/yixiang/modules/security/utils/VerifyCodeUtils.java new file mode 100644 index 00000000..5e3217ee --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/security/utils/VerifyCodeUtils.java @@ -0,0 +1,199 @@ +package co.yixiang.modules.security.utils; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Arrays; +import java.util.Random; + +/** + * @author https://blog.csdn.net/ruixue0117/article/details/22829557 + * @date 2019-6-20 17:28:53 + */ +public class VerifyCodeUtils{ + + //使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符 + public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ"; + private static Random random = new Random(); + + + /** + * 使用系统默认字符源生成验证码 + * @param verifySize 验证码长度 + * @return + */ + public static String generateVerifyCode(int verifySize){ + return generateVerifyCode(verifySize, VERIFY_CODES); + } + /** + * 使用指定源生成验证码 + * @param verifySize 验证码长度 + * @param sources 验证码字符源 + * @return + */ + public static String generateVerifyCode(int verifySize, String sources){ + if(sources == null || sources.length() == 0){ + sources = VERIFY_CODES; + } + int codesLen = sources.length(); + Random rand = new Random(System.currentTimeMillis()); + StringBuilder verifyCode = new StringBuilder(verifySize); + for(int i = 0; i < verifySize; i++){ + verifyCode.append(sources.charAt(rand.nextInt(codesLen-1))); + } + return verifyCode.toString(); + } + + /** + * 输出指定验证码图片流 + * @param w + * @param h + * @param os + * @param code + * @throws IOException + */ + public static void outputImage(int w, int h, OutputStream os, String code) throws IOException{ + int verifySize = code.length(); + BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); + Random rand = new Random(); + Graphics2D g2 = image.createGraphics(); + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); + Color[] colors = new Color[5]; + Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN, + Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, Color.ORANGE, + Color.PINK, Color.YELLOW }; + float[] fractions = new float[colors.length]; + for(int i = 0; i < colors.length; i++){ + colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)]; + fractions[i] = rand.nextFloat(); + } + Arrays.sort(fractions); + + g2.setColor(Color.GRAY);// 设置边框色 + g2.fillRect(0, 0, w, h); + + Color c = getRandColor(200, 250); + g2.setColor(c);// 设置背景色 + g2.fillRect(0, 2, w, h-4); + + //绘制干扰线 + Random random = new Random(); + g2.setColor(getRandColor(160, 200));// 设置线条的颜色 + for (int i = 0; i < 20; i++) { + int x = random.nextInt(w - 1); + int y = random.nextInt(h - 1); + int xl = random.nextInt(6) + 1; + int yl = random.nextInt(12) + 1; + g2.drawLine(x, y, x + xl + 40, y + yl + 20); + } + + // 添加噪点 + float yawpRate = 0.05f;// 噪声率 + int area = (int) (yawpRate * w * h); + for (int i = 0; i < area; i++) { + int x = random.nextInt(w); + int y = random.nextInt(h); + int rgb = getRandomIntColor(); + image.setRGB(x, y, rgb); + } + + shear(g2, w, h, c);// 使图片扭曲 + + g2.setColor(getRandColor(100, 160)); + int fontSize = h-4; + Font font = new Font("Algerian", Font.ITALIC, fontSize); + g2.setFont(font); + char[] chars = code.toCharArray(); + for(int i = 0; i < verifySize; i++){ + AffineTransform affine = new AffineTransform(); + affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + fontSize/2, h/2); + g2.setTransform(affine); + g2.drawChars(chars, i, 1, ((w-10) / verifySize) * i + 5, h/2 + fontSize/2 - 10); + } + + g2.dispose(); + ImageIO.write(image, "jpg", os); + } + + private static Color getRandColor(int fc, int bc) { + if (fc > 255) + fc = 255; + if (bc > 255) + bc = 255; + int r = fc + random.nextInt(bc - fc); + int g = fc + random.nextInt(bc - fc); + int b = fc + random.nextInt(bc - fc); + return new Color(r, g, b); + } + + private static int getRandomIntColor() { + int[] rgb = getRandomRgb(); + int color = 0; + for (int c : rgb) { + color = color << 8; + color = color | c; + } + return color; + } + + private static int[] getRandomRgb() { + int[] rgb = new int[3]; + for (int i = 0; i < 3; i++) { + rgb[i] = random.nextInt(255); + } + return rgb; + } + + private static void shear(Graphics g, int w1, int h1, Color color) { + shearX(g, w1, h1, color); + shearY(g, w1, h1, color); + } + + private static void shearX(Graphics g, int w1, int h1, Color color) { + + int period = random.nextInt(2); + + boolean borderGap = true; + int frames = 1; + int phase = random.nextInt(2); + + for (int i = 0; i < h1; i++) { + double d = (double) (period >> 1) + * Math.sin((double) i / (double) period + + (6.2831853071795862D * (double) phase) + / (double) frames); + g.copyArea(0, i, w1, 1, (int) d, 0); + if (borderGap) { + g.setColor(color); + g.drawLine((int) d, i, 0, i); + g.drawLine((int) d + w1, i, w1, i); + } + } + + } + + private static void shearY(Graphics g, int w1, int h1, Color color) { + + int period = random.nextInt(40) + 10; // 50; + + boolean borderGap = true; + int frames = 20; + int phase = 7; + for (int i = 0; i < w1; i++) { + double d = (double) (period >> 1) + * Math.sin((double) i / (double) period + + (6.2831853071795862D * (double) phase) + / (double) frames); + g.copyArea(i, 0, 1, h1, 0, (int) d); + if (borderGap) { + g.setColor(color); + g.drawLine(i, (int) d, i, 0); + g.drawLine(i, (int) d + h1, i, h1); + } + + } + } +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxArticle.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxArticle.java new file mode 100644 index 00000000..164f5a23 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxArticle.java @@ -0,0 +1,84 @@ +package co.yixiang.modules.shop.entity; + +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 文章管理表 + *

+ * + * @author hupeng + * @since 2019-10-02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxArticle对象", description="文章管理表") +public class YxArticle extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "文章管理ID") +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "分类id") +private String cid; + +@ApiModelProperty(value = "文章标题") +private String title; + +@ApiModelProperty(value = "文章作者") +private String author; + +@ApiModelProperty(value = "文章图片") +private String imageInput; + +@ApiModelProperty(value = "文章简介") +private String synopsis; + +@ApiModelProperty(value = "文章分享标题") +private String shareTitle; + +@ApiModelProperty(value = "文章分享简介") +private String shareSynopsis; + +@ApiModelProperty(value = "浏览次数") +private String visit; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "原文链接") +private String url; + +@ApiModelProperty(value = "状态") +private Boolean status; + +@ApiModelProperty(value = "添加时间") +private String addTime; + +@ApiModelProperty(value = "是否隐藏") +private Boolean hide; + +@ApiModelProperty(value = "管理员id") +private Integer adminId; + +@ApiModelProperty(value = "商户id") +private Integer merId; + +@ApiModelProperty(value = "产品关联id") +private Integer productId; + +@ApiModelProperty(value = "是否热门(小程序)") +private Boolean isHot; + +@ApiModelProperty(value = "是否轮播图(小程序)") +private Boolean isBanner; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCart.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCart.java new file mode 100644 index 00000000..9f34e7dd --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCart.java @@ -0,0 +1,68 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 购物车表 + *

+ * + * @author hupeng + * @since 2019-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxStoreCart对象", description = "购物车表") +public class YxStoreCart extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "购物车表ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "用户ID") + private Integer uid; + + @ApiModelProperty(value = "类型") + private String type; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "商品属性") + private String productAttrUnique; + + @ApiModelProperty(value = "商品数量") + private Integer cartNum; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + + @ApiModelProperty(value = "0 = 未购买 1 = 已购买") + private Integer isPay; + + @ApiModelProperty(value = "是否删除") + private Integer isDel; + + @ApiModelProperty(value = "是否为立即购买") + private Integer isNew; + + @ApiModelProperty(value = "拼团id") + private Integer combinationId; + + @ApiModelProperty(value = "秒杀产品ID") + private Integer seckillId; + + @ApiModelProperty(value = "砍价id") + private Integer bargainId; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCategory.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCategory.java new file mode 100644 index 00000000..f9518cdf --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCategory.java @@ -0,0 +1,50 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 商品分类表 + *

+ * + * @author hupeng + * @since 2019-10-22 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCategory对象", description="商品分类表") +public class YxStoreCategory extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "商品分类表ID") +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "父id") +private Integer pid; + +@ApiModelProperty(value = "分类名称") +private String cateName; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "图标") +private String pic; + +@ApiModelProperty(value = "是否推荐") +private Boolean isShow; + +@ApiModelProperty(value = "添加时间") +private Integer addTime; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCoupon.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCoupon.java new file mode 100644 index 00000000..6311ac8b --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCoupon.java @@ -0,0 +1,60 @@ +package co.yixiang.modules.shop.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 优惠券表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCoupon对象", description="优惠券表") +public class YxStoreCoupon extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "优惠券表ID") +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "优惠券名称") +private String title; + +@ApiModelProperty(value = "兑换消耗积分值") +private Integer integral; + +@ApiModelProperty(value = "兑换的优惠券面值") +private BigDecimal couponPrice; + +@ApiModelProperty(value = "最低消费多少金额可用优惠券") +private BigDecimal useMinPrice; + +@ApiModelProperty(value = "优惠券有效期限(单位:天)") +private Integer couponTime; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "状态(0:关闭,1:开启)") +private Boolean status; + +@ApiModelProperty(value = "兑换项目添加时间") +private Integer addTime; + +@ApiModelProperty(value = "是否删除") +private Boolean isDel; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponIssue.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponIssue.java new file mode 100644 index 00000000..fbdffd16 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponIssue.java @@ -0,0 +1,57 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 优惠券前台领取表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxStoreCouponIssue对象", description = "优惠券前台领取表") +public class YxStoreCouponIssue extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "优惠券ID") + private Integer cid; + + @ApiModelProperty(value = "优惠券领取开启时间") + private Integer startTime; + + @ApiModelProperty(value = "优惠券领取结束时间") + private Integer endTime; + + @ApiModelProperty(value = "优惠券领取数量") + private Integer totalCount; + + @ApiModelProperty(value = "优惠券剩余领取数量") + private Integer remainCount; + + @ApiModelProperty(value = "是否无限张数") + private Boolean isPermanent; + + @ApiModelProperty(value = "1 正常 0 未开启 -1 已无效") + private Boolean status; + + private Boolean isDel; + + @ApiModelProperty(value = "优惠券添加时间") + private Integer addTime; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponIssueUser.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponIssueUser.java new file mode 100644 index 00000000..a4b8ce5b --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponIssueUser.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 优惠券前台用户领取记录表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCouponIssueUser对象", description="优惠券前台用户领取记录表") +public class YxStoreCouponIssueUser extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "领取优惠券用户ID") +private Integer uid; + +@ApiModelProperty(value = "优惠券前台领取ID") +private Integer issueCouponId; + +@ApiModelProperty(value = "领取时间") +private Integer addTime; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponUser.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponUser.java new file mode 100644 index 00000000..6fdd25a8 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreCouponUser.java @@ -0,0 +1,66 @@ +package co.yixiang.modules.shop.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 优惠券发放记录表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCouponUser对象", description="优惠券发放记录表") +public class YxStoreCouponUser extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "优惠券发放记录id") +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "兑换的项目id") +private Integer cid; + +@ApiModelProperty(value = "优惠券所属用户") +private Integer uid; + +@ApiModelProperty(value = "优惠券名称") +private String couponTitle; + +@ApiModelProperty(value = "优惠券的面值") +private BigDecimal couponPrice; + +@ApiModelProperty(value = "最低消费多少金额可用优惠券") +private BigDecimal useMinPrice; + +@ApiModelProperty(value = "优惠券创建时间") +private Integer addTime; + +@ApiModelProperty(value = "优惠券结束时间") +private Integer endTime; + +@ApiModelProperty(value = "使用时间") +private Integer useTime; + +@ApiModelProperty(value = "获取方式") +private String type; + +@ApiModelProperty(value = "状态(0:未使用,1:已使用, 2:已过期)") +private Boolean status; + +@ApiModelProperty(value = "是否有效") +private Boolean isFail; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProduct.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProduct.java new file mode 100644 index 00000000..8a775384 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProduct.java @@ -0,0 +1,138 @@ +package co.yixiang.modules.shop.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 商品表 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProduct对象", description="商品表") +public class YxStoreProduct extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "商品id") +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "商户Id(0为总后台管理员创建,不为0的时候是商户后台创建)") +private Integer merId; + +@ApiModelProperty(value = "商品图片") +private String image; + +@ApiModelProperty(value = "轮播图") +private String sliderImage; + +@ApiModelProperty(value = "商品名称") +private String storeName; + +@ApiModelProperty(value = "商品简介") +private String storeInfo; + +@ApiModelProperty(value = "关键字") +private String keyword; + +@ApiModelProperty(value = "产品条码(一维码)") +private String barCode; + +@ApiModelProperty(value = "分类id") +private String cateId; + +@ApiModelProperty(value = "商品价格") +private BigDecimal price; + +@ApiModelProperty(value = "会员价格") +private BigDecimal vipPrice; + +@ApiModelProperty(value = "市场价") +private BigDecimal otPrice; + +@ApiModelProperty(value = "邮费") +private BigDecimal postage; + +@ApiModelProperty(value = "单位名") +private String unitName; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "销量") +private Integer sales; + +@ApiModelProperty(value = "库存") +private Integer stock; + +@ApiModelProperty(value = "状态(0:未上架,1:上架)") +private Integer isShow; + +@ApiModelProperty(value = "是否热卖") +private Integer isHot; + +@ApiModelProperty(value = "是否优惠") +private Integer isBenefit; + +@ApiModelProperty(value = "是否精品") +private Integer isBest; + +@ApiModelProperty(value = "是否新品") +private Integer isNew; + +@ApiModelProperty(value = "产品描述") +private String description; + +@ApiModelProperty(value = "添加时间") +private Integer addTime; + +@ApiModelProperty(value = "是否包邮") +private Integer isPostage; + +@ApiModelProperty(value = "是否删除") +private Integer isDel; + +@ApiModelProperty(value = "商户是否代理 0不可代理1可代理") +private Integer merUse; + +@ApiModelProperty(value = "获得积分") +private BigDecimal giveIntegral; + +@ApiModelProperty(value = "成本价") +private BigDecimal cost; + +@ApiModelProperty(value = "秒杀状态 0 未开启 1已开启") +private Integer isSeckill; + +@ApiModelProperty(value = "砍价状态 0未开启 1开启") +private Integer isBargain; + +@ApiModelProperty(value = "是否优品推荐") +private Integer isGood; + +@ApiModelProperty(value = "虚拟销量") +private Integer ficti; + +@ApiModelProperty(value = "浏览量") +private Integer browse; + +@ApiModelProperty(value = "产品二维码地址(用户小程序海报)") +private String codePath; + +@ApiModelProperty(value = "淘宝京东1688类型") +private String soureLink; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttr.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttr.java new file mode 100644 index 00000000..70388e1c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttr.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 商品属性表 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxStoreProductAttr对象", description = "商品属性表") +public class YxStoreProductAttr extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "属性名") + private String attrName; + + @ApiModelProperty(value = "属性值") + private String attrValues; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttrResult.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttrResult.java new file mode 100644 index 00000000..e7aa8515 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttrResult.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 商品属性详情表 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProductAttrResult对象", description="商品属性详情表") +public class YxStoreProductAttrResult extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "商品ID") +private Integer productId; + +@ApiModelProperty(value = "商品属性参数") +private String result; + +@ApiModelProperty(value = "上次修改时间") +private Integer changeTime; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttrValue.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttrValue.java new file mode 100644 index 00000000..56df9dab --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductAttrValue.java @@ -0,0 +1,59 @@ +package co.yixiang.modules.shop.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 商品属性值表 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxStoreProductAttrValue对象", description = "商品属性值表") +public class YxStoreProductAttrValue extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "商品属性索引值 (attr_value|attr_value[|....])") + private String suk; + + @ApiModelProperty(value = "属性对应的库存") + private Integer stock; + + @ApiModelProperty(value = "销量") + private Integer sales; + + @ApiModelProperty(value = "属性金额") + private BigDecimal price; + + @ApiModelProperty(value = "图片") + private String image; + + @ApiModelProperty(value = "唯一值") + @TableField(value = "`unique`") + private String unique; + + @ApiModelProperty(value = "成本价") + private BigDecimal cost; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductRelation.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductRelation.java new file mode 100644 index 00000000..f6c84f21 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductRelation.java @@ -0,0 +1,46 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 商品点赞和收藏表 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProductRelation对象", description="商品点赞和收藏表") +public class YxStoreProductRelation extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "用户ID") +private Integer uid; + +@ApiModelProperty(value = "商品ID") +private Integer productId; + +@ApiModelProperty(value = "类型(收藏(collect)、点赞(like))") +private String type; + +@ApiModelProperty(value = "某种类型的商品(普通商品、秒杀商品)") +private String category; + +@ApiModelProperty(value = "添加时间") +private Integer addTime; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductReply.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductReply.java new file mode 100644 index 00000000..7a15d794 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxStoreProductReply.java @@ -0,0 +1,78 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import java.util.Date; + +/** + *

+ * 评论表 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxStoreProductReply对象", description = "评论表") +public class YxStoreProductReply extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "评论ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "用户ID") + private Integer uid; + + @ApiModelProperty(value = "订单ID") + private Integer oid; + + @ApiModelProperty(value = "唯一id") + @TableField(value = "`unique`") + @NotBlank(message = "参数错误") + private String unique; + + @ApiModelProperty(value = "产品id") + private Integer productId; + + @ApiModelProperty(value = "某种商品类型(普通商品、秒杀商品)") + private String replyType; + + @ApiModelProperty(value = "商品分数") + private Integer productScore; + + @ApiModelProperty(value = "服务分数") + private Integer serviceScore; + + @ApiModelProperty(value = "评论内容") + private String comment; + + @ApiModelProperty(value = "评论图片") + private String pics; + + @ApiModelProperty(value = "评论时间") + private Integer addTime; + + @ApiModelProperty(value = "管理员回复内容") + private String merchantReplyContent; + + @ApiModelProperty(value = "管理员回复时间") + private Integer merchantReplyTime; + + @ApiModelProperty(value = "0未删除1已删除") + private Integer isDel; + + @ApiModelProperty(value = "0未回复1已回复") + private Integer isReply; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxSystemConfig.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxSystemConfig.java new file mode 100644 index 00000000..9ce8efbd --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxSystemConfig.java @@ -0,0 +1,44 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 配置表 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxSystemConfig对象", description="配置表") +public class YxSystemConfig extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "配置id") +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "字段名称") +private String menuName; + +@ApiModelProperty(value = "默认值") +private String value; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "是否隐藏") +private Boolean status; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxSystemGroupData.java b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxSystemGroupData.java new file mode 100644 index 00000000..ec14330a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/entity/YxSystemGroupData.java @@ -0,0 +1,47 @@ +package co.yixiang.modules.shop.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 组合数据详情表 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxSystemGroupData对象", description="组合数据详情表") +public class YxSystemGroupData extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "组合数据详情ID") +@TableId(value = "id", type = IdType.AUTO) +private Integer id; + +@ApiModelProperty(value = "对应的数据名称") +private String groupName; + +@ApiModelProperty(value = "数据组对应的数据值(json数据)") +private String value; + +@ApiModelProperty(value = "添加数据时间") +private Integer addTime; + +@ApiModelProperty(value = "数据排序") +private Integer sort; + +@ApiModelProperty(value = "状态(1:开启;2:关闭;)") +private Boolean status; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxArticleMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxArticleMapper.java new file mode 100644 index 00000000..fe73991c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxArticleMapper.java @@ -0,0 +1,45 @@ +package co.yixiang.modules.shop.mapper; + +import co.yixiang.modules.shop.entity.YxArticle; +import co.yixiang.modules.shop.web.param.YxArticleQueryParam; +import co.yixiang.modules.shop.web.vo.YxArticleQueryVo; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Update; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 文章管理表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-02 + */ +@Repository +public interface YxArticleMapper extends BaseMapper { + + @Update("update yx_article set visit=visit+1 " + + "where id=#{id}") + int incVisitNum(@Param("id") int id); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxArticleQueryVo getYxArticleById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxArticleQueryParam + * @return + */ + IPage getYxArticlePageList(@Param("page") Page page, @Param("param") YxArticleQueryParam yxArticleQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCartMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCartMapper.java new file mode 100644 index 00000000..0fa1fdfb --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCartMapper.java @@ -0,0 +1,45 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreCart; +import co.yixiang.modules.shop.web.param.YxStoreCartQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 购物车表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-25 + */ +@Repository +public interface YxStoreCartMapper extends BaseMapper { + + @Select("select IFNULL(sum(cart_num),0) from yx_store_cart " + + "where is_pay=0 and is_del=0 and is_new=0 and uid=#{uid} and type=#{type}") + int cartSum(@Param("uid") int uid,@Param("type") String type); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCartQueryVo getYxStoreCartById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreCartQueryParam + * @return + */ + IPage getYxStoreCartPageList(@Param("page") Page page, @Param("param") YxStoreCartQueryParam yxStoreCartQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCategoryMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCategoryMapper.java new file mode 100644 index 00000000..a769b686 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCategoryMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreCategory; +import co.yixiang.modules.shop.web.param.YxStoreCategoryQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCategoryQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 商品分类表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-22 + */ +@Repository +public interface YxStoreCategoryMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCategoryQueryVo getYxStoreCategoryById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreCategoryQueryParam + * @return + */ + IPage getYxStoreCategoryPageList(@Param("page") Page page, @Param("param") YxStoreCategoryQueryParam yxStoreCategoryQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponIssueMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponIssueMapper.java new file mode 100644 index 00000000..7f5841bd --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponIssueMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreCouponIssue; +import co.yixiang.modules.shop.web.param.YxStoreCouponIssueQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponIssueQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 优惠券前台领取表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxStoreCouponIssueMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCouponIssueQueryVo getYxStoreCouponIssueById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreCouponIssueQueryParam + * @return + */ + IPage getYxStoreCouponIssuePageList(@Param("page") Page page, @Param("param") YxStoreCouponIssueQueryParam yxStoreCouponIssueQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponIssueUserMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponIssueUserMapper.java new file mode 100644 index 00000000..4ec47ac1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponIssueUserMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreCouponIssueUser; +import co.yixiang.modules.shop.web.param.YxStoreCouponIssueUserQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponIssueUserQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 优惠券前台用户领取记录表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxStoreCouponIssueUserMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCouponIssueUserQueryVo getYxStoreCouponIssueUserById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreCouponIssueUserQueryParam + * @return + */ + IPage getYxStoreCouponIssueUserPageList(@Param("page") Page page, @Param("param") YxStoreCouponIssueUserQueryParam yxStoreCouponIssueUserQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponMapper.java new file mode 100644 index 00000000..47957360 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreCoupon; +import co.yixiang.modules.shop.web.param.YxStoreCouponQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 优惠券表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxStoreCouponMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCouponQueryVo getYxStoreCouponById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreCouponQueryParam + * @return + */ + IPage getYxStoreCouponPageList(@Param("page") Page page, @Param("param") YxStoreCouponQueryParam yxStoreCouponQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponUserMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponUserMapper.java new file mode 100644 index 00000000..8c3e770f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreCouponUserMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreCouponUser; +import co.yixiang.modules.shop.web.param.YxStoreCouponUserQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponUserQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 优惠券发放记录表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxStoreCouponUserMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCouponUserQueryVo getYxStoreCouponUserById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreCouponUserQueryParam + * @return + */ + IPage getYxStoreCouponUserPageList(@Param("page") Page page, @Param("param") YxStoreCouponUserQueryParam yxStoreCouponUserQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrMapper.java new file mode 100644 index 00000000..62259a4f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreProductAttr; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 商品属性表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Repository +public interface YxStoreProductAttrMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductAttrQueryVo getYxStoreProductAttrById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreProductAttrQueryParam + * @return + */ + IPage getYxStoreProductAttrPageList(@Param("page") Page page, @Param("param") YxStoreProductAttrQueryParam yxStoreProductAttrQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrResultMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrResultMapper.java new file mode 100644 index 00000000..1d89922f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrResultMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreProductAttrResult; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrResultQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrResultQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 商品属性详情表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Repository +public interface YxStoreProductAttrResultMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductAttrResultQueryVo getYxStoreProductAttrResultById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreProductAttrResultQueryParam + * @return + */ + IPage getYxStoreProductAttrResultPageList(@Param("page") Page page, @Param("param") YxStoreProductAttrResultQueryParam yxStoreProductAttrResultQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrValueMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrValueMapper.java new file mode 100644 index 00000000..4cada4e7 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductAttrValueMapper.java @@ -0,0 +1,48 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrValueQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrValueQueryVo; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Update; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 商品属性值表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Repository +public interface YxStoreProductAttrValueMapper extends BaseMapper { + + @Update("update yx_store_product_attr_value set stock=stock-#{num}, sales=sales+#{num}" + + " where product_id=#{productId} and `unique`=#{unique}") + int decStockIncSales(@Param("num") int num,@Param("productId") int productId, + @Param("unique") String unique); + + + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductAttrValueQueryVo getYxStoreProductAttrValueById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreProductAttrValueQueryParam + * @return + */ + IPage getYxStoreProductAttrValuePageList(@Param("page") Page page, @Param("param") YxStoreProductAttrValueQueryParam yxStoreProductAttrValueQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductMapper.java new file mode 100644 index 00000000..4a2245bf --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductMapper.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreProduct; +import co.yixiang.modules.shop.web.param.YxStoreProductQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Update; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 商品表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Repository +public interface YxStoreProductMapper extends BaseMapper { + + @Update("update yx_store_product set stock=stock-#{num}, sales=sales+#{num}" + + " where product_id=#{productId}") + int decStockIncSales(@Param("num") int num,@Param("productId") int productId); + + @Update("update yx_store_product set sales=sales+#{num}" + + " where id=#{productId}") + int incSales(@Param("num") int num,@Param("productId") int productId); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductQueryVo getYxStoreProductById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreProductQueryParam + * @return + */ + IPage getYxStoreProductPageList(@Param("page") Page page, @Param("param") YxStoreProductQueryParam yxStoreProductQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductRelationMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductRelationMapper.java new file mode 100644 index 00000000..6637aacc --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductRelationMapper.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreProductRelation; +import co.yixiang.modules.shop.web.param.YxStoreProductRelationQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductRelationQueryVo; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 商品点赞和收藏表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Repository +public interface YxStoreProductRelationMapper extends BaseMapper { + + @Select("select B.id pid,A.category,B.store_name as storeName,B.price," + + "B.ot_price as otPrice,B.sales,B.image,B.is_del as isDel,B.is_show as isShow" + + " from yx_store_product_relation A left join yx_store_product B " + + "on A.product_id = B.id where A.uid=#{uid}") + List selectList(Page page,@Param("uid") int uid); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductRelationQueryVo getYxStoreProductRelationById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreProductRelationQueryParam + * @return + */ + IPage getYxStoreProductRelationPageList(@Param("page") Page page, + @Param("param") YxStoreProductRelationQueryParam yxStoreProductRelationQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductReplyMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductReplyMapper.java new file mode 100644 index 00000000..62561500 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxStoreProductReplyMapper.java @@ -0,0 +1,62 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxStoreProductReply; +import co.yixiang.modules.shop.web.param.YxStoreProductReplyQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductReplyQueryVo; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 评论表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Repository +public interface YxStoreProductReplyMapper extends BaseMapper { + + @Select("select A.product_score as productScore,A.service_score as serviceScore," + + "A.comment,A.merchant_reply_content as merchantReplyContent," + + "A.merchant_reply_time as merchantReplyTime,A.pics,A.add_time as addTime," + + "B.nickname,B.avatar,C.cart_info as cartInfo" + + " from yx_store_product_reply A left join yx_user B " + + "on A.uid = B.uid left join yx_store_order_cart_info C on A.unique = C.unique" + + " where A.product_id=#{productId} and A.is_del=0 and A.reply_type='product' " + + "order by A.add_time DESC limit 1") + YxStoreProductReplyQueryVo getReply(int productId); + + @Select("select A.product_score as productScore,A.service_score as serviceScore," + + "A.comment,A.merchant_reply_content as merchantReplyContent," + + "A.merchant_reply_time as merchantReplyTime,A.pics,A.add_time as addTime," + + "B.nickname,B.avatar,C.cart_info as cartInfo" + + " from yx_store_product_reply A left join yx_user B " + + "on A.uid = B.uid left join yx_store_order_cart_info C on A.unique = C.unique" + + " where A.product_id=#{productId} and A.is_del=0 and A.reply_type='product' " + + "order by A.add_time DESC") + List selectReplyList(Page page, @Param("productId") int productId); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductReplyQueryVo getYxStoreProductReplyById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxStoreProductReplyQueryParam + * @return + */ + IPage getYxStoreProductReplyPageList(@Param("page") Page page, @Param("param") YxStoreProductReplyQueryParam yxStoreProductReplyQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxSystemConfigMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxSystemConfigMapper.java new file mode 100644 index 00000000..4ddfdb1a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxSystemConfigMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxSystemConfig; +import co.yixiang.modules.shop.web.param.YxSystemConfigQueryParam; +import co.yixiang.modules.shop.web.vo.YxSystemConfigQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 配置表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Repository +public interface YxSystemConfigMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxSystemConfigQueryVo getYxSystemConfigById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxSystemConfigQueryParam + * @return + */ + IPage getYxSystemConfigPageList(@Param("page") Page page, @Param("param") YxSystemConfigQueryParam yxSystemConfigQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxSystemGroupDataMapper.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxSystemGroupDataMapper.java new file mode 100644 index 00000000..43abf594 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapper/YxSystemGroupDataMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.shop.entity.YxSystemGroupData; +import co.yixiang.modules.shop.web.param.YxSystemGroupDataQueryParam; +import co.yixiang.modules.shop.web.vo.YxSystemGroupDataQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 组合数据详情表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Repository +public interface YxSystemGroupDataMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxSystemGroupDataQueryVo getYxSystemGroupDataById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxSystemGroupDataQueryParam + * @return + */ + IPage getYxSystemGroupDataPageList(@Param("page") Page page, @Param("param") YxSystemGroupDataQueryParam yxSystemGroupDataQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/CartMap.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/CartMap.java new file mode 100644 index 00000000..75076746 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/CartMap.java @@ -0,0 +1,17 @@ +package co.yixiang.modules.shop.mapping; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.entity.YxStoreCart; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + + +/** +* @author hupeng +* @date 2019-10-26 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface CartMap extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/CategoryMap.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/CategoryMap.java new file mode 100644 index 00000000..daab9d33 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/CategoryMap.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.shop.mapping; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.entity.YxStoreCategory; +import co.yixiang.modules.shop.entity.YxStoreProduct; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import co.yixiang.utils.CateDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + + +/** +* @author hupeng +* @date 2019-10-19 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface CategoryMap extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/ProductAttrMap.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/ProductAttrMap.java new file mode 100644 index 00000000..ed07dd45 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/ProductAttrMap.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.shop.mapping; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.entity.YxStoreCategory; +import co.yixiang.modules.shop.entity.YxStoreProductAttr; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrQueryVo; +import co.yixiang.utils.CateDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + + +/** +* @author hupeng +* @date 2019-10-19 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface ProductAttrMap extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/YxStoreProductMap.java b/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/YxStoreProductMap.java new file mode 100644 index 00000000..4671587c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/mapping/YxStoreProductMap.java @@ -0,0 +1,17 @@ +package co.yixiang.modules.shop.mapping; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.entity.YxStoreProduct; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + + +/** +* @author hupeng +* @date 2019-10-19 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreProductMap extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxArticleService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxArticleService.java new file mode 100644 index 00000000..bf2e3faf --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxArticleService.java @@ -0,0 +1,37 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.common.service.BaseService; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.entity.YxArticle; +import co.yixiang.modules.shop.web.param.YxArticleQueryParam; +import co.yixiang.modules.shop.web.vo.YxArticleQueryVo; + +import java.io.Serializable; + +/** + *

+ * 文章管理表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-02 + */ +public interface YxArticleService extends BaseService { + + void incVisitNum(int id); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxArticleQueryVo getYxArticleById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxArticleQueryParam + * @return + */ + Paging getYxArticlePageList(YxArticleQueryParam yxArticleQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCartService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCartService.java new file mode 100644 index 00000000..52376d03 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCartService.java @@ -0,0 +1,37 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreCart; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreCartQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; +import java.util.Map; + +/** + *

+ * 购物车表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-25 + */ +public interface YxStoreCartService extends BaseService { + + Map getUserProductCartList(int uid,String cartIds,int status); + + int getUserCartNum(int uid,String type,int numType); + + int addCart(int uid,int productId,int cartNum, String productAttrUnique, + String type,int isNew,int combinationId,int seckillId,int bargainId); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCartQueryVo getYxStoreCartById(Serializable id) throws Exception; + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java new file mode 100644 index 00000000..b784385b --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java @@ -0,0 +1,36 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreCategory; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreCategoryQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCategoryQueryVo; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.utils.CateDTO; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 商品分类表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-22 + */ +public interface YxStoreCategoryService extends BaseService { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCategoryQueryVo getYxStoreCategoryById(Serializable id) throws Exception; + + public List getList(); + + public List getAllChilds(int catid); + + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponIssueService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponIssueService.java new file mode 100644 index 00000000..32731255 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponIssueService.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreCouponIssue; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreCouponIssueQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponIssueQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 优惠券前台领取表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxStoreCouponIssueService extends BaseService { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCouponIssueQueryVo getYxStoreCouponIssueById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreCouponIssueQueryParam + * @return + */ + Paging getYxStoreCouponIssuePageList(YxStoreCouponIssueQueryParam yxStoreCouponIssueQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponIssueUserService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponIssueUserService.java new file mode 100644 index 00000000..baad3512 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponIssueUserService.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreCouponIssueUser; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreCouponIssueUserQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponIssueUserQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 优惠券前台用户领取记录表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxStoreCouponIssueUserService extends BaseService { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCouponIssueUserQueryVo getYxStoreCouponIssueUserById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreCouponIssueUserQueryParam + * @return + */ + Paging getYxStoreCouponIssueUserPageList(YxStoreCouponIssueUserQueryParam yxStoreCouponIssueUserQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponService.java new file mode 100644 index 00000000..457ecc4b --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponService.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreCoupon; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreCouponQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 优惠券表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxStoreCouponService extends BaseService { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCouponQueryVo getYxStoreCouponById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreCouponQueryParam + * @return + */ + Paging getYxStoreCouponPageList(YxStoreCouponQueryParam yxStoreCouponQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponUserService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponUserService.java new file mode 100644 index 00000000..d964ec3a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreCouponUserService.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreCouponUser; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreCouponUserQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponUserQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 优惠券发放记录表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxStoreCouponUserService extends BaseService { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreCouponUserQueryVo getYxStoreCouponUserById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreCouponUserQueryParam + * @return + */ + Paging getYxStoreCouponUserPageList(YxStoreCouponUserQueryParam yxStoreCouponUserQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrResultService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrResultService.java new file mode 100644 index 00000000..19fdf394 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrResultService.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreProductAttrResult; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrResultQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrResultQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 商品属性详情表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +public interface YxStoreProductAttrResultService extends BaseService { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductAttrResultQueryVo getYxStoreProductAttrResultById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreProductAttrResultQueryParam + * @return + */ + Paging getYxStoreProductAttrResultPageList(YxStoreProductAttrResultQueryParam yxStoreProductAttrResultQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrService.java new file mode 100644 index 00000000..b1648079 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrService.java @@ -0,0 +1,32 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreProductAttr; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; +import java.util.Map; + +/** + *

+ * 商品属性表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +public interface YxStoreProductAttrService extends BaseService { + + void decProductAttrStock(int num, int productId, String unique); + + Map getProductAttrDetail(int productId,int uid,int type); + + int uniqueByStock(String unique); + + Boolean issetProductUnique(int productId,String unique); + + YxStoreProductAttrValue uniqueByAttrInfo(String unique); +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrValueService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrValueService.java new file mode 100644 index 00000000..d4bca7d3 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrValueService.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrValueQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrValueQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 商品属性值表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +public interface YxStoreProductAttrValueService extends BaseService { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductAttrValueQueryVo getYxStoreProductAttrValueById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreProductAttrValueQueryParam + * @return + */ + Paging getYxStoreProductAttrValuePageList(YxStoreProductAttrValueQueryParam yxStoreProductAttrValueQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductRelationService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductRelationService.java new file mode 100644 index 00000000..ca111229 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductRelationService.java @@ -0,0 +1,48 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreProductRelation; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxStoreProductRelationQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductRelationQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 商品点赞和收藏表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +public interface YxStoreProductRelationService extends BaseService { + + Boolean isProductRelation(int productId, String category, + int uid, String relationType); + + void addRroductRelation(YxStoreProductRelationQueryParam param,int uid, + String relationType); + + void delRroductRelation(YxStoreProductRelationQueryParam param,int uid, + String relationType); + + List userCollectProduct(int page,int limit,int uid); + + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductRelationQueryVo getYxStoreProductRelationById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreProductRelationQueryParam + * @return + */ + Paging getYxStoreProductRelationPageList(YxStoreProductRelationQueryParam yxStoreProductRelationQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java new file mode 100644 index 00000000..f39cedcb --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java @@ -0,0 +1,53 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreProductReply; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.dto.ReplyCountDTO; +import co.yixiang.modules.shop.web.param.YxStoreProductReplyQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductReplyQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 评论表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +public interface YxStoreProductReplyService extends BaseService { + + ReplyCountDTO getReplyCount(int productId); + + YxStoreProductReplyQueryVo handleReply(YxStoreProductReplyQueryVo replyQueryVo); + + YxStoreProductReplyQueryVo getReply(int productId); + + List getReplyList(int productId,int page, int limit); + + int getInfoCount(Integer oid,String unique); + + int replyCount(String unique); + + int productReplyCount(int productId); + + String doReply(int productId,int count); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductReplyQueryVo getYxStoreProductReplyById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxStoreProductReplyQueryParam + * @return + */ + Paging getYxStoreProductReplyPageList(YxStoreProductReplyQueryParam yxStoreProductReplyQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java new file mode 100644 index 00000000..98d3a9c0 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java @@ -0,0 +1,55 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxStoreProduct; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.dto.ProductDTO; +import co.yixiang.modules.shop.web.param.YxStoreProductQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 商品表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +public interface YxStoreProductService extends BaseService { + + void decProductStock(int num,int productId,String unique); + + int getProductStock(int productId,String unique); + + + ProductDTO goodsDetail(int id,int type,int uid); + + List getGoodsList(YxStoreProductQueryParam productQueryParam); + + /** + * 商品列表 + * @param page + * @param limit + * @param order + * @return + */ + List getList(int page, int limit, int order); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxStoreProductQueryVo getYxStoreProductById(Serializable id); + + /** + * 获取分页对象 + * @param yxStoreProductQueryParam + * @return + */ + Paging getYxStoreProductPageList(YxStoreProductQueryParam yxStoreProductQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxSystemConfigService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxSystemConfigService.java new file mode 100644 index 00000000..e5bcdbb1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxSystemConfigService.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxSystemConfig; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxSystemConfigQueryParam; +import co.yixiang.modules.shop.web.vo.YxSystemConfigQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 配置表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +public interface YxSystemConfigService extends BaseService { + + String getData(String name); +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java new file mode 100644 index 00000000..7c128dec --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java @@ -0,0 +1,25 @@ +package co.yixiang.modules.shop.service; + +import co.yixiang.modules.shop.entity.YxSystemGroupData; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.shop.web.param.YxSystemGroupDataQueryParam; +import co.yixiang.modules.shop.web.vo.YxSystemGroupDataQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + *

+ * 组合数据详情表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +public interface YxSystemGroupDataService extends BaseService { + + List> getDatas(String name); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxArticleServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxArticleServiceImpl.java new file mode 100644 index 00000000..4f0b7dbd --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxArticleServiceImpl.java @@ -0,0 +1,53 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.entity.YxArticle; +import co.yixiang.modules.shop.mapper.YxArticleMapper; +import co.yixiang.modules.shop.web.param.YxArticleQueryParam; +import co.yixiang.modules.shop.web.vo.YxArticleQueryVo; +import co.yixiang.modules.shop.service.YxArticleService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 文章管理表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-02 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxArticleServiceImpl extends BaseServiceImpl implements YxArticleService { + + @Autowired + private YxArticleMapper yxArticleMapper; + + @Override + public YxArticleQueryVo getYxArticleById(Serializable id) throws Exception{ + return yxArticleMapper.getYxArticleById(id); + } + + @Override + public Paging getYxArticlePageList(YxArticleQueryParam yxArticleQueryParam){ + Page page = setPageParam(yxArticleQueryParam,OrderItem.desc("add_time")); + IPage iPage = yxArticleMapper.getYxArticlePageList(page,yxArticleQueryParam); + return new Paging(iPage); + } + + @Override + public void incVisitNum(int id) { + yxArticleMapper.incVisitNum(id); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCartServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCartServiceImpl.java new file mode 100644 index 00000000..b72c7f9e --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCartServiceImpl.java @@ -0,0 +1,221 @@ +package co.yixiang.modules.shop.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.exception.ErrorRequestException; +import co.yixiang.modules.shop.entity.YxStoreCart; +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import co.yixiang.modules.shop.mapper.YxStoreCartMapper; +import co.yixiang.modules.shop.mapping.CartMap; +import co.yixiang.modules.shop.service.YxStoreCartService; +import co.yixiang.modules.shop.service.YxStoreProductAttrService; +import co.yixiang.modules.shop.service.YxStoreProductService; +import co.yixiang.modules.shop.web.param.YxStoreCartQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import co.yixiang.utils.OrderUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.Builder; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.util.StringUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import javax.validation.Valid; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + + +/** + *

+ * 购物车表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-25 + */ +@Slf4j +@Service +@Builder +@Transactional(rollbackFor = Exception.class) +public class YxStoreCartServiceImpl extends BaseServiceImpl implements YxStoreCartService { + + @Autowired + private YxStoreCartMapper yxStoreCartMapper; + + @Autowired + private YxStoreProductService productService; + + @Autowired + private YxStoreProductAttrService productAttrService; + + @Autowired + private CartMap cartMap; + + + /** + * 购物车列表 + * @param uid 用户id + * @param cartIds 购物车id,多个逗号隔开 + * @param status 0-购购物车列表 + * @return + */ + @Override + public Map getUserProductCartList(int uid, String cartIds, int status) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("uid",uid).eq("type","product").eq("is_pay",0) + .eq("is_del",0).orderByDesc("add_time"); + if(status == 0) wrapper.eq("is_new",0); + if(StrUtil.isNotEmpty(cartIds)) wrapper.in("id",cartIds.split(",")); + List carts = yxStoreCartMapper.selectList(wrapper); + + List valid = new ArrayList<>(); + List invalid = new ArrayList<>(); + + for (YxStoreCart storeCart : carts) { + YxStoreProductQueryVo storeProduct = productService + .getYxStoreProductById(storeCart.getProductId()); + YxStoreCartQueryVo storeCartQueryVo = cartMap.toDto(storeCart); + //System.out.println(storeProduct); + storeCartQueryVo.setProductInfo(storeProduct); + if(ObjectUtil.isNull(storeProduct)){ + YxStoreCart yxStoreCart = new YxStoreCart(); + yxStoreCart.setIsDel(1); + yxStoreCartMapper.update(yxStoreCart, + new QueryWrapper() + .lambda().eq(YxStoreCart::getId,storeCart.getId())); + }else if(storeProduct.getIsShow() == 0 || storeProduct.getIsDel() == 1 || storeProduct.getStock() == 0){ + invalid.add(storeCartQueryVo); + }else{ + if(StrUtil.isNotEmpty(storeCart.getProductAttrUnique())){ + YxStoreProductAttrValue productAttrValue = productAttrService + .uniqueByAttrInfo(storeCart.getProductAttrUnique()); + if(ObjectUtil.isNull(productAttrValue) || productAttrValue.getStock() == 0){ + invalid.add(storeCartQueryVo); + }else{ + storeProduct.setAttrInfo(productAttrValue); + //todo 秒杀 砍价 拼团 + + //todo 设置真实价格 + storeCartQueryVo.setTruePrice(productAttrValue.getPrice() + .doubleValue()); + //todo 设置会员价 + storeCartQueryVo.setVipTruePrice(productAttrValue.getPrice() + .doubleValue()); + storeCartQueryVo.setCostPrice(productAttrValue.getCost() + .doubleValue()); + storeCartQueryVo.setTrueStock(productAttrValue.getStock()); + + valid.add(storeCartQueryVo); + } + }else{ + storeCartQueryVo.setTruePrice(storeProduct.getPrice() + .doubleValue()); + //todo 设置会员价 + storeCartQueryVo.setVipTruePrice(0d); + storeCartQueryVo.setCostPrice(storeProduct.getCost() + .doubleValue()); + storeCartQueryVo.setTrueStock(storeProduct.getStock()); + + valid.add(storeCartQueryVo); + } + } + } + Map map = new LinkedHashMap<>(); + map.put("valid",valid); + map.put("invalid",invalid); + return map; + } + + /** + * 添加购物车 + * @param uid 用户id + * @param productId 普通产品编号 + * @param cartNum 购物车数量 + * @param productAttrUnique 属性唯一值 + * @param type product + * @param isNew 1 加入购物车直接购买 0 加入购物车 + * @param combinationId 拼团id + * @param seckillId 秒杀id + * @param bargainId 砍价id + * @return + */ + @Override + public int addCart(int uid, int productId, int cartNum, String productAttrUnique, + String type, int isNew, int combinationId, int seckillId, int bargainId) { + YxStoreProductQueryVo productQueryVo = productService + .getYxStoreProductById(productId); + if(ObjectUtil.isNull(productQueryVo)){ + throw new ErrorRequestException("该产品已下架或删除"); + } + + int stock = productService.getProductStock(productId,productAttrUnique); + if(stock < cartNum){ + throw new ErrorRequestException("该产品库存不足"+cartNum); + } + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("uid",uid).eq("type",type).eq("is_pay",0).eq("is_del",0) + .eq("is_new",isNew).eq("product_attr_unique",productAttrUnique) + .eq("combination_id",combinationId).eq("bargain_id",bargainId) + .eq("seckill_id",seckillId); + + YxStoreCart cart =yxStoreCartMapper.selectOne(wrapper); + YxStoreCart storeCart = new YxStoreCart(); + + storeCart.setBargainId(bargainId); + storeCart.setCartNum(cartNum); + storeCart.setCombinationId(combinationId); + storeCart.setIsNew(0); + storeCart.setProductAttrUnique(productAttrUnique); + storeCart.setProductId(productId); + storeCart.setSeckillId(seckillId); + storeCart.setType(type); + storeCart.setUid(uid); + storeCart.setIsNew(isNew); + if(ObjectUtil.isNotNull(cart)){ + if(isNew == 0){ + storeCart.setCartNum(cartNum + storeCart.getCartNum()); + } + storeCart.setId(cart.getId()); + yxStoreCartMapper.updateById(storeCart); + }else{ + storeCart.setAddTime(OrderUtil.getSecondTimestampTwo()); + yxStoreCartMapper.insert(storeCart); + } + + return storeCart.getId().intValue(); + } + + @Override + public int getUserCartNum(int uid, String type, int numType) { + int num = 0; + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("uid",uid).eq("type",type).eq("is_pay",0).eq("is_del",0).eq("is_new",0); + if(numType > 0){ + num = yxStoreCartMapper.selectCount(wrapper); + }else{ + num = yxStoreCartMapper.cartSum(uid,type); + } + return num; + } + + @Override + public YxStoreCartQueryVo getYxStoreCartById(Serializable id) throws Exception{ + return yxStoreCartMapper.getYxStoreCartById(id); + } + + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java new file mode 100644 index 00000000..bda56335 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java @@ -0,0 +1,69 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxStoreCategory; +import co.yixiang.modules.shop.mapper.YxStoreCategoryMapper; +import co.yixiang.modules.shop.mapping.CategoryMap; +import co.yixiang.modules.shop.service.YxStoreCategoryService; +import co.yixiang.modules.shop.web.param.YxStoreCategoryQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCategoryQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.utils.CateDTO; +import co.yixiang.utils.TreeUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; +import java.util.List; + + +/** + *

+ * 商品分类表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-22 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreCategoryServiceImpl extends BaseServiceImpl implements YxStoreCategoryService { + + @Autowired + private YxStoreCategoryMapper yxStoreCategoryMapper; + + @Autowired + private CategoryMap categoryMap; + + @Override + public YxStoreCategoryQueryVo getYxStoreCategoryById(Serializable id) throws Exception{ + return yxStoreCategoryMapper.getYxStoreCategoryById(id); + } + + @Override + public List getList() { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_show",1).orderByAsc("sort"); + List list = categoryMap.toDto(baseMapper.selectList(wrapper)); + return TreeUtil.list2TreeConverter(list,0); + } + + @Override + public List getAllChilds(int catid) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_show",1).eq("id",catid); + + List list = categoryMap.toDto(baseMapper.selectList(wrapper)); + + System.out.println(TreeUtil.getChildList(list,new CateDTO())); + return null; + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponIssueServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponIssueServiceImpl.java new file mode 100644 index 00000000..dde08694 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponIssueServiceImpl.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxStoreCouponIssue; +import co.yixiang.modules.shop.mapper.YxStoreCouponIssueMapper; +import co.yixiang.modules.shop.service.YxStoreCouponIssueService; +import co.yixiang.modules.shop.web.param.YxStoreCouponIssueQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponIssueQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 优惠券前台领取表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreCouponIssueServiceImpl extends BaseServiceImpl implements YxStoreCouponIssueService { + + @Autowired + private YxStoreCouponIssueMapper yxStoreCouponIssueMapper; + + @Override + public YxStoreCouponIssueQueryVo getYxStoreCouponIssueById(Serializable id) throws Exception{ + return yxStoreCouponIssueMapper.getYxStoreCouponIssueById(id); + } + + @Override + public Paging getYxStoreCouponIssuePageList(YxStoreCouponIssueQueryParam yxStoreCouponIssueQueryParam) throws Exception{ + Page page = setPageParam(yxStoreCouponIssueQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreCouponIssueMapper.getYxStoreCouponIssuePageList(page,yxStoreCouponIssueQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponIssueUserServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponIssueUserServiceImpl.java new file mode 100644 index 00000000..5c4bf240 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponIssueUserServiceImpl.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxStoreCouponIssueUser; +import co.yixiang.modules.shop.mapper.YxStoreCouponIssueUserMapper; +import co.yixiang.modules.shop.service.YxStoreCouponIssueUserService; +import co.yixiang.modules.shop.web.param.YxStoreCouponIssueUserQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponIssueUserQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 优惠券前台用户领取记录表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreCouponIssueUserServiceImpl extends BaseServiceImpl implements YxStoreCouponIssueUserService { + + @Autowired + private YxStoreCouponIssueUserMapper yxStoreCouponIssueUserMapper; + + @Override + public YxStoreCouponIssueUserQueryVo getYxStoreCouponIssueUserById(Serializable id) throws Exception{ + return yxStoreCouponIssueUserMapper.getYxStoreCouponIssueUserById(id); + } + + @Override + public Paging getYxStoreCouponIssueUserPageList(YxStoreCouponIssueUserQueryParam yxStoreCouponIssueUserQueryParam) throws Exception{ + Page page = setPageParam(yxStoreCouponIssueUserQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreCouponIssueUserMapper.getYxStoreCouponIssueUserPageList(page,yxStoreCouponIssueUserQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponServiceImpl.java new file mode 100644 index 00000000..1a68db51 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponServiceImpl.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxStoreCoupon; +import co.yixiang.modules.shop.mapper.YxStoreCouponMapper; +import co.yixiang.modules.shop.service.YxStoreCouponService; +import co.yixiang.modules.shop.web.param.YxStoreCouponQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 优惠券表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreCouponServiceImpl extends BaseServiceImpl implements YxStoreCouponService { + + @Autowired + private YxStoreCouponMapper yxStoreCouponMapper; + + @Override + public YxStoreCouponQueryVo getYxStoreCouponById(Serializable id) throws Exception{ + return yxStoreCouponMapper.getYxStoreCouponById(id); + } + + @Override + public Paging getYxStoreCouponPageList(YxStoreCouponQueryParam yxStoreCouponQueryParam) throws Exception{ + Page page = setPageParam(yxStoreCouponQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreCouponMapper.getYxStoreCouponPageList(page,yxStoreCouponQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponUserServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponUserServiceImpl.java new file mode 100644 index 00000000..51137b59 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCouponUserServiceImpl.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxStoreCouponUser; +import co.yixiang.modules.shop.mapper.YxStoreCouponUserMapper; +import co.yixiang.modules.shop.service.YxStoreCouponUserService; +import co.yixiang.modules.shop.web.param.YxStoreCouponUserQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCouponUserQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 优惠券发放记录表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreCouponUserServiceImpl extends BaseServiceImpl implements YxStoreCouponUserService { + + @Autowired + private YxStoreCouponUserMapper yxStoreCouponUserMapper; + + @Override + public YxStoreCouponUserQueryVo getYxStoreCouponUserById(Serializable id) throws Exception{ + return yxStoreCouponUserMapper.getYxStoreCouponUserById(id); + } + + @Override + public Paging getYxStoreCouponUserPageList(YxStoreCouponUserQueryParam yxStoreCouponUserQueryParam) throws Exception{ + Page page = setPageParam(yxStoreCouponUserQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreCouponUserMapper.getYxStoreCouponUserPageList(page,yxStoreCouponUserQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrResultServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrResultServiceImpl.java new file mode 100644 index 00000000..0ad62426 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrResultServiceImpl.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxStoreProductAttrResult; +import co.yixiang.modules.shop.mapper.YxStoreProductAttrResultMapper; +import co.yixiang.modules.shop.service.YxStoreProductAttrResultService; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrResultQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrResultQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 商品属性详情表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreProductAttrResultServiceImpl extends BaseServiceImpl implements YxStoreProductAttrResultService { + + @Autowired + private YxStoreProductAttrResultMapper yxStoreProductAttrResultMapper; + + @Override + public YxStoreProductAttrResultQueryVo getYxStoreProductAttrResultById(Serializable id) throws Exception{ + return yxStoreProductAttrResultMapper.getYxStoreProductAttrResultById(id); + } + + @Override + public Paging getYxStoreProductAttrResultPageList(YxStoreProductAttrResultQueryParam yxStoreProductAttrResultQueryParam) throws Exception{ + Page page = setPageParam(yxStoreProductAttrResultQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreProductAttrResultMapper.getYxStoreProductAttrResultPageList(page,yxStoreProductAttrResultQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrServiceImpl.java new file mode 100644 index 00000000..982ddebf --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrServiceImpl.java @@ -0,0 +1,132 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxStoreProductAttr; +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import co.yixiang.modules.shop.mapper.YxStoreProductAttrMapper; +import co.yixiang.modules.shop.mapper.YxStoreProductAttrValueMapper; +import co.yixiang.modules.shop.mapping.ProductAttrMap; +import co.yixiang.modules.shop.service.YxStoreProductAttrService; +import co.yixiang.modules.shop.web.dto.AttrValueDTO; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrValueQueryVo; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.util.LinkedCaseInsensitiveMap; + +import java.io.Serializable; +import java.util.*; + + +/** + *

+ * 商品属性表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreProductAttrServiceImpl extends BaseServiceImpl implements YxStoreProductAttrService { + + @Autowired + private YxStoreProductAttrMapper yxStoreProductAttrMapper; + + @Autowired + private YxStoreProductAttrValueMapper yxStoreProductAttrValueMapper; + + @Autowired + private ProductAttrMap productAttrMap; + + + @Override + public void decProductAttrStock(int num, int productId, String unique) { + yxStoreProductAttrValueMapper.decStockIncSales(num,productId,unique); + } + + @Override + public Map getProductAttrDetail(int productId,int uid,int type) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("product_id",productId).orderByAsc("attr_values"); + List storeProductAttrs = yxStoreProductAttrMapper + .selectList(wrapper); + + QueryWrapper wrapper2 = new QueryWrapper<>(); + wrapper2.eq("product_id",productId); + List productAttrValues = yxStoreProductAttrValueMapper + .selectList(wrapper2); + + List> mapList = new ArrayList<>(); + + Map map = new LinkedHashMap<>(); + for (YxStoreProductAttrValue value : productAttrValues) { + + map.put(value.getSuk(),value); + // mapList.add(map); + } + + List yxStoreProductAttrQueryVoList = new ArrayList<>(); + + for (YxStoreProductAttr attr : storeProductAttrs) { + List stringList = Arrays.asList(attr.getAttrValues().split(",")); + List attrValueDTOS = new ArrayList<>(); + for (String str : stringList) { + AttrValueDTO attrValueDTO = new AttrValueDTO(); + attrValueDTO.setAttr(str); + attrValueDTO.setCheck(false); + + attrValueDTOS.add(attrValueDTO); + } + YxStoreProductAttrQueryVo attrQueryVo = productAttrMap.toDto(attr); + attrQueryVo.setAttrValue(attrValueDTOS); + attrQueryVo.setAttrValueArr(stringList); + + yxStoreProductAttrQueryVoList.add(attrQueryVo); + + } + + //System.out.println(yxStoreProductAttrQueryVoList); + //System.out.println(map); + Map returnMap = new LinkedHashMap<>(); + + + returnMap.put("productAttr",yxStoreProductAttrQueryVoList); + returnMap.put("productValue",map); + return returnMap; + } + + /** + * 库存 + * @param unique + * @return + */ + @Override + public int uniqueByStock(String unique) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("`unique`",unique); + return yxStoreProductAttrValueMapper.selectOne(wrapper).getStock(); + } + + @Override + public Boolean issetProductUnique(int productId, String unique) { + return null; + } + + @Override + public YxStoreProductAttrValue uniqueByAttrInfo(String unique) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("`unique`",unique); + return yxStoreProductAttrValueMapper.selectOne(wrapper); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrValueServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrValueServiceImpl.java new file mode 100644 index 00000000..59ebbd5a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrValueServiceImpl.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import co.yixiang.modules.shop.mapper.YxStoreProductAttrValueMapper; +import co.yixiang.modules.shop.service.YxStoreProductAttrValueService; +import co.yixiang.modules.shop.web.param.YxStoreProductAttrValueQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrValueQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 商品属性值表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreProductAttrValueServiceImpl extends BaseServiceImpl implements YxStoreProductAttrValueService { + + @Autowired + private YxStoreProductAttrValueMapper yxStoreProductAttrValueMapper; + + @Override + public YxStoreProductAttrValueQueryVo getYxStoreProductAttrValueById(Serializable id) throws Exception{ + return yxStoreProductAttrValueMapper.getYxStoreProductAttrValueById(id); + } + + @Override + public Paging getYxStoreProductAttrValuePageList(YxStoreProductAttrValueQueryParam yxStoreProductAttrValueQueryParam) throws Exception{ + Page page = setPageParam(yxStoreProductAttrValueQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreProductAttrValueMapper.getYxStoreProductAttrValuePageList(page,yxStoreProductAttrValueQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductRelationServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductRelationServiceImpl.java new file mode 100644 index 00000000..0a724591 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductRelationServiceImpl.java @@ -0,0 +1,100 @@ +package co.yixiang.modules.shop.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import co.yixiang.exception.ErrorRequestException; +import co.yixiang.modules.shop.entity.YxStoreProductRelation; +import co.yixiang.modules.shop.mapper.YxStoreProductRelationMapper; +import co.yixiang.modules.shop.service.YxStoreProductRelationService; +import co.yixiang.modules.shop.web.param.YxStoreProductRelationQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductRelationQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.utils.OrderUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; +import java.util.List; + + +/** + *

+ * 商品点赞和收藏表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreProductRelationServiceImpl extends BaseServiceImpl implements YxStoreProductRelationService { + + @Autowired + private YxStoreProductRelationMapper yxStoreProductRelationMapper; + + @Override + public YxStoreProductRelationQueryVo getYxStoreProductRelationById(Serializable id) throws Exception{ + return yxStoreProductRelationMapper.getYxStoreProductRelationById(id); + } + + @Override + public Paging getYxStoreProductRelationPageList(YxStoreProductRelationQueryParam yxStoreProductRelationQueryParam) throws Exception{ + Page page = setPageParam(yxStoreProductRelationQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreProductRelationMapper.getYxStoreProductRelationPageList(page,yxStoreProductRelationQueryParam); + return new Paging(iPage); + } + + @Override + public List userCollectProduct(int page, int limit, int uid) { + Page pageModel = new Page<>(page, limit); + List list = baseMapper.selectList(pageModel,uid); + return list; + } + + @Override + public void addRroductRelation(YxStoreProductRelationQueryParam param + ,int uid,String relationType) { + YxStoreProductRelation storeProductRelation = new YxStoreProductRelation(); + if(isProductRelation(param.getId(),param.getCategory(),uid,relationType)) throw new ErrorRequestException("已收藏"); + + storeProductRelation.setCategory(param.getCategory()); + storeProductRelation.setProductId(param.getId()); + storeProductRelation.setType(relationType); + storeProductRelation.setUid(uid); + storeProductRelation.setAddTime(OrderUtil.getSecondTimestampTwo()); + + yxStoreProductRelationMapper.insert(storeProductRelation); + } + + @Override + public void delRroductRelation(YxStoreProductRelationQueryParam param, int uid, String relationType) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("uid",uid).eq("product_id",param.getId()) + .eq("type",relationType).eq("category",param.getCategory()); + YxStoreProductRelation productRelation = yxStoreProductRelationMapper + .selectOne(wrapper); + if(ObjectUtil.isNull(productRelation)) throw new ErrorRequestException("已取消"); + + yxStoreProductRelationMapper.deleteById(productRelation.getId()); + } + + @Override + public Boolean isProductRelation(int productId, String category, + int uid, String relationType) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("uid",uid).eq("product_id",productId) + .eq("type",relationType).eq("category",category); + YxStoreProductRelation productRelation = yxStoreProductRelationMapper + .selectOne(wrapper); + if(ObjectUtil.isNotNull(productRelation)) return true; + + return false; + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java new file mode 100644 index 00000000..f1be7b05 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java @@ -0,0 +1,184 @@ +package co.yixiang.modules.shop.service.impl; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.modules.shop.entity.YxStoreProductReply; +import co.yixiang.modules.shop.mapper.YxStoreProductReplyMapper; +import co.yixiang.modules.shop.service.YxStoreProductReplyService; +import co.yixiang.modules.shop.web.dto.ReplyCountDTO; +import co.yixiang.modules.shop.web.param.YxStoreProductReplyQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import co.yixiang.modules.shop.web.vo.YxStoreProductReplyQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + +/** + *

+ * 评论表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-23 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreProductReplyServiceImpl extends BaseServiceImpl implements YxStoreProductReplyService { + + @Autowired + private YxStoreProductReplyMapper yxStoreProductReplyMapper; + + /** + * 评价数据 + * @param productId + * @return + */ + @Override + public ReplyCountDTO getReplyCount(int productId) { + ReplyCountDTO replyCountDTO = new ReplyCountDTO(); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("product_id",productId).eq("is_del",0).eq("reply_type","product"); + int sumCount = yxStoreProductReplyMapper.selectCount(wrapper); + replyCountDTO.setSumCount(sumCount); + + //好评 + QueryWrapper wrapperOne = new QueryWrapper<>(); + wrapperOne.eq("product_id",productId).eq("is_del",0) + .eq("reply_type","product").eq("product_score",5); + int goodCount = yxStoreProductReplyMapper.selectCount(wrapperOne); + replyCountDTO.setGoodCount(goodCount); + + //中评 + QueryWrapper wrapperTwo = new QueryWrapper<>(); + wrapperTwo.eq("product_id",productId).eq("is_del",0) + .eq("reply_type","product") + .lt("product_score",5).gt("product_score",2); + replyCountDTO.setInCount(yxStoreProductReplyMapper.selectCount(wrapperTwo)); + + //差评 + QueryWrapper wrapperThree = new QueryWrapper<>(); + wrapperThree.eq("product_id",productId).eq("is_del",0) + .eq("reply_type","product") + .lt("product_score",2); + replyCountDTO.setPoorCount(yxStoreProductReplyMapper.selectCount(wrapperThree)); + + //好评率 + + replyCountDTO.setReplySstar(""+NumberUtil.mul(NumberUtil.div(goodCount,sumCount),5)); + replyCountDTO.setReplyChance(""+NumberUtil.mul(NumberUtil.div(goodCount,sumCount),100)); + + return replyCountDTO; + } + + @Override + public YxStoreProductReplyQueryVo handleReply(YxStoreProductReplyQueryVo replyQueryVo) { + YxStoreCartQueryVo cartInfo = JSONObject.parseObject(replyQueryVo.getCartInfo() + ,YxStoreCartQueryVo.class); + if(ObjectUtil.isNotEmpty(cartInfo.getProductInfo().getAttrInfo())){ + replyQueryVo.setSuk(cartInfo.getProductInfo().getAttrInfo().getSuk()); + } + BigDecimal star = NumberUtil.add(replyQueryVo.getProductScore(), + replyQueryVo.getServiceScore()); + + star = NumberUtil.div(star,2); + + replyQueryVo.setStar(String.valueOf(star.intValue())); + + if(StrUtil.isEmpty(replyQueryVo.getComment())){ + replyQueryVo.setComment("此用户没有填写评价"); + } + + return replyQueryVo; + } + + @Override + public YxStoreProductReplyQueryVo getReply(int productId) { + YxStoreProductReplyQueryVo vo = yxStoreProductReplyMapper.getReply(productId); + if(ObjectUtil.isNotNull(vo)){ + return handleReply(yxStoreProductReplyMapper.getReply(productId)); + } + return null; + } + + @Override + public List getReplyList(int productId,int page, int limit) { + List newList = new ArrayList<>(); + Page pageModel = new Page<>(page, limit); + List list = yxStoreProductReplyMapper + .selectReplyList(pageModel,productId); + for (YxStoreProductReplyQueryVo queryVo : list) { + newList.add(handleReply(queryVo)); + } + return newList; + } + + @Override + public int getInfoCount(Integer oid, String unique) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("`unique`",unique).eq("oid",oid); + return yxStoreProductReplyMapper.selectCount(wrapper); + } + + @Override + public int productReplyCount(int productId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("product_id",productId).eq("is_del",0).eq("reply_type","product"); + return yxStoreProductReplyMapper.selectCount(wrapper); + } + + @Override + public int replyCount(String unique) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("`unique`",unique); + return yxStoreProductReplyMapper.selectCount(wrapper); + } + + /** + * 处理比例 + * @param productId + * @param count + * @return + */ + @Override + public String doReply(int productId, int count) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("product_id",productId).eq("is_del",0) + .eq("reply_type","product").eq("product_score",5); + int productScoreCount = yxStoreProductReplyMapper.selectCount(wrapper); + if(count > 0){ + return ""+NumberUtil.mul(NumberUtil.div(productScoreCount,count),100); + } + + return "0"; + } + + @Override + public YxStoreProductReplyQueryVo getYxStoreProductReplyById(Serializable id) throws Exception{ + return yxStoreProductReplyMapper.getYxStoreProductReplyById(id); + } + + @Override + public Paging getYxStoreProductReplyPageList(YxStoreProductReplyQueryParam yxStoreProductReplyQueryParam) throws Exception{ + Page page = setPageParam(yxStoreProductReplyQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreProductReplyMapper.getYxStoreProductReplyPageList(page,yxStoreProductReplyQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java new file mode 100644 index 00000000..116954d1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java @@ -0,0 +1,222 @@ +package co.yixiang.modules.shop.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.exception.ErrorRequestException; +import co.yixiang.modules.shop.entity.YxStoreCategory; +import co.yixiang.modules.shop.entity.YxStoreProduct; +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import co.yixiang.modules.shop.mapper.YxStoreCategoryMapper; +import co.yixiang.modules.shop.mapper.YxStoreProductMapper; +import co.yixiang.modules.shop.mapping.YxStoreProductMap; +import co.yixiang.modules.shop.service.*; +import co.yixiang.modules.shop.web.dto.ProductDTO; +import co.yixiang.modules.shop.web.param.YxStoreProductQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrQueryVo; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.utils.CateDTO; +import co.yixiang.utils.TreeUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; +import java.util.List; +import java.util.Map; + + +/** + *

+ * 商品表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxStoreProductServiceImpl extends BaseServiceImpl implements YxStoreProductService { + + @Autowired + private YxStoreProductMapper yxStoreProductMapper; + + @Autowired + private YxStoreProductMap storeProductMap; + + @Autowired + private YxStoreProductAttrService storeProductAttrService; + + @Autowired + private YxStoreProductRelationService relationService; + + @Autowired + private YxStoreProductReplyService replyService; + + /** + * 库存与销量 + * @param num + * @param productId + * @param unique + */ + @Override + public void decProductStock(int num, int productId, String unique) { + if(StrUtil.isNotEmpty(unique)){ + storeProductAttrService.decProductAttrStock(num,productId,unique); + yxStoreProductMapper.incSales(num,productId); + }else{ + yxStoreProductMapper.decStockIncSales(num,productId); + } + } + + /** + * 返回商品库存 + * @param productId + * @param unique + * @return + */ + @Override + public int getProductStock(int productId, String unique) { + if(StrUtil.isEmpty(unique)){ + return getYxStoreProductById(productId).getStock(); + }else{ + return storeProductAttrService.uniqueByStock(unique); + } + + } + + @Override + public ProductDTO goodsDetail(int id, int type,int uid) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_del",0).eq("is_show",1).eq("id",id); + YxStoreProduct storeProduct = yxStoreProductMapper.selectOne(wrapper); + if(ObjectUtil.isNull(storeProduct)){ + throw new ErrorRequestException("商品不存在或已下架"); + } + Map returnMap = storeProductAttrService.getProductAttrDetail(id,0,0); + ProductDTO productDTO = new ProductDTO(); + YxStoreProductQueryVo storeProductQueryVo = storeProductMap.toDto(storeProduct); + storeProductQueryVo.setUserCollect(relationService + .isProductRelation(id,"product",uid,"collect")); + productDTO.setStoreInfo(storeProductQueryVo); + productDTO.setProductAttr((List)returnMap.get("productAttr")); + productDTO.setProductValue((Map)returnMap.get("productValue")); + + productDTO.setReply(replyService.getReply(id)); + int replyCount = replyService.productReplyCount(id); + productDTO.setReplyCount(replyCount); + productDTO.setReplyChance(replyService.doReply(id,replyCount));//百分比 + + return productDTO; + } + + /** + * 商品列表 + * @return + */ + @Override + public List getGoodsList(YxStoreProductQueryParam productQueryParam) { + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_del",0).eq("is_show",1).orderByDesc("sort"); + + //分类搜索 + if(productQueryParam.getSid() > 0){ + wrapper.eq("cate_id",productQueryParam.getSid()); + } + //关键字搜索 + if(StrUtil.isNotEmpty(productQueryParam.getKeyword())){ + wrapper.like("store_name",productQueryParam.getKeyword()); + } + + //新品搜索 + if(productQueryParam.getNews() == 1){ + wrapper.eq("is_new",1); + } + //销量排序 + if(productQueryParam.getSalesOrder().equals("desc")){ + wrapper.orderByDesc("sales"); + }else{ + wrapper.orderByAsc("sales"); + } + //价格排序 + if(productQueryParam.getPriceOrder().equals("desc")){ + wrapper.orderByDesc("price"); + }else{ + wrapper.orderByAsc("price"); + } + + + Page pageModel = new Page<>(productQueryParam.getPage(), + productQueryParam.getLimit()); + + IPage pageList = yxStoreProductMapper.selectPage(pageModel,wrapper); + + List list = storeProductMap.toDto(pageList.getRecords()); + +// for (GoodsDTO goodsDTO : list) { +// goodsDTO.setIsCollect(isCollect(goodsDTO.getGoodsId(),userId)); +// } + + return list; + } + + /** + * 商品列表 + * @param page + * @param limit + * @param order + * @return + */ + @Override + public List getList(int page, int limit, int order) { + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_del",0).eq("is_show",1).orderByDesc("sort"); + + + //todo order = 1 精品推荐 order=2 新品 3-优惠产品 4-热卖 + switch (order){ + case 1: + wrapper.eq("is_best",1); + break; + case 2: + wrapper.eq("is_new",1); + break; + case 3: + wrapper.eq("is_benefit",1); + break; + case 4: + wrapper.eq("is_hot",1); + break; + } + Page pageModel = new Page<>(page, limit); + + IPage pageList = yxStoreProductMapper.selectPage(pageModel,wrapper); + + List list = storeProductMap.toDto(pageList.getRecords()); + + + return list; + } + + @Override + public YxStoreProductQueryVo getYxStoreProductById(Serializable id){ + return yxStoreProductMapper.getYxStoreProductById(id); + } + + @Override + public Paging getYxStoreProductPageList(YxStoreProductQueryParam yxStoreProductQueryParam) throws Exception{ + Page page = setPageParam(yxStoreProductQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxStoreProductMapper.getYxStoreProductPageList(page,yxStoreProductQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemConfigServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemConfigServiceImpl.java new file mode 100644 index 00000000..8170a93b --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemConfigServiceImpl.java @@ -0,0 +1,44 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxSystemConfig; +import co.yixiang.modules.shop.mapper.YxSystemConfigMapper; +import co.yixiang.modules.shop.service.YxSystemConfigService; +import co.yixiang.modules.shop.web.param.YxSystemConfigQueryParam; +import co.yixiang.modules.shop.web.vo.YxSystemConfigQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 配置表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxSystemConfigServiceImpl extends BaseServiceImpl implements YxSystemConfigService { + + @Autowired + private YxSystemConfigMapper yxSystemConfigMapper; + + @Override + public String getData(String name) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("menu_name",name); + return yxSystemConfigMapper.selectOne(wrapper).getValue(); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java new file mode 100644 index 00000000..0af8e663 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java @@ -0,0 +1,66 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.entity.YxSystemGroupData; +import co.yixiang.modules.shop.mapper.YxSystemGroupDataMapper; +import co.yixiang.modules.shop.service.YxSystemGroupDataService; +import co.yixiang.modules.shop.web.param.YxSystemGroupDataQueryParam; +import co.yixiang.modules.shop.web.vo.YxSystemGroupDataQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + + +/** + *

+ * 组合数据详情表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxSystemGroupDataServiceImpl extends BaseServiceImpl implements YxSystemGroupDataService { + + + /** + * 获取配置数据 + * @param name + * @return + */ + @Override + public List> getDatas(String name) { + QueryWrapper wrapper = new QueryWrapper<>(); + + List> list = new ArrayList<>(); + + wrapper.eq("group_name",name).eq("status",1); + List systemGroupDatas = baseMapper.selectList(wrapper); + + for (YxSystemGroupData yxSystemGroupData : systemGroupDatas) { + list.add(JSONObject.parseObject(yxSystemGroupData.getValue())); + } + + return list; + } + + + + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/ArticleController.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/ArticleController.java new file mode 100644 index 00000000..c98e3e77 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/ArticleController.java @@ -0,0 +1,67 @@ +package co.yixiang.modules.shop.web.controller; + +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.common.web.param.IdParam; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.exception.ErrorRequestException; +import co.yixiang.modules.shop.entity.YxArticle; +import co.yixiang.modules.shop.service.YxArticleService; +import co.yixiang.modules.shop.web.param.YxArticleQueryParam; +import co.yixiang.modules.shop.web.vo.YxArticleQueryVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + *

+ * 文章 前端控制器 + *

+ * + * @author hupeng + * @since 2019-10-02 + */ +@Slf4j +@RestController +@RequestMapping("/article") +@Api(value = "文章模块", tags = "文章模块", description = "文章模块") +public class ArticleController extends BaseController { + + @Autowired + private YxArticleService yxArticleService; + + + /** + * 获取文章文章详情 + */ + @GetMapping("/details/{id}") + @ApiOperation(value = "文章详情",notes = "文章详情",response = YxArticleQueryVo.class) + public ApiResult getYxArticle(@PathVariable Integer id) throws Exception{ + YxArticleQueryVo yxArticleQueryVo = yxArticleService.getYxArticleById(id); + yxArticleService.incVisitNum(id); + return ApiResult.ok(yxArticleQueryVo); + } + + /** + * 文章列表 + */ + @GetMapping("/list") + @ApiOperation(value = "文章列表",notes = "文章列表",response = YxArticleQueryVo.class) + public ApiResult> getYxArticlePageList( + @RequestParam(value = "page",defaultValue = "1") int page, + @RequestParam(value = "limit",defaultValue = "10") int limit + ){ + // throw new ErrorRequestException("error"); + YxArticleQueryParam yxArticleQueryParam = new YxArticleQueryParam(); + yxArticleQueryParam.setCurrent(page); + yxArticleQueryParam.setSize(limit); + Paging paging = yxArticleService.getYxArticlePageList(yxArticleQueryParam); + return ApiResult.ok(paging.getRecords()); + } + +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/CouponController.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/CouponController.java new file mode 100644 index 00000000..7e0c9a1f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/CouponController.java @@ -0,0 +1,50 @@ +package co.yixiang.modules.shop.web.controller; + +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.service.YxArticleService; +import co.yixiang.modules.shop.web.param.YxArticleQueryParam; +import co.yixiang.modules.shop.web.vo.YxArticleQueryVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 优惠券 todo + *

+ * + * @author hupeng + * @since 2019-10-02 + */ +@Slf4j +@RestController +@Api(value = "优惠券", tags = "优惠券", description = "优惠券") +public class CouponController extends BaseController { + + + + + + /** + * 优惠券列表 + */ + @GetMapping("/coupons") + @ApiOperation(value = "优惠券列表",notes = "优惠券列表",response = YxArticleQueryVo.class) + public ApiResult getList( + @RequestParam(value = "page",defaultValue = "1") int page, + @RequestParam(value = "limit",defaultValue = "10") int limit + ){ + // todo + List list = new ArrayList(); + return ApiResult.ok(list); + } + +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/IndexController.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/IndexController.java new file mode 100644 index 00000000..3fdbac47 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/IndexController.java @@ -0,0 +1,106 @@ +package co.yixiang.modules.shop.web.controller; + +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.service.YxArticleService; +import co.yixiang.modules.shop.service.YxStoreProductService; +import co.yixiang.modules.shop.service.YxSystemConfigService; +import co.yixiang.modules.shop.service.YxSystemGroupDataService; +import co.yixiang.modules.shop.web.param.YxArticleQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * @ClassName IndexController + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/19 + **/ + +@RestController +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@Api(value = "首页模块", tags = "首页模块", description = "首页模块") +public class IndexController { + + private final YxSystemGroupDataService systemGroupDataService; + private final YxSystemConfigService systemConfigService; + private final YxStoreProductService storeProductService; + private final YxArticleService articleService; + + @GetMapping("/index") + @ApiOperation(value = "首页数据",notes = "首页数据") + public ApiResult> index(){ + + Map map = new LinkedHashMap<>(); + //banner + map.put("banner",systemGroupDataService.getDatas("routine_home_banner")); + //首页按钮 + map.put("menus",systemGroupDataService.getDatas("routine_home_menus")); + //首页活动区域图片 + map.put("activity",systemGroupDataService.getDatas("routine_home_activity")); + //logo + map.put("logoUrl",systemConfigService.getData("wechat_logo")); + + //精品推荐 + map.put("bastList",storeProductService.getList(1,6,1)); + //首发新品 + map.put("firstList",storeProductService.getList(1,6,2)); + //促销单品 + map.put("benefit",storeProductService.getList(1,3,3)); + //热门榜单 + map.put("likeInfo",storeProductService.getList(1,3,4)); + + //滚动 + map.put("roll",systemGroupDataService.getDatas("routine_home_roll_news")); + + //todo 优惠券 + List list = new ArrayList(); + map.put("couponList",list); + + + return ApiResult.ok(map); + } + + @GetMapping("/search/keyword") + @ApiOperation(value = "热门搜索关键字获取",notes = "热门搜索关键字获取") + public ApiResult> search(){ + List> list = systemGroupDataService.getDatas("routine_hot_search"); + List stringList = new ArrayList<>(); + for (Map map : list) { + stringList.add(map.get("title").toString()); + } + //System.out.println(stringList); + return ApiResult.ok(stringList); + } + + @PostMapping("/image_base64") + @ApiOperation(value = "获取图片base64",notes = "获取图片base64") + public ApiResult> imageBase64(){ + + Map map = new LinkedHashMap<>(); + return ApiResult.ok(map); + } + + @GetMapping("/share") + @ApiOperation(value = "分享参数",notes = "分享参数") + public ApiResult share(){ + + Map map = new LinkedHashMap<>(); + map.put("img",""); + map.put("title",""); + map.put("synopsis",""); + return ApiResult.ok(map); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreCartController.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreCartController.java new file mode 100644 index 00000000..8b05fb43 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreCartController.java @@ -0,0 +1,94 @@ +package co.yixiang.modules.shop.web.controller; + +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.common.web.param.IdParam; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.entity.YxStoreCart; +import co.yixiang.modules.shop.service.YxStoreCartService; +import co.yixiang.modules.shop.web.param.YxStoreCartQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo; +import co.yixiang.utils.SecurityUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + *

+ * 购物车控制器 + *

+ * + * @author hupeng + * @since 2019-10-25 + */ +@Slf4j +@RestController +@Api(value = "购物车", tags = "购物车", description = "购物车") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class StoreCartController extends BaseController { + + private final YxStoreCartService storeCartService; + + /** + * 购物车 获取数量 + */ + @GetMapping("/cart/count") + @ApiOperation(value = "获取数量",notes = "获取数量") + public ApiResult> count(@RequestParam(value = "numType",defaultValue = "0") int numType){ + Map map = new LinkedHashMap<>(); + int uid = SecurityUtils.getUserId().intValue(); + map.put("count",storeCartService.getUserCartNum(uid,"product",numType)); + return ApiResult.ok(map); + } + + /** + * 购物车 添加 + */ + @PostMapping("/cart/add") + @ApiOperation(value = "添加购物车",notes = "添加购物车") + public ApiResult> add(@RequestBody String jsonStr){ + JSONObject jsonObject = JSON.parseObject(jsonStr); + Map map = new LinkedHashMap<>(); + int uid = SecurityUtils.getUserId().intValue(); + int cartNum = Integer.valueOf(jsonObject.get("cartNum").toString()); + if(cartNum <= 0){ + ApiResult.fail("购物车数量必须大于0"); + } + int isNew = Integer.valueOf(jsonObject.get("new").toString()); + int productId = Integer.valueOf(jsonObject.get("productId").toString()); + if(productId <= 0){ + ApiResult.fail("产品参数有误"); + } + String uniqueId = jsonObject.get("uniqueId").toString(); + + map.put("cartId",storeCartService.addCart(uid,productId,cartNum,uniqueId + ,"product",isNew,0,0,0)); + return ApiResult.ok(map); + } + + + /** + * 购物车列表 + */ + @GetMapping("/cart/list") + @ApiOperation(value = "购物车列表",notes = "购物车列表") + public ApiResult> getList(){ + int uid = SecurityUtils.getUserId().intValue(); + return ApiResult.ok(storeCartService.getUserProductCartList(uid,"",0)); + } + + + + + +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreCategoryController.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreCategoryController.java new file mode 100644 index 00000000..b449efb1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreCategoryController.java @@ -0,0 +1,47 @@ +package co.yixiang.modules.shop.web.controller; + +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.common.web.param.IdParam; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.entity.YxStoreCategory; +import co.yixiang.modules.shop.service.YxStoreCategoryService; +import co.yixiang.modules.shop.web.param.YxStoreCategoryQueryParam; +import co.yixiang.modules.shop.web.vo.YxStoreCategoryQueryVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + *

+ * 商品分类前端控制器 + *

+ * + * @author hupeng + * @since 2019-10-22 + */ +@Slf4j +@RestController +@Api("商品分类表 API") +public class StoreCategoryController extends BaseController { + + @Autowired + private YxStoreCategoryService yxStoreCategoryService; + + + /** + * 商品分类列表 + */ + @GetMapping("/category") + @ApiOperation(value = "商品分类列表",notes = "商品分类列表") + public ApiResult> getYxStoreCategoryPageList(){ + + return ApiResult.ok(yxStoreCategoryService.getList()); + } + +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreProductController.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreProductController.java new file mode 100644 index 00000000..3f1426de --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/controller/StoreProductController.java @@ -0,0 +1,159 @@ +package co.yixiang.modules.shop.web.controller; + +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.common.web.param.IdParam; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.shop.entity.YxStoreProduct; +import co.yixiang.modules.shop.service.YxStoreProductRelationService; +import co.yixiang.modules.shop.service.YxStoreProductReplyService; +import co.yixiang.modules.shop.service.YxStoreProductService; +import co.yixiang.modules.shop.web.dto.ProductDTO; +import co.yixiang.modules.shop.web.param.YxStoreProductQueryParam; +import co.yixiang.modules.shop.web.param.YxStoreProductRelationQueryParam; +import co.yixiang.modules.shop.web.vo.YxArticleQueryVo; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import co.yixiang.utils.SecurityUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + *

+ * 商品控制器 + *

+ * + * @author hupeng + * @since 2019-10-19 + */ +@Slf4j +@RestController +@Api("商品表 API") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class StoreProductController extends BaseController { + + private final YxStoreProductService storeProductService; + private final YxStoreProductRelationService productRelationService; + private final YxStoreProductReplyService replyService; + + + /** + * 获取首页更多产品 + */ + @GetMapping("/groom/list/{type}") + @ApiOperation(value = "获取首页更多产品",notes = "获取首页更多产品") + public ApiResult> moreGoodsList(@PathVariable Integer type){ + + Map map = new LinkedHashMap<>(); + if(type == 1){//TODO 精品推荐 + map.put("list",storeProductService.getList(1,20,1)); + }else if(type == 2){//TODO 热门榜单 + map.put("list",storeProductService.getList(1,20,4)); + }else if(type == 3){//TODO 首发新品 + map.put("list",storeProductService.getList(1,20,2)); + }else if(type == 4){//TODO 促销单品 + map.put("list",storeProductService.getList(1,20,3)); + } + + return ApiResult.ok(map); + } + + /** + * 获取首页更多产品 + */ + @GetMapping("/products") + @ApiOperation(value = "商品列表",notes = "商品列表") + public ApiResult> goodsList(YxStoreProductQueryParam productQueryParam){ + + return ApiResult.ok(storeProductService.getGoodsList(productQueryParam)); + } + + /** + * 为你推荐 + */ + @GetMapping("/product/hot") + @ApiOperation(value = "为你推荐",notes = "为你推荐") + public ApiResult> productRecommend( + @RequestParam(value = "page",defaultValue = "1") int page, + @RequestParam(value = "limit",defaultValue = "10") int limit){ + + return ApiResult.ok(storeProductService.getList(page,limit,1)); + } + + /** + * 普通商品详情 + */ + @GetMapping("/product/detail/{id}") + @ApiOperation(value = "普通商品详情",notes = "普通商品详情") + public ApiResult detail(@PathVariable Integer id){ + int uid = SecurityUtils.getUserId().intValue(); + return ApiResult.ok(storeProductService.goodsDetail(id,0,uid)); + } + + /** + * 添加收藏 + */ + @PostMapping("/collect/add") + @ApiOperation(value = "添加收藏",notes = "添加收藏") + public ApiResult collectAdd(@Validated @RequestBody YxStoreProductRelationQueryParam param){ + int uid = SecurityUtils.getUserId().intValue(); + productRelationService.addRroductRelation(param,uid,"collect"); + return ApiResult.ok("success"); + } + + /** + * 取消收藏 + */ + @PostMapping("/collect/del") + @ApiOperation(value = "取消收藏",notes = "取消收藏") + public ApiResult collectDel(@Validated @RequestBody YxStoreProductRelationQueryParam param){ + int uid = SecurityUtils.getUserId().intValue(); + productRelationService.delRroductRelation(param,uid,"collect"); + return ApiResult.ok("success"); + } + + /** + * 获取产品评论 + */ + @GetMapping("/reply/list/{id}") + @ApiOperation(value = "获取产品评论",notes = "获取产品评论") + public ApiResult replyList(@PathVariable Integer id, + @RequestParam(value = "type",defaultValue = "0") int type, + @RequestParam(value = "page",defaultValue = "1") int page, + @RequestParam(value = "limit",defaultValue = "10") int limit){ + return ApiResult.ok(replyService.getReplyList(id,page,limit)); + } + + /** + * 获取产品评论数据 + */ + @GetMapping("/reply/config/{id}") + @ApiOperation(value = "获取产品评论数据",notes = "获取产品评论数据") + public ApiResult replyCount(@PathVariable Integer id){ + return ApiResult.ok(replyService.getReplyCount(id)); + } + + + + + + + + + + + + + + +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/AttrValueDTO.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/AttrValueDTO.java new file mode 100644 index 00000000..ad121e4f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/AttrValueDTO.java @@ -0,0 +1,15 @@ +package co.yixiang.modules.shop.web.dto; + +import lombok.Data; + +/** + * @ClassName AttrValueDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/23 + **/ + +@Data +public class AttrValueDTO { + private String attr; + private Boolean check; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ProductDTO.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ProductDTO.java new file mode 100644 index 00000000..ba65ffa3 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ProductDTO.java @@ -0,0 +1,59 @@ +package co.yixiang.modules.shop.web.dto; + +import co.yixiang.common.web.param.QueryParam; +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import co.yixiang.modules.shop.web.vo.YxStoreProductAttrQueryVo; +import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo; +import co.yixiang.modules.shop.web.vo.YxStoreProductReplyQueryVo; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.*; + +/** + *

+ * 商品dto + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) + +public class ProductDTO extends QueryParam { + private static final long serialVersionUID = 1L; + + //todo + private List goodList = new ArrayList(); + + //todo + private String mapKay = ""; + + //todo + private Integer merId = 0; + + private String priceName = ""; + + private List productAttr = new ArrayList(); + + private Map productValue = new LinkedHashMap<>(); + + private YxStoreProductReplyQueryVo reply; + + private String replyChance; + + private Integer replyCount = 0; + + //todo + private List similarity = new ArrayList(); + + private YxStoreProductQueryVo storeInfo; + + //todo + private Map system_store = new LinkedHashMap<>(); + + private Integer uid = 0; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ReplyCountDTO.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ReplyCountDTO.java new file mode 100644 index 00000000..351ae6ae --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/dto/ReplyCountDTO.java @@ -0,0 +1,21 @@ +package co.yixiang.modules.shop.web.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName ReplyCount + * @Author hupeng <610796224@qq.com> + * @Date 2019/11/4 + **/ +@Data +public class ReplyCountDTO implements Serializable { + private Integer sumCount; + private Integer goodCount; + private Integer inCount; + private Integer poorCount; + private String replyChance; + private String replySstar; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxArticleQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxArticleQueryParam.java new file mode 100644 index 00000000..325b44f3 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxArticleQueryParam.java @@ -0,0 +1,21 @@ +package co.yixiang.modules.shop.web.param; + +import co.yixiang.common.web.param.QueryParam; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 文章管理表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxArticleQueryParam对象", description="文章管理表查询参数") +public class YxArticleQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCartQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCartQueryParam.java new file mode 100644 index 00000000..a7ca3740 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCartQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 购物车表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-25 + */ +@Data +@ApiModel(value="YxStoreCartQueryParam对象", description="购物车表查询参数") +public class YxStoreCartQueryParam { + private static final long serialVersionUID = 1L; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCategoryQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCategoryQueryParam.java new file mode 100644 index 00000000..4d810d5e --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCategoryQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 商品分类表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-22 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCategoryQueryParam对象", description="商品分类表查询参数") +public class YxStoreCategoryQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponIssueQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponIssueQueryParam.java new file mode 100644 index 00000000..66f28898 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponIssueQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 优惠券前台领取表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCouponIssueQueryParam对象", description="优惠券前台领取表查询参数") +public class YxStoreCouponIssueQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponIssueUserQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponIssueUserQueryParam.java new file mode 100644 index 00000000..28b34ad0 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponIssueUserQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 优惠券前台用户领取记录表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCouponIssueUserQueryParam对象", description="优惠券前台用户领取记录表查询参数") +public class YxStoreCouponIssueUserQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponQueryParam.java new file mode 100644 index 00000000..d1db2ad3 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 优惠券表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCouponQueryParam对象", description="优惠券表查询参数") +public class YxStoreCouponQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponUserQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponUserQueryParam.java new file mode 100644 index 00000000..380fd644 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreCouponUserQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 优惠券发放记录表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreCouponUserQueryParam对象", description="优惠券发放记录表查询参数") +public class YxStoreCouponUserQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrQueryParam.java new file mode 100644 index 00000000..104ed406 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 商品属性表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProductAttrQueryParam对象", description="商品属性表查询参数") +public class YxStoreProductAttrQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrResultQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrResultQueryParam.java new file mode 100644 index 00000000..1d2083e4 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrResultQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 商品属性详情表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProductAttrResultQueryParam对象", description="商品属性详情表查询参数") +public class YxStoreProductAttrResultQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrValueQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrValueQueryParam.java new file mode 100644 index 00000000..dd46928d --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductAttrValueQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 商品属性值表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProductAttrValueQueryParam对象", description="商品属性值表查询参数") +public class YxStoreProductAttrValueQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductQueryParam.java new file mode 100644 index 00000000..2be521d2 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductQueryParam.java @@ -0,0 +1,31 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 商品表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProductQueryParam对象", description="商品表查询参数") +public class YxStoreProductQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; + + private int page; + private int limit; + private int sid; + private int cid; + private int news; + private String priceOrder; + private String salesOrder; + private String keyword; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductRelationQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductRelationQueryParam.java new file mode 100644 index 00000000..8385712e --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductRelationQueryParam.java @@ -0,0 +1,29 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +import javax.validation.constraints.NotBlank; + +/** + *

+ * 商品点赞和收藏表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProductRelationQueryParam对象", description="商品点赞和收藏表查询参数") +public class YxStoreProductRelationQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; + + @NotBlank + private String category; + + private Integer id; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductReplyQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductReplyQueryParam.java new file mode 100644 index 00000000..abe0b862 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxStoreProductReplyQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 评论表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxStoreProductReplyQueryParam对象", description="评论表查询参数") +public class YxStoreProductReplyQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemConfigQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemConfigQueryParam.java new file mode 100644 index 00000000..2209ef13 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemConfigQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 配置表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxSystemConfigQueryParam对象", description="配置表查询参数") +public class YxSystemConfigQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemGroupDataQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemGroupDataQueryParam.java new file mode 100644 index 00000000..863f3494 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/param/YxSystemGroupDataQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.shop.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 组合数据详情表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxSystemGroupDataQueryParam对象", description="组合数据详情表查询参数") +public class YxSystemGroupDataQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxArticleQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxArticleQueryVo.java new file mode 100644 index 00000000..956beb9d --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxArticleQueryVo.java @@ -0,0 +1,80 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 文章管理表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-02 + */ +@Data +@ApiModel(value="YxArticleQueryVo对象", description="文章管理表查询参数") +public class YxArticleQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "文章管理ID") +private Integer id; + +@ApiModelProperty(value = "分类id") +private String cid; + +@ApiModelProperty(value = "文章标题") +private String title; + +@ApiModelProperty(value = "文章作者") +private String author; + +@ApiModelProperty(value = "文章图片") +private String imageInput; + +@ApiModelProperty(value = "文章简介") +private String synopsis; + +@ApiModelProperty(value = "文章分享标题") +private String shareTitle; + +@ApiModelProperty(value = "文章分享简介") +private String shareSynopsis; + +@ApiModelProperty(value = "浏览次数") +private String visit; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "原文链接") +private String url; + +@ApiModelProperty(value = "状态") +private Boolean status; + +@ApiModelProperty(value = "添加时间") +private String addTime; + +@ApiModelProperty(value = "是否隐藏") +private Boolean hide; + +@ApiModelProperty(value = "管理员id") +private Integer adminId; + +@ApiModelProperty(value = "商户id") +private Integer merId; + +@ApiModelProperty(value = "产品关联id") +private Integer productId; + +@ApiModelProperty(value = "是否热门(小程序)") +private Boolean isHot; + +@ApiModelProperty(value = "是否轮播图(小程序)") +private Boolean isBanner; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCartQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCartQueryVo.java new file mode 100644 index 00000000..e230bcb6 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCartQueryVo.java @@ -0,0 +1,69 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.omg.CORBA.PRIVATE_MEMBER; + +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 购物车表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-25 + */ +@Data +@ApiModel(value = "YxStoreCartQueryVo对象", description = "购物车表查询参数") +public class YxStoreCartQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "购物车表ID") + private Long id; + + @ApiModelProperty(value = "用户ID") + private Integer uid; + + @ApiModelProperty(value = "类型") + private String type; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "商品属性") + private String productAttrUnique; + + @ApiModelProperty(value = "商品数量") + private Integer cartNum; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + + @ApiModelProperty(value = "拼团id") + private Integer combinationId; + + @ApiModelProperty(value = "秒杀产品ID") + private Integer seckillId; + + @ApiModelProperty(value = "砍价id") + private Integer bargainId; + + private YxStoreProductQueryVo productInfo; + + private Double costPrice; + + private Double truePrice; + + private Integer trueStock; + + private Double vipTruePrice; + + private String unique; + + private Integer isReply; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCategoryQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCategoryQueryVo.java new file mode 100644 index 00000000..fe89d58d --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCategoryQueryVo.java @@ -0,0 +1,42 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 商品分类表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-22 + */ +@Data +@ApiModel(value="YxStoreCategoryQueryVo对象", description="商品分类表查询参数") +public class YxStoreCategoryQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "商品分类表ID") +private Integer id; + +@ApiModelProperty(value = "父id") +private Integer pid; + +@ApiModelProperty(value = "分类名称") +private String cateName; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "图标") +private String pic; + + + + + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponIssueQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponIssueQueryVo.java new file mode 100644 index 00000000..fd55afc8 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponIssueQueryVo.java @@ -0,0 +1,51 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 优惠券前台领取表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value="YxStoreCouponIssueQueryVo对象", description="优惠券前台领取表查询参数") +public class YxStoreCouponIssueQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +private Integer id; + +@ApiModelProperty(value = "优惠券ID") +private Integer cid; + +@ApiModelProperty(value = "优惠券领取开启时间") +private Integer startTime; + +@ApiModelProperty(value = "优惠券领取结束时间") +private Integer endTime; + +@ApiModelProperty(value = "优惠券领取数量") +private Integer totalCount; + +@ApiModelProperty(value = "优惠券剩余领取数量") +private Integer remainCount; + +@ApiModelProperty(value = "是否无限张数") +private Boolean isPermanent; + +@ApiModelProperty(value = "1 正常 0 未开启 -1 已无效") +private Boolean status; + +private Boolean isDel; + +@ApiModelProperty(value = "优惠券添加时间") +private Integer addTime; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponIssueUserQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponIssueUserQueryVo.java new file mode 100644 index 00000000..189dcaba --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponIssueUserQueryVo.java @@ -0,0 +1,34 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 优惠券前台用户领取记录表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value="YxStoreCouponIssueUserQueryVo对象", description="优惠券前台用户领取记录表查询参数") +public class YxStoreCouponIssueUserQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +private Integer id; + +@ApiModelProperty(value = "领取优惠券用户ID") +private Integer uid; + +@ApiModelProperty(value = "优惠券前台领取ID") +private Integer issueCouponId; + +@ApiModelProperty(value = "领取时间") +private Integer addTime; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponQueryVo.java new file mode 100644 index 00000000..b04a7dff --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponQueryVo.java @@ -0,0 +1,54 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 优惠券表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value="YxStoreCouponQueryVo对象", description="优惠券表查询参数") +public class YxStoreCouponQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "优惠券表ID") +private Integer id; + +@ApiModelProperty(value = "优惠券名称") +private String title; + +@ApiModelProperty(value = "兑换消耗积分值") +private Integer integral; + +@ApiModelProperty(value = "兑换的优惠券面值") +private BigDecimal couponPrice; + +@ApiModelProperty(value = "最低消费多少金额可用优惠券") +private BigDecimal useMinPrice; + +@ApiModelProperty(value = "优惠券有效期限(单位:天)") +private Integer couponTime; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "状态(0:关闭,1:开启)") +private Boolean status; + +@ApiModelProperty(value = "兑换项目添加时间") +private Integer addTime; + +@ApiModelProperty(value = "是否删除") +private Boolean isDel; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponUserQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponUserQueryVo.java new file mode 100644 index 00000000..96a4f084 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreCouponUserQueryVo.java @@ -0,0 +1,60 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 优惠券发放记录表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value="YxStoreCouponUserQueryVo对象", description="优惠券发放记录表查询参数") +public class YxStoreCouponUserQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "优惠券发放记录id") +private Integer id; + +@ApiModelProperty(value = "兑换的项目id") +private Integer cid; + +@ApiModelProperty(value = "优惠券所属用户") +private Integer uid; + +@ApiModelProperty(value = "优惠券名称") +private String couponTitle; + +@ApiModelProperty(value = "优惠券的面值") +private BigDecimal couponPrice; + +@ApiModelProperty(value = "最低消费多少金额可用优惠券") +private BigDecimal useMinPrice; + +@ApiModelProperty(value = "优惠券创建时间") +private Integer addTime; + +@ApiModelProperty(value = "优惠券结束时间") +private Integer endTime; + +@ApiModelProperty(value = "使用时间") +private Integer useTime; + +@ApiModelProperty(value = "获取方式") +private String type; + +@ApiModelProperty(value = "状态(0:未使用,1:已使用, 2:已过期)") +private Boolean status; + +@ApiModelProperty(value = "是否有效") +private Boolean isFail; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrQueryVo.java new file mode 100644 index 00000000..4116236c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrQueryVo.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.shop.web.vo; + +import co.yixiang.modules.shop.web.dto.AttrValueDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.util.List; + +/** + *

+ * 商品属性表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@ApiModel(value = "YxStoreProductAttrQueryVo对象", description = "商品属性表查询参数") +public class YxStoreProductAttrQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + private Integer id; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "属性名") + private String attrName; + + @ApiModelProperty(value = "属性值") + private String attrValues; + + private List attrValue; + + private List attrValueArr; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrResultQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrResultQueryVo.java new file mode 100644 index 00000000..792243e4 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrResultQueryVo.java @@ -0,0 +1,34 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 商品属性详情表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@ApiModel(value="YxStoreProductAttrResultQueryVo对象", description="商品属性详情表查询参数") +public class YxStoreProductAttrResultQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +private Integer id; + +@ApiModelProperty(value = "商品ID") +private Integer productId; + +@ApiModelProperty(value = "商品属性参数") +private String result; + +@ApiModelProperty(value = "上次修改时间") +private Integer changeTime; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrValueQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrValueQueryVo.java new file mode 100644 index 00000000..8054e48c --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductAttrValueQueryVo.java @@ -0,0 +1,51 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 商品属性值表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@ApiModel(value = "YxStoreProductAttrValueQueryVo对象", description = "商品属性值表查询参数") +public class YxStoreProductAttrValueQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + private Integer id; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "商品属性索引值 (attr_value|attr_value[|....])") + private String suk; + + @ApiModelProperty(value = "属性对应的库存") + private Integer stock; + + @ApiModelProperty(value = "销量") + private Integer sales; + + @ApiModelProperty(value = "属性金额") + private BigDecimal price; + + @ApiModelProperty(value = "图片") + private String image; + + @ApiModelProperty(value = "唯一值") + private String unique; + + @ApiModelProperty(value = "成本价") + private BigDecimal cost; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductQueryVo.java new file mode 100644 index 00000000..0d944d3b --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductQueryVo.java @@ -0,0 +1,156 @@ +package co.yixiang.modules.shop.web.vo; + +import cn.hutool.core.util.StrUtil; +import co.yixiang.modules.shop.entity.YxStoreProductAttrValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + *

+ * 商品表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-19 + */ +@Data +@ApiModel(value = "YxStoreProductQueryVo对象", description = "商品表查询参数") +public class YxStoreProductQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "商品id") + private Integer id; + + @ApiModelProperty(value = "商户Id(0为总后台管理员创建,不为0的时候是商户后台创建)") + private Integer merId; + + @ApiModelProperty(value = "商品图片") + private String image; + + private String image_base; + + public String getImage_base() { + return image; + } + + private Boolean userCollect = false; + + private Boolean userLike = false; + + @ApiModelProperty(value = "轮播图") + private String sliderImage; + + private List sliderImageArr; + + public List getSliderImageArr() { + //Arrays.asList(sliderImage.split(",")); + return Arrays.asList(sliderImage.split(",")); + } + + private YxStoreProductAttrValue attrInfo; + + @ApiModelProperty(value = "商品名称") + private String storeName; + + @ApiModelProperty(value = "商品简介") + private String storeInfo; + + @ApiModelProperty(value = "关键字") + private String keyword; + + @ApiModelProperty(value = "产品条码(一维码)") + private String barCode; + + @ApiModelProperty(value = "分类id") + private String cateId; + + @ApiModelProperty(value = "商品价格") + private BigDecimal price; + + @ApiModelProperty(value = "会员价格") + private BigDecimal vipPrice; + + @ApiModelProperty(value = "市场价") + private BigDecimal otPrice; + + @ApiModelProperty(value = "邮费") + private BigDecimal postage; + + @ApiModelProperty(value = "单位名") + private String unitName; + + @ApiModelProperty(value = "排序") + private Integer sort; + + @ApiModelProperty(value = "销量") + private Integer sales; + + @ApiModelProperty(value = "库存") + private Integer stock; + + @ApiModelProperty(value = "状态(0:未上架,1:上架)") + private Integer isShow; + + @ApiModelProperty(value = "是否热卖") + private Integer isHot; + + @ApiModelProperty(value = "是否优惠") + private Integer isBenefit; + + @ApiModelProperty(value = "是否精品") + private Integer isBest; + + @ApiModelProperty(value = "是否新品") + private Integer isNew; + + @ApiModelProperty(value = "产品描述") + private String description; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + + @ApiModelProperty(value = "是否包邮") + private Integer isPostage; + + @ApiModelProperty(value = "是否删除") + private Integer isDel; + + @ApiModelProperty(value = "商户是否代理 0不可代理1可代理") + private Integer merUse; + + @ApiModelProperty(value = "获得积分") + private BigDecimal giveIntegral; + + @ApiModelProperty(value = "成本价") + private BigDecimal cost; + + @ApiModelProperty(value = "秒杀状态 0 未开启 1已开启") + private Integer isSeckill; + + @ApiModelProperty(value = "砍价状态 0未开启 1开启") + private Integer isBargain; + + @ApiModelProperty(value = "是否优品推荐") + private Integer isGood; + + @ApiModelProperty(value = "虚拟销量") + private Integer ficti; + + @ApiModelProperty(value = "浏览量") + private Integer browse; + + @ApiModelProperty(value = "产品二维码地址(用户小程序海报)") + private String codePath; + + @ApiModelProperty(value = "淘宝京东1688类型") + private String soureLink; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductRelationQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductRelationQueryVo.java new file mode 100644 index 00000000..20a132e5 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductRelationQueryVo.java @@ -0,0 +1,57 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 商品点赞和收藏表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@ApiModel(value = "YxStoreProductRelationQueryVo对象", description = "商品点赞和收藏表查询参数") +public class YxStoreProductRelationQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + private Integer id; + + @ApiModelProperty(value = "用户ID") + private Integer uid; + + @ApiModelProperty(value = "商品ID") + private Integer productId; + + @ApiModelProperty(value = "类型(收藏(collect)、点赞(like))") + private String type; + + @ApiModelProperty(value = "某种类型的商品(普通商品、秒杀商品)") + private String category; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + + private String image; + + private Integer isDel; + + private Integer isShow; + + private Double otPrice; + + private Integer pid; + + private Double price; + + private Integer sales; + + private String storeName; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductReplyQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductReplyQueryVo.java new file mode 100644 index 00000000..f57db538 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxStoreProductReplyQueryVo.java @@ -0,0 +1,70 @@ +package co.yixiang.modules.shop.web.vo; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 评论表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-23 + */ +@Data +@ApiModel(value = "YxStoreProductReplyQueryVo对象", description = "评论表查询参数") +public class YxStoreProductReplyQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "评论ID") + private Integer id; + + + @ApiModelProperty(value = "产品id") + private Integer productId; + + @ApiModelProperty(value = "某种商品类型(普通商品、秒杀商品)") + private String replyType; + + @ApiModelProperty(value = "商品分数") + private Integer productScore; + + @ApiModelProperty(value = "服务分数") + private Integer serviceScore; + + @ApiModelProperty(value = "评论内容") + private String comment; + + @ApiModelProperty(value = "评论图片") + private String pics; + + @ApiModelProperty(value = "评论时间") + private Integer addTime; + + @ApiModelProperty(value = "管理员回复内容") + private String merchantReplyContent; + + @ApiModelProperty(value = "管理员回复时间") + private Integer merchantReplyTime; + + + private String star; + + private String nickname; + + private String avatar; + + private String suk; + + @JsonIgnore + private String cartInfo; + + + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemConfigQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemConfigQueryVo.java new file mode 100644 index 00000000..2bd680a4 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemConfigQueryVo.java @@ -0,0 +1,38 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 配置表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-19 + */ +@Data +@ApiModel(value="YxSystemConfigQueryVo对象", description="配置表查询参数") +public class YxSystemConfigQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "配置id") +private Integer id; + +@ApiModelProperty(value = "字段名称") +private String menuName; + +@ApiModelProperty(value = "默认值") +private String value; + +@ApiModelProperty(value = "排序") +private Integer sort; + +@ApiModelProperty(value = "是否隐藏") +private Boolean status; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemGroupDataQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemGroupDataQueryVo.java new file mode 100644 index 00000000..7b4805a9 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/web/vo/YxSystemGroupDataQueryVo.java @@ -0,0 +1,44 @@ +package co.yixiang.modules.shop.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.util.Date; +import java.util.Map; + +/** + *

+ * 组合数据详情表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-19 + */ +@Data +@ApiModel(value="YxSystemGroupDataQueryVo对象", description="组合数据详情表查询参数") +public class YxSystemGroupDataQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "组合数据详情ID") +private Integer id; + +@ApiModelProperty(value = "对应的数据名称") +private String groupName; + +@ApiModelProperty(value = "数据组对应的数据值(json数据)") +private String value; + +private Map map; + +@ApiModelProperty(value = "添加数据时间") +private Integer addTime; + +@ApiModelProperty(value = "数据排序") +private Integer sort; + +@ApiModelProperty(value = "状态(1:开启;2:关闭;)") +private Boolean status; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUser.java b/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUser.java new file mode 100644 index 00000000..5de1c688 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUser.java @@ -0,0 +1,132 @@ +package co.yixiang.modules.user.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 用户表 + *

+ * + * @author hupeng + * @since 2019-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxUser对象", description="用户表") +public class YxUser extends BaseEntity { + + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "用户id") +@TableId(value = "uid", type = IdType.AUTO) +private Integer uid; + +@ApiModelProperty(value = "用户账户(跟accout一样)") +private String username; + +@ApiModelProperty(value = "用户账号") +private String account; + +@ApiModelProperty(value = "用户密码(跟pwd)") +private String password; + +@ApiModelProperty(value = "用户密码") +private String pwd; + +@ApiModelProperty(value = "真实姓名") +private String realName; + +@ApiModelProperty(value = "生日") +private Integer birthday; + +@ApiModelProperty(value = "身份证号码") +private String cardId; + +@ApiModelProperty(value = "用户备注") +private String mark; + +@ApiModelProperty(value = "合伙人id") +private Integer partnerId; + +@ApiModelProperty(value = "用户分组id") +private Integer groupId; + +@ApiModelProperty(value = "用户昵称") +private String nickname; + +@ApiModelProperty(value = "用户头像") +private String avatar; + +@ApiModelProperty(value = "手机号码") +private String phone; + +@ApiModelProperty(value = "添加时间") +private Integer addTime; + +@ApiModelProperty(value = "添加ip") +private String addIp; + +@ApiModelProperty(value = "最后一次登录时间") +private Integer lastTime; + +@ApiModelProperty(value = "最后一次登录ip") +private String lastIp; + +@ApiModelProperty(value = "用户余额") +private BigDecimal nowMoney; + +@ApiModelProperty(value = "佣金金额") +private BigDecimal brokeragePrice; + +@ApiModelProperty(value = "用户剩余积分") +private BigDecimal integral; + +@ApiModelProperty(value = "连续签到天数") +private Integer signNum; + +@ApiModelProperty(value = "1为正常,0为禁止") +private Boolean status; + +@ApiModelProperty(value = "等级") +private Integer level; + +@ApiModelProperty(value = "推广元id") +private Integer spreadUid; + +@ApiModelProperty(value = "推广员关联时间") +private Integer spreadTime; + +@ApiModelProperty(value = "用户类型") +private String userType; + +@ApiModelProperty(value = "是否为推广员") +private Boolean isPromoter; + +@ApiModelProperty(value = "用户购买次数") +private Integer payCount; + +@ApiModelProperty(value = "下级人数") +private Integer spreadCount; + +@ApiModelProperty(value = "清理会员时间") +private Integer cleanTime; + +@ApiModelProperty(value = "详细地址") +private String addres; + +@ApiModelProperty(value = "管理员编号 ") +private Integer adminid; + +@ApiModelProperty(value = "用户登陆类型,h5,wechat,routine") +private String loginType; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUserAddress.java b/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUserAddress.java new file mode 100644 index 00000000..f3a4f0b7 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUserAddress.java @@ -0,0 +1,71 @@ +package co.yixiang.modules.user.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 用户地址表 + *

+ * + * @author hupeng + * @since 2019-10-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxUserAddress对象", description = "用户地址表") +public class YxUserAddress extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "用户地址id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "用户id") + private Integer uid; + + @ApiModelProperty(value = "收货人姓名") + private String realName; + + @ApiModelProperty(value = "收货人电话") + private String phone; + + @ApiModelProperty(value = "收货人所在省") + private String province; + + @ApiModelProperty(value = "收货人所在市") + private String city; + + @ApiModelProperty(value = "收货人所在区") + private String district; + + @ApiModelProperty(value = "收货人详细地址") + private String detail; + + @ApiModelProperty(value = "邮编") + private String postCode; + + @ApiModelProperty(value = "经度") + private String longitude; + + @ApiModelProperty(value = "纬度") + private String latitude; + + @ApiModelProperty(value = "是否默认") + private Integer isDefault; + + @ApiModelProperty(value = "是否删除") + private Integer isDel; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUserBill.java b/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUserBill.java new file mode 100644 index 00000000..f101f02a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxUserBill.java @@ -0,0 +1,67 @@ +package co.yixiang.modules.user.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 用户账单表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxUserBill对象", description = "用户账单表") +public class YxUserBill extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "用户账单id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "用户uid") + private Integer uid; + + @ApiModelProperty(value = "关联id") + private String linkId; + + @ApiModelProperty(value = "0 = 支出 1 = 获得") + private Integer pm; + + @ApiModelProperty(value = "账单标题") + private String title; + + @ApiModelProperty(value = "明细种类") + private String category; + + @ApiModelProperty(value = "明细类型") + private String type; + + @ApiModelProperty(value = "明细数字") + private BigDecimal number; + + @ApiModelProperty(value = "剩余") + private BigDecimal balance; + + @ApiModelProperty(value = "备注") + private String mark; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + + @ApiModelProperty(value = "0 = 带确定 1 = 有效 -1 = 无效") + private Integer status; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxWechatUser.java b/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxWechatUser.java new file mode 100644 index 00000000..aafd60ee --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/entity/YxWechatUser.java @@ -0,0 +1,103 @@ +package co.yixiang.modules.user.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.IdType; +import co.yixiang.common.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 微信用户表 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "YxWechatUser对象", description = "微信用户表") +public class YxWechatUser extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "微信用户id") + @TableId(value = "uid", type = IdType.AUTO) + private Integer uid; + + @ApiModelProperty(value = "只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段") + private String unionid; + + @ApiModelProperty(value = "用户的标识,对当前公众号唯一") + private String openid; + + @ApiModelProperty(value = "小程序唯一身份ID") + private String routineOpenid; + + @ApiModelProperty(value = "用户的昵称") + private String nickname; + + @ApiModelProperty(value = "用户头像") + private String headimgurl; + + @ApiModelProperty(value = "用户的性别,值为1时是男性,值为2时是女性,值为0时是未知") + private Integer sex; + + @ApiModelProperty(value = "用户所在城市") + private String city; + + @ApiModelProperty(value = "用户的语言,简体中文为zh_CN") + private String language; + + @ApiModelProperty(value = "用户所在省份") + private String province; + + @ApiModelProperty(value = "用户所在国家") + private String country; + + @ApiModelProperty(value = "公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注") + private String remark; + + @ApiModelProperty(value = "用户所在的分组ID(兼容旧的用户分组接口)") + private Integer groupid; + + @ApiModelProperty(value = "用户被打上的标签ID列表") + private String tagidList; + + @ApiModelProperty(value = "用户是否订阅该公众号标识") + private Integer subscribe; + + @ApiModelProperty(value = "关注公众号时间") + private Integer subscribeTime; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + + @ApiModelProperty(value = "一级推荐人") + private Integer stair; + + @ApiModelProperty(value = "二级推荐人") + private Integer second; + + @ApiModelProperty(value = "一级推荐人订单") + private Integer orderStair; + + @ApiModelProperty(value = "二级推荐人订单") + private Integer orderSecond; + + @ApiModelProperty(value = "佣金") + private BigDecimal nowMoney; + + @ApiModelProperty(value = "小程序用户会话密匙") + private String sessionKey; + + @ApiModelProperty(value = "用户类型") + private String userType; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserAddressMapper.java b/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserAddressMapper.java new file mode 100644 index 00000000..296f013e --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserAddressMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.user.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.user.entity.YxUserAddress; +import co.yixiang.modules.user.web.param.YxUserAddressQueryParam; +import co.yixiang.modules.user.web.vo.YxUserAddressQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 用户地址表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-28 + */ +@Repository +public interface YxUserAddressMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxUserAddressQueryVo getYxUserAddressById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxUserAddressQueryParam + * @return + */ + IPage getYxUserAddressPageList(@Param("page") Page page, @Param("param") YxUserAddressQueryParam yxUserAddressQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserBillMapper.java b/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserBillMapper.java new file mode 100644 index 00000000..4d04806a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserBillMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.user.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.user.entity.YxUserBill; +import co.yixiang.modules.user.web.param.YxUserBillQueryParam; +import co.yixiang.modules.user.web.vo.YxUserBillQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 用户账单表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxUserBillMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxUserBillQueryVo getYxUserBillById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxUserBillQueryParam + * @return + */ + IPage getYxUserBillPageList(@Param("page") Page page, @Param("param") YxUserBillQueryParam yxUserBillQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserMapper.java b/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserMapper.java new file mode 100644 index 00000000..301c2be7 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxUserMapper.java @@ -0,0 +1,50 @@ +package co.yixiang.modules.user.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.user.entity.YxUser; +import co.yixiang.modules.user.web.param.YxUserQueryParam; +import co.yixiang.modules.user.web.vo.YxUserQueryVo; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Update; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 用户表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-16 + */ +@Repository +public interface YxUserMapper extends BaseMapper { + + @Update("update yx_user set now_money=now_money-#{payPrice}" + + " where uid=#{uid}") + int decPrice(@Param("payPrice") double payPrice,@Param("uid") int uid); + + @Update("update yx_user set pay_count=pay_count+1" + + " where uid=#{uid}") + int incPayCount(@Param("uid") int uid); + + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxUserQueryVo getYxUserById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxUserQueryParam + * @return + */ + IPage getYxUserPageList(@Param("page") Page page, @Param("param") YxUserQueryParam yxUserQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxWechatUserMapper.java b/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxWechatUserMapper.java new file mode 100644 index 00000000..b6559af5 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/mapper/YxWechatUserMapper.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.user.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import co.yixiang.modules.user.entity.YxWechatUser; +import co.yixiang.modules.user.web.param.YxWechatUserQueryParam; +import co.yixiang.modules.user.web.vo.YxWechatUserQueryVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * 微信用户表 Mapper 接口 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Repository +public interface YxWechatUserMapper extends BaseMapper { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxWechatUserQueryVo getYxWechatUserById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param yxWechatUserQueryParam + * @return + */ + IPage getYxWechatUserPageList(@Param("page") Page page, @Param("param") YxWechatUserQueryParam yxWechatUserQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserAddressService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserAddressService.java new file mode 100644 index 00000000..f66d2c56 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserAddressService.java @@ -0,0 +1,37 @@ +package co.yixiang.modules.user.service; + +import co.yixiang.modules.user.entity.YxUserAddress; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.user.web.param.YxUserAddressQueryParam; +import co.yixiang.modules.user.web.vo.YxUserAddressQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 用户地址表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-28 + */ +public interface YxUserAddressService extends BaseService { + + YxUserAddress getUserDefaultAddress(int uid); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxUserAddressQueryVo getYxUserAddressById(Serializable id); + + /** + * 获取分页对象 + * @param yxUserAddressQueryParam + * @return + */ + Paging getYxUserAddressPageList(YxUserAddressQueryParam yxUserAddressQueryParam); + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserBillService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserBillService.java new file mode 100644 index 00000000..70f1ffde --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserBillService.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.user.service; + +import co.yixiang.modules.user.entity.YxUserBill; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.user.web.param.YxUserBillQueryParam; +import co.yixiang.modules.user.web.vo.YxUserBillQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 用户账单表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxUserBillService extends BaseService { + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxUserBillQueryVo getYxUserBillById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param yxUserBillQueryParam + * @return + */ + Paging getYxUserBillPageList(YxUserBillQueryParam yxUserBillQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserService.java new file mode 100644 index 00000000..29a5a57f --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserService.java @@ -0,0 +1,41 @@ +package co.yixiang.modules.user.service; + +import co.yixiang.modules.user.entity.YxUser; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.user.web.param.YxUserQueryParam; +import co.yixiang.modules.user.web.vo.YxUserQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 用户表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-16 + */ +public interface YxUserService extends BaseService { + + void incPayCount(int uid); + + void decPrice(int uid,double payPrice); + + YxUser findByName(String name); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxUserQueryVo getYxUserById(Serializable id); + + /** + * 获取分页对象 + * @param yxUserQueryParam + * @return + */ + Paging getYxUserPageList(YxUserQueryParam yxUserQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxWechatUserService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxWechatUserService.java new file mode 100644 index 00000000..db3e5b72 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxWechatUserService.java @@ -0,0 +1,37 @@ +package co.yixiang.modules.user.service; + +import co.yixiang.modules.user.entity.YxWechatUser; +import co.yixiang.common.service.BaseService; +import co.yixiang.modules.user.web.param.YxWechatUserQueryParam; +import co.yixiang.modules.user.web.vo.YxWechatUserQueryVo; +import co.yixiang.common.web.vo.Paging; + +import java.io.Serializable; + +/** + *

+ * 微信用户表 服务类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +public interface YxWechatUserService extends BaseService { + + YxWechatUser getUserInfo(String openid); + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + YxWechatUserQueryVo getYxWechatUserById(Serializable id); + + /** + * 获取分页对象 + * @param yxWechatUserQueryParam + * @return + */ + Paging getYxWechatUserPageList(YxWechatUserQueryParam yxWechatUserQueryParam) throws Exception; + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserAddressServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserAddressServiceImpl.java new file mode 100644 index 00000000..6a65baea --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserAddressServiceImpl.java @@ -0,0 +1,57 @@ +package co.yixiang.modules.user.service.impl; + +import co.yixiang.modules.user.entity.YxUserAddress; +import co.yixiang.modules.user.mapper.YxUserAddressMapper; +import co.yixiang.modules.user.service.YxUserAddressService; +import co.yixiang.modules.user.web.param.YxUserAddressQueryParam; +import co.yixiang.modules.user.web.vo.YxUserAddressQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 用户地址表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-28 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxUserAddressServiceImpl extends BaseServiceImpl implements YxUserAddressService { + + @Autowired + private YxUserAddressMapper yxUserAddressMapper; + + @Override + public YxUserAddressQueryVo getYxUserAddressById(Serializable id){ + return yxUserAddressMapper.getYxUserAddressById(id); + } + + @Override + public YxUserAddress getUserDefaultAddress(int uid) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_default",1).eq("uid",uid); + return getOne(wrapper); + } + + @Override + public Paging getYxUserAddressPageList(YxUserAddressQueryParam yxUserAddressQueryParam){ + Page page = setPageParam(yxUserAddressQueryParam,OrderItem.desc("add_time")); + IPage iPage = yxUserAddressMapper.getYxUserAddressPageList(page,yxUserAddressQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserBillServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserBillServiceImpl.java new file mode 100644 index 00000000..a77bc291 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserBillServiceImpl.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.user.service.impl; + +import co.yixiang.modules.user.entity.YxUserBill; +import co.yixiang.modules.user.mapper.YxUserBillMapper; +import co.yixiang.modules.user.service.YxUserBillService; +import co.yixiang.modules.user.web.param.YxUserBillQueryParam; +import co.yixiang.modules.user.web.vo.YxUserBillQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 用户账单表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxUserBillServiceImpl extends BaseServiceImpl implements YxUserBillService { + + @Autowired + private YxUserBillMapper yxUserBillMapper; + + @Override + public YxUserBillQueryVo getYxUserBillById(Serializable id) throws Exception{ + return yxUserBillMapper.getYxUserBillById(id); + } + + @Override + public Paging getYxUserBillPageList(YxUserBillQueryParam yxUserBillQueryParam) throws Exception{ + Page page = setPageParam(yxUserBillQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxUserBillMapper.getYxUserBillPageList(page,yxUserBillQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserServiceImpl.java new file mode 100644 index 00000000..f9063570 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserServiceImpl.java @@ -0,0 +1,73 @@ +package co.yixiang.modules.user.service.impl; + +import co.yixiang.modules.order.service.YxStoreOrderService; +import co.yixiang.modules.user.entity.YxUser; +import co.yixiang.modules.user.mapper.YxUserMapper; +import co.yixiang.modules.user.service.YxUserService; +import co.yixiang.modules.user.web.param.YxUserQueryParam; +import co.yixiang.modules.user.web.vo.YxUserQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 用户表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-16 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxUserServiceImpl extends BaseServiceImpl implements YxUserService { + + @Autowired + private YxUserMapper yxUserMapper; + + @Autowired + private YxStoreOrderService orderService; + + + @Override + public void incPayCount(int uid) { + yxUserMapper.incPayCount(uid); + } + + @Override + public void decPrice(int uid, double payPrice) { + yxUserMapper.decPrice(payPrice,uid); + } + + @Override + public YxUserQueryVo getYxUserById(Serializable id){ + YxUserQueryVo userQueryVo = yxUserMapper.getYxUserById(id); + userQueryVo.setOrderStatusNum(orderService.orderData((int)id)); + return userQueryVo; + } + + @Override + public Paging getYxUserPageList(YxUserQueryParam yxUserQueryParam) throws Exception{ + Page page = setPageParam(yxUserQueryParam,OrderItem.desc("add_time")); + IPage iPage = yxUserMapper.getYxUserPageList(page,yxUserQueryParam); + return new Paging(iPage); + } + + @Override + public YxUser findByName(String name) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("username",name); + return getOne(wrapper); + } +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxWechatUserServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxWechatUserServiceImpl.java new file mode 100644 index 00000000..8214cc04 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxWechatUserServiceImpl.java @@ -0,0 +1,57 @@ +package co.yixiang.modules.user.service.impl; + +import co.yixiang.modules.user.entity.YxWechatUser; +import co.yixiang.modules.user.mapper.YxWechatUserMapper; +import co.yixiang.modules.user.service.YxWechatUserService; +import co.yixiang.modules.user.web.param.YxWechatUserQueryParam; +import co.yixiang.modules.user.web.vo.YxWechatUserQueryVo; +import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.common.web.vo.Paging; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * 微信用户表 服务实现类 + *

+ * + * @author hupeng + * @since 2019-10-27 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class YxWechatUserServiceImpl extends BaseServiceImpl implements YxWechatUserService { + + @Autowired + private YxWechatUserMapper yxWechatUserMapper; + + @Override + public YxWechatUser getUserInfo(String openid) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("openid",openid); + return yxWechatUserMapper.selectOne(wrapper); + } + + @Override + public YxWechatUserQueryVo getYxWechatUserById(Serializable id){ + return yxWechatUserMapper.getYxWechatUserById(id); + } + + @Override + public Paging getYxWechatUserPageList(YxWechatUserQueryParam yxWechatUserQueryParam) throws Exception{ + Page page = setPageParam(yxWechatUserQueryParam,OrderItem.desc("create_time")); + IPage iPage = yxWechatUserMapper.getYxWechatUserPageList(page,yxWechatUserQueryParam); + return new Paging(iPage); + } + +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserAddressController.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserAddressController.java new file mode 100644 index 00000000..b428a7fb --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserAddressController.java @@ -0,0 +1,140 @@ +package co.yixiang.modules.user.web.controller; + +import cn.hutool.core.util.StrUtil; +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.common.web.param.IdParam; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.user.entity.YxUserAddress; +import co.yixiang.modules.user.service.YxUserAddressService; +import co.yixiang.modules.user.web.param.AddressParam; +import co.yixiang.modules.user.web.param.YxUserAddressQueryParam; +import co.yixiang.modules.user.web.vo.YxUserAddressQueryVo; +import co.yixiang.utils.OrderUtil; +import co.yixiang.utils.SecurityUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + *

+ * 用户地前端控制器 + *

+ * + * @author hupeng + * @since 2019-10-28 + */ +@Slf4j +@RestController +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@Api(value = "用户地址", tags = "用户地址", description = "用户地址") +public class UserAddressController extends BaseController { + + private final YxUserAddressService userAddressService; + + /** + * 添加或修改地址 + */ + @PostMapping("/address/edit") + @ApiOperation(value = "添加或修改地址",notes = "添加或修改地址",response = ApiResult.class) + public ApiResult> addYxUserAddress(@Valid @RequestBody AddressParam param){ + int uid = SecurityUtils.getUserId().intValue(); + + YxUserAddress userAddress = new YxUserAddress(); + userAddress.setCity(param.getAddress().getCity()); + userAddress.setDistrict(param.getAddress().getDistrict()); + userAddress.setProvince(param.getAddress().getProvince()); + if(param.getIs_default().equals("true")){ + userAddress.setIsDefault(1); + }else{ + userAddress.setIsDefault(0); + } + userAddress.setDetail(param.getDetail()); + userAddress.setUid(uid); + userAddress.setPhone(param.getPhone()); + userAddress.setPostCode(param.getPost_code()); + userAddress.setRealName(param.getReal_name()); + if(StrUtil.isEmpty(param.getId())){ + userAddress.setAddTime(OrderUtil.getSecondTimestampTwo()); + userAddressService.save(userAddress); + }else{ + userAddress.setId(Integer.valueOf(param.getId())); + userAddressService.updateById(userAddress); + } + Map map = new LinkedHashMap<>(); + map.put("id",userAddress.getId()); + return ApiResult.ok(map); + } + + /** + * 设置默认地址 + */ + @PostMapping("/address/default/set") + @ApiOperation(value = "设置默认地址",notes = "设置默认地址",response = ApiResult.class) + public ApiResult setDefault(@Valid @RequestBody IdParam idParam){ + int uid = SecurityUtils.getUserId().intValue(); + YxUserAddress address = new YxUserAddress(); + address.setIsDefault(0); + userAddressService.update(address, + new QueryWrapper().lambda().eq(YxUserAddress::getUid,uid)); + YxUserAddress userAddress = new YxUserAddress(); + userAddress.setIsDefault(1); + userAddress.setId(Integer.valueOf(idParam.getId())); + boolean flag = userAddressService.updateById(userAddress); + return ApiResult.result(flag); + } + + + + /** + * 删除用户地址 + */ + @PostMapping("/delete") + @ApiOperation(value = "删除用户地址",notes = "删除用户地址",response = ApiResult.class) + public ApiResult deleteYxUserAddress(@Valid @RequestBody IdParam idParam){ + YxUserAddress userAddress = new YxUserAddress(); + userAddress.setIsDel(1); + userAddress.setId(Integer.valueOf(idParam.getId())); + boolean flag = userAddressService.updateById(userAddress); + return ApiResult.result(flag); + } + + + /** + * 用户地址列表 + */ + @GetMapping("/address/list") + @ApiOperation(value = "用户地址列表",notes = "用户地址列表",response = YxUserAddressQueryVo.class) + public ApiResult> getYxUserAddressPageList( + @RequestParam(value = "page",defaultValue = "1") int page, + @RequestParam(value = "limit",defaultValue = "10") int limit){ + int uid = SecurityUtils.getUserId().intValue(); + YxUserAddressQueryParam yxUserAddressQueryParam = new YxUserAddressQueryParam(); + yxUserAddressQueryParam.setCurrent(page); + yxUserAddressQueryParam.setSize(limit); + yxUserAddressQueryParam.setUid(uid); + yxUserAddressQueryParam.setIsDel(0); + Paging paging = userAddressService.getYxUserAddressPageList(yxUserAddressQueryParam); + return ApiResult.ok(paging.getRecords()); + } + + /** + * 地址详情 + */ + @GetMapping("/address/detail/{id}") + @ApiOperation(value = "地址详情",notes = "地址详情",response = ApiResult.class) + public ApiResult addressDetail(@PathVariable Integer id){ + return ApiResult.ok(userAddressService.getYxUserAddressById(id)); + } + +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserController.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserController.java new file mode 100644 index 00000000..d196122a --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserController.java @@ -0,0 +1,138 @@ +package co.yixiang.modules.user.web.controller; + +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.common.web.param.IdParam; +import co.yixiang.common.web.vo.Paging; +import co.yixiang.modules.order.service.YxStoreOrderService; +import co.yixiang.modules.shop.service.YxStoreProductRelationService; +import co.yixiang.modules.shop.service.YxSystemGroupDataService; +import co.yixiang.modules.user.entity.YxUser; +import co.yixiang.modules.user.service.YxUserService; +import co.yixiang.modules.user.web.param.YxUserQueryParam; +import co.yixiang.modules.user.web.vo.YxUserQueryVo; +import co.yixiang.utils.SecurityUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + *

+ * 用户控制器 + *

+ * + * @author hupeng + * @since 2019-10-16 + */ +@Slf4j +@RestController +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@Api(value = "用户中心", tags = "用户中心", description = "用户中心") +public class UserController extends BaseController { + + private final YxUserService yxUserService; + private final YxSystemGroupDataService systemGroupDataService; + private final YxStoreOrderService orderService; + private final YxStoreProductRelationService relationService; + + + + /** + * 用户资料 + */ + @GetMapping("/userinfo") + @ApiOperation(value = "获取用户信息",notes = "获取用户信息",response = YxUserQueryVo.class) + public ApiResult userInfo(){ + int uid = SecurityUtils.getUserId().intValue(); + return ApiResult.ok(yxUserService.getYxUserById(uid)); + } + + /** + * 获取个人中心菜单 + */ + @GetMapping("/menu/user") + @ApiOperation(value = "获取个人中心菜单",notes = "获取个人中心菜单") + public ApiResult> userMenu(){ + Map map = new LinkedHashMap<>(); + map.put("routine_my_menus",systemGroupDataService.getDatas("routine_my_menus")); + return ApiResult.ok(map); + } + + /** + * 个人中心 + */ + @GetMapping("/user") + @ApiOperation(value = "个人中心",notes = "个人中心") + public ApiResult user(){ + int uid = SecurityUtils.getUserId().intValue(); + return ApiResult.ok(yxUserService.getYxUserById(uid)); + } + + /** + * 订单统计数据 + */ + @GetMapping("/order/data") + @ApiOperation(value = "订单统计数据",notes = "订单统计数据") + public ApiResult orderData(){ + int uid = SecurityUtils.getUserId().intValue(); + return ApiResult.ok(orderService.orderData(uid)); + } + + /** + * 获取收藏产品 + */ + @GetMapping("/collect/user") + @ApiOperation(value = "获取收藏产品",notes = "获取收藏产品") + public ApiResult collectUser(@RequestParam(value = "page",defaultValue = "1") int page, + @RequestParam(value = "limit",defaultValue = "10") int limit){ + int uid = SecurityUtils.getUserId().intValue(); + return ApiResult.ok(relationService.userCollectProduct(page,limit,uid)); + } + + /** + * 用户资金统计 + */ + @GetMapping("/user/balance") + @ApiOperation(value = "用户资金统计",notes = "用户资金统计") + public ApiResult collectUser(){ + int uid = SecurityUtils.getUserId().intValue(); + Map map = new LinkedHashMap<>(); + map.put("now_money",yxUserService.getYxUserById(uid).getNowMoney()); + map.put("orderStatusSum",orderService.orderData(uid).getSumPrice()); + map.put("recharge",0); + return ApiResult.ok(map); + } + + /** + * 获取活动状态 + */ + @GetMapping("/user/activity") + @ApiOperation(value = "获取活动状态",notes = "获取活动状态") + public ApiResult activity(){ + Map map = new LinkedHashMap<>(); + map.put("is_bargin",false); + map.put("is_pink",false); + map.put("is_seckill",false); + return ApiResult.ok(map); + } + + /** + * 获取活动状态 + */ + @PostMapping("/sign/user") + @ApiOperation(value = "获取活动状态",notes = "获取活动状态") + public ApiResult sign(){ + return ApiResult.fail("开发中"); + } + + + +} + diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/param/AddressDetailParam.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/AddressDetailParam.java new file mode 100644 index 00000000..9f0e67c1 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/AddressDetailParam.java @@ -0,0 +1,17 @@ +package co.yixiang.modules.user.web.param; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @ClassName AddressDetailParam + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/28 + **/ +@Data +public class AddressDetailParam implements Serializable { + private String city; + private String district; + private String province; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/param/AddressParam.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/AddressParam.java new file mode 100644 index 00000000..bf9ac4cc --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/AddressParam.java @@ -0,0 +1,25 @@ +package co.yixiang.modules.user.web.param; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @ClassName AddressParam + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/28 + **/ +@Data +public class AddressParam implements Serializable { + private String id; + @NotBlank + private String real_name; + private String post_code; + private String is_default; + @NotBlank + private String detail; + @NotBlank + private String phone; + private AddressDetailParam address; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserAddressQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserAddressQueryParam.java new file mode 100644 index 00000000..e998e014 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserAddressQueryParam.java @@ -0,0 +1,24 @@ +package co.yixiang.modules.user.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 用户地址表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxUserAddressQueryParam对象", description="用户地址表查询参数") +public class YxUserAddressQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; + private Integer uid; + private Integer isDel; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserBillQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserBillQueryParam.java new file mode 100644 index 00000000..7e094dc4 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserBillQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.user.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 用户账单表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxUserBillQueryParam对象", description="用户账单表查询参数") +public class YxUserBillQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserQueryParam.java new file mode 100644 index 00000000..3b47ddce --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxUserQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.user.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 用户表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxUserQueryParam对象", description="用户表查询参数") +public class YxUserQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxWechatUserQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxWechatUserQueryParam.java new file mode 100644 index 00000000..22f4f3fc --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/param/YxWechatUserQueryParam.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.user.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import co.yixiang.common.web.param.QueryParam; + +/** + *

+ * 微信用户表 查询参数对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="YxWechatUserQueryParam对象", description="微信用户表查询参数") +public class YxWechatUserQueryParam extends QueryParam { + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserAddressQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserAddressQueryVo.java new file mode 100644 index 00000000..8333e5a7 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserAddressQueryVo.java @@ -0,0 +1,66 @@ +package co.yixiang.modules.user.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * 用户地址表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-28 + */ +@Data +@ApiModel(value = "YxUserAddressQueryVo对象", description = "用户地址表查询参数") +public class YxUserAddressQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "用户地址id") + private Integer id; + + @ApiModelProperty(value = "用户id") + private Integer uid; + + @ApiModelProperty(value = "收货人姓名") + private String realName; + + @ApiModelProperty(value = "收货人电话") + private String phone; + + @ApiModelProperty(value = "收货人所在省") + private String province; + + @ApiModelProperty(value = "收货人所在市") + private String city; + + @ApiModelProperty(value = "收货人所在区") + private String district; + + @ApiModelProperty(value = "收货人详细地址") + private String detail; + + @ApiModelProperty(value = "邮编") + private Integer postCode; + + @ApiModelProperty(value = "经度") + private String longitude; + + @ApiModelProperty(value = "纬度") + private String latitude; + + @ApiModelProperty(value = "是否默认") + private Integer isDefault; + + @ApiModelProperty(value = "是否删除") + private Integer isDel; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserBillQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserBillQueryVo.java new file mode 100644 index 00000000..38e61cf2 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserBillQueryVo.java @@ -0,0 +1,60 @@ +package co.yixiang.modules.user.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; + +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 用户账单表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value="YxUserBillQueryVo对象", description="用户账单表查询参数") +public class YxUserBillQueryVo implements Serializable{ + private static final long serialVersionUID = 1L; + +@ApiModelProperty(value = "用户账单id") +private Integer id; + +@ApiModelProperty(value = "用户uid") +private Integer uid; + +@ApiModelProperty(value = "关联id") +private String linkId; + +@ApiModelProperty(value = "0 = 支出 1 = 获得") +private Boolean pm; + +@ApiModelProperty(value = "账单标题") +private String title; + +@ApiModelProperty(value = "明细种类") +private String category; + +@ApiModelProperty(value = "明细类型") +private String type; + +@ApiModelProperty(value = "明细数字") +private BigDecimal number; + +@ApiModelProperty(value = "剩余") +private BigDecimal balance; + +@ApiModelProperty(value = "备注") +private String mark; + +@ApiModelProperty(value = "添加时间") +private Integer addTime; + +@ApiModelProperty(value = "0 = 带确定 1 = 有效 -1 = 无效") +private Boolean status; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserQueryVo.java new file mode 100644 index 00000000..a156d521 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxUserQueryVo.java @@ -0,0 +1,140 @@ +package co.yixiang.modules.user.web.vo; + +import co.yixiang.modules.order.web.dto.OrderCountDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 用户表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-16 + */ +@Data +@ApiModel(value = "YxUserQueryVo对象", description = "用户表查询参数") +public class YxUserQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "用户id") + private Integer uid; + + @ApiModelProperty(value = "用户账户(跟accout一样)") + private String username; + + @ApiModelProperty(value = "用户账号") + private String account; + + private Integer couponCount = 0; + + private OrderCountDTO orderStatusNum; + + + +// @ApiModelProperty(value = "用户密码(跟pwd)") +// @JsonIgnore +// private String password; +// +// @ApiModelProperty(value = "用户密码") +// @JsonIgnore +// private String pwd; + + @ApiModelProperty(value = "真实姓名") + private String realName; + + @ApiModelProperty(value = "生日") + private Integer birthday; + + @ApiModelProperty(value = "身份证号码") + @JsonIgnore + private String cardId; + + @ApiModelProperty(value = "用户备注") + private String mark; + + @ApiModelProperty(value = "合伙人id") + @JsonIgnore + private Integer partnerId; + + @ApiModelProperty(value = "用户分组id") + @JsonIgnore + private Integer groupId; + + @ApiModelProperty(value = "用户昵称") + private String nickname; + + @ApiModelProperty(value = "用户头像") + private String avatar; + + @ApiModelProperty(value = "手机号码") + private String phone; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + + @ApiModelProperty(value = "添加ip") + private String addIp; + + @ApiModelProperty(value = "最后一次登录时间") + private Integer lastTime; + + @ApiModelProperty(value = "最后一次登录ip") + private String lastIp; + + @ApiModelProperty(value = "用户余额") + private BigDecimal nowMoney; + + @ApiModelProperty(value = "佣金金额") + private BigDecimal brokeragePrice; + + @ApiModelProperty(value = "用户剩余积分") + private BigDecimal integral; + + @ApiModelProperty(value = "连续签到天数") + private Integer signNum; + + @ApiModelProperty(value = "1为正常,0为禁止") + private Boolean status; + + @ApiModelProperty(value = "等级") + private Integer level; + + @ApiModelProperty(value = "推广元id") + private Integer spreadUid; + + @ApiModelProperty(value = "推广员关联时间") + private Integer spreadTime; + + @ApiModelProperty(value = "用户类型") + private String userType; + + @ApiModelProperty(value = "是否为推广员") + private Boolean isPromoter; + + @ApiModelProperty(value = "用户购买次数") + private Integer payCount; + + @ApiModelProperty(value = "下级人数") + private Integer spreadCount; + + @ApiModelProperty(value = "清理会员时间") + private Integer cleanTime; + + @ApiModelProperty(value = "详细地址") + private String addres; + + @ApiModelProperty(value = "管理员编号 ") + private Integer adminid; + + @ApiModelProperty(value = "用户登陆类型,h5,wechat,routine") + private String loginType; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxWechatUserQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxWechatUserQueryVo.java new file mode 100644 index 00000000..9e82f71b --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/vo/YxWechatUserQueryVo.java @@ -0,0 +1,97 @@ +package co.yixiang.modules.user.web.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 微信用户表 查询结果对象 + *

+ * + * @author hupeng + * @date 2019-10-27 + */ +@Data +@ApiModel(value = "YxWechatUserQueryVo对象", description = "微信用户表查询参数") +public class YxWechatUserQueryVo implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "微信用户id") + private Integer uid; + + @ApiModelProperty(value = "只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段") + private String unionid; + + @ApiModelProperty(value = "用户的标识,对当前公众号唯一") + private String openid; + + @ApiModelProperty(value = "小程序唯一身份ID") + private String routineOpenid; + + @ApiModelProperty(value = "用户的昵称") + private String nickname; + + @ApiModelProperty(value = "用户头像") + private String headimgurl; + + @ApiModelProperty(value = "用户的性别,值为1时是男性,值为2时是女性,值为0时是未知") + private Integer sex; + + @ApiModelProperty(value = "用户所在城市") + private String city; + + @ApiModelProperty(value = "用户的语言,简体中文为zh_CN") + private String language; + + @ApiModelProperty(value = "用户所在省份") + private String province; + + @ApiModelProperty(value = "用户所在国家") + private String country; + + @ApiModelProperty(value = "公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注") + private String remark; + + @ApiModelProperty(value = "用户所在的分组ID(兼容旧的用户分组接口)") + private Integer groupid; + + @ApiModelProperty(value = "用户被打上的标签ID列表") + private String tagidList; + + @ApiModelProperty(value = "用户是否订阅该公众号标识") + private Integer subscribe; + + @ApiModelProperty(value = "关注公众号时间") + private Integer subscribeTime; + + @ApiModelProperty(value = "添加时间") + private Integer addTime; + + @ApiModelProperty(value = "一级推荐人") + private Integer stair; + + @ApiModelProperty(value = "二级推荐人") + private Integer second; + + @ApiModelProperty(value = "一级推荐人订单") + private Integer orderStair; + + @ApiModelProperty(value = "二级推荐人订单") + private Integer orderSecond; + + @ApiModelProperty(value = "佣金") + private BigDecimal nowMoney; + + @ApiModelProperty(value = "小程序用户会话密匙") + private String sessionKey; + + @ApiModelProperty(value = "用户类型") + private String userType; + +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java new file mode 100644 index 00000000..48b46d42 --- /dev/null +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java @@ -0,0 +1,194 @@ +package co.yixiang.modules.wechat.web.controller; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.common.api.ApiResult; +import co.yixiang.common.web.controller.BaseController; +import co.yixiang.modules.order.service.YxStoreOrderService; +import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo; +import co.yixiang.modules.security.security.JwtUser; +import co.yixiang.modules.security.utils.JwtTokenUtil; +import co.yixiang.modules.user.entity.YxUser; +import co.yixiang.modules.user.entity.YxWechatUser; +import co.yixiang.modules.user.service.YxUserService; +import co.yixiang.modules.user.service.YxWechatUserService; +import co.yixiang.utils.EncryptUtils; +import co.yixiang.utils.OrderUtil; +import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; +import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.api.WxConsts; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; +import me.chanjar.weixin.mp.bean.result.WxMpUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @ClassName WechatController + * @Author hupeng <610796224@qq.com> + * @Date 2019/11/5 + **/ +@Slf4j +@RestController +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@Api(value = "微信模块", tags = "微信模块", description = "微信模块") +public class WechatController extends BaseController { + + private final WxMpService wxService; + private final YxWechatUserService wechatUserService; + private final YxUserService userService; + private final WxPayService wxPayService; + private final YxStoreOrderService orderService; + + @Autowired + private JwtTokenUtil jwtTokenUtil; + + + @Autowired + @Qualifier("jwtUserDetailsService") + private UserDetailsService userDetailsService; + + /** + * jssdk配置 + */ + @GetMapping("/wechat/config") + @ApiOperation(value = "jssdk配置",notes = "jssdk配置") + public ApiResult jsConfig(@RequestParam(value = "url") String url) throws WxErrorException { + return ApiResult.ok(wxService.createJsapiSignature(url)); + } + + /** + * 微信授权 + */ + @GetMapping("/wechat/auth") + @ApiOperation(value = "微信授权",notes = "微信授权") + public ApiResult authLogin(@RequestParam(value = "code") String code) { + //todo 分销人 + //String url = "https://h5.dayouqiantu.cn/"; + //wxService.oauth2buildAuthorizationUrl(url, WxConsts.OAuth2Scope.SNSAPI_USERINFO, null); + + + try { + WxMpOAuth2AccessToken wxMpOAuth2AccessToken = wxService.oauth2getAccessToken(code); + WxMpUser wxMpUser = wxService.oauth2getUserInfo(wxMpOAuth2AccessToken, null); + String openid = wxMpUser.getOpenId(); + YxWechatUser wechatUser = wechatUserService.getUserInfo(openid); + JwtUser jwtUser = null; + if(ObjectUtil.isNotNull(wechatUser)){ + jwtUser = (JwtUser) userDetailsService.loadUserByUsername(wechatUser.getNickname()); + }else{ + //保存微信用户 + YxWechatUser yxWechatUser = new YxWechatUser(); + // System.out.println("wxMpUser:"+wxMpUser); + yxWechatUser.setAddTime(OrderUtil.getSecondTimestampTwo()); + yxWechatUser.setNickname(wxMpUser.getNickname()); + yxWechatUser.setOpenid(wxMpUser.getOpenId()); + int sub = 0; + if(ObjectUtil.isNotNull(wxMpUser.getSubscribe()) && wxMpUser.getSubscribe()) sub =1; + yxWechatUser.setSubscribe(sub); + yxWechatUser.setSex(wxMpUser.getSex()); + yxWechatUser.setLanguage(wxMpUser.getLanguage()); + yxWechatUser.setCity(wxMpUser.getCity()); + yxWechatUser.setProvince(wxMpUser.getProvince()); + yxWechatUser.setCountry(wxMpUser.getCountry()); + yxWechatUser.setHeadimgurl(wxMpUser.getHeadImgUrl()); + if(ObjectUtil.isNotNull(wxMpUser.getSubscribeTime())){ + yxWechatUser.setSubscribeTime(wxMpUser.getSubscribeTime().intValue()); + } + if(StrUtil.isNotEmpty(wxMpUser.getUnionId())){ + yxWechatUser.setUnionid(wxMpUser.getUnionId()); + } + if(StrUtil.isNotEmpty(wxMpUser.getRemark())){ + yxWechatUser.setUnionid(wxMpUser.getRemark()); + } + if(ObjectUtil.isNotEmpty(wxMpUser.getGroupId())){ + yxWechatUser.setGroupid(wxMpUser.getGroupId()); + } + + wechatUserService.save(yxWechatUser); + + + //用户保存 + YxUser user = new YxUser(); + user.setAccount(wxMpUser.getNickname()); + user.setUsername(wxMpUser.getNickname()); + user.setPassword(EncryptUtils.encryptPassword("123456")); + user.setPwd(EncryptUtils.encryptPassword("123456")); + user.setPhone(""); + user.setUserType("wechat"); + user.setAddTime(OrderUtil.getSecondTimestampTwo()); + user.setLastTime(OrderUtil.getSecondTimestampTwo()); + user.setNickname(wxMpUser.getNickname()); + user.setAvatar(wxMpUser.getHeadImgUrl()); + user.setNowMoney(BigDecimal.ZERO); + user.setBrokeragePrice(BigDecimal.ZERO); + user.setIntegral(BigDecimal.ZERO); + user.setUid(yxWechatUser.getUid()); + userService.save(user); + + jwtUser = (JwtUser) userDetailsService.loadUserByUsername(wxMpUser.getNickname()); + } + + //System.out.println("jwtUser:"+jwtUser); + + // 生成令牌 + final String token = jwtTokenUtil.generateToken(jwtUser); + Date expiresTime = jwtTokenUtil.getExpirationDateFromToken(token); + String expiresTimeStr = DateUtil.formatDateTime(expiresTime); + Map map = new LinkedHashMap<>(); + map.put("token",token); + map.put("expires_time",expiresTimeStr); + + // 返回 token + return ApiResult.ok(map); + } catch (WxErrorException e) { + e.printStackTrace(); + log.error(e.getMessage()); + return ApiResult.fail("授权失败"); + } + // return ApiResult.ok(wxService.createJsapiSignature(url)); + } + + /** + * 微信支付回调 + */ + @PostMapping("/wechat/notify") + @ApiOperation(value = "微信支付回调",notes = "微信支付回调") + public String notify(@RequestBody String xmlData) { + try { + WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData); + String orderId = notifyResult.getOutTradeNo(); + YxStoreOrderQueryVo orderInfo = orderService.getOrderInfo(orderId,0); + if(orderInfo.getPaid() == 1){ + return WxPayNotifyResponse.success("处理成功!"); + } + + orderService.paySuccess(orderId,"weixin"); + + return WxPayNotifyResponse.success("处理成功!"); + } catch (WxPayException e) { + log.error(e.getMessage()); + return WxPayNotifyResponse.fail(e.getMessage()); + } + + } + + + + +} diff --git a/yshop-api/src/main/resources/banner.txt b/yshop-api/src/main/resources/banner.txt new file mode 100644 index 00000000..4dac28d9 --- /dev/null +++ b/yshop-api/src/main/resources/banner.txt @@ -0,0 +1,15 @@ + + __ __ ___ _ _ ___ _ __ + \ \ / // __|| | | | / _ \ | '_ \ + \ \/ / \__ \| |--| || (_) || |_) | + \/ / |___/|_| |_| \___/ | .__/ + / / | | + /_/ |_| + + + + :: Spring Boot :: (v2.1.0.RELEASE) + + + + diff --git a/yshop-api/src/main/resources/config/application-dev.yml b/yshop-api/src/main/resources/config/application-dev.yml new file mode 100644 index 00000000..98d19e67 --- /dev/null +++ b/yshop-api/src/main/resources/config/application-dev.yml @@ -0,0 +1,80 @@ +#配置数据源 +spring: + datasource: + druid: + type: com.alibaba.druid.pool.DruidDataSource + #driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + driver-class-name: com.p6spy.engine.spy.P6SpyDriver + url: jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false + #url: jdbc:log4jdbc:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false + username: root + password: root + + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + + validation-query: select 1 + # 配置监控统计拦截的filters + filters: stat + stat-view-servlet: + url-pattern: /druid/* + reset-enable: false + + web-stat-filter: + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" + + #配置 Jpa + jpa: + hibernate: + # 生产环境设置成 none,避免程序运行时自动更新数据库结构 + ddl-auto: update + redis: + #数据库索引 + database: 0 + host: 127.0.0.1 + port: 6379 + password: + #连接超时时间 + timeout: 5000 + +#jwt +jwt: + header: Authorization + secret: JBqNQX7HD9xhwHP7 + # token 过期时间 6个小时 + expiration: 210000000 + auth: + # 授权路径 + path: /login + # 获取用户信息 + account: /info + +#是否允许生成代码,生产环境设置为false +generator: + enabled: true + +#是否开启 swagger-ui +swagger: + enabled: true + +# 文件存储路径 +file: + path: E:\yshop\file\ + avatar: E:\yshop\avatar\ + # 文件大小 /M + maxSize: 100 + avatarMaxSize: 5 \ No newline at end of file diff --git a/yshop-api/src/main/resources/config/application-prod.yml b/yshop-api/src/main/resources/config/application-prod.yml new file mode 100644 index 00000000..8c552c02 --- /dev/null +++ b/yshop-api/src/main/resources/config/application-prod.yml @@ -0,0 +1,88 @@ +#配置数据源 +spring: + datasource: + druid: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + url: jdbc:log4jdbc:mysql://localhost:3306/yshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false + username: yshop + password: yshoP@2019#yx + + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + validation-query: select 1 + # 配置监控统计拦截的filters + filters: stat + + stat-view-servlet: + url-pattern: /druid/* + reset-enable: false + login-username: admin + login-password: 123456 + + web-stat-filter: + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" + + #配置 Jpa + jpa: + hibernate: + # 生产环境设置成 none,避免程序运行时自动更新数据库结构 + ddl-auto: none + + redis: + #数据库索引 + database: 0 + host: 127.0.0.1 + port: 6379 + password: yshop2019@yxtw + #连接超时时间 + timeout: 5000 + +#jwt +jwt: + header: Authorization + secret: JBqNQX7HD9xhwHP7YSHOP + # token 过期时间 2个小时 + expiration: 7200000 + auth: + # 授权路径 + path: /login + # 获取用户信息 + account: /info + +#是否允许生成代码,生产环境设置为false +generator: + enabled: false + +#如果生产环境要开启swagger,需要配置请求地址 +#springfox: +# documentation: +# swagger: +# v2: +# host: # 接口域名或外网ip + +#是否开启 swagger-ui +swagger: + enabled: false + +# 文件存储路径 +file: + path: /home/yshop/file/ + avatar: /home/yshop/avatar/ + # 文件大小 /M + maxSize: 100 + avatarMaxSize: 5 \ No newline at end of file diff --git a/yshop-api/src/main/resources/config/application.yml b/yshop-api/src/main/resources/config/application.yml new file mode 100644 index 00000000..4812f3d0 --- /dev/null +++ b/yshop-api/src/main/resources/config/application.yml @@ -0,0 +1,71 @@ +server: + port: 8009 + servlet: + context-path: /api + +spring: + freemarker: + check-template-location: false + profiles: + active: dev + jackson: + time-zone: GMT+8 + data: + redis: + repositories: + enabled: false + + #配置 Jpa + jpa: + properties: + hibernate: + dialect: org.hibernate.dialect.MySQL5InnoDBDialect + open-in-view: true + + + +#七牛云 +qiniu: + # 文件大小 /M + max-size: 15 + +#邮箱验证码有效时间/分钟 +code: + expiration: 5 + +#登录图形验证码有效时间/分钟 +loginCode: + expiration: 2 + +mybatis-plus: + check-config-location: true + configuration: + map-underscore-to-camel-case: true + global-config: + db-config: + id-type: id_worker + logic-delete-value: 0 + logic-not-delete-value: 1 + mapper-locations: classpath*:mapper/**/*Mapper.xml + +# 公众号配置(必填) +wx: + mp: + configs: + - appId: wx41db1daef9040a9e + secret: a21b79510e45c76d6d543ef3ec020817 + token: dayouqiantu + aesKey: 6wYzx9DyWXHwKSCOBjf8hHQu15d4JI5fVzDDNphaKqM + pay: + appId: wx41db1daef9040a9e + mchId: 1531087341 + mchKey: dayouqiantuhupeng8638004yixiangt + subAppId: + subMchId: + keyPath: +logging: + level: + org.springframework.web: INFO + com.github.binarywang.demo.wx.mp: DEBUG + me.chanjar.weixin: DEBUG + diff --git a/yshop-api/src/main/resources/generator.properties b/yshop-api/src/main/resources/generator.properties new file mode 100644 index 00000000..2ed93706 --- /dev/null +++ b/yshop-api/src/main/resources/generator.properties @@ -0,0 +1,27 @@ +#数据库类型转Java类型 +tinyint=Integer +smallint=Integer +mediumint=Integer +int=Integer +integer=Integer + +bigint=Long + +float=Float + +double=Double + +decimal=BigDecimal + +bit=Boolean + +char=String +varchar=String +tinytext=String +text=String +mediumtext=String +longtext=String + +date=Timestamp +datetime=Timestamp +timestamp=Timestamp \ No newline at end of file diff --git a/yshop-api/src/main/resources/ip2region/ip2region.db b/yshop-api/src/main/resources/ip2region/ip2region.db new file mode 100644 index 00000000..43e1daf5 Binary files /dev/null and b/yshop-api/src/main/resources/ip2region/ip2region.db differ diff --git a/yshop-api/src/main/resources/log4jdbc.log4j2.properties b/yshop-api/src/main/resources/log4jdbc.log4j2.properties new file mode 100644 index 00000000..302525ff --- /dev/null +++ b/yshop-api/src/main/resources/log4jdbc.log4j2.properties @@ -0,0 +1,4 @@ +# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger +log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator +log4jdbc.auto.load.popular.drivers=false +log4jdbc.drivers=com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/yshop-api/src/main/resources/logback.xml b/yshop-api/src/main/resources/logback.xml new file mode 100644 index 00000000..ec1ccfa3 --- /dev/null +++ b/yshop-api/src/main/resources/logback.xml @@ -0,0 +1,43 @@ + + + elAdmin + + + + + %black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n) + utf-8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yshop-api/src/main/resources/mapper/order/YxStoreOrderCartInfoMapper.xml b/yshop-api/src/main/resources/mapper/order/YxStoreOrderCartInfoMapper.xml new file mode 100644 index 00000000..15761087 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/order/YxStoreOrderCartInfoMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, oid, cart_id, product_id, cart_info, unique + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/order/YxStoreOrderMapper.xml b/yshop-api/src/main/resources/mapper/order/YxStoreOrderMapper.xml new file mode 100644 index 00000000..b694d7f4 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/order/YxStoreOrderMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, order_id, uid, real_name, user_phone, user_address, cart_id, freight_price, total_num, total_price, total_postage, pay_price, pay_postage, deduction_price, coupon_id, coupon_price, paid, pay_time, pay_type, add_time, status, refund_status, refund_reason_wap_img, refund_reason_wap_explain, refund_reason_time, refund_reason_wap, refund_reason, refund_price, delivery_name, delivery_type, delivery_id, gain_integral, use_integral, back_integral, mark, is_del, unique, remark, mer_id, is_mer_check, combination_id, pink_id, cost, seckill_id, bargain_id, verify_code, store_id, shipping_type, is_channel, is_remind, is_system_del + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/order/YxStoreOrderStatusMapper.xml b/yshop-api/src/main/resources/mapper/order/YxStoreOrderStatusMapper.xml new file mode 100644 index 00000000..4b353c49 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/order/YxStoreOrderStatusMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, oid, change_type, change_message, change_time + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxArticleMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxArticleMapper.xml new file mode 100644 index 00000000..7846f3de --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxArticleMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, cid, title, author, image_input, synopsis, share_title, share_synopsis, visit, sort, url, status, add_time, hide, admin_id, mer_id, product_id, is_hot, is_banner + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreCartMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreCartMapper.xml new file mode 100644 index 00000000..ae833830 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreCartMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, uid, type, product_id, product_attr_unique, cart_num, add_time, is_pay, is_del, is_new, combination_id, seckill_id, bargain_id + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreCategoryMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreCategoryMapper.xml new file mode 100644 index 00000000..93211504 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreCategoryMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, pid, cate_name, sort, pic, is_show, add_time + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreCouponIssueMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreCouponIssueMapper.xml new file mode 100644 index 00000000..1f71e12c --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreCouponIssueMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, cid, start_time, end_time, total_count, remain_count, is_permanent, status, is_del, add_time + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreCouponIssueUserMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreCouponIssueUserMapper.xml new file mode 100644 index 00000000..50df97f8 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreCouponIssueUserMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, uid, issue_coupon_id, add_time + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreCouponMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreCouponMapper.xml new file mode 100644 index 00000000..5762c792 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreCouponMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, title, integral, coupon_price, use_min_price, coupon_time, sort, status, add_time, is_del + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreCouponUserMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreCouponUserMapper.xml new file mode 100644 index 00000000..67ae4692 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreCouponUserMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, cid, uid, coupon_title, coupon_price, use_min_price, add_time, end_time, use_time, type, status, is_fail + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrMapper.xml new file mode 100644 index 00000000..6ffcadc8 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, product_id, attr_name, attr_values + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrResultMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrResultMapper.xml new file mode 100644 index 00000000..79f368e8 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrResultMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, product_id, result, change_time + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrValueMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrValueMapper.xml new file mode 100644 index 00000000..fc8a9740 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreProductAttrValueMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, product_id, suk, stock, sales, price, image, unique, cost + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreProductMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreProductMapper.xml new file mode 100644 index 00000000..726dad50 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreProductMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, mer_id, image, slider_image, store_name, store_info, keyword, bar_code, cate_id, price, vip_price, ot_price, postage, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, description, add_time, is_postage, is_del, mer_use, give_integral, cost, is_seckill, is_bargain, is_good, ficti, browse, code_path, soure_link + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreProductRelationMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreProductRelationMapper.xml new file mode 100644 index 00000000..a93ec9ec --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreProductRelationMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, uid, product_id, type, category, add_time + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxStoreProductReplyMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxStoreProductReplyMapper.xml new file mode 100644 index 00000000..9d6ceb06 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxStoreProductReplyMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, uid, oid, unique, product_id, reply_type, product_score, service_score, comment, pics, add_time, merchant_reply_content, merchant_reply_time, is_del, is_reply + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxSystemConfigMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxSystemConfigMapper.xml new file mode 100644 index 00000000..6183cc0d --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxSystemConfigMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, menu_name, value, sort, status + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/shop/YxSystemGroupDataMapper.xml b/yshop-api/src/main/resources/mapper/shop/YxSystemGroupDataMapper.xml new file mode 100644 index 00000000..cd60c668 --- /dev/null +++ b/yshop-api/src/main/resources/mapper/shop/YxSystemGroupDataMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, group_name, value, add_time, sort, status + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/user/YxUserAddressMapper.xml b/yshop-api/src/main/resources/mapper/user/YxUserAddressMapper.xml new file mode 100644 index 00000000..d10555aa --- /dev/null +++ b/yshop-api/src/main/resources/mapper/user/YxUserAddressMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, uid, real_name, phone, province, city, district, detail, post_code, longitude, latitude, is_default, is_del, add_time + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/user/YxUserBillMapper.xml b/yshop-api/src/main/resources/mapper/user/YxUserBillMapper.xml new file mode 100644 index 00000000..bd5c34cf --- /dev/null +++ b/yshop-api/src/main/resources/mapper/user/YxUserBillMapper.xml @@ -0,0 +1,18 @@ + + + + + + + id, uid, link_id, pm, title, category, type, number, balance, mark, add_time, status + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/user/YxUserMapper.xml b/yshop-api/src/main/resources/mapper/user/YxUserMapper.xml new file mode 100644 index 00000000..b6bd4ecc --- /dev/null +++ b/yshop-api/src/main/resources/mapper/user/YxUserMapper.xml @@ -0,0 +1,18 @@ + + + + + + + uid, username, account, password, pwd, real_name, birthday, card_id, mark, partner_id, group_id, nickname, avatar, phone, add_time, add_ip, last_time, last_ip, now_money, brokerage_price, integral, sign_num, status, level, spread_uid, spread_time, user_type, is_promoter, pay_count, spread_count, clean_time, addres, adminid, login_type + + + + + + + diff --git a/yshop-api/src/main/resources/mapper/user/YxWechatUserMapper.xml b/yshop-api/src/main/resources/mapper/user/YxWechatUserMapper.xml new file mode 100644 index 00000000..0779894b --- /dev/null +++ b/yshop-api/src/main/resources/mapper/user/YxWechatUserMapper.xml @@ -0,0 +1,18 @@ + + + + + + + uid, unionid, openid, routine_openid, nickname, headimgurl, sex, city, language, province, country, remark, groupid, tagid_list, subscribe, subscribe_time, add_time, stair, second, order_stair, order_second, now_money, session_key, user_type + + + + + + + diff --git a/yshop-api/src/main/resources/spy.properties b/yshop-api/src/main/resources/spy.properties new file mode 100644 index 00000000..d7430d17 --- /dev/null +++ b/yshop-api/src/main/resources/spy.properties @@ -0,0 +1,21 @@ +module.log=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory +# 自定义日志打印 +logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger +#日志输出到控制台 +appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger +# 使用日志系统记录 sql +#appender=com.p6spy.engine.spy.appender.Slf4JLogger +# 设置 p6spy driver 代理 +deregisterdrivers=true +# 取消JDBC URL前缀 +useprefix=true +# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset. +excludecategories=info,debug,result,batch,resultset +# 日期格式 +dateformat=yyyy-MM-dd HH:mm:ss +# 实际驱动可多个 +#driverlist=org.h2.Driver +# 是否开启慢SQL记录 +outagedetection=true +# 慢SQL记录标准 2 秒 +outagedetectioninterval=2 diff --git a/yshop-api/src/test/java/co/yixiang/test/BaseTest.java b/yshop-api/src/test/java/co/yixiang/test/BaseTest.java new file mode 100644 index 00000000..66345551 --- /dev/null +++ b/yshop-api/src/test/java/co/yixiang/test/BaseTest.java @@ -0,0 +1,12 @@ + +package co.yixiang.test; + +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class BaseTest { + +} diff --git a/yshop-api/src/test/java/co/yixiang/test/CodeGenerator.java b/yshop-api/src/test/java/co/yixiang/test/CodeGenerator.java new file mode 100644 index 00000000..6a52c151 --- /dev/null +++ b/yshop-api/src/test/java/co/yixiang/test/CodeGenerator.java @@ -0,0 +1,198 @@ + + +package co.yixiang.test; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.DateType; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 代码生成器入口类 + */ +public class CodeGenerator { + + private static final String USER_NAME = "root"; + private static final String PASSWORD = "root"; + private static final String DRIVER_NAME = "com.mysql.cj.jdbc.Driver"; + private static final String DRIVER_URL = "jdbc:mysql://127.0.0.1:3306/yxshop?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8"; + + private static final String PARENT_PACKAGE = "co.yixiang"; + private static final String SUPER_ENTITY = PARENT_PACKAGE + ".common.entity.BaseEntity"; + private static final String[] SUPER_ENTITY_COMMON_COLUMNS = new String[]{}; + private static final String SUPER_CONTROLLER = PARENT_PACKAGE + ".common.web.controller.BaseController"; + private static final String SUPER_SERVICE = PARENT_PACKAGE + ".common.service.BaseService"; + private static final String SUPER_SERVICE_IMPL = PARENT_PACKAGE + ".common.service.impl.BaseServiceImpl"; + + private static final String PROJECT_PACKAGE_PATH = "co/yixiang"; + + private static final String PARENT_PACKAGE2 = "co.yixiang.modules"; + + + // ############################ 配置部分 start ############################ + // 模块名称 + private static final String MODULE_NAME = "user"; + // 作者 + private static final String AUTHOR = "hupeng"; + // 生成的表名称 + private static final String TABLE_NAME = "yx_user_address"; + // 主键数据库列名称 + private static final String PK_ID_COLUMN_NAME = "id"; + // 代码生成策略 true:All/false:SIMPLE + private static final boolean GENERATOR_STRATEGY = true; + // 分页列表查询是否排序 true:有排序参数/false:无 + private static final boolean PAGE_LIST_ORDER = false; + // ############################ 配置部分 end ############################ + + + public static void main(String[] args) { + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + String projectPath = System.getProperty("user.dir"); + gc.setOutputDir(projectPath + "/yshop-api/src/main/java"); + gc.setAuthor(AUTHOR); + gc.setOpen(false); // 是否打开输出目录 + gc.setSwagger2(true); // 启用swagger注解 + gc.setIdType(IdType.ID_WORKER); // 主键类型:ID_WORKER + gc.setServiceName("%sService"); // 自定义文件命名,注意 %s 会自动填充表实体属性! + gc.setFileOverride(true); // 是否覆盖已有文件 + gc.setDateType(DateType.ONLY_DATE); // 设置日期类型为Date + + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setUrl(DRIVER_URL); + // dsc.setSchemaName("public"); + dsc.setDriverName(DRIVER_NAME); + dsc.setUsername(USER_NAME); + dsc.setPassword(PASSWORD); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setModuleName(MODULE_NAME); + pc.setParent("co.yixiang.modules"); + pc.setController("web.controller"); + + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + Map map = new HashMap(); + map.put("customField", "Hello " + this.getConfig().getGlobalConfig().getAuthor()); + // 查询参数包路径 + map.put("queryParamPath",PARENT_PACKAGE2 + StringPool.DOT + pc.getModuleName() + ".web.param." + underlineToPascal(TABLE_NAME) + "QueryParam"); + // 查询参数共公包路径 + map.put("queryParamCommonPath",PARENT_PACKAGE + StringPool.DOT + "common.web.param." + "QueryParam"); + // 查询参数共公包路径 + map.put("idParamPath",PARENT_PACKAGE + StringPool.DOT + "common.web.param." + "IdParam"); + // 响应结果包路径 + map.put("queryVoPath",PARENT_PACKAGE2 + StringPool.DOT + pc.getModuleName() + ".web.vo." + underlineToPascal(TABLE_NAME) + "QueryVo"); + // 实体对象名称 + map.put("entityObjectName",underlineToCamel(TABLE_NAME)); + // service对象名称 + map.put("serviceObjectName",underlineToCamel(TABLE_NAME) + "Service"); + // mapper对象名称 + map.put("mapperObjectName",underlineToCamel(TABLE_NAME) + "Mapper"); + // 主键ID列名 + map.put("pkIdColumnName",PK_ID_COLUMN_NAME); + // 主键ID驼峰名称 + map.put("pkIdCamelName",underlineToCamel(PK_ID_COLUMN_NAME)); + // 导入分页类 + map.put("paging",PARENT_PACKAGE + ".common.web.vo.Paging"); + // 导入排序枚举 + map.put("orderEnum",PARENT_PACKAGE + ".common.enums.OrderEnum"); + // 分页列表查询是否排序 + map.put("pageListOrder",PAGE_LIST_ORDER); + // 导入排序查询参数类 + map.put("orderQueryParamPath",PARENT_PACKAGE + StringPool.DOT + "common.web.param." + "OrderQueryParam"); + // 代码生成策略 + map.put("generatorStrategy",GENERATOR_STRATEGY); + this.setMap(map); + } + }; + List focList = new ArrayList<>(); + focList.add(new FileOutConfig("/templates/mapper.xml.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + // 自定义输入文件名称 + return projectPath + "/yshop-api/src/main/resources/mapper/" + pc.getModuleName() + + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML; + } + }); + + // 自定义queryParam模板 + focList.add(new FileOutConfig("/templates/queryParam.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return projectPath + "/yshop-api/src/main/java/"+ PROJECT_PACKAGE_PATH +"/modules/" + pc.getModuleName() + "/web/param/" + tableInfo.getEntityName() + "QueryParam" + StringPool.DOT_JAVA; + } + }); + + // 自定义queryVo模板 + focList.add(new FileOutConfig("/templates/queryVo.java.vm") { + @Override + public String outputFile(TableInfo tableInfo) { + return projectPath + "/yshop-api/src/main/java/"+ PROJECT_PACKAGE_PATH +"/modules/" + pc.getModuleName() + "/web/vo/" + tableInfo.getEntityName() + "QueryVo" + StringPool.DOT_JAVA; + } + }); + + + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + mpg.setTemplate(new TemplateConfig().setXml(null)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setSuperEntityClass(SUPER_ENTITY); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + strategy.setSuperControllerClass(SUPER_CONTROLLER); + strategy.setSuperServiceClass(SUPER_SERVICE); + strategy.setSuperServiceImplClass(SUPER_SERVICE_IMPL); + strategy.setInclude(TABLE_NAME); + strategy.setSuperEntityColumns(SUPER_ENTITY_COMMON_COLUMNS); + strategy.setControllerMappingHyphenStyle(true); + /** + * 注意,根据实际情况,进行设置 + * 当表名称的前缀和模块名称一样时,会去掉表的前缀 + * 比如模块名称为user,表明为user_info,则生成的实体名称是Info.java,一定要注意 + */ + //strategy.setTablePrefix(pc.getModuleName() + "_"); + mpg.setStrategy(strategy); + mpg.execute(); + } + + public static String underlineToCamel(String underline){ + if (StringUtils.isNotBlank(underline)){ + return NamingStrategy.underlineToCamel(underline); + } + return null; + } + + public static String underlineToPascal(String underline){ + if (StringUtils.isNotBlank(underline)){ + return NamingStrategy.capitalFirst(NamingStrategy.underlineToCamel(underline)); + } + return null; + } + +} diff --git a/yshop-api/src/test/resources/templates/controller.java.vm b/yshop-api/src/test/resources/templates/controller.java.vm new file mode 100644 index 00000000..7c6b8941 --- /dev/null +++ b/yshop-api/src/test/resources/templates/controller.java.vm @@ -0,0 +1,114 @@ +package ${package.Controller}; + +import ${package.Entity}.${entity}; +import ${package.Service}.${table.serviceName}; +import ${cfg.queryParamPath}; +import ${cfg.queryVoPath}; +#if(${superControllerClassPackage}) +import ${superControllerClassPackage}; +#end +import co.yixiang.common.api.ApiResult; + #if(${swagger2}) +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +#end +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +#if(${restControllerStyle}) +import org.springframework.web.bind.annotation.RestController; +#else +import org.springframework.stereotype.Controller; +#end + +import javax.validation.Valid; + +import ${cfg.paging}; +import ${cfg.idParamPath}; + +/** + *

+ * $!{table.comment} 前端控制器 + *

+ * + * @author ${author} + * @since ${date} + */ +@Slf4j +#if(${restControllerStyle}) +@RestController +#else +@Controller +#end +@RequestMapping("/${cfg.entityObjectName}") +@Api("$!{table.comment} API") +#if(${kotlin}) +class ${table.controllerName}#if(${superControllerClass}) : ${superControllerClass}()#end + +#else +#if(${superControllerClass}) +public class ${table.controllerName} extends ${superControllerClass} { +#else +public class ${table.controllerName} { +#end + + @Autowired + private ${table.serviceName} ${cfg.serviceObjectName}; + +#if(${cfg.generatorStrategy}) + /** + * 添加$!{table.comment} + */ + @PostMapping("/add") + @ApiOperation(value = "添加${entity}对象",notes = "添加$!{table.comment}",response = ApiResult.class) + public ApiResult add${entity}(@Valid @RequestBody ${entity} ${cfg.entityObjectName}) throws Exception{ + boolean flag = ${cfg.serviceObjectName}.save(${cfg.entityObjectName}); + return ApiResult.result(flag); + } + + /** + * 修改$!{table.comment} + */ + @PostMapping("/update") + @ApiOperation(value = "修改${entity}对象",notes = "修改$!{table.comment}",response = ApiResult.class) + public ApiResult update${entity}(@Valid @RequestBody ${entity} ${cfg.entityObjectName}) throws Exception{ + boolean flag = ${cfg.serviceObjectName}.updateById(${cfg.entityObjectName}); + return ApiResult.result(flag); + } + + /** + * 删除$!{table.comment} + */ + @PostMapping("/delete") + @ApiOperation(value = "删除${entity}对象",notes = "删除$!{table.comment}",response = ApiResult.class) + public ApiResult delete${entity}(@Valid @RequestBody IdParam idParam) throws Exception{ + boolean flag = ${cfg.serviceObjectName}.removeById(idParam.getId()); + return ApiResult.result(flag); + } + + /** + * 获取$!{table.comment} + */ + @PostMapping("/info") + @ApiOperation(value = "获取${entity}对象详情",notes = "查看$!{table.comment}",response = ${entity}QueryVo.class) + public ApiResult<${entity}QueryVo> get${entity}(@Valid @RequestBody IdParam idParam) throws Exception{ + ${entity}QueryVo ${cfg.entityObjectName}QueryVo = ${cfg.serviceObjectName}.get${entity}ById(idParam.getId()); + return ApiResult.ok(${cfg.entityObjectName}QueryVo); + } + + /** + * $!{table.comment}分页列表 + */ + @PostMapping("/getPageList") + @ApiOperation(value = "获取${entity}分页列表",notes = "$!{table.comment}分页列表",response = ${entity}QueryVo.class) + public ApiResult> get${entity}PageList(@Valid @RequestBody(required = false) ${entity}QueryParam ${cfg.entityObjectName}QueryParam) throws Exception{ + Paging<${entity}QueryVo> paging = ${cfg.entityObjectName}Service.get${entity}PageList(${cfg.entityObjectName}QueryParam); + return ApiResult.ok(paging); + } +#end + +} + +#end \ No newline at end of file diff --git a/yshop-api/src/test/resources/templates/entity.java.vm b/yshop-api/src/test/resources/templates/entity.java.vm new file mode 100644 index 00000000..61c3326a --- /dev/null +++ b/yshop-api/src/test/resources/templates/entity.java.vm @@ -0,0 +1,161 @@ +package ${package.Entity}; + +#foreach($pkg in ${table.importPackages}) +import ${pkg}; +#end +#if(${swagger2}) +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +#end +#if(${entityLombokModel}) +import lombok.Data; +import lombok.EqualsAndHashCode; +## import lombok.experimental.Accessors; +#end + +import java.util.Date; + +/** + *

+ * $!{table.comment} + *

+ * + * @author ${author} + * @since ${date} + */ +#if(${entityLombokModel}) +@Data +#if(${superEntityClass}) +@EqualsAndHashCode(callSuper = true) +#else +@EqualsAndHashCode(callSuper = false) +#end +## @Accessors(chain = true) +#end +#if(${table.convert}) +@TableName("${table.name}") +#end +#if(${swagger2}) +@ApiModel(value="${entity}对象", description="$!{table.comment}") +#end +#if(${superEntityClass}) +public class ${entity} extends ${superEntityClass}#if(${activeRecord})<${entity}>#end { +#elseif(${activeRecord}) +public class ${entity} extends Model<${entity}> { +#else +public class ${entity} implements Serializable { +#end + + private static final long serialVersionUID = 1L; +## ---------- BEGIN 字段循环遍历 ---------- +#foreach($field in ${table.fields}) +## 自定义属性,是否是主键 +#set($custom_is_pk=false) + +#if(${field.keyFlag}) +#set($keyPropertyName=${field.propertyName}) +#end +#if("$!field.comment" != "") + #if(${swagger2}) +@ApiModelProperty(value = "${field.comment}") + #else +/** + * ${field.comment} + */ + #end +#end +#if(${field.keyFlag}) +## 主键 +#if(${field.keyIdentityFlag}) +@TableId(value = "${field.name}", type = IdType.AUTO) +#elseif(!$null.isNull(${idType}) && "$!idType" != "") +## 设置主键注解 +@TableId(value = "${field.name}", type = IdType.${idType}) +## 是主键类型 +#set($custom_is_pk=true) +#elseif(${field.convert}) +@TableId("${field.name}") +#end +## 普通字段 +#elseif(${field.fill}) +## ----- 存在字段填充设置 ----- +#if(${field.convert}) + @TableField(value = "${field.name}", fill = FieldFill.${field.fill}) +#else + @TableField(fill = FieldFill.${field.fill}) +#end +#elseif(${field.convert}) + @TableField("${field.name}") +#end +## 乐观锁注解 +#if(${versionFieldName}==${field.name}) + @Version +#end +## 逻辑删除注解 +#if(${logicDeleteFieldName}==${field.name}) + @TableLogic +#end +#if(${custom_is_pk}) + private ${field.propertyType} ${field.propertyName}; +#else +private ${field.propertyType} ${field.propertyName}; +#end +#end +## ---------- END 字段循环遍历 ---------- +#if(!${entityLombokModel}) +#foreach($field in ${table.fields}) +#if(${field.propertyType.equals("boolean")}) +#set($getprefix="is") +#else +#set($getprefix="get") +#end + + public ${field.propertyType} ${getprefix}${field.capitalName}() { + return ${field.propertyName}; + } + +#if(${entityBuilderModel}) + public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { +#else + public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { +#end + this.${field.propertyName} = ${field.propertyName}; +#if(${entityBuilderModel}) + return this; +#end + } +#end +#end + +#if(${entityColumnConstant}) +#foreach($field in ${table.fields}) + public static final String ${field.name.toUpperCase()} = "${field.name}"; + +#end +#end +#if(${activeRecord}) + @Override + protected Serializable pkVal() { +#if(${keyPropertyName}) + return this.${keyPropertyName}; +#else + return null; +#end + } + +#end +#if(!${entityLombokModel}) + @Override + public String toString() { + return "${entity}{" + +#foreach($field in ${table.fields}) +#if($!{foreach.index}==0) + "${field.propertyName}=" + ${field.propertyName} + +#else + ", ${field.propertyName}=" + ${field.propertyName} + +#end +#end + "}"; + } +#end +} diff --git a/yshop-api/src/test/resources/templates/mapper.java.vm b/yshop-api/src/test/resources/templates/mapper.java.vm new file mode 100644 index 00000000..207c1cbb --- /dev/null +++ b/yshop-api/src/test/resources/templates/mapper.java.vm @@ -0,0 +1,46 @@ +package ${package.Mapper}; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import ${superMapperClassPackage}; +import ${package.Entity}.${entity}; +import ${cfg.queryParamPath}; +import ${cfg.queryVoPath}; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; + +/** + *

+ * $!{table.comment} Mapper 接口 + *

+ * + * @author ${author} + * @since ${date} + */ +#if(${kotlin}) +interface ${table.mapperName} : ${superMapperClass}<${entity}> +#else +@Repository +public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { +#if(${cfg.generatorStrategy}) + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + ${entity}QueryVo get${entity}ById(Serializable id); + + /** + * 获取分页对象 + * @param page + * @param ${cfg.entityObjectName}QueryParam + * @return + */ + IPage<${entity}QueryVo> get${entity}PageList(@Param("page") Page page, @Param("param") ${entity}QueryParam ${cfg.entityObjectName}QueryParam); +#end + +} +#end diff --git a/yshop-api/src/test/resources/templates/mapper.xml.vm b/yshop-api/src/test/resources/templates/mapper.xml.vm new file mode 100644 index 00000000..b3829d3f --- /dev/null +++ b/yshop-api/src/test/resources/templates/mapper.xml.vm @@ -0,0 +1,47 @@ + + + + +#if(${enableCache}) + + + +#end +#if(${baseResultMap}) + + +#foreach($field in ${table.fields}) +#if(${field.keyFlag})##生成主键排在第一位 + +#end +#end +#foreach($field in ${table.commonFields})##生成公共字段 + +#end +#foreach($field in ${table.fields}) +#if(!${field.keyFlag})##生成普通字段 + +#end +#end + + +#end + + +#foreach($field in ${table.commonFields}) + ${field.name}, +#end + ${table.fieldNames} + +#if(${cfg.generatorStrategy}) + + + + + +#end + diff --git a/yshop-api/src/test/resources/templates/queryParam.java.vm b/yshop-api/src/test/resources/templates/queryParam.java.vm new file mode 100644 index 00000000..208ffbb3 --- /dev/null +++ b/yshop-api/src/test/resources/templates/queryParam.java.vm @@ -0,0 +1,30 @@ +package co.yixiang.modules.${package.ModuleName}.web.param; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +#if(${cfg.pageListOrder}) +import ${cfg.orderQueryParamPath}; +#else +import ${cfg.queryParamCommonPath}; +#end + +/** + *

+ * $!{table.comment} 查询参数对象 + *

+ * + * @author ${author} + * @date ${date} + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value="${entity}QueryParam对象", description="$!{table.comment}查询参数") +#if(${cfg.pageListOrder}) +public class ${entity}QueryParam extends OrderQueryParam { +#else +public class ${entity}QueryParam extends QueryParam { +#end + private static final long serialVersionUID = 1L; +} diff --git a/yshop-api/src/test/resources/templates/queryVo.java.vm b/yshop-api/src/test/resources/templates/queryVo.java.vm new file mode 100644 index 00000000..25ed1c4f --- /dev/null +++ b/yshop-api/src/test/resources/templates/queryVo.java.vm @@ -0,0 +1,124 @@ +package co.yixiang.modules.${package.ModuleName}.web.vo; + +#if(${swagger2}) +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +#end +#if(${entityLombokModel}) +import lombok.Data; +#end +import java.io.Serializable; + +import java.util.Date; + +/** + *

+ * $!{table.comment} 查询结果对象 + *

+ * + * @author ${author} + * @date ${date} + */ +#if(${entityLombokModel}) +@Data +#end +#if(${table.convert}) +@TableName("${table.name}") +#end +@ApiModel(value="${entity}QueryVo对象", description="$!{table.comment}查询参数") +public class ${entity}QueryVo implements Serializable{ + private static final long serialVersionUID = 1L; +## ---------- BEGIN 字段循环遍历 ---------- +#foreach($field in ${table.fields}) + +#if(${field.keyFlag}) +#set($keyPropertyName=${field.propertyName}) +#end +#if("$!field.comment" != "") + #if(${swagger2}) +@ApiModelProperty(value = "${field.comment}") + #else +/** + * ${field.comment} + */ + #end +#end +#if(${field.keyFlag}) +## 普通字段 +#elseif(${field.fill}) +## ----- 存在字段填充设置 ----- +#if(${field.convert}) + @TableField(value = "${field.name}", fill = FieldFill.${field.fill}) +#else + @TableField(fill = FieldFill.${field.fill}) +#end +#elseif(${field.convert}) + @TableField("${field.name}") +#end +## 乐观锁注解 +#if(${versionFieldName}==${field.name}) + @Version +#end +## 逻辑删除注解 +#if(${logicDeleteFieldName}==${field.name}) + @TableLogic +#end +private ${field.propertyType} ${field.propertyName}; +#end +## ---------- END 字段循环遍历 ---------- +#if(!${entityLombokModel}) +#foreach($field in ${table.fields}) +#if(${field.propertyType.equals("boolean")}) +#set($getprefix="is") +#else +#set($getprefix="get") +#end + + public ${field.propertyType} ${getprefix}${field.capitalName}() { + return ${field.propertyName}; + } + +#if(${entityBuilderModel}) + public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { +#else + public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { +#end + this.${field.propertyName} = ${field.propertyName}; +#if(${entityBuilderModel}) + return this; +#end + } +#end +#end + +#if(${entityColumnConstant}) +#foreach($field in ${table.fields}) + public static final String ${field.name.toUpperCase()} = "${field.name}"; + +#end +#end +#if(${activeRecord}) + @Override + protected Serializable pkVal() { +#if(${keyPropertyName}) + return this.${keyPropertyName}; +#else + return null; +#end + } +#end +#if(!${entityLombokModel}) + @Override + public String toString() { + return "${entity}{" + +#foreach($field in ${table.fields}) +#if($!{foreach.index}==0) + "${field.propertyName}=" + ${field.propertyName} + +#else + ", ${field.propertyName}=" + ${field.propertyName} + +#end +#end + "}"; + } +#end +} \ No newline at end of file diff --git a/yshop-api/src/test/resources/templates/service.java.vm b/yshop-api/src/test/resources/templates/service.java.vm new file mode 100644 index 00000000..9009d5c1 --- /dev/null +++ b/yshop-api/src/test/resources/templates/service.java.vm @@ -0,0 +1,41 @@ +package ${package.Service}; + +import ${package.Entity}.${entity}; +import ${superServiceClassPackage}; +import ${cfg.queryParamPath}; +import ${cfg.queryVoPath}; +import ${cfg.paging}; + +import java.io.Serializable; + +/** + *

+ * $!{table.comment} 服务类 + *

+ * + * @author ${author} + * @since ${date} + */ +#if(${kotlin}) +interface ${table.serviceName} : ${superServiceClass}<${entity}> +#else +public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { +#if(${cfg.generatorStrategy}) + + /** + * 根据ID获取查询对象 + * @param id + * @return + */ + ${entity}QueryVo get${entity}ById(Serializable id) throws Exception; + + /** + * 获取分页对象 + * @param ${cfg.entityObjectName}QueryParam + * @return + */ + Paging<${entity}QueryVo> get${entity}PageList(${entity}QueryParam ${cfg.entityObjectName}QueryParam) throws Exception; +#end + +} +#end diff --git a/yshop-api/src/test/resources/templates/serviceImpl.java.vm b/yshop-api/src/test/resources/templates/serviceImpl.java.vm new file mode 100644 index 00000000..648f327d --- /dev/null +++ b/yshop-api/src/test/resources/templates/serviceImpl.java.vm @@ -0,0 +1,57 @@ +package ${package.ServiceImpl}; + +import ${package.Entity}.${entity}; +import ${package.Mapper}.${table.mapperName}; +import ${package.Service}.${table.serviceName}; +import ${cfg.queryParamPath}; +import ${cfg.queryVoPath}; +import ${superServiceImplClassPackage}; +import ${cfg.paging}; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.beans.factory.annotation.Autowired; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.io.Serializable; + + +/** + *

+ * $!{table.comment} 服务实现类 + *

+ * + * @author ${author} + * @since ${date} + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +#if(${kotlin}) +open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} { + +} +#else +public class ${table.serviceImplName} extends BaseServiceImpl<${table.mapperName}, ${entity}> implements ${table.serviceName} { + + @Autowired + private ${table.mapperName} ${cfg.mapperObjectName}; +#if(${cfg.generatorStrategy}) + + @Override + public ${entity}QueryVo get${entity}ById(Serializable id) throws Exception{ + return ${cfg.mapperObjectName}.get${entity}ById(id); + } + + @Override + public Paging<${entity}QueryVo> get${entity}PageList(${entity}QueryParam ${cfg.entityObjectName}QueryParam) throws Exception{ + Page page = setPageParam(${cfg.entityObjectName}QueryParam,OrderItem.desc("create_time")); + IPage<${entity}QueryVo> iPage = ${cfg.mapperObjectName}.get${entity}PageList(page,${cfg.entityObjectName}QueryParam); + return new Paging(iPage); + } +#end + +} +#end diff --git a/yshop-common/pom.xml b/yshop-common/pom.xml new file mode 100644 index 00000000..57455bf5 --- /dev/null +++ b/yshop-common/pom.xml @@ -0,0 +1,15 @@ + + + + yshop + co.yixiang + 1.0 + + 4.0.0 + + yshop-common + 公共模块 + + \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/annotation/Limit.java b/yshop-common/src/main/java/co/yixiang/annotation/Limit.java new file mode 100644 index 00000000..4c1b64c6 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/annotation/Limit.java @@ -0,0 +1,35 @@ +package co.yixiang.annotation; + +import co.yixiang.aspect.LimitType; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author jacky + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Limit { + + // 资源名称,用于描述接口功能 + String name() default ""; + + // 资源 key + String key() default ""; + + // key prefix + String prefix() default ""; + + // 时间的,单位秒 + int period(); + + // 限制访问次数 + int count(); + + // 限制类型 + LimitType limitType() default LimitType.CUSTOMER; + +} diff --git a/yshop-common/src/main/java/co/yixiang/annotation/Query.java b/yshop-common/src/main/java/co/yixiang/annotation/Query.java new file mode 100644 index 00000000..9fd97f85 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/annotation/Query.java @@ -0,0 +1,70 @@ +package co.yixiang.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author Zheng Jie + * @date 2019-6-4 13:52:30 + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Query { + + /** Dong ZhaoYang 2017/8/7 基本对象的属性名 */ + String propName() default ""; + /** Dong ZhaoYang 2017/8/7 查询方式 */ + Type type() default Type.EQUAL; + + /** + * 连接查询的属性名,如User类中的dept + * @return + */ + String joinName() default ""; + + /** + * 默认左连接 + * @return + */ + Join join() default Join.LEFT; + + /** + * 多字段模糊搜索,仅支持String类型字段,多个用逗号隔开, 如@Query(blurry = "email,username") + * @return + */ + String blurry() default ""; + + enum Type { + /** jie 2019/6/4 相等 */ + EQUAL + /** Dong ZhaoYang 2017/8/7 大于等于 */ + , GREATER_THAN + /** Dong ZhaoYang 2017/8/7 小于等于 */ + , LESS_THAN + /** Dong ZhaoYang 2017/8/7 中模糊查询 */ + , INNER_LIKE + /** Dong ZhaoYang 2017/8/7 左模糊查询 */ + , LEFT_LIKE + /** Dong ZhaoYang 2017/8/7 右模糊查询 */ + , RIGHT_LIKE + /** Dong ZhaoYang 2017/8/7 小于 */ + , LESS_THAN_NQ + //** jie 2019/6/4 包含 */ + , IN + } + + /** + * @author Zheng Jie + * 适用于简单连接查询,复杂的请自定义该注解,或者使用sql查询 + */ + enum Join { + /** jie 2019-6-4 13:18:30 左连接 */ + LEFT + /** jie 2019-6-4 13:18:30 右连接 */ + , RIGHT + } + +} + diff --git a/yshop-common/src/main/java/co/yixiang/aspect/LimitAspect.java b/yshop-common/src/main/java/co/yixiang/aspect/LimitAspect.java new file mode 100644 index 00000000..7a63da90 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/aspect/LimitAspect.java @@ -0,0 +1,81 @@ +package co.yixiang.aspect; + +import com.google.common.collect.ImmutableList; +import co.yixiang.annotation.Limit; +import co.yixiang.exception.BadRequestException; +import co.yixiang.utils.RequestHolder; +import co.yixiang.utils.StringUtils; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.script.DefaultRedisScript; +import org.springframework.data.redis.core.script.RedisScript; +import org.springframework.stereotype.Component; +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; + +@Aspect +@Component +public class LimitAspect { + @Autowired + private RedisTemplate redisTemplate; + private static final Logger logger = LoggerFactory.getLogger(LimitAspect.class); + + + @Pointcut("@annotation(co.yixiang.annotation.Limit)") + public void pointcut() { + } + + @Around("pointcut()") + public Object around(ProceedingJoinPoint joinPoint) throws Throwable { + HttpServletRequest request = RequestHolder.getHttpServletRequest(); + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method signatureMethod = signature.getMethod(); + Limit limit = signatureMethod.getAnnotation(Limit.class); + LimitType limitType = limit.limitType(); + String key = limit.key(); + if (StringUtils.isEmpty(key)) { + switch (limitType) { + case IP: + key = StringUtils.getIP(request); + break; + default: + key = signatureMethod.getName(); + } + } + + ImmutableList keys = ImmutableList.of(StringUtils.join(limit.prefix(), "_", key, "_", request.getRequestURI().replaceAll("/","_"))); + + String luaScript = buildLuaScript(); + RedisScript redisScript = new DefaultRedisScript<>(luaScript, Number.class); + Number count = (Number) redisTemplate.execute(redisScript, keys, limit.count(), limit.period()); + if (null != count && count.intValue() <= limit.count()) { + logger.info("第{}次访问key为 {},描述为 [{}] 的接口", count, keys, limit.name()); + return joinPoint.proceed(); + } else { + throw new BadRequestException("访问次数受限制"); + } + } + + /** + * 限流脚本 + */ + private String buildLuaScript() { + return "local c" + + "\nc = redis.call('get',KEYS[1])" + + "\nif c and tonumber(c) > tonumber(ARGV[1]) then" + + "\nreturn c;" + + "\nend" + + "\nc = redis.call('incr',KEYS[1])" + + "\nif tonumber(c) == 1 then" + + "\nredis.call('expire',KEYS[1],ARGV[2])" + + "\nend" + + "\nreturn c;"; + } +} diff --git a/yshop-common/src/main/java/co/yixiang/aspect/LimitType.java b/yshop-common/src/main/java/co/yixiang/aspect/LimitType.java new file mode 100644 index 00000000..d314cdd3 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/aspect/LimitType.java @@ -0,0 +1,7 @@ +package co.yixiang.aspect; + +public enum LimitType { + CUSTOMER, +// by ip addr + IP; +} diff --git a/yshop-common/src/main/java/co/yixiang/exception/BadRequestException.java b/yshop-common/src/main/java/co/yixiang/exception/BadRequestException.java new file mode 100644 index 00000000..276bb7e3 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/exception/BadRequestException.java @@ -0,0 +1,26 @@ +package co.yixiang.exception; + +import lombok.Getter; +import org.springframework.http.HttpStatus; + +import static org.springframework.http.HttpStatus.BAD_REQUEST; + +/** + * @author Zheng Jie + * @date 2018-11-23 + * 统一异常处理 + */ +@Getter +public class BadRequestException extends RuntimeException{ + + private Integer status = BAD_REQUEST.value(); + + public BadRequestException(String msg){ + super(msg); + } + + public BadRequestException(HttpStatus status,String msg){ + super(msg); + this.status = status.value(); + } +} diff --git a/yshop-common/src/main/java/co/yixiang/exception/EntityExistException.java b/yshop-common/src/main/java/co/yixiang/exception/EntityExistException.java new file mode 100644 index 00000000..e6c941bd --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/exception/EntityExistException.java @@ -0,0 +1,34 @@ +package co.yixiang.exception; + +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.Map; +import java.util.stream.IntStream; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +public class EntityExistException extends RuntimeException { + + public EntityExistException(Class clazz, Object... saveBodyParamsMap) { + super(EntityExistException.generateMessage(clazz.getSimpleName(), toMap(String.class, String.class, saveBodyParamsMap))); + } + + private static String generateMessage(String entity, Map saveBodyParams) { + return StringUtils.capitalize(entity) + + " 已存在 " + + saveBodyParams; + } + + private static Map toMap( + Class keyType, Class valueType, Object... entries) { + if (entries.length % 2 == 1) + throw new IllegalArgumentException("Invalid entries"); + return IntStream.range(0, entries.length / 2).map(i -> i * 2) + .collect(HashMap::new, + (m, i) -> m.put(keyType.cast(entries[i]), valueType.cast(entries[i + 1])), + Map::putAll); + } +} \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/exception/EntityNotFoundException.java b/yshop-common/src/main/java/co/yixiang/exception/EntityNotFoundException.java new file mode 100644 index 00000000..b8d5f657 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/exception/EntityNotFoundException.java @@ -0,0 +1,35 @@ +package co.yixiang.exception; + +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.Map; +import java.util.stream.IntStream; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +public class EntityNotFoundException extends RuntimeException { + + public EntityNotFoundException(Class clazz, Object... searchParamsMap) { + super(EntityNotFoundException.generateMessage(clazz.getSimpleName(), toMap(String.class, String.class, searchParamsMap))); + } + + private static String generateMessage(String entity, Map searchParams) { + return StringUtils.capitalize(entity) + + " 不存在 " + + searchParams; + } + + private static Map toMap( + Class keyType, Class valueType, Object... entries) { + if (entries.length % 2 == 1) + throw new IllegalArgumentException("Invalid entries"); + return IntStream.range(0, entries.length / 2).map(i -> i * 2) + .collect(HashMap::new, + (m, i) -> m.put(keyType.cast(entries[i]), valueType.cast(entries[i + 1])), + Map::putAll); + } + +} \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/exception/ErrorRequestException.java b/yshop-common/src/main/java/co/yixiang/exception/ErrorRequestException.java new file mode 100644 index 00000000..cfb7029f --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/exception/ErrorRequestException.java @@ -0,0 +1,26 @@ +package co.yixiang.exception; + +import lombok.Getter; +import org.springframework.http.HttpStatus; + +import static org.springframework.http.HttpStatus.BAD_REQUEST; + +/** + * @author Zheng Jie + * @date 2018-11-23 + * 统一异常处理 + */ +@Getter +public class ErrorRequestException extends RuntimeException{ + + private Integer status = BAD_REQUEST.value(); + + public ErrorRequestException(String msg){ + super(msg); + } + + public ErrorRequestException(HttpStatus status, String msg){ + super(msg); + this.status = status.value(); + } +} diff --git a/yshop-common/src/main/java/co/yixiang/exception/handler/ApiErr.java b/yshop-common/src/main/java/co/yixiang/exception/handler/ApiErr.java new file mode 100644 index 00000000..8c8bf5d1 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/exception/handler/ApiErr.java @@ -0,0 +1,31 @@ +package co.yixiang.exception.handler; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author hupeng + * @since 2019-10-02 + */ +@Data +class ApiErr { + + private Integer status; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime timestamp; + private String msg; + + private ApiErr() { + timestamp = LocalDateTime.now(); + } + + public ApiErr(Integer status, String message) { + this(); + this.status = status; + this.msg = message; + } +} + + diff --git a/yshop-common/src/main/java/co/yixiang/exception/handler/ApiError.java b/yshop-common/src/main/java/co/yixiang/exception/handler/ApiError.java new file mode 100644 index 00000000..91cc2dcb --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/exception/handler/ApiError.java @@ -0,0 +1,31 @@ +package co.yixiang.exception.handler; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Data +class ApiError { + + private Integer status; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime timestamp; + private String message; + + private ApiError() { + timestamp = LocalDateTime.now(); + } + + public ApiError(Integer status,String message) { + this(); + this.status = status; + this.message = message; + } +} + + diff --git a/yshop-common/src/main/java/co/yixiang/exception/handler/GlobalExceptionHandler.java b/yshop-common/src/main/java/co/yixiang/exception/handler/GlobalExceptionHandler.java new file mode 100644 index 00000000..708f9dd5 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/exception/handler/GlobalExceptionHandler.java @@ -0,0 +1,136 @@ +package co.yixiang.exception.handler; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.exception.EntityNotFoundException; +import co.yixiang.exception.ErrorRequestException; +import co.yixiang.utils.ThrowableUtil; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.exception.EntityExistException; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import static org.springframework.http.HttpStatus.*; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + /** + * 处理所有不可知的异常 + * @param e + * @return + */ + @ExceptionHandler(Throwable.class) + public ResponseEntity handleException(Throwable e){ + // 打印堆栈信息 + log.error(ThrowableUtil.getStackTrace(e)); + ApiError apiError = new ApiError(BAD_REQUEST.value(),e.getMessage()); + return buildResponseEntity(apiError); + } + + /** + * 处理 接口无权访问异常AccessDeniedException + * @param e + * @return + */ + @ExceptionHandler(AccessDeniedException.class) + public ResponseEntity handleAccessDeniedException(AccessDeniedException e){ + // 打印堆栈信息 + log.error(ThrowableUtil.getStackTrace(e)); + ApiError apiError = new ApiError(FORBIDDEN.value(),e.getMessage()); + return buildResponseEntity(apiError); + } + + /** + * 处理自定义异常 + * @param e + * @return + */ + @ExceptionHandler(value = BadRequestException.class) + public ResponseEntity badRequestException(BadRequestException e) { + // 打印堆栈信息 + log.error(ThrowableUtil.getStackTrace(e)); + ApiError apiError = new ApiError(e.getStatus(),e.getMessage()); + return buildResponseEntity(apiError); + } + + /** + * 处理自定义异常 + * @param e + * @return + */ + @ExceptionHandler(value = ErrorRequestException.class) + public ResponseEntity errorRequestException(ErrorRequestException e) { + // 打印堆栈信息 + log.error(ThrowableUtil.getStackTrace(e)); + ApiErr apiError = new ApiErr(e.getStatus(),e.getMessage()); + return buildResponseEntity2(apiError); + } + + /** + * 处理 EntityExist + * @param e + * @return + */ + @ExceptionHandler(value = EntityExistException.class) + public ResponseEntity entityExistException(EntityExistException e) { + // 打印堆栈信息 + log.error(ThrowableUtil.getStackTrace(e)); + ApiError apiError = new ApiError(BAD_REQUEST.value(),e.getMessage()); + return buildResponseEntity(apiError); + } + + /** + * 处理 EntityNotFound + * @param e + * @return + */ + @ExceptionHandler(value = EntityNotFoundException.class) + public ResponseEntity entityNotFoundException(EntityNotFoundException e) { + // 打印堆栈信息 + log.error(ThrowableUtil.getStackTrace(e)); + ApiError apiError = new ApiError(NOT_FOUND.value(),e.getMessage()); + return buildResponseEntity(apiError); + } + + /** + * 处理所有接口数据验证异常 + * @param e + * @returns + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseEntity handleMethodArgumentNotValidException(MethodArgumentNotValidException e){ + // 打印堆栈信息 + log.error(ThrowableUtil.getStackTrace(e)); + String[] str = e.getBindingResult().getAllErrors().get(0).getCodes()[1].split("\\."); + StringBuffer msg = new StringBuffer(str[1]+":"); + msg.append(e.getBindingResult().getAllErrors().get(0).getDefaultMessage()); + ApiError apiError = new ApiError(BAD_REQUEST.value(),msg.toString()); + return buildResponseEntity(apiError); + } + + /** + * 统一返回 + * @param apiError + * @return + */ + private ResponseEntity buildResponseEntity(ApiError apiError) { + return new ResponseEntity(apiError, HttpStatus.valueOf(apiError.getStatus())); + } + + /** + * 统一返回 + * @param apiError + * @return + */ + private ResponseEntity buildResponseEntity2(ApiErr apiError) { + return new ResponseEntity(apiError, HttpStatus.valueOf(apiError.getStatus())); + } +} diff --git a/yshop-common/src/main/java/co/yixiang/mapper/EntityMapper.java b/yshop-common/src/main/java/co/yixiang/mapper/EntityMapper.java new file mode 100644 index 00000000..0f1be70b --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/mapper/EntityMapper.java @@ -0,0 +1,38 @@ +package co.yixiang.mapper; + +import java.util.List; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +public interface EntityMapper { + + /** + * DTO转Entity + * @param dto + * @return + */ + E toEntity(D dto); + + /** + * Entity转DTO + * @param entity + * @return + */ + D toDto(E entity); + + /** + * DTO集合转Entity集合 + * @param dtoList + * @return + */ + List toEntity(List dtoList); + + /** + * Entity集合转DTO集合 + * @param entityList + * @return + */ + List toDto(List entityList); +} diff --git a/yshop-common/src/main/java/co/yixiang/redis/FastJsonRedisSerializer.java b/yshop-common/src/main/java/co/yixiang/redis/FastJsonRedisSerializer.java new file mode 100644 index 00000000..f85d2802 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/redis/FastJsonRedisSerializer.java @@ -0,0 +1,44 @@ +package co.yixiang.redis; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationException; + +import java.nio.charset.Charset; + +/** + * Value 序列化 + * + * @author / + * @param + */ +public class FastJsonRedisSerializer implements RedisSerializer { + + public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); + + private Class clazz; + + public FastJsonRedisSerializer(Class clazz) { + super(); + this.clazz = clazz; + } + + @Override + public byte[] serialize(T t) throws SerializationException { + if (t == null) { + return new byte[0]; + } + return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET); + } + + @Override + public T deserialize(byte[] bytes) throws SerializationException { + if (bytes == null || bytes.length <= 0) { + return null; + } + String str = new String(bytes, DEFAULT_CHARSET); + return (T) JSON.parseObject(str, clazz); + } + +} diff --git a/yshop-common/src/main/java/co/yixiang/redis/RedisConfig.java b/yshop-common/src/main/java/co/yixiang/redis/RedisConfig.java new file mode 100644 index 00000000..88a60b00 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/redis/RedisConfig.java @@ -0,0 +1,126 @@ +package co.yixiang.redis; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.parser.ParserConfig; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.data.redis.RedisProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cache.Cache; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cache.interceptor.CacheErrorHandler; +import org.springframework.cache.interceptor.KeyGenerator; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.RedisSerializationContext; +import java.time.Duration; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@Slf4j +@Configuration +@EnableCaching +// 自动配置 +@ConditionalOnClass(RedisOperations.class) +@EnableConfigurationProperties(RedisProperties.class) +public class RedisConfig extends CachingConfigurerSupport { + + /** + * 设置 redis 数据默认过期时间,默认1天 + * 设置@cacheable 序列化方式 + * @return + */ + @Bean + public RedisCacheConfiguration redisCacheConfiguration(){ + FastJsonRedisSerializer fastJsonRedisSerializer = new FastJsonRedisSerializer<>(Object.class); + RedisCacheConfiguration configuration = RedisCacheConfiguration.defaultCacheConfig(); + configuration = configuration.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(fastJsonRedisSerializer)).entryTtl(Duration.ofDays(1)); + return configuration; + } + + @Bean(name = "redisTemplate") + @ConditionalOnMissingBean(name = "redisTemplate") + public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) { + RedisTemplate template = new RedisTemplate<>(); + //序列化 + FastJsonRedisSerializer fastJsonRedisSerializer = new FastJsonRedisSerializer(Object.class); + // value值的序列化采用fastJsonRedisSerializer + template.setValueSerializer(fastJsonRedisSerializer); + template.setHashValueSerializer(fastJsonRedisSerializer); + + // 全局开启AutoType,不建议使用 + // ParserConfig.getGlobalInstance().setAutoTypeSupport(true); + // 建议使用这种方式,小范围指定白名单 + ParserConfig.getGlobalInstance().addAccept("co.yixiang.modules.order.entity"); + ParserConfig.getGlobalInstance().addAccept("co.yixiang.modules.order.web.dto"); + ParserConfig.getGlobalInstance().addAccept("co.yixiang.domain"); + ParserConfig.getGlobalInstance().addAccept("co.yixiang.modules.system.service.dto"); + ParserConfig.getGlobalInstance().addAccept("co.yixiang.service.dto"); + ParserConfig.getGlobalInstance().addAccept("co.yixiang.modules.system.domain"); + ParserConfig.getGlobalInstance().addAccept("co.yixiang.modules.quartz.domain"); + ParserConfig.getGlobalInstance().addAccept("co.yixiang.modules.monitor.domain"); + ParserConfig.getGlobalInstance().addAccept("co.yixiang.modules.security.security"); + // key的序列化采用StringRedisSerializer + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.setConnectionFactory(redisConnectionFactory); + return template; + } + + /** + * 自定义缓存key生成策略,默认将使用该策略 + * 使用方法 @Cacheable + * @return + */ + @Bean + @Override + public KeyGenerator keyGenerator() { + return (target, method, params) -> { + StringBuilder sb = new StringBuilder(); + sb.append(target.getClass().getName()); + sb.append(method.getName()); + for (Object obj : params) { + sb.append(JSON.toJSONString(obj).hashCode()); + } + return sb.toString(); + }; + } + + @Bean + @Override + public CacheErrorHandler errorHandler() { + // 异常处理,当Redis发生异常时,打印日志,但是程序正常走 + log.info("初始化 -> [{}]", "Redis CacheErrorHandler"); + CacheErrorHandler cacheErrorHandler = new CacheErrorHandler() { + @Override + public void handleCacheGetError(RuntimeException e, Cache cache, Object key) { + log.error("Redis occur handleCacheGetError:key -> [{}]", key, e); + } + + @Override + public void handleCachePutError(RuntimeException e, Cache cache, Object key, Object value) { + log.error("Redis occur handleCachePutError:key -> [{}];value -> [{}]", key, value, e); + } + + @Override + public void handleCacheEvictError(RuntimeException e, Cache cache, Object key) { + log.error("Redis occur handleCacheEvictError:key -> [{}]", key, e); + } + + @Override + public void handleCacheClearError(RuntimeException e, Cache cache) { + log.error("Redis occur handleCacheClearError:", e); + } + }; + return cacheErrorHandler; + } + +} diff --git a/yshop-common/src/main/java/co/yixiang/redis/StringRedisSerializer.java b/yshop-common/src/main/java/co/yixiang/redis/StringRedisSerializer.java new file mode 100644 index 00000000..1c80ffc7 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/redis/StringRedisSerializer.java @@ -0,0 +1,45 @@ +package co.yixiang.redis; + +import cn.hutool.core.lang.Assert; +import com.alibaba.fastjson.JSON; +import org.springframework.data.redis.serializer.RedisSerializer; + +import java.nio.charset.Charset; + +/** + * 重写序列化器 + * + * @author / + */ +public class StringRedisSerializer implements RedisSerializer { + + private final Charset charset; + + private final String target = "\""; + + private final String replacement = ""; + + public StringRedisSerializer() { + this(Charset.forName("UTF8")); + } + + public StringRedisSerializer(Charset charset) { + Assert.notNull(charset, "Charset must not be null!"); + this.charset = charset; + } + + @Override + public String deserialize(byte[] bytes) { + return (bytes == null ? null : new String(bytes, charset)); + } + + @Override + public byte[] serialize(Object object) { + String string = JSON.toJSONString(object); + if (string == null) { + return null; + } + string = string.replace(target, replacement); + return string.getBytes(charset); + } +} \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/swagger2/SwaggerConfig.java b/yshop-common/src/main/java/co/yixiang/swagger2/SwaggerConfig.java new file mode 100644 index 00000000..a3337fe4 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/swagger2/SwaggerConfig.java @@ -0,0 +1,62 @@ +package co.yixiang.swagger2; + +import com.google.common.base.Predicates; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; +import java.util.ArrayList; +import java.util.List; + +/** + * api页面 /swagger-ui.html + * @author Zheng Jie + * @date 2018-11-23 + */ + +//@Configuration +//@EnableSwagger2 +public class SwaggerConfig { + + @Value("${jwt.header}") + private String tokenHeader; + + @Value("${swagger.enabled}") + private Boolean enabled; + + @Bean + public Docket createRestApi() { + ParameterBuilder ticketPar = new ParameterBuilder(); + List pars = new ArrayList(); + ticketPar.name(tokenHeader).description("token") + .modelRef(new ModelRef("string")) + .parameterType("header") + .defaultValue("Bearer ") + .required(true) + .build(); + pars.add(ticketPar.build()); + return new Docket(DocumentationType.SWAGGER_2) + .enable(enabled) + .apiInfo(apiInfo()) + .select() + .paths(Predicates.not(PathSelectors.regex("/error.*"))) + .build() + .globalOperationParameters(pars); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("eladmin 接口文档") + .version("2.1") + .build(); + } + +} diff --git a/yshop-common/src/main/java/co/yixiang/swagger2/SwaggerDataConfig.java b/yshop-common/src/main/java/co/yixiang/swagger2/SwaggerDataConfig.java new file mode 100644 index 00000000..408d06ce --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/swagger2/SwaggerDataConfig.java @@ -0,0 +1 @@ +package co.yixiang.swagger2; import com.fasterxml.classmate.TypeResolver; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.data.domain.Pageable; import springfox.documentation.schema.AlternateTypeRule; import springfox.documentation.schema.AlternateTypeRuleConvention; import java.util.List; import static com.google.common.collect.Lists.newArrayList; import static springfox.documentation.schema.AlternateTypeRules.newRule; /** * 将Pageable转换展示在swagger中 */ //@Configuration public class SwaggerDataConfig { @Bean public AlternateTypeRuleConvention pageableConvention(final TypeResolver resolver) { return new AlternateTypeRuleConvention() { @Override public int getOrder() { return Ordered.HIGHEST_PRECEDENCE; } @Override public List rules() { return newArrayList(newRule(resolver.resolve(Pageable.class), resolver.resolve(Page.class))); } }; } @ApiModel static class Page { @ApiModelProperty("页码 (0..N)") private Integer page; @ApiModelProperty("每页显示的数目") private Integer size; @ApiModelProperty("以下列格式排序标准:property[,asc | desc]。 默认排序顺序为升序。 支持多种排序条件:如:id,asc") private List sort; public Integer getPage() { return page; } public void setPage(Integer page) { this.page = page; } public Integer getSize() { return size; } public void setSize(Integer size) { this.size = size; } public List getSort() { return sort; } public void setSort(List sort) { this.sort = sort; } } } \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/utils/CateDTO.java b/yshop-common/src/main/java/co/yixiang/utils/CateDTO.java new file mode 100644 index 00000000..6e23fbb3 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/CateDTO.java @@ -0,0 +1,43 @@ +package co.yixiang.utils; + + + +import lombok.Data; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + *

+ * 商城商品分类 + *

+ * + * @author hupeng + * @since 2019-09-08 + */ +@Data +public class CateDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + private Long id; + /** + * 上级分类编号 + */ + private Long pid; + + /** + * 商品分类名称 + */ + private String cateName; + + /** + * 缩略图url + */ + private String pic; + + private List children = new ArrayList<>(); + +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/ElAdminConstant.java b/yshop-common/src/main/java/co/yixiang/utils/ElAdminConstant.java new file mode 100644 index 00000000..c4d68b06 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/ElAdminConstant.java @@ -0,0 +1,25 @@ +package co.yixiang.utils; + +/** + * 常用静态常量 + * @author Zheng Jie + * @date 2018-12-26 + */ +public class ElAdminConstant { + + public static final String RESET_PASS = "重置密码"; + + public static final String RESET_MAIL = "重置邮箱"; + + /** + * 用于IP定位转换 + */ + public static final String REGION = "内网IP|内网IP"; + + /** + * 常用接口 + */ + public static class Url{ + public static final String SM_MS_URL = "https://sm.ms/api/upload"; + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/EncryptUtils.java b/yshop-common/src/main/java/co/yixiang/utils/EncryptUtils.java new file mode 100644 index 00000000..198f0b23 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/EncryptUtils.java @@ -0,0 +1,96 @@ +package co.yixiang.utils; + +import org.springframework.util.DigestUtils; +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.DESKeySpec; +import javax.crypto.spec.IvParameterSpec; + +/** + * 加密 + * @author Zheng Jie + * @date 2018-11-23 + */ +public class EncryptUtils { + + private static String strKey = "Passw0rd", strParam = "Passw0rd"; + + /** + * 对称加密 + * @param source + * @return + * @throws Exception + */ + public static String desEncrypt(String source) throws Exception { + if (source == null || source.length() == 0){ + return null; + } + Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); + DESKeySpec desKeySpec = new DESKeySpec(strKey.getBytes("UTF-8")); + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); + SecretKey secretKey = keyFactory.generateSecret(desKeySpec); + IvParameterSpec iv = new IvParameterSpec(strParam.getBytes("UTF-8")); + cipher.init(Cipher.ENCRYPT_MODE, secretKey, iv); + return byte2hex( + cipher.doFinal(source.getBytes("UTF-8"))).toUpperCase(); + } + + public static String byte2hex(byte[] inStr) { + String stmp; + StringBuffer out = new StringBuffer(inStr.length * 2); + for (int n = 0; n < inStr.length; n++) { + stmp = Integer.toHexString(inStr[n] & 0xFF); + if (stmp.length() == 1) { + // 如果是0至F的单位字符串,则添加0 + out.append("0" + stmp); + } else { + out.append(stmp); + } + } + return out.toString(); + } + + + public static byte[] hex2byte(byte[] b) { + if ((b.length % 2) != 0){ + throw new IllegalArgumentException("长度不是偶数"); + } + byte[] b2 = new byte[b.length / 2]; + for (int n = 0; n < b.length; n += 2) { + String item = new String(b, n, 2); + b2[n / 2] = (byte) Integer.parseInt(item, 16); + } + return b2; + } + + /** + * 对称解密 + * @param source + * @return + * @throws Exception + */ + public static String desDecrypt(String source) throws Exception { + if (source == null || source.length() == 0){ + return null; + } + byte[] src = hex2byte(source.getBytes()); + Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); + DESKeySpec desKeySpec = new DESKeySpec(strKey.getBytes("UTF-8")); + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); + SecretKey secretKey = keyFactory.generateSecret(desKeySpec); + IvParameterSpec iv = new IvParameterSpec(strParam.getBytes("UTF-8")); + cipher.init(Cipher.DECRYPT_MODE, secretKey, iv); + byte[] retByte = cipher.doFinal(src); + return new String(retByte); + } + + /** + * 密码加密 + * @param password + * @return + */ + public static String encryptPassword(String password){ + return DigestUtils.md5DigestAsHex(password.getBytes()); + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/FileUtil.java b/yshop-common/src/main/java/co/yixiang/utils/FileUtil.java new file mode 100644 index 00000000..b7ff4038 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/FileUtil.java @@ -0,0 +1,244 @@ +package co.yixiang.utils; + +import cn.hutool.core.codec.Base64; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.poi.excel.BigExcelWriter; +import cn.hutool.poi.excel.ExcelUtil; +import co.yixiang.exception.BadRequestException; +import org.springframework.web.multipart.MultipartFile; +import javax.activation.MimetypesFileTypeMap; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * File工具类,扩展 hutool 工具包 + * @author Zheng Jie + * @date 2018-12-27 + */ +public class FileUtil extends cn.hutool.core.io.FileUtil { + + /** + * 定义GB的计算常量 + */ + private static final int GB = 1024 * 1024 * 1024; + /** + * 定义MB的计算常量 + */ + private static final int MB = 1024 * 1024; + /** + * 定义KB的计算常量 + */ + private static final int KB = 1024; + + /** + * 格式化小数 + */ + private static final DecimalFormat DF = new DecimalFormat("0.00"); + + /** + * MultipartFile转File + * @param multipartFile + * @return + */ + public static File toFile(MultipartFile multipartFile){ + // 获取文件名 + String fileName = multipartFile.getOriginalFilename(); + // 获取文件后缀 + String prefix="."+getExtensionName(fileName); + File file = null; + try { + // 用uuid作为文件名,防止生成的临时文件重复 + file = File.createTempFile(IdUtil.simpleUUID(), prefix); + // MultipartFile to File + multipartFile.transferTo(file); + } catch (IOException e) { + e.printStackTrace(); + } + return file; + } + + /** + * 删除 + * @param files + */ + public static void deleteFile(File... files) { + for (File file : files) { + if (file.exists()) { + file.delete(); + } + } + } + + /** + * 获取文件扩展名 + * @param filename + * @return + */ + public static String getExtensionName(String filename) { + if ((filename != null) && (filename.length() > 0)) { + int dot = filename.lastIndexOf('.'); + if ((dot >-1) && (dot < (filename.length() - 1))) { + return filename.substring(dot + 1); + } + } + return filename; + } + + /** + * Java文件操作 获取不带扩展名的文件名 + * @param filename + * @return + */ + public static String getFileNameNoEx(String filename) { + if ((filename != null) && (filename.length() > 0)) { + int dot = filename.lastIndexOf('.'); + if ((dot >-1) && (dot < (filename.length()))) { + return filename.substring(0, dot); + } + } + return filename; + } + + /** + * 文件大小转换 + * @param size + * @return + */ + public static String getSize(long size){ + String resultSize = ""; + if (size / GB >= 1) { + //如果当前Byte的值大于等于1GB + resultSize = DF.format(size / (float) GB) + "GB "; + } else if (size / MB >= 1) { + //如果当前Byte的值大于等于1MB + resultSize = DF.format(size / (float) MB) + "MB "; + } else if (size / KB >= 1) { + //如果当前Byte的值大于等于1KB + resultSize = DF.format(size / (float) KB) + "KB "; + } else { + resultSize = size + "B "; + } + return resultSize; + } + + /** + * inputStream 转 File + * @param ins + * @param name + * @return + * @throws Exception + */ + public static File inputStreamToFile(InputStream ins, String name) throws Exception{ + File file = new File(System.getProperty("java.io.tmpdir") + name); + if (file.exists()) { + return file; + } + OutputStream os = new FileOutputStream(file); + int bytesRead = 0; + byte[] buffer = new byte[8192]; + while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) { + os.write(buffer, 0, bytesRead); + } + os.close(); + ins.close(); + return file; + } + + /** + * 将文件名解析成文件的上传路径 + * + * @param file + * @param filePath + * @return 上传到服务器的文件名 + */ + public static File upload(MultipartFile file, String filePath) { + Date date = new Date(); + SimpleDateFormat format = new SimpleDateFormat("yyyyMMddhhmmssS"); + String name = getFileNameNoEx(file.getOriginalFilename()); + String suffix = getExtensionName(file.getOriginalFilename()); + String nowStr = "-" + format.format(date); + try { + String fileName = name + nowStr + "." + suffix; + String path = filePath + fileName; + File dest = new File(path); + // 检测是否存在目录 + if (!dest.getParentFile().exists()) { + dest.getParentFile().mkdirs();// 新建文件夹 + } + String d = dest.getPath(); + file.transferTo(dest);// 文件写入 + return dest; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + public static String fileToBase64(File file) throws Exception { + FileInputStream inputFile = new FileInputStream(file); + String base64 =null; + byte[] buffer = new byte[(int)file.length()]; + inputFile.read(buffer); + inputFile.close(); + base64=new Base64().encode(buffer); + String encoded = base64.replaceAll("[\\s*\t\n\r]", ""); + return encoded; + } + + /** + * 导出excel + * @param list + * @return + * @throws Exception + */ + public static void downloadExcel(List> list, HttpServletResponse response) throws IOException { + String tempPath =System.getProperty("java.io.tmpdir") + IdUtil.fastSimpleUUID() + ".xlsx"; + File file = new File(tempPath); + BigExcelWriter writer= ExcelUtil.getBigWriter(file); + // 一次性写出内容,使用默认样式,强制输出标题 + writer.write(list, true); + //response为HttpServletResponse对象 + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"); + //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码 + response.setHeader("Content-Disposition","attachment;filename=file.xlsx"); + ServletOutputStream out=response.getOutputStream(); + // 终止后删除临时文件 + file.deleteOnExit(); + writer.flush(out, true); + //此处记得关闭输出Servlet流 + IoUtil.close(out); + } + + public static String getFileType(String type) { + String documents = "txt doc pdf ppt pps xlsx xls"; + String music = "mp3 wav wma mpa ram ra aac aif m4a"; + String video = "avi mpg mpe mpeg asf wmv mov qt rm mp4 flv m4v webm ogv ogg"; + String image = "bmp dib pcp dif wmf gif jpg tif eps psd cdr iff tga pcd mpt png jpeg"; + if(image.indexOf(type) != -1){ + return "图片"; + } else if(documents.indexOf(type) != -1){ + return "文档"; + } else if(music.indexOf(type) != -1){ + return "音乐"; + } else if(video.indexOf(type) != -1){ + return "视频"; + } else return "其他"; + } + + public static String getFileTypeByMimeType(String type) { + String mimeType = new MimetypesFileTypeMap().getContentType("." + type); + return mimeType.split("\\/")[0]; + } + public static void checkSize(long maxSize, long size) { + if(size > (maxSize * 1024 * 1024)){ + throw new BadRequestException("文件超出规定大小"); + } + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/OrderUtil.java b/yshop-common/src/main/java/co/yixiang/utils/OrderUtil.java new file mode 100644 index 00000000..049ec9a8 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/OrderUtil.java @@ -0,0 +1,157 @@ +package co.yixiang.utils; + +import cn.hutool.core.date.DateUtil; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @ClassName OrderUtil + * @Author hupeng <610796224@qq.com> + * @Date 2019/9/13 + **/ +public class OrderUtil { + + /** + * 时间戳订单号 + * @return + */ + public static String orderSn(){ + Date date = DateUtil.date(); + return DateUtil.format(date,"yyyyMMddHHmmssSSS"); + } + + /* + * 将时间戳转换为时间 + */ + public static String stampToDate(String s){ + String res; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + long lt = new Long(s) * 1000; + Date date = new Date(lt); + res = simpleDateFormat.format(date); + return res; + } + + + /** + * 获取精确到秒的时间戳 + * @return + **/ + public static int getSecondTimestampTwo(){ + String timestamp = String.valueOf(new Date().getTime()/1000); + return Integer.valueOf(timestamp); + } + + /** + * 获取订单状态名称 + * @param paid + * @param status + * @param shipping_type + * @param refund_status + * @return + */ + public static String orderStatusStr(int paid,int status, + int shipping_type,int refund_status){ + String statusName = ""; + if(paid == 0 && status == 0){ + statusName = "未支付"; + }else if(paid == 1 && status == 0 && shipping_type == 1 && refund_status == 0){ + statusName = "未发货"; + }else if(paid == 1 && status == 0 && shipping_type == 2 && refund_status == 0){ + statusName = "未核销"; + }else if(paid == 1 && status == 1 && shipping_type ==1 && refund_status == 0){ + statusName = "待收货"; + }else if(paid == 1 && status == 1 && shipping_type == 2 && refund_status == 0){ + statusName = "未核销"; + }else if(paid == 1 && status == 2 && refund_status == 0){ + statusName = "待评价"; + }else if(paid == 1 && status == 3 && refund_status == 0){ + statusName = "已完成"; + }else if(paid == 1 && refund_status == 1){ + statusName = "退款中"; + }else if(paid == 1 && refund_status == 2){ + statusName = "已退款"; + } + + return statusName; + } + + + /** + * 获取状态数值 + * @param paid + * @param status + * @param refund_status + * @return + */ + public static int orderStatus(int paid,int status,int refund_status){ + //todo 1-已付款 2-未发货 3-退款中 4-待收货 5-待评价 6-已完成 7-已退款 + int _status = 0; + + if(paid == 0 && status == 0 && refund_status == 0){ + _status = 1; + }else if(paid == 1 && status == 0 && refund_status == 0){ + _status = 2; + }else if(paid == 1 && refund_status == 1){ + _status = 3; + }else if(paid == 1 && status == 1 && refund_status == 0){ + _status = 4; + }else if(paid == 1 && status == 2 && refund_status == 0){ + _status = 5; + }else if(paid == 1 && status == 3 && refund_status == 0){ + _status = 6; + }else if(paid == 1 && refund_status == 2){ + _status =7 ; + } + + return _status; + + } + + + /** + * 支付方式 + * @param pay_type + * @param paid + * @return + */ + public static String payTypeName(String pay_type, int paid){ + String payTypeName = ""; + if(paid == 1 ){ + switch(pay_type){ + case "weixin": + payTypeName = "微信支付"; + break; + case "yue": + payTypeName = "余额支付"; + break; + case "offline": + payTypeName = "线下支付"; + break; + default: + payTypeName = "其他支付"; + break; + } + }else{ + switch(pay_type){ + default: + payTypeName = "未支付"; + break; + case "offline": + payTypeName = "线下支付"; + break; + } + } + + + return payTypeName; + } + + //todo 订单类型 + public static String orderType(int pink_id){ + return "普通订单"; + } + + +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/PageUtil.java b/yshop-common/src/main/java/co/yixiang/utils/PageUtil.java new file mode 100644 index 00000000..e188799b --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/PageUtil.java @@ -0,0 +1,58 @@ +package co.yixiang.utils; + +import org.springframework.data.domain.Page; +import java.util.*; + +/** + * 分页工具 + * @author Zheng Jie + * @date 2018-12-10 + */ +public class PageUtil extends cn.hutool.core.util.PageUtil { + + /** + * List 分页 + * @param page + * @param size + * @param list + * @return + */ + public static List toPage(int page, int size , List list) { + int fromIndex = page * size; + int toIndex = page * size + size; + + if(fromIndex > list.size()){ + return new ArrayList(); + } else if(toIndex >= list.size()) { + return list.subList(fromIndex,list.size()); + } else { + return list.subList(fromIndex,toIndex); + } + } + + /** + * Page 数据处理,预防redis反序列化报错 + * @param page + * @return + */ + public static Map toPage(Page page) { + Map map = new LinkedHashMap<>(2); + map.put("content",page.getContent()); + map.put("totalElements",page.getTotalElements()); + return map; + } + + /** + * @param object + * @param totalElements + * @return + */ + public static Map toPage(Object object, Object totalElements) { + Map map = new LinkedHashMap<>(2); + map.put("content",object); + map.put("totalElements",totalElements); + + return map; + } + +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/QueryHelp.java b/yshop-common/src/main/java/co/yixiang/utils/QueryHelp.java new file mode 100644 index 00000000..1b86b5c8 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/QueryHelp.java @@ -0,0 +1,155 @@ +package co.yixiang.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.annotation.Query; +import javax.persistence.criteria.*; +import java.lang.reflect.Field; +import java.util.*; + +/** + * @author Zheng Jie + * @date 2019-6-4 14:59:48 + */ +@Slf4j +public class QueryHelp { + + /** + * @描述 : 转换为Predicate + * @作者 : Dong ZhaoYang + * @日期 : 2017/8/7 + * @时间 : 17:25 + */ + @SuppressWarnings("unchecked") + public static Predicate getPredicate(Root root, Q query, CriteriaBuilder cb) { + List list = new ArrayList<>(); + + if(query == null){ + return cb.and(list.toArray(new Predicate[list.size()])); + } + try { + List fields = getAllFields(query.getClass(), new ArrayList<>()); + for (Field field : fields) { + boolean accessible = field.isAccessible(); + field.setAccessible(true); + Query q = field.getAnnotation(Query.class); + if (q != null) { + String propName = q.propName(); + String joinName = q.joinName(); + String blurry = q.blurry(); + String attributeName = isBlank(propName) ? field.getName() : propName; + Class fieldType = field.getType(); + Object val = field.get(query); + if (ObjectUtil.isNull(val) || "".equals(val)) { + continue; + } + Join join = null; + // 模糊多字段 + if (ObjectUtil.isNotEmpty(blurry)) { + String[] blurrys = blurry.split(","); + List orPredicate = new ArrayList<>(); + for (String s : blurrys) { + orPredicate.add(cb.like(root.get(s) + .as(String.class), "%" + val.toString() + "%")); + } + Predicate[] p = new Predicate[orPredicate.size()]; + list.add(cb.or(orPredicate.toArray(p))); + continue; + } + if (ObjectUtil.isNotEmpty(joinName)) { + String[] joinNames = joinName.split(">"); + for (String name : joinNames) { + switch (q.join()) { + case LEFT: + if(ObjectUtil.isNotEmpty(join)){ + join = join.join(name, JoinType.LEFT); + } else { + join = root.join(name, JoinType.LEFT); + } + break; + case RIGHT: + if(ObjectUtil.isNotEmpty(join)){ + join = join.join(name, JoinType.RIGHT); + } else { + join = root.join(name, JoinType.RIGHT); + } + break; + } + } + } + switch (q.type()) { + case EQUAL: + list.add(cb.equal(getExpression(attributeName,join,root) + .as((Class) fieldType),val)); + break; + case GREATER_THAN: + list.add(cb.greaterThanOrEqualTo(getExpression(attributeName,join,root) + .as((Class) fieldType), (Comparable) val)); + break; + case LESS_THAN: + list.add(cb.lessThanOrEqualTo(getExpression(attributeName,join,root) + .as((Class) fieldType), (Comparable) val)); + break; + case LESS_THAN_NQ: + list.add(cb.lessThan(getExpression(attributeName,join,root) + .as((Class) fieldType), (Comparable) val)); + break; + case INNER_LIKE: + list.add(cb.like(getExpression(attributeName,join,root) + .as(String.class), "%" + val.toString() + "%")); + break; + case LEFT_LIKE: + list.add(cb.like(getExpression(attributeName,join,root) + .as(String.class), "%" + val.toString())); + break; + case RIGHT_LIKE: + list.add(cb.like(getExpression(attributeName,join,root) + .as(String.class), val.toString() + "%")); + case IN: + if (CollUtil.isNotEmpty((Collection)val)) { + list.add(getExpression(attributeName,join,root).in((Collection) val)); + } + break; + } + } + field.setAccessible(accessible); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + } + return cb.and(list.toArray(new Predicate[list.size()])); + } + + @SuppressWarnings("unchecked") + private static Expression getExpression(String attributeName, Join join, Root root) { + if (ObjectUtil.isNotEmpty(join)) { + return join.get(attributeName); + } else { + return root.get(attributeName); + } + } + + @SuppressWarnings("unchecked") + public static boolean isBlank(final CharSequence cs) { + int strLen; + if (cs == null || (strLen = cs.length()) == 0) { + return true; + } + for (int i = 0; i < strLen; i++) { + if (Character.isWhitespace(cs.charAt(i)) == false) { + return false; + } + } + return true; + } + + @SuppressWarnings("unchecked") + private static List getAllFields(Class clazz, List fields) { + if (clazz != null) { + fields.addAll(Arrays.asList(clazz.getDeclaredFields())); + getAllFields(clazz.getSuperclass(), fields); + } + return fields; + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/RequestHolder.java b/yshop-common/src/main/java/co/yixiang/utils/RequestHolder.java new file mode 100644 index 00000000..fcf9259e --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/RequestHolder.java @@ -0,0 +1,17 @@ +package co.yixiang.utils; + +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import javax.servlet.http.HttpServletRequest; + +/** + * 获取 HttpServletRequest + * @author Zheng Jie + * @date 2018-11-24 + */ +public class RequestHolder { + + public static HttpServletRequest getHttpServletRequest() { + return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/SecurityUtils.java b/yshop-common/src/main/java/co/yixiang/utils/SecurityUtils.java new file mode 100644 index 00000000..95a50591 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/SecurityUtils.java @@ -0,0 +1,44 @@ +package co.yixiang.utils; + +import cn.hutool.json.JSONObject; +import co.yixiang.exception.BadRequestException; +import org.springframework.http.HttpStatus; +import org.springframework.security.core.userdetails.UserDetails; + +/** + * 获取当前登录的用户 + * @author Zheng Jie + * @date 2019-01-17 + */ +public class SecurityUtils { + + public static UserDetails getUserDetails() { + UserDetails userDetails = null; + try { + userDetails = (UserDetails) org.springframework.security.core.context.SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + } catch (Exception e) { + throw new BadRequestException(HttpStatus.UNAUTHORIZED, "登录状态过期"); + } + return userDetails; + } + + /** + * 获取系统用户名称 + * @return 系统用户名称 + */ + public static String getUsername(){ + Object obj = getUserDetails(); + JSONObject json = new JSONObject(obj); + return json.get("username", String.class); + } + + /** + * 获取系统用户id + * @return 系统用户id + */ + public static Long getUserId(){ + Object obj = getUserDetails(); + JSONObject json = new JSONObject(obj); + return json.get("id", Long.class); + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/SpringContextHolder.java b/yshop-common/src/main/java/co/yixiang/utils/SpringContextHolder.java new file mode 100644 index 00000000..e994804f --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/SpringContextHolder.java @@ -0,0 +1,73 @@ +package co.yixiang.utils; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; + +/** + * @author + * @date 2019-01-07 + */ +@Slf4j +public class SpringContextHolder implements ApplicationContextAware, DisposableBean { + + private static ApplicationContext applicationContext = null; + + /** + * 取得存储在静态变量中的ApplicationContext. + */ + public static ApplicationContext getApplicationContext() { + assertContextInjected(); + return applicationContext; + } + + /** + * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. + */ + public static T getBean(String name) { + assertContextInjected(); + return (T) applicationContext.getBean(name); + } + + /** + * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. + */ + public static T getBean(Class requiredType) { + assertContextInjected(); + return applicationContext.getBean(requiredType); + } + + /** + * 检查ApplicationContext不为空. + */ + private static void assertContextInjected() { + if (applicationContext == null) { + throw new IllegalStateException("applicaitonContext属性未注入, 请在applicationContext" + + ".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder."); + } + } + + /** + * 清除SpringContextHolder中的ApplicationContext为Null. + */ + public static void clearHolder() { + log.debug("清除SpringContextHolder中的ApplicationContext:" + + applicationContext); + applicationContext = null; + } + + @Override + public void destroy() throws Exception { + SpringContextHolder.clearHolder(); + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + if (SpringContextHolder.applicationContext != null) { + log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); + } + SpringContextHolder.applicationContext = applicationContext; + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/StringUtils.java b/yshop-common/src/main/java/co/yixiang/utils/StringUtils.java new file mode 100644 index 00000000..92563dd1 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/StringUtils.java @@ -0,0 +1,200 @@ +package co.yixiang.utils; + +import cn.hutool.core.io.resource.ClassPathResource; +import org.lionsoul.ip2region.DataBlock; +import org.lionsoul.ip2region.DbConfig; +import org.lionsoul.ip2region.DbSearcher; + +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.lang.reflect.Method; +import java.util.Calendar; +import java.util.Date; + +/** + * 字符串工具类, 继承org.apache.commons.lang3.StringUtils类 + */ +public class StringUtils extends org.apache.commons.lang3.StringUtils { + + private static final char SEPARATOR = '_'; + private static final String CHARSET_NAME = "UTF-8"; + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inString(String str, String... strs) { + if (str != null) { + for (String s : strs) { + if (str.equals(trim(s))) { + return true; + } + } + } + return false; + } + + /** + * 驼峰命名法工具 + * + * @return toCamelCase(" hello_world ") == "helloWorld" + * toCapitalizeCamelCase("hello_world") == "HelloWorld" + * toUnderScoreCase("helloWorld") = "hello_world" + */ + public static String toCamelCase(String s) { + if (s == null) { + return null; + } + + s = s.toLowerCase(); + + StringBuilder sb = new StringBuilder(s.length()); + boolean upperCase = false; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + + if (c == SEPARATOR) { + upperCase = true; + } else if (upperCase) { + sb.append(Character.toUpperCase(c)); + upperCase = false; + } else { + sb.append(c); + } + } + + return sb.toString(); + } + + /** + * 驼峰命名法工具 + * + * @return toCamelCase(" hello_world ") == "helloWorld" + * toCapitalizeCamelCase("hello_world") == "HelloWorld" + * toUnderScoreCase("helloWorld") = "hello_world" + */ + public static String toCapitalizeCamelCase(String s) { + if (s == null) { + return null; + } + s = toCamelCase(s); + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + + /** + * 驼峰命名法工具 + * + * @return toCamelCase(" hello_world ") == "helloWorld" + * toCapitalizeCamelCase("hello_world") == "HelloWorld" + * toUnderScoreCase("helloWorld") = "hello_world" + */ + public static String toUnderScoreCase(String s) { + if (s == null) { + return null; + } + + StringBuilder sb = new StringBuilder(); + boolean upperCase = false; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + + boolean nextUpperCase = true; + + if (i < (s.length() - 1)) { + nextUpperCase = Character.isUpperCase(s.charAt(i + 1)); + } + + if ((i > 0) && Character.isUpperCase(c)) { + if (!upperCase || !nextUpperCase) { + sb.append(SEPARATOR); + } + upperCase = true; + } else { + upperCase = false; + } + + sb.append(Character.toLowerCase(c)); + } + + return sb.toString(); + } + + /** + * 获取ip地址 + * @param request + * @return + */ + public static String getIP(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + String[] ips = ip.split(","); + return "0:0:0:0:0:0:0:1".equals(ips[0])?"127.0.0.1":ips[0]; + } + + /** + * 根据ip获取详细地址 + * @param ip + * @return + */ + public static String getCityInfo(String ip) { + try { + String path = "ip2region/ip2region.db"; + String name = "ip2region.db"; + int algorithm = DbSearcher.BTREE_ALGORITHM; + DbConfig config = new DbConfig(); + File file = FileUtil.inputStreamToFile(new ClassPathResource(path).getStream(), name); + DbSearcher searcher = new DbSearcher(config, file.getPath()); + Method method = null; + switch (algorithm) { + case DbSearcher.BTREE_ALGORITHM: + method = searcher.getClass().getMethod("btreeSearch", String.class); + break; + case DbSearcher.BINARY_ALGORITHM: + method = searcher.getClass().getMethod("binarySearch", String.class); + break; + case DbSearcher.MEMORY_ALGORITYM: + method = searcher.getClass().getMethod("memorySearch", String.class); + break; + default: + method = searcher.getClass().getMethod("memorySearch", String.class); + break; + } + DataBlock dataBlock = null; + dataBlock = (DataBlock) method.invoke(searcher, ip); + String address = dataBlock.getRegion().replace("0|",""); + if(address.charAt(address.length()-1) == '|'){ + address = address.substring(0,address.length() - 1); + } + return address.equals(ElAdminConstant.REGION)?"内网IP":address; + } catch (Exception e) { + e.printStackTrace(); + } + return ""; + } + + /** + * 获得当天是周几 + */ + public static String getWeekDay(){ + String[] weekDays = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date()); + + int w = cal.get(Calendar.DAY_OF_WEEK) - 1; + if (w < 0){ + w = 0; + } + return weekDays[w]; + } +} \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/utils/ThrowableUtil.java b/yshop-common/src/main/java/co/yixiang/utils/ThrowableUtil.java new file mode 100644 index 00000000..33ae9504 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/ThrowableUtil.java @@ -0,0 +1,42 @@ +package co.yixiang.utils; + +import co.yixiang.exception.BadRequestException; +import org.hibernate.exception.ConstraintViolationException; + +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * 异常工具 + * @author Zheng Jie + * @date 2019-01-06 + */ +public class ThrowableUtil { + + /** + * 获取堆栈信息 + * @param throwable + * @return + */ + public static String getStackTrace(Throwable throwable){ + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + try { + throwable.printStackTrace(pw); + return sw.toString(); + } finally { + pw.close(); + } + } + + public static void throwForeignKeyException(Throwable e, String msg){ + Throwable t = e.getCause(); + while ((t != null) && !(t instanceof ConstraintViolationException)) { + t = t.getCause(); + } + if (t instanceof ConstraintViolationException) { + throw new BadRequestException(msg); + } + throw new BadRequestException("删除失败:" + t.getMessage()); + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/TranslatorUtil.java b/yshop-common/src/main/java/co/yixiang/utils/TranslatorUtil.java new file mode 100644 index 00000000..ca67810c --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/TranslatorUtil.java @@ -0,0 +1,52 @@ +package co.yixiang.utils; + +import cn.hutool.json.JSONArray; +import lombok.var; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; + +public class TranslatorUtil { + + public static String translate(String word){ + try { + String url = "https://translate.googleapis.com/translate_a/single?" + + "client=gtx&" + + "sl=en" + + "&tl=zh-CN" + + "&dt=t&q=" + URLEncoder.encode(word, "UTF-8"); + + URL obj = new URL(url); + HttpURLConnection con = (HttpURLConnection) obj.openConnection(); + con.setRequestProperty("User-Agent", "Mozilla/5.0"); + + BufferedReader in = new BufferedReader( + new InputStreamReader(con.getInputStream())); + String inputLine; + StringBuffer response = new StringBuffer(); + + while ((inputLine = in.readLine()) != null) { + response.append(inputLine); + } + in.close(); + return parseResult(response.toString()); + }catch (Exception e){ + return word; + } + } + + private static String parseResult(String inputJson) throws Exception { + JSONArray jsonArray = new JSONArray(inputJson); + JSONArray jsonArray2 = (JSONArray) jsonArray.get(0); + String result =""; + + for(var i = 0; i < jsonArray2.size(); i ++){ + result += ((JSONArray) jsonArray2.get(i)).get(0).toString(); + } + return result; + } + +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/TreeUtil.java b/yshop-common/src/main/java/co/yixiang/utils/TreeUtil.java new file mode 100644 index 00000000..6497f1c2 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/TreeUtil.java @@ -0,0 +1,89 @@ +package co.yixiang.utils; + + +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @ClassName TreeUtil + * @Author hupeng <610796224@qq.com> + * @Date 2019/10/22 + **/ +public class TreeUtil { + /** + * 获得指定节点下所有归档 + * @param list + * @param parentId + * @return + */ + public static List list2TreeConverter(List list, int parentId) { + List returnList = new ArrayList<>(); + + for (CateDTO res : list) { + //判断对象是否为根节点 + + if (res.getPid() == parentId) { + //该节点为根节点,开始递归 + + recursionFn(list, res); //通过递归为节点设置childList + + returnList.add(res); + } + } + + return returnList; + } + + /** + * 递归列表 + * 通过递归,给指定t节点设置childList + * @param list + * @param t + */ + public static void recursionFn(List list, CateDTO t) { + //只能获取当前t节点的子节点集,并不是所有子节点集 + List childsList = getChildList(list, t); + //设置他的子集对象集 + t.setChildren(childsList); + + //迭代子集对象集 + for (CateDTO nextChild : childsList) { //遍历完,则退出递归 + + //判断子集对象是否还有子节点 + if (!CollectionUtils.isEmpty(childsList)) { + //有下一个子节点,继续递归 + recursionFn(list, nextChild); + } + } + } + + /** + * 获得指定节点下的所有子节点 + * @param list + * @param t + * @return + */ + public static List getChildList(List list, CateDTO t) { + List childsList = new ArrayList(); + //遍历集合元素,如果元素的Parentid==指定元素的id,则说明是该元素的子节点 + for (CateDTO t1 : list) { + if (t1.getPid() == t.getId() ) { + childsList.add(t1); + } + } + + return childsList; + } + + /** + * 判断是否还有下一个子节点 + * @param list + * @param t + */ + public static boolean hasChild(List list, CateDTO t) { + return getChildList(list, t).size() > 0 ? true : false; + } +} diff --git a/yshop-common/src/main/java/co/yixiang/utils/ValidationUtil.java b/yshop-common/src/main/java/co/yixiang/utils/ValidationUtil.java new file mode 100644 index 00000000..9da58a91 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/utils/ValidationUtil.java @@ -0,0 +1,39 @@ +package co.yixiang.utils; + +import co.yixiang.exception.BadRequestException; + +import java.util.Optional; + +/** + * 验证工具 + * @author Zheng Jie + * @date 2018-11-23 + */ +public class ValidationUtil{ + + /** + * 验证空 + * @param optional + */ + public static void isNull(Optional optional, String entity,String parameter , Object value){ + if(!optional.isPresent()){ + String msg = entity + + " 不存在 " + +"{ "+ parameter +":"+ value.toString() +" }"; + throw new BadRequestException(msg); + } + } + + /** + * 验证是否为邮箱 + * @param string + * @return + */ + public static boolean isEmail(String string) { + if (string == null){ + return false; + } + String regEx1 = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; + return string.matches(regEx1); + } +} diff --git a/yshop-common/src/test/java/co/yixiang/utils/EncryptUtilsTest.java b/yshop-common/src/test/java/co/yixiang/utils/EncryptUtilsTest.java new file mode 100644 index 00000000..5a19230e --- /dev/null +++ b/yshop-common/src/test/java/co/yixiang/utils/EncryptUtilsTest.java @@ -0,0 +1,31 @@ +package co.yixiang.utils; + +import org.junit.Assert; +import org.junit.Test; + +public class EncryptUtilsTest { + + /** + * 对称加密 + */ + @Test + public void testDesEncrypt() { + try { + Assert.assertEquals("7772841DC6099402", EncryptUtils.desEncrypt("123456")); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 对称解密 + */ + @Test + public void testDesDecrypt() { + try { + Assert.assertEquals("123456", EncryptUtils.desDecrypt("7772841DC6099402")); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/yshop-common/src/test/java/co/yixiang/utils/FileUtilTest.java b/yshop-common/src/test/java/co/yixiang/utils/FileUtilTest.java new file mode 100644 index 00000000..526b3f8b --- /dev/null +++ b/yshop-common/src/test/java/co/yixiang/utils/FileUtilTest.java @@ -0,0 +1,36 @@ +package co.yixiang.utils; + +import org.junit.Assert; +import org.junit.Test; +import org.springframework.mock.web.MockMultipartFile; + +import static org.junit.Assert.*; + +public class FileUtilTest { + + @Test + public void testToFile() { + long retval = FileUtil.toFile(new MockMultipartFile("foo", (byte[]) null)).getTotalSpace(); + assertEquals(500695072768L, retval); + } + + @Test + public void testGetExtensionName() { + Assert.assertEquals("foo", FileUtil.getExtensionName("foo")); + Assert.assertEquals("exe", FileUtil.getExtensionName("bar.exe")); + } + + @Test + public void testGetFileNameNoEx() { + Assert.assertEquals("foo", FileUtil.getFileNameNoEx("foo")); + Assert.assertEquals("bar", FileUtil.getFileNameNoEx("bar.txt")); + } + + @Test + public void testGetSize() { + Assert.assertEquals("1000B ", FileUtil.getSize(1000)); + Assert.assertEquals("1.00KB ", FileUtil.getSize(1024)); + Assert.assertEquals("1.00MB ", FileUtil.getSize(1048576)); + Assert.assertEquals("1.00GB ", FileUtil.getSize(1073741824)); + } +} diff --git a/yshop-common/src/test/java/co/yixiang/utils/StringUtilsTest.java b/yshop-common/src/test/java/co/yixiang/utils/StringUtilsTest.java new file mode 100644 index 00000000..551de800 --- /dev/null +++ b/yshop-common/src/test/java/co/yixiang/utils/StringUtilsTest.java @@ -0,0 +1,49 @@ +package co.yixiang.utils; + +import org.junit.Assert; +import org.junit.Test; +import org.springframework.mock.web.MockHttpServletRequest; + +import java.text.SimpleDateFormat; +import java.util.*; + +import static org.junit.Assert.*; + +public class StringUtilsTest { + + @Test + public void testInString() { + assertTrue(StringUtils.inString("?", "?")); + assertFalse(StringUtils.inString("?", new String[]{})); + } + + @Test + public void testToCamelCase() { + assertNull(StringUtils.toCamelCase(null)); + } + + @Test + public void testToCapitalizeCamelCase() { + assertNull(StringUtils.toCapitalizeCamelCase(null)); + Assert.assertEquals("HelloWorld", StringUtils.toCapitalizeCamelCase("hello_world")); + } + + @Test + public void testToUnderScoreCase() { + assertNull(StringUtils.toUnderScoreCase(null)); + Assert.assertEquals("hello_world", StringUtils.toUnderScoreCase("helloWorld")); + Assert.assertEquals("\u0000\u0000", StringUtils.toUnderScoreCase("\u0000\u0000")); + Assert.assertEquals("\u0000_a", StringUtils.toUnderScoreCase("\u0000A")); + } + + @Test + public void testGetWeekDay() { + SimpleDateFormat simpleDateformat = new SimpleDateFormat("E"); + Assert.assertEquals(simpleDateformat.format(new Date()), StringUtils.getWeekDay()); + } + + @Test + public void testGetIP() { + Assert.assertEquals("127.0.0.1", StringUtils.getIP(new MockHttpServletRequest())); + } +} \ No newline at end of file diff --git a/yshop-generator/pom.xml b/yshop-generator/pom.xml new file mode 100644 index 00000000..4c0df150 --- /dev/null +++ b/yshop-generator/pom.xml @@ -0,0 +1,39 @@ + + + + yshop + co.yixiang + 1.0 + + 4.0.0 + + yshop-generator + 代码生成模块 + + + 1.9 + + + + + co.yixiang + yshop-common + 1.0 + + + + + org.springframework.boot + spring-boot-starter-freemarker + + + + + commons-configuration + commons-configuration + ${configuration.version} + + + \ No newline at end of file diff --git a/yshop-generator/src/main/java/co/yixiang/domain/GenConfig.java b/yshop-generator/src/main/java/co/yixiang/domain/GenConfig.java new file mode 100644 index 00000000..f45bb610 --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/domain/GenConfig.java @@ -0,0 +1,41 @@ +package co.yixiang.domain; + +import lombok.Data; +import javax.persistence.*; + +/** + * 代码生成配置 + * @author Zheng Jie + * @date 2019-01-03 + */ +@Data +@Entity +@Table(name = "gen_config") +public class GenConfig { + + @Id + private Long id; + + /** 包路径 **/ + private String pack; + + /** 模块名 **/ + @Column(name = "module_name") + private String moduleName; + + /** 前端文件路径 **/ + private String path; + + /** 前端文件路径 **/ + @Column(name = "api_path") + private String apiPath; + + /** 作者 **/ + private String author; + + /** 表前缀 **/ + private String prefix; + + /** 是否覆盖 **/ + private Boolean cover; +} diff --git a/yshop-generator/src/main/java/co/yixiang/domain/vo/ColumnInfo.java b/yshop-generator/src/main/java/co/yixiang/domain/vo/ColumnInfo.java new file mode 100644 index 00000000..b7c66f27 --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/domain/vo/ColumnInfo.java @@ -0,0 +1,40 @@ +package co.yixiang.domain.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 列的数据信息 + * @author Zheng Jie + * @date 2019-01-02 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ColumnInfo { + + /** 数据库字段名称 **/ + private Object columnName; + + /** 允许空值 **/ + private Object isNullable; + + /** 数据库字段类型 **/ + private Object columnType; + + /** 数据库字段注释 **/ + private Object columnComment; + + /** 数据库字段键类型 **/ + private Object columnKey; + + /** 额外的参数 **/ + private Object extra; + + /** 查询 1:模糊 2:精确 **/ + private String columnQuery; + + /** 是否在列表显示 **/ + private String columnShow; +} diff --git a/yshop-generator/src/main/java/co/yixiang/domain/vo/TableInfo.java b/yshop-generator/src/main/java/co/yixiang/domain/vo/TableInfo.java new file mode 100644 index 00000000..93f587e6 --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/domain/vo/TableInfo.java @@ -0,0 +1,33 @@ +package co.yixiang.domain.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 表的数据信息 + * @author Zheng Jie + * @date 2019-01-02 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class TableInfo { + + /** 表名称 **/ + private Object tableName; + + /** 创建日期 **/ + private Object createTime; + + // 数据库引擎 + private Object engine; + + // 编码集 + private Object coding; + + // 备注 + private Object remark; + + +} diff --git a/yshop-generator/src/main/java/co/yixiang/repository/GenConfigRepository.java b/yshop-generator/src/main/java/co/yixiang/repository/GenConfigRepository.java new file mode 100644 index 00000000..8512bf9c --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/repository/GenConfigRepository.java @@ -0,0 +1,11 @@ +package co.yixiang.repository; + +import co.yixiang.domain.GenConfig; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * @author Zheng Jie + * @date 2019-01-14 + */ +public interface GenConfigRepository extends JpaRepository { +} diff --git a/yshop-generator/src/main/java/co/yixiang/rest/GenConfigController.java b/yshop-generator/src/main/java/co/yixiang/rest/GenConfigController.java new file mode 100644 index 00000000..d2cc202b --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/rest/GenConfigController.java @@ -0,0 +1,35 @@ +package co.yixiang.rest; + +import co.yixiang.service.GenConfigService; +import co.yixiang.domain.GenConfig; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @author Zheng Jie + * @date 2019-01-14 + */ +@RestController +@RequestMapping("api") +public class GenConfigController { + + @Autowired + private GenConfigService genConfigService; + + /** + * 查询生成器配置 + * @return + */ + @GetMapping(value = "/genConfig") + public ResponseEntity get(){ + return new ResponseEntity(genConfigService.find(), HttpStatus.OK); + } + + @PutMapping(value = "/genConfig") + public ResponseEntity emailConfig(@Validated @RequestBody GenConfig genConfig){ + return new ResponseEntity(genConfigService.update(genConfig),HttpStatus.OK); + } +} diff --git a/yshop-generator/src/main/java/co/yixiang/rest/GeneratorController.java b/yshop-generator/src/main/java/co/yixiang/rest/GeneratorController.java new file mode 100644 index 00000000..0703b137 --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/rest/GeneratorController.java @@ -0,0 +1,70 @@ +package co.yixiang.rest; + +import cn.hutool.core.util.PageUtil; +import co.yixiang.domain.vo.ColumnInfo; +import co.yixiang.service.GenConfigService; +import co.yixiang.service.GeneratorService; +import co.yixiang.exception.BadRequestException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2019-01-02 + */ +@RestController +@RequestMapping("api") +public class GeneratorController { + + @Autowired + private GeneratorService generatorService; + + @Autowired + private GenConfigService genConfigService; + + @Value("${generator.enabled}") + private Boolean generatorEnabled; + + /** + * 查询数据库元数据 + * @param name + * @param page + * @param size + * @return + */ + @GetMapping(value = "/generator/tables") + public ResponseEntity getTables(@RequestParam(defaultValue = "") String name, + @RequestParam(defaultValue = "0")Integer page, + @RequestParam(defaultValue = "10")Integer size){ + int[] startEnd = PageUtil.transToStartEnd(page+1, size); + return new ResponseEntity(generatorService.getTables(name,startEnd), HttpStatus.OK); + } + + /** + * 查询表内元数据 + * @param tableName + * @return + */ + @GetMapping(value = "/generator/columns") + public ResponseEntity getTables(@RequestParam String tableName){ + return new ResponseEntity(generatorService.getColumns(tableName), HttpStatus.OK); + } + + /** + * 生成代码 + * @param columnInfos + * @return + */ + @PostMapping(value = "/generator") + public ResponseEntity generator(@RequestBody List columnInfos, @RequestParam String tableName){ + if(!generatorEnabled){ + throw new BadRequestException("此环境不允许生成代码!"); + } + generatorService.generator(columnInfos,genConfigService.find(),tableName); + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-generator/src/main/java/co/yixiang/service/GenConfigService.java b/yshop-generator/src/main/java/co/yixiang/service/GenConfigService.java new file mode 100644 index 00000000..3893def6 --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/service/GenConfigService.java @@ -0,0 +1,29 @@ +package co.yixiang.service; + +import co.yixiang.domain.GenConfig; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; + +/** + * @author Zheng Jie + * @date 2019-01-14 + */ +@CacheConfig(cacheNames = "genConfig") +public interface GenConfigService { + + /** + * find + * @return + */ + @Cacheable(key = "'1'") + GenConfig find(); + + /** + * update + * @param genConfig + * @return + */ + @CacheEvict(allEntries = true) + GenConfig update(GenConfig genConfig); +} diff --git a/yshop-generator/src/main/java/co/yixiang/service/GeneratorService.java b/yshop-generator/src/main/java/co/yixiang/service/GeneratorService.java new file mode 100644 index 00000000..312a3a7e --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/service/GeneratorService.java @@ -0,0 +1,35 @@ +package co.yixiang.service; + +import co.yixiang.domain.GenConfig; +import co.yixiang.domain.vo.ColumnInfo; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2019-01-02 + */ +public interface GeneratorService { + + /** + * 查询数据库元数据 + * @param name + * @param startEnd + * @return + */ + Object getTables(String name, int[] startEnd); + + /** + * 得到数据表的元数据 + * @param name + * @return + */ + Object getColumns(String name); + + /** + * 生成代码 + * @param columnInfos + * @param genConfig + * @param tableName + */ + void generator(List columnInfos, GenConfig genConfig, String tableName); +} diff --git a/yshop-generator/src/main/java/co/yixiang/service/impl/GenConfigServiceImpl.java b/yshop-generator/src/main/java/co/yixiang/service/impl/GenConfigServiceImpl.java new file mode 100644 index 00000000..ac80a59f --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/service/impl/GenConfigServiceImpl.java @@ -0,0 +1,53 @@ +package co.yixiang.service.impl; + +import co.yixiang.repository.GenConfigRepository; +import co.yixiang.service.GenConfigService; +import co.yixiang.domain.GenConfig; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.util.Optional; + +/** + * @author Zheng Jie + * @date 2019-01-14 + */ +@Service +public class GenConfigServiceImpl implements GenConfigService { + + @Autowired + private GenConfigRepository genConfigRepository; + + @Override + public GenConfig find() { + Optional genConfig = genConfigRepository.findById(1L); + if(genConfig.isPresent()){ + return genConfig.get(); + } else { + return new GenConfig(); + } + } + + @Override + public GenConfig update(GenConfig genConfig) { + genConfig.setId(1L); + // 自动设置Api路径,注释掉前需要同步取消前端的注释 + String separator = File.separator; + String[] paths = null; + if (separator.equals("\\")) { + paths = genConfig.getPath().split("\\\\"); + } else paths = genConfig.getPath().split(File.separator); + StringBuffer api = new StringBuffer(); + for (int i = 0; i < paths.length; i++) { + api.append(paths[i]); + api.append(separator); + if(paths[i].equals("src")){ + api.append("api"); + break; + } + } + genConfig.setApiPath(api.toString()); + return genConfigRepository.save(genConfig); + } +} diff --git a/yshop-generator/src/main/java/co/yixiang/service/impl/GeneratorServiceImpl.java b/yshop-generator/src/main/java/co/yixiang/service/impl/GeneratorServiceImpl.java new file mode 100644 index 00000000..160f7056 --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/service/impl/GeneratorServiceImpl.java @@ -0,0 +1,77 @@ +package co.yixiang.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import co.yixiang.domain.vo.ColumnInfo; +import co.yixiang.service.GeneratorService; +import co.yixiang.domain.GenConfig; +import co.yixiang.domain.vo.TableInfo; +import co.yixiang.exception.BadRequestException; +import co.yixiang.utils.GenUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.StringUtils; +import org.springframework.stereotype.Service; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2019-01-02 + */ +@Service +public class GeneratorServiceImpl implements GeneratorService { + + @PersistenceContext + private EntityManager em; + + @Override + public Object getTables(String name, int[] startEnd) { + // 使用预编译防止sql注入 + String sql = "select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables " + + "where table_schema = (select database()) " + + "and table_name like ? order by create_time desc"; + Query query = em.createNativeQuery(sql); + query.setFirstResult(startEnd[0]); + query.setMaxResults(startEnd[1]-startEnd[0]); + query.setParameter(1, StringUtils.isNotBlank(name) ? ("%" + name + "%") : "%%"); + List result = query.getResultList(); + List tableInfos = new ArrayList<>(); + for (Object[] obj : result) { + tableInfos.add(new TableInfo(obj[0],obj[1],obj[2],obj[3], ObjectUtil.isNotEmpty(obj[4])? obj[4] : "-")); + } + Query query1 = em.createNativeQuery("SELECT COUNT(*) from information_schema.tables where table_schema = (select database())"); + Object totalElements = query1.getSingleResult(); + return PageUtil.toPage(tableInfos,totalElements); + } + + @Override + public Object getColumns(String name) { + // 使用预编译防止sql注入 + String sql = "select column_name, is_nullable, data_type, column_comment, column_key, extra from information_schema.columns " + + "where table_name = ? and table_schema = (select database()) order by ordinal_position"; + Query query = em.createNativeQuery(sql); + query.setParameter(1, StringUtils.isNotBlank(name) ? name : null); + List result = query.getResultList(); + List columnInfos = new ArrayList<>(); + for (Object[] obj : result) { + columnInfos.add(new ColumnInfo(obj[0],obj[1],obj[2],obj[3],obj[4],obj[5],null,"true")); + } + return PageUtil.toPage(columnInfos,columnInfos.size()); + } + + @Override + public void generator(List columnInfos, GenConfig genConfig, String tableName) { + if(genConfig.getId() == null){ + throw new BadRequestException("请先配置生成器"); + } + try { + GenUtil.generatorCode(columnInfos,genConfig,tableName); + } catch (IOException e) { + System.out.println(e.getMessage()); + throw new RuntimeException(e); + } + } +} diff --git a/yshop-generator/src/main/java/co/yixiang/utils/ColUtil.java b/yshop-generator/src/main/java/co/yixiang/utils/ColUtil.java new file mode 100644 index 00000000..da26a9af --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/utils/ColUtil.java @@ -0,0 +1,34 @@ +package co.yixiang.utils; + +import org.apache.commons.configuration.*; + +/** + * sql字段转java + * + * @author Zheng Jie + * @date 2019-01-03 + */ +public class ColUtil { + + /** + * 转换mysql数据类型为java数据类型 + * @param type + * @return + */ + public static String cloToJava(String type){ + Configuration config = getConfig(); + return config.getString(type,"unknowType"); + } + + /** + * 获取配置信息 + */ + public static PropertiesConfiguration getConfig() { + try { + return new PropertiesConfiguration("generator.properties" ); + } catch (ConfigurationException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/yshop-generator/src/main/java/co/yixiang/utils/GenUtil.java b/yshop-generator/src/main/java/co/yixiang/utils/GenUtil.java new file mode 100644 index 00000000..3429e209 --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/utils/GenUtil.java @@ -0,0 +1,248 @@ +package co.yixiang.utils; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.template.*; +import co.yixiang.domain.GenConfig; +import co.yixiang.domain.vo.ColumnInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.ObjectUtils; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 代码生成 + * @author Zheng Jie + * @date 2019-01-02 + */ +@Slf4j +public class GenUtil { + + private static final String TIMESTAMP = "Timestamp"; + + private static final String BIGDECIMAL = "BigDecimal"; + + private static final String PK = "PRI"; + + private static final String EXTRA = "auto_increment"; + + /** + * 获取后端代码模板名称 + * @return + */ + public static List getAdminTemplateNames() { + List templateNames = new ArrayList<>(); + templateNames.add("Entity"); + templateNames.add("Dto"); + templateNames.add("Mapper"); + templateNames.add("Repository"); + templateNames.add("Service"); + templateNames.add("ServiceImpl"); + templateNames.add("QueryCriteria"); + templateNames.add("Controller"); + return templateNames; + } + + /** + * 获取前端代码模板名称 + * @return + */ + public static List getFrontTemplateNames() { + List templateNames = new ArrayList<>(); + templateNames.add("api"); + templateNames.add("index"); + templateNames.add("eForm"); + return templateNames; + } + + /** + * 生成代码 + * @param columnInfos 表元数据 + * @param genConfig 生成代码的参数配置,如包路径,作者 + */ + public static void generatorCode(List columnInfos, GenConfig genConfig, String tableName) throws IOException { + Map map = new HashMap(); + map.put("package",genConfig.getPack()); + map.put("moduleName",genConfig.getModuleName()); + map.put("author",genConfig.getAuthor()); + map.put("date", LocalDate.now().toString()); + map.put("tableName",tableName); + String className = StringUtils.toCapitalizeCamelCase(tableName); + String changeClassName = StringUtils.toCamelCase(tableName); + + // 判断是否去除表前缀 + if (StringUtils.isNotEmpty(genConfig.getPrefix())) { + className = StringUtils.toCapitalizeCamelCase(StrUtil.removePrefix(tableName,genConfig.getPrefix())); + changeClassName = StringUtils.toCamelCase(StrUtil.removePrefix(tableName,genConfig.getPrefix())); + } + map.put("className", className); + map.put("upperCaseClassName", className.toUpperCase()); + map.put("changeClassName", changeClassName); + map.put("hasTimestamp",false); + map.put("hasBigDecimal",false); + map.put("hasQuery",false); + map.put("auto",false); + + List> columns = new ArrayList<>(); + List> queryColumns = new ArrayList<>(); + for (ColumnInfo column : columnInfos) { + Map listMap = new HashMap(); + listMap.put("columnComment",column.getColumnComment()); + listMap.put("columnKey",column.getColumnKey()); + + String colType = ColUtil.cloToJava(column.getColumnType().toString()); + String changeColumnName = StringUtils.toCamelCase(column.getColumnName().toString()); + String capitalColumnName = StringUtils.toCapitalizeCamelCase(column.getColumnName().toString()); + if(PK.equals(column.getColumnKey())){ + map.put("pkColumnType",colType); + map.put("pkChangeColName",changeColumnName); + map.put("pkCapitalColName",capitalColumnName); + } + if(TIMESTAMP.equals(colType)){ + map.put("hasTimestamp",true); + } + if(BIGDECIMAL.equals(colType)){ + map.put("hasBigDecimal",true); + } + if(EXTRA.equals(column.getExtra())){ + map.put("auto",true); + } + listMap.put("columnType",colType); + listMap.put("columnName",column.getColumnName()); + listMap.put("isNullable",column.getIsNullable()); + listMap.put("columnShow",column.getColumnShow()); + listMap.put("changeColumnName",changeColumnName); + listMap.put("capitalColumnName",capitalColumnName); + + // 判断是否有查询,如有则把查询的字段set进columnQuery + if(!StringUtils.isBlank(column.getColumnQuery())){ + listMap.put("columnQuery",column.getColumnQuery()); + map.put("hasQuery",true); + queryColumns.add(listMap); + } + columns.add(listMap); + } + map.put("columns",columns); + map.put("queryColumns",queryColumns); + TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); + + // 生成后端代码 + List templates = getAdminTemplateNames(); + for (String templateName : templates) { + Template template = engine.getTemplate("generator/admin/"+templateName+".ftl"); + String filePath = getAdminFilePath(templateName,genConfig,className); + + File file = new File(filePath); + + // 如果非覆盖生成 + if(!genConfig.getCover() && FileUtil.exist(file)){ + continue; + } + // 生成代码 + genFile(file, template, map); + } + + // 生成前端代码 + templates = getFrontTemplateNames(); + for (String templateName : templates) { + Template template = engine.getTemplate("generator/front/"+templateName+".ftl"); + String filePath = getFrontFilePath(templateName,genConfig,map.get("changeClassName").toString()); + + File file = new File(filePath); + + // 如果非覆盖生成 + if(!genConfig.getCover() && FileUtil.exist(file)){ + continue; + } + // 生成代码 + genFile(file, template, map); + } + } + + /** + * 定义后端文件路径以及名称 + */ + public static String getAdminFilePath(String templateName, GenConfig genConfig, String className) { + String projectPath = System.getProperty("user.dir") + File.separator + genConfig.getModuleName(); + String packagePath = projectPath + File.separator + "src" +File.separator+ "main" + File.separator + "java" + File.separator; + if (!ObjectUtils.isEmpty(genConfig.getPack())) { + packagePath += genConfig.getPack().replace(".", File.separator) + File.separator; + } + + if ("Entity".equals(templateName)) { + return packagePath + "domain" + File.separator + className + ".java"; + } + + if ("Controller".equals(templateName)) { + return packagePath + "rest" + File.separator + className + "Controller.java"; + } + + if ("Service".equals(templateName)) { + return packagePath + "service" + File.separator + className + "Service.java"; + } + + if ("ServiceImpl".equals(templateName)) { + return packagePath + "service" + File.separator + "impl" + File.separator + className + "ServiceImpl.java"; + } + + if ("Dto".equals(templateName)) { + return packagePath + "service" + File.separator + "dto" + File.separator + className + "DTO.java"; + } + + if ("QueryCriteria".equals(templateName)) { + return packagePath + "service" + File.separator + "dto" + File.separator + className + "QueryCriteria.java"; + } + + if ("Mapper".equals(templateName)) { + return packagePath + "service" + File.separator + "mapper" + File.separator + className + "Mapper.java"; + } + + if ("Repository".equals(templateName)) { + return packagePath + "repository" + File.separator + className + "Repository.java"; + } + + return null; + } + + /** + * 定义前端文件路径以及名称 + */ + public static String getFrontFilePath(String templateName, GenConfig genConfig, String apiName) { + String path = genConfig.getPath(); + + if ("api".equals(templateName)) { + return genConfig.getApiPath() + File.separator + apiName + ".js"; + } + + if ("index".equals(templateName)) { + return path + File.separator + "index.vue"; + } + + if ("eForm".equals(templateName)) { + return path + File.separator + File.separator + "form.vue"; + } + return null; + } + + public static void genFile(File file,Template template,Map map) throws IOException { + // 生成目标文件 + Writer writer = null; + try { + FileUtil.touch(file); + writer = new FileWriter(file); + template.render(map, writer); + } catch (TemplateException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + writer.close(); + } + } +} diff --git a/yshop-logging/pom.xml b/yshop-logging/pom.xml new file mode 100644 index 00000000..3af2419e --- /dev/null +++ b/yshop-logging/pom.xml @@ -0,0 +1,22 @@ + + + + yshop + co.yixiang + 1.0 + + 4.0.0 + + yshop-logging + 日志模块 + + + + co.yixiang + yshop-common + 1.0 + + + \ No newline at end of file diff --git a/yshop-logging/src/main/java/co/yixiang/aop/log/Log.java b/yshop-logging/src/main/java/co/yixiang/aop/log/Log.java new file mode 100644 index 00000000..9fc17055 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/aop/log/Log.java @@ -0,0 +1,16 @@ +package co.yixiang.aop.log; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Log { + String value() default ""; +} diff --git a/yshop-logging/src/main/java/co/yixiang/aspect/LogAspect.java b/yshop-logging/src/main/java/co/yixiang/aspect/LogAspect.java new file mode 100644 index 00000000..60f3f9ca --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/aspect/LogAspect.java @@ -0,0 +1,76 @@ +package co.yixiang.aspect; + +import co.yixiang.domain.Log; +import co.yixiang.utils.RequestHolder; +import co.yixiang.utils.SecurityUtils; +import co.yixiang.utils.StringUtils; +import co.yixiang.utils.ThrowableUtil; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.service.LogService; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@Component +@Aspect +@Slf4j +public class LogAspect { + + @Autowired + private LogService logService; + + private long currentTime = 0L; + + /** + * 配置切入点 + */ + @Pointcut("@annotation(co.yixiang.aop.log.Log)") + public void logPointcut() { + // 该方法无方法体,主要为了让同类中其他方法使用此切入点 + } + + /** + * 配置环绕通知,使用在方法logPointcut()上注册的切入点 + * + * @param joinPoint join point for advice + */ + @Around("logPointcut()") + public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { + Object result = null; + currentTime = System.currentTimeMillis(); + result = joinPoint.proceed(); + Log log = new Log("INFO",System.currentTimeMillis() - currentTime); + logService.save(getUsername(), StringUtils.getIP(RequestHolder.getHttpServletRequest()),joinPoint, log); + return result; + } + + /** + * 配置异常通知 + * + * @param joinPoint join point for advice + * @param e exception + */ + @AfterThrowing(pointcut = "logPointcut()", throwing = "e") + public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { + Log log = new Log("ERROR",System.currentTimeMillis() - currentTime); + log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes()); + logService.save(getUsername(), StringUtils.getIP(RequestHolder.getHttpServletRequest()), (ProceedingJoinPoint)joinPoint, log); + } + + public String getUsername() { + try { + return SecurityUtils.getUsername(); + }catch (Exception e){ + return ""; + } + } +} diff --git a/yshop-logging/src/main/java/co/yixiang/domain/Log.java b/yshop-logging/src/main/java/co/yixiang/domain/Log.java new file mode 100644 index 00000000..3442a4d2 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/domain/Log.java @@ -0,0 +1,82 @@ +package co.yixiang.domain; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Timestamp; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@Entity +@Data +@Table(name = "log") +@NoArgsConstructor +public class Log implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + /** + * 操作用户 + */ + private String username; + + /** + * 描述 + */ + private String description; + + /** + * 方法名 + */ + private String method; + + /** + * 参数 + */ + @Column(columnDefinition = "text") + private String params; + + /** + * 日志类型 + */ + @Column(name = "log_type") + private String logType; + + /** + * 请求ip + */ + @Column(name = "request_ip") + private String requestIp; + + @Column(name = "address") + private String address; + + /** + * 请求耗时 + */ + private Long time; + + /** + * 异常详细 + */ + @Column(name = "exception_detail", columnDefinition = "text") + private byte[] exceptionDetail; + + /** + * 创建日期 + */ + @CreationTimestamp + @Column(name = "create_time") + private Timestamp createTime; + + public Log(String logType, Long time) { + this.logType = logType; + this.time = time; + } +} diff --git a/yshop-logging/src/main/java/co/yixiang/repository/LogRepository.java b/yshop-logging/src/main/java/co/yixiang/repository/LogRepository.java new file mode 100644 index 00000000..e9af7dc0 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/repository/LogRepository.java @@ -0,0 +1,32 @@ +package co.yixiang.repository; + +import co.yixiang.domain.Log; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@Repository +public interface LogRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * 获取一个时间段的IP记录 + * @param date1 + * @param date2 + * @return + */ + @Query(value = "select count(*) FROM (select request_ip FROM log where create_time between ?1 and ?2 GROUP BY request_ip) as s",nativeQuery = true) + Long findIp(String date1, String date2); + + /** + * findExceptionById + * @param id + * @return + */ + @Query(value = "select exception_detail FROM log where id = ?1",nativeQuery = true) + String findExceptionById(Long id); +} diff --git a/yshop-logging/src/main/java/co/yixiang/rest/LogController.java b/yshop-logging/src/main/java/co/yixiang/rest/LogController.java new file mode 100644 index 00000000..6aa47a13 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/rest/LogController.java @@ -0,0 +1,53 @@ +package co.yixiang.rest; + +import co.yixiang.utils.SecurityUtils; +import co.yixiang.service.LogService; +import co.yixiang.service.dto.LogQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@RestController +@RequestMapping("api") +public class LogController { + + @Autowired + private LogService logService; + + @GetMapping(value = "/logs") + @PreAuthorize("hasAnyRole('ADMIN')") + public ResponseEntity getLogs(LogQueryCriteria criteria, Pageable pageable){ + criteria.setLogType("INFO"); + return new ResponseEntity(logService.queryAll(criteria,pageable), HttpStatus.OK); + } + + @GetMapping(value = "/logs/user") + public ResponseEntity getUserLogs(LogQueryCriteria criteria, Pageable pageable){ + criteria.setLogType("INFO"); + criteria.setBlurry(SecurityUtils.getUsername()); + return new ResponseEntity(logService.queryAllByUser(criteria,pageable), HttpStatus.OK); + } + + @GetMapping(value = "/logs/error") + @PreAuthorize("hasAnyRole('ADMIN')") + public ResponseEntity getErrorLogs(LogQueryCriteria criteria, Pageable pageable){ + criteria.setLogType("ERROR"); + return new ResponseEntity(logService.queryAll(criteria,pageable), HttpStatus.OK); + } + + @GetMapping(value = "/logs/error/{id}") + @PreAuthorize("hasAnyRole('ADMIN')") + public ResponseEntity getErrorLogs(@PathVariable Long id){ + return new ResponseEntity(logService.findByErrDetail(id), HttpStatus.OK); + } +} diff --git a/yshop-logging/src/main/java/co/yixiang/service/LogService.java b/yshop-logging/src/main/java/co/yixiang/service/LogService.java new file mode 100644 index 00000000..6ee0581c --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/service/LogService.java @@ -0,0 +1,47 @@ +package co.yixiang.service; + +import co.yixiang.domain.Log; +import co.yixiang.service.dto.LogQueryCriteria; +import org.aspectj.lang.ProceedingJoinPoint; +import org.springframework.data.domain.Pageable; +import org.springframework.scheduling.annotation.Async; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +public interface LogService { + + /** + * queryAll + * @param criteria + * @param pageable + * @return + */ + Object queryAll(LogQueryCriteria criteria, Pageable pageable); + + /** + * queryAllByUser + * @param criteria + * @param pageable + * @return + */ + Object queryAllByUser(LogQueryCriteria criteria, Pageable pageable); + + /** + * 新增日志 + * @param username + * @param ip + * @param joinPoint + * @param log + */ + @Async + void save(String username, String ip, ProceedingJoinPoint joinPoint, Log log); + + /** + * 查询异常详情 + * @param id + * @return + */ + Object findByErrDetail(Long id); +} diff --git a/yshop-logging/src/main/java/co/yixiang/service/dto/LogErrorDTO.java b/yshop-logging/src/main/java/co/yixiang/service/dto/LogErrorDTO.java new file mode 100644 index 00000000..73e99976 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/service/dto/LogErrorDTO.java @@ -0,0 +1,48 @@ +package co.yixiang.service.dto; + +import lombok.Data; +import java.io.Serializable; +import java.sql.Timestamp; + +/** +* @author Zheng Jie +* @date 2019-5-22 +*/ +@Data +public class LogErrorDTO implements Serializable { + + private Long id; + + /** + * 操作用户 + */ + private String username; + + /** + * 描述 + */ + private String description; + + /** + * 方法名 + */ + private String method; + + /** + * 参数 + */ + private String params; + + /** + * 请求ip + */ + private String requestIp; + + private String address; + + + /** + * 创建日期 + */ + private Timestamp createTime; +} \ No newline at end of file diff --git a/yshop-logging/src/main/java/co/yixiang/service/dto/LogQueryCriteria.java b/yshop-logging/src/main/java/co/yixiang/service/dto/LogQueryCriteria.java new file mode 100644 index 00000000..44f6c27c --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/service/dto/LogQueryCriteria.java @@ -0,0 +1,20 @@ +package co.yixiang.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +/** + * 日志查询类 + * @author Zheng Jie + * @date 2019-6-4 09:23:07 + */ +@Data +public class LogQueryCriteria { + + // 多字段模糊 + @Query(blurry = "username,description,address,requestIp,method,params") + private String blurry; + + @Query + private String logType; +} diff --git a/yshop-logging/src/main/java/co/yixiang/service/dto/LogSmallDTO.java b/yshop-logging/src/main/java/co/yixiang/service/dto/LogSmallDTO.java new file mode 100644 index 00000000..59a67ec8 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/service/dto/LogSmallDTO.java @@ -0,0 +1,36 @@ +package co.yixiang.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.sql.Timestamp; + +/** + * @author Zheng Jie + * @date 2019-5-22 + */ +@Data +public class LogSmallDTO implements Serializable { + + /** + * 描述 + */ + private String description; + + /** + * 请求ip + */ + private String requestIp; + + /** + * 请求耗时 + */ + private Long time; + + private String address; + + /** + * 创建日期 + */ + private Timestamp createTime; +} diff --git a/yshop-logging/src/main/java/co/yixiang/service/impl/LogServiceImpl.java b/yshop-logging/src/main/java/co/yixiang/service/impl/LogServiceImpl.java new file mode 100644 index 00000000..ba111cfc --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/service/impl/LogServiceImpl.java @@ -0,0 +1,107 @@ +package co.yixiang.service.impl; + +import cn.hutool.core.lang.Dict; +import cn.hutool.json.JSONObject; +import co.yixiang.domain.Log; +import co.yixiang.service.LogService; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.StringUtils; +import co.yixiang.repository.LogRepository; +import co.yixiang.service.dto.LogQueryCriteria; +import co.yixiang.service.mapper.LogErrorMapper; +import co.yixiang.service.mapper.LogSmallMapper; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.lang.reflect.Method; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class LogServiceImpl implements LogService { + + @Autowired + private LogRepository logRepository; + + @Autowired + private LogErrorMapper logErrorMapper; + + @Autowired + private LogSmallMapper logSmallMapper; + + private final String LOGINPATH = "login"; + + @Override + public Object queryAll(LogQueryCriteria criteria, Pageable pageable){ + Page page = logRepository.findAll(((root, criteriaQuery, cb) -> QueryHelp.getPredicate(root, criteria, cb)),pageable); + if ("ERROR".equals(criteria.getLogType())) { + return PageUtil.toPage(page.map(logErrorMapper::toDto)); + } + return page; + } + + @Override + public Object queryAllByUser(LogQueryCriteria criteria, Pageable pageable) { + Page page = logRepository.findAll(((root, criteriaQuery, cb) -> QueryHelp.getPredicate(root, criteria, cb)),pageable); + return PageUtil.toPage(page.map(logSmallMapper::toDto)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(String username, String ip, ProceedingJoinPoint joinPoint, Log log){ + + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + co.yixiang.aop.log.Log aopLog = method.getAnnotation(co.yixiang.aop.log.Log.class); + + // 描述 + if (log != null) { + log.setDescription(aopLog.value()); + } + + // 方法路径 + String methodName = joinPoint.getTarget().getClass().getName()+"."+signature.getName()+"()"; + + String params = "{"; + //参数值 + Object[] argValues = joinPoint.getArgs(); + //参数名称 + String[] argNames = ((MethodSignature)joinPoint.getSignature()).getParameterNames(); + if(argValues != null){ + for (int i = 0; i < argValues.length; i++) { + params += " " + argNames[i] + ": " + argValues[i]; + } + } + + // 获取IP地址 + log.setRequestIp(ip); + + if(LOGINPATH.equals(signature.getName())){ + try { + JSONObject jsonObject = new JSONObject(argValues[0]); + username = jsonObject.get("username").toString(); + }catch (Exception e){ + e.printStackTrace(); + } + } + log.setAddress(StringUtils.getCityInfo(log.getRequestIp())); + log.setMethod(methodName); + log.setUsername(username); + log.setParams(params + " }"); + logRepository.save(log); + } + + @Override + public Object findByErrDetail(Long id) { + return Dict.create().set("exception",logRepository.findExceptionById(id)); + } +} diff --git a/yshop-logging/src/main/java/co/yixiang/service/mapper/LogErrorMapper.java b/yshop-logging/src/main/java/co/yixiang/service/mapper/LogErrorMapper.java new file mode 100644 index 00000000..959ddb47 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/service/mapper/LogErrorMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.service.mapper; + +import co.yixiang.domain.Log; +import co.yixiang.mapper.EntityMapper; +import co.yixiang.service.dto.LogErrorDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2019-5-22 + */ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface LogErrorMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-logging/src/main/java/co/yixiang/service/mapper/LogSmallMapper.java b/yshop-logging/src/main/java/co/yixiang/service/mapper/LogSmallMapper.java new file mode 100644 index 00000000..43beb57a --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/service/mapper/LogSmallMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.service.mapper; + +import co.yixiang.domain.Log; +import co.yixiang.mapper.EntityMapper; +import co.yixiang.service.dto.LogSmallDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2019-5-22 + */ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface LogSmallMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-mp/pom.xml b/yshop-mp/pom.xml new file mode 100644 index 00000000..c369c84d --- /dev/null +++ b/yshop-mp/pom.xml @@ -0,0 +1,29 @@ + + + + yshop + co.yixiang + 1.0 + + 4.0.0 + + yshop-mp + 微信模块 + + + + com.github.binarywang + weixin-java-mp + 3.5.0 + + + com.github.binarywang + wx-java-pay-spring-boot-starter + 3.5.0 + + + + + \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/builder/AbstractBuilder.java b/yshop-mp/src/main/java/co/yixiang/mp/builder/AbstractBuilder.java new file mode 100644 index 00000000..3750a15f --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/builder/AbstractBuilder.java @@ -0,0 +1,17 @@ +package co.yixiang.mp.builder; + +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +public abstract class AbstractBuilder { + protected final Logger logger = LoggerFactory.getLogger(getClass()); + + public abstract WxMpXmlOutMessage build(String content, + WxMpXmlMessage wxMessage, WxMpService service); +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/builder/ImageBuilder.java b/yshop-mp/src/main/java/co/yixiang/mp/builder/ImageBuilder.java new file mode 100644 index 00000000..a2f30709 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/builder/ImageBuilder.java @@ -0,0 +1,24 @@ +package co.yixiang.mp.builder; + +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +public class ImageBuilder extends AbstractBuilder { + + @Override + public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage, + WxMpService service) { + + WxMpXmlOutImageMessage m = WxMpXmlOutMessage.IMAGE().mediaId(content) + .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()) + .build(); + + return m; + } + +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/builder/TextBuilder.java b/yshop-mp/src/main/java/co/yixiang/mp/builder/TextBuilder.java new file mode 100644 index 00000000..a98cadfe --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/builder/TextBuilder.java @@ -0,0 +1,22 @@ +package co.yixiang.mp.builder; + +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutTextMessage; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +public class TextBuilder extends AbstractBuilder { + + @Override + public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage, + WxMpService service) { + WxMpXmlOutTextMessage m = WxMpXmlOutMessage.TEXT().content(content) + .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()) + .build(); + return m; + } + +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/config/WxMpConfiguration.java b/yshop-mp/src/main/java/co/yixiang/mp/config/WxMpConfiguration.java new file mode 100644 index 00000000..4cf4e403 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/config/WxMpConfiguration.java @@ -0,0 +1,112 @@ +package co.yixiang.mp.config; + +import co.yixiang.mp.handler.*; +import lombok.AllArgsConstructor; +import me.chanjar.weixin.mp.api.WxMpMessageRouter; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; +import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.List; +import java.util.stream.Collectors; + +import static me.chanjar.weixin.common.api.WxConsts.EventType; +import static me.chanjar.weixin.common.api.WxConsts.EventType.SUBSCRIBE; +import static me.chanjar.weixin.common.api.WxConsts.EventType.UNSUBSCRIBE; +import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType.CLICK; +import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType.VIEW; +import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType; +import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType.EVENT; +import static me.chanjar.weixin.mp.constant.WxMpEventConstants.CustomerService.*; +import static me.chanjar.weixin.mp.constant.WxMpEventConstants.POI_CHECK_NOTIFY; + +/** + * wechat mp configuration + */ +@AllArgsConstructor +@Configuration +@EnableConfigurationProperties(WxMpProperties.class) +public class WxMpConfiguration { + private final LogHandler logHandler; + private final NullHandler nullHandler; + private final KfSessionHandler kfSessionHandler; + private final StoreCheckNotifyHandler storeCheckNotifyHandler; + private final LocationHandler locationHandler; + private final MenuHandler menuHandler; + private final MsgHandler msgHandler; + private final UnsubscribeHandler unsubscribeHandler; + private final SubscribeHandler subscribeHandler; + private final ScanHandler scanHandler; + private final WxMpProperties properties; + + @Bean + public WxMpService wxMpService() { + // 代码里 getConfigs()处报错的同学,请注意仔细阅读项目说明,你的IDE需要引入lombok插件!!!! + final List configs = this.properties.getConfigs(); + System.out.println(configs); + if (configs == null) { + throw new RuntimeException("请先配置!"); + } + + WxMpService service = new WxMpServiceImpl(); + service.setMultiConfigStorages(configs + .stream().map(a -> { + WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl(); + configStorage.setAppId(a.getAppId()); + configStorage.setSecret(a.getSecret()); + configStorage.setToken(a.getToken()); + configStorage.setAesKey(a.getAesKey()); + return configStorage; + }).collect(Collectors.toMap(WxMpDefaultConfigImpl::getAppId, a -> a, (o, n) -> o))); + return service; + } + + @Bean + public WxMpMessageRouter messageRouter(WxMpService wxMpService) { + final WxMpMessageRouter newRouter = new WxMpMessageRouter(wxMpService); + + // 记录所有事件的日志 (异步执行) + newRouter.rule().handler(this.logHandler).next(); + + // 接收客服会话管理事件 +// newRouter.rule().async(false).msgType(EVENT).event(KF_CREATE_SESSION) +// .handler(this.kfSessionHandler).end(); +// newRouter.rule().async(false).msgType(EVENT).event(KF_CLOSE_SESSION) +// .handler(this.kfSessionHandler).end(); +// newRouter.rule().async(false).msgType(EVENT).event(KF_SWITCH_SESSION) +// .handler(this.kfSessionHandler).end(); + + // 门店审核事件 + //newRouter.rule().async(false).msgType(EVENT).event(POI_CHECK_NOTIFY).handler(this.storeCheckNotifyHandler).end(); + + // 自定义菜单事件 + newRouter.rule().async(false).msgType(EVENT).event(CLICK).handler(this.menuHandler).end(); + + // 点击菜单连接事件 + newRouter.rule().async(false).msgType(EVENT).event(VIEW).handler(this.nullHandler).end(); + + // 关注事件 + newRouter.rule().async(false).msgType(EVENT).event(SUBSCRIBE).handler(this.subscribeHandler).end(); + + // 取消关注事件 + newRouter.rule().async(false).msgType(EVENT).event(UNSUBSCRIBE).handler(this.unsubscribeHandler).end(); + + // 上报地理位置事件 + //newRouter.rule().async(false).msgType(EVENT).event(EventType.LOCATION).handler(this.locationHandler).end(); + + // 接收地理位置消息 + //newRouter.rule().async(false).msgType(XmlMsgType.LOCATION).handler(this.locationHandler).end(); + + // 扫码事件 + //newRouter.rule().async(false).msgType(EVENT).event(EventType.SCAN).handler(this.scanHandler).end(); + + // 默认 + //newRouter.rule().async(false).handler(this.msgHandler).end(); + + return newRouter; + } + +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/config/WxMpProperties.java b/yshop-mp/src/main/java/co/yixiang/mp/config/WxMpProperties.java new file mode 100644 index 00000000..428803fe --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/config/WxMpProperties.java @@ -0,0 +1,44 @@ +package co.yixiang.mp.config; + +import co.yixiang.mp.utils.JsonUtils; +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; + +/** + * wechat mp properties + */ +@Data +@ConfigurationProperties(prefix = "wx.mp") +public class WxMpProperties { + private List configs; + + @Data + public static class MpConfig { + /** + * 设置微信公众号的appid + */ + private String appId; + + /** + * 设置微信公众号的app secret + */ + private String secret; + + /** + * 设置微信公众号的token + */ + private String token; + + /** + * 设置微信公众号的EncodingAESKey + */ + private String aesKey; + } + + @Override + public String toString() { + return JsonUtils.toJson(this); + } +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/controller/WxMenuController.java b/yshop-mp/src/main/java/co/yixiang/mp/controller/WxMenuController.java new file mode 100644 index 00000000..5fab0b56 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/controller/WxMenuController.java @@ -0,0 +1,186 @@ +package co.yixiang.mp.controller; + +import lombok.AllArgsConstructor; +import me.chanjar.weixin.common.api.WxConsts; +import me.chanjar.weixin.common.bean.menu.WxMenu; +import me.chanjar.weixin.common.bean.menu.WxMenuButton; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.menu.WxMpGetSelfMenuInfoResult; +import me.chanjar.weixin.mp.bean.menu.WxMpMenu; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.net.MalformedURLException; +import java.net.URL; + +import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType; + + +@AllArgsConstructor +@RestController +@RequestMapping("/wx/menu/{appid}") +public class WxMenuController { + private final WxMpService wxService; + + /** + *
+     * 自定义菜单创建接口
+     * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN
+     * 如果要创建个性化菜单,请设置matchrule属性
+     * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN
+     * 
+ * + * @return 如果是个性化菜单,则返回menuid,否则返回null + */ + @PostMapping("/create") + public String menuCreate(@PathVariable String appid, @RequestBody WxMenu menu) throws WxErrorException { + return this.wxService.switchoverTo(appid).getMenuService().menuCreate(menu); + } + + @GetMapping("/create") + public String menuCreateSample(@PathVariable String appid) throws WxErrorException, MalformedURLException { + WxMenu menu = new WxMenu(); + WxMenuButton button1 = new WxMenuButton(); + button1.setType(MenuButtonType.CLICK); + button1.setName("今日歌曲"); + button1.setKey("V1001_TODAY_MUSIC"); + +// WxMenuButton button2 = new WxMenuButton(); +// button2.setType(WxConsts.BUTTON_MINIPROGRAM); +// button2.setName("小程序"); +// button2.setAppId("wx286b93c14bbf93aa"); +// button2.setPagePath("pages/lunar/index.html"); +// button2.setUrl("http://mp.weixin.qq.com"); + + WxMenuButton button3 = new WxMenuButton(); + button3.setName("菜单"); + + menu.getButtons().add(button1); +// menu.getButtons().add(button2); + menu.getButtons().add(button3); + + WxMenuButton button31 = new WxMenuButton(); + button31.setType(MenuButtonType.VIEW); + button31.setName("搜索"); + button31.setUrl("http://www.soso.com/"); + + WxMenuButton button32 = new WxMenuButton(); + button32.setType(MenuButtonType.VIEW); + button32.setName("视频"); + button32.setUrl("http://v.qq.com/"); + + WxMenuButton button33 = new WxMenuButton(); + button33.setType(MenuButtonType.CLICK); + button33.setName("赞一下我们"); + button33.setKey("V1001_GOOD"); + + WxMenuButton button34 = new WxMenuButton(); + button34.setType(MenuButtonType.VIEW); + button34.setName("获取用户信息"); + + ServletRequestAttributes servletRequestAttributes = + (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + if (servletRequestAttributes != null) { + HttpServletRequest request = servletRequestAttributes.getRequest(); + URL requestURL = new URL(request.getRequestURL().toString()); + String url = this.wxService.switchoverTo(appid).oauth2buildAuthorizationUrl( + String.format("%s://%s/wx/redirect/%s/greet", requestURL.getProtocol(), requestURL.getHost(), appid), + WxConsts.OAuth2Scope.SNSAPI_USERINFO, null); + button34.setUrl(url); + } + + button3.getSubButtons().add(button31); + button3.getSubButtons().add(button32); + button3.getSubButtons().add(button33); + button3.getSubButtons().add(button34); + + this.wxService.switchover(appid); + return this.wxService.getMenuService().menuCreate(menu); + } + + /** + *
+     * 自定义菜单创建接口
+     * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN
+     * 如果要创建个性化菜单,请设置matchrule属性
+     * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN
+     * 
+ * + * @return 如果是个性化菜单,则返回menuid,否则返回null + */ + @PostMapping("/createByJson") + public String menuCreate(@PathVariable String appid, @RequestBody String json) throws WxErrorException { + return this.wxService.switchoverTo(appid).getMenuService().menuCreate(json); + } + + /** + *
+     * 自定义菜单删除接口
+     * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141015&token=&lang=zh_CN
+     * 
+ */ + @GetMapping("/delete") + public void menuDelete(@PathVariable String appid) throws WxErrorException { + this.wxService.switchoverTo(appid).getMenuService().menuDelete(); + } + + /** + *
+     * 删除个性化菜单接口
+     * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN
+     * 
+ * + * @param menuId 个性化菜单的menuid + */ + @GetMapping("/delete/{menuId}") + public void menuDelete(@PathVariable String appid, @PathVariable String menuId) throws WxErrorException { + this.wxService.switchoverTo(appid).getMenuService().menuDelete(menuId); + } + + /** + *
+     * 自定义菜单查询接口
+     * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141014&token=&lang=zh_CN
+     * 
+ */ + @GetMapping("/get") + public WxMpMenu menuGet(@PathVariable String appid) throws WxErrorException { + return this.wxService.switchoverTo(appid).getMenuService().menuGet(); + } + + /** + *
+     * 测试个性化菜单匹配结果
+     * 详情请见: http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
+     * 
+ * + * @param userid 可以是粉丝的OpenID,也可以是粉丝的微信号。 + */ + @GetMapping("/menuTryMatch/{userid}") + public WxMenu menuTryMatch(@PathVariable String appid, @PathVariable String userid) throws WxErrorException { + return this.wxService.switchoverTo(appid).getMenuService().menuTryMatch(userid); + } + + /** + *
+     * 获取自定义菜单配置接口
+     * 本接口将会提供公众号当前使用的自定义菜单的配置,如果公众号是通过API调用设置的菜单,则返回菜单的开发配置,而如果公众号是在公众平台官网通过网站功能发布菜单,则本接口返回运营者设置的菜单配置。
+     * 请注意:
+     * 1、第三方平台开发者可以通过本接口,在旗下公众号将业务授权给你后,立即通过本接口检测公众号的自定义菜单配置,并通过接口再次给公众号设置好自动回复规则,以提升公众号运营者的业务体验。
+     * 2、本接口与自定义菜单查询接口的不同之处在于,本接口无论公众号的接口是如何设置的,都能查询到接口,而自定义菜单查询接口则仅能查询到使用API设置的菜单配置。
+     * 3、认证/未认证的服务号/订阅号,以及接口测试号,均拥有该接口权限。
+     * 4、从第三方平台的公众号登录授权机制上来说,该接口从属于消息与菜单权限集。
+     * 5、本接口中返回的图片/语音/视频为临时素材(临时素材每次获取都不同,3天内有效,通过素材管理-获取临时素材接口来获取这些素材),本接口返回的图文消息为永久素材素材(通过素材管理-获取永久素材接口来获取这些素材)。
+     *  接口调用请求说明:
+     * http请求方式: GET(请使用https协议)
+     * https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info?access_token=ACCESS_TOKEN
+     * 
+ */ + @GetMapping("/getSelfMenuInfo") + public WxMpGetSelfMenuInfoResult getSelfMenuInfo(@PathVariable String appid) throws WxErrorException { + return this.wxService.switchoverTo(appid).getMenuService().getSelfMenuInfo(); + } +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/controller/WxPortalController.java b/yshop-mp/src/main/java/co/yixiang/mp/controller/WxPortalController.java new file mode 100644 index 00000000..258059f0 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/controller/WxPortalController.java @@ -0,0 +1,116 @@ +package co.yixiang.mp.controller; + +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j; +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.mp.api.WxMpMessageRouter; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; +import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; + +/** + * @author Binary Wang(https://github.com/binarywang) + */ +@Slf4j +@AllArgsConstructor +@RestController +@RequestMapping("/wx/portal/{appid}") +public class WxPortalController { + private final WxMpService wxService; + private final WxMpMessageRouter messageRouter; + + @GetMapping(produces = "text/plain;charset=utf-8") + public String authGet(@PathVariable String appid, + @RequestParam(name = "signature", required = false) String signature, + @RequestParam(name = "timestamp", required = false) String timestamp, + @RequestParam(name = "nonce", required = false) String nonce, + @RequestParam(name = "echostr", required = false) String echostr) { + + log.info("\n接收到来自微信服务器的认证消息:[{}, {}, {}, {}]", signature, + timestamp, nonce, echostr); + if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) { + throw new IllegalArgumentException("请求参数非法,请核实!"); + } + + if (!this.wxService.switchover(appid)) { + throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); + } + + if (wxService.checkSignature(timestamp, nonce, signature)) { + return echostr; + } + + return "非法请求"; + } + + @PostMapping(produces = "application/xml; charset=UTF-8") + public String post(@PathVariable String appid, + @RequestBody String requestBody, + @RequestParam("signature") String signature, + @RequestParam("timestamp") String timestamp, + @RequestParam("nonce") String nonce, + @RequestParam("openid") String openid, + @RequestParam(name = "encrypt_type", required = false) String encType, + @RequestParam(name = "msg_signature", required = false) String msgSignature) { + log.info("\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}]," + + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", + openid, signature, encType, msgSignature, timestamp, nonce, requestBody); + + if (!this.wxService.switchover(appid)) { + throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); + } + + if (!wxService.checkSignature(timestamp, nonce, signature)) { + throw new IllegalArgumentException("非法请求,可能属于伪造的请求!"); + } + + String out = null; + if (encType == null) { + // 明文传输的消息 + WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(requestBody); + WxMpXmlOutMessage outMessage = this.route(inMessage); + if (outMessage == null) { + return ""; + } + + out = outMessage.toXml(); + } else if ("aes".equalsIgnoreCase(encType)) { + // aes加密的消息 + WxMpXmlMessage inMessage = WxMpXmlMessage.fromEncryptedXml(requestBody, wxService.getWxMpConfigStorage(), + timestamp, nonce, msgSignature); + log.debug("\n消息解密后内容为:\n{} ", inMessage.toString()); + WxMpXmlOutMessage outMessage = this.route(inMessage); + if (outMessage == null) { + return ""; + } + + out = outMessage.toEncryptedXml(wxService.getWxMpConfigStorage()); + } + + log.debug("\n组装回复信息:{}", out); + return out; + } + + private WxMpXmlOutMessage route(WxMpXmlMessage message) { + try { + return this.messageRouter.route(message); + } catch (Exception e) { + log.error("路由消息时出现异常!", e); + } + + return null; + } + +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/controller/WxRedirectController.java b/yshop-mp/src/main/java/co/yixiang/mp/controller/WxRedirectController.java new file mode 100644 index 00000000..077ebe78 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/controller/WxRedirectController.java @@ -0,0 +1,41 @@ +package co.yixiang.mp.controller; + +import co.yixiang.mp.config.WxMpConfiguration; +import lombok.AllArgsConstructor; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; +import me.chanjar.weixin.mp.bean.result.WxMpUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.xml.ws.Action; + + +@AllArgsConstructor +@Controller +@RequestMapping("/wx/redirect/{appid}") +public class WxRedirectController { + private final WxMpService wxService; + + @RequestMapping("/greet") + public String greetUser(@PathVariable String appid, @RequestParam String code, ModelMap map) { + if (!this.wxService.switchover(appid)) { + throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); + } + + try { + WxMpOAuth2AccessToken accessToken = wxService.oauth2getAccessToken(code); + WxMpUser user = wxService.oauth2getUserInfo(accessToken, null); + map.put("user", user); + } catch (WxErrorException e) { + e.printStackTrace(); + } + + return "greet_user"; + } +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorController.java b/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorController.java new file mode 100644 index 00000000..e62ca986 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorController.java @@ -0,0 +1,27 @@ +package co.yixiang.mp.error; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + *
+ * 出错页面控制器
+ * 
+ * + */ +@Controller +@RequestMapping("/error") +public class ErrorController { + + @GetMapping(value = "/404") + public String error404() { + return "error"; + } + + @GetMapping(value = "/500") + public String error500() { + return "error"; + } + +} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorPageConfiguration.java b/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorPageConfiguration.java new file mode 100644 index 00000000..a1198fe3 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorPageConfiguration.java @@ -0,0 +1,24 @@ +package co.yixiang.mp.error; + +import org.springframework.boot.web.server.ErrorPage; +import org.springframework.boot.web.server.ErrorPageRegistrar; +import org.springframework.boot.web.server.ErrorPageRegistry; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Component; + +/** + *
+ * Created by Binary Wang on 2018/8/25.
+ *
+ */
+@Component
+public class ErrorPageConfiguration implements ErrorPageRegistrar {
+  @Override
+  public void registerErrorPages(ErrorPageRegistry errorPageRegistry) {
+    errorPageRegistry.addErrorPages(
+        new ErrorPage(HttpStatus.NOT_FOUND, "/error/404"),
+        new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500")
+    );
+  }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/AbstractHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/AbstractHandler.java
new file mode 100644
index 00000000..3cd624ba
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/AbstractHandler.java
@@ -0,0 +1,10 @@
+package co.yixiang.mp.handler;
+
+import me.chanjar.weixin.mp.api.WxMpMessageHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public abstract class AbstractHandler implements WxMpMessageHandler {
+    protected Logger logger = LoggerFactory.getLogger(getClass());
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/KfSessionHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/KfSessionHandler.java
new file mode 100644
index 00000000..effaa4d7
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/KfSessionHandler.java
@@ -0,0 +1,23 @@
+package co.yixiang.mp.handler;
+
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+@Component
+public class KfSessionHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService wxMpService,
+                                    WxSessionManager sessionManager) {
+        //TODO 对会话做处理
+        return null;
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/LocationHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/LocationHandler.java
new file mode 100644
index 00000000..9c44df35
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/LocationHandler.java
@@ -0,0 +1,42 @@
+package co.yixiang.mp.handler;
+
+import co.yixiang.mp.builder.TextBuilder;
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType;
+
+
+@Component
+public class LocationHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService wxMpService,
+                                    WxSessionManager sessionManager) {
+        if (wxMessage.getMsgType().equals(XmlMsgType.LOCATION)) {
+            //TODO 接收处理用户发送的地理位置消息
+            try {
+                String content = "感谢反馈,您的的地理位置已收到!";
+                return new TextBuilder().build(content, wxMessage, null);
+            } catch (Exception e) {
+                this.logger.error("位置消息接收处理失败", e);
+                return null;
+            }
+        }
+
+        //上报地理位置事件
+        this.logger.info("上报地理位置,纬度 : {},经度 : {},精度 : {}",
+            wxMessage.getLatitude(), wxMessage.getLongitude(), String.valueOf(wxMessage.getPrecision()));
+
+        //TODO  可以将用户地理位置信息保存到本地数据库,以便以后使用
+
+        return null;
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/LogHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/LogHandler.java
new file mode 100644
index 00000000..e224051c
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/LogHandler.java
@@ -0,0 +1,22 @@
+package co.yixiang.mp.handler;
+
+import co.yixiang.mp.utils.JsonUtils;
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Component
+public class LogHandler extends AbstractHandler {
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService wxMpService,
+                                    WxSessionManager sessionManager) {
+        this.logger.info("\n接收到请求消息,内容:{}", JsonUtils.toJson(wxMessage));
+        return null;
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/MenuHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/MenuHandler.java
new file mode 100644
index 00000000..9d0e8400
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/MenuHandler.java
@@ -0,0 +1,34 @@
+package co.yixiang.mp.handler;
+
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType;
+
+
+@Component
+public class MenuHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService weixinService,
+                                    WxSessionManager sessionManager) {
+
+        String msg = String.format("type:%s, event:%s, key:%s",
+            wxMessage.getMsgType(), wxMessage.getEvent(),
+            wxMessage.getEventKey());
+        if (MenuButtonType.VIEW.equals(wxMessage.getEvent())) {
+            return null;
+        }
+
+        return WxMpXmlOutMessage.TEXT().content(msg)
+            .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
+            .build();
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/MsgHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/MsgHandler.java
new file mode 100644
index 00000000..9d8f8bc6
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/MsgHandler.java
@@ -0,0 +1,49 @@
+package co.yixiang.mp.handler;
+
+import co.yixiang.mp.builder.TextBuilder;
+import co.yixiang.mp.utils.JsonUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType;
+
+@Component
+public class MsgHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService weixinService,
+                                    WxSessionManager sessionManager) {
+
+        if (!wxMessage.getMsgType().equals(XmlMsgType.EVENT)) {
+            //TODO 可以选择将消息保存到本地
+        }
+
+        //当用户输入关键词如“你好”,“客服”等,并且有客服在线时,把消息转发给在线客服
+        try {
+            if (StringUtils.startsWithAny(wxMessage.getContent(), "你好", "客服")
+                && weixinService.getKefuService().kfOnlineList()
+                .getKfOnlineList().size() > 0) {
+                return WxMpXmlOutMessage.TRANSFER_CUSTOMER_SERVICE()
+                    .fromUser(wxMessage.getToUser())
+                    .toUser(wxMessage.getFromUser()).build();
+            }
+        } catch (WxErrorException e) {
+            e.printStackTrace();
+        }
+
+        //TODO 组装回复消息
+        String content = "收到信息内容:" + JsonUtils.toJson(wxMessage);
+
+        return new TextBuilder().build(content, wxMessage, weixinService);
+
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/NullHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/NullHandler.java
new file mode 100644
index 00000000..d3651f17
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/NullHandler.java
@@ -0,0 +1,21 @@
+package co.yixiang.mp.handler;
+
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Component
+public class NullHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService wxMpService,
+                                    WxSessionManager sessionManager) {
+        return null;
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/ScanHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/ScanHandler.java
new file mode 100644
index 00000000..be6f4462
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/ScanHandler.java
@@ -0,0 +1,22 @@
+package co.yixiang.mp.handler;
+
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+
+@Component
+public class ScanHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMpXmlMessage, Map map,
+                                    WxMpService wxMpService, WxSessionManager wxSessionManager) throws WxErrorException {
+        // 扫码事件处理
+        return null;
+    }
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/StoreCheckNotifyHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/StoreCheckNotifyHandler.java
new file mode 100644
index 00000000..ce692c02
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/StoreCheckNotifyHandler.java
@@ -0,0 +1,26 @@
+package co.yixiang.mp.handler;
+
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * 门店审核事件处理
+ *
+ */
+@Component
+public class StoreCheckNotifyHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService wxMpService,
+                                    WxSessionManager sessionManager) {
+        // TODO 处理门店审核事件
+        return null;
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/SubscribeHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/SubscribeHandler.java
new file mode 100644
index 00000000..76290889
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/SubscribeHandler.java
@@ -0,0 +1,69 @@
+package co.yixiang.mp.handler;
+
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import co.yixiang.mp.builder.TextBuilder;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import me.chanjar.weixin.mp.bean.result.WxMpUser;
+
+
+@Component
+public class SubscribeHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService weixinService,
+                                    WxSessionManager sessionManager) throws WxErrorException {
+
+        this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser());
+
+        // 获取微信用户基本信息
+        try {
+            WxMpUser userWxInfo = weixinService.getUserService()
+                .userInfo(wxMessage.getFromUser(), null);
+            if (userWxInfo != null) {
+                // TODO 可以添加关注用户到本地数据库
+            }
+        } catch (WxErrorException e) {
+            if (e.getError().getErrorCode() == 48001) {
+                this.logger.info("该公众号没有获取用户信息权限!");
+            }
+        }
+
+
+        WxMpXmlOutMessage responseResult = null;
+        try {
+            responseResult = this.handleSpecial(wxMessage);
+        } catch (Exception e) {
+            this.logger.error(e.getMessage(), e);
+        }
+
+        if (responseResult != null) {
+            return responseResult;
+        }
+
+        try {
+            return new TextBuilder().build("感谢关注", wxMessage, weixinService);
+        } catch (Exception e) {
+            this.logger.error(e.getMessage(), e);
+        }
+
+        return null;
+    }
+
+    /**
+     * 处理特殊请求,比如如果是扫码进来的,可以做相应处理
+     */
+    private WxMpXmlOutMessage handleSpecial(WxMpXmlMessage wxMessage)
+        throws Exception {
+        //TODO
+        return null;
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/UnsubscribeHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/UnsubscribeHandler.java
new file mode 100644
index 00000000..97f0c9d8
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/UnsubscribeHandler.java
@@ -0,0 +1,25 @@
+package co.yixiang.mp.handler;
+
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+@Component
+public class UnsubscribeHandler extends AbstractHandler {
+
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map context, WxMpService wxMpService,
+                                    WxSessionManager sessionManager) {
+        String openId = wxMessage.getFromUser();
+        this.logger.info("取消关注用户 OPENID: " + openId);
+        // TODO 可以更新本地数据库为取消关注状态
+        return null;
+    }
+
+}
diff --git a/yshop-mp/src/main/java/co/yixiang/mp/utils/JsonUtils.java b/yshop-mp/src/main/java/co/yixiang/mp/utils/JsonUtils.java
new file mode 100644
index 00000000..5eb49193
--- /dev/null
+++ b/yshop-mp/src/main/java/co/yixiang/mp/utils/JsonUtils.java
@@ -0,0 +1,16 @@
+package co.yixiang.mp.utils;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+/**
+ * @author Binary Wang(https://github.com/binarywang)
+ */
+public class JsonUtils {
+    public static String toJson(Object obj) {
+        Gson gson = new GsonBuilder()
+            .setPrettyPrinting()
+            .create();
+        return gson.toJson(obj);
+    }
+}
diff --git a/yshop-system/pom.xml b/yshop-system/pom.xml
new file mode 100644
index 00000000..16a2a05f
--- /dev/null
+++ b/yshop-system/pom.xml
@@ -0,0 +1,69 @@
+
+
+    
+        yshop
+        co.yixiang
+        1.0
+    
+    4.0.0
+
+    yshop-system
+    核心模块
+
+    
+        0.9.1
+    
+
+    
+        
+            co.yixiang
+            yshop-generator
+            1.0
+            
+                
+                    co.yixiang
+                    yshop-common
+                
+            
+        
+
+        
+            co.yixiang
+            yshop-tools
+            1.0
+        
+
+        
+        
+            io.jsonwebtoken
+            jjwt
+            ${jjwt.version}
+        
+
+        
+        
+            org.quartz-scheduler
+            quartz
+        
+
+    
+
+    
+        
+            
+                org.springframework.boot
+                spring-boot-maven-plugin
+            
+            
+            
+                org.apache.maven.plugins
+                maven-surefire-plugin
+                
+                    true
+                
+            
+        
+    
+
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/AppRun.java b/yshop-system/src/main/java/co/yixiang/AppRun.java
new file mode 100644
index 00000000..aebf04ec
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/AppRun.java
@@ -0,0 +1,27 @@
+package co.yixiang;
+
+import co.yixiang.utils.SpringContextHolder;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @author Zheng Jie
+ * @date 2018/11/15 9:20:19
+ */
+@EnableAsync
+@SpringBootApplication
+@EnableTransactionManagement
+public class AppRun {
+
+    public static void main(String[] args) {
+        SpringApplication.run(AppRun.class, args);
+    }
+
+    @Bean
+    public SpringContextHolder springContextHolder() {
+        return new SpringContextHolder();
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/config/ConfigurerAdapter.java b/yshop-system/src/main/java/co/yixiang/config/ConfigurerAdapter.java
new file mode 100644
index 00000000..e8421fff
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/config/ConfigurerAdapter.java
@@ -0,0 +1,44 @@
+package co.yixiang.config;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * WebMvcConfigurer
+ *
+ * @author Zheng Jie
+ * @date 2018-11-30
+ */
+@Configuration
+@EnableWebMvc
+public class ConfigurerAdapter implements WebMvcConfigurer {
+
+    @Value("${file.path}")
+    private String path;
+
+    @Value("${file.avatar}")
+    private String avatar;
+
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**")
+                .allowCredentials(true)
+                .allowedHeaders("*")
+                .allowedOrigins("*")
+                .allowedMethods("GET","POST","PUT","DELETE");
+
+    }
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        String avatarUtl = "file:" + avatar.replace("\\","/");
+        String pathUtl = "file:" + path.replace("\\","/");
+        registry.addResourceHandler("/avatar/**").addResourceLocations(avatarUtl).setCachePeriod(0);
+        registry.addResourceHandler("/file/**").addResourceLocations(pathUtl).setCachePeriod(0);
+        registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/").setCachePeriod(0);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/config/DataScope.java b/yshop-system/src/main/java/co/yixiang/config/DataScope.java
new file mode 100644
index 00000000..e21bc7a7
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/config/DataScope.java
@@ -0,0 +1,87 @@
+package co.yixiang.config;
+
+import co.yixiang.utils.SecurityUtils;
+import co.yixiang.modules.system.domain.Dept;
+import co.yixiang.modules.system.service.DeptService;
+import co.yixiang.modules.system.service.RoleService;
+import co.yixiang.modules.system.service.UserService;
+import co.yixiang.modules.system.service.dto.RoleSmallDTO;
+import co.yixiang.modules.system.service.dto.UserDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 数据权限配置
+ * @author Zheng Jie
+ * @date 2019-4-1
+ */
+@Component
+public class DataScope {
+
+    private final String[] scopeType = {"全部","本级","自定义"};
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private RoleService roleService;
+
+    @Autowired
+    private DeptService deptService;
+
+    public Set getDeptIds() {
+
+        UserDTO user = userService.findByName(SecurityUtils.getUsername());
+
+        // 用于存储部门id
+        Set deptIds = new HashSet<>();
+
+        // 查询用户角色
+        List roleSet = roleService.findByUsers_Id(user.getId());
+
+        for (RoleSmallDTO role : roleSet) {
+
+            if (scopeType[0].equals(role.getDataScope())) {
+                return new HashSet<>() ;
+            }
+
+            // 存储本级的数据权限
+            if (scopeType[1].equals(role.getDataScope())) {
+                deptIds.add(user.getDept().getId());
+            }
+
+            // 存储自定义的数据权限
+            if (scopeType[2].equals(role.getDataScope())) {
+                Set depts = deptService.findByRoleIds(role.getId());
+                for (Dept dept : depts) {
+                    deptIds.add(dept.getId());
+                    List deptChildren = deptService.findByPid(dept.getId());
+                    if (deptChildren != null && deptChildren.size() != 0) {
+                        deptIds.addAll(getDeptChildren(deptChildren));
+                    }
+                }
+            }
+        }
+        return deptIds;
+    }
+
+
+    public List getDeptChildren(List deptList) {
+        List list = new ArrayList<>();
+        deptList.forEach(dept -> {
+                    if (dept!=null && dept.getEnabled()){
+                        List depts = deptService.findByPid(dept.getId());
+                        if(deptList!=null && deptList.size()!=0){
+                            list.addAll(getDeptChildren(depts));
+                        }
+                        list.add(dept.getId());
+                    }
+                }
+        );
+        return list;
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/config/VisitsInitialization.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/config/VisitsInitialization.java
new file mode 100644
index 00000000..0c98c48f
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/config/VisitsInitialization.java
@@ -0,0 +1,25 @@
+package co.yixiang.modules.monitor.config;
+
+import co.yixiang.modules.monitor.service.VisitsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.stereotype.Component;
+
+/**
+ * 初始化站点统计
+ * @author Zheng Jie
+ */
+@Component
+public class VisitsInitialization implements ApplicationRunner {
+
+    @Autowired
+    private VisitsService visitsService;
+
+    @Override
+    public void run(ApplicationArguments args) throws Exception {
+        System.out.println("--------------- 初始化站点统计,如果存在今日统计则跳过 ---------------");
+        visitsService.save();
+        System.out.println("--------------- 初始化站点统计完成 ---------------");
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/Visits.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/Visits.java
new file mode 100644
index 00000000..b09903f9
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/Visits.java
@@ -0,0 +1,39 @@
+package co.yixiang.modules.monitor.domain;
+
+import lombok.Data;
+import org.hibernate.annotations.CreationTimestamp;
+
+import javax.persistence.*;
+import java.sql.Timestamp;
+
+/**
+ * pv 与 ip 统计
+ *
+ * @author Zheng Jie
+ * @date 2018-12-13
+ */
+@Entity
+@Data
+@Table(name = "visits")
+public class Visits {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @Column(unique = true)
+    private String date;
+
+    @Column(name = "pv_counts")
+    private Long pvCounts;
+
+    @Column(name = "ip_counts")
+    private Long ipCounts;
+
+    @CreationTimestamp
+    @Column(name = "create_time")
+    private Timestamp createTime;
+
+    @Column(name = "week_day")
+    private String weekDay;
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/vo/RedisVo.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/vo/RedisVo.java
new file mode 100644
index 00000000..02cd0caf
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/vo/RedisVo.java
@@ -0,0 +1,24 @@
+package co.yixiang.modules.monitor.domain.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-12-10
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class RedisVo implements Serializable {
+
+    @NotBlank
+    private String key;
+
+    @NotBlank
+    private String value;
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/repository/VisitsRepository.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/repository/VisitsRepository.java
new file mode 100644
index 00000000..41843b45
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/repository/VisitsRepository.java
@@ -0,0 +1,33 @@
+package co.yixiang.modules.monitor.repository;
+
+import co.yixiang.modules.monitor.domain.Visits;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-12-13
+ */
+@Repository
+public interface VisitsRepository extends JpaRepository {
+
+    /**
+     * findByDate
+     * @param date
+     * @return
+     */
+    Visits findByDate(String date);
+
+    /**
+     * 获得一个时间段的记录
+     * @param date1
+     * @param date2
+     * @return
+     */
+    @Query(value = "select * FROM visits where " +
+            "create_time between ?1 and ?2",nativeQuery = true)
+    List findAllVisits(String date1, String date2);
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/LimitController.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/LimitController.java
new file mode 100644
index 00000000..e753ff3f
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/LimitController.java
@@ -0,0 +1,27 @@
+package co.yixiang.modules.monitor.rest;
+
+import co.yixiang.annotation.Limit;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ *
+ * 接口限流测试类
+ */
+@RestController
+@RequestMapping("api")
+public class LimitController {
+    private static final AtomicInteger ATOMIC_INTEGER = new AtomicInteger();
+
+    /**
+     * 测试限流注解,下面配置说明该接口 60秒内最多只能访问 10次,保存到redis的键名为 limit_test,
+     */
+    @Limit(key = "test", period = 60, count = 10, name = "testLimit", prefix = "limit")
+    @GetMapping("/limit")
+    public int testLimit() {
+        return ATOMIC_INTEGER.incrementAndGet();
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/RedisController.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/RedisController.java
new file mode 100644
index 00000000..bb892ed2
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/RedisController.java
@@ -0,0 +1,46 @@
+package co.yixiang.modules.monitor.rest;
+
+import co.yixiang.modules.monitor.service.RedisService;
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.monitor.domain.vo.RedisVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-12-10
+ */
+@RestController
+@RequestMapping("api")
+public class RedisController {
+
+    @Autowired
+    private RedisService redisService;
+
+    @Log("查询Redis缓存")
+    @GetMapping(value = "/redis")
+    @PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_SELECT')")
+    public ResponseEntity getRedis(String key, Pageable pageable){
+        return new ResponseEntity(redisService.findByKey(key,pageable), HttpStatus.OK);
+    }
+
+    @Log("删除Redis缓存")
+    @DeleteMapping(value = "/redis")
+    @PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')")
+    public ResponseEntity delete(@RequestBody RedisVo resources){
+        redisService.delete(resources.getKey());
+        return new ResponseEntity(HttpStatus.OK);
+    }
+
+    @Log("清空Redis缓存")
+    @DeleteMapping(value = "/redis/all")
+    @PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')")
+    public ResponseEntity deleteAll(){
+        redisService.flushdb();
+        return new ResponseEntity(HttpStatus.OK);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/VisitsController.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/VisitsController.java
new file mode 100644
index 00000000..a73aec69
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/VisitsController.java
@@ -0,0 +1,39 @@
+package co.yixiang.modules.monitor.rest;
+
+import co.yixiang.utils.RequestHolder;
+import co.yixiang.modules.monitor.service.VisitsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-12-13
+ */
+@RestController
+@RequestMapping("api")
+public class VisitsController {
+
+    @Autowired
+    private VisitsService visitsService;
+
+    @PostMapping(value = "/visits")
+    public ResponseEntity create(){
+        visitsService.count(RequestHolder.getHttpServletRequest());
+        return new ResponseEntity(HttpStatus.CREATED);
+    }
+
+    @GetMapping(value = "/visits")
+    public ResponseEntity get(){
+        return new ResponseEntity(visitsService.get(),HttpStatus.OK);
+    }
+
+    @GetMapping(value = "/visits/chartData")
+    public ResponseEntity getChartData(){
+        return new ResponseEntity(visitsService.getChartData(),HttpStatus.OK);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/RedisService.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/RedisService.java
new file mode 100644
index 00000000..0838343f
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/RedisService.java
@@ -0,0 +1,44 @@
+package co.yixiang.modules.monitor.service;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+/**
+ * 可自行扩展
+ * @author Zheng Jie
+ * @date 2018-12-10
+ */
+public interface RedisService {
+
+    /**
+     * findById
+     * @param key
+     * @return
+     */
+    Page findByKey(String key, Pageable pageable);
+
+    /**
+     * 查询验证码的值
+     * @param key
+     * @return
+     */
+    String getCodeVal(String key);
+
+    /**
+     * 保存验证码
+     * @param key
+     * @param val
+     */
+    void saveCode(String key, Object val);
+
+    /**
+     * delete
+     * @param key
+     */
+    void delete(String key);
+
+    /**
+     * 清空所有缓存
+     */
+    void flushdb();
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/VisitsService.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/VisitsService.java
new file mode 100644
index 00000000..730b3c74
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/VisitsService.java
@@ -0,0 +1,36 @@
+package co.yixiang.modules.monitor.service;
+
+import org.springframework.scheduling.annotation.Async;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-12-13
+ */
+public interface VisitsService {
+
+    /**
+     * 提供给定时任务,每天0点执行
+     */
+    void save();
+
+    /**
+     * 新增记录
+     * @param request
+     */
+    @Async
+    void count(HttpServletRequest request);
+
+    /**
+     * 获取数据
+     * @return
+     */
+    Object get();
+
+    /**
+     * getChartData
+     * @return
+     */
+    Object getChartData();
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/RedisServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/RedisServiceImpl.java
new file mode 100644
index 00000000..12f4ec69
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/RedisServiceImpl.java
@@ -0,0 +1,76 @@
+package co.yixiang.modules.monitor.service.impl;
+
+import co.yixiang.utils.PageUtil;
+import co.yixiang.modules.monitor.domain.vo.RedisVo;
+import co.yixiang.modules.monitor.service.RedisService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-12-10
+ */
+@Service
+public class RedisServiceImpl implements RedisService {
+
+    @Autowired
+    RedisTemplate redisTemplate;
+
+    @Value("${loginCode.expiration}")
+    private Long expiration;
+
+    @Override
+    public Page findByKey(String key, Pageable pageable){
+        List redisVos = new ArrayList<>();
+        if(!"*".equals(key)){
+            key = "*" + key + "*";
+        }
+        for (Object s : redisTemplate.keys(key)) {
+            // 过滤掉权限的缓存
+            if (s.toString().indexOf("role::loadPermissionByUser") != -1 || s.toString().indexOf("user::loadUserByUsername") != -1) {
+                continue;
+            }
+            RedisVo redisVo = new RedisVo(s.toString(),redisTemplate.opsForValue().get(s.toString()).toString());
+            redisVos.add(redisVo);
+        }
+        Page page = new PageImpl(
+                PageUtil.toPage(pageable.getPageNumber(),pageable.getPageSize(),redisVos),
+                pageable,
+                redisVos.size());
+        return page;
+    }
+
+    @Override
+    public void delete(String key) {
+        redisTemplate.delete(key);
+    }
+
+    @Override
+    public void flushdb() {
+        redisTemplate.getConnectionFactory().getConnection().flushDb();
+    }
+
+    @Override
+    public String getCodeVal(String key) {
+        try {
+            String value = redisTemplate.opsForValue().get(key).toString();
+            return value;
+        }catch (Exception e){
+            return "";
+        }
+    }
+
+    @Override
+    public void saveCode(String key, Object val) {
+        redisTemplate.opsForValue().set(key,val);
+        redisTemplate.expire(key,expiration, TimeUnit.MINUTES);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/VisitsServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/VisitsServiceImpl.java
new file mode 100644
index 00000000..56a01fc5
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/VisitsServiceImpl.java
@@ -0,0 +1,88 @@
+package co.yixiang.modules.monitor.service.impl;
+
+import co.yixiang.modules.monitor.repository.VisitsRepository;
+import co.yixiang.utils.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import co.yixiang.modules.monitor.domain.Visits;
+import co.yixiang.modules.monitor.service.VisitsService;
+import co.yixiang.repository.LogRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDate;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-12-13
+ */
+@Slf4j
+@Service
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
+public class VisitsServiceImpl implements VisitsService {
+
+    @Autowired
+    private VisitsRepository visitsRepository;
+
+    @Autowired
+    private LogRepository logRepository;
+
+    @Override
+    public void save() {
+        LocalDate localDate = LocalDate.now();
+        Visits visits = visitsRepository.findByDate(localDate.toString());
+        if(visits == null){
+            visits = new Visits();
+            visits.setWeekDay(StringUtils.getWeekDay());
+            visits.setPvCounts(1L);
+            visits.setIpCounts(1L);
+            visits.setDate(localDate.toString());
+            visitsRepository.save(visits);
+        }
+    }
+
+    @Override
+    public void count(HttpServletRequest request) {
+        LocalDate localDate = LocalDate.now();
+        Visits visits = visitsRepository.findByDate(localDate.toString());
+        visits.setPvCounts(visits.getPvCounts()+1);
+        long ipCounts = logRepository.findIp(localDate.toString(), localDate.plusDays(1).toString());
+        visits.setIpCounts(ipCounts);
+        visitsRepository.save(visits);
+    }
+
+    @Override
+    public Object get() {
+        Map map = new HashMap();
+        LocalDate localDate = LocalDate.now();
+        Visits visits = visitsRepository.findByDate(localDate.toString());
+        List list = visitsRepository.findAllVisits(localDate.minusDays(6).toString(),localDate.plusDays(1).toString());
+
+        long recentVisits = 0, recentIp = 0;
+        for (Visits data : list) {
+            recentVisits += data.getPvCounts();
+            recentIp += data.getIpCounts();
+        }
+        map.put("newVisits",visits.getPvCounts());
+        map.put("newIp",visits.getIpCounts());
+        map.put("recentVisits",recentVisits);
+        map.put("recentIp",recentIp);
+        return map;
+    }
+
+    @Override
+    public Object getChartData() {
+        Map map = new HashMap();
+        LocalDate localDate = LocalDate.now();
+        List list = visitsRepository.findAllVisits(localDate.minusDays(6).toString(),localDate.plusDays(1).toString());
+        map.put("weekDays",list.stream().map(Visits::getWeekDay).collect(Collectors.toList()));
+        map.put("visitsData",list.stream().map(Visits::getPvCounts).collect(Collectors.toList()));
+        map.put("ipData",list.stream().map(Visits::getIpCounts).collect(Collectors.toList()));
+        return map;
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/config/JobRunner.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/config/JobRunner.java
new file mode 100644
index 00000000..629f8541
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/config/JobRunner.java
@@ -0,0 +1,40 @@
+package co.yixiang.modules.quartz.config;
+
+import co.yixiang.modules.quartz.domain.QuartzJob;
+import co.yixiang.modules.quartz.repository.QuartzJobRepository;
+import co.yixiang.modules.quartz.utils.QuartzManage;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+@Component
+public class JobRunner implements ApplicationRunner {
+
+    @Autowired
+    private QuartzJobRepository quartzJobRepository;
+
+    @Autowired
+    private QuartzManage quartzManage;
+
+    /**
+     * 项目启动时重新激活启用的定时任务
+     * @param applicationArguments
+     * @throws Exception
+     */
+    @Override
+    public void run(ApplicationArguments applicationArguments){
+        System.out.println("--------------------注入定时任务---------------------");
+        List quartzJobs = quartzJobRepository.findByIsPauseIsFalse();
+        quartzJobs.forEach(quartzJob -> {
+            quartzManage.addJob(quartzJob);
+        });
+        System.out.println("--------------------定时任务注入完成---------------------");
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/config/QuartzConfig.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/config/QuartzConfig.java
new file mode 100644
index 00000000..a1d2ad01
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/config/QuartzConfig.java
@@ -0,0 +1,55 @@
+package co.yixiang.modules.quartz.config;
+
+import org.quartz.Scheduler;
+import org.quartz.spi.TriggerFiredBundle;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.quartz.AdaptableJobFactory;
+import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+import org.springframework.stereotype.Component;
+
+/**
+ * 定时任务配置
+ * @author
+ * @date 2019-01-07
+ */
+@Configuration
+public class QuartzConfig {
+
+	/**
+	 * 解决Job中注入Spring Bean为null的问题
+	 */
+	@Component("quartzJobFactory")
+	public class QuartzJobFactory extends AdaptableJobFactory {
+
+		@Autowired
+		private AutowireCapableBeanFactory capableBeanFactory;
+
+		@Override
+		protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception {
+
+			//调用父类的方法
+			Object jobInstance = super.createJobInstance(bundle);
+			capableBeanFactory.autowireBean(jobInstance);
+			return jobInstance;
+		}
+	}
+
+	/**
+	 * 注入scheduler到spring
+	 * @param quartzJobFactory
+	 * @return
+	 * @throws Exception
+	 */
+	@Bean(name = "scheduler")
+	public Scheduler scheduler(QuartzJobFactory quartzJobFactory) throws Exception {
+		SchedulerFactoryBean factoryBean=new SchedulerFactoryBean();
+		factoryBean.setJobFactory(quartzJobFactory);
+		factoryBean.afterPropertiesSet();
+		Scheduler scheduler=factoryBean.getScheduler();
+		scheduler.start();
+		return scheduler;
+	}
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/domain/QuartzJob.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/domain/QuartzJob.java
new file mode 100644
index 00000000..ef1a1d56
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/domain/QuartzJob.java
@@ -0,0 +1,82 @@
+package co.yixiang.modules.quartz.domain;
+
+import lombok.Data;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+@Data
+@Entity
+@Table(name = "quartz_job")
+public class QuartzJob implements Serializable {
+
+    public static final String JOB_KEY = "JOB_KEY";
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @NotNull(groups = {Update.class})
+    private Long id;
+
+    /**
+     * 定时器名称
+     */
+    @Column(name = "job_name")
+    private String jobName;
+
+    /**
+     * Bean名称
+     */
+    @Column(name = "bean_name")
+    @NotBlank
+    private String beanName;
+
+    /**
+     * 方法名称
+     */
+    @Column(name = "method_name")
+    @NotBlank
+    private String methodName;
+
+    /**
+     * 参数
+     */
+    @Column(name = "params")
+    private String params;
+
+    /**
+     * cron表达式
+     */
+    @Column(name = "cron_expression")
+    @NotBlank
+    private String cronExpression;
+
+    /**
+     * 状态
+     */
+    @Column(name = "is_pause")
+    private Boolean isPause = false;
+
+    /**
+     * 备注
+     */
+    @Column(name = "remark")
+    @NotBlank
+    private String remark;
+
+    /**
+     * 创建日期
+     */
+    @UpdateTimestamp
+    @Column(name = "update_time")
+    private Timestamp updateTime;
+
+    public interface Update{}
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/domain/QuartzLog.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/domain/QuartzLog.java
new file mode 100644
index 00000000..2532a08c
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/domain/QuartzLog.java
@@ -0,0 +1,76 @@
+package co.yixiang.modules.quartz.domain;
+
+import lombok.Data;
+import org.hibernate.annotations.CreationTimestamp;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+@Entity
+@Data
+@Table(name = "quartz_log")
+public class QuartzLog implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 任务名称
+     */
+    @Column(name = "job_name")
+    private String jobName;
+
+    /**
+     * Bean名称
+     */
+    @Column(name = "baen_name")
+    private String beanName;
+
+    /**
+     * 方法名称
+     */
+    @Column(name = "method_name")
+    private String methodName;
+
+    /**
+     * 参数
+     */
+    @Column(name = "params")
+    private String params;
+
+    /**
+     * cron表达式
+     */
+    @Column(name = "cron_expression")
+    private String cronExpression;
+
+    /**
+     * 状态
+     */
+    @Column(name = "is_success")
+    private Boolean isSuccess;
+
+    /**
+     * 异常详细
+     */
+    @Column(name = "exception_detail",columnDefinition = "text")
+    private String exceptionDetail;
+
+    /**
+     * 耗时(毫秒)
+     */
+    private Long time;
+
+    /**
+     * 创建日期
+     */
+    @CreationTimestamp
+    @Column(name = "create_time")
+    private Timestamp createTime;
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/repository/QuartzJobRepository.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/repository/QuartzJobRepository.java
new file mode 100644
index 00000000..29aef07a
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/repository/QuartzJobRepository.java
@@ -0,0 +1,19 @@
+package co.yixiang.modules.quartz.repository;
+
+import co.yixiang.modules.quartz.domain.QuartzJob;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import java.util.List;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+public interface QuartzJobRepository extends JpaRepository, JpaSpecificationExecutor {
+
+    /**
+     * 查询启用的任务
+     * @return
+     */
+    List findByIsPauseIsFalse();
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/repository/QuartzLogRepository.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/repository/QuartzLogRepository.java
new file mode 100644
index 00000000..5ded7792
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/repository/QuartzLogRepository.java
@@ -0,0 +1,13 @@
+package co.yixiang.modules.quartz.repository;
+
+import co.yixiang.modules.quartz.domain.QuartzLog;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+public interface QuartzLogRepository extends JpaRepository, JpaSpecificationExecutor {
+
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/rest/QuartzJobController.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/rest/QuartzJobController.java
new file mode 100644
index 00000000..a0d76158
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/rest/QuartzJobController.java
@@ -0,0 +1,85 @@
+package co.yixiang.modules.quartz.rest;
+
+import co.yixiang.exception.BadRequestException;
+import co.yixiang.modules.quartz.domain.QuartzJob;
+import co.yixiang.modules.quartz.service.QuartzJobService;
+import lombok.extern.slf4j.Slf4j;
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.quartz.service.dto.JobQueryCriteria;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+@Slf4j
+@RestController
+@RequestMapping("/api")
+public class QuartzJobController {
+
+    private static final String ENTITY_NAME = "quartzJob";
+
+    @Autowired
+    private QuartzJobService quartzJobService;
+
+    @Log("查询定时任务")
+    @GetMapping(value = "/jobs")
+    @PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_SELECT')")
+    public ResponseEntity getJobs(JobQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity(quartzJobService.queryAll(criteria,pageable), HttpStatus.OK);
+    }
+
+    @GetMapping(value = "/jobLogs")
+    @PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_SELECT')")
+    public ResponseEntity getJobLogs(JobQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity(quartzJobService.queryAllLog(criteria,pageable), HttpStatus.OK);
+    }
+
+    @Log("新增定时任务")
+    @PostMapping(value = "/jobs")
+    @PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_CREATE')")
+    public ResponseEntity create(@Validated @RequestBody QuartzJob resources){
+        if (resources.getId() != null) {
+            throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
+        }
+        return new ResponseEntity(quartzJobService.create(resources),HttpStatus.CREATED);
+    }
+
+    @Log("修改定时任务")
+    @PutMapping(value = "/jobs")
+    @PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
+    public ResponseEntity update(@Validated(QuartzJob.Update.class) @RequestBody QuartzJob resources){
+        quartzJobService.update(resources);
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("更改定时任务状态")
+    @PutMapping(value = "/jobs/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
+    public ResponseEntity updateIsPause(@PathVariable Long id){
+        quartzJobService.updateIsPause(quartzJobService.findById(id));
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("执行定时任务")
+    @PutMapping(value = "/jobs/exec/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
+    public ResponseEntity execution(@PathVariable Long id){
+        quartzJobService.execution(quartzJobService.findById(id));
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除定时任务")
+    @DeleteMapping(value = "/jobs/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_DELETE')")
+    public ResponseEntity delete(@PathVariable Long id){
+        quartzJobService.delete(quartzJobService.findById(id));
+        return new ResponseEntity(HttpStatus.OK);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/QuartzJobService.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/QuartzJobService.java
new file mode 100644
index 00000000..56f9eae5
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/QuartzJobService.java
@@ -0,0 +1,77 @@
+package co.yixiang.modules.quartz.service;
+
+import co.yixiang.modules.quartz.domain.QuartzJob;
+import co.yixiang.modules.quartz.service.dto.JobQueryCriteria;
+import org.springframework.cache.annotation.CacheConfig;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.domain.Pageable;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+@CacheConfig(cacheNames = "quartzJob")
+public interface QuartzJobService {
+
+    /**
+     * queryAll quartzJob
+     * @param criteria
+     * @param pageable
+     * @return
+     */
+    @Cacheable
+    Object queryAll(JobQueryCriteria criteria, Pageable pageable);
+
+    /**
+     * queryAll quartzLog
+     * @param criteria
+     * @param pageable
+     * @return
+     */
+    Object queryAllLog(JobQueryCriteria criteria, Pageable pageable);
+
+    /**
+     * create
+     * @param resources
+     * @return
+     */
+    @CacheEvict(allEntries = true)
+    QuartzJob create(QuartzJob resources);
+
+    /**
+     * update
+     * @param resources
+     * @return
+     */
+    @CacheEvict(allEntries = true)
+    void update(QuartzJob resources);
+
+    /**
+     * del
+     * @param quartzJob
+     */
+    @CacheEvict(allEntries = true)
+    void delete(QuartzJob quartzJob);
+
+    /**
+     * findById
+     * @param id
+     * @return
+     */
+    @Cacheable(key = "#p0")
+    QuartzJob findById(Long id);
+
+    /**
+     * 更改定时任务状态
+     * @param quartzJob
+     */
+    @CacheEvict(allEntries = true)
+    void updateIsPause(QuartzJob quartzJob);
+
+    /**
+     * 立即执行定时任务
+     * @param quartzJob
+     */
+    void execution(QuartzJob quartzJob);
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/JobQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/JobQueryCriteria.java
new file mode 100644
index 00000000..5f2a8d36
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/JobQueryCriteria.java
@@ -0,0 +1,18 @@
+package co.yixiang.modules.quartz.service.dto;
+
+import co.yixiang.annotation.Query;
+import lombok.Data;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-6-4 10:33:02
+ */
+@Data
+public class JobQueryCriteria {
+
+    @Query(type = Query.Type.INNER_LIKE)
+    private String jobName;
+
+    @Query
+    private Boolean isSuccess;
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/impl/QuartzJobServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/impl/QuartzJobServiceImpl.java
new file mode 100644
index 00000000..65d2ede6
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/impl/QuartzJobServiceImpl.java
@@ -0,0 +1,111 @@
+package co.yixiang.modules.quartz.service.impl;
+
+import co.yixiang.exception.BadRequestException;
+import co.yixiang.modules.quartz.domain.QuartzJob;
+import co.yixiang.modules.quartz.repository.QuartzJobRepository;
+import co.yixiang.modules.quartz.repository.QuartzLogRepository;
+import co.yixiang.modules.quartz.service.QuartzJobService;
+import co.yixiang.modules.quartz.utils.QuartzManage;
+import co.yixiang.utils.PageUtil;
+import co.yixiang.utils.QueryHelp;
+import co.yixiang.utils.ValidationUtil;
+import co.yixiang.modules.quartz.service.dto.JobQueryCriteria;
+import org.quartz.CronExpression;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.Optional;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+@Service(value = "quartzJobService")
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
+public class QuartzJobServiceImpl implements QuartzJobService {
+
+    @Autowired
+    private QuartzJobRepository quartzJobRepository;
+
+    @Autowired
+    private QuartzLogRepository quartzLogRepository;
+
+    @Autowired
+    private QuartzManage quartzManage;
+
+    @Override
+    public Object queryAll(JobQueryCriteria criteria, Pageable pageable){
+        return PageUtil.toPage(quartzJobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable));
+    }
+
+    @Override
+    public Object queryAllLog(JobQueryCriteria criteria, Pageable pageable){
+        return PageUtil.toPage(quartzLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable));
+    }
+
+    @Override
+    public QuartzJob findById(Long id) {
+        Optional quartzJob = quartzJobRepository.findById(id);
+        ValidationUtil.isNull(quartzJob,"QuartzJob","id",id);
+        return quartzJob.get();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public QuartzJob create(QuartzJob resources) {
+        if (!CronExpression.isValidExpression(resources.getCronExpression())){
+            throw new BadRequestException("cron表达式格式错误");
+        }
+        resources = quartzJobRepository.save(resources);
+        quartzManage.addJob(resources);
+        return resources;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(QuartzJob resources) {
+        if(resources.getId().equals(1L)){
+            throw new BadRequestException("该任务不可操作");
+        }
+        if (!CronExpression.isValidExpression(resources.getCronExpression())){
+            throw new BadRequestException("cron表达式格式错误");
+        }
+        resources = quartzJobRepository.save(resources);
+        quartzManage.updateJobCron(resources);
+    }
+
+    @Override
+    public void updateIsPause(QuartzJob quartzJob) {
+        if(quartzJob.getId().equals(1L)){
+            throw new BadRequestException("该任务不可操作");
+        }
+        if (quartzJob.getIsPause()) {
+            quartzManage.resumeJob(quartzJob);
+            quartzJob.setIsPause(false);
+        } else {
+            quartzManage.pauseJob(quartzJob);
+            quartzJob.setIsPause(true);
+        }
+        quartzJobRepository.save(quartzJob);
+    }
+
+    @Override
+    public void execution(QuartzJob quartzJob) {
+        if(quartzJob.getId().equals(1L)){
+            throw new BadRequestException("该任务不可操作");
+        }
+        quartzManage.runAJobNow(quartzJob);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delete(QuartzJob quartzJob) {
+        if(quartzJob.getId().equals(1L)){
+            throw new BadRequestException("该任务不可操作");
+        }
+        quartzManage.deleteJob(quartzJob);
+        quartzJobRepository.delete(quartzJob);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/task/TestTask.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/task/TestTask.java
new file mode 100644
index 00000000..3c485440
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/task/TestTask.java
@@ -0,0 +1,22 @@
+package co.yixiang.modules.quartz.task;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * 测试用
+ * @author Zheng Jie
+ * @date 2019-01-08
+ */
+@Slf4j
+@Component
+public class TestTask {
+
+    public void run(){
+        log.info("执行成功");
+    }
+
+    public void run1(String str){
+        log.info("执行成功,参数为: {}" + str);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/task/VisitsTask.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/task/VisitsTask.java
new file mode 100644
index 00000000..4576bae4
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/task/VisitsTask.java
@@ -0,0 +1,20 @@
+package co.yixiang.modules.quartz.task;
+
+import co.yixiang.modules.monitor.service.VisitsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-12-25
+ */
+@Component
+public class VisitsTask {
+
+    @Autowired
+    private VisitsService visitsService;
+
+    public void run(){
+        visitsService.save();
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/ExecutionJob.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/ExecutionJob.java
new file mode 100644
index 00000000..466e23cd
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/ExecutionJob.java
@@ -0,0 +1,72 @@
+package co.yixiang.modules.quartz.utils;
+
+import co.yixiang.modules.quartz.domain.QuartzJob;
+import co.yixiang.modules.quartz.domain.QuartzLog;
+import co.yixiang.modules.quartz.service.QuartzJobService;
+import co.yixiang.utils.SpringContextHolder;
+import co.yixiang.utils.ThrowableUtil;
+import co.yixiang.modules.quartz.repository.QuartzLogRepository;
+import org.quartz.JobExecutionContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+/**
+ * 参考人人开源,https://gitee.com/renrenio/renren-security
+ * @author
+ * @date 2019-01-07
+ */
+@Async
+public class ExecutionJob extends QuartzJobBean {
+
+    private Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    // 建议自定义线程池实现方式,该处仅供参考
+    private ExecutorService executorService = Executors.newSingleThreadExecutor();
+
+    @Override
+    protected void executeInternal(JobExecutionContext context) {
+        QuartzJob quartzJob = (QuartzJob) context.getMergedJobDataMap().get(QuartzJob.JOB_KEY);
+        // 获取spring bean
+        QuartzLogRepository quartzLogRepository = SpringContextHolder.getBean("quartzLogRepository");
+        QuartzJobService quartzJobService = SpringContextHolder.getBean("quartzJobService");
+        QuartzManage quartzManage = SpringContextHolder.getBean("quartzManage");
+
+        QuartzLog log = new QuartzLog();
+        log.setJobName(quartzJob.getJobName());
+        log.setBeanName(quartzJob.getBeanName());
+        log.setMethodName(quartzJob.getMethodName());
+        log.setParams(quartzJob.getParams());
+        long startTime = System.currentTimeMillis();
+        log.setCronExpression(quartzJob.getCronExpression());
+        try {
+            // 执行任务
+            logger.info("任务准备执行,任务名称:{}", quartzJob.getJobName());
+            QuartzRunnable task = new QuartzRunnable(quartzJob.getBeanName(), quartzJob.getMethodName(),
+                    quartzJob.getParams());
+            Future future = executorService.submit(task);
+            future.get();
+            long times = System.currentTimeMillis() - startTime;
+            log.setTime(times);
+            // 任务状态
+            log.setIsSuccess(true);
+            logger.info("任务执行完毕,任务名称:{} 总共耗时:{} 毫秒", quartzJob.getJobName(), times);
+        } catch (Exception e) {
+            logger.error("任务执行失败,任务名称:{}" + quartzJob.getJobName(), e);
+            long times = System.currentTimeMillis() - startTime;
+            log.setTime(times);
+            // 任务状态 0:成功 1:失败
+            log.setIsSuccess(false);
+            log.setExceptionDetail(ThrowableUtil.getStackTrace(e));
+            quartzJob.setIsPause(false);
+            //更新状态
+            quartzJobService.updateIsPause(quartzJob);
+        } finally {
+            quartzLogRepository.save(log);
+        }
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/QuartzManage.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/QuartzManage.java
new file mode 100644
index 00000000..878588e3
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/QuartzManage.java
@@ -0,0 +1,161 @@
+package co.yixiang.modules.quartz.utils;
+
+import co.yixiang.exception.BadRequestException;
+import co.yixiang.modules.quartz.domain.QuartzJob;
+import lombok.extern.slf4j.Slf4j;
+import org.quartz.*;
+import org.quartz.impl.triggers.CronTriggerImpl;
+import org.springframework.stereotype.Component;
+import javax.annotation.Resource;
+import java.util.Date;
+import static org.quartz.TriggerBuilder.newTrigger;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-01-07
+ */
+@Slf4j
+@Component
+public class QuartzManage {
+
+    private static final String JOB_NAME = "TASK_";
+
+    @Resource(name = "scheduler")
+    private Scheduler scheduler;
+
+    public void addJob(QuartzJob quartzJob){
+        try {
+            // 构建job信息
+            JobDetail jobDetail = JobBuilder.newJob(ExecutionJob.class).
+                    withIdentity(JOB_NAME + quartzJob.getId()).build();
+
+            //通过触发器名和cron 表达式创建 Trigger
+            Trigger cronTrigger = newTrigger()
+                    .withIdentity(JOB_NAME + quartzJob.getId())
+                    .startNow()
+                    .withSchedule(CronScheduleBuilder.cronSchedule(quartzJob.getCronExpression()))
+                    .build();
+
+            cronTrigger.getJobDataMap().put(QuartzJob.JOB_KEY, quartzJob);
+
+            //重置启动时间
+            ((CronTriggerImpl)cronTrigger).setStartTime(new Date());
+
+            //执行定时任务
+            scheduler.scheduleJob(jobDetail,cronTrigger);
+
+            // 暂停任务
+            if (quartzJob.getIsPause()) {
+                pauseJob(quartzJob);
+            }
+        } catch (Exception e){
+            log.error("创建定时任务失败", e);
+            throw new BadRequestException("创建定时任务失败");
+        }
+    }
+
+    /**
+     * 更新job cron表达式
+     * @param quartzJob
+     * @throws SchedulerException
+     */
+    public void updateJobCron(QuartzJob quartzJob){
+        try {
+            TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getId());
+            CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
+            // 如果不存在则创建一个定时任务
+            if(trigger == null){
+                addJob(quartzJob);
+                trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
+            }
+            CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(quartzJob.getCronExpression());
+            trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
+            //重置启动时间
+            ((CronTriggerImpl)trigger).setStartTime(new Date());
+            trigger.getJobDataMap().put(QuartzJob.JOB_KEY,quartzJob);
+
+            scheduler.rescheduleJob(triggerKey, trigger);
+            // 暂停任务
+            if (quartzJob.getIsPause()) {
+                pauseJob(quartzJob);
+            }
+        } catch (Exception e){
+            log.error("更新定时任务失败", e);
+            throw new BadRequestException("更新定时任务失败");
+        }
+
+    }
+
+    /**
+     * 删除一个job
+     * @param quartzJob
+     * @throws SchedulerException
+     */
+    public void deleteJob(QuartzJob quartzJob){
+        try {
+            JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getId());
+            scheduler.pauseJob(jobKey);
+            scheduler.deleteJob(jobKey);
+        } catch (Exception e){
+            log.error("删除定时任务失败", e);
+            throw new BadRequestException("删除定时任务失败");
+        }
+    }
+
+    /**
+     * 恢复一个job
+     * @param quartzJob
+     * @throws SchedulerException
+     */
+    public void resumeJob(QuartzJob quartzJob){
+        try {
+            TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getId());
+            CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
+            // 如果不存在则创建一个定时任务
+            if(trigger == null)
+                addJob(quartzJob);
+            JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getId());
+            scheduler.resumeJob(jobKey);
+        } catch (Exception e){
+            log.error("恢复定时任务失败", e);
+            throw new BadRequestException("恢复定时任务失败");
+        }
+    }
+
+    /**
+     * 立即执行job
+     * @param quartzJob
+     * @throws SchedulerException
+     */
+    public void runAJobNow(QuartzJob quartzJob){
+        try {
+            TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getId());
+            CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
+            // 如果不存在则创建一个定时任务
+            if(trigger == null)
+                addJob(quartzJob);
+            JobDataMap dataMap = new JobDataMap();
+            dataMap.put(QuartzJob.JOB_KEY, quartzJob);
+            JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getId());
+            scheduler.triggerJob(jobKey,dataMap);
+        } catch (Exception e){
+            log.error("定时任务执行失败", e);
+            throw new BadRequestException("定时任务执行失败");
+        }
+    }
+
+    /**
+     * 暂停一个job
+     * @param quartzJob
+     * @throws SchedulerException
+     */
+    public void pauseJob(QuartzJob quartzJob){
+        try {
+            JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getId());
+            scheduler.pauseJob(jobKey);
+        } catch (Exception e){
+            log.error("定时任务暂停失败", e);
+            throw new BadRequestException("定时任务暂停失败");
+        }
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/QuartzRunnable.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/QuartzRunnable.java
new file mode 100644
index 00000000..c0a0e148
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/utils/QuartzRunnable.java
@@ -0,0 +1,43 @@
+package co.yixiang.modules.quartz.utils;
+
+import co.yixiang.utils.SpringContextHolder;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.util.ReflectionUtils;
+import java.lang.reflect.Method;
+import java.util.concurrent.Callable;
+
+/**
+ * 执行定时任务
+ * @author
+ */
+@Slf4j
+public class QuartzRunnable implements Callable {
+
+	private Object target;
+	private Method method;
+	private String params;
+
+	QuartzRunnable(String beanName, String methodName, String params)
+			throws NoSuchMethodException, SecurityException {
+		this.target = SpringContextHolder.getBean(beanName);
+		this.params = params;
+
+		if (StringUtils.isNotBlank(params)) {
+			this.method = target.getClass().getDeclaredMethod(methodName, String.class);
+		} else {
+			this.method = target.getClass().getDeclaredMethod(methodName);
+		}
+	}
+
+	@Override
+	public Object call() throws Exception {
+		ReflectionUtils.makeAccessible(method);
+		if (StringUtils.isNotBlank(params)) {
+			method.invoke(target, params);
+		} else {
+			method.invoke(target);
+		}
+		return null;
+	}
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/config/SecurityConfig.java b/yshop-system/src/main/java/co/yixiang/modules/security/config/SecurityConfig.java
new file mode 100644
index 00000000..fb633fe1
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/config/SecurityConfig.java
@@ -0,0 +1,125 @@
+package co.yixiang.modules.security.config;
+
+import co.yixiang.modules.security.security.JwtAuthenticationEntryPoint;
+import co.yixiang.modules.security.security.JwtAuthorizationTokenFilter;
+import co.yixiang.modules.security.service.JwtUserDetailsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpMethod;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.config.core.GrantedAuthorityDefaults;
+import org.springframework.security.config.http.SessionCreationPolicy;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
+
+@Configuration
+@EnableWebSecurity
+@EnableGlobalMethodSecurity(prePostEnabled = true)
+public class SecurityConfig extends WebSecurityConfigurerAdapter {
+
+    @Autowired
+    private JwtAuthenticationEntryPoint unauthorizedHandler;
+
+    @Autowired
+    private JwtUserDetailsService jwtUserDetailsService;
+
+    /**
+     * 自定义基于JWT的安全过滤器
+     */
+    @Autowired
+    JwtAuthorizationTokenFilter authenticationTokenFilter;
+
+    @Value("${jwt.header}")
+    private String tokenHeader;
+
+    @Value("${jwt.auth.path}")
+    private String loginPath;
+
+    @Autowired
+    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
+        auth
+                .userDetailsService(jwtUserDetailsService)
+                .passwordEncoder(passwordEncoderBean());
+    }
+
+    @Bean
+    GrantedAuthorityDefaults grantedAuthorityDefaults() {
+        // Remove the ROLE_ prefix
+        return new GrantedAuthorityDefaults("");
+    }
+
+    @Bean
+    public PasswordEncoder passwordEncoderBean() {
+        return new BCryptPasswordEncoder();
+    }
+
+    @Bean
+    @Override
+    public AuthenticationManager authenticationManagerBean() throws Exception {
+        return super.authenticationManagerBean();
+    }
+
+    @Override
+    protected void configure(HttpSecurity httpSecurity) throws Exception {
+
+        httpSecurity
+
+                // 禁用 CSRF
+                .csrf().disable()
+
+                // 授权异常
+                .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
+
+                // 不创建会话
+                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
+
+                // 过滤请求
+                .authorizeRequests()
+                .antMatchers(
+                        HttpMethod.GET,
+                        "/*.html",
+                        "/**/*.html",
+                        "/**/*.css",
+                        "/**/*.js"
+                ).anonymous()
+
+                .antMatchers( HttpMethod.POST,"/auth/"+loginPath).anonymous()
+                .antMatchers("/auth/vCode").anonymous()
+                // 支付宝回调
+                .antMatchers("/api/aliPay/return").anonymous()
+                .antMatchers("/api/aliPay/notify").anonymous()
+
+                // swagger start
+                .antMatchers("/swagger-ui.html").anonymous()
+                .antMatchers("/swagger-resources/**").anonymous()
+                .antMatchers("/webjars/**").anonymous()
+                .antMatchers("/*/api-docs").anonymous()
+                // swagger end
+
+                // 接口限流测试
+                .antMatchers("/test/**").anonymous()
+                // 文件
+                .antMatchers("/avatar/**").anonymous()
+                .antMatchers("/file/**").anonymous()
+
+                // 放行OPTIONS请求
+                .antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
+
+                .antMatchers("/druid/**").anonymous()
+                // 所有请求都需要认证
+                .anyRequest().authenticated()
+                // 防止iframe 造成跨域
+                .and().headers().frameOptions().disable();
+
+        httpSecurity
+                .addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/rest/AuthenticationController.java b/yshop-system/src/main/java/co/yixiang/modules/security/rest/AuthenticationController.java
new file mode 100644
index 00000000..d9d65c3c
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/rest/AuthenticationController.java
@@ -0,0 +1,122 @@
+package co.yixiang.modules.security.rest;
+
+import cn.hutool.core.codec.Base64;
+import cn.hutool.core.util.IdUtil;
+import co.yixiang.exception.BadRequestException;
+import co.yixiang.modules.monitor.service.RedisService;
+import co.yixiang.modules.security.security.AuthenticationInfo;
+import co.yixiang.modules.security.security.AuthorizationUser;
+import co.yixiang.modules.security.security.JwtUser;
+import co.yixiang.modules.security.utils.JwtTokenUtil;
+import co.yixiang.modules.security.utils.VerifyCodeUtils;
+import co.yixiang.utils.EncryptUtils;
+import co.yixiang.utils.SecurityUtils;
+import co.yixiang.utils.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.security.security.ImgResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.authentication.AccountExpiredException;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-11-23
+ * 授权、根据token获取用户详细信息
+ */
+@Slf4j
+@RestController
+@RequestMapping("auth")
+public class AuthenticationController {
+
+    @Value("${jwt.header}")
+    private String tokenHeader;
+
+    @Autowired
+    private JwtTokenUtil jwtTokenUtil;
+
+    @Autowired
+    private RedisService redisService;
+
+    @Autowired
+    @Qualifier("jwtUserDetailsService")
+    private UserDetailsService userDetailsService;
+
+    /**
+     * 登录授权
+     * @param authorizationUser
+     * @return
+     */
+    @Log("用户登录")
+    @PostMapping(value = "${jwt.auth.path}")
+    public ResponseEntity login(@Validated @RequestBody AuthorizationUser authorizationUser){
+
+        // 查询验证码
+        String code = redisService.getCodeVal(authorizationUser.getUuid());
+        // 清除验证码
+        redisService.delete(authorizationUser.getUuid());
+        if (StringUtils.isBlank(code)) {
+            throw new BadRequestException("验证码已过期");
+        }
+        if (StringUtils.isBlank(authorizationUser.getCode()) || !authorizationUser.getCode().equalsIgnoreCase(code)) {
+            throw new BadRequestException("验证码错误");
+        }
+        final JwtUser jwtUser = (JwtUser) userDetailsService.loadUserByUsername(authorizationUser.getUsername());
+
+        if(!jwtUser.getPassword().equals(EncryptUtils.encryptPassword(authorizationUser.getPassword()))){
+            throw new AccountExpiredException("密码错误");
+        }
+
+        if(!jwtUser.isEnabled()){
+            throw new AccountExpiredException("账号已停用,请联系管理员");
+        }
+
+        // 生成令牌
+        final String token = jwtTokenUtil.generateToken(jwtUser);
+
+        // 返回 token
+        return ResponseEntity.ok(new AuthenticationInfo(token,jwtUser));
+    }
+
+    /**
+     * 获取用户信息
+     * @return
+     */
+    @GetMapping(value = "${jwt.auth.account}")
+    public ResponseEntity getUserInfo(){
+        JwtUser jwtUser = (JwtUser)userDetailsService.loadUserByUsername(SecurityUtils.getUsername());
+        return ResponseEntity.ok(jwtUser);
+    }
+
+    /**
+     * 获取验证码
+     */
+    @GetMapping(value = "vCode")
+    public ImgResult getCode(HttpServletResponse response) throws IOException {
+
+        //生成随机字串
+        String verifyCode = VerifyCodeUtils.generateVerifyCode(4);
+        String uuid = IdUtil.simpleUUID();
+        redisService.saveCode(uuid,verifyCode);
+        // 生成图片
+        int w = 111, h = 36;
+        ByteArrayOutputStream stream = new ByteArrayOutputStream();
+        VerifyCodeUtils.outputImage(w, h, stream, verifyCode);
+        try {
+            return new ImgResult(Base64.encode(stream.toByteArray()),uuid);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        } finally {
+            stream.close();
+        }
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/AuthenticationInfo.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/AuthenticationInfo.java
new file mode 100644
index 00000000..a81d1afb
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/AuthenticationInfo.java
@@ -0,0 +1,19 @@
+package co.yixiang.modules.security.security;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import java.io.Serializable;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-11-23
+ * 返回token
+ */
+@Getter
+@AllArgsConstructor
+public class AuthenticationInfo implements Serializable {
+
+    private final String token;
+
+    private final JwtUser user;
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/AuthorizationUser.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/AuthorizationUser.java
new file mode 100644
index 00000000..4abe8f72
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/AuthorizationUser.java
@@ -0,0 +1,30 @@
+package co.yixiang.modules.security.security;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-11-30
+ */
+@Getter
+@Setter
+public class AuthorizationUser {
+
+    @NotBlank
+    private String username;
+
+    @NotBlank
+    private String password;
+
+    private String code;
+
+    private String uuid = "";
+
+    @Override
+    public String toString() {
+        return "{username=" + username  + ", password= ******}";
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/ImgResult.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/ImgResult.java
new file mode 100644
index 00000000..627f5deb
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/ImgResult.java
@@ -0,0 +1,17 @@
+package co.yixiang.modules.security.security;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * @author Zheng Jie
+ * @date 2019-6-5 17:29:57
+ */
+@Data
+@AllArgsConstructor
+public class ImgResult {
+
+    private String img;
+
+    private String uuid;
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAuthenticationEntryPoint.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAuthenticationEntryPoint.java
new file mode 100644
index 00000000..c872396d
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAuthenticationEntryPoint.java
@@ -0,0 +1,26 @@
+package co.yixiang.modules.security.security;
+
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.Serializable;
+
+@Component
+public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint, Serializable {
+
+    private static final long serialVersionUID = -8970718410437077606L;
+
+    @Override
+    public void commence(HttpServletRequest request,
+                         HttpServletResponse response,
+                         AuthenticationException authException) throws IOException {
+        /**
+         * 当用户尝试访问安全的REST资源而不提供任何凭据时,将调用此方法发送401 响应
+         */
+        response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException==null?"Unauthorized":authException.getMessage());
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAuthorizationTokenFilter.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAuthorizationTokenFilter.java
new file mode 100644
index 00000000..2e849831
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAuthorizationTokenFilter.java
@@ -0,0 +1,66 @@
+package co.yixiang.modules.security.security;
+
+import io.jsonwebtoken.ExpiredJwtException;
+import lombok.extern.slf4j.Slf4j;
+import co.yixiang.modules.security.utils.JwtTokenUtil;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
+import org.springframework.stereotype.Component;
+import org.springframework.web.filter.OncePerRequestFilter;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@Slf4j
+@Component
+public class JwtAuthorizationTokenFilter extends OncePerRequestFilter {
+
+    private final UserDetailsService userDetailsService;
+    private final JwtTokenUtil jwtTokenUtil;
+    private final String tokenHeader;
+
+    public JwtAuthorizationTokenFilter(@Qualifier("jwtUserDetailsService") UserDetailsService userDetailsService, JwtTokenUtil jwtTokenUtil, @Value("${jwt.header}") String tokenHeader) {
+        this.userDetailsService = userDetailsService;
+        this.jwtTokenUtil = jwtTokenUtil;
+        this.tokenHeader = tokenHeader;
+    }
+
+    @Override
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
+
+        final String requestHeader = request.getHeader(this.tokenHeader);
+
+        String username = null;
+        String authToken = null;
+        if (requestHeader != null && requestHeader.startsWith("Bearer ")) {
+            authToken = requestHeader.substring(7);
+            try {
+                username = jwtTokenUtil.getUsernameFromToken(authToken);
+            } catch (ExpiredJwtException e) {
+                log.error(e.getMessage());
+            }
+        }
+
+        if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
+
+            // It is not compelling necessary to load the use details from the database. You could also store the information
+            // in the token and read it from it. It's up to you ;)
+            JwtUser userDetails = (JwtUser)this.userDetailsService.loadUserByUsername(username);
+
+            // For simple validation it is completely sufficient to just check the token integrity. You don't have to call
+            // the database compellingly. Again it's up to you ;)
+            if (jwtTokenUtil.validateToken(authToken, userDetails)) {
+                UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
+                authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
+                SecurityContextHolder.getContext().setAuthentication(authentication);
+            }
+        }
+        chain.doFilter(request, response);
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtUser.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtUser.java
new file mode 100644
index 00000000..b6bae1be
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtUser.java
@@ -0,0 +1,81 @@
+package co.yixiang.modules.security.security;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+import java.sql.Timestamp;
+import java.util.Collection;
+import java.util.Date;
+import java.util.stream.Collectors;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-11-23
+ */
+@Getter
+@AllArgsConstructor
+public class JwtUser implements UserDetails {
+
+    @JsonIgnore
+    private final Long id;
+
+    private final String username;
+
+    @JsonIgnore
+    private final String password;
+
+    private final String avatar;
+
+    private final String email;
+
+    private final String phone;
+
+    private final String dept;
+
+    private final String job;
+
+    @JsonIgnore
+    private final Collection authorities;
+
+    private final boolean enabled;
+
+    private Timestamp createTime;
+
+    @JsonIgnore
+    private final Date lastPasswordResetDate;
+
+    @JsonIgnore
+    @Override
+    public boolean isAccountNonExpired() {
+        return true;
+    }
+
+    @JsonIgnore
+    @Override
+    public boolean isAccountNonLocked() {
+        return true;
+    }
+
+    @JsonIgnore
+    @Override
+    public boolean isCredentialsNonExpired() {
+        return true;
+    }
+
+    @JsonIgnore
+    @Override
+    public String getPassword() {
+        return password;
+    }
+
+    @Override
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    public Collection getRoles() {
+        return authorities.stream().map(GrantedAuthority::getAuthority).collect(Collectors.toSet());
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/service/JwtPermissionService.java b/yshop-system/src/main/java/co/yixiang/modules/security/service/JwtPermissionService.java
new file mode 100644
index 00000000..2697aee3
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/service/JwtPermissionService.java
@@ -0,0 +1,39 @@
+package co.yixiang.modules.security.service;
+
+import co.yixiang.modules.system.domain.Role;
+import co.yixiang.modules.system.repository.RoleRepository;
+import co.yixiang.modules.system.service.dto.UserDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheConfig;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.stereotype.Service;
+import java.util.Collection;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@Service
+@CacheConfig(cacheNames = "role")
+public class JwtPermissionService {
+
+    @Autowired
+    private RoleRepository roleRepository;
+
+    /**
+     * key的名称如有修改,请同步修改 UserServiceImpl 中的 update 方法
+     * @param user
+     * @return
+     */
+    @Cacheable(key = "'loadPermissionByUser:' + #p0.username")
+    public Collection mapToGrantedAuthorities(UserDTO user) {
+
+        System.out.println("--------------------loadPermissionByUser:" + user.getUsername() + "---------------------");
+
+        Set roles = roleRepository.findByUsers_Id(user.getId());
+
+        return roles.stream().flatMap(role -> role.getPermissions().stream())
+                .map(permission -> new SimpleGrantedAuthority(permission.getName()))
+                .collect(Collectors.toList());
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/service/JwtUserDetailsService.java b/yshop-system/src/main/java/co/yixiang/modules/security/service/JwtUserDetailsService.java
new file mode 100644
index 00000000..930b6e81
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/service/JwtUserDetailsService.java
@@ -0,0 +1,59 @@
+package co.yixiang.modules.security.service;
+
+import co.yixiang.exception.BadRequestException;
+import co.yixiang.modules.security.security.JwtUser;
+import co.yixiang.modules.system.service.UserService;
+import co.yixiang.modules.system.service.dto.DeptSmallDTO;
+import co.yixiang.modules.system.service.dto.JobSmallDTO;
+import co.yixiang.modules.system.service.dto.UserDTO;
+import co.yixiang.modules.system.service.dto.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.Optional;
+
+/**
+ * @author Zheng Jie
+ * @date 2018-11-22
+ */
+@Service
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
+public class JwtUserDetailsService implements UserDetailsService {
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private JwtPermissionService permissionService;
+
+    @Override
+    public UserDetails loadUserByUsername(String username){
+
+        UserDTO user = userService.findByName(username);
+        if (user == null) {
+            throw new BadRequestException("账号不存在");
+        } else {
+            return createJwtUser(user);
+        }
+    }
+
+    public UserDetails createJwtUser(UserDTO user) {
+        return new JwtUser(
+                user.getId(),
+                user.getUsername(),
+                user.getPassword(),
+                user.getAvatar(),
+                user.getEmail(),
+                user.getPhone(),
+                Optional.ofNullable(user.getDept()).map(DeptSmallDTO::getName).orElse(null),
+                Optional.ofNullable(user.getJob()).map(JobSmallDTO::getName).orElse(null),
+                permissionService.mapToGrantedAuthorities(user),
+                user.getEnabled(),
+                user.getCreateTime(),
+                user.getLastPasswordResetTime()
+        );
+    }
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/utils/JwtTokenUtil.java b/yshop-system/src/main/java/co/yixiang/modules/security/utils/JwtTokenUtil.java
new file mode 100644
index 00000000..00e618b8
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/utils/JwtTokenUtil.java
@@ -0,0 +1,120 @@
+package co.yixiang.modules.security.utils;
+
+import co.yixiang.modules.security.security.JwtUser;
+import io.jsonwebtoken.*;
+import io.jsonwebtoken.impl.DefaultClock;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.stereotype.Component;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Function;
+
+@Component
+public class JwtTokenUtil implements Serializable {
+
+    private static final long serialVersionUID = -3301605591108950415L;
+    private Clock clock = DefaultClock.INSTANCE;
+
+    @Value("${jwt.secret}")
+    private String secret;
+
+    @Value("${jwt.expiration}")
+    private Long expiration;
+
+    @Value("${jwt.header}")
+    private String tokenHeader;
+
+    public String getUsernameFromToken(String token) {
+        return getClaimFromToken(token, Claims::getSubject);
+    }
+
+    public Date getIssuedAtDateFromToken(String token) {
+        return getClaimFromToken(token, Claims::getIssuedAt);
+    }
+
+    public Date getExpirationDateFromToken(String token) {
+        return getClaimFromToken(token, Claims::getExpiration);
+    }
+
+    public  T getClaimFromToken(String token, Function claimsResolver) {
+        final Claims claims = getAllClaimsFromToken(token);
+        return claimsResolver.apply(claims);
+    }
+
+    private Claims getAllClaimsFromToken(String token) {
+        return Jwts.parser()
+                .setSigningKey(secret)
+                .parseClaimsJws(token)
+                .getBody();
+    }
+
+    private Boolean isTokenExpired(String token) {
+        final Date expiration = getExpirationDateFromToken(token);
+        return expiration.before(clock.now());
+    }
+
+    private Boolean isCreatedBeforeLastPasswordReset(Date created, Date lastPasswordReset) {
+        return (lastPasswordReset != null && created.before(lastPasswordReset));
+    }
+
+    private Boolean ignoreTokenExpiration(String token) {
+        // here you specify tokens, for that the expiration is ignored
+        return false;
+    }
+
+    public String generateToken(UserDetails userDetails) {
+        Map claims = new HashMap<>();
+        return doGenerateToken(claims, userDetails.getUsername());
+    }
+
+    private String doGenerateToken(Map claims, String subject) {
+        final Date createdDate = clock.now();
+        final Date expirationDate = calculateExpirationDate(createdDate);
+
+        return Jwts.builder()
+                .setClaims(claims)
+                .setSubject(subject)
+                .setIssuedAt(createdDate)
+                .setExpiration(expirationDate)
+                .signWith(SignatureAlgorithm.HS512, secret)
+                .compact();
+    }
+
+    public Boolean canTokenBeRefreshed(String token, Date lastPasswordReset) {
+        final Date created = getIssuedAtDateFromToken(token);
+        return !isCreatedBeforeLastPasswordReset(created, lastPasswordReset)
+                && (!isTokenExpired(token) || ignoreTokenExpiration(token));
+    }
+
+    public String refreshToken(String token) {
+        final Date createdDate = clock.now();
+        final Date expirationDate = calculateExpirationDate(createdDate);
+
+        final Claims claims = getAllClaimsFromToken(token);
+        claims.setIssuedAt(createdDate);
+        claims.setExpiration(expirationDate);
+
+        return Jwts.builder()
+                .setClaims(claims)
+                .signWith(SignatureAlgorithm.HS512, secret)
+                .compact();
+    }
+
+    public Boolean validateToken(String token, UserDetails userDetails) {
+        JwtUser user = (JwtUser) userDetails;
+        final Date created = getIssuedAtDateFromToken(token);
+//        final Date expiration = getExpirationDateFromToken(token);
+//        如果token存在,且token创建日期 > 最后修改密码的日期 则代表token有效
+        return (!isTokenExpired(token)
+                && !isCreatedBeforeLastPasswordReset(created, user.getLastPasswordResetDate())
+        );
+    }
+
+    private Date calculateExpirationDate(Date createdDate) {
+        return new Date(createdDate.getTime() + expiration);
+    }
+}
+
diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/utils/VerifyCodeUtils.java b/yshop-system/src/main/java/co/yixiang/modules/security/utils/VerifyCodeUtils.java
new file mode 100644
index 00000000..e8cab6eb
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/security/utils/VerifyCodeUtils.java
@@ -0,0 +1,203 @@
+package co.yixiang.modules.security.utils;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.Random;
+import javax.imageio.ImageIO;
+
+/**
+ * @author https://blog.csdn.net/ruixue0117/article/details/22829557
+ * @date 2019-6-20 17:28:53
+ */
+public class VerifyCodeUtils{
+
+    //使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
+    public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
+    private static Random random = new Random();
+
+
+    /**
+     * 使用系统默认字符源生成验证码
+     * @param verifySize	验证码长度
+     * @return
+     */
+    public static String generateVerifyCode(int verifySize){
+        return generateVerifyCode(verifySize, VERIFY_CODES);
+    }
+    /**
+     * 使用指定源生成验证码
+     * @param verifySize	验证码长度
+     * @param sources	验证码字符源
+     * @return
+     */
+    public static String generateVerifyCode(int verifySize, String sources){
+        if(sources == null || sources.length() == 0){
+            sources = VERIFY_CODES;
+        }
+        int codesLen = sources.length();
+        Random rand = new Random(System.currentTimeMillis());
+        StringBuilder verifyCode = new StringBuilder(verifySize);
+        for(int i = 0; i < verifySize; i++){
+            verifyCode.append(sources.charAt(rand.nextInt(codesLen-1)));
+        }
+        return verifyCode.toString();
+    }
+
+    /**
+     * 输出指定验证码图片流
+     * @param w
+     * @param h
+     * @param os
+     * @param code
+     * @throws IOException
+     */
+    public static void outputImage(int w, int h, OutputStream os, String code) throws IOException{
+        int verifySize = code.length();
+        BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+        Random rand = new Random();
+        Graphics2D g2 = image.createGraphics();
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
+        Color[] colors = new Color[5];
+        Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN,
+                Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, Color.ORANGE,
+                Color.PINK, Color.YELLOW };
+        float[] fractions = new float[colors.length];
+        for(int i = 0; i < colors.length; i++){
+            colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)];
+            fractions[i] = rand.nextFloat();
+        }
+        Arrays.sort(fractions);
+
+        g2.setColor(Color.GRAY);// 设置边框色
+        g2.fillRect(0, 0, w, h);
+
+        Color c = getRandColor(200, 250);
+        g2.setColor(c);// 设置背景色
+        g2.fillRect(0, 2, w, h-4);
+
+        //绘制干扰线
+        Random random = new Random();
+        g2.setColor(getRandColor(160, 200));// 设置线条的颜色
+        for (int i = 0; i < 20; i++) {
+            int x = random.nextInt(w - 1);
+            int y = random.nextInt(h - 1);
+            int xl = random.nextInt(6) + 1;
+            int yl = random.nextInt(12) + 1;
+            g2.drawLine(x, y, x + xl + 40, y + yl + 20);
+        }
+
+        // 添加噪点
+        float yawpRate = 0.05f;// 噪声率
+        int area = (int) (yawpRate * w * h);
+        for (int i = 0; i < area; i++) {
+            int x = random.nextInt(w);
+            int y = random.nextInt(h);
+            int rgb = getRandomIntColor();
+            image.setRGB(x, y, rgb);
+        }
+
+        shear(g2, w, h, c);// 使图片扭曲
+
+        g2.setColor(getRandColor(100, 160));
+        int fontSize = h-4;
+        Font font = new Font("Algerian", Font.ITALIC, fontSize);
+        g2.setFont(font);
+        char[] chars = code.toCharArray();
+        for(int i = 0; i < verifySize; i++){
+            AffineTransform affine = new AffineTransform();
+            affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + fontSize/2, h/2);
+            g2.setTransform(affine);
+            g2.drawChars(chars, i, 1, ((w-10) / verifySize) * i + 5, h/2 + fontSize/2 - 10);
+        }
+
+        g2.dispose();
+        ImageIO.write(image, "jpg", os);
+    }
+
+    private static Color getRandColor(int fc, int bc) {
+        if (fc > 255)
+            fc = 255;
+        if (bc > 255)
+            bc = 255;
+        int r = fc + random.nextInt(bc - fc);
+        int g = fc + random.nextInt(bc - fc);
+        int b = fc + random.nextInt(bc - fc);
+        return new Color(r, g, b);
+    }
+
+    private static int getRandomIntColor() {
+        int[] rgb = getRandomRgb();
+        int color = 0;
+        for (int c : rgb) {
+            color = color << 8;
+            color = color | c;
+        }
+        return color;
+    }
+
+    private static int[] getRandomRgb() {
+        int[] rgb = new int[3];
+        for (int i = 0; i < 3; i++) {
+            rgb[i] = random.nextInt(255);
+        }
+        return rgb;
+    }
+
+    private static void shear(Graphics g, int w1, int h1, Color color) {
+        shearX(g, w1, h1, color);
+        shearY(g, w1, h1, color);
+    }
+
+    private static void shearX(Graphics g, int w1, int h1, Color color) {
+
+        int period = random.nextInt(2);
+
+        boolean borderGap = true;
+        int frames = 1;
+        int phase = random.nextInt(2);
+
+        for (int i = 0; i < h1; i++) {
+            double d = (double) (period >> 1)
+                    * Math.sin((double) i / (double) period
+                    + (6.2831853071795862D * (double) phase)
+                    / (double) frames);
+            g.copyArea(0, i, w1, 1, (int) d, 0);
+            if (borderGap) {
+                g.setColor(color);
+                g.drawLine((int) d, i, 0, i);
+                g.drawLine((int) d + w1, i, w1, i);
+            }
+        }
+
+    }
+
+    private static void shearY(Graphics g, int w1, int h1, Color color) {
+
+        int period = random.nextInt(40) + 10; // 50;
+
+        boolean borderGap = true;
+        int frames = 20;
+        int phase = 7;
+        for (int i = 0; i < w1; i++) {
+            double d = (double) (period >> 1)
+                    * Math.sin((double) i / (double) period
+                    + (6.2831853071795862D * (double) phase)
+                    / (double) frames);
+            g.copyArea(i, 0, 1, h1, 0, (int) d);
+            if (borderGap) {
+                g.setColor(color);
+                g.drawLine(i, (int) d, i, 0);
+                g.drawLine(i, (int) d + h1, i, h1);
+            }
+
+        }
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/StoreOrderCartInfo.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/StoreOrderCartInfo.java
new file mode 100644
index 00000000..f5bba610
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/StoreOrderCartInfo.java
@@ -0,0 +1,36 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+
+import javax.persistence.*;
+
+/**
+ * @ClassName StoreOrderCartInfo
+ * @Author hupeng <610796224@qq.com>
+ * @Date 2019/10/14
+ **/
+
+@Entity
+@Data
+@Table(name="yx_store_order_cart_info")
+public class StoreOrderCartInfo {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    @Column(name = "oid")
+    private Integer oid;
+
+    @Column(name = "cart_id")
+    private Integer cartId;
+
+    @Column(name = "cart_info")
+    private String cartInfo;
+
+    @Column(name = "unique")
+    private String unique;
+
+
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreCategory.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreCategory.java
new file mode 100644
index 00000000..dcea4046
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreCategory.java
@@ -0,0 +1,51 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-10-03
+*/
+@Entity
+@Data
+@Table(name="yx_store_category")
+public class YxStoreCategory implements Serializable {
+
+    // 商品分类表ID
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 父id
+    @Column(name = "pid",nullable = false)
+    private Integer pid;
+
+    // 分类名称
+    @Column(name = "cate_name",nullable = false)
+    private String cateName;
+
+    // 排序
+    @Column(name = "sort",nullable = false)
+    private Integer sort;
+
+    // 图标
+    @Column(name = "pic",nullable = false)
+    private String pic;
+
+    // 是否推荐
+    @Column(name = "is_show",nullable = false)
+    private Integer isShow;
+
+    // 添加时间
+    @Column(name = "add_time",nullable = false)
+    private Integer addTime;
+
+    public void copy(YxStoreCategory source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrder.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrder.java
new file mode 100644
index 00000000..73171f12
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrder.java
@@ -0,0 +1,225 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-10-14
+*/
+@Entity
+@Data
+@Table(name="yx_store_order")
+public class YxStoreOrder implements Serializable {
+
+    // 订单ID
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 订单号
+    @Column(name = "order_id",nullable = false)
+    private String orderId;
+
+    // 用户id
+    @Column(name = "uid",nullable = false)
+    private Integer uid;
+
+    // 用户姓名
+    @Column(name = "real_name",nullable = false)
+    private String realName;
+
+    // 用户电话
+    @Column(name = "user_phone",nullable = false)
+    private String userPhone;
+
+    // 详细地址
+    @Column(name = "user_address",nullable = false)
+    private String userAddress;
+
+    // 购物车id
+    @Column(name = "cart_id",nullable = false)
+    private String cartId;
+
+    // 运费金额
+    @Column(name = "freight_price",nullable = false)
+    private BigDecimal freightPrice;
+
+    // 订单商品总数
+    @Column(name = "total_num",nullable = false)
+    private Integer totalNum;
+
+    // 订单总价
+    @Column(name = "total_price",nullable = false)
+    private BigDecimal totalPrice;
+
+    // 邮费
+    @Column(name = "total_postage",nullable = false)
+    private BigDecimal totalPostage;
+
+    // 实际支付金额
+    @Column(name = "pay_price",nullable = false)
+    private BigDecimal payPrice;
+
+    // 支付邮费
+    @Column(name = "pay_postage",nullable = false)
+    private BigDecimal payPostage;
+
+    // 抵扣金额
+    @Column(name = "deduction_price",nullable = false)
+    private BigDecimal deductionPrice;
+
+    // 优惠券id
+    @Column(name = "coupon_id",nullable = false)
+    private Integer couponId;
+
+    // 优惠券金额
+    @Column(name = "coupon_price",nullable = false)
+    private BigDecimal couponPrice;
+
+    // 支付状态
+    @Column(name = "paid",nullable = false)
+    private Integer paid;
+
+    // 支付时间
+    @Column(name = "pay_time")
+    private Integer payTime;
+
+    // 支付方式
+    @Column(name = "pay_type",nullable = false)
+    private String payType;
+
+    // 创建时间
+    @Column(name = "add_time",nullable = false)
+    private Integer addTime;
+
+    // 订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款)
+    @Column(name = "status",nullable = false)
+    private Integer status;
+
+    // 0 未退款 1 申请中 2 已退款
+    @Column(name = "refund_status",nullable = false)
+    private Integer refundStatus;
+
+    // 退款图片
+    @Column(name = "refund_reason_wap_img")
+    private String refundReasonWapImg;
+
+    // 退款用户说明
+    @Column(name = "refund_reason_wap_explain")
+    private String refundReasonWapExplain;
+
+    // 退款时间
+    @Column(name = "refund_reason_time")
+    private Integer refundReasonTime;
+
+    // 前台退款原因
+    @Column(name = "refund_reason_wap")
+    private String refundReasonWap;
+
+    // 不退款的理由
+    @Column(name = "refund_reason")
+    private String refundReason;
+
+    // 退款金额
+    @Column(name = "refund_price",nullable = false)
+    private BigDecimal refundPrice;
+
+    // 快递名称/送货人姓名
+    @Column(name = "delivery_name")
+    private String deliveryName;
+
+    // 发货类型
+    @Column(name = "delivery_type")
+    private String deliveryType;
+
+    // 快递单号/手机号
+    @Column(name = "delivery_id")
+    private String deliveryId;
+
+    // 消费赚取积分
+    @Column(name = "gain_integral",nullable = false)
+    private BigDecimal gainIntegral;
+
+    // 使用积分
+    @Column(name = "use_integral",nullable = false)
+    private BigDecimal useIntegral;
+
+    // 给用户退了多少积分
+    @Column(name = "back_integral")
+    private BigDecimal backIntegral;
+
+    // 备注
+    @Column(name = "mark",nullable = false)
+    private String mark;
+
+    // 是否删除
+    @Column(name = "is_del",nullable = false)
+    private Integer isDel;
+
+    // 唯一id(md5加密)类似id
+    @Column(name = "`unique`",unique = true,nullable = false)
+    private String unique;
+
+    // 管理员备注
+    @Column(name = "remark")
+    private String remark;
+
+    // 商户ID
+    @Column(name = "mer_id",nullable = false)
+    private Integer merId;
+
+    @Column(name = "is_mer_check",nullable = false)
+    private Integer isMerCheck;
+
+    // 拼团产品id0一般产品
+    @Column(name = "combination_id")
+    private Integer combinationId;
+
+    // 拼团id 0没有拼团
+    @Column(name = "pink_id",nullable = false)
+    private Integer pinkId;
+
+    // 成本价
+    @Column(name = "cost",nullable = false)
+    private BigDecimal cost;
+
+    // 秒杀产品ID
+    @Column(name = "seckill_id",nullable = false)
+    private Integer seckillId;
+
+    // 砍价id
+    @Column(name = "bargain_id")
+    private Integer bargainId;
+
+    // 核销码
+    @Column(name = "verify_code",nullable = false)
+    private String verifyCode;
+
+    // 门店id
+    @Column(name = "store_id",nullable = false)
+    private Integer storeId;
+
+    // 配送方式 1=快递 ,2=门店自提
+    @Column(name = "shipping_type",nullable = false)
+    private Integer shippingType;
+
+    // 支付渠道(0微信公众号1微信小程序)
+    @Column(name = "is_channel")
+    private Integer isChannel;
+
+    @Column(name = "is_remind")
+    private Integer isRemind;
+
+    @Column(name = "is_system_del")
+    private Integer isSystemDel;
+
+    public void copy(YxStoreOrder source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderStatus.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderStatus.java
new file mode 100644
index 00000000..b8fb8051
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderStatus.java
@@ -0,0 +1,42 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-11-02
+*/
+@Entity
+@Data
+@Table(name="yx_store_order_status")
+public class YxStoreOrderStatus implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 订单id
+    @Column(name = "oid",nullable = false)
+    private Integer oid;
+
+    // 操作类型
+    @Column(name = "change_type",nullable = false)
+    private String changeType;
+
+    // 操作备注
+    @Column(name = "change_message",nullable = false)
+    private String changeMessage;
+
+    // 操作时间
+    @Column(name = "change_time",nullable = false)
+    private Integer changeTime;
+
+    public void copy(YxStoreOrderStatus source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProduct.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProduct.java
new file mode 100644
index 00000000..f5ed9f10
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProduct.java
@@ -0,0 +1,168 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-10-04
+*/
+@Entity
+@Data
+@Table(name="yx_store_product")
+public class YxStoreProduct implements Serializable {
+
+    // 商品id
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 商户Id(0为总后台管理员创建,不为0的时候是商户后台创建)
+    @Column(name = "mer_id",nullable = false)
+    private Integer merId;
+
+    // 商品图片
+    @Column(name = "image",nullable = false)
+    private String image;
+
+    // 轮播图
+    @Column(name = "slider_image",nullable = false)
+    private String sliderImage;
+
+    // 商品名称
+    @Column(name = "store_name",nullable = false)
+    private String storeName;
+
+    // 商品简介
+    @Column(name = "store_info",nullable = false)
+    private String storeInfo;
+
+    // 关键字
+    @Column(name = "keyword",nullable = false)
+    private String keyword;
+
+    // 产品条码(一维码)
+    @Column(name = "bar_code",nullable = false)
+    private String barCode;
+
+    // 分类id
+    @Column(name = "cate_id",nullable = false)
+    private String cateId;
+
+    // 商品价格
+    @Column(name = "price",nullable = false)
+    private BigDecimal price;
+
+    // 会员价格
+    @Column(name = "vip_price",nullable = false)
+    private BigDecimal vipPrice;
+
+    // 市场价
+    @Column(name = "ot_price",nullable = false)
+    private BigDecimal otPrice;
+
+    // 邮费
+    @Column(name = "postage",nullable = false)
+    private BigDecimal postage;
+
+    // 单位名
+    @Column(name = "unit_name",nullable = false)
+    private String unitName;
+
+    // 排序
+    @Column(name = "sort",nullable = false)
+    private Integer sort;
+
+    // 销量
+    @Column(name = "sales",nullable = false)
+    private Integer sales;
+
+    // 库存
+    @Column(name = "stock",nullable = false)
+    private Integer stock;
+
+    // 状态(0:未上架,1:上架)
+    @Column(name = "is_show",nullable = false)
+    private Integer isShow;
+
+    // 是否热卖
+    @Column(name = "is_hot",nullable = false)
+    private Integer isHot;
+
+    // 是否优惠
+    @Column(name = "is_benefit",nullable = false)
+    private Integer isBenefit;
+
+    // 是否精品
+    @Column(name = "is_best",nullable = false)
+    private Integer isBest;
+
+    // 是否新品
+    @Column(name = "is_new",nullable = false)
+    private Integer isNew;
+
+    // 产品描述
+    @Column(name = "description",nullable = false)
+    private String description;
+
+    // 添加时间
+    @Column(name = "add_time",nullable = false)
+    private Integer addTime;
+
+    // 是否包邮
+    @Column(name = "is_postage",nullable = false)
+    private Integer isPostage;
+
+    // 是否删除
+    @Column(name = "is_del",nullable = false)
+    private Integer isDel;
+
+    // 商户是否代理 0不可代理1可代理
+    @Column(name = "mer_use",nullable = false)
+    private Integer merUse;
+
+    // 获得积分
+    @Column(name = "give_integral",nullable = false)
+    private BigDecimal giveIntegral;
+
+    // 成本价
+    @Column(name = "cost",nullable = false)
+    private BigDecimal cost;
+
+    // 秒杀状态 0 未开启 1已开启
+    @Column(name = "is_seckill",nullable = false)
+    private Integer isSeckill;
+
+    // 砍价状态 0未开启 1开启
+    @Column(name = "is_bargain")
+    private Integer isBargain;
+
+    // 是否优品推荐
+    @Column(name = "is_good",nullable = false)
+    private Integer isGood;
+
+    // 虚拟销量
+    @Column(name = "ficti")
+    private Integer ficti;
+
+    // 浏览量
+    @Column(name = "browse")
+    private Integer browse;
+
+    // 产品二维码地址(用户小程序海报)
+    @Column(name = "code_path",nullable = false)
+    private String codePath;
+
+    // 淘宝京东1688类型
+    @Column(name = "soure_link")
+    private String soureLink;
+
+    public void copy(YxStoreProduct source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttr.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttr.java
new file mode 100644
index 00000000..021b7282
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttr.java
@@ -0,0 +1,37 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-10-13
+*/
+@Entity
+@Data
+@Table(name="yx_store_product_attr")
+public class YxStoreProductAttr implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+    // 商品ID
+    @Column(name = "product_id",nullable = false)
+    private Integer productId;
+
+    // 属性名
+    @Column(name = "attr_name",nullable = false)
+    private String attrName;
+
+    // 属性值
+    @Column(name = "attr_values",nullable = false)
+    private String attrValues;
+
+    public void copy(YxStoreProductAttr source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrResult.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrResult.java
new file mode 100644
index 00000000..13363ea0
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrResult.java
@@ -0,0 +1,38 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-10-13
+*/
+@Entity
+@Data
+@Table(name="yx_store_product_attr_result")
+public class YxStoreProductAttrResult implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 商品ID
+    @Column(name = "product_id",nullable = false)
+    private Integer productId;
+
+    // 商品属性参数
+    @Column(name = "result",nullable = false)
+    private String result;
+
+    // 上次修改时间
+    @Column(name = "change_time",nullable = false)
+    private Integer changeTime;
+
+    public void copy(YxStoreProductAttrResult source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrValue.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrValue.java
new file mode 100644
index 00000000..df6718db
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrValue.java
@@ -0,0 +1,59 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-10-13
+*/
+@Entity
+@Data
+@Table(name="yx_store_product_attr_value")
+public class YxStoreProductAttrValue implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 商品ID
+    @Column(name = "product_id",nullable = false)
+    private Integer productId;
+
+    // 商品属性索引值 (attr_value|attr_value[|....])
+    @Column(name = "suk",nullable = false)
+    private String suk;
+
+    // 属性对应的库存
+    @Column(name = "stock",nullable = false)
+    private Integer stock;
+
+    // 销量
+    @Column(name = "sales",nullable = false)
+    private Integer sales;
+
+    // 属性金额
+    @Column(name = "price",nullable = false)
+    private BigDecimal price;
+
+    // 图片
+    @Column(name = "image")
+    private String image;
+
+    // 唯一值
+    @Column(name = "`unique`",nullable = false)
+    private String unique;
+
+    // 成本价
+    @Column(name = "cost",nullable = false)
+    private BigDecimal cost;
+
+    public void copy(YxStoreProductAttrValue source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductReply.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductReply.java
new file mode 100644
index 00000000..04f9b772
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductReply.java
@@ -0,0 +1,83 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-11-03
+*/
+@Entity
+@Data
+@Table(name="yx_store_product_reply")
+public class YxStoreProductReply implements Serializable {
+
+    // 评论ID
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 用户ID
+    @Column(name = "uid",nullable = false)
+    private Integer uid;
+
+    // 订单ID
+    @Column(name = "oid",nullable = false)
+    private Integer oid;
+
+    // 唯一id
+    @Column(name = "`unique`",nullable = false)
+    private String unique;
+
+    // 产品id
+    @Column(name = "product_id",nullable = false)
+    private Integer productId;
+
+    // 某种商品类型(普通商品、秒杀商品)
+    @Column(name = "reply_type",nullable = false)
+    private String replyType;
+
+    // 商品分数
+    @Column(name = "product_score",nullable = false)
+    private Integer productScore;
+
+    // 服务分数
+    @Column(name = "service_score",nullable = false)
+    private Integer serviceScore;
+
+    // 评论内容
+    @Column(name = "comment",nullable = false)
+    private String comment;
+
+    // 评论图片
+    @Column(name = "pics",nullable = false)
+    private String pics;
+
+    // 评论时间
+    @Column(name = "add_time",nullable = false)
+    private Integer addTime;
+
+    // 管理员回复内容
+    @Column(name = "merchant_reply_content")
+    private String merchantReplyContent;
+
+    // 管理员回复时间
+    @Column(name = "merchant_reply_time")
+    private Integer merchantReplyTime;
+
+    // 0未删除1已删除
+    @Column(name = "is_del",nullable = false)
+    private Integer isDel;
+
+    // 0未回复1已回复
+    @Column(name = "is_reply",nullable = false)
+    private Integer isReply;
+
+    public void copy(YxStoreProductReply source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxSystemGroupData.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxSystemGroupData.java
new file mode 100644
index 00000000..f8598a2e
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxSystemGroupData.java
@@ -0,0 +1,47 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-10-18
+*/
+@Entity
+@Data
+@Table(name="yx_system_group_data")
+public class YxSystemGroupData implements Serializable {
+
+    // 组合数据详情ID
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 对应的数据名称
+    @Column(name = "group_name",nullable = false)
+    private String groupName;
+
+    // 数据组对应的数据值(json数据)
+    @Column(name = "value",nullable = false)
+    private String value;
+
+    // 添加数据时间
+    @Column(name = "add_time",nullable = false)
+    private Integer addTime;
+
+    // 数据排序
+    @Column(name = "sort",nullable = false)
+    private Integer sort;
+
+    // 状态(1:开启;2:关闭;)
+    @Column(name = "status",nullable = false)
+    private Integer status;
+
+    public void copy(YxSystemGroupData source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxUser.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxUser.java
new file mode 100644
index 00000000..109d7762
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxUser.java
@@ -0,0 +1,152 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-10-06
+*/
+@Entity
+@Data
+@Table(name="yx_user")
+public class YxUser implements Serializable {
+
+    // 用户id
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "uid")
+    private Integer uid;
+
+    // 用户账号
+    @Column(name = "account",nullable = false)
+    private String account;
+
+    // 用户密码
+    @Column(name = "pwd",nullable = false)
+    private String pwd;
+
+    // 真实姓名
+    @Column(name = "real_name",nullable = false)
+    private String realName;
+
+    // 生日
+    @Column(name = "birthday",nullable = false)
+    private Integer birthday;
+
+    // 身份证号码
+    @Column(name = "card_id",nullable = false)
+    private String cardId;
+
+    // 用户备注
+    @Column(name = "mark",nullable = false)
+    private String mark;
+
+    // 合伙人id
+    @Column(name = "partner_id",nullable = false)
+    private Integer partnerId;
+
+    // 用户分组id
+    @Column(name = "group_id",nullable = false)
+    private Integer groupId;
+
+    // 用户昵称
+    @Column(name = "nickname",nullable = false)
+    private String nickname;
+
+    // 用户头像
+    @Column(name = "avatar",nullable = false)
+    private String avatar;
+
+    // 手机号码
+    @Column(name = "phone")
+    private String phone;
+
+    // 添加时间
+    @Column(name = "add_time",nullable = false)
+    private Integer addTime;
+
+    // 添加ip
+    @Column(name = "add_ip",nullable = false)
+    private String addIp;
+
+    // 最后一次登录时间
+    @Column(name = "last_time",nullable = false)
+    private Integer lastTime;
+
+    // 最后一次登录ip
+    @Column(name = "last_ip",nullable = false)
+    private String lastIp;
+
+    // 用户余额
+    @Column(name = "now_money",nullable = false)
+    private BigDecimal nowMoney;
+
+    // 佣金金额
+    @Column(name = "brokerage_price",nullable = false)
+    private BigDecimal brokeragePrice;
+
+    // 用户剩余积分
+    @Column(name = "integral",nullable = false)
+    private BigDecimal integral;
+
+    // 连续签到天数
+    @Column(name = "sign_num",nullable = false)
+    private Integer signNum;
+
+    // 1为正常,0为禁止
+    @Column(name = "status",nullable = false)
+    private Integer status;
+
+    // 等级
+    @Column(name = "level",nullable = false)
+    private Integer level;
+
+    // 推广元id
+    @Column(name = "spread_uid",nullable = false)
+    private Integer spreadUid;
+
+    // 推广员关联时间
+    @Column(name = "spread_time",nullable = false)
+    private Integer spreadTime;
+
+    // 用户类型
+    @Column(name = "user_type",nullable = false)
+    private String userType;
+
+    // 是否为推广员
+    @Column(name = "is_promoter",nullable = false)
+    private Integer isPromoter;
+
+    // 用户购买次数
+    @Column(name = "pay_count")
+    private Integer payCount;
+
+    // 下级人数
+    @Column(name = "spread_count")
+    private Integer spreadCount;
+
+    // 清理会员时间
+    @Column(name = "clean_time")
+    private Integer cleanTime;
+
+    // 详细地址
+    @Column(name = "addres",nullable = false)
+    private String addres;
+
+    // 管理员编号 
+    @Column(name = "adminid")
+    private Integer adminid;
+
+    // 用户登陆类型,h5,wechat,routine
+    @Column(name = "login_type",nullable = false)
+    private String loginType;
+
+    public void copy(YxUser source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxUserBill.java b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxUserBill.java
new file mode 100644
index 00000000..ec956f2b
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/domain/YxUserBill.java
@@ -0,0 +1,72 @@
+package co.yixiang.modules.shop.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+/**
+* @author hupeng
+* @date 2019-11-06
+*/
+@Entity
+@Data
+@Table(name="yx_user_bill")
+public class YxUserBill implements Serializable {
+
+    // 用户账单id
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    // 用户uid
+    @Column(name = "uid",nullable = false)
+    private Integer uid;
+
+    // 关联id
+    @Column(name = "link_id",nullable = false)
+    private String linkId;
+
+    // 0 = 支出 1 = 获得
+    @Column(name = "pm",nullable = false)
+    private Integer pm;
+
+    // 账单标题
+    @Column(name = "title",nullable = false)
+    private String title;
+
+    // 明细种类
+    @Column(name = "category",nullable = false)
+    private String category;
+
+    // 明细类型
+    @Column(name = "type",nullable = false)
+    private String type;
+
+    // 明细数字
+    @Column(name = "number",nullable = false)
+    private BigDecimal number;
+
+    // 剩余
+    @Column(name = "balance",nullable = false)
+    private BigDecimal balance;
+
+    // 备注
+    @Column(name = "mark",nullable = false)
+    private String mark;
+
+    // 添加时间
+    @Column(name = "add_time",nullable = false)
+    private Integer addTime;
+
+    // 0 = 带确定 1 = 有效 -1 = 无效
+    @Column(name = "status",nullable = false)
+    private Integer status;
+
+    public void copy(YxUserBill source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreCategoryRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreCategoryRepository.java
new file mode 100644
index 00000000..0e786f55
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreCategoryRepository.java
@@ -0,0 +1,16 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxStoreCategory;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+
+/**
+* @author hupeng
+* @date 2019-10-03
+*/
+public interface YxStoreCategoryRepository extends JpaRepository, JpaSpecificationExecutor {
+    @Query(value = "select cate_name from yx_store_category where id = ?1",nativeQuery = true)
+    String findNameById(Integer id);
+
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderCartInfoRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderCartInfoRepository.java
new file mode 100644
index 00000000..5c4bd8f8
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderCartInfoRepository.java
@@ -0,0 +1,17 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.StoreOrderCartInfo;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-10-14
+*/
+public interface YxStoreOrderCartInfoRepository extends JpaRepository, JpaSpecificationExecutor {
+
+    List findByOid(int oid);
+
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderRepository.java
new file mode 100644
index 00000000..322240d9
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderRepository.java
@@ -0,0 +1,19 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxStoreOrder;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @author hupeng
+* @date 2019-10-14
+*/
+public interface YxStoreOrderRepository extends JpaRepository, JpaSpecificationExecutor {
+
+    /**
+     * findByUnique
+     * @param unique
+     * @return
+     */
+    YxStoreOrder findByUnique(String unique);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderStatusRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderStatusRepository.java
new file mode 100644
index 00000000..0b49b039
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderStatusRepository.java
@@ -0,0 +1,12 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxStoreOrderStatus;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @author hupeng
+* @date 2019-11-02
+*/
+public interface YxStoreOrderStatusRepository extends JpaRepository, JpaSpecificationExecutor {
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrRepository.java
new file mode 100644
index 00000000..27e8b08a
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrRepository.java
@@ -0,0 +1,15 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxStoreProductAttr;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @author hupeng
+* @date 2019-10-13
+*/
+public interface YxStoreProductAttrRepository extends JpaRepository, JpaSpecificationExecutor {
+    //@Modifying
+    //@Query(value = "delete from yx_store_product_attr where product_id =?1",nativeQuery = true)
+    void deleteByProductId(int id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrResultRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrResultRepository.java
new file mode 100644
index 00000000..da334e7b
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrResultRepository.java
@@ -0,0 +1,21 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxStoreProductAttrResult;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @author hupeng
+* @date 2019-10-13
+*/
+public interface YxStoreProductAttrResultRepository extends JpaRepository, JpaSpecificationExecutor {
+
+    /**
+     * findByProductId
+     * @param product_id
+     * @return
+     */
+    YxStoreProductAttrResult findByProductId(Integer product_id);
+
+    void deleteByProductId(Integer product_id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrValueRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrValueRepository.java
new file mode 100644
index 00000000..4d1aa4ee
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrValueRepository.java
@@ -0,0 +1,16 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxStoreProductAttrValue;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @author hupeng
+* @date 2019-10-13
+*/
+public interface YxStoreProductAttrValueRepository extends JpaRepository, JpaSpecificationExecutor {
+
+    //@Modifying
+   // @Query(value = "delete from yx_store_product_attr_value where product_id =?1",nativeQuery = true)
+    void deleteByProductId(Integer id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductReplyRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductReplyRepository.java
new file mode 100644
index 00000000..5767dd82
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductReplyRepository.java
@@ -0,0 +1,12 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxStoreProductReply;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @author hupeng
+* @date 2019-11-03
+*/
+public interface YxStoreProductReplyRepository extends JpaRepository, JpaSpecificationExecutor {
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductRepository.java
new file mode 100644
index 00000000..7e72ec6c
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductRepository.java
@@ -0,0 +1,21 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxStoreProduct;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+
+/**
+* @author hupeng
+* @date 2019-10-04
+*/
+public interface YxStoreProductRepository extends JpaRepository, JpaSpecificationExecutor {
+    @Modifying
+    @Query(value = "update yx_store_product set is_show = ?1 where id = ?2",nativeQuery = true)
+    void updateOnsale(int status,int id);
+
+    @Modifying
+    @Query(value = "update yx_store_product set is_del = ?1 where id = ?2",nativeQuery = true)
+    void updateDel(int status,int id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxSystemGroupDataRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxSystemGroupDataRepository.java
new file mode 100644
index 00000000..86144a06
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxSystemGroupDataRepository.java
@@ -0,0 +1,12 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxSystemGroupData;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @author hupeng
+* @date 2019-10-18
+*/
+public interface YxSystemGroupDataRepository extends JpaRepository, JpaSpecificationExecutor {
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxUserBillRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxUserBillRepository.java
new file mode 100644
index 00000000..19e5384d
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxUserBillRepository.java
@@ -0,0 +1,12 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxUserBill;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @author hupeng
+* @date 2019-11-06
+*/
+public interface YxUserBillRepository extends JpaRepository, JpaSpecificationExecutor {
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxUserRepository.java b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxUserRepository.java
new file mode 100644
index 00000000..d067cac4
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/repository/YxUserRepository.java
@@ -0,0 +1,25 @@
+package co.yixiang.modules.shop.repository;
+
+import co.yixiang.modules.shop.domain.YxUser;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+
+/**
+* @author hupeng
+* @date 2019-10-06
+*/
+public interface YxUserRepository extends JpaRepository, JpaSpecificationExecutor {
+
+    @Modifying
+    @Query(value = "update yx_user set status = ?1 where uid = ?2",nativeQuery = true)
+    void updateOnstatus(int status,int id);
+
+    @Modifying
+    @Query(value = "update yx_user set now_money = now_money + ?1 where uid = ?2",nativeQuery = true)
+    void updateMoney(double money,int id);
+
+
+
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreCategoryController.java b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreCategoryController.java
new file mode 100644
index 00000000..fca936d9
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreCategoryController.java
@@ -0,0 +1,65 @@
+package co.yixiang.modules.shop.rest;
+
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.shop.domain.YxStoreCategory;
+import co.yixiang.modules.shop.service.YxStoreCategoryService;
+import co.yixiang.modules.shop.service.dto.YxStoreCategoryDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreCategoryQueryCriteria;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-10-03
+*/
+@Api(tags = "商品分类管理")
+@RestController
+@RequestMapping("api")
+public class YxStoreCategoryController {
+
+    @Autowired
+    private YxStoreCategoryService yxStoreCategoryService;
+
+    @Log("查询商品分类")
+    @ApiOperation(value = "查询商品分类")
+    @GetMapping(value = "/yxStoreCategory")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_SELECT')")
+    public ResponseEntity getYxStoreCategorys(YxStoreCategoryQueryCriteria criteria, Pageable pageable){
+        List categoryDTOList = yxStoreCategoryService.queryAll(criteria);
+        return new ResponseEntity(yxStoreCategoryService.buildTree(categoryDTOList),HttpStatus.OK);
+    }
+
+    @Log("新增商品分类")
+    @ApiOperation(value = "新增商品分类")
+    @PostMapping(value = "/yxStoreCategory")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_CREATE')")
+    public ResponseEntity create(@Validated @RequestBody YxStoreCategory resources){
+        return new ResponseEntity(yxStoreCategoryService.create(resources),HttpStatus.CREATED);
+    }
+
+    @Log("修改商品分类")
+    @ApiOperation(value = "修改商品分类")
+    @PutMapping(value = "/yxStoreCategory")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_EDIT')")
+    public ResponseEntity update(@Validated @RequestBody YxStoreCategory resources){
+        yxStoreCategoryService.update(resources);
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除商品分类")
+    @ApiOperation(value = "删除商品分类")
+    @DeleteMapping(value = "/yxStoreCategory/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_DELETE')")
+    public ResponseEntity delete(@PathVariable Integer id){
+        yxStoreCategoryService.delete(id);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreOrderController.java b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreOrderController.java
new file mode 100644
index 00000000..ddbb21c3
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreOrderController.java
@@ -0,0 +1,138 @@
+package co.yixiang.modules.shop.rest;
+
+import cn.hutool.core.util.StrUtil;
+import co.yixiang.exception.BadRequestException;
+import co.yixiang.modules.shop.domain.YxStoreOrder;
+import co.yixiang.modules.shop.domain.YxStoreOrderStatus;
+import co.yixiang.modules.shop.service.YxStoreOrderService;
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.shop.service.YxStoreOrderStatusService;
+import co.yixiang.modules.shop.service.dto.YxStoreOrderQueryCriteria;
+import co.yixiang.utils.OrderUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+
+/**
+* @author hupeng
+* @date 2019-10-14
+*/
+@Api(tags = "订单管理")
+@RestController
+@RequestMapping("api")
+public class YxStoreOrderController {
+
+    @Autowired
+    private YxStoreOrderService yxStoreOrderService;
+
+    @Autowired
+    private YxStoreOrderStatusService yxStoreOrderStatusService;
+
+
+    @ApiOperation(value = "查询订单")
+    @GetMapping(value = "/yxStoreOrder")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')")
+    public ResponseEntity getYxStoreOrders(YxStoreOrderQueryCriteria criteria,
+                                           Pageable pageable,
+                                           @RequestParam(name = "orderStatus") String orderStatus){
+
+
+        if(StrUtil.isNotEmpty(orderStatus)){
+            switch (orderStatus){
+                case "0":
+                    criteria.setIsDel(0);
+                    criteria.setPaid(0);
+                    criteria.setStatus(0);
+                    criteria.setRefundStatus(0);
+                    break;
+                case "1":
+                    System.out.println(orderStatus);
+                    criteria.setIsDel(0);
+                    criteria.setPaid(1);
+                    criteria.setStatus(0);
+                    criteria.setRefundStatus(0);
+                    break;
+                case "2":
+                    criteria.setIsDel(0);
+                    criteria.setPaid(1);
+                    criteria.setStatus(1);
+                    criteria.setRefundStatus(0);
+                    break;
+                case "3":
+                    criteria.setIsDel(0);
+                    criteria.setPaid(1);
+                    criteria.setStatus(2);
+                    criteria.setRefundStatus(0);
+                    break;
+                case "4":
+                    criteria.setIsDel(0);
+                    criteria.setPaid(1);
+                    criteria.setStatus(3);
+                    criteria.setRefundStatus(0);
+                    break;
+                case "-1":
+                    criteria.setIsDel(0);
+                    criteria.setPaid(1);
+                    criteria.setRefundStatus(1);
+                    break;
+                case "-2":
+                    criteria.setIsDel(0);
+                    criteria.setPaid(1);
+                    criteria.setRefundStatus(2);
+                    break;
+                case "-4":
+                    criteria.setIsDel(1);
+                    break;
+            }
+        }
+
+        return new ResponseEntity(yxStoreOrderService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+
+
+
+    @ApiOperation(value = "发货")
+    @PutMapping(value = "/yxStoreOrder")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
+    public ResponseEntity update(@Validated @RequestBody YxStoreOrder resources){
+        resources.setStatus(1);
+        resources.setDeliveryType("express");
+        yxStoreOrderService.update(resources);
+
+        YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus();
+        storeOrderStatus.setOid(resources.getId());
+        storeOrderStatus.setChangeType("delivery_goods");
+        storeOrderStatus.setChangeMessage("已发货 快递公司:"+resources.getDeliveryName()
+                +" 快递单号:"+resources.getDeliveryId());
+        storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo());
+
+        yxStoreOrderStatusService.create(storeOrderStatus);
+
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+
+    @ApiOperation(value = "退款")
+    @PostMapping(value = "/yxStoreOrder/refund")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
+    public ResponseEntity refund(@Validated @RequestBody YxStoreOrder resources){
+        yxStoreOrderService.refund(resources);
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+
+    @Log("删除")
+    @ApiOperation(value = "删除")
+    @DeleteMapping(value = "/yxStoreOrder/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_DELETE')")
+    public ResponseEntity delete(@PathVariable Integer id){
+        yxStoreOrderService.delete(id);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreProductController.java b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreProductController.java
new file mode 100644
index 00000000..a359b17e
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreProductController.java
@@ -0,0 +1,117 @@
+package co.yixiang.modules.shop.rest;
+
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.shop.domain.YxStoreProduct;
+import co.yixiang.modules.shop.service.YxStoreProductService;
+import co.yixiang.modules.shop.service.dto.YxStoreProductQueryCriteria;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+
+/**
+* @author hupeng
+* @date 2019-10-04
+*/
+@Api(tags = "商品管理")
+@RestController
+@RequestMapping("api")
+public class YxStoreProductController {
+
+    @Autowired
+    private YxStoreProductService yxStoreProductService;
+
+    @Log("查询商品")
+    @ApiOperation(value = "查询商品")
+    @GetMapping(value = "/yxStoreProduct")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_SELECT')")
+    public ResponseEntity getYxStoreProducts(YxStoreProductQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity(yxStoreProductService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @Log("新增商品")
+    @ApiOperation(value = "新增商品")
+    @PostMapping(value = "/yxStoreProduct")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_CREATE')")
+    public ResponseEntity create(@Validated @RequestBody YxStoreProduct resources){
+        return new ResponseEntity(yxStoreProductService.create(resources),HttpStatus.CREATED);
+    }
+
+    @Log("修改商品")
+    @ApiOperation(value = "修改商品")
+    @PutMapping(value = "/yxStoreProduct")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT')")
+    public ResponseEntity update(@Validated @RequestBody YxStoreProduct resources){
+        yxStoreProductService.update(resources);
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除商品")
+    @ApiOperation(value = "删除商品")
+    @DeleteMapping(value = "/yxStoreProduct/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')")
+    public ResponseEntity delete(@PathVariable Integer id){
+        yxStoreProductService.delete(id);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+
+    @ApiOperation(value = "恢复数据")
+    @DeleteMapping(value = "/yxStoreProduct/recovery/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')")
+    public ResponseEntity recovery(@PathVariable Integer id){
+        yxStoreProductService.recovery(id);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+
+    @ApiOperation(value = "商品上架下架")
+    @PostMapping(value = "/yxStoreProduct/onsale/{id}")
+    public ResponseEntity onSale(@PathVariable Integer id,@RequestBody String jsonStr){
+        JSONObject jsonObject = JSON.parseObject(jsonStr);
+        int status = Integer.valueOf(jsonObject.get("status").toString());
+        //System.out.println(status);
+        yxStoreProductService.onSale(id,status);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+
+    @ApiOperation(value = "生成属性")
+    @PostMapping(value = "/yxStoreProduct/isFormatAttr/{id}")
+    public ResponseEntity isFormatAttr(@PathVariable Integer id,@RequestBody String jsonStr){
+        return new ResponseEntity(yxStoreProductService.isFormatAttr(id,jsonStr),HttpStatus.OK);
+    }
+
+    @ApiOperation(value = "设置保存属性")
+    @PostMapping(value = "/yxStoreProduct/setAttr/{id}")
+    public ResponseEntity setAttr(@PathVariable Integer id,@RequestBody String jsonStr){
+        yxStoreProductService.createProductAttr(id,jsonStr);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+
+    @ApiOperation(value = "清除属性")
+    @PostMapping(value = "/yxStoreProduct/clearAttr/{id}")
+    public ResponseEntity clearAttr(@PathVariable Integer id){
+        yxStoreProductService.clearProductAttr(id,true);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+
+    @ApiOperation(value = "获取属性")
+    @GetMapping(value = "/yxStoreProduct/attr/{id}")
+    public ResponseEntity attr(@PathVariable Integer id){
+        String str = yxStoreProductService.getStoreProductAttrResult(id);
+        if(StrUtil.isEmpty(str)){
+            return new ResponseEntity(HttpStatus.OK);
+        }
+        JSONObject jsonObject = JSON.parseObject(str);
+
+        return new ResponseEntity(jsonObject,HttpStatus.OK);
+    }
+
+
+
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreProductReplyController.java b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreProductReplyController.java
new file mode 100644
index 00000000..3e938d38
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxStoreProductReplyController.java
@@ -0,0 +1,59 @@
+package co.yixiang.modules.shop.rest;
+
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.shop.domain.YxStoreProductReply;
+import co.yixiang.modules.shop.service.YxStoreProductReplyService;
+import co.yixiang.modules.shop.service.dto.YxStoreProductReplyQueryCriteria;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+
+/**
+* @author hupeng
+* @date 2019-11-03
+*/
+@Api(tags = "评论管理")
+@RestController
+@RequestMapping("api")
+public class YxStoreProductReplyController {
+
+    @Autowired
+    private YxStoreProductReplyService yxStoreProductReplyService;
+
+    @Log("查询")
+    @ApiOperation(value = "查询")
+    @GetMapping(value = "/yxStoreProductReply")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_SELECT')")
+    public ResponseEntity getYxStoreProductReplys(YxStoreProductReplyQueryCriteria criteria, Pageable pageable){
+        criteria.setIsDel(0);
+        return new ResponseEntity(yxStoreProductReplyService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+
+
+    @Log("修改")
+    @ApiOperation(value = "修改")
+    @PutMapping(value = "/yxStoreProductReply")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_EDIT')")
+    public ResponseEntity update(@Validated @RequestBody YxStoreProductReply resources){
+        yxStoreProductReplyService.update(resources);
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除")
+    @ApiOperation(value = "删除")
+    @DeleteMapping(value = "/yxStoreProductReply/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_DELETE')")
+    public ResponseEntity delete(@PathVariable Integer id){
+        YxStoreProductReply reply = new YxStoreProductReply();
+        reply.setIsDel(1);
+        reply.setId(id);
+        yxStoreProductReplyService.update(reply);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxSystemGroupDataController.java b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxSystemGroupDataController.java
new file mode 100644
index 00000000..86c2ade9
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxSystemGroupDataController.java
@@ -0,0 +1,127 @@
+package co.yixiang.modules.shop.rest;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import co.yixiang.aop.log.Log;
+import co.yixiang.exception.BadRequestException;
+import co.yixiang.modules.shop.domain.YxSystemGroupData;
+import co.yixiang.modules.shop.service.YxSystemGroupDataService;
+import co.yixiang.modules.shop.service.dto.YxSystemGroupDataQueryCriteria;
+import co.yixiang.utils.OrderUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+
+/**
+* @author hupeng
+* @date 2019-10-18
+*/
+@Api(tags = "数据配置管理")
+@RestController
+@RequestMapping("api")
+public class YxSystemGroupDataController {
+
+    @Autowired
+    private YxSystemGroupDataService yxSystemGroupDataService;
+
+    @Log("查询数据配置")
+    @ApiOperation(value = "查询数据配置")
+    @GetMapping(value = "/yxSystemGroupData")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_SELECT')")
+    public ResponseEntity getYxSystemGroupDatas(YxSystemGroupDataQueryCriteria criteria, Pageable pageable){
+
+        return new ResponseEntity(yxSystemGroupDataService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @Log("新增数据配置")
+    @ApiOperation(value = "新增数据配置")
+    @PostMapping(value = "/yxSystemGroupData")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE')")
+    public ResponseEntity create(@RequestBody String jsonStr){
+        JSONObject jsonObject = JSON.parseObject(jsonStr);
+
+        if(ObjectUtil.isNotNull(jsonObject.get("name"))){
+            if(StrUtil.isEmpty(jsonObject.get("name").toString())){
+                throw new BadRequestException("名称必须填写");
+            }
+        }
+
+        if(ObjectUtil.isNotNull(jsonObject.get("title"))){
+            if(StrUtil.isEmpty(jsonObject.get("title").toString())){
+                throw new BadRequestException("标题必须填写");
+            }
+        }
+
+        if(ObjectUtil.isNotNull(jsonObject.get("info"))){
+            if(StrUtil.isEmpty(jsonObject.get("info").toString())){
+                throw new BadRequestException("简介必须填写");
+            }
+        }
+
+        if(ObjectUtil.isNotNull(jsonObject.get("pic"))){
+            if(StrUtil.isEmpty(jsonObject.get("pic").toString())){
+                throw new BadRequestException("图片必须上传");
+            }
+        }
+
+
+        YxSystemGroupData yxSystemGroupData = new YxSystemGroupData();
+        yxSystemGroupData.setGroupName(jsonObject.get("groupName").toString());
+        jsonObject.remove("groupName");
+        yxSystemGroupData.setValue(jsonObject.toJSONString());
+        yxSystemGroupData.setStatus(1);
+        yxSystemGroupData.setAddTime(OrderUtil.getSecondTimestampTwo());
+
+        return new ResponseEntity(yxSystemGroupDataService.create(yxSystemGroupData),HttpStatus.CREATED);
+    }
+
+    @Log("修改数据配置")
+    @ApiOperation(value = "修改数据配置")
+    @PutMapping(value = "/yxSystemGroupData")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT')")
+    public ResponseEntity update(@RequestBody String jsonStr){
+        JSONObject jsonObject = JSON.parseObject(jsonStr);
+        if(ObjectUtil.isNotNull(jsonObject.get("name"))){
+            if(StrUtil.isEmpty(jsonObject.get("name").toString())){
+                throw new BadRequestException("名称必须填写");
+            }
+        }
+
+        if(ObjectUtil.isNotNull(jsonObject.get("title"))){
+            if(StrUtil.isEmpty(jsonObject.get("title").toString())){
+                throw new BadRequestException("标题必须填写");
+            }
+        }
+
+        if(ObjectUtil.isNotNull(jsonObject.get("pic"))){
+            if(StrUtil.isEmpty(jsonObject.get("pic").toString())){
+                throw new BadRequestException("图片必须上传");
+            }
+        }
+
+        YxSystemGroupData yxSystemGroupData = new YxSystemGroupData();
+
+        yxSystemGroupData.setGroupName(jsonObject.get("groupName").toString());
+        jsonObject.remove("groupName");
+        yxSystemGroupData.setValue(jsonObject.toJSONString());
+        yxSystemGroupData.setId(Integer.valueOf(jsonObject.get("id").toString()));
+        yxSystemGroupDataService.update(yxSystemGroupData);
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除数据配置")
+    @ApiOperation(value = "删除数据配置")
+    @DeleteMapping(value = "/yxSystemGroupData/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE')")
+    public ResponseEntity delete(@PathVariable Integer id){
+        yxSystemGroupDataService.delete(id);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxUserBillController.java b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxUserBillController.java
new file mode 100644
index 00000000..e43240d0
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxUserBillController.java
@@ -0,0 +1,61 @@
+package co.yixiang.modules.shop.rest;
+
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.shop.domain.YxUserBill;
+import co.yixiang.modules.shop.service.YxUserBillService;
+import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+
+/**
+* @author hupeng
+* @date 2019-11-06
+*/
+@Api(tags = "YxUserBill管理")
+@RestController
+@RequestMapping("api")
+public class YxUserBillController {
+
+    @Autowired
+    private YxUserBillService yxUserBillService;
+
+    @Log("查询YxUserBill")
+    @ApiOperation(value = "查询YxUserBill")
+    @GetMapping(value = "/yxUserBill")
+    @PreAuthorize("hasAnyRole('ADMIN','YXUSERBILL_ALL','YXUSERBILL_SELECT')")
+    public ResponseEntity getYxUserBills(YxUserBillQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity(yxUserBillService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @Log("新增YxUserBill")
+    @ApiOperation(value = "新增YxUserBill")
+    @PostMapping(value = "/yxUserBill")
+    @PreAuthorize("hasAnyRole('ADMIN','YXUSERBILL_ALL','YXUSERBILL_CREATE')")
+    public ResponseEntity create(@Validated @RequestBody YxUserBill resources){
+        return new ResponseEntity(yxUserBillService.create(resources),HttpStatus.CREATED);
+    }
+
+    @Log("修改YxUserBill")
+    @ApiOperation(value = "修改YxUserBill")
+    @PutMapping(value = "/yxUserBill")
+    @PreAuthorize("hasAnyRole('ADMIN','YXUSERBILL_ALL','YXUSERBILL_EDIT')")
+    public ResponseEntity update(@Validated @RequestBody YxUserBill resources){
+        yxUserBillService.update(resources);
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除YxUserBill")
+    @ApiOperation(value = "删除YxUserBill")
+    @DeleteMapping(value = "/yxUserBill/{id}")
+    @PreAuthorize("hasAnyRole('ADMIN','YXUSERBILL_ALL','YXUSERBILL_DELETE')")
+    public ResponseEntity delete(@PathVariable Integer id){
+        yxUserBillService.delete(id);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxUserController.java b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxUserController.java
new file mode 100644
index 00000000..d284e93c
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/rest/YxUserController.java
@@ -0,0 +1,74 @@
+package co.yixiang.modules.shop.rest;
+
+import co.yixiang.modules.shop.service.YxUserService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import co.yixiang.aop.log.Log;
+import co.yixiang.modules.shop.domain.YxUser;
+import co.yixiang.modules.shop.service.dto.YxUserQueryCriteria;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+
+/**
+* @author hupeng
+* @date 2019-10-06
+*/
+@Api(tags = "用户管理")
+@RestController
+@RequestMapping("api")
+public class YxUserController {
+
+    @Autowired
+    private YxUserService yxUserService;
+
+    @Log("查询用户")
+    @ApiOperation(value = "查询用户")
+    @GetMapping(value = "/yxUser")
+    @PreAuthorize("hasAnyRole('ADMIN','YXUSER_ALL','YXUSER_SELECT')")
+    public ResponseEntity getYxUsers(YxUserQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity(yxUserService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @Log("新增用户")
+    @ApiOperation(value = "新增用户")
+    @PostMapping(value = "/yxUser")
+    @PreAuthorize("hasAnyRole('ADMIN','YXUSER_ALL','YXUSER_CREATE')")
+    public ResponseEntity create(@Validated @RequestBody YxUser resources){
+        return new ResponseEntity(yxUserService.create(resources),HttpStatus.CREATED);
+    }
+
+    @Log("修改用户")
+    @ApiOperation(value = "修改用户")
+    @PutMapping(value = "/yxUser")
+    @PreAuthorize("hasAnyRole('ADMIN','YXUSER_ALL','YXUSER_EDIT')")
+    public ResponseEntity update(@Validated @RequestBody YxUser resources){
+        yxUserService.update(resources);
+        return new ResponseEntity(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除用户")
+    @ApiOperation(value = "删除用户")
+    @DeleteMapping(value = "/yxUser/{uid}")
+    @PreAuthorize("hasAnyRole('ADMIN','YXUSER_ALL','YXUSER_DELETE')")
+    public ResponseEntity delete(@PathVariable Integer uid){
+        yxUserService.delete(uid);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+
+    @ApiOperation(value = "用户禁用启用")
+    @PostMapping(value = "/yxUser/onStatus/{id}")
+    public ResponseEntity onStatus(@PathVariable Integer id,@RequestBody String jsonStr){
+        JSONObject jsonObject = JSON.parseObject(jsonStr);
+        int status = Integer.valueOf(jsonObject.get("status").toString());
+        //System.out.println(status);
+        yxUserService.onStatus(id,status);
+        return new ResponseEntity(HttpStatus.OK);
+    }
+
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java
new file mode 100644
index 00000000..1552e872
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java
@@ -0,0 +1,66 @@
+package co.yixiang.modules.shop.service;
+
+import co.yixiang.modules.shop.domain.YxStoreCategory;
+import co.yixiang.modules.shop.service.dto.YxStoreCategoryDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreCategoryQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-10-03
+*/
+//@CacheConfig(cacheNames = "yxStoreCategory")
+public interface YxStoreCategoryService {
+
+    /**
+    * 查询数据分页
+    * @param criteria
+    * @param pageable
+    * @return
+    */
+    //@Cacheable
+    Map queryAll(YxStoreCategoryQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria
+    * @return
+    */
+    //@Cacheable
+    List queryAll(YxStoreCategoryQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id
+     * @return
+     */
+    //@Cacheable(key = "#p0")
+    YxStoreCategoryDTO findById(Integer id);
+
+    /**
+     * 创建
+     * @param resources
+     * @return
+     */
+    //@CacheEvict(allEntries = true)
+    YxStoreCategoryDTO create(YxStoreCategory resources);
+
+    /**
+     * 编辑
+     * @param resources
+     */
+    //@CacheEvict(allEntries = true)
+    void update(YxStoreCategory resources);
+
+    /**
+     * 删除
+     * @param id
+     */
+    //@CacheEvict(allEntries = true)
+    void delete(Integer id);
+
+    Object buildTree(List categoryDTOS);
+
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderService.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderService.java
new file mode 100644
index 00000000..d20f0844
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderService.java
@@ -0,0 +1,65 @@
+package co.yixiang.modules.shop.service;
+
+import co.yixiang.modules.shop.domain.YxStoreOrder;
+import co.yixiang.modules.shop.service.dto.YxStoreOrderDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreOrderQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-10-14
+*/
+//@CacheConfig(cacheNames = "yxStoreOrder")
+public interface YxStoreOrderService {
+
+    void refund(YxStoreOrder resources);
+
+    /**
+    * 查询数据分页
+    * @param criteria
+    * @param pageable
+    * @return
+    */
+    //@Cacheable
+    Map queryAll(YxStoreOrderQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria
+    * @return
+    */
+    //@Cacheable
+    List queryAll(YxStoreOrderQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id
+     * @return
+     */
+    //@Cacheable(key = "#p0")
+    YxStoreOrderDTO findById(Integer id);
+
+    /**
+     * 创建
+     * @param resources
+     * @return
+     */
+    //@CacheEvict(allEntries = true)
+    YxStoreOrderDTO create(YxStoreOrder resources);
+
+    /**
+     * 编辑
+     * @param resources
+     */
+    //@CacheEvict(allEntries = true)
+    void update(YxStoreOrder resources);
+
+    /**
+     * 删除
+     * @param id
+     */
+    //@CacheEvict(allEntries = true)
+    void delete(Integer id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderStatusService.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderStatusService.java
new file mode 100644
index 00000000..489d38b8
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderStatusService.java
@@ -0,0 +1,66 @@
+package co.yixiang.modules.shop.service;
+
+import co.yixiang.modules.shop.domain.YxStoreOrderStatus;
+import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusQueryCriteria;
+import org.springframework.cache.annotation.CacheConfig;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-11-02
+*/
+//@CacheConfig(cacheNames = "yxStoreOrderStatus")
+public interface YxStoreOrderStatusService {
+
+    /**
+    * 查询数据分页
+    * @param criteria
+    * @param pageable
+    * @return
+    */
+    //@Cacheable
+    Map queryAll(YxStoreOrderStatusQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria
+    * @return
+    */
+    //@Cacheable
+    List queryAll(YxStoreOrderStatusQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id
+     * @return
+     */
+    //@Cacheable(key = "#p0")
+    YxStoreOrderStatusDTO findById(Integer id);
+
+    /**
+     * 创建
+     * @param resources
+     * @return
+     */
+    //@CacheEvict(allEntries = true)
+    YxStoreOrderStatusDTO create(YxStoreOrderStatus resources);
+
+    /**
+     * 编辑
+     * @param resources
+     */
+    //@CacheEvict(allEntries = true)
+    void update(YxStoreOrderStatus resources);
+
+    /**
+     * 删除
+     * @param id
+     */
+    //@CacheEvict(allEntries = true)
+    void delete(Integer id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java
new file mode 100644
index 00000000..20e1c0df
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java
@@ -0,0 +1,66 @@
+package co.yixiang.modules.shop.service;
+
+import co.yixiang.modules.shop.domain.YxStoreProductReply;
+import co.yixiang.modules.shop.service.dto.YxStoreProductReplyDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreProductReplyQueryCriteria;
+import org.springframework.cache.annotation.CacheConfig;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-11-03
+*/
+//@CacheConfig(cacheNames = "yxStoreProductReply")
+public interface YxStoreProductReplyService {
+
+    /**
+    * 查询数据分页
+    * @param criteria
+    * @param pageable
+    * @return
+    */
+    //@Cacheable
+    Map queryAll(YxStoreProductReplyQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria
+    * @return
+    */
+    //@Cacheable
+    List queryAll(YxStoreProductReplyQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id
+     * @return
+     */
+    //@Cacheable(key = "#p0")
+    YxStoreProductReplyDTO findById(Integer id);
+
+    /**
+     * 创建
+     * @param resources
+     * @return
+     */
+    //@CacheEvict(allEntries = true)
+    YxStoreProductReplyDTO create(YxStoreProductReply resources);
+
+    /**
+     * 编辑
+     * @param resources
+     */
+    //@CacheEvict(allEntries = true)
+    void update(YxStoreProductReply resources);
+
+    /**
+     * 删除
+     * @param id
+     */
+    //@CacheEvict(allEntries = true)
+    void delete(Integer id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java
new file mode 100644
index 00000000..083c16cb
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java
@@ -0,0 +1,78 @@
+package co.yixiang.modules.shop.service;
+
+import co.yixiang.modules.shop.domain.YxStoreProduct;
+import co.yixiang.modules.shop.service.dto.ProductFormatDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreProductDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreProductQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-10-04
+*/
+//@CacheConfig(cacheNames = "yxStoreProduct")
+public interface YxStoreProductService {
+
+    /**
+    * 查询数据分页
+    * @param criteria
+    * @param pageable
+    * @return
+    */
+    //@Cacheable
+    Map queryAll(YxStoreProductQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria
+    * @return
+    */
+    //@Cacheable
+    List queryAll(YxStoreProductQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id
+     * @return
+     */
+    //@Cacheable(key = "#p0")
+    YxStoreProductDTO findById(Integer id);
+
+    /**
+     * 创建
+     * @param resources
+     * @return
+     */
+    //@CacheEvict(allEntries = true)
+    YxStoreProductDTO create(YxStoreProduct resources);
+
+    /**
+     * 编辑
+     * @param resources
+     */
+    //@CacheEvict(allEntries = true)
+    void update(YxStoreProduct resources);
+
+    /**
+     * 删除
+     * @param id
+     */
+    //@CacheEvict(allEntries = true)
+    void delete(Integer id);
+
+    void recovery(Integer id);
+
+    void onSale(Integer id,Integer status);
+
+    List isFormatAttr(Integer id, String jsonStr);
+
+    void createProductAttr(Integer id, String jsonStr);
+
+    void setResult(Map map,Integer id);
+
+    void clearProductAttr(Integer id,boolean isActice);
+
+    String getStoreProductAttrResult(Integer id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java
new file mode 100644
index 00000000..7cd7ed01
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java
@@ -0,0 +1,66 @@
+package co.yixiang.modules.shop.service;
+
+import co.yixiang.modules.shop.domain.YxSystemGroupData;
+import co.yixiang.modules.shop.service.dto.YxSystemGroupDataDTO;
+import co.yixiang.modules.shop.service.dto.YxSystemGroupDataQueryCriteria;
+import org.springframework.cache.annotation.CacheConfig;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-10-18
+*/
+//@CacheConfig(cacheNames = "yxSystemGroupData")
+public interface YxSystemGroupDataService {
+
+    /**
+    * 查询数据分页
+    * @param criteria
+    * @param pageable
+    * @return
+    */
+    //@Cacheable
+    Map queryAll(YxSystemGroupDataQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria
+    * @return
+    */
+    //@Cacheable
+    List queryAll(YxSystemGroupDataQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id
+     * @return
+     */
+    //@Cacheable(key = "#p0")
+    YxSystemGroupDataDTO findById(Integer id);
+
+    /**
+     * 创建
+     * @param resources
+     * @return
+     */
+    //@CacheEvict(allEntries = true)
+    YxSystemGroupDataDTO create(YxSystemGroupData resources);
+
+    /**
+     * 编辑
+     * @param resources
+     */
+    //@CacheEvict(allEntries = true)
+    void update(YxSystemGroupData resources);
+
+    /**
+     * 删除
+     * @param id
+     */
+    //@CacheEvict(allEntries = true)
+    void delete(Integer id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxUserBillService.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxUserBillService.java
new file mode 100644
index 00000000..bb1e6424
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxUserBillService.java
@@ -0,0 +1,66 @@
+package co.yixiang.modules.shop.service;
+
+import co.yixiang.modules.shop.domain.YxUserBill;
+import co.yixiang.modules.shop.service.dto.YxUserBillDTO;
+import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria;
+import org.springframework.cache.annotation.CacheConfig;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-11-06
+*/
+//@CacheConfig(cacheNames = "yxUserBill")
+public interface YxUserBillService {
+
+    /**
+    * 查询数据分页
+    * @param criteria
+    * @param pageable
+    * @return
+    */
+    //@Cacheable
+    Map queryAll(YxUserBillQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria
+    * @return
+    */
+    //@Cacheable
+    List queryAll(YxUserBillQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id
+     * @return
+     */
+    //@Cacheable(key = "#p0")
+    YxUserBillDTO findById(Integer id);
+
+    /**
+     * 创建
+     * @param resources
+     * @return
+     */
+    //@CacheEvict(allEntries = true)
+    YxUserBillDTO create(YxUserBill resources);
+
+    /**
+     * 编辑
+     * @param resources
+     */
+    //@CacheEvict(allEntries = true)
+    void update(YxUserBill resources);
+
+    /**
+     * 删除
+     * @param id
+     */
+    //@CacheEvict(allEntries = true)
+    void delete(Integer id);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxUserService.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxUserService.java
new file mode 100644
index 00000000..7f213118
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/YxUserService.java
@@ -0,0 +1,65 @@
+package co.yixiang.modules.shop.service;
+
+import co.yixiang.modules.shop.domain.YxUser;
+import co.yixiang.modules.shop.service.dto.YxUserDTO;
+import co.yixiang.modules.shop.service.dto.YxUserQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+
+/**
+* @author hupeng
+* @date 2019-10-06
+*/
+//@CacheConfig(cacheNames = "yxUser")
+public interface YxUserService {
+
+    /**
+    * 查询数据分页
+    * @param criteria
+    * @param pageable
+    * @return
+    */
+    //@Cacheable
+    Map queryAll(YxUserQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria
+    * @return
+    */
+    //@Cacheable
+    List queryAll(YxUserQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param uid
+     * @return
+     */
+    //@Cacheable(key = "#p0")
+    YxUserDTO findById(Integer uid);
+
+    /**
+     * 创建
+     * @param resources
+     * @return
+     */
+    //@CacheEvict(allEntries = true)
+    YxUserDTO create(YxUser resources);
+
+    /**
+     * 编辑
+     * @param resources
+     */
+    //@CacheEvict(allEntries = true)
+    void update(YxUser resources);
+
+    /**
+     * 删除
+     * @param uid
+     */
+    //@CacheEvict(allEntries = true)
+    void delete(Integer uid);
+
+    void onStatus(Integer uid, Integer status);
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/DetailDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/DetailDTO.java
new file mode 100644
index 00000000..b15f5831
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/DetailDTO.java
@@ -0,0 +1,20 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName DetailDTO
+ * @Author hupeng <610796224@qq.com>
+ * @Date 2019/10/12
+ **/
+@Data
+public class DetailDTO {
+    private List data;
+
+    //private List>>> res;
+
+    private List>> res;
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/FromatDetailDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/FromatDetailDTO.java
new file mode 100644
index 00000000..7c18db15
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/FromatDetailDTO.java
@@ -0,0 +1,23 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @ClassName FromatDetailDTO
+ * @Author hupeng <610796224@qq.com>
+ * @Date 2019/10/12
+ **/
+
+@Data
+public class FromatDetailDTO {
+    private  boolean attrHidden;
+
+    private  String detailValue;
+
+    private List detail;
+
+    private String value;
+
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDTO.java
new file mode 100644
index 00000000..d1d01aeb
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDTO.java
@@ -0,0 +1,33 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import org.omg.CORBA.PRIVATE_MEMBER;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName ProductFormatDTO
+ * @Author hupeng <610796224@qq.com>
+ * @Date 2019/10/12
+ **/
+
+@Data
+public class ProductFormatDTO {
+
+    private Double price;
+
+    private Double cost;
+
+    private int sales;
+
+    private String pic;
+
+   // private Map>> detail;
+
+    //private List> detail;
+    private Map detail;
+    private Boolean check;
+    
+
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDTO.java
new file mode 100644
index 00000000..449cdbe6
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDTO.java
@@ -0,0 +1,36 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Map;
+
+/**
+ * @ClassName StoreOrderCartInfo
+ * @Author hupeng <610796224@qq.com>
+ * @Date 2019/10/14
+ **/
+
+
+@Data
+public class StoreOrderCartInfoDTO {
+
+
+    private Integer id;
+
+
+    private Integer oid;
+
+
+    private Integer cartId;
+
+
+    private String cartInfo;
+
+
+    private String unique;
+
+    private Map cartInfoMap;
+
+
+}
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryDTO.java
new file mode 100644
index 00000000..b1b6ba90
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryDTO.java
@@ -0,0 +1,44 @@
+package co.yixiang.modules.shop.service.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+* @author hupeng
+* @date 2019-10-03
+*/
+@Data
+public class YxStoreCategoryDTO implements Serializable {
+
+    // 商品分类表ID
+    private Integer id;
+
+    // 父id
+    private Integer pid;
+
+    // 分类名称
+    private String cateName;
+
+    // 排序
+    private Integer sort;
+
+    // 图标
+    private String pic;
+
+    // 是否推荐
+    private Integer isShow;
+
+    // 添加时间
+    private Integer addTime;
+
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private List children;
+
+    public String getLabel() {
+        return cateName;
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryQueryCriteria.java
new file mode 100644
index 00000000..295f3c8d
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryQueryCriteria.java
@@ -0,0 +1,16 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import co.yixiang.annotation.Query;
+
+/**
+* @author hupeng
+* @date 2019-10-03
+*/
+@Data
+public class YxStoreCategoryQueryCriteria{
+
+    // 模糊
+    @Query(type = Query.Type.INNER_LIKE)
+    private String cateName;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDTO.java
new file mode 100644
index 00000000..bd5cc567
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDTO.java
@@ -0,0 +1,180 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+* @author hupeng
+* @date 2019-10-14
+*/
+@Data
+public class YxStoreOrderDTO implements Serializable {
+
+    // 订单ID
+    private Integer id;
+
+    //支付类型
+    private String payTypeName;
+
+    //状态名称
+    private String statusName;
+
+    private Integer _status;
+
+    //订单类型
+    private String pinkName;
+
+    private List cartInfoList;
+
+
+    // 订单号
+    private String orderId;
+
+    // 用户id
+    private Integer uid;
+
+    // 用户姓名
+    private String realName;
+
+    // 用户电话
+    private String userPhone;
+
+    // 详细地址
+    private String userAddress;
+
+    // 购物车id
+    private String cartId;
+
+    // 运费金额
+    private BigDecimal freightPrice;
+
+    // 订单商品总数
+    private Integer totalNum;
+
+    // 订单总价
+    private BigDecimal totalPrice;
+
+    // 邮费
+    private BigDecimal totalPostage;
+
+    // 实际支付金额
+    private BigDecimal payPrice;
+
+    // 支付邮费
+    private BigDecimal payPostage;
+
+    // 抵扣金额
+    private BigDecimal deductionPrice;
+
+    // 优惠券id
+    private Integer couponId;
+
+    // 优惠券金额
+    private BigDecimal couponPrice;
+
+    // 支付状态
+    private Integer paid;
+
+    // 支付时间
+    private Integer payTime;
+
+    // 支付方式
+    private String payType;
+
+    // 创建时间
+    private Integer addTime;
+
+    // 订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款)
+    private Integer status;
+
+    // 0 未退款 1 申请中 2 已退款
+    private Integer refundStatus;
+
+    // 退款图片
+    private String refundReasonWapImg;
+
+    // 退款用户说明
+    private String refundReasonWapExplain;
+
+    // 退款时间
+    private Integer refundReasonTime;
+
+    // 前台退款原因
+    private String refundReasonWap;
+
+    // 不退款的理由
+    private String refundReason;
+
+    // 退款金额
+    private BigDecimal refundPrice;
+
+    // 快递名称/送货人姓名
+    private String deliveryName;
+
+    // 发货类型
+    private String deliveryType;
+
+    // 快递单号/手机号
+    private String deliveryId;
+
+    // 消费赚取积分
+    private BigDecimal gainIntegral;
+
+    // 使用积分
+    private BigDecimal useIntegral;
+
+    // 给用户退了多少积分
+    private BigDecimal backIntegral;
+
+    // 备注
+    private String mark;
+
+    // 是否删除
+    private Integer isDel;
+
+    // 唯一id(md5加密)类似id
+    private String unique;
+
+    // 管理员备注
+    private String remark;
+
+    // 商户ID
+    private Integer merId;
+
+    private Integer isMerCheck;
+
+    // 拼团产品id0一般产品
+    private Integer combinationId;
+
+    // 拼团id 0没有拼团
+    private Integer pinkId;
+
+    // 成本价
+    private BigDecimal cost;
+
+    // 秒杀产品ID
+    private Integer seckillId;
+
+    // 砍价id
+    private Integer bargainId;
+
+    // 核销码
+    private String verifyCode;
+
+    // 门店id
+    private Integer storeId;
+
+    // 配送方式 1=快递 ,2=门店自提
+    private Integer shippingType;
+
+    // 支付渠道(0微信公众号1微信小程序)
+    private Integer isChannel;
+
+    private Integer isRemind;
+
+    private Integer isSystemDel;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderQueryCriteria.java
new file mode 100644
index 00000000..4c893c65
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderQueryCriteria.java
@@ -0,0 +1,36 @@
+package co.yixiang.modules.shop.service.dto;
+
+import co.yixiang.annotation.Query;
+import lombok.Data;
+
+/**
+* @author hupeng
+* @date 2019-10-14
+*/
+@Data
+public class YxStoreOrderQueryCriteria{
+
+    // 模糊
+    @Query(type = Query.Type.INNER_LIKE)
+    private String orderId;
+
+    // 模糊
+    @Query(type = Query.Type.INNER_LIKE)
+    private String realName;
+
+    // 模糊
+    @Query(type = Query.Type.INNER_LIKE)
+    private String userPhone;
+
+    @Query
+    private Integer paid;
+
+    @Query
+    private Integer status;
+
+    @Query
+    private Integer refundStatus;
+
+    @Query
+    private Integer isDel;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDTO.java
new file mode 100644
index 00000000..656c5f8b
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDTO.java
@@ -0,0 +1,27 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import java.io.Serializable;
+
+
+/**
+* @author hupeng
+* @date 2019-11-02
+*/
+@Data
+public class YxStoreOrderStatusDTO implements Serializable {
+
+    private Integer id;
+
+    // 订单id
+    private Integer oid;
+
+    // 操作类型
+    private String changeType;
+
+    // 操作备注
+    private String changeMessage;
+
+    // 操作时间
+    private Integer changeTime;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusQueryCriteria.java
new file mode 100644
index 00000000..862a3f5f
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusQueryCriteria.java
@@ -0,0 +1,12 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import co.yixiang.annotation.Query;
+
+/**
+* @author hupeng
+* @date 2019-11-02
+*/
+@Data
+public class YxStoreOrderStatusQueryCriteria{
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDTO.java
new file mode 100644
index 00000000..e6d8b20d
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDTO.java
@@ -0,0 +1,124 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+
+/**
+* @author hupeng
+* @date 2019-10-04
+*/
+@Data
+public class YxStoreProductDTO implements Serializable {
+
+    // 商品id
+    private Integer id;
+
+    // 商户Id(0为总后台管理员创建,不为0的时候是商户后台创建)
+    private Integer merId;
+
+    // 商品图片
+    private String image;
+
+    // 轮播图
+    private String sliderImage;
+
+    // 商品名称
+    private String storeName;
+
+    // 商品简介
+    private String storeInfo;
+
+    // 关键字
+    private String keyword;
+
+    // 产品条码(一维码)
+    private String barCode;
+
+    // 分类id
+    private String cateId;
+
+    private String cateName;
+
+    // 商品价格
+    private BigDecimal price;
+
+    // 会员价格
+    private BigDecimal vipPrice;
+
+    // 市场价
+    private BigDecimal otPrice;
+
+    // 邮费
+    private BigDecimal postage;
+
+    // 单位名
+    private String unitName;
+
+    // 排序
+    private Integer sort;
+
+    // 销量
+    private Integer sales;
+
+    // 库存
+    private Integer stock;
+
+    // 状态(0:未上架,1:上架)
+    private Integer isShow;
+
+    // 是否热卖
+    private Integer isHot;
+
+    // 是否优惠
+    private Integer isBenefit;
+
+    // 是否精品
+    private Integer isBest;
+
+    // 是否新品
+    private Integer isNew;
+
+    // 产品描述
+    private String description;
+
+    // 添加时间
+    private Integer addTime;
+
+    // 是否包邮
+    private Integer isPostage;
+
+    // 是否删除
+    private Integer isDel;
+
+    // 商户是否代理 0不可代理1可代理
+    private Integer merUse;
+
+    // 获得积分
+    private BigDecimal giveIntegral;
+
+    // 成本价
+    private BigDecimal cost;
+
+    // 秒杀状态 0 未开启 1已开启
+    private Integer isSeckill;
+
+    // 砍价状态 0未开启 1开启
+    private Integer isBargain;
+
+    // 是否优品推荐
+    private Integer isGood;
+
+    // 虚拟销量
+    private Integer ficti;
+
+    // 浏览量
+    private Integer browse;
+
+    // 产品二维码地址(用户小程序海报)
+    private String codePath;
+
+    // 淘宝京东1688类型
+    private String soureLink;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductQueryCriteria.java
new file mode 100644
index 00000000..09a7f9cf
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductQueryCriteria.java
@@ -0,0 +1,24 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import co.yixiang.annotation.Query;
+
+/**
+* @author hupeng
+* @date 2019-10-04
+*/
+@Data
+public class YxStoreProductQueryCriteria{
+
+    // 模糊
+    @Query(type = Query.Type.INNER_LIKE)
+    private String storeName;
+
+    // 精确
+    @Query
+    private Integer isDel;
+
+    @Query
+    private Integer isShow;
+
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDTO.java
new file mode 100644
index 00000000..d93fdaf8
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDTO.java
@@ -0,0 +1,64 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import java.io.Serializable;
+
+
+/**
+* @author hupeng
+* @date 2019-11-03
+*/
+@Data
+public class YxStoreProductReplyDTO implements Serializable {
+
+    // 评论ID
+    private Integer id;
+
+    // 用户ID
+    private Integer uid;
+
+    private String username;
+
+    // 订单ID
+    private Integer oid;
+
+    // 唯一id
+    private String unique;
+
+    // 产品id
+    private Integer productId;
+
+    private String productName;
+
+
+    // 某种商品类型(普通商品、秒杀商品)
+    private String replyType;
+
+    // 商品分数
+    private Integer productScore;
+
+    // 服务分数
+    private Integer serviceScore;
+
+    // 评论内容
+    private String comment;
+
+    // 评论图片
+    private String pics;
+
+    // 评论时间
+    private Integer addTime;
+
+    // 管理员回复内容
+    private String merchantReplyContent;
+
+    // 管理员回复时间
+    private Integer merchantReplyTime;
+
+    // 0未删除1已删除
+    private Integer isDel;
+
+    // 0未回复1已回复
+    private Integer isReply;
+
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyQueryCriteria.java
new file mode 100644
index 00000000..2609334a
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyQueryCriteria.java
@@ -0,0 +1,14 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import co.yixiang.annotation.Query;
+
+/**
+* @author hupeng
+* @date 2019-11-03
+*/
+@Data
+public class YxStoreProductReplyQueryCriteria{
+    @Query
+    private Integer isDel;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDTO.java
new file mode 100644
index 00000000..08b4af15
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDTO.java
@@ -0,0 +1,34 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Map;
+
+
+/**
+* @author hupeng
+* @date 2019-10-18
+*/
+@Data
+public class YxSystemGroupDataDTO implements Serializable {
+
+    // 组合数据详情ID
+    private Integer id;
+
+    // 对应的数据名称
+    private String groupName;
+
+    // 数据组对应的数据值(json数据)
+    private String value;
+
+    private Map map;
+
+    // 添加数据时间
+    private Integer addTime;
+
+    // 数据排序
+    private Integer sort;
+
+    // 状态(1:开启;2:关闭;)
+    private Integer status;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataQueryCriteria.java
new file mode 100644
index 00000000..9814e284
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataQueryCriteria.java
@@ -0,0 +1,15 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import co.yixiang.annotation.Query;
+
+/**
+* @author hupeng
+* @date 2019-10-18
+*/
+@Data
+public class YxSystemGroupDataQueryCriteria{
+    // 精确
+    @Query
+    private String groupName;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDTO.java
new file mode 100644
index 00000000..c8f09087
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDTO.java
@@ -0,0 +1,50 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+
+/**
+* @author hupeng
+* @date 2019-11-06
+*/
+@Data
+public class YxUserBillDTO implements Serializable {
+
+    // 用户账单id
+    private Integer id;
+
+    // 用户uid
+    private Integer uid;
+
+    // 关联id
+    private String linkId;
+
+    // 0 = 支出 1 = 获得
+    private Integer pm;
+
+    // 账单标题
+    private String title;
+
+    // 明细种类
+    private String category;
+
+    // 明细类型
+    private String type;
+
+    // 明细数字
+    private BigDecimal number;
+
+    // 剩余
+    private BigDecimal balance;
+
+    // 备注
+    private String mark;
+
+    // 添加时间
+    private Integer addTime;
+
+    // 0 = 带确定 1 = 有效 -1 = 无效
+    private Integer status;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillQueryCriteria.java
new file mode 100644
index 00000000..713c4516
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillQueryCriteria.java
@@ -0,0 +1,13 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import java.math.BigDecimal;
+import co.yixiang.annotation.Query;
+
+/**
+* @author hupeng
+* @date 2019-11-06
+*/
+@Data
+public class YxUserBillQueryCriteria{
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDTO.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDTO.java
new file mode 100644
index 00000000..357b2f75
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDTO.java
@@ -0,0 +1,110 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+
+/**
+* @author hupeng
+* @date 2019-10-06
+*/
+@Data
+public class YxUserDTO implements Serializable {
+
+    // 用户id
+    private Integer uid;
+
+    // 用户账号
+    private String account;
+
+    // 用户密码
+    private String pwd;
+
+    // 真实姓名
+    private String realName;
+
+    // 生日
+    private Integer birthday;
+
+    // 身份证号码
+    private String cardId;
+
+    // 用户备注
+    private String mark;
+
+    // 合伙人id
+    private Integer partnerId;
+
+    // 用户分组id
+    private Integer groupId;
+
+    // 用户昵称
+    private String nickname;
+
+    // 用户头像
+    private String avatar;
+
+    // 手机号码
+    private String phone;
+
+    // 添加时间
+    private Integer addTime;
+
+    // 添加ip
+    private String addIp;
+
+    // 最后一次登录时间
+    private Integer lastTime;
+
+    // 最后一次登录ip
+    private String lastIp;
+
+    // 用户余额
+    private BigDecimal nowMoney;
+
+    // 佣金金额
+    private BigDecimal brokeragePrice;
+
+    // 用户剩余积分
+    private BigDecimal integral;
+
+    // 连续签到天数
+    private Integer signNum;
+
+    // 1为正常,0为禁止
+    private Integer status;
+
+    // 等级
+    private Integer level;
+
+    // 推广元id
+    private Integer spreadUid;
+
+    // 推广员关联时间
+    private Integer spreadTime;
+
+    // 用户类型
+    private String userType;
+
+    // 是否为推广员
+    private Integer isPromoter;
+
+    // 用户购买次数
+    private Integer payCount;
+
+    // 下级人数
+    private Integer spreadCount;
+
+    // 清理会员时间
+    private Integer cleanTime;
+
+    // 详细地址
+    private String addres;
+
+    // 管理员编号 
+    private Integer adminid;
+
+    // 用户登陆类型,h5,wechat,routine
+    private String loginType;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserQueryCriteria.java
new file mode 100644
index 00000000..bddaf6e5
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/dto/YxUserQueryCriteria.java
@@ -0,0 +1,20 @@
+package co.yixiang.modules.shop.service.dto;
+
+import lombok.Data;
+import co.yixiang.annotation.Query;
+
+/**
+* @author hupeng
+* @date 2019-10-06
+*/
+@Data
+public class YxUserQueryCriteria{
+
+    // 模糊
+    @Query(type = Query.Type.INNER_LIKE)
+    private String nickname;
+
+    // 模糊
+    @Query(type = Query.Type.INNER_LIKE)
+    private String phone;
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java
new file mode 100644
index 00000000..83015443
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java
@@ -0,0 +1,118 @@
+package co.yixiang.modules.shop.service.impl;
+
+import co.yixiang.modules.shop.domain.YxStoreCategory;
+import co.yixiang.modules.shop.service.YxStoreCategoryService;
+import co.yixiang.utils.ValidationUtil;
+import co.yixiang.modules.shop.repository.YxStoreCategoryRepository;
+import co.yixiang.modules.shop.service.dto.YxStoreCategoryDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreCategoryQueryCriteria;
+import co.yixiang.modules.shop.service.mapper.YxStoreCategoryMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import co.yixiang.utils.PageUtil;
+import co.yixiang.utils.QueryHelp;
+import org.springframework.util.CollectionUtils;
+
+/**
+* @author hupeng
+* @date 2019-10-03
+*/
+@Service
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
+public class YxStoreCategoryServiceImpl implements YxStoreCategoryService {
+
+    @Autowired
+    private YxStoreCategoryRepository yxStoreCategoryRepository;
+
+    @Autowired
+    private YxStoreCategoryMapper yxStoreCategoryMapper;
+
+    @Override
+    public Map queryAll(YxStoreCategoryQueryCriteria criteria, Pageable pageable){
+        Page page = yxStoreCategoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
+        return PageUtil.toPage(page.map(yxStoreCategoryMapper::toDto));
+    }
+
+    @Override
+    public List queryAll(YxStoreCategoryQueryCriteria criteria){
+        return yxStoreCategoryMapper.toDto(yxStoreCategoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
+    }
+
+    @Override
+    public YxStoreCategoryDTO findById(Integer id) {
+        Optional yxStoreCategory = yxStoreCategoryRepository.findById(id);
+        ValidationUtil.isNull(yxStoreCategory,"YxStoreCategory","id",id);
+        return yxStoreCategoryMapper.toDto(yxStoreCategory.get());
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public YxStoreCategoryDTO create(YxStoreCategory resources) {
+        return yxStoreCategoryMapper.toDto(yxStoreCategoryRepository.save(resources));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(YxStoreCategory resources) {
+        Optional optionalYxStoreCategory = yxStoreCategoryRepository.findById(resources.getId());
+        ValidationUtil.isNull( optionalYxStoreCategory,"YxStoreCategory","id",resources.getId());
+        YxStoreCategory yxStoreCategory = optionalYxStoreCategory.get();
+        yxStoreCategory.copy(resources);
+        yxStoreCategoryRepository.save(yxStoreCategory);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delete(Integer id) {
+        yxStoreCategoryRepository.deleteById(id);
+    }
+
+
+    @Override
+    public Object buildTree(List categoryDTOS) {
+        Set trees = new LinkedHashSet<>();
+        Set cates= new LinkedHashSet<>();
+        List deptNames = categoryDTOS.stream().map(YxStoreCategoryDTO::getCateName)
+                .collect(Collectors.toList());
+        Boolean isChild;
+        for (YxStoreCategoryDTO deptDTO : categoryDTOS) {
+            isChild = false;
+            if ("0".equals(deptDTO.getPid().toString())) {
+                trees.add(deptDTO);
+            }
+            for (YxStoreCategoryDTO it : categoryDTOS) {
+                if (it.getPid().equals(deptDTO.getId())) {
+                    isChild = true;
+                    if (deptDTO.getChildren() == null) {
+                        deptDTO.setChildren(new ArrayList());
+                    }
+                    deptDTO.getChildren().add(it);
+                }
+            }
+            if(isChild)
+                cates.add(deptDTO);
+            else if(!deptNames.contains(yxStoreCategoryRepository.findNameById(deptDTO.getPid())))
+                cates.add(deptDTO);
+        }
+
+        if (CollectionUtils.isEmpty(trees)) {
+            trees = cates;
+        }
+
+        Integer totalElements = categoryDTOS!=null?categoryDTOS.size():0;
+
+        Map map = new HashMap();
+        map.put("totalElements",totalElements);
+        map.put("content",CollectionUtils.isEmpty(trees)?categoryDTOS:trees);
+        return map;
+        //return null;
+    }
+}
\ No newline at end of file
diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderServiceImpl.java
new file mode 100644
index 00000000..cae0be8a
--- /dev/null
+++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderServiceImpl.java
@@ -0,0 +1,207 @@
+package co.yixiang.modules.shop.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.NumberUtil;
+import co.yixiang.exception.BadRequestException;
+import co.yixiang.exception.EntityExistException;
+import co.yixiang.modules.shop.domain.YxStoreOrder;
+import co.yixiang.modules.shop.domain.YxStoreOrderStatus;
+import co.yixiang.modules.shop.domain.YxUserBill;
+import co.yixiang.modules.shop.repository.YxStoreOrderRepository;
+import co.yixiang.modules.shop.repository.YxUserRepository;
+import co.yixiang.modules.shop.service.YxStoreOrderService;
+import co.yixiang.modules.shop.service.YxStoreOrderStatusService;
+import co.yixiang.modules.shop.service.YxUserBillService;
+import co.yixiang.modules.shop.service.YxUserService;
+import co.yixiang.modules.shop.service.dto.YxStoreOrderDTO;
+import co.yixiang.modules.shop.service.dto.YxStoreOrderQueryCriteria;
+import co.yixiang.modules.shop.service.dto.YxUserDTO;
+import co.yixiang.modules.shop.service.mapper.YxStoreOrderMapper;
+import co.yixiang.utils.OrderUtil;
+import co.yixiang.utils.QueryHelp;
+import co.yixiang.utils.ValidationUtil;
+import com.alibaba.fastjson.JSON;
+import co.yixiang.modules.shop.domain.StoreOrderCartInfo;
+import co.yixiang.modules.shop.repository.YxStoreOrderCartInfoRepository;
+import co.yixiang.modules.shop.service.dto.StoreOrderCartInfoDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+/**
+* @author hupeng
+* @date 2019-10-14
+*/
+@Service
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
+public class YxStoreOrderServiceImpl implements YxStoreOrderService {
+
+    @Autowired
+    private YxStoreOrderRepository yxStoreOrderRepository;
+
+    @Autowired
+    private YxStoreOrderCartInfoRepository yxStoreOrderCartInfoRepository;
+
+    @Autowired
+    private YxStoreOrderMapper yxStoreOrderMapper;
+
+    @Autowired
+    private YxStoreOrderStatusService yxStoreOrderStatusService;
+
+    @Autowired
+    private YxUserService userService;
+
+    @Autowired
+    private YxUserRepository userRepository;
+
+    @Autowired
+    private YxUserBillService yxUserBillService;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void refund(YxStoreOrder resources) {
+        if(resources.getPayPrice().doubleValue() < 0){
+            throw new BadRequestException("请输入退款金额");
+        }
+
+        //修改状态
+        resources.setRefundStatus(2);
+        resources.setRefundPrice(resources.getPayPrice());
+        update(resources);
+
+        //退款到余额
+        YxUserDTO userDTO = userService.findById(resources.getUid());
+        userRepository.updateMoney(resources.getPayPrice().doubleValue(),
+                resources.getUid());
+
+        YxUserBill userBill = new YxUserBill();
+        userBill.setUid(resources.getUid());
+        userBill.setLinkId(resources.getId().toString());
+        userBill.setPm(1);
+        userBill.setTitle("商品退款");
+        userBill.setCategory("now_money");
+        userBill.setType("pay_product_refund");
+        userBill.setNumber(resources.getPayPrice());
+        userBill.setBalance(NumberUtil.add(resources.getPayPrice(),userDTO.getNowMoney()));
+        userBill.setMark("订单退款到余额");
+        userBill.setAddTime(OrderUtil.getSecondTimestampTwo());
+        userBill.setStatus(1);
+        yxUserBillService.create(userBill);
+
+
+        YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus();
+        storeOrderStatus.setOid(resources.getId());
+        storeOrderStatus.setChangeType("refund_price");
+        storeOrderStatus.setChangeMessage("退款给用户:"+resources.getPayPrice() +"元");
+        storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo());
+
+        yxStoreOrderStatusService.create(storeOrderStatus);
+    }
+
+    @Override
+    public Map queryAll(YxStoreOrderQueryCriteria criteria, Pageable pageable){
+
+        Page page = yxStoreOrderRepository
+                .findAll((root, criteriaQuery, criteriaBuilder)
+                        -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
+        List storeOrderDTOS = new ArrayList<>();
+        for (YxStoreOrder yxStoreOrder : page.getContent()) {
+            YxStoreOrderDTO yxStoreOrderDTO = yxStoreOrderMapper.toDto(yxStoreOrder);
+
+
+            Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(),
+                    yxStoreOrder.getRefundStatus());
+
+            //订单状态
+            String orderStatusStr = OrderUtil.orderStatusStr(yxStoreOrder.getPaid()
+                    ,yxStoreOrder.getStatus(),yxStoreOrder.getShippingType()
+                    ,yxStoreOrder.getRefundStatus());
+            if(_status == 3){
+                String refundTime = OrderUtil.stampToDate(String.valueOf(yxStoreOrder
+                        .getRefundReasonTime()));
+                String str = "申请退款
"+ + "退款原因:"+yxStoreOrder.getRefundReasonWap()+"
" + + "备注说明:"+yxStoreOrder.getRefundReasonWapExplain()+"
" + + "退款时间:"+refundTime+"
"; + orderStatusStr = str; + } + yxStoreOrderDTO.setStatusName(orderStatusStr); + + yxStoreOrderDTO.set_status(_status); + + String payTypeName = OrderUtil.payTypeName(yxStoreOrder.getPayType() + ,yxStoreOrder.getPaid()); + yxStoreOrderDTO.setPayTypeName(payTypeName); + + String orderType = OrderUtil.orderType(1); + yxStoreOrderDTO.setPinkName(orderType); + + List cartInfos = yxStoreOrderCartInfoRepository + .findByOid(yxStoreOrder.getId()); + List cartInfoDTOS = new ArrayList<>(); + for (StoreOrderCartInfo cartInfo : cartInfos) { + StoreOrderCartInfoDTO cartInfoDTO = new StoreOrderCartInfoDTO(); + cartInfoDTO.setCartInfoMap(JSON.parseObject(cartInfo.getCartInfo())); + + cartInfoDTOS.add(cartInfoDTO); + } + yxStoreOrderDTO.setCartInfoList(cartInfoDTOS); + + storeOrderDTOS.add(yxStoreOrderDTO); + + } + + Map map = new LinkedHashMap<>(2); + map.put("content",storeOrderDTOS); + map.put("totalElements",page.getTotalElements()); + + return map; + } + + @Override + public List queryAll(YxStoreOrderQueryCriteria criteria){ + return yxStoreOrderMapper.toDto(yxStoreOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxStoreOrderDTO findById(Integer id) { + Optional yxStoreOrder = yxStoreOrderRepository.findById(id); + ValidationUtil.isNull(yxStoreOrder,"YxStoreOrder","id",id); + return yxStoreOrderMapper.toDto(yxStoreOrder.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreOrderDTO create(YxStoreOrder resources) { + if(yxStoreOrderRepository.findByUnique(resources.getUnique()) != null){ + throw new EntityExistException(YxStoreOrder.class,"unique",resources.getUnique()); + } + return yxStoreOrderMapper.toDto(yxStoreOrderRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreOrder resources) { + Optional optionalYxStoreOrder = yxStoreOrderRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreOrder,"YxStoreOrder","id",resources.getId()); + YxStoreOrder yxStoreOrder = optionalYxStoreOrder.get(); + YxStoreOrder yxStoreOrder1 = yxStoreOrderRepository.findByUnique(resources.getUnique()); + if(yxStoreOrder1 != null && !yxStoreOrder1.getId().equals(yxStoreOrder.getId())){ + throw new EntityExistException(YxStoreOrder.class,"unique",resources.getUnique()); + } + yxStoreOrder.copy(resources); + yxStoreOrderRepository.save(yxStoreOrder); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreOrderRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderStatusServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderStatusServiceImpl.java new file mode 100644 index 00000000..aec37cde --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderStatusServiceImpl.java @@ -0,0 +1,75 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.domain.YxStoreOrderStatus; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.shop.repository.YxStoreOrderStatusRepository; +import co.yixiang.modules.shop.service.YxStoreOrderStatusService; +import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusDTO; +import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusQueryCriteria; +import co.yixiang.modules.shop.service.mapper.YxStoreOrderStatusMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import java.util.List; +import java.util.Map; + +/** +* @author hupeng +* @date 2019-11-02 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxStoreOrderStatusServiceImpl implements YxStoreOrderStatusService { + + @Autowired + private YxStoreOrderStatusRepository yxStoreOrderStatusRepository; + + @Autowired + private YxStoreOrderStatusMapper yxStoreOrderStatusMapper; + + @Override + public Map queryAll(YxStoreOrderStatusQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreOrderStatusRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxStoreOrderStatusMapper::toDto)); + } + + @Override + public List queryAll(YxStoreOrderStatusQueryCriteria criteria){ + return yxStoreOrderStatusMapper.toDto(yxStoreOrderStatusRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxStoreOrderStatusDTO findById(Integer id) { + Optional yxStoreOrderStatus = yxStoreOrderStatusRepository.findById(id); + ValidationUtil.isNull(yxStoreOrderStatus,"YxStoreOrderStatus","id",id); + return yxStoreOrderStatusMapper.toDto(yxStoreOrderStatus.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreOrderStatusDTO create(YxStoreOrderStatus resources) { + return yxStoreOrderStatusMapper.toDto(yxStoreOrderStatusRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreOrderStatus resources) { + Optional optionalYxStoreOrderStatus = yxStoreOrderStatusRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreOrderStatus,"YxStoreOrderStatus","id",resources.getId()); + YxStoreOrderStatus yxStoreOrderStatus = optionalYxStoreOrderStatus.get(); + yxStoreOrderStatus.copy(resources); + yxStoreOrderStatusRepository.save(yxStoreOrderStatus); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreOrderStatusRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java new file mode 100644 index 00000000..3fb3bf92 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java @@ -0,0 +1,98 @@ +package co.yixiang.modules.shop.service.impl; + +import cn.hutool.core.util.StrUtil; +import co.yixiang.modules.shop.domain.YxStoreProductReply; +import co.yixiang.modules.shop.service.YxStoreProductService; +import co.yixiang.modules.shop.service.YxUserService; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.shop.repository.YxStoreProductReplyRepository; +import co.yixiang.modules.shop.service.YxStoreProductReplyService; +import co.yixiang.modules.shop.service.dto.YxStoreProductReplyDTO; +import co.yixiang.modules.shop.service.dto.YxStoreProductReplyQueryCriteria; +import co.yixiang.modules.shop.service.mapper.YxStoreProductReplyMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; + +/** +* @author hupeng +* @date 2019-11-03 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxStoreProductReplyServiceImpl implements YxStoreProductReplyService { + + @Autowired + private YxStoreProductReplyRepository yxStoreProductReplyRepository; + + @Autowired + private YxStoreProductReplyMapper yxStoreProductReplyMapper; + + @Autowired + private YxUserService userService; + + @Autowired + private YxStoreProductService productService; + + @Override + public Map queryAll(YxStoreProductReplyQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreProductReplyRepository + .findAll((root, criteriaQuery, criteriaBuilder) + -> QueryHelp.getPredicate(root,criteria,criteriaBuilder) + ,pageable); + List productReplyDTOS = new ArrayList<>(); + for (YxStoreProductReply reply : page.getContent()) { + + YxStoreProductReplyDTO productReplyDTO = yxStoreProductReplyMapper.toDto(reply); + productReplyDTO.setUsername(userService.findById(reply.getUid()).getAccount()); + productReplyDTO.setProductName(productService.findById(reply.getProductId()).getStoreName()); + productReplyDTOS.add(productReplyDTO); + } + Map map = new LinkedHashMap<>(2); + map.put("content",productReplyDTOS); + map.put("totalElements",page.getTotalElements()); + return map; + } + + @Override + public List queryAll(YxStoreProductReplyQueryCriteria criteria){ + return yxStoreProductReplyMapper.toDto(yxStoreProductReplyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxStoreProductReplyDTO findById(Integer id) { + Optional yxStoreProductReply = yxStoreProductReplyRepository.findById(id); + ValidationUtil.isNull(yxStoreProductReply,"YxStoreProductReply","id",id); + return yxStoreProductReplyMapper.toDto(yxStoreProductReply.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreProductReplyDTO create(YxStoreProductReply resources) { + return yxStoreProductReplyMapper.toDto(yxStoreProductReplyRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreProductReply resources) { + Optional optionalYxStoreProductReply = yxStoreProductReplyRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreProductReply,"YxStoreProductReply","id",resources.getId()); + YxStoreProductReply yxStoreProductReply = optionalYxStoreProductReply.get(); + yxStoreProductReply.copy(resources); + yxStoreProductReplyRepository.save(yxStoreProductReply); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreProductReplyRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java new file mode 100644 index 00000000..5d93e950 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java @@ -0,0 +1,352 @@ +package co.yixiang.modules.shop.service.impl; + +import cn.hutool.core.util.*; +import co.yixiang.modules.shop.domain.YxStoreProduct; +import co.yixiang.modules.shop.repository.*; +import co.yixiang.modules.shop.service.YxStoreProductService; +import co.yixiang.modules.shop.service.dto.*; +import co.yixiang.modules.shop.service.mapper.YxStoreProductMapper; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import co.yixiang.exception.BadRequestException; +import co.yixiang.modules.shop.domain.YxStoreProductAttr; +import co.yixiang.modules.shop.domain.YxStoreProductAttrResult; +import co.yixiang.modules.shop.domain.YxStoreProductAttrValue; +import co.yixiang.modules.shop.repository.*; +import co.yixiang.modules.shop.service.dto.*; +import co.yixiang.utils.OrderUtil; +import co.yixiang.utils.ValidationUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.QueryHelp; + +/** +* @author hupeng +* @date 2019-10-04 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxStoreProductServiceImpl implements YxStoreProductService { + + @Autowired + private YxStoreProductRepository yxStoreProductRepository; + + @Autowired + private YxStoreCategoryRepository yxStoreCategoryRepository; + + @Autowired + private YxStoreProductAttrRepository yxStoreProductAttrRepository; + + @Autowired + private YxStoreProductAttrValueRepository yxStoreProductAttrValueRepository; + + @Autowired + private YxStoreProductAttrResultRepository yxStoreProductAttrResultRepository; + + @Autowired + private YxStoreProductMapper yxStoreProductMapper; + + @Override + public Map queryAll(YxStoreProductQueryCriteria criteria, Pageable pageable){ + //criteria.setIsDel(0); + Page page = yxStoreProductRepository + .findAll((root, criteriaQuery, criteriaBuilder) + -> QueryHelp.getPredicate(root,criteria,criteriaBuilder) + ,pageable); + List storeProductDTOS = new ArrayList<>(); + for (YxStoreProduct product : page.getContent()) { + if(StrUtil.isEmpty(product.getCateId())) continue; + String cateName = yxStoreCategoryRepository + .findNameById(Integer.valueOf(product.getCateId())); + YxStoreProductDTO yxStoreProductDTO = yxStoreProductMapper.toDto(product); + yxStoreProductDTO.setCateName(cateName); + storeProductDTOS.add(yxStoreProductDTO); + } + Map map = new LinkedHashMap<>(2); + map.put("content",storeProductDTOS); + map.put("totalElements",page.getTotalElements()); + return map; + } + @Override + public List queryAll(YxStoreProductQueryCriteria criteria){ + return yxStoreProductMapper.toDto(yxStoreProductRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxStoreProductDTO findById(Integer id) { + Optional yxStoreProduct = yxStoreProductRepository.findById(id); + ValidationUtil.isNull(yxStoreProduct,"YxStoreProduct","id",id); + return yxStoreProductMapper.toDto(yxStoreProduct.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreProductDTO create(YxStoreProduct resources) { + return yxStoreProductMapper.toDto(yxStoreProductRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreProduct resources) { + Optional optionalYxStoreProduct = yxStoreProductRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreProduct,"YxStoreProduct","id",resources.getId()); + YxStoreProduct yxStoreProduct = optionalYxStoreProduct.get(); + yxStoreProduct.copy(resources); + yxStoreProductRepository.save(yxStoreProduct); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreProductRepository.updateDel(1,id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void recovery(Integer id) { + yxStoreProductRepository.updateDel(0,id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void onSale(Integer id, Integer status) { + if(status == 1){ + status = 0; + }else{ + status = 1; + } + yxStoreProductRepository.updateOnsale(status,id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List isFormatAttr(Integer id, String jsonStr) { + if(ObjectUtil.isNull(id)) throw new BadRequestException("产品不存在"); + + YxStoreProductDTO yxStoreProductDTO = findById(id); + + DetailDTO detailDTO = attrFormat(jsonStr); + + //System.out.println("list:"+detailDTO.getRes()); + List newList = new ArrayList<>(); + for (Map> map : detailDTO.getRes()) { + ProductFormatDTO productFormatDTO = new ProductFormatDTO(); + + productFormatDTO.setDetail(map.get("detail")); + productFormatDTO.setCost(yxStoreProductDTO.getCost().doubleValue()); + productFormatDTO.setPrice(yxStoreProductDTO.getPrice().doubleValue()); + productFormatDTO.setSales(yxStoreProductDTO.getSales()); + productFormatDTO.setPic(yxStoreProductDTO.getImage()); + productFormatDTO.setCheck(false); + newList.add(productFormatDTO); + + } + + + return newList; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void createProductAttr(Integer id, String jsonStr) { + JSONObject jsonObject = JSON.parseObject(jsonStr); + //System.out.println(jsonObject); + List attrList = JSON.parseArray( + jsonObject.get("items").toString(), + FromatDetailDTO.class); + List valueList = JSON.parseArray( + jsonObject.get("attrs").toString(), + ProductFormatDTO.class); + + + List attrGroup = new ArrayList<>(); + for (FromatDetailDTO fromatDetailDTO : attrList) { + YxStoreProductAttr yxStoreProductAttr = new YxStoreProductAttr(); + yxStoreProductAttr.setProductId(id); + yxStoreProductAttr.setAttrName(fromatDetailDTO.getValue()); + yxStoreProductAttr.setAttrValues(StrUtil. + join(",",fromatDetailDTO.getDetail())); + attrGroup.add(yxStoreProductAttr); + } + + + List valueGroup = new ArrayList<>(); + for (ProductFormatDTO productFormatDTO : valueList) { + YxStoreProductAttrValue yxStoreProductAttrValue = new YxStoreProductAttrValue(); + yxStoreProductAttrValue.setProductId(id); + //productFormatDTO.getDetail().values().stream().collect(Collectors.toList()); + List stringList = productFormatDTO.getDetail().values() + .stream().collect(Collectors.toList()); + Collections.sort(stringList); + yxStoreProductAttrValue.setSuk(StrUtil. + join(",",stringList)); + yxStoreProductAttrValue.setPrice(BigDecimal.valueOf(productFormatDTO.getPrice())); + yxStoreProductAttrValue.setCost(BigDecimal.valueOf(productFormatDTO.getCost())); + yxStoreProductAttrValue.setStock(productFormatDTO.getSales()); + yxStoreProductAttrValue.setUnique(IdUtil.simpleUUID()); + yxStoreProductAttrValue.setImage(productFormatDTO.getPic()); + + valueGroup.add(yxStoreProductAttrValue); + } + + if(attrGroup.isEmpty() || valueGroup.isEmpty()){ + throw new BadRequestException("请设置至少一个属性!"); + } + + //插入之前清空 + clearProductAttr(id,false); + + + //保存属性 + yxStoreProductAttrRepository.saveAll(attrGroup); + + //保存值 + yxStoreProductAttrValueRepository.saveAll(valueGroup); + + Map map = new LinkedHashMap<>(); + map.put("attr",jsonObject.get("items")); + map.put("value",jsonObject.get("attrs")); + + //保存结果 + setResult(map,id); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void setResult(Map map,Integer id) { + YxStoreProductAttrResult yxStoreProductAttrResult = new YxStoreProductAttrResult(); + yxStoreProductAttrResult.setProductId(id); + yxStoreProductAttrResult.setResult(JSON.toJSONString(map)); + yxStoreProductAttrResult.setChangeTime(OrderUtil.getSecondTimestampTwo()); + + yxStoreProductAttrResultRepository.deleteByProductId(id); + + yxStoreProductAttrResultRepository.save(yxStoreProductAttrResult); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void clearProductAttr(Integer id,boolean isActice) { + if(ObjectUtil.isNull(id)) throw new BadRequestException("产品不存在"); + + yxStoreProductAttrRepository.deleteByProductId(id); + yxStoreProductAttrValueRepository.deleteByProductId(id); + + if(isActice){ + yxStoreProductAttrResultRepository.deleteByProductId(id); + } + } + + @Override + public String getStoreProductAttrResult(Integer id) { + YxStoreProductAttrResult yxStoreProductAttrResult = yxStoreProductAttrResultRepository + .findByProductId(id); + if(ObjectUtil.isNull(yxStoreProductAttrResult)) return ""; + return yxStoreProductAttrResult.getResult(); + } + + /** + * 组合规则属性算法 + * @param jsonStr + * @return + */ + public DetailDTO attrFormat(String jsonStr){ + // List returnList = new ArrayList<>(); + + JSONObject jsonObject = JSON.parseObject(jsonStr); + List fromatDetailDTOList = JSON.parseArray(jsonObject.get("items").toString(), + FromatDetailDTO.class); + List data = new ArrayList<>(); + //List>>> res =new ArrayList<>(); + List>> res =new ArrayList<>(); + + if(fromatDetailDTOList.size() > 1){ + for (int i=0; i < fromatDetailDTOList.size() - 1;i++){ + if(i == 0) data = fromatDetailDTOList.get(i).getDetail(); + List tmp = new LinkedList<>(); + for (String v : data) { + for (String g : fromatDetailDTOList.get(i+1).getDetail()) { + String rep2 = ""; + if(i == 0){ + rep2 = fromatDetailDTOList.get(i).getValue() + "_" + v + "-" + + fromatDetailDTOList.get(i+1).getValue() + "_" + g; + }else{ + rep2 = v + "-" + + fromatDetailDTOList.get(i+1).getValue() + "_" + g; + } + + tmp.add(rep2); + + if(i == fromatDetailDTOList.size() - 2){ + // Map>> rep4 = new LinkedHashMap<>(); + Map> rep4 = new LinkedHashMap<>(); + //List> listMap = new ArrayList<>(); + //Map map1 = new LinkedHashMap<>(); + Map reptemp = new LinkedHashMap<>(); + for (String h : Arrays.asList(rep2.split("-"))) { + List rep3 = Arrays.asList(h.split("_")); + + if(rep3.size() > 1){ + reptemp.put(rep3.get(0),rep3.get(1)); + }else{ + reptemp.put(rep3.get(0),""); + } + //listMap.add(reptemp); + + } + rep4.put("detail",reptemp); + + //rep4.put("detail",listMap); + + res.add(rep4); + } + } + + } + + //System.out.println("tmp:"+tmp); + if(!tmp.isEmpty()){ + data = tmp; + } + } + }else{ + List dataArr = new ArrayList<>(); + + for (FromatDetailDTO fromatDetailDTO : fromatDetailDTOList) { + + for (String str : fromatDetailDTO.getDetail()) { + Map> map2 = new LinkedHashMap<>(); + //List> list1 = new ArrayList<>(); + dataArr.add(fromatDetailDTO.getValue()+"_"+str); + Map map1 = new LinkedHashMap<>(); + map1.put(fromatDetailDTO.getValue(),str); + //list1.add(map1); + map2.put("detail",map1); + res.add(map2); + } + } + + String s = StrUtil.join("-",dataArr); + data.add(s); + } + + + DetailDTO detailDTO = new DetailDTO(); + detailDTO.setData(data); + detailDTO.setRes(res); + + + return detailDTO; + } + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java new file mode 100644 index 00000000..7223e5ad --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java @@ -0,0 +1,91 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.domain.YxSystemGroupData; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.shop.repository.YxSystemGroupDataRepository; +import co.yixiang.modules.shop.service.YxSystemGroupDataService; +import co.yixiang.modules.shop.service.dto.YxSystemGroupDataDTO; +import co.yixiang.modules.shop.service.dto.YxSystemGroupDataQueryCriteria; +import co.yixiang.modules.shop.service.mapper.YxSystemGroupDataMapper; +import com.alibaba.fastjson.JSON; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; + +/** +* @author hupeng +* @date 2019-10-18 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxSystemGroupDataServiceImpl implements YxSystemGroupDataService { + + @Autowired + private YxSystemGroupDataRepository yxSystemGroupDataRepository; + + @Autowired + private YxSystemGroupDataMapper yxSystemGroupDataMapper; + + @Override + public Map queryAll(YxSystemGroupDataQueryCriteria criteria, Pageable pageable){ + Page page = yxSystemGroupDataRepository + .findAll((root, criteriaQuery, criteriaBuilder) + -> QueryHelp.getPredicate(root,criteria,criteriaBuilder) + ,pageable); + List systemGroupDataDTOS = new ArrayList<>(); + for (YxSystemGroupData systemGroupData : page.getContent()) { + + YxSystemGroupDataDTO systemGroupDataDTO = yxSystemGroupDataMapper + .toDto(systemGroupData); + systemGroupDataDTO.setMap(JSON.parseObject(systemGroupData.getValue())); + systemGroupDataDTOS.add(systemGroupDataDTO); + } + Map map = new LinkedHashMap<>(2); + map.put("content",systemGroupDataDTOS); + map.put("totalElements",page.getTotalElements()); + return map; + //return PageUtil.toPage(page.map(yxSystemGroupDataMapper::toDto)); + } + + @Override + public List queryAll(YxSystemGroupDataQueryCriteria criteria){ + return yxSystemGroupDataMapper.toDto(yxSystemGroupDataRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxSystemGroupDataDTO findById(Integer id) { + Optional yxSystemGroupData = yxSystemGroupDataRepository.findById(id); + ValidationUtil.isNull(yxSystemGroupData,"YxSystemGroupData","id",id); + return yxSystemGroupDataMapper.toDto(yxSystemGroupData.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxSystemGroupDataDTO create(YxSystemGroupData resources) { + return yxSystemGroupDataMapper.toDto(yxSystemGroupDataRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxSystemGroupData resources) { + Optional optionalYxSystemGroupData = yxSystemGroupDataRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxSystemGroupData,"YxSystemGroupData","id",resources.getId()); + YxSystemGroupData yxSystemGroupData = optionalYxSystemGroupData.get(); + yxSystemGroupData.copy(resources); + yxSystemGroupDataRepository.save(yxSystemGroupData); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxSystemGroupDataRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxUserBillServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxUserBillServiceImpl.java new file mode 100644 index 00000000..c14c0e01 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxUserBillServiceImpl.java @@ -0,0 +1,75 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.domain.YxUserBill; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.shop.repository.YxUserBillRepository; +import co.yixiang.modules.shop.service.YxUserBillService; +import co.yixiang.modules.shop.service.dto.YxUserBillDTO; +import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria; +import co.yixiang.modules.shop.service.mapper.YxUserBillMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import java.util.List; +import java.util.Map; + +/** +* @author hupeng +* @date 2019-11-06 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxUserBillServiceImpl implements YxUserBillService { + + @Autowired + private YxUserBillRepository yxUserBillRepository; + + @Autowired + private YxUserBillMapper yxUserBillMapper; + + @Override + public Map queryAll(YxUserBillQueryCriteria criteria, Pageable pageable){ + Page page = yxUserBillRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxUserBillMapper::toDto)); + } + + @Override + public List queryAll(YxUserBillQueryCriteria criteria){ + return yxUserBillMapper.toDto(yxUserBillRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxUserBillDTO findById(Integer id) { + Optional yxUserBill = yxUserBillRepository.findById(id); + ValidationUtil.isNull(yxUserBill,"YxUserBill","id",id); + return yxUserBillMapper.toDto(yxUserBill.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxUserBillDTO create(YxUserBill resources) { + return yxUserBillMapper.toDto(yxUserBillRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxUserBill resources) { + Optional optionalYxUserBill = yxUserBillRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxUserBill,"YxUserBill","id",resources.getId()); + YxUserBill yxUserBill = optionalYxUserBill.get(); + yxUserBill.copy(resources); + yxUserBillRepository.save(yxUserBill); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxUserBillRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxUserServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxUserServiceImpl.java new file mode 100644 index 00000000..f66194a8 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/impl/YxUserServiceImpl.java @@ -0,0 +1,88 @@ +package co.yixiang.modules.shop.service.impl; + +import co.yixiang.modules.shop.service.mapper.YxUserMapper; +import co.yixiang.modules.shop.domain.YxUser; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.shop.repository.YxUserRepository; +import co.yixiang.modules.shop.service.YxUserService; +import co.yixiang.modules.shop.service.dto.YxUserDTO; +import co.yixiang.modules.shop.service.dto.YxUserQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import java.util.List; +import java.util.Map; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxUserServiceImpl implements YxUserService { + + @Autowired + private YxUserRepository yxUserRepository; + + @Autowired + private YxUserMapper yxUserMapper; + + @Override + public Map queryAll(YxUserQueryCriteria criteria, Pageable pageable){ + Page page = yxUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxUserMapper::toDto)); + } + + @Override + public List queryAll(YxUserQueryCriteria criteria){ + return yxUserMapper.toDto(yxUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxUserDTO findById(Integer uid) { + Optional yxUser = yxUserRepository.findById(uid); + ValidationUtil.isNull(yxUser,"YxUser","uid",uid); + return yxUserMapper.toDto(yxUser.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxUserDTO create(YxUser resources) { + return yxUserMapper.toDto(yxUserRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxUser resources) { + Optional optionalYxUser = yxUserRepository.findById(resources.getUid()); + ValidationUtil.isNull( optionalYxUser,"YxUser","id",resources.getUid()); + YxUser yxUser = optionalYxUser.get(); + yxUser.copy(resources); + yxUserRepository.save(yxUser); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer uid) { + yxUserRepository.deleteById(uid); + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public void onStatus(Integer uid, Integer status) { + if(status == 1){ + status = 0; + }else{ + status = 1; + } + + yxUserRepository.updateOnstatus(status,uid); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreCategoryMapper.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreCategoryMapper.java new file mode 100644 index 00000000..b673b567 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreCategoryMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.modules.shop.domain.YxStoreCategory; +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.service.dto.YxStoreCategoryDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-03 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreCategoryMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderMapper.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderMapper.java new file mode 100644 index 00000000..a81b6bd8 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxStoreOrder; +import co.yixiang.modules.shop.service.dto.YxStoreOrderDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-14 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreOrderMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderStatusMapper.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderStatusMapper.java new file mode 100644 index 00000000..17ffa234 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderStatusMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxStoreOrderStatus; +import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-11-02 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreOrderStatusMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductMapper.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductMapper.java new file mode 100644 index 00000000..20a5da63 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductMapper.java @@ -0,0 +1,17 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.modules.shop.service.dto.YxStoreProductDTO; +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxStoreProduct; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + + +/** +* @author hupeng +* @date 2019-10-04 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreProductMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductReplyMapper.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductReplyMapper.java new file mode 100644 index 00000000..dd07d295 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductReplyMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxStoreProductReply; +import co.yixiang.modules.shop.service.dto.YxStoreProductReplyDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-11-03 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreProductReplyMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemGroupDataMapper.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemGroupDataMapper.java new file mode 100644 index 00000000..ba1a8112 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemGroupDataMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxSystemGroupData; +import co.yixiang.modules.shop.service.dto.YxSystemGroupDataDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-18 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxSystemGroupDataMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserBillMapper.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserBillMapper.java new file mode 100644 index 00000000..8eedb2b5 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserBillMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxUserBill; +import co.yixiang.modules.shop.service.dto.YxUserBillDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-11-06 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxUserBillMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserMapper.java b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserMapper.java new file mode 100644 index 00000000..474a605b --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxUser; +import co.yixiang.modules.shop.service.dto.YxUserDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxUserMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/Dept.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Dept.java new file mode 100644 index 00000000..490a542c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Dept.java @@ -0,0 +1,57 @@ +package co.yixiang.modules.system.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.sql.Timestamp; +import java.io.Serializable; +import java.util.Set; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@Entity +@Data +@Table(name="dept") +public class Dept implements Serializable { + + /** + * ID + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + @NotNull(groups = Update.class) + private Long id; + + /** + * 名称 + */ + @Column(name = "name",nullable = false) + @NotBlank + private String name; + + @NotNull + private Boolean enabled; + + /** + * 上级部门 + */ + @Column(name = "pid",nullable = false) + @NotNull + private Long pid; + + @JsonIgnore + @ManyToMany(mappedBy = "depts") + private Set roles; + + @Column(name = "create_time") + @CreationTimestamp + private Timestamp createTime; + + public @interface Update {} +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/Dict.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Dict.java new file mode 100644 index 00000000..693759e4 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Dict.java @@ -0,0 +1,42 @@ +package co.yixiang.modules.system.domain; + +import lombok.Data; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Entity +@Data +@Table(name="dict") +public class Dict implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + @NotNull(groups = Update.class) + private Long id; + + /** + * 字典名称 + */ + @Column(name = "name",nullable = false,unique = true) + @NotBlank + private String name; + + /** + * 描述 + */ + @Column(name = "remark") + private String remark; + + @OneToMany(mappedBy = "dict",cascade={CascadeType.PERSIST,CascadeType.REMOVE}) + private List dictDetails; + + public @interface Update {} +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/DictDetail.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/DictDetail.java new file mode 100644 index 00000000..ec2fe19d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/DictDetail.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.system.domain; + +import lombok.Data; +import javax.persistence.*; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Entity +@Data +@Table(name="dict_detail") +public class DictDetail implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + @NotNull(groups = Update.class) + private Long id; + + /** + * 字典标签 + */ + @Column(name = "label",nullable = false) + private String label; + + /** + * 字典值 + */ + @Column(name = "value",nullable = false) + private String value; + + /** + * 排序 + */ + @Column(name = "sort") + private String sort = "999"; + + /** + * 字典id + */ + @ManyToOne(fetch=FetchType.LAZY) + @JoinColumn(name = "dict_id") + private Dict dict; + + public @interface Update {} +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/Job.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Job.java new file mode 100644 index 00000000..d8a4084e --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Job.java @@ -0,0 +1,61 @@ +package co.yixiang.modules.system.domain; + +import lombok.Data; +import org.hibernate.annotations.*; +import javax.persistence.*; +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.sql.Timestamp; +import java.io.Serializable; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@Entity +@Data +@Table(name="job") +public class Job implements Serializable { + + /** + * ID + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + @NotNull(groups = Update.class) + private Long id; + + /** + * 名称 + */ + @Column(name = "name",nullable = false) + @NotBlank + private String name; + + @Column(unique = true) + @NotNull + private Long sort; + + /** + * 状态 + */ + @Column(name = "enabled",nullable = false) + @NotNull + private Boolean enabled; + + @OneToOne + @JoinColumn(name = "dept_id") + private Dept dept; + + /** + * 创建日期 + */ + @Column(name = "create_time") + @CreationTimestamp + private Timestamp createTime; + + public @interface Update {} +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/Menu.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Menu.java new file mode 100644 index 00000000..99cc2449 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Menu.java @@ -0,0 +1,88 @@ +package co.yixiang.modules.system.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Objects; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-17 + */ +@Entity +@Getter +@Setter +@Table(name = "menu") +public class Menu implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @NotNull(groups = {Update.class}) + private Long id; + + @NotBlank + private String name; + + @Column(unique = true) + @NotNull + private Long sort; + + @NotBlank + @Column(name = "path") + private String path; + + private String component; + + @Column(unique = true,name = "component_name") + private String componentName; + + private String icon; + + @Column(columnDefinition = "bit(1) default 0") + private Boolean cache; + + @Column(columnDefinition = "bit(1) default 0") + private Boolean hidden; + + /** + * 上级菜单ID + */ + @Column(name = "pid",nullable = false) + private Long pid; + + /** + * 是否为外链 true/false + */ + @Column(name = "i_frame") + private Boolean iFrame; + + @ManyToMany(mappedBy = "menus") + @JsonIgnore + private Set roles; + + @CreationTimestamp + @Column(name = "create_time") + private Timestamp createTime; + + public interface Update{} + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Menu menu = (Menu) o; + return Objects.equals(id, menu.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/Permission.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Permission.java new file mode 100644 index 00000000..1753d55c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Permission.java @@ -0,0 +1,62 @@ +package co.yixiang.modules.system.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +@Entity +@Getter +@Setter +@Table(name = "permission") +public class Permission implements Serializable{ + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @NotNull(groups = {Update.class}) + private Long id; + + @NotBlank + private String name; + + /** + * 上级类目 + */ + @NotNull + @Column(name = "pid",nullable = false) + private Long pid; + + @NotBlank + private String alias; + + @JsonIgnore + @ManyToMany(mappedBy = "permissions") + private Set roles; + + @CreationTimestamp + @Column(name = "create_time") + private Timestamp createTime; + + @Override + public String toString() { + return "Permission{" + + "id=" + id + + ", name='" + name + '\'' + + ", pid=" + pid + + ", alias='" + alias + '\'' + + ", createTime=" + createTime + + '}'; + } + + public interface Update{} +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/Role.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Role.java new file mode 100644 index 00000000..516d5dc7 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Role.java @@ -0,0 +1,90 @@ +package co.yixiang.modules.system.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Objects; +import java.util.Set; + +/** + * 角色 + * @author Zheng Jie + * @date 2018-11-22 + */ +@Entity +@Table(name = "role") +@Getter +@Setter +public class Role implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @NotNull(groups = {Update.class}) + private Long id; + + @Column(nullable = false) + @NotBlank + private String name; + + // 数据权限类型 全部 、 本级 、 自定义 + @Column(name = "data_scope") + private String dataScope = "本级"; + + // 数值越小,级别越大 + @Column(name = "level") + private Integer level = 3; + + @Column + private String remark; + + @JsonIgnore + @ManyToMany(mappedBy = "roles") + private Set users; + + @ManyToMany + @JoinTable(name = "roles_permissions", joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "permission_id",referencedColumnName = "id")}) + private Set permissions; + + @ManyToMany + @JoinTable(name = "roles_menus", joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "menu_id",referencedColumnName = "id")}) + private Set menus; + + @ManyToMany + @JoinTable(name = "roles_depts", joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "dept_id",referencedColumnName = "id")}) + private Set depts; + + @CreationTimestamp + @Column(name = "create_time") + private Timestamp createTime; + + @Override + public String toString() { + return "Role{" + + "id=" + id + + ", name='" + name + '\'' + + ", remark='" + remark + '\'' + + ", createDateTime=" + createTime + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Role role = (Role) o; + return Objects.equals(id, role.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + public interface Update{} +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/User.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/User.java new file mode 100644 index 00000000..ea1c6126 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/User.java @@ -0,0 +1,83 @@ +package co.yixiang.modules.system.domain; + +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-11-22 + */ +@Entity +@Getter +@Setter +@Table(name="user") +public class User implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @NotNull(groups = Update.class) + private Long id; + + @NotBlank + @Column(unique = true) + private String username; + + @OneToOne + @JoinColumn(name = "avatar_id") + private UserAvatar userAvatar; + + @NotBlank + @Pattern(regexp = "([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}",message = "格式错误") + private String email; + + @NotBlank + private String phone; + + @NotNull + private Boolean enabled; + + private String password; + + @CreationTimestamp + @Column(name = "create_time") + private Timestamp createTime; + + @Column(name = "last_password_reset_time") + private Date lastPasswordResetTime; + + @ManyToMany + @JoinTable(name = "users_roles", joinColumns = {@JoinColumn(name = "user_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}) + private Set roles; + + @OneToOne + @JoinColumn(name = "job_id") + private Job job; + + @OneToOne + @JoinColumn(name = "dept_id") + private Dept dept; + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", username='" + username + '\'' + + ", email='" + email + '\'' + + ", enabled=" + enabled + + ", password='" + password + '\'' + + ", createTime=" + createTime + + ", lastPasswordResetTime=" + lastPasswordResetTime + + '}'; + } + + public @interface Update {} +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/UserAvatar.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/UserAvatar.java new file mode 100644 index 00000000..6f561bea --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/UserAvatar.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.system.domain; + +import cn.hutool.core.util.ObjectUtil; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.persistence.*; + +/** + * @author Zheng Jie + * @date 2019年9月7日 16:16:59 + */ +@Entity +@Table(name = "user_avatar") +@Data +@NoArgsConstructor +public class UserAvatar { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String realName; + + private String path; + + private String size; + + public UserAvatar(UserAvatar userAvatar,String realName, String path, String size) { + this.id = ObjectUtil.isNotEmpty(userAvatar) ? userAvatar.getId() : null; + this.realName = realName; + this.path = path; + this.size = size; + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/MenuMetaVo.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/MenuMetaVo.java new file mode 100644 index 00000000..71027856 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/MenuMetaVo.java @@ -0,0 +1,20 @@ +package co.yixiang.modules.system.domain.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import java.io.Serializable; + +/** + * @author Zheng Jie + * @date 2018-12-20 + */ +@Data +@AllArgsConstructor +public class MenuMetaVo implements Serializable { + + private String title; + + private String icon; + + private Boolean noCache; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/MenuVo.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/MenuVo.java new file mode 100644 index 00000000..95031514 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/MenuVo.java @@ -0,0 +1,33 @@ +package co.yixiang.modules.system.domain.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 构建前端路由时用到 + * @author Zheng Jie + * @date 2018-12-20 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class MenuVo implements Serializable { + + private String name; + + private String path; + + private Boolean hidden; + + private String redirect; + + private String component; + + private Boolean alwaysShow; + + private MenuMetaVo meta; + + private List children; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/UserPassVo.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/UserPassVo.java new file mode 100644 index 00000000..035caac4 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/domain/vo/UserPassVo.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.domain.vo; + +import lombok.Data; + +/** + * 修改密码的 Vo 类 + * @author Zheng Jie + * @date 2019年7月11日13:59:49 + */ +@Data +public class UserPassVo { + + private String oldPass; + + private String newPass; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/DeptRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/DeptRepository.java new file mode 100644 index 00000000..e92f3f6a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/DeptRepository.java @@ -0,0 +1,28 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.Dept; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; +import java.util.Set; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +public interface DeptRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * findByPid + * @param id + * @return + */ + List findByPid(Long id); + + @Query(value = "select name from dept where id = ?1",nativeQuery = true) + String findNameById(Long id); + + Set findByRoles_Id(Long id); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/DictDetailRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/DictDetailRepository.java new file mode 100644 index 00000000..995bdcbc --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/DictDetailRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.DictDetail; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +public interface DictDetailRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/DictRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/DictRepository.java new file mode 100644 index 00000000..59c830b9 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/DictRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.Dict; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +public interface DictRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/JobRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/JobRepository.java new file mode 100644 index 00000000..3e694039 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/JobRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.Job; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +public interface JobRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/MenuRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/MenuRepository.java new file mode 100644 index 00000000..ebc7c88f --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/MenuRepository.java @@ -0,0 +1,38 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.Menu; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +import java.util.LinkedHashSet; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2018-12-17 + */ +public interface MenuRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * findByName + * @param name + * @return + */ + Menu findByName(String name); + + /** + * findByName + * @param name + * @return + */ + Menu findByComponentName(String name); + + /** + * findByPid + * @param pid + * @return + */ + List findByPid(long pid); + + LinkedHashSet findByRoles_IdOrderBySortAsc(Long id); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/PermissionRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/PermissionRepository.java new file mode 100644 index 00000000..56873d5d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/PermissionRepository.java @@ -0,0 +1,27 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.Permission; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +public interface PermissionRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * findByName + * @param name + * @return + */ + Permission findByName(String name); + + /** + * findByPid + * @param pid + * @return + */ + List findByPid(long pid); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/RoleRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/RoleRepository.java new file mode 100644 index 00000000..8bed2bd9 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/RoleRepository.java @@ -0,0 +1,33 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.Role; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; + +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +public interface RoleRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * findByName + * @param name + * @return + */ + Role findByName(String name); + + Set findByUsers_Id(Long id); + + @Modifying + @Query(value = "delete from roles_permissions where permission_id = ?1",nativeQuery = true) + void untiedPermission(Long id); + + @Modifying + @Query(value = "delete from roles_menus where menu_id = ?1",nativeQuery = true) + void untiedMenu(Long id); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/UserAvatarRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/UserAvatarRepository.java new file mode 100644 index 00000000..5dcf9993 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/UserAvatarRepository.java @@ -0,0 +1,13 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.UserAvatar; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** + * @author Zheng Jie + * @date 2018-11-22 + */ +public interface UserAvatarRepository extends JpaRepository, JpaSpecificationExecutor { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/repository/UserRepository.java b/yshop-system/src/main/java/co/yixiang/modules/system/repository/UserRepository.java new file mode 100644 index 00000000..c0948d8c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/UserRepository.java @@ -0,0 +1,56 @@ +package co.yixiang.modules.system.repository; + +import co.yixiang.modules.system.domain.User; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import java.util.Date; + +/** + * @author Zheng Jie + * @date 2018-11-22 + */ +public interface UserRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * findByUsername + * @param username + * @return + */ + User findByUsername(String username); + + /** + * findByEmail + * @param email + * @return + */ + User findByEmail(String email); + + /** + * 修改密码 + * @param username + * @param pass + */ + @Modifying + @Query(value = "update user set password = ?2 , last_password_reset_time = ?3 where username = ?1",nativeQuery = true) + void updatePass(String username, String pass, Date lastPasswordResetTime); + + /** + * 修改头像 + * @param username + * @param url + */ + @Modifying + @Query(value = "update user set avatar = ?2 where username = ?1",nativeQuery = true) + void updateAvatar(String username, String url); + + /** + * 修改邮箱 + * @param username + * @param email + */ + @Modifying + @Query(value = "update user set email = ?2 where username = ?1",nativeQuery = true) + void updateEmail(String username, String email); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/DeptController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/DeptController.java new file mode 100644 index 00000000..60c131a7 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/DeptController.java @@ -0,0 +1,74 @@ +package co.yixiang.modules.system.rest; + +import co.yixiang.config.DataScope; +import co.yixiang.exception.BadRequestException; +import co.yixiang.utils.ThrowableUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.system.domain.Dept; +import co.yixiang.modules.system.service.DeptService; +import co.yixiang.modules.system.service.dto.DeptDTO; +import co.yixiang.modules.system.service.dto.DeptQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import java.util.List; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@RestController +@RequestMapping("api") +public class DeptController { + + @Autowired + private DeptService deptService; + + @Autowired + private DataScope dataScope; + + private static final String ENTITY_NAME = "dept"; + + @Log("查询部门") + @GetMapping(value = "/dept") + @PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_SELECT','DEPT_ALL','DEPT_SELECT')") + public ResponseEntity getDepts(DeptQueryCriteria criteria){ + // 数据权限 + criteria.setIds(dataScope.getDeptIds()); + List deptDTOS = deptService.queryAll(criteria); + return new ResponseEntity(deptService.buildTree(deptDTOS),HttpStatus.OK); + } + + @Log("新增部门") + @PostMapping(value = "/dept") + @PreAuthorize("hasAnyRole('ADMIN','DEPT_ALL','DEPT_CREATE')") + public ResponseEntity create(@Validated @RequestBody Dept resources){ + if (resources.getId() != null) { + throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); + } + return new ResponseEntity(deptService.create(resources),HttpStatus.CREATED); + } + + @Log("修改部门") + @PutMapping(value = "/dept") + @PreAuthorize("hasAnyRole('ADMIN','DEPT_ALL','DEPT_EDIT')") + public ResponseEntity update(@Validated(Dept.Update.class) @RequestBody Dept resources){ + deptService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除部门") + @DeleteMapping(value = "/dept/{id}") + @PreAuthorize("hasAnyRole('ADMIN','DEPT_ALL','DEPT_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + try { + deptService.delete(id); + }catch (Throwable e){ + ThrowableUtil.throwForeignKeyException(e, "该部门存在岗位或者角色关联,请取消关联后再试"); + } + return new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/DictController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/DictController.java new file mode 100644 index 00000000..760dbd62 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/DictController.java @@ -0,0 +1,61 @@ +package co.yixiang.modules.system.rest; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.system.domain.Dict; +import co.yixiang.modules.system.service.DictService; +import co.yixiang.modules.system.service.dto.DictQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@RestController +@RequestMapping("api") +public class DictController { + + @Autowired + private DictService dictService; + + private static final String ENTITY_NAME = "dict"; + + @Log("查询字典") + @GetMapping(value = "/dict") + @PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_SELECT')") + public ResponseEntity getDicts(DictQueryCriteria resources, Pageable pageable){ + return new ResponseEntity(dictService.queryAll(resources,pageable),HttpStatus.OK); + } + + @Log("新增字典") + @PostMapping(value = "/dict") + @PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_CREATE')") + public ResponseEntity create(@Validated @RequestBody Dict resources){ + if (resources.getId() != null) { + throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); + } + return new ResponseEntity(dictService.create(resources),HttpStatus.CREATED); + } + + @Log("修改字典") + @PutMapping(value = "/dict") + @PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_EDIT')") + public ResponseEntity update(@Validated(Dict.Update.class) @RequestBody Dict resources){ + dictService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除字典") + @DeleteMapping(value = "/dict/{id}") + @PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + dictService.delete(id); + return new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/DictDetailController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/DictDetailController.java new file mode 100644 index 00000000..e376478d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/DictDetailController.java @@ -0,0 +1,80 @@ +package co.yixiang.modules.system.rest; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.system.domain.DictDetail; +import co.yixiang.modules.system.service.DictDetailService; +import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@RestController +@RequestMapping("api") +public class DictDetailController { + + @Autowired + private DictDetailService dictDetailService; + + private static final String ENTITY_NAME = "dictDetail"; + + @Log("查询字典详情") + @GetMapping(value = "/dictDetail") + public ResponseEntity getDictDetails(DictDetailQueryCriteria criteria, + @PageableDefault(value = 10, sort = {"sort"}, direction = Sort.Direction.ASC) Pageable pageable){ + String[] names = criteria.getDictName().split(","); + return new ResponseEntity(dictDetailService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("查询多个字典详情") + @GetMapping(value = "/dictDetail/map") + public ResponseEntity getDictDetailMaps(DictDetailQueryCriteria criteria, + @PageableDefault(value = 10, sort = {"sort"}, direction = Sort.Direction.ASC) Pageable pageable){ + String[] names = criteria.getDictName().split(","); + Map map = new HashMap(names.length); + for (String name : names) { + criteria.setDictName(name); + map.put(name,dictDetailService.queryAll(criteria,pageable).get("content")); + } + return new ResponseEntity(map,HttpStatus.OK); + } + + @Log("新增字典详情") + @PostMapping(value = "/dictDetail") + @PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_CREATE')") + public ResponseEntity create(@Validated @RequestBody DictDetail resources){ + if (resources.getId() != null) { + throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); + } + return new ResponseEntity(dictDetailService.create(resources),HttpStatus.CREATED); + } + + @Log("修改字典详情") + @PutMapping(value = "/dictDetail") + @PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_EDIT')") + public ResponseEntity update(@Validated(DictDetail.Update.class) @RequestBody DictDetail resources){ + dictDetailService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除字典详情") + @DeleteMapping(value = "/dictDetail/{id}") + @PreAuthorize("hasAnyRole('ADMIN','DICT_ALL','DICT_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + dictDetailService.delete(id); + return new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/JobController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/JobController.java new file mode 100644 index 00000000..5b9493e5 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/JobController.java @@ -0,0 +1,73 @@ +package co.yixiang.modules.system.rest; + +import co.yixiang.config.DataScope; +import co.yixiang.exception.BadRequestException; +import co.yixiang.utils.ThrowableUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.system.domain.Job; +import co.yixiang.modules.system.service.JobService; +import co.yixiang.modules.system.service.dto.JobQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@RestController +@RequestMapping("api") +public class JobController { + + @Autowired + private JobService jobService; + + @Autowired + private DataScope dataScope; + + private static final String ENTITY_NAME = "job"; + + @Log("查询岗位") + @GetMapping(value = "/job") + @PreAuthorize("hasAnyRole('ADMIN','USERJOB_ALL','USERJOB_SELECT','USER_ALL','USER_SELECT')") + public ResponseEntity getJobs(JobQueryCriteria criteria, + Pageable pageable){ + // 数据权限 + criteria.setDeptIds(dataScope.getDeptIds()); + return new ResponseEntity(jobService.queryAll(criteria, pageable),HttpStatus.OK); + } + + @Log("新增岗位") + @PostMapping(value = "/job") + @PreAuthorize("hasAnyRole('ADMIN','USERJOB_ALL','USERJOB_CREATE')") + public ResponseEntity create(@Validated @RequestBody Job resources){ + if (resources.getId() != null) { + throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); + } + return new ResponseEntity(jobService.create(resources),HttpStatus.CREATED); + } + + @Log("修改岗位") + @PutMapping(value = "/job") + @PreAuthorize("hasAnyRole('ADMIN','USERJOB_ALL','USERJOB_EDIT')") + public ResponseEntity update(@Validated(Job.Update.class) @RequestBody Job resources){ + jobService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除岗位") + @DeleteMapping(value = "/job/{id}") + @PreAuthorize("hasAnyRole('ADMIN','USERJOB_ALL','USERJOB_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + try { + jobService.delete(id); + }catch (Throwable e){ + ThrowableUtil.throwForeignKeyException(e, "该岗位存在用户关联,请取消关联后再试"); + } + return new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/MenuController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/MenuController.java new file mode 100644 index 00000000..b5973899 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/MenuController.java @@ -0,0 +1,101 @@ +package co.yixiang.modules.system.rest; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.utils.SecurityUtils; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.system.domain.Menu; +import co.yixiang.modules.system.service.MenuService; +import co.yixiang.modules.system.service.RoleService; +import co.yixiang.modules.system.service.UserService; +import co.yixiang.modules.system.service.dto.MenuDTO; +import co.yixiang.modules.system.service.dto.MenuQueryCriteria; +import co.yixiang.modules.system.service.dto.UserDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +@RestController +@RequestMapping("api") +public class MenuController { + + @Autowired + private MenuService menuService; + + @Autowired + private UserService userService; + + @Autowired + private RoleService roleService; + + private static final String ENTITY_NAME = "menu"; + + /** + * 构建前端路由所需要的菜单 + * @return + */ + @GetMapping(value = "/menus/build") + public ResponseEntity buildMenus(){ + UserDTO user = userService.findByName(SecurityUtils.getUsername()); + List menuDTOList = menuService.findByRoles(roleService.findByUsers_Id(user.getId())); + List menuDTOTree = (List)menuService.buildTree(menuDTOList).get("content"); + return new ResponseEntity(menuService.buildMenus(menuDTOTree),HttpStatus.OK); + } + + /** + * 返回全部的菜单 + * @return + */ + @GetMapping(value = "/menus/tree") + @PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_CREATE','MENU_EDIT','ROLES_SELECT','ROLES_ALL')") + public ResponseEntity getMenuTree(){ + return new ResponseEntity(menuService.getMenuTree(menuService.findByPid(0L)),HttpStatus.OK); + } + + @Log("查询菜单") + @GetMapping(value = "/menus") + @PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_SELECT')") + public ResponseEntity getMenus(MenuQueryCriteria criteria){ + List menuDTOList = menuService.queryAll(criteria); + return new ResponseEntity(menuService.buildTree(menuDTOList),HttpStatus.OK); + } + + @Log("新增菜单") + @PostMapping(value = "/menus") + @PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_CREATE')") + public ResponseEntity create(@Validated @RequestBody Menu resources){ + if (resources.getId() != null) { + throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); + } + return new ResponseEntity(menuService.create(resources),HttpStatus.CREATED); + } + + @Log("修改菜单") + @PutMapping(value = "/menus") + @PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_EDIT')") + public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Menu resources){ + menuService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除菜单") + @DeleteMapping(value = "/menus/{id}") + @PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + List menuList = menuService.findByPid(id); + Set menuSet = new HashSet<>(); + menuSet.add(menuService.findOne(id)); + menuSet = menuService.getDeleteMenus(menuList, menuSet); + menuService.delete(menuSet); + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/PermissionController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/PermissionController.java new file mode 100644 index 00000000..530d5299 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/PermissionController.java @@ -0,0 +1,84 @@ +package co.yixiang.modules.system.rest; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.system.domain.Permission; +import co.yixiang.modules.system.service.PermissionService; +import co.yixiang.modules.system.service.dto.PermissionDTO; +import co.yixiang.modules.system.service.dto.PermissionQueryCriteria; +import co.yixiang.modules.system.service.mapper.PermissionMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +@RestController +@RequestMapping("api") +public class PermissionController { + + @Autowired + private PermissionService permissionService; + + @Autowired + private PermissionMapper permissionMapper; + + private static final String ENTITY_NAME = "permission"; + + /** + * 返回全部的权限,新增角色时下拉选择 + * @return + */ + @GetMapping(value = "/permissions/tree") + @PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_CREATE','PERMISSION_EDIT','ROLES_SELECT','ROLES_ALL')") + public ResponseEntity getTree(){ + return new ResponseEntity(permissionService.getPermissionTree(permissionService.findByPid(0L)),HttpStatus.OK); + } + + @Log("查询权限") + @GetMapping(value = "/permissions") + @PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_SELECT')") + public ResponseEntity getPermissions(PermissionQueryCriteria criteria){ + List permissionDTOS = permissionService.queryAll(criteria); + return new ResponseEntity(permissionService.buildTree(permissionDTOS),HttpStatus.OK); + } + + @Log("新增权限") + @PostMapping(value = "/permissions") + @PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_CREATE')") + public ResponseEntity create(@Validated @RequestBody Permission resources){ + if (resources.getId() != null) { + throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); + } + return new ResponseEntity(permissionService.create(resources),HttpStatus.CREATED); + } + + @Log("修改权限") + @PutMapping(value = "/permissions") + @PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_EDIT')") + public ResponseEntity update(@Validated(Permission.Update.class) @RequestBody Permission resources){ + permissionService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除权限") + @DeleteMapping(value = "/permissions/{id}") + @PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + List permissions = permissionService.findByPid(id); + Set permissionSet = new HashSet<>(); + permissionSet.add(permissionMapper.toEntity(permissionService.findById(id))); + permissionSet = permissionService.getDeletePermission(permissions, permissionSet); + permissionService.delete(permissionSet); + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/RoleController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/RoleController.java new file mode 100644 index 00000000..4c100169 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/RoleController.java @@ -0,0 +1,117 @@ +package co.yixiang.modules.system.rest; + +import cn.hutool.core.lang.Dict; +import co.yixiang.exception.BadRequestException; +import co.yixiang.utils.SecurityUtils; +import co.yixiang.utils.ThrowableUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.system.domain.Role; +import co.yixiang.modules.system.service.RoleService; +import co.yixiang.modules.system.service.dto.RoleQueryCriteria; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +@RestController +@RequestMapping("api") +public class RoleController { + + @Autowired + private RoleService roleService; + + private static final String ENTITY_NAME = "role"; + + /** + * 获取单个role + * @param id + * @return + */ + @GetMapping(value = "/roles/{id}") + @PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_SELECT')") + public ResponseEntity getRoles(@PathVariable Long id){ + return new ResponseEntity(roleService.findById(id), HttpStatus.OK); + } + + /** + * 返回全部的角色,新增用户时下拉选择 + * @return + */ + @GetMapping(value = "/roles/all") + @PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','USER_ALL','USER_CREATE','USER_EDIT')") + public ResponseEntity getAll(@PageableDefault(value = 2000, sort = {"level"}, direction = Sort.Direction.ASC) Pageable pageable){ + return new ResponseEntity(roleService.queryAll(pageable),HttpStatus.OK); + } + + @Log("查询角色") + @GetMapping(value = "/roles") + @PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_SELECT')") + public ResponseEntity getRoles(RoleQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity(roleService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @GetMapping(value = "/roles/level") + public ResponseEntity getLevel(){ + List levels = roleService.findByUsers_Id(SecurityUtils.getUserId()).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList()); + return new ResponseEntity(Dict.create().set("level", Collections.min(levels)),HttpStatus.OK); + } + + @Log("新增角色") + @PostMapping(value = "/roles") + @PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_CREATE')") + public ResponseEntity create(@Validated @RequestBody Role resources){ + if (resources.getId() != null) { + throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); + } + return new ResponseEntity(roleService.create(resources),HttpStatus.CREATED); + } + + @Log("修改角色") + @PutMapping(value = "/roles") + @PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')") + public ResponseEntity update(@Validated(Role.Update.class) @RequestBody Role resources){ + roleService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("修改角色权限") + @PutMapping(value = "/roles/permission") + @PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')") + public ResponseEntity updatePermission(@RequestBody Role resources){ + roleService.updatePermission(resources,roleService.findById(resources.getId())); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("修改角色菜单") + @PutMapping(value = "/roles/menu") + @PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')") + public ResponseEntity updateMenu(@RequestBody Role resources){ + roleService.updateMenu(resources,roleService.findById(resources.getId())); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除角色") + @DeleteMapping(value = "/roles/{id}") + @PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + try { + roleService.delete(id); + }catch (Throwable e){ + ThrowableUtil.throwForeignKeyException(e, "该角色存在用户关联,请取消关联后再试"); + } + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/UserController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/UserController.java new file mode 100644 index 00000000..b68ea5d0 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/UserController.java @@ -0,0 +1,198 @@ +package co.yixiang.modules.system.rest; + +import co.yixiang.config.DataScope; +import co.yixiang.domain.VerificationCode; +import co.yixiang.exception.BadRequestException; +import co.yixiang.service.PictureService; +import co.yixiang.service.VerificationCodeService; +import co.yixiang.utils.ElAdminConstant; +import co.yixiang.utils.EncryptUtils; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.SecurityUtils; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.system.domain.User; +import co.yixiang.modules.system.domain.vo.UserPassVo; +import co.yixiang.modules.system.service.DeptService; +import co.yixiang.modules.system.service.RoleService; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import co.yixiang.modules.system.service.dto.UserQueryCriteria; +import co.yixiang.utils.*; +import co.yixiang.modules.system.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@RestController +@RequestMapping("api") +public class UserController { + + @Autowired + private UserService userService; + + @Autowired + private PictureService pictureService; + + @Autowired + private DataScope dataScope; + + @Autowired + private DeptService deptService; + + @Autowired + private RoleService roleService; + + @Autowired + private VerificationCodeService verificationCodeService; + + @Log("导出用户数据") + @GetMapping(value = "/users/download") + @PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_SELECT')") + public void update(HttpServletResponse response, UserQueryCriteria criteria) throws IOException { + userService.download(userService.queryAll(criteria), response); + } + + @Log("查询用户") + @GetMapping(value = "/users") + @PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_SELECT')") + public ResponseEntity getUsers(UserQueryCriteria criteria, Pageable pageable){ + Set deptSet = new HashSet<>(); + Set result = new HashSet<>(); + + if (!ObjectUtils.isEmpty(criteria.getDeptId())) { + deptSet.add(criteria.getDeptId()); + deptSet.addAll(dataScope.getDeptChildren(deptService.findByPid(criteria.getDeptId()))); + } + + // 数据权限 + Set deptIds = dataScope.getDeptIds(); + + // 查询条件不为空并且数据权限不为空则取交集 + if (!CollectionUtils.isEmpty(deptIds) && !CollectionUtils.isEmpty(deptSet)){ + + // 取交集 + result.addAll(deptSet); + result.retainAll(deptIds); + + // 若无交集,则代表无数据权限 + criteria.setDeptIds(result); + if(result.size() == 0){ + return new ResponseEntity(PageUtil.toPage(null,0),HttpStatus.OK); + } else return new ResponseEntity(userService.queryAll(criteria,pageable),HttpStatus.OK); + // 否则取并集 + } else { + result.addAll(deptSet); + result.addAll(deptIds); + criteria.setDeptIds(result); + return new ResponseEntity(userService.queryAll(criteria,pageable),HttpStatus.OK); + } + } + + @Log("新增用户") + @PostMapping(value = "/users") + @PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_CREATE')") + public ResponseEntity create(@Validated @RequestBody User resources){ + checkLevel(resources); + return new ResponseEntity(userService.create(resources),HttpStatus.CREATED); + } + + @Log("修改用户") + @PutMapping(value = "/users") + @PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_EDIT')") + public ResponseEntity update(@Validated(User.Update.class) @RequestBody User resources){ + checkLevel(resources); + userService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除用户") + @DeleteMapping(value = "/users/{id}") + @PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + Integer currentLevel = Collections.min(roleService.findByUsers_Id(SecurityUtils.getUserId()).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList())); + Integer optLevel = Collections.min(roleService.findByUsers_Id(id).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList())); + + if (currentLevel > optLevel) { + throw new BadRequestException("角色权限不足"); + } + userService.delete(id); + return new ResponseEntity(HttpStatus.OK); + } + + /** + * 修改密码 + * @param user + * @return + */ + @PostMapping(value = "/users/updatePass") + public ResponseEntity updatePass(@RequestBody UserPassVo user){ + UserDetails userDetails = SecurityUtils.getUserDetails(); + if(!userDetails.getPassword().equals(EncryptUtils.encryptPassword(user.getOldPass()))){ + throw new BadRequestException("修改失败,旧密码错误"); + } + if(userDetails.getPassword().equals(EncryptUtils.encryptPassword(user.getNewPass()))){ + throw new BadRequestException("新密码不能与旧密码相同"); + } + userService.updatePass(userDetails.getUsername(),EncryptUtils.encryptPassword(user.getNewPass())); + return new ResponseEntity(HttpStatus.OK); + } + + /** + * 修改头像 + * @param file + * @return + */ + @PostMapping(value = "/users/updateAvatar") + public ResponseEntity updateAvatar(@RequestParam MultipartFile file){ + userService.updateAvatar(file); + return new ResponseEntity(HttpStatus.OK); + } + + /** + * 修改邮箱 + * @param user + * @param user + * @return + */ + @Log("修改邮箱") + @PostMapping(value = "/users/updateEmail/{code}") + public ResponseEntity updateEmail(@PathVariable String code,@RequestBody User user){ + UserDetails userDetails = SecurityUtils.getUserDetails(); + if(!userDetails.getPassword().equals(EncryptUtils.encryptPassword(user.getPassword()))){ + throw new BadRequestException("密码错误"); + } + VerificationCode verificationCode = new VerificationCode(code, ElAdminConstant.RESET_MAIL,"email",user.getEmail()); + verificationCodeService.validated(verificationCode); + userService.updateEmail(userDetails.getUsername(),user.getEmail()); + return new ResponseEntity(HttpStatus.OK); + } + + + + /** + * 如果当前用户的角色级别低于创建用户的角色级别,则抛出权限不足的错误 + * @param resources + */ + private void checkLevel(User resources) { + Integer currentLevel = Collections.min(roleService.findByUsers_Id(SecurityUtils.getUserId()).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList())); + Integer optLevel = roleService.findByRoles(resources.getRoles()); + if (currentLevel > optLevel) { + throw new BadRequestException("角色权限不足"); + } + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/DeptService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/DeptService.java new file mode 100644 index 00000000..3615eb5c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/DeptService.java @@ -0,0 +1,75 @@ +package co.yixiang.modules.system.service; + +import co.yixiang.modules.system.domain.Dept; +import co.yixiang.modules.system.service.dto.DeptDTO; +import co.yixiang.modules.system.service.dto.DeptQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; + +import java.util.List; +import java.util.Set; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@CacheConfig(cacheNames = "dept") +public interface DeptService { + + /** + * queryAll + * @param criteria + * @return + */ + @Cacheable + List queryAll(DeptQueryCriteria criteria); + + /** + * findById + * @param id + * @return + */ + @Cacheable(key = "#p0") + DeptDTO findById(Long id); + + /** + * create + * @param resources + * @return + */ + @CacheEvict(allEntries = true) + DeptDTO create(Dept resources); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(Dept resources); + + /** + * delete + * @param id + */ + @CacheEvict(allEntries = true) + void delete(Long id); + + /** + * buildTree + * @param deptDTOS + * @return + */ + @Cacheable + Object buildTree(List deptDTOS); + + /** + * findByPid + * @param pid + * @return + */ + @Cacheable + List findByPid(long pid); + + Set findByRoleIds(Long id); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/DictDetailService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/DictDetailService.java new file mode 100644 index 00000000..a13f262d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/DictDetailService.java @@ -0,0 +1,52 @@ +package co.yixiang.modules.system.service; + +import co.yixiang.modules.system.domain.DictDetail; +import co.yixiang.modules.system.service.dto.DictDetailDTO; +import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; + +import java.util.Map; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@CacheConfig(cacheNames = "dictDetail") +public interface DictDetailService { + + /** + * findById + * @param id + * @return + */ + @Cacheable(key = "#p0") + DictDetailDTO findById(Long id); + + /** + * create + * @param resources + * @return + */ + @CacheEvict(allEntries = true) + DictDetailDTO create(DictDetail resources); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(DictDetail resources); + + /** + * delete + * @param id + */ + @CacheEvict(allEntries = true) + void delete(Long id); + + @Cacheable + Map queryAll(DictDetailQueryCriteria criteria, Pageable pageable); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/DictService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/DictService.java new file mode 100644 index 00000000..acdc70b6 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/DictService.java @@ -0,0 +1,56 @@ +package co.yixiang.modules.system.service; + +import co.yixiang.modules.system.domain.Dict; +import co.yixiang.modules.system.service.dto.DictDTO; +import co.yixiang.modules.system.service.dto.DictQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@CacheConfig(cacheNames = "dict") +public interface DictService { + + /** + * 查询 + * @param dict + * @param pageable + * @return + */ + @Cacheable + Object queryAll(DictQueryCriteria dict, Pageable pageable); + + /** + * findById + * @param id + * @return + */ + @Cacheable(key = "#p0") + DictDTO findById(Long id); + + /** + * create + * @param resources + * @return + */ + @CacheEvict(allEntries = true) + DictDTO create(Dict resources); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(Dict resources); + + /** + * delete + * @param id + */ + @CacheEvict(allEntries = true) + void delete(Long id); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/JobService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/JobService.java new file mode 100644 index 00000000..47dd8b01 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/JobService.java @@ -0,0 +1,55 @@ +package co.yixiang.modules.system.service; + +import co.yixiang.modules.system.domain.Job; +import co.yixiang.modules.system.service.dto.JobDTO; +import co.yixiang.modules.system.service.dto.JobQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@CacheConfig(cacheNames = "job") +public interface JobService { + + /** + * findById + * @param id + * @return + */ + @Cacheable(key = "#p0") + JobDTO findById(Long id); + + /** + * create + * @param resources + * @return + */ + @CacheEvict(allEntries = true) + JobDTO create(Job resources); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(Job resources); + + /** + * delete + * @param id + */ + @CacheEvict(allEntries = true) + void delete(Long id); + + /** + * queryAll + * @param criteria + * @param pageable + * @return + */ + Object queryAll(JobQueryCriteria criteria, Pageable pageable); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/MenuService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/MenuService.java new file mode 100644 index 00000000..e6a2511d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/MenuService.java @@ -0,0 +1,104 @@ +package co.yixiang.modules.system.service; + +import co.yixiang.modules.system.domain.Menu; +import co.yixiang.modules.system.service.dto.MenuQueryCriteria; +import co.yixiang.modules.system.service.dto.MenuDTO; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-17 + */ +@CacheConfig(cacheNames = "menu") +public interface MenuService { + + /** + * queryAll + * @param criteria + * @return + */ + @Cacheable + List queryAll(MenuQueryCriteria criteria); + + /** + * get + * @param id + * @return + */ + @Cacheable(key = "#p0") + MenuDTO findById(long id); + + /** + * create + * @param resources + * @return + */ + @CacheEvict(allEntries = true) + MenuDTO create(Menu resources); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(Menu resources); + + /** + * getDeleteMenus + * @param menuList + * @param menuSet + * @return + */ + Set getDeleteMenus(List menuList, Set menuSet); + + /** + * permission tree + * @return + */ + @Cacheable(key = "'tree'") + Object getMenuTree(List menus); + + /** + * findByPid + * @param pid + * @return + */ + @Cacheable(key = "'pid:'+#p0") + List findByPid(long pid); + + /** + * build Tree + * @param menuDTOS + * @return + */ + Map buildTree(List menuDTOS); + + /** + * findByRoles + * @param roles + * @return + */ + List findByRoles(List roles); + + /** + * buildMenus + * @param byRoles + * @return + */ + Object buildMenus(List byRoles); + + Menu findOne(Long id); + + /** + * delete + * @param menuSet + */ + @CacheEvict(allEntries = true) + void delete(Set menuSet); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/PermissionService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/PermissionService.java new file mode 100644 index 00000000..d84aeb56 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/PermissionService.java @@ -0,0 +1,82 @@ +package co.yixiang.modules.system.service; + +import co.yixiang.modules.system.domain.Permission; +import co.yixiang.modules.system.service.dto.PermissionDTO; +import co.yixiang.modules.system.service.dto.PermissionQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; + +import java.util.List; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-08 + */ +@CacheConfig(cacheNames = "permission") +public interface PermissionService { + + /** + * get + * @param id + * @return + */ + @Cacheable(key = "#p0") + PermissionDTO findById(long id); + + /** + * create + * @param resources + * @return + */ + @CacheEvict(allEntries = true) + PermissionDTO create(Permission resources); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(Permission resources); + + /** + * delete + * @param permissions + */ + @CacheEvict(allEntries = true) + void delete(Set permissions); + + /** + * permission tree + * @return + */ + @Cacheable(key = "'tree'") + Object getPermissionTree(List permissions); + + /** + * findByPid + * @param pid + * @return + */ + @Cacheable(key = "'pid:'+#p0") + List findByPid(long pid); + + /** + * build Tree + * @param permissionDTOS + * @return + */ + @Cacheable + Object buildTree(List permissionDTOS); + + /** + * queryAll + * @param criteria + * @return + */ + @Cacheable + List queryAll(PermissionQueryCriteria criteria); + + Set getDeletePermission(List permissions, Set permissionSet); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/RoleService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/RoleService.java new file mode 100644 index 00000000..2cd7760e --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/RoleService.java @@ -0,0 +1,110 @@ +package co.yixiang.modules.system.service; + +import co.yixiang.modules.system.domain.Role; +import co.yixiang.modules.system.service.dto.RoleDTO; +import co.yixiang.modules.system.service.dto.RoleQueryCriteria; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; + +import java.util.List; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +@CacheConfig(cacheNames = "role") +public interface RoleService { + + /** + * get + * @param id + * @return + */ + @Cacheable(key = "#p0") + RoleDTO findById(long id); + + /** + * create + * @param resources + * @return + */ + @CacheEvict(allEntries = true) + RoleDTO create(Role resources); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(Role resources); + + /** + * delete + * @param id + */ + @CacheEvict(allEntries = true) + void delete(Long id); + + /** + * key的名称如有修改,请同步修改 UserServiceImpl 中的 update 方法 + * findByUsers_Id + * @param id + * @return + */ + @Cacheable(key = "'findByUsers_Id:' + #p0") + List findByUsers_Id(Long id); + + @Cacheable + Integer findByRoles(Set roles); + + /** + * updatePermission + * @param resources + * @param roleDTO + */ + @CacheEvict(allEntries = true) + void updatePermission(Role resources, RoleDTO roleDTO); + + /** + * updateMenu + * @param resources + * @param roleDTO + */ + @CacheEvict(allEntries = true) + void updateMenu(Role resources, RoleDTO roleDTO); + + @CacheEvict(allEntries = true) + void untiedMenu(Long id); + + /** + * queryAll + * @param pageable + * @return + */ + @Cacheable + Object queryAll(Pageable pageable); + + /** + * queryAll + * @param pageable + * @param criteria + * @return + */ + @Cacheable + Object queryAll(RoleQueryCriteria criteria, Pageable pageable); + + /** + * queryAll + * @param criteria + * @return + */ + @Cacheable + List queryAll(RoleQueryCriteria criteria); + + @CacheEvict(allEntries = true) + void untiedPermission(Long id); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/UserService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/UserService.java new file mode 100644 index 00000000..f9893136 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/UserService.java @@ -0,0 +1,91 @@ +package co.yixiang.modules.system.service; + +import co.yixiang.modules.system.domain.User; +import co.yixiang.modules.system.service.dto.UserDTO; +import co.yixiang.modules.system.service.dto.UserQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@CacheConfig(cacheNames = "user") +public interface UserService { + + /** + * get + * @param id + * @return + */ + @Cacheable(key = "#p0") + UserDTO findById(long id); + + /** + * create + * @param resources + * @return + */ + @CacheEvict(allEntries = true) + UserDTO create(User resources); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(User resources); + + /** + * delete + * @param id + */ + @CacheEvict(allEntries = true) + void delete(Long id); + + /** + * findByName + * @param userName + * @return + */ + @Cacheable(key = "'loadUserByUsername:'+#p0") + UserDTO findByName(String userName); + + /** + * 修改密码 + * @param username + * @param encryptPassword + */ + @CacheEvict(allEntries = true) + void updatePass(String username, String encryptPassword); + + /** + * 修改头像 + * @param file + */ + @CacheEvict(allEntries = true) + void updateAvatar(MultipartFile file); + + /** + * 修改邮箱 + * @param username + * @param email + */ + @CacheEvict(allEntries = true) + void updateEmail(String username, String email); + + @Cacheable + Object queryAll(UserQueryCriteria criteria, Pageable pageable); + + @Cacheable + List queryAll(UserQueryCriteria criteria); + + void download(List queryAll, HttpServletResponse response) throws IOException; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptDTO.java new file mode 100644 index 00000000..4d408b52 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptDTO.java @@ -0,0 +1,44 @@ +package co.yixiang.modules.system.service.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.sql.Timestamp; +import java.io.Serializable; +import java.util.List; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@Data +public class DeptDTO implements Serializable { + + /** + * ID + */ + private Long id; + + /** + * 名称 + */ + private String name; + + @NotNull + private Boolean enabled; + + /** + * 上级部门 + */ + private Long pid; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + private Timestamp createTime; + + public String getLabel() { + return name; + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptQueryCriteria.java new file mode 100644 index 00000000..c0523a83 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptQueryCriteria.java @@ -0,0 +1,26 @@ +package co.yixiang.modules.system.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +import java.util.Set; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@Data +public class DeptQueryCriteria{ + + @Query(type = Query.Type.IN, propName="id") + private Set ids; + + @Query(type = Query.Type.INNER_LIKE) + private String name; + + @Query + private Boolean enabled; + + @Query + private Long pid; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptSmallDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptSmallDTO.java new file mode 100644 index 00000000..e5c631fb --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptSmallDTO.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; +import java.io.Serializable; + +/** +* @author Zheng Jie +* @date 2019-6-10 16:32:18 +*/ +@Data +public class DeptSmallDTO implements Serializable { + + /** + * ID + */ + private Long id; + + /** + * 名称 + */ + private String name; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDTO.java new file mode 100644 index 00000000..81dc4d48 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDTO.java @@ -0,0 +1,24 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; +import java.io.Serializable; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Data +public class DictDTO implements Serializable { + + private Long id; + + /** + * 字典名称 + */ + private String name; + + /** + * 描述 + */ + private String remark; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDetailDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDetailDTO.java new file mode 100644 index 00000000..872fd523 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDetailDTO.java @@ -0,0 +1,29 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; +import java.io.Serializable; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Data +public class DictDetailDTO implements Serializable { + + private Long id; + + /** + * 字典标签 + */ + private String label; + + /** + * 字典值 + */ + private String value; + + /** + * 排序 + */ + private String sort; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDetailQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDetailQueryCriteria.java new file mode 100644 index 00000000..3bf6b225 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDetailQueryCriteria.java @@ -0,0 +1,18 @@ +package co.yixiang.modules.system.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Data +public class DictDetailQueryCriteria { + + @Query(type = Query.Type.INNER_LIKE) + private String label; + + @Query(propName = "name",joinName = "dict") + private String dictName; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictQueryCriteria.java new file mode 100644 index 00000000..4fcbd067 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictQueryCriteria.java @@ -0,0 +1,15 @@ +package co.yixiang.modules.system.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +/** + * 公共查询类 + */ +@Data +public class DictQueryCriteria { + + // 多字段模糊 + @Query(blurry = "name,remark") + private String blurry; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobDTO.java new file mode 100644 index 00000000..4d53da5a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobDTO.java @@ -0,0 +1,50 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.sql.Timestamp; +import java.io.Serializable; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@Data +@NoArgsConstructor +public class JobDTO implements Serializable { + + /** + * ID + */ + private Long id; + + private Long sort; + + /** + * 名称 + */ + private String name; + + /** + * 状态 + */ + private Boolean enabled; + + private DeptDTO dept; + + /** + * 如果分公司存在相同部门,则显示上级部门名称 + */ + private String deptSuperiorName; + + /** + * 创建日期 + */ + private Timestamp createTime; + + public JobDTO(String name, Boolean enabled) { + this.name = name; + this.enabled = enabled; + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobQueryCriteria.java new file mode 100644 index 00000000..81256dfd --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobQueryCriteria.java @@ -0,0 +1,28 @@ +package co.yixiang.modules.system.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Set; + +/** +* @author Zheng Jie +* @date 2019-6-4 14:49:34 +*/ +@Data +@NoArgsConstructor +public class JobQueryCriteria { + + @Query(type = Query.Type.INNER_LIKE) + private String name; + + @Query + private Boolean enabled; + + @Query(propName = "id", joinName = "dept") + private Long deptId; + + @Query(propName = "id", joinName = "dept", type = Query.Type.IN) + private Set deptIds; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobSmallDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobSmallDTO.java new file mode 100644 index 00000000..229f21ce --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobSmallDTO.java @@ -0,0 +1,24 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; +import lombok.NoArgsConstructor; +import java.io.Serializable; + +/** +* @author Zheng Jie +* @date 2019-6-10 16:32:18 +*/ +@Data +@NoArgsConstructor +public class JobSmallDTO implements Serializable { + + /** + * ID + */ + private Long id; + + /** + * 名称 + */ + private String name; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/MenuDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/MenuDTO.java new file mode 100644 index 00000000..f93fc9c7 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/MenuDTO.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; + +import java.sql.Timestamp; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2018-12-17 + */ +@Data +public class MenuDTO { + + private Long id; + + private String name; + + private Long sort; + + private String path; + + private String component; + + private Long pid; + + private Boolean iFrame; + + private Boolean cache; + + private Boolean hidden; + + private String componentName; + + private String icon; + + private List children; + + private Timestamp createTime; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/MenuQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/MenuQueryCriteria.java new file mode 100644 index 00000000..41cd45f9 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/MenuQueryCriteria.java @@ -0,0 +1,15 @@ +package co.yixiang.modules.system.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +/** + * 公共查询类 + */ +@Data +public class MenuQueryCriteria { + + // 多字段模糊 + @Query(blurry = "name,path,component") + private String blurry; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/PermissionDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/PermissionDTO.java new file mode 100644 index 00000000..eef9a973 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/PermissionDTO.java @@ -0,0 +1,38 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +@Data +public class PermissionDTO implements Serializable{ + + private Long id; + + private String name; + + private Long pid; + + private String alias; + + private Timestamp createTime; + + private List children; + + @Override + public String toString() { + return "Permission{" + + "id=" + id + + ", name='" + name + '\'' + + ", pid=" + pid + + ", alias='" + alias + '\'' + + ", createTime=" + createTime + + '}'; + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/PermissionQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/PermissionQueryCriteria.java new file mode 100644 index 00000000..a88b319f --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/PermissionQueryCriteria.java @@ -0,0 +1,15 @@ +package co.yixiang.modules.system.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +/** + * 公共查询类 + */ +@Data +public class PermissionQueryCriteria { + + // 多字段模糊 + @Query(blurry = "name,alias") + private String blurry; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleDTO.java new file mode 100644 index 00000000..39d41a27 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleDTO.java @@ -0,0 +1,32 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Data +public class RoleDTO implements Serializable { + + private Long id; + + private String name; + + private String dataScope; + + private Integer level; + + private String remark; + + private Set permissions; + + private Set menus; + + private Set depts; + + private Timestamp createTime; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleQueryCriteria.java new file mode 100644 index 00000000..ebae59ff --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleQueryCriteria.java @@ -0,0 +1,15 @@ +package co.yixiang.modules.system.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +/** + * 公共查询类 + */ +@Data +public class RoleQueryCriteria { + + // 多字段模糊 + @Query(blurry = "name,remark") + private String blurry; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleSmallDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleSmallDTO.java new file mode 100644 index 00000000..ebeeebda --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleSmallDTO.java @@ -0,0 +1,23 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Data +public class RoleSmallDTO implements Serializable { + + private Long id; + + private String name; + + private Integer level; + + private String dataScope; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserDTO.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserDTO.java new file mode 100644 index 00000000..7ed82e5c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserDTO.java @@ -0,0 +1,47 @@ +package co.yixiang.modules.system.service.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Data +public class UserDTO implements Serializable { + + @ApiModelProperty(hidden = true) + private Long id; + + private String username; + + private String avatar; + + private String email; + + private String phone; + + private Boolean enabled; + + @JsonIgnore + private String password; + + private Timestamp createTime; + + private Date lastPasswordResetTime; + + @ApiModelProperty(hidden = true) + private Set roles; + + @ApiModelProperty(hidden = true) + private JobSmallDTO job; + + private DeptSmallDTO dept; + + private Long deptId; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserQueryCriteria.java new file mode 100644 index 00000000..4ba35165 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserQueryCriteria.java @@ -0,0 +1,30 @@ +package co.yixiang.modules.system.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +import java.io.Serializable; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Data +public class UserQueryCriteria implements Serializable { + + @Query + private Long id; + + @Query(propName = "id", type = Query.Type.IN, joinName = "dept") + private Set deptIds; + + // 多字段模糊 + @Query(blurry = "email,username") + private String blurry; + + @Query + private Boolean enabled; + + private Long deptId; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DeptServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DeptServiceImpl.java new file mode 100644 index 00000000..9cc817c0 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DeptServiceImpl.java @@ -0,0 +1,118 @@ +package co.yixiang.modules.system.service.impl; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.modules.system.domain.Dept; +import co.yixiang.modules.system.service.DeptService; +import co.yixiang.modules.system.service.dto.DeptDTO; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.service.dto.DeptQueryCriteria; +import co.yixiang.modules.system.repository.DeptRepository; +import co.yixiang.modules.system.service.mapper.DeptMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.util.*; +import java.util.stream.Collectors; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class DeptServiceImpl implements DeptService { + + @Autowired + private DeptRepository deptRepository; + + @Autowired + private DeptMapper deptMapper; + + @Override + public List queryAll(DeptQueryCriteria criteria) { + return deptMapper.toDto(deptRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public DeptDTO findById(Long id) { + Optional dept = deptRepository.findById(id); + ValidationUtil.isNull(dept,"Dept","id",id); + return deptMapper.toDto(dept.get()); + } + + @Override + public List findByPid(long pid) { + return deptRepository.findByPid(pid); + } + + @Override + public Set findByRoleIds(Long id) { + return deptRepository.findByRoles_Id(id); + } + + @Override + public Object buildTree(List deptDTOS) { + Set trees = new LinkedHashSet<>(); + Set depts= new LinkedHashSet<>(); + List deptNames = deptDTOS.stream().map(DeptDTO::getName).collect(Collectors.toList()); + Boolean isChild; + for (DeptDTO deptDTO : deptDTOS) { + isChild = false; + if ("0".equals(deptDTO.getPid().toString())) { + trees.add(deptDTO); + } + for (DeptDTO it : deptDTOS) { + if (it.getPid().equals(deptDTO.getId())) { + isChild = true; + if (deptDTO.getChildren() == null) { + deptDTO.setChildren(new ArrayList()); + } + deptDTO.getChildren().add(it); + } + } + if(isChild) + depts.add(deptDTO); + else if(!deptNames.contains(deptRepository.findNameById(deptDTO.getPid()))) + depts.add(deptDTO); + } + + if (CollectionUtils.isEmpty(trees)) { + trees = depts; + } + + Integer totalElements = deptDTOS!=null?deptDTOS.size():0; + + Map map = new HashMap(); + map.put("totalElements",totalElements); + map.put("content",CollectionUtils.isEmpty(trees)?deptDTOS:trees); + return map; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DeptDTO create(Dept resources) { + return deptMapper.toDto(deptRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Dept resources) { + if(resources.getId().equals(resources.getPid())) { + throw new BadRequestException("上级不能为自己"); + } + Optional optionalDept = deptRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalDept,"Dept","id",resources.getId()); + Dept dept = optionalDept.get(); + resources.setId(dept.getId()); + deptRepository.save(resources); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + deptRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DictDetailServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DictDetailServiceImpl.java new file mode 100644 index 00000000..eb153628 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DictDetailServiceImpl.java @@ -0,0 +1,70 @@ +package co.yixiang.modules.system.service.impl; + +import co.yixiang.modules.system.domain.DictDetail; +import co.yixiang.modules.system.service.DictDetailService; +import co.yixiang.modules.system.service.dto.DictDetailDTO; +import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria; +import co.yixiang.modules.system.service.mapper.DictDetailMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.repository.DictDetailRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Map; +import java.util.Optional; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class DictDetailServiceImpl implements DictDetailService { + + @Autowired + private DictDetailRepository dictDetailRepository; + + @Autowired + private DictDetailMapper dictDetailMapper; + + @Override + public Map queryAll(DictDetailQueryCriteria criteria, Pageable pageable) { + Page page = dictDetailRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(dictDetailMapper::toDto)); + } + + @Override + public DictDetailDTO findById(Long id) { + Optional dictDetail = dictDetailRepository.findById(id); + ValidationUtil.isNull(dictDetail,"DictDetail","id",id); + return dictDetailMapper.toDto(dictDetail.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DictDetailDTO create(DictDetail resources) { + return dictDetailMapper.toDto(dictDetailRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DictDetail resources) { + Optional optionalDictDetail = dictDetailRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalDictDetail,"DictDetail","id",resources.getId()); + DictDetail dictDetail = optionalDictDetail.get(); + resources.setId(dictDetail.getId()); + dictDetailRepository.save(resources); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + dictDetailRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DictServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DictServiceImpl.java new file mode 100644 index 00000000..bcf2f31a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/DictServiceImpl.java @@ -0,0 +1,68 @@ +package co.yixiang.modules.system.service.impl; + +import co.yixiang.modules.system.domain.Dict; +import co.yixiang.modules.system.service.DictService; +import co.yixiang.modules.system.service.dto.DictDTO; +import co.yixiang.modules.system.service.dto.DictQueryCriteria; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.repository.DictRepository; +import co.yixiang.modules.system.service.mapper.DictMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class DictServiceImpl implements DictService { + + @Autowired + private DictRepository dictRepository; + + @Autowired + private DictMapper dictMapper; + + @Override + public Object queryAll(DictQueryCriteria dict, Pageable pageable){ + Page page = dictRepository.findAll((root, query, cb) -> QueryHelp.getPredicate(root, dict, cb), pageable); + return PageUtil.toPage(page.map(dictMapper::toDto)); + } + + @Override + public DictDTO findById(Long id) { + Optional dict = dictRepository.findById(id); + ValidationUtil.isNull(dict,"Dict","id",id); + return dictMapper.toDto(dict.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DictDTO create(Dict resources) { + return dictMapper.toDto(dictRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Dict resources) { + Optional optionalDict = dictRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalDict,"Dict","id",resources.getId()); + Dict dict = optionalDict.get(); + resources.setId(dict.getId()); + dictRepository.save(resources); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + dictRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/JobServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/JobServiceImpl.java new file mode 100644 index 00000000..dd9fe245 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/JobServiceImpl.java @@ -0,0 +1,79 @@ +package co.yixiang.modules.system.service.impl; + +import co.yixiang.modules.system.domain.Job; +import co.yixiang.modules.system.service.JobService; +import co.yixiang.modules.system.service.dto.JobDTO; +import co.yixiang.modules.system.service.dto.JobQueryCriteria; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.repository.DeptRepository; +import co.yixiang.modules.system.repository.JobRepository; +import co.yixiang.modules.system.service.mapper.JobMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class JobServiceImpl implements JobService { + + @Autowired + private JobRepository jobRepository; + + @Autowired + private JobMapper jobMapper; + + @Autowired + private DeptRepository deptRepository; + + @Override + public Object queryAll(JobQueryCriteria criteria, Pageable pageable) { + Page page = jobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + List jobs = new ArrayList<>(); + for (Job job : page.getContent()) { + jobs.add(jobMapper.toDto(job,deptRepository.findNameById(job.getDept().getPid()))); + } + return PageUtil.toPage(jobs,page.getTotalElements()); + } + + @Override + public JobDTO findById(Long id) { + Optional job = jobRepository.findById(id); + ValidationUtil.isNull(job,"Job","id",id); + return jobMapper.toDto(job.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public JobDTO create(Job resources) { + return jobMapper.toDto(jobRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Job resources) { + Optional optionalJob = jobRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalJob,"Job","id",resources.getId()); + + Job job = optionalJob.get(); + resources.setId(job.getId()); + jobRepository.save(resources); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + jobRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/MenuServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/MenuServiceImpl.java new file mode 100644 index 00000000..999502db --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/MenuServiceImpl.java @@ -0,0 +1,248 @@ +package co.yixiang.modules.system.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.exception.BadRequestException; +import co.yixiang.exception.EntityExistException; +import co.yixiang.modules.system.domain.Menu; +import co.yixiang.modules.system.domain.vo.MenuMetaVo; +import co.yixiang.modules.system.domain.vo.MenuVo; +import co.yixiang.modules.system.service.MenuService; +import co.yixiang.modules.system.service.RoleService; +import co.yixiang.modules.system.service.dto.MenuDTO; +import co.yixiang.modules.system.service.dto.MenuQueryCriteria; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.StringUtils; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.repository.MenuRepository; +import co.yixiang.modules.system.service.mapper.MenuMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.*; +import java.util.stream.Collectors; + +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class MenuServiceImpl implements MenuService { + + @Autowired + private MenuRepository menuRepository; + + @Autowired + private MenuMapper menuMapper; + + @Autowired + private RoleService roleService; + + @Override + public List queryAll(MenuQueryCriteria criteria){ + return menuMapper.toDto(menuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public MenuDTO findById(long id) { + Optional menu = menuRepository.findById(id); + ValidationUtil.isNull(menu,"Menu","id",id); + return menuMapper.toDto(menu.get()); + } + + @Override + public List findByRoles(List roles) { + Set menus = new LinkedHashSet<>(); + for (RoleSmallDTO role : roles) { + List menus1 = menuRepository.findByRoles_IdOrderBySortAsc(role.getId()).stream().collect(Collectors.toList()); + menus.addAll(menus1); + } + return menus.stream().map(menuMapper::toDto).collect(Collectors.toList()); + } + + @Override + public MenuDTO create(Menu resources) { + if(menuRepository.findByName(resources.getName()) != null){ + throw new EntityExistException(Menu.class,"name",resources.getName()); + } + if(StringUtils.isNotBlank(resources.getComponentName())){ + if(menuRepository.findByComponentName(resources.getComponentName()) != null){ + throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); + } + } + if(resources.getIFrame()){ + if (!(resources.getPath().toLowerCase().startsWith("http://")||resources.getPath().toLowerCase().startsWith("https://"))) { + throw new BadRequestException("外链必须以http://或者https://开头"); + } + } + return menuMapper.toDto(menuRepository.save(resources)); + } + + @Override + public void update(Menu resources) { + if(resources.getId().equals(resources.getPid())) { + throw new BadRequestException("上级不能为自己"); + } + Optional optionalPermission = menuRepository.findById(resources.getId()); + ValidationUtil.isNull(optionalPermission,"Permission","id",resources.getId()); + + if(resources.getIFrame()){ + if (!(resources.getPath().toLowerCase().startsWith("http://")||resources.getPath().toLowerCase().startsWith("https://"))) { + throw new BadRequestException("外链必须以http://或者https://开头"); + } + } + Menu menu = optionalPermission.get(); + Menu menu1 = menuRepository.findByName(resources.getName()); + + if(menu1 != null && !menu1.getId().equals(menu.getId())){ + throw new EntityExistException(Menu.class,"name",resources.getName()); + } + + if(StringUtils.isNotBlank(resources.getComponentName())){ + menu1 = menuRepository.findByComponentName(resources.getComponentName()); + if(menu1 != null && !menu1.getId().equals(menu.getId())){ + throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); + } + } + menu.setName(resources.getName()); + menu.setComponent(resources.getComponent()); + menu.setPath(resources.getPath()); + menu.setIcon(resources.getIcon()); + menu.setIFrame(resources.getIFrame()); + menu.setPid(resources.getPid()); + menu.setSort(resources.getSort()); + menu.setCache(resources.getCache()); + menu.setHidden(resources.getHidden()); + menu.setComponentName(resources.getComponentName()); + menuRepository.save(menu); + } + + @Override + public Set getDeleteMenus(List menuList, Set menuSet) { + // 递归找出待删除的菜单 + for (Menu menu1 : menuList) { + menuSet.add(menu1); + List menus = menuRepository.findByPid(menu1.getId()); + if(menus!=null && menus.size()!=0){ + getDeleteMenus(menus, menuSet); + } + } + return menuSet; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Set menuSet) { + for (Menu menu : menuSet) { + roleService.untiedMenu(menu.getId()); + menuRepository.deleteById(menu.getId()); + } + } + + @Override + public Object getMenuTree(List menus) { + List> list = new LinkedList<>(); + menus.forEach(menu -> { + if (menu!=null){ + List menuList = menuRepository.findByPid(menu.getId()); + Map map = new HashMap<>(); + map.put("id",menu.getId()); + map.put("label",menu.getName()); + if(menuList!=null && menuList.size()!=0){ + map.put("children",getMenuTree(menuList)); + } + list.add(map); + } + } + ); + return list; + } + + @Override + public List findByPid(long pid) { + return menuRepository.findByPid(pid); + } + + @Override + public Map buildTree(List menuDTOS) { + List trees = new ArrayList(); + Set ids = new HashSet<>(); + for (MenuDTO menuDTO : menuDTOS) { + if (menuDTO.getPid() == 0) { + trees.add(menuDTO); + } + for (MenuDTO it : menuDTOS) { + if (it.getPid().equals(menuDTO.getId())) { + if (menuDTO.getChildren() == null) { + menuDTO.setChildren(new ArrayList()); + } + menuDTO.getChildren().add(it); + ids.add(it.getId()); + } + } + } + Map map = new HashMap(); + if(trees.size() == 0){ + trees = menuDTOS.stream().filter(s -> !ids.contains(s.getId())).collect(Collectors.toList()); + } + map.put("content",trees); + map.put("totalElements",menuDTOS!=null?menuDTOS.size():0); + return map; + } + + @Override + public List buildMenus(List menuDTOS) { + List list = new LinkedList<>(); + menuDTOS.forEach(menuDTO -> { + if (menuDTO!=null){ + List menuDTOList = menuDTO.getChildren(); + MenuVo menuVo = new MenuVo(); + menuVo.setName(ObjectUtil.isNotEmpty(menuDTO.getComponentName()) ? menuDTO.getComponentName() : menuDTO.getName()); + // 一级目录需要加斜杠,不然会报警告 + menuVo.setPath(menuDTO.getPid() == 0 ? "/" + menuDTO.getPath() :menuDTO.getPath()); + menuVo.setHidden(menuDTO.getHidden()); + // 如果不是外链 + if(!menuDTO.getIFrame()){ + if(menuDTO.getPid() == 0){ + menuVo.setComponent(StrUtil.isEmpty(menuDTO.getComponent())?"Layout":menuDTO.getComponent()); + }else if(!StrUtil.isEmpty(menuDTO.getComponent())){ + menuVo.setComponent(menuDTO.getComponent()); + } + } + menuVo.setMeta(new MenuMetaVo(menuDTO.getName(),menuDTO.getIcon(),!menuDTO.getCache())); + if(menuDTOList!=null && menuDTOList.size()!=0){ + menuVo.setAlwaysShow(true); + menuVo.setRedirect("noredirect"); + menuVo.setChildren(buildMenus(menuDTOList)); + // 处理是一级菜单并且没有子菜单的情况 + } else if(menuDTO.getPid() == 0){ + MenuVo menuVo1 = new MenuVo(); + menuVo1.setMeta(menuVo.getMeta()); + // 非外链 + if(!menuDTO.getIFrame()){ + menuVo1.setPath("index"); + menuVo1.setName(menuVo.getName()); + menuVo1.setComponent(menuVo.getComponent()); + } else { + menuVo1.setPath(menuDTO.getPath()); + } + menuVo.setName(null); + menuVo.setMeta(null); + menuVo.setComponent("Layout"); + List list1 = new ArrayList(); + list1.add(menuVo1); + menuVo.setChildren(list1); + } + list.add(menuVo); + } + } + ); + return list; + } + + @Override + public Menu findOne(Long id) { + Optional menu = menuRepository.findById(id); + ValidationUtil.isNull(menu,"Menu","id",id); + return menu.get(); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/PermissionServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/PermissionServiceImpl.java new file mode 100644 index 00000000..0f82a228 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/PermissionServiceImpl.java @@ -0,0 +1,155 @@ +package co.yixiang.modules.system.service.impl; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.exception.EntityExistException; +import co.yixiang.modules.system.domain.Permission; +import co.yixiang.modules.system.service.PermissionService; +import co.yixiang.modules.system.service.RoleService; +import co.yixiang.modules.system.service.dto.PermissionDTO; +import co.yixiang.modules.system.service.dto.PermissionQueryCriteria; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.repository.PermissionRepository; +import co.yixiang.modules.system.service.mapper.PermissionMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.*; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class PermissionServiceImpl implements PermissionService { + + @Autowired + private PermissionRepository permissionRepository; + + @Autowired + private PermissionMapper permissionMapper; + + @Autowired + private RoleService roleService; + + @Override + public List queryAll(PermissionQueryCriteria criteria) { + return permissionMapper.toDto(permissionRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public PermissionDTO findById(long id) { + Optional permission = permissionRepository.findById(id); + ValidationUtil.isNull(permission,"Permission","id",id); + return permissionMapper.toDto(permission.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public PermissionDTO create(Permission resources) { + if(permissionRepository.findByName(resources.getName()) != null){ + throw new EntityExistException(Permission.class,"name",resources.getName()); + } + return permissionMapper.toDto(permissionRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Permission resources) { + Optional optionalPermission = permissionRepository.findById(resources.getId()); + if(resources.getId().equals(resources.getPid())) { + throw new BadRequestException("上级不能为自己"); + } + ValidationUtil.isNull(optionalPermission,"Permission","id",resources.getId()); + + Permission permission = optionalPermission.get(); + + Permission permission1 = permissionRepository.findByName(resources.getName()); + + if(permission1 != null && !permission1.getId().equals(permission.getId())){ + throw new EntityExistException(Permission.class,"name",resources.getName()); + } + + permission.setName(resources.getName()); + permission.setAlias(resources.getAlias()); + permission.setPid(resources.getPid()); + permissionRepository.save(permission); + } + + @Override + public Set getDeletePermission(List permissions, Set permissionSet) { + // 递归找出待删除的菜单 + for (Permission permission : permissions) { + permissionSet.add(permission); + List permissionList = permissionRepository.findByPid(permission.getId()); + if(permissionList!=null && permissionList.size()!=0){ + getDeletePermission(permissionList, permissionSet); + } + } + return permissionSet; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Set permissions) { + for (Permission permission : permissions) { + roleService.untiedPermission(permission.getId()); + permissionRepository.delete(permission); + } + } + + @Override + public Object getPermissionTree(List permissions) { + List> list = new LinkedList<>(); + permissions.forEach(permission -> { + if (permission!=null){ + List permissionList = permissionRepository.findByPid(permission.getId()); + Map map = new HashMap<>(); + map.put("id",permission.getId()); + map.put("label",permission.getAlias()); + if(permissionList!=null && permissionList.size()!=0){ + map.put("children",getPermissionTree(permissionList)); + } + list.add(map); + } + } + ); + return list; + } + + @Override + public List findByPid(long pid) { + return permissionRepository.findByPid(pid); + } + + @Override + public Object buildTree(List permissionDTOS) { + + List trees = new ArrayList(); + + for (PermissionDTO permissionDTO : permissionDTOS) { + + if ("0".equals(permissionDTO.getPid().toString())) { + trees.add(permissionDTO); + } + + for (PermissionDTO it : permissionDTOS) { + if (it.getPid().equals(permissionDTO.getId())) { + if (permissionDTO.getChildren() == null) { + permissionDTO.setChildren(new ArrayList()); + } + permissionDTO.getChildren().add(it); + } + } + } + + Integer totalElements = permissionDTOS!=null?permissionDTOS.size():0; + + Map map = new HashMap(); + map.put("content",trees.size() == 0?permissionDTOS:trees); + map.put("totalElements",totalElements); + return map; + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RoleServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RoleServiceImpl.java new file mode 100644 index 00000000..58222c38 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RoleServiceImpl.java @@ -0,0 +1,141 @@ +package co.yixiang.modules.system.service.impl; + +import co.yixiang.exception.EntityExistException; +import co.yixiang.modules.system.domain.Role; +import co.yixiang.modules.system.service.RoleService; +import co.yixiang.modules.system.service.dto.RoleDTO; +import co.yixiang.modules.system.service.dto.RoleQueryCriteria; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import co.yixiang.modules.system.service.mapper.RoleMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.repository.RoleRepository; +import co.yixiang.modules.system.service.mapper.RoleSmallMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author Zheng Jie + * @date 2018-12-03 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class RoleServiceImpl implements RoleService { + + @Autowired + private RoleRepository roleRepository; + + @Autowired + private RoleMapper roleMapper; + + @Autowired + private RoleSmallMapper roleSmallMapper; + + @Override + public Object queryAll(Pageable pageable) { + return roleMapper.toDto(roleRepository.findAll(pageable).getContent()); + } + + @Override + public List queryAll(RoleQueryCriteria criteria) { + return roleMapper.toDto(roleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public Object queryAll(RoleQueryCriteria criteria, Pageable pageable) { + Page page = roleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(roleMapper::toDto)); + } + + @Override + public RoleDTO findById(long id) { + Optional role = roleRepository.findById(id); + ValidationUtil.isNull(role,"Role","id",id); + return roleMapper.toDto(role.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public RoleDTO create(Role resources) { + if(roleRepository.findByName(resources.getName()) != null){ + throw new EntityExistException(Role.class,"username",resources.getName()); + } + return roleMapper.toDto(roleRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Role resources) { + + Optional optionalRole = roleRepository.findById(resources.getId()); + ValidationUtil.isNull(optionalRole,"Role","id",resources.getId()); + + Role role = optionalRole.get(); + + Role role1 = roleRepository.findByName(resources.getName()); + + if(role1 != null && !role1.getId().equals(role.getId())){ + throw new EntityExistException(Role.class,"username",resources.getName()); + } + + role.setName(resources.getName()); + role.setRemark(resources.getRemark()); + role.setDataScope(resources.getDataScope()); + role.setDepts(resources.getDepts()); + role.setLevel(resources.getLevel()); + roleRepository.save(role); + } + + @Override + public void updatePermission(Role resources, RoleDTO roleDTO) { + Role role = roleMapper.toEntity(roleDTO); + role.setPermissions(resources.getPermissions()); + roleRepository.save(role); + } + + @Override + public void updateMenu(Role resources, RoleDTO roleDTO) { + Role role = roleMapper.toEntity(roleDTO); + role.setMenus(resources.getMenus()); + roleRepository.save(role); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void untiedMenu(Long id) { + roleRepository.untiedMenu(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void untiedPermission(Long id) { + roleRepository.untiedPermission(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + roleRepository.deleteById(id); + } + + @Override + public List findByUsers_Id(Long id) { + return roleSmallMapper.toDto(roleRepository.findByUsers_Id(id).stream().collect(Collectors.toList())); + } + + @Override + public Integer findByRoles(Set roles) { + Set roleDTOS = new HashSet<>(); + for (Role role : roles) { + roleDTOS.add(findById(role.getId())); + } + return Collections.min(roleDTOS.stream().map(RoleDTO::getLevel).collect(Collectors.toList())); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UserServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UserServiceImpl.java new file mode 100644 index 00000000..9216f0b8 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UserServiceImpl.java @@ -0,0 +1,199 @@ +package co.yixiang.modules.system.service.impl; + +import co.yixiang.exception.EntityExistException; +import co.yixiang.exception.EntityNotFoundException; +import co.yixiang.modules.system.domain.User; +import co.yixiang.modules.system.domain.UserAvatar; +import co.yixiang.modules.system.service.UserService; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import co.yixiang.modules.system.service.dto.UserDTO; +import co.yixiang.modules.system.service.dto.UserQueryCriteria; +import co.yixiang.utils.*; +import co.yixiang.modules.monitor.service.RedisService; +import co.yixiang.modules.system.repository.UserAvatarRepository; +import co.yixiang.modules.system.repository.UserRepository; +import co.yixiang.modules.system.service.mapper.UserMapper; +import co.yixiang.utils.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class UserServiceImpl implements UserService { + + @Autowired + private UserRepository userRepository; + + @Autowired + private UserMapper userMapper; + + @Autowired + private RedisService redisService; + + @Autowired + private UserAvatarRepository userAvatarRepository; + + @Value("${file.avatar}") + private String avatar; + + @Override + public Object queryAll(UserQueryCriteria criteria, Pageable pageable) { + Page page = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(userMapper::toDto)); + } + + @Override + public List queryAll(UserQueryCriteria criteria) { + List users = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); + return userMapper.toDto(users); + } + + @Override + public UserDTO findById(long id) { + Optional user = userRepository.findById(id); + ValidationUtil.isNull(user,"User","id",id); + return userMapper.toDto(user.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public UserDTO create(User resources) { + + if(userRepository.findByUsername(resources.getUsername())!=null){ + throw new EntityExistException(User.class,"username",resources.getUsername()); + } + + if(userRepository.findByEmail(resources.getEmail())!=null){ + throw new EntityExistException(User.class,"email",resources.getEmail()); + } + + // 默认密码 123456,此密码是加密后的字符 + resources.setPassword("e10adc3949ba59abbe56e057f20f883e"); + return userMapper.toDto(userRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(User resources) { + Optional userOptional = userRepository.findById(resources.getId()); + ValidationUtil.isNull(userOptional,"User","id",resources.getId()); + + User user = userOptional.get(); + + User user1 = userRepository.findByUsername(user.getUsername()); + User user2 = userRepository.findByEmail(user.getEmail()); + + if(user1 !=null&&!user.getId().equals(user1.getId())){ + throw new EntityExistException(User.class,"username",resources.getUsername()); + } + + if(user2!=null&&!user.getId().equals(user2.getId())){ + throw new EntityExistException(User.class,"email",resources.getEmail()); + } + + // 如果用户的角色改变了,需要手动清理下缓存 + if (!resources.getRoles().equals(user.getRoles())) { + String key = "role::loadPermissionByUser:" + user.getUsername(); + redisService.delete(key); + key = "role::findByUsers_Id:" + user.getId(); + redisService.delete(key); + } + + user.setUsername(resources.getUsername()); + user.setEmail(resources.getEmail()); + user.setEnabled(resources.getEnabled()); + user.setRoles(resources.getRoles()); + user.setDept(resources.getDept()); + user.setJob(resources.getJob()); + user.setPhone(resources.getPhone()); + userRepository.save(user); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + userRepository.deleteById(id); + } + + @Override + public UserDTO findByName(String userName) { + User user = null; + if(ValidationUtil.isEmail(userName)){ + user = userRepository.findByEmail(userName); + } else { + user = userRepository.findByUsername(userName); + } + if (user == null) { + throw new EntityNotFoundException(User.class, "name", userName); + } else { + return userMapper.toDto(user); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updatePass(String username, String pass) { + userRepository.updatePass(username,pass,new Date()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateAvatar(MultipartFile multipartFile) { + User user = userRepository.findByUsername(SecurityUtils.getUsername()); + UserAvatar userAvatar = user.getUserAvatar(); + String oldPath = ""; + if(userAvatar != null){ + oldPath = userAvatar.getPath(); + } + File file = FileUtil.upload(multipartFile, avatar); + userAvatar = userAvatarRepository.save(new UserAvatar(userAvatar,file.getName(), file.getPath(), FileUtil.getSize(multipartFile.getSize()))); + user.setUserAvatar(userAvatar); + userRepository.save(user); + if(StringUtils.isNotBlank(oldPath)){ + FileUtil.del(oldPath); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateEmail(String username, String email) { + userRepository.updateEmail(username,email); + } + + @Override + public void download(List queryAll, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (UserDTO userDTO : queryAll) { + List roles = userDTO.getRoles().stream().map(RoleSmallDTO::getName).collect(Collectors.toList()); + Map map = new LinkedHashMap(); + map.put("用户名", userDTO.getUsername()); + map.put("头像", userDTO.getAvatar()); + map.put("邮箱", userDTO.getEmail()); + map.put("状态", userDTO.getEnabled() ? "启用" : "禁用"); + map.put("手机号码", userDTO.getPhone()); + map.put("角色", roles); + map.put("部门", userDTO.getDept().getName()); + map.put("岗位", userDTO.getJob().getName()); + map.put("最后修改密码的时间", userDTO.getLastPasswordResetTime()); + map.put("创建日期", userDTO.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DeptMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DeptMapper.java new file mode 100644 index 00000000..60e3ecd3 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DeptMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Dept; +import co.yixiang.modules.system.service.dto.DeptDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DeptMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DeptSmallMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DeptSmallMapper.java new file mode 100644 index 00000000..9348e70f --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DeptSmallMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Dept; +import co.yixiang.modules.system.service.dto.DeptSmallDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DeptSmallMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictDetailMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictDetailMapper.java new file mode 100644 index 00000000..bebac731 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictDetailMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.DictDetail; +import co.yixiang.modules.system.service.dto.DictDetailDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DictDetailMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictMapper.java new file mode 100644 index 00000000..00963d6e --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Dict; +import co.yixiang.modules.system.service.dto.DictDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DictMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/JobMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/JobMapper.java new file mode 100644 index 00000000..e199947a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/JobMapper.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Job; +import co.yixiang.modules.system.service.dto.JobDTO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@Mapper(componentModel = "spring",uses = {DeptMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface JobMapper extends EntityMapper { + + @Mapping(source = "deptSuperiorName", target = "deptSuperiorName") + JobDTO toDto(Job job, String deptSuperiorName); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/JobSmallMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/JobSmallMapper.java new file mode 100644 index 00000000..76565204 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/JobSmallMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Job; +import co.yixiang.modules.system.service.dto.JobSmallDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface JobSmallMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/MenuMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/MenuMapper.java new file mode 100644 index 00000000..def68798 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/MenuMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Menu; +import co.yixiang.modules.system.service.dto.MenuDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2018-12-17 + */ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface MenuMapper extends EntityMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/PermissionMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/PermissionMapper.java new file mode 100644 index 00000000..e7ac7e32 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/PermissionMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Permission; +import co.yixiang.modules.system.service.dto.PermissionDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface PermissionMapper extends EntityMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RoleMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RoleMapper.java new file mode 100644 index 00000000..7d62bcd6 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RoleMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Role; +import co.yixiang.modules.system.service.dto.RoleDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Mapper(componentModel = "spring", uses = {PermissionMapper.class, MenuMapper.class, DeptMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface RoleMapper extends EntityMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RoleSmallMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RoleSmallMapper.java new file mode 100644 index 00000000..429f8ff3 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RoleSmallMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.Role; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2019-5-23 + */ +@Mapper(componentModel = "spring", uses = {}, unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface RoleSmallMapper extends EntityMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UserMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UserMapper.java new file mode 100644 index 00000000..208a2827 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UserMapper.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.system.domain.User; +import co.yixiang.modules.system.service.dto.UserDTO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +@Mapper(componentModel = "spring",uses = {RoleMapper.class, DeptMapper.class, JobMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface UserMapper extends EntityMapper { + + @Mapping(source = "user.userAvatar.realName",target = "avatar") + UserDTO toDto(User user); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxArticle.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxArticle.java new file mode 100644 index 00000000..3f074a0c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxArticle.java @@ -0,0 +1,102 @@ +package co.yixiang.modules.wechat.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +import java.io.Serializable; + +/** +* @author hupeng +* @date 2019-10-07 +*/ +@Entity +@Data +@Table(name="yx_article") +public class YxArticle implements Serializable { + + // 文章管理ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Integer id; + + // 分类id + @Column(name = "cid") + private String cid; + + // 文章标题 + @Column(name = "title",nullable = false) + private String title; + + // 文章作者 + @Column(name = "author") + private String author; + + @Column(name = "content") + private String content; + + // 文章图片 + @Column(name = "image_input",nullable = false) + private String imageInput; + + // 文章简介 + @Column(name = "synopsis") + private String synopsis; + + // 文章分享标题 + @Column(name = "share_title") + private String shareTitle; + + // 文章分享简介 + @Column(name = "share_synopsis") + private String shareSynopsis; + + // 浏览次数 + @Column(name = "visit") + private String visit; + + // 排序 + @Column(name = "sort",nullable = false) + private Integer sort; + + // 原文链接 + @Column(name = "url") + private String url; + + // 状态 + @Column(name = "status",nullable = false) + private Integer status; + + // 添加时间 + @Column(name = "add_time",nullable = false) + private String addTime; + + // 是否隐藏 + @Column(name = "hide",nullable = false) + private Integer hide; + + // 管理员id + @Column(name = "admin_id",nullable = false) + private Integer adminId; + + // 商户id + @Column(name = "mer_id") + private Integer merId; + + // 产品关联id + @Column(name = "product_id",nullable = false) + private Integer productId; + + // 是否热门(小程序) + @Column(name = "is_hot",nullable = false) + private Integer isHot; + + // 是否轮播图(小程序) + @Column(name = "is_banner",nullable = false) + private Integer isBanner; + + public void copy(YxArticle source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxCache.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxCache.java new file mode 100644 index 00000000..eb30f668 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxCache.java @@ -0,0 +1,34 @@ +package co.yixiang.modules.wechat.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +import java.io.Serializable; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Entity +@Data +@Table(name="yx_cache") +public class YxCache implements Serializable { + + + @Id + @Column(name = "`key`") + private String key; + + // 缓存数据 + @Column(name = "result") + private String result; + + // 缓存时间 + @Column(name = "add_time") + private Integer addTime; + + public void copy(YxCache source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxSystemConfig.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxSystemConfig.java new file mode 100644 index 00000000..9b769d84 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxSystemConfig.java @@ -0,0 +1,44 @@ +package co.yixiang.modules.wechat.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +import java.io.Serializable; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Entity +@Data +@Table(name="yx_system_config") +public class YxSystemConfig implements Serializable { + + // 配置id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Integer id; + + // 字段名称 + @Column(name = "menu_name",nullable = false) + private String menuName; + + + // 默认值 + @Column(name = "value") + private String value; + + // 排序 + @Column(name = "sort",nullable = false) + private Integer sort; + + // 是否隐藏 + @Column(name = "status",nullable = false) + private Integer status; + + public void copy(YxSystemConfig source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxWechatReply.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxWechatReply.java new file mode 100644 index 00000000..465b583d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/domain/YxWechatReply.java @@ -0,0 +1,47 @@ +package co.yixiang.modules.wechat.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +import java.io.Serializable; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Entity +@Data +@Table(name="yx_wechat_reply") +public class YxWechatReply implements Serializable { + + // 微信关键字回复id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Integer id; + + // 关键字 + @Column(name = "`key`",unique = true,nullable = false) + private String key; + + // 回复类型 + @Column(name = "type",nullable = false) + private String type; + + // 回复数据 + @Column(name = "data",nullable = false) + private String data; + + // 0=不可用 1 =可用 + @Column(name = "status",nullable = false) + private Integer status; + + // 是否隐藏 + @Column(name = "hide",nullable = false) + private Integer hide; + + public void copy(YxWechatReply source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxArticleRepository.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxArticleRepository.java new file mode 100644 index 00000000..62fb1544 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxArticleRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.wechat.repository; + +import co.yixiang.modules.wechat.domain.YxArticle; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-10-07 +*/ +public interface YxArticleRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxCacheRepository.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxCacheRepository.java new file mode 100644 index 00000000..44deb114 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxCacheRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.wechat.repository; + +import co.yixiang.modules.wechat.domain.YxCache; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +public interface YxCacheRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxSystemConfigRepository.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxSystemConfigRepository.java new file mode 100644 index 00000000..3ffa89e7 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxSystemConfigRepository.java @@ -0,0 +1,13 @@ +package co.yixiang.modules.wechat.repository; + +import co.yixiang.modules.wechat.domain.YxSystemConfig; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +public interface YxSystemConfigRepository extends JpaRepository, JpaSpecificationExecutor { + YxSystemConfig findByMenuName(String str); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxWechatReplyRepository.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxWechatReplyRepository.java new file mode 100644 index 00000000..c903aa0d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/repository/YxWechatReplyRepository.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.wechat.repository; + +import co.yixiang.modules.wechat.domain.YxWechatReply; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +public interface YxWechatReplyRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * findByKey + * @param key + * @return + */ + YxWechatReply findByKey(String key); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxArticleController.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxArticleController.java new file mode 100644 index 00000000..4e3d809d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxArticleController.java @@ -0,0 +1,71 @@ +package co.yixiang.modules.wechat.rest; + +import co.yixiang.modules.wechat.service.dto.YxArticleQueryCriteria; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.wechat.domain.YxArticle; +import co.yixiang.modules.wechat.service.YxArticleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.*; + +/** +* @author hupeng +* @date 2019-10-07 +*/ +@Api(tags = "YxArticle管理") +@RestController +@RequestMapping("api") +public class YxArticleController { + + @Autowired + private YxArticleService yxArticleService; + + @Log("查询YxArticle") + @ApiOperation(value = "查询YxArticle") + @GetMapping(value = "/yxArticle") + @PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_SELECT')") + public ResponseEntity getYxArticles(YxArticleQueryCriteria criteria, Pageable pageable){ + System.out.println(yxArticleService.queryAll(criteria,pageable)); + return new ResponseEntity(yxArticleService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("新增YxArticle") + @ApiOperation(value = "新增YxArticle") + @PostMapping(value = "/yxArticle") + @PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_CREATE')") + public ResponseEntity create(@Validated @RequestBody YxArticle resources){ + return new ResponseEntity(yxArticleService.create(resources),HttpStatus.CREATED); + } + + @Log("修改YxArticle") + @ApiOperation(value = "修改YxArticle") + @PutMapping(value = "/yxArticle") + @PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_EDIT')") + public ResponseEntity update(@Validated @RequestBody YxArticle resources){ + yxArticleService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除YxArticle") + @ApiOperation(value = "删除YxArticle") + @DeleteMapping(value = "/yxArticle/{id}") + @PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_DELETE')") + public ResponseEntity delete(@PathVariable Integer id){ + yxArticleService.delete(id); + return new ResponseEntity(HttpStatus.OK); + } + + @ApiOperation(value = "发布文章") + @GetMapping(value = "/yxArticle/publish/{id}") + @PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_DELETE')") + public ResponseEntity publish(@PathVariable Integer id){ + //todo + return new ResponseEntity(HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxCacheController.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxCacheController.java new file mode 100644 index 00000000..d93d0c3c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxCacheController.java @@ -0,0 +1,62 @@ +package co.yixiang.modules.wechat.rest; + +import co.yixiang.modules.wechat.service.YxCacheService; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.wechat.domain.YxCache; +import co.yixiang.utils.OrderUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.*; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Api(tags = "YxCache管理") +@RestController +@RequestMapping("api") +public class YxCacheController { + + @Autowired + private YxCacheService yxCacheService; + + @Log("查询菜单") + @ApiOperation(value = "查询菜单") + @GetMapping(value = "/yxCache") + @PreAuthorize("hasAnyRole('ADMIN','YXCACHE_ALL','YXCACHE_SELECT')") + public ResponseEntity getYxCaches(){ + return new ResponseEntity(yxCacheService.findById("wechat_menus"),HttpStatus.OK); + } + + @Log("创建菜单") + @ApiOperation(value = "创建菜单") + @PostMapping(value = "/yxCache") + @PreAuthorize("hasAnyRole('ADMIN','YXCACHE_ALL','YXCACHE_CREATE')") + public ResponseEntity create(@RequestBody String jsonStr){ + JSONObject jsonObject = JSON.parseObject(jsonStr); + String jsonButton = jsonObject.get("button").toString(); + YxCache yxCache = new YxCache(); + Boolean isExist = yxCacheService.isExist("wechat_menus"); + if(isExist){ + yxCache.setKey("wechat_menus"); + yxCache.setResult(jsonButton); + yxCacheService.update(yxCache); + }else { + yxCache.setKey("wechat_menus"); + yxCache.setResult(jsonButton); + yxCache.setAddTime(OrderUtil.getSecondTimestampTwo()); + yxCacheService.create(yxCache); + } + + return new ResponseEntity(HttpStatus.OK); + } + + + + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxSystemConfigController.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxSystemConfigController.java new file mode 100644 index 00000000..235fdb65 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxSystemConfigController.java @@ -0,0 +1,80 @@ +package co.yixiang.modules.wechat.rest; + +import cn.hutool.core.util.ObjectUtil; +import co.yixiang.modules.wechat.domain.YxSystemConfig; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.wechat.service.YxSystemConfigService; +import co.yixiang.modules.wechat.service.dto.YxSystemConfigQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.*; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Api(tags = "YxSystemConfig管理") +@RestController +@RequestMapping("api") +public class YxSystemConfigController { + + @Autowired + private YxSystemConfigService yxSystemConfigService; + + @Log("查询YxSystemConfig") + @ApiOperation(value = "查询YxSystemConfig") + @GetMapping(value = "/yxSystemConfig") + @PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_SELECT')") + public ResponseEntity getYxSystemConfigs(YxSystemConfigQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity(yxSystemConfigService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("新增YxSystemConfig") + @ApiOperation(value = "新增YxSystemConfig") + @PostMapping(value = "/yxSystemConfig") + @PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_CREATE')") + public ResponseEntity create(@RequestBody String jsonStr){ + JSONObject jsonObject = JSON.parseObject(jsonStr); + jsonObject.forEach( + (key,value)->{ + YxSystemConfig yxSystemConfig = yxSystemConfigService.findByKey(key); + YxSystemConfig yxSystemConfigModel = new YxSystemConfig(); + yxSystemConfigModel.setMenuName(key); + yxSystemConfigModel.setValue(value.toString()); + if(ObjectUtil.isNull(yxSystemConfig)){ + yxSystemConfigService.create(yxSystemConfigModel); + }else{ + yxSystemConfigModel.setId(yxSystemConfig.getId()); + yxSystemConfigService.update(yxSystemConfigModel); + } + } + ); + + return new ResponseEntity(HttpStatus.CREATED); + } + + @Log("修改YxSystemConfig") + @ApiOperation(value = "修改YxSystemConfig") + @PutMapping(value = "/yxSystemConfig") + @PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_EDIT')") + public ResponseEntity update(@Validated @RequestBody YxSystemConfig resources){ + yxSystemConfigService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除YxSystemConfig") + @ApiOperation(value = "删除YxSystemConfig") + @DeleteMapping(value = "/yxSystemConfig/{id}") + @PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_DELETE')") + public ResponseEntity delete(@PathVariable Integer id){ + yxSystemConfigService.delete(id); + return new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxWechatReplyController.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxWechatReplyController.java new file mode 100644 index 00000000..c0e56aff --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/rest/YxWechatReplyController.java @@ -0,0 +1,76 @@ +package co.yixiang.modules.wechat.rest; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.wechat.domain.YxWechatReply; +import co.yixiang.modules.wechat.service.YxWechatReplyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.*; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Api(tags = "YxWechatReply管理") +@RestController +@RequestMapping("api") +public class YxWechatReplyController { + + @Autowired + private YxWechatReplyService yxWechatReplyService; + + @Log("查询") + @ApiOperation(value = "查询") + @GetMapping(value = "/yxWechatReply") + @PreAuthorize("hasAnyRole('ADMIN','YXWECHATREPLY_ALL','YXWECHATREPLY_SELECT')") + public ResponseEntity getYxWechatReplys(){ + return new ResponseEntity(yxWechatReplyService.isExist("subscribe"),HttpStatus.OK); + } + + @Log("新增自动回复") + @ApiOperation(value = "新增自动回复") + @PostMapping(value = "/yxWechatReply") + @PreAuthorize("hasAnyRole('ADMIN','YXWECHATREPLY_ALL','YXWECHATREPLY_CREATE')") + public ResponseEntity create(@RequestBody String jsonStr){ + JSONObject jsonObject = JSON.parseObject(jsonStr); + YxWechatReply yxWechatReply = new YxWechatReply(); + YxWechatReply isExist = yxWechatReplyService.isExist(jsonObject.get("key").toString()); + yxWechatReply.setKey(jsonObject.get("key").toString()); + yxWechatReply.setStatus(Integer.valueOf(jsonObject.get("status").toString())); + yxWechatReply.setData(jsonObject.get("data").toString()); + yxWechatReply.setType(jsonObject.get("type").toString()); + if(ObjectUtil.isNull(isExist)){ + yxWechatReplyService.create(yxWechatReply); + }else{ + yxWechatReply.setId(isExist.getId()); + yxWechatReplyService.update(yxWechatReply); + } + + return new ResponseEntity(HttpStatus.CREATED); + } + + @Log("修改YxWechatReply") + @ApiOperation(value = "修改YxWechatReply") + @PutMapping(value = "/yxWechatReply") + @PreAuthorize("hasAnyRole('ADMIN','YXWECHATREPLY_ALL','YXWECHATREPLY_EDIT')") + public ResponseEntity update(@Validated @RequestBody YxWechatReply resources){ + yxWechatReplyService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除YxWechatReply") + @ApiOperation(value = "删除YxWechatReply") + @DeleteMapping(value = "/yxWechatReply/{id}") + @PreAuthorize("hasAnyRole('ADMIN','YXWECHATREPLY_ALL','YXWECHATREPLY_DELETE')") + public ResponseEntity delete(@PathVariable Integer id){ + yxWechatReplyService.delete(id); + return new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxArticleService.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxArticleService.java new file mode 100644 index 00000000..9bc61c98 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxArticleService.java @@ -0,0 +1,63 @@ +package co.yixiang.modules.wechat.service; + +import co.yixiang.modules.wechat.service.dto.YxArticleQueryCriteria; +import co.yixiang.modules.wechat.domain.YxArticle; +import co.yixiang.modules.wechat.service.dto.YxArticleDTO; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; + +/** +* @author hupeng +* @date 2019-10-07 +*/ +//@CacheConfig(cacheNames = "yxArticle") +public interface YxArticleService { + + /** + * 查询数据分页 + * @param criteria + * @param pageable + * @return + */ + //@Cacheable + Map queryAll(YxArticleQueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria + * @return + */ + //@Cacheable + List queryAll(YxArticleQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxArticleDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxArticleDTO create(YxArticle resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxArticle resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxCacheService.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxCacheService.java new file mode 100644 index 00000000..946f922c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxCacheService.java @@ -0,0 +1,65 @@ +package co.yixiang.modules.wechat.service; + +import co.yixiang.modules.wechat.service.dto.YxCacheDTO; +import co.yixiang.modules.wechat.service.dto.YxCacheQueryCriteria; +import co.yixiang.modules.wechat.domain.YxCache; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +//@CacheConfig(cacheNames = "yxCache") +public interface YxCacheService { + + /** + * 查询数据分页 + * @param criteria + * @param pageable + * @return + */ + //@Cacheable + Map queryAll(YxCacheQueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria + * @return + */ + //@Cacheable + List queryAll(YxCacheQueryCriteria criteria); + + /** + * 根据ID查询 + * @param key + * @return + */ + //@Cacheable(key = "#p0") + YxCacheDTO findById(String key); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxCacheDTO create(YxCache resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxCache resources); + + /** + * 删除 + * @param key + */ + //@CacheEvict(allEntries = true) + void delete(String key); + + boolean isExist(String key); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxSystemConfigService.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxSystemConfigService.java new file mode 100644 index 00000000..60cdd3e1 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxSystemConfigService.java @@ -0,0 +1,65 @@ +package co.yixiang.modules.wechat.service; + +import co.yixiang.modules.wechat.domain.YxSystemConfig; +import co.yixiang.modules.wechat.service.dto.YxSystemConfigDTO; +import co.yixiang.modules.wechat.service.dto.YxSystemConfigQueryCriteria; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +//@CacheConfig(cacheNames = "yxSystemConfig") +public interface YxSystemConfigService { + + /** + * 查询数据分页 + * @param criteria + * @param pageable + * @return + */ + //@Cacheable + Map queryAll(YxSystemConfigQueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria + * @return + */ + //@Cacheable + List queryAll(YxSystemConfigQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxSystemConfigDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxSystemConfigDTO create(YxSystemConfig resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxSystemConfig resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); + + YxSystemConfig findByKey(String str); +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxWechatReplyService.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxWechatReplyService.java new file mode 100644 index 00000000..260f5e71 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/YxWechatReplyService.java @@ -0,0 +1,66 @@ +package co.yixiang.modules.wechat.service; + +import co.yixiang.modules.wechat.domain.YxWechatReply; +import co.yixiang.modules.wechat.service.dto.YxWechatReplyDTO; +import co.yixiang.modules.wechat.service.dto.YxWechatReplyQueryCriteria; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +//@CacheConfig(cacheNames = "yxWechatReply") +public interface YxWechatReplyService { + + /** + * 查询数据分页 + * @param criteria + * @param pageable + * @return + */ + //@Cacheable + Map queryAll(YxWechatReplyQueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria + * @return + */ + //@Cacheable + List queryAll(YxWechatReplyQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxWechatReplyDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxWechatReplyDTO create(YxWechatReply resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxWechatReply resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); + + YxWechatReply isExist(String key); + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxArticleDTO.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxArticleDTO.java new file mode 100644 index 00000000..db4fb4df --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxArticleDTO.java @@ -0,0 +1,72 @@ +package co.yixiang.modules.wechat.service.dto; + +import lombok.Data; +import java.io.Serializable; + + +/** +* @author hupeng +* @date 2019-10-07 +*/ +@Data +public class YxArticleDTO implements Serializable { + + // 文章管理ID + private Integer id; + + // 分类id + private String cid; + + // 文章标题 + private String title; + + // 文章作者 + private String author; + + // 文章图片 + private String imageInput; + + // 文章简介 + private String synopsis; + + private String content; + + // 文章分享标题 + private String shareTitle; + + // 文章分享简介 + private String shareSynopsis; + + // 浏览次数 + private String visit; + + // 排序 + private Integer sort; + + // 原文链接 + private String url; + + // 状态 + private Integer status; + + // 添加时间 + private String addTime; + + // 是否隐藏 + private Integer hide; + + // 管理员id + private Integer adminId; + + // 商户id + private Integer merId; + + // 产品关联id + private Integer productId; + + // 是否热门(小程序) + private Integer isHot; + + // 是否轮播图(小程序) + private Integer isBanner; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxArticleQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxArticleQueryCriteria.java new file mode 100644 index 00000000..fe97f318 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxArticleQueryCriteria.java @@ -0,0 +1,11 @@ +package co.yixiang.modules.wechat.service.dto; + +import lombok.Data; + +/** +* @author hupeng +* @date 2019-10-07 +*/ +@Data +public class YxArticleQueryCriteria{ +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxCacheDTO.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxCacheDTO.java new file mode 100644 index 00000000..77293255 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxCacheDTO.java @@ -0,0 +1,21 @@ +package co.yixiang.modules.wechat.service.dto; + +import lombok.Data; +import java.io.Serializable; + + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Data +public class YxCacheDTO implements Serializable { + + private String key; + + // 缓存数据 + private String result; + + // 缓存时间 + private Integer addTime; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxCacheQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxCacheQueryCriteria.java new file mode 100644 index 00000000..7ae6e98b --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxCacheQueryCriteria.java @@ -0,0 +1,11 @@ +package co.yixiang.modules.wechat.service.dto; + +import lombok.Data; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Data +public class YxCacheQueryCriteria{ +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxSystemConfigDTO.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxSystemConfigDTO.java new file mode 100644 index 00000000..ee4069cc --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxSystemConfigDTO.java @@ -0,0 +1,29 @@ +package co.yixiang.modules.wechat.service.dto; + +import lombok.Data; +import java.io.Serializable; + + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Data +public class YxSystemConfigDTO implements Serializable { + + // 配置id + private Integer id; + + // 字段名称 + private String menuName; + + + // 默认值 + private String value; + + // 排序 + private Integer sort; + + // 是否隐藏 + private Integer status; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxSystemConfigQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxSystemConfigQueryCriteria.java new file mode 100644 index 00000000..541ed7f1 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxSystemConfigQueryCriteria.java @@ -0,0 +1,11 @@ +package co.yixiang.modules.wechat.service.dto; + +import lombok.Data; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Data +public class YxSystemConfigQueryCriteria{ +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxWechatReplyDTO.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxWechatReplyDTO.java new file mode 100644 index 00000000..e0185a13 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxWechatReplyDTO.java @@ -0,0 +1,31 @@ +package co.yixiang.modules.wechat.service.dto; + +import lombok.Data; +import java.io.Serializable; + + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Data +public class YxWechatReplyDTO implements Serializable { + + // 微信关键字回复id + private Integer id; + + // 关键字 + private String key; + + // 回复类型 + private String type; + + // 回复数据 + private String data; + + // 0=不可用 1 =可用 + private Integer status; + + // 是否隐藏 + private Integer hide; +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxWechatReplyQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxWechatReplyQueryCriteria.java new file mode 100644 index 00000000..dd78ae15 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/dto/YxWechatReplyQueryCriteria.java @@ -0,0 +1,11 @@ +package co.yixiang.modules.wechat.service.dto; + +import lombok.Data; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Data +public class YxWechatReplyQueryCriteria{ +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxArticleServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxArticleServiceImpl.java new file mode 100644 index 00000000..8c3e8be9 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxArticleServiceImpl.java @@ -0,0 +1,77 @@ +package co.yixiang.modules.wechat.service.impl; + +import co.yixiang.modules.wechat.repository.YxArticleRepository; +import co.yixiang.modules.wechat.service.YxArticleService; +import co.yixiang.modules.wechat.service.dto.YxArticleQueryCriteria; +import co.yixiang.modules.wechat.domain.YxArticle; +import co.yixiang.utils.OrderUtil; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.wechat.service.dto.YxArticleDTO; +import co.yixiang.modules.wechat.service.mapper.YxArticleMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import java.util.List; +import java.util.Map; + +/** +* @author hupeng +* @date 2019-10-07 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxArticleServiceImpl implements YxArticleService { + + @Autowired + private YxArticleRepository yxArticleRepository; + + @Autowired + private YxArticleMapper yxArticleMapper; + + @Override + public Map queryAll(YxArticleQueryCriteria criteria, Pageable pageable){ + Page page = yxArticleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxArticleMapper::toDto)); + } + + @Override + public List queryAll(YxArticleQueryCriteria criteria){ + return yxArticleMapper.toDto(yxArticleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxArticleDTO findById(Integer id) { + Optional yxArticle = yxArticleRepository.findById(id); + ValidationUtil.isNull(yxArticle,"YxArticle","id",id); + return yxArticleMapper.toDto(yxArticle.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxArticleDTO create(YxArticle resources) { + resources.setAddTime(String.valueOf(OrderUtil.getSecondTimestampTwo())); + return yxArticleMapper.toDto(yxArticleRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxArticle resources) { + Optional optionalYxArticle = yxArticleRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxArticle,"YxArticle","id",resources.getId()); + YxArticle yxArticle = optionalYxArticle.get(); + yxArticle.copy(resources); + yxArticleRepository.save(yxArticle); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxArticleRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxCacheServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxCacheServiceImpl.java new file mode 100644 index 00000000..0fa1054b --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxCacheServiceImpl.java @@ -0,0 +1,86 @@ +package co.yixiang.modules.wechat.service.impl; + +import co.yixiang.modules.wechat.service.dto.YxCacheDTO; +import co.yixiang.modules.wechat.service.dto.YxCacheQueryCriteria; +import co.yixiang.modules.wechat.domain.YxCache; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.wechat.repository.YxCacheRepository; +import co.yixiang.modules.wechat.service.YxCacheService; +import co.yixiang.modules.wechat.service.mapper.YxCacheMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import java.util.List; +import java.util.Map; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxCacheServiceImpl implements YxCacheService { + + @Autowired + private YxCacheRepository yxCacheRepository; + + @Autowired + private YxCacheMapper yxCacheMapper; + + @Override + public Map queryAll(YxCacheQueryCriteria criteria, Pageable pageable){ + Page page = yxCacheRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxCacheMapper::toDto)); + } + + @Override + public List queryAll(YxCacheQueryCriteria criteria){ + return yxCacheMapper.toDto(yxCacheRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxCacheDTO findById(String key) { + Optional yxCache = yxCacheRepository.findById(key); + ValidationUtil.isNull(yxCache,"YxCache","key",key); + return yxCacheMapper.toDto(yxCache.get()); + } + + @Override + public boolean isExist(String key) { + Optional yxCache = yxCacheRepository.findById(key); + if(!yxCache.isPresent()){ + return false; + } + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxCacheDTO create(YxCache resources) { + //resources.setKey(IdUtil.simpleUUID()); + return yxCacheMapper.toDto(yxCacheRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxCache resources) { + Optional optionalYxCache = yxCacheRepository.findById(resources.getKey()); + ValidationUtil.isNull( optionalYxCache,"YxCache","id",resources.getKey()); + YxCache yxCache = optionalYxCache.get(); + yxCache.copy(resources); + yxCacheRepository.save(yxCache); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String key) { + yxCacheRepository.deleteById(key); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxSystemConfigServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxSystemConfigServiceImpl.java new file mode 100644 index 00000000..d684bd90 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxSystemConfigServiceImpl.java @@ -0,0 +1,80 @@ +package co.yixiang.modules.wechat.service.impl; + +import co.yixiang.modules.wechat.domain.YxSystemConfig; +import co.yixiang.modules.wechat.repository.YxSystemConfigRepository; +import co.yixiang.modules.wechat.service.YxSystemConfigService; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.wechat.service.dto.YxSystemConfigDTO; +import co.yixiang.modules.wechat.service.dto.YxSystemConfigQueryCriteria; +import co.yixiang.modules.wechat.service.mapper.YxSystemConfigMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import java.util.List; +import java.util.Map; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxSystemConfigServiceImpl implements YxSystemConfigService { + + @Autowired + private YxSystemConfigRepository yxSystemConfigRepository; + + @Autowired + private YxSystemConfigMapper yxSystemConfigMapper; + + @Override + public Map queryAll(YxSystemConfigQueryCriteria criteria, Pageable pageable){ + Page page = yxSystemConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxSystemConfigMapper::toDto)); + } + + @Override + public List queryAll(YxSystemConfigQueryCriteria criteria){ + return yxSystemConfigMapper.toDto(yxSystemConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxSystemConfigDTO findById(Integer id) { + Optional yxSystemConfig = yxSystemConfigRepository.findById(id); + ValidationUtil.isNull(yxSystemConfig,"YxSystemConfig","id",id); + return yxSystemConfigMapper.toDto(yxSystemConfig.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxSystemConfigDTO create(YxSystemConfig resources) { + return yxSystemConfigMapper.toDto(yxSystemConfigRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxSystemConfig resources) { + Optional optionalYxSystemConfig = yxSystemConfigRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxSystemConfig,"YxSystemConfig","id",resources.getId()); + YxSystemConfig yxSystemConfig = optionalYxSystemConfig.get(); + yxSystemConfig.copy(resources); + yxSystemConfigRepository.save(yxSystemConfig); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxSystemConfigRepository.deleteById(id); + } + + @Override + public YxSystemConfig findByKey(String str) { + return yxSystemConfigRepository.findByMenuName(str); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxWechatReplyServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxWechatReplyServiceImpl.java new file mode 100644 index 00000000..24d2a525 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/impl/YxWechatReplyServiceImpl.java @@ -0,0 +1,92 @@ +package co.yixiang.modules.wechat.service.impl; + +import co.yixiang.modules.wechat.repository.YxWechatReplyRepository; +import co.yixiang.modules.wechat.service.YxWechatReplyService; +import co.yixiang.modules.wechat.service.dto.YxWechatReplyDTO; +import co.yixiang.modules.wechat.service.dto.YxWechatReplyQueryCriteria; +import co.yixiang.modules.wechat.service.mapper.YxWechatReplyMapper; +import co.yixiang.modules.wechat.domain.YxWechatReply; +import co.yixiang.exception.EntityExistException; +import co.yixiang.utils.ValidationUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import java.util.List; +import java.util.Map; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class YxWechatReplyServiceImpl implements YxWechatReplyService { + + @Autowired + private YxWechatReplyRepository yxWechatReplyRepository; + + @Autowired + private YxWechatReplyMapper yxWechatReplyMapper; + + @Override + public Map queryAll(YxWechatReplyQueryCriteria criteria, Pageable pageable){ + Page page = yxWechatReplyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxWechatReplyMapper::toDto)); + } + + @Override + public List queryAll(YxWechatReplyQueryCriteria criteria){ + return yxWechatReplyMapper.toDto(yxWechatReplyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxWechatReplyDTO findById(Integer id) { + Optional yxWechatReply = yxWechatReplyRepository.findById(id); + ValidationUtil.isNull(yxWechatReply,"YxWechatReply","id",id); + return yxWechatReplyMapper.toDto(yxWechatReply.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxWechatReplyDTO create(YxWechatReply resources) { + if(yxWechatReplyRepository.findByKey(resources.getKey()) != null){ + throw new EntityExistException(YxWechatReply.class,"key",resources.getKey()); + } + return yxWechatReplyMapper.toDto(yxWechatReplyRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxWechatReply resources) { + Optional optionalYxWechatReply = yxWechatReplyRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxWechatReply,"YxWechatReply","id",resources.getId()); + YxWechatReply yxWechatReply = optionalYxWechatReply.get(); + YxWechatReply yxWechatReply1 = null; + yxWechatReply1 = yxWechatReplyRepository.findByKey(resources.getKey()); + if(yxWechatReply1 != null && !yxWechatReply1.getId().equals(yxWechatReply.getId())){ + throw new EntityExistException(YxWechatReply.class,"key",resources.getKey()); + } + yxWechatReply.copy(resources); + yxWechatReplyRepository.save(yxWechatReply); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxWechatReplyRepository.deleteById(id); + } + + + @Override + public YxWechatReply isExist(String key) { + YxWechatReply yxWechatReply = yxWechatReplyRepository.findByKey(key); + + return yxWechatReply; + } +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxArticleMapper.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxArticleMapper.java new file mode 100644 index 00000000..d8e11968 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxArticleMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.wechat.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.wechat.domain.YxArticle; +import co.yixiang.modules.wechat.service.dto.YxArticleDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-07 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxArticleMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxCacheMapper.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxCacheMapper.java new file mode 100644 index 00000000..4750b563 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxCacheMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.wechat.service.mapper; + +import co.yixiang.modules.wechat.service.dto.YxCacheDTO; +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.wechat.domain.YxCache; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxCacheMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxSystemConfigMapper.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxSystemConfigMapper.java new file mode 100644 index 00000000..34cc695a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxSystemConfigMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.wechat.service.mapper; + +import co.yixiang.modules.wechat.domain.YxSystemConfig; +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.wechat.service.dto.YxSystemConfigDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxSystemConfigMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxWechatReplyMapper.java b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxWechatReplyMapper.java new file mode 100644 index 00000000..1d078083 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/wechat/service/mapper/YxWechatReplyMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.wechat.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.wechat.domain.YxWechatReply; +import co.yixiang.modules.wechat.service.dto.YxWechatReplyDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-10 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxWechatReplyMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/banner.txt b/yshop-system/src/main/resources/banner.txt new file mode 100644 index 00000000..4dac28d9 --- /dev/null +++ b/yshop-system/src/main/resources/banner.txt @@ -0,0 +1,15 @@ + + __ __ ___ _ _ ___ _ __ + \ \ / // __|| | | | / _ \ | '_ \ + \ \/ / \__ \| |--| || (_) || |_) | + \/ / |___/|_| |_| \___/ | .__/ + / / | | + /_/ |_| + + + + :: Spring Boot :: (v2.1.0.RELEASE) + + + + diff --git a/yshop-system/src/main/resources/config/application-dev.yml b/yshop-system/src/main/resources/config/application-dev.yml new file mode 100644 index 00000000..36c59fa9 --- /dev/null +++ b/yshop-system/src/main/resources/config/application-dev.yml @@ -0,0 +1,70 @@ +#配置数据源 +spring: + datasource: + druid: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + url: jdbc:log4jdbc:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false + username: root + password: root + + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + + validation-query: select 1 + # 配置监控统计拦截的filters + filters: stat + stat-view-servlet: + url-pattern: /druid/* + reset-enable: false + + web-stat-filter: + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" + + #配置 Jpa + jpa: + hibernate: + # 生产环境设置成 none,避免程序运行时自动更新数据库结构 + ddl-auto: update + +#jwt +jwt: + header: Authorization + secret: mySecret + # token 过期时间 6个小时 + expiration: 21000000 + auth: + # 授权路径 + path: /login + # 获取用户信息 + account: /info + +#是否允许生成代码,生产环境设置为false +generator: + enabled: true + +#是否开启 swagger-ui +swagger: + enabled: true + +# 文件存储路径 +file: + path: E:\yashop\file\ + avatar: E:\yashop\avatar\ + # 文件大小 /M + maxSize: 100 + avatarMaxSize: 5 \ No newline at end of file diff --git a/yshop-system/src/main/resources/config/application-prod.yml b/yshop-system/src/main/resources/config/application-prod.yml new file mode 100644 index 00000000..a1ae2b74 --- /dev/null +++ b/yshop-system/src/main/resources/config/application-prod.yml @@ -0,0 +1,79 @@ +#配置数据源 +spring: + datasource: + druid: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + url: jdbc:log4jdbc:mysql://localhost:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false + username: root + password: 123456 + + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + validation-query: select 1 + # 配置监控统计拦截的filters + filters: stat + + stat-view-servlet: + url-pattern: /druid/* + reset-enable: false + login-username: admin + login-password: 123456 + + web-stat-filter: + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" + + #配置 Jpa + jpa: + hibernate: + # 生产环境设置成 none,避免程序运行时自动更新数据库结构 + ddl-auto: none + +#jwt +jwt: + header: Authorization + secret: mySecret + # token 过期时间 2个小时 + expiration: 7200000 + auth: + # 授权路径 + path: /login + # 获取用户信息 + account: /info + +#是否允许生成代码,生产环境设置为false +generator: + enabled: false + +#如果生产环境要开启swagger,需要配置请求地址 +#springfox: +# documentation: +# swagger: +# v2: +# host: # 接口域名或外网ip + +#是否开启 swagger-ui +swagger: + enabled: false + +# 文件存储路径 +file: + path: /home/eladmin/file/ + avatar: /home/eladmin/avatar/ + # 文件大小 /M + maxSize: 100 + avatarMaxSize: 5 \ No newline at end of file diff --git a/yshop-system/src/main/resources/config/application.yml b/yshop-system/src/main/resources/config/application.yml new file mode 100644 index 00000000..c45c9529 --- /dev/null +++ b/yshop-system/src/main/resources/config/application.yml @@ -0,0 +1,43 @@ +server: + port: 8000 + +spring: + freemarker: + check-template-location: false + profiles: + active: dev + jackson: + time-zone: GMT+8 + data: + redis: + repositories: + enabled: false + + #配置 Jpa + jpa: + properties: + hibernate: + dialect: org.hibernate.dialect.MySQL5InnoDBDialect + open-in-view: true + + redis: + #数据库索引 + database: 0 + host: 127.0.0.1 + port: 6379 + password: + #连接超时时间 + timeout: 5000 + +#七牛云 +qiniu: + # 文件大小 /M + max-size: 15 + +#邮箱验证码有效时间/分钟 +code: + expiration: 5 + +#登录图形验证码有效时间/分钟 +loginCode: + expiration: 2 \ No newline at end of file diff --git a/yshop-system/src/main/resources/generator.properties b/yshop-system/src/main/resources/generator.properties new file mode 100644 index 00000000..2ed93706 --- /dev/null +++ b/yshop-system/src/main/resources/generator.properties @@ -0,0 +1,27 @@ +#数据库类型转Java类型 +tinyint=Integer +smallint=Integer +mediumint=Integer +int=Integer +integer=Integer + +bigint=Long + +float=Float + +double=Double + +decimal=BigDecimal + +bit=Boolean + +char=String +varchar=String +tinytext=String +text=String +mediumtext=String +longtext=String + +date=Timestamp +datetime=Timestamp +timestamp=Timestamp \ No newline at end of file diff --git a/yshop-system/src/main/resources/ip2region/ip2region.db b/yshop-system/src/main/resources/ip2region/ip2region.db new file mode 100644 index 00000000..43e1daf5 Binary files /dev/null and b/yshop-system/src/main/resources/ip2region/ip2region.db differ diff --git a/yshop-system/src/main/resources/log4jdbc.log4j2.properties b/yshop-system/src/main/resources/log4jdbc.log4j2.properties new file mode 100644 index 00000000..302525ff --- /dev/null +++ b/yshop-system/src/main/resources/log4jdbc.log4j2.properties @@ -0,0 +1,4 @@ +# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger +log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator +log4jdbc.auto.load.popular.drivers=false +log4jdbc.drivers=com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/yshop-system/src/main/resources/logback.xml b/yshop-system/src/main/resources/logback.xml new file mode 100644 index 00000000..ec1ccfa3 --- /dev/null +++ b/yshop-system/src/main/resources/logback.xml @@ -0,0 +1,43 @@ + + + elAdmin + + + + + %black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n) + utf-8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/email/email.ftl b/yshop-system/src/main/resources/template/email/email.ftl new file mode 100644 index 00000000..3a186358 --- /dev/null +++ b/yshop-system/src/main/resources/template/email/email.ftl @@ -0,0 +1,55 @@ + + + + + + + +
+
+

尊敬的用户,您好:

+

您正在申请邮箱验证,您的验证码为:

+

${code}

+ +
+
+
+ Copyright ©${.now?string("yyyy")} EL-ADMIN 后台管理系统 All Rights Reserved. +
+ +
+
+ + diff --git a/yshop-system/src/main/resources/template/generator/admin/Controller.ftl b/yshop-system/src/main/resources/template/generator/admin/Controller.ftl new file mode 100644 index 00000000..521c43bb --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/admin/Controller.ftl @@ -0,0 +1,61 @@ +package ${package}.rest; + +import co.yixiang.aop.log.Log; +import ${package}.domain.${className}; +import ${package}.service.${className}Service; +import ${package}.service.dto.${className}QueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.*; + +/** +* @author ${author} +* @date ${date} +*/ +@Api(tags = "${className}管理") +@RestController +@RequestMapping("api") +public class ${className}Controller { + + @Autowired + private ${className}Service ${changeClassName}Service; + + @Log("查询${className}") + @ApiOperation(value = "查询${className}") + @GetMapping(value = "/${changeClassName}") + @PreAuthorize("hasAnyRole('ADMIN','${upperCaseClassName}_ALL','${upperCaseClassName}_SELECT')") + public ResponseEntity get${className}s(${className}QueryCriteria criteria, Pageable pageable){ + return new ResponseEntity(${changeClassName}Service.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("新增${className}") + @ApiOperation(value = "新增${className}") + @PostMapping(value = "/${changeClassName}") + @PreAuthorize("hasAnyRole('ADMIN','${upperCaseClassName}_ALL','${upperCaseClassName}_CREATE')") + public ResponseEntity create(@Validated @RequestBody ${className} resources){ + return new ResponseEntity(${changeClassName}Service.create(resources),HttpStatus.CREATED); + } + + @Log("修改${className}") + @ApiOperation(value = "修改${className}") + @PutMapping(value = "/${changeClassName}") + @PreAuthorize("hasAnyRole('ADMIN','${upperCaseClassName}_ALL','${upperCaseClassName}_EDIT')") + public ResponseEntity update(@Validated @RequestBody ${className} resources){ + ${changeClassName}Service.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @Log("删除${className}") + @ApiOperation(value = "删除${className}") + @DeleteMapping(value = "/${changeClassName}/{${pkChangeColName}}") + @PreAuthorize("hasAnyRole('ADMIN','${upperCaseClassName}_ALL','${upperCaseClassName}_DELETE')") + public ResponseEntity delete(@PathVariable ${pkColumnType} ${pkChangeColName}){ + ${changeClassName}Service.delete(${pkChangeColName}); + return new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/Dto.ftl b/yshop-system/src/main/resources/template/generator/admin/Dto.ftl new file mode 100644 index 00000000..d57910b4 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/admin/Dto.ftl @@ -0,0 +1,38 @@ +package ${package}.service.dto; + +import lombok.Data; +<#if hasTimestamp> +import java.sql.Timestamp; + +<#if hasBigDecimal> +import java.math.BigDecimal; + +import java.io.Serializable; +<#if !auto && pkColumnType = 'Long'> +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + + + +/** +* @author ${author} +* @date ${date} +*/ +@Data +public class ${className}DTO implements Serializable { +<#if columns??> + <#list columns as column> + + <#if column.columnComment != ''> + // ${column.columnComment} + + <#if column.columnKey = 'PRI'> + <#if !auto && pkColumnType = 'Long'> + // 处理精度丢失问题 + @JsonSerialize(using= ToStringSerializer.class) + + + private ${column.columnType} ${column.changeColumnName}; + + +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/Entity.ftl b/yshop-system/src/main/resources/template/generator/admin/Entity.ftl new file mode 100644 index 00000000..5bf7eab4 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/admin/Entity.ftl @@ -0,0 +1,43 @@ +package ${package}.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +<#if hasTimestamp> +import java.sql.Timestamp; + +<#if hasBigDecimal> +import java.math.BigDecimal; + +import java.io.Serializable; + +/** +* @author ${author} +* @date ${date} +*/ +@Entity +@Data +@Table(name="${tableName}") +public class ${className} implements Serializable { +<#if columns??> + <#list columns as column> + + <#if column.columnComment != ''> + // ${column.columnComment} + + <#if column.columnKey = 'PRI'> + @Id + <#if auto> + @GeneratedValue(strategy = GenerationType.IDENTITY) + + + @Column(name = "${column.columnName}"<#if column.columnKey = 'UNI'>,unique = true<#if column.isNullable = 'NO' && column.columnKey != 'PRI'>,nullable = false) + private ${column.columnType} ${column.changeColumnName}; + + + + public void copy(${className} source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/Mapper.ftl b/yshop-system/src/main/resources/template/generator/admin/Mapper.ftl new file mode 100644 index 00000000..557ebf71 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/admin/Mapper.ftl @@ -0,0 +1,16 @@ +package ${package}.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import ${package}.domain.${className}; +import ${package}.service.dto.${className}DTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author ${author} +* @date ${date} +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface ${className}Mapper extends EntityMapper<${className}DTO, ${className}> { + +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/QueryCriteria.ftl b/yshop-system/src/main/resources/template/generator/admin/QueryCriteria.ftl new file mode 100644 index 00000000..a11226df --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/admin/QueryCriteria.ftl @@ -0,0 +1,34 @@ +package ${package}.service.dto; + +import lombok.Data; +<#if hasTimestamp> +import java.sql.Timestamp; + +<#if hasBigDecimal> +import java.math.BigDecimal; + +<#if queryColumns??> +import co.yixiang.annotation.Query; + + +/** +* @author ${author} +* @date ${date} +*/ +@Data +public class ${className}QueryCriteria{ +<#if queryColumns??> + <#list queryColumns as column> + + <#if column.columnQuery = '1'> + // 模糊 + @Query(type = Query.Type.INNER_LIKE) + + <#if column.columnQuery = '2'> + // 精确 + @Query + + private ${column.columnType} ${column.changeColumnName}; + + +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/Repository.ftl b/yshop-system/src/main/resources/template/generator/admin/Repository.ftl new file mode 100644 index 00000000..9b896818 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/admin/Repository.ftl @@ -0,0 +1,25 @@ +package ${package}.repository; + +import ${package}.domain.${className}; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author ${author} +* @date ${date} +*/ +public interface ${className}Repository extends JpaRepository<${className}, ${pkColumnType}>, JpaSpecificationExecutor { +<#if columns??> + <#list columns as column> + <#if column.columnKey = 'UNI'> + + /** + * findBy${column.capitalColumnName} + * @param ${column.columnName} + * @return + */ + ${className} findBy${column.capitalColumnName}(${column.columnType} ${column.columnName}); + + + +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/Service.ftl b/yshop-system/src/main/resources/template/generator/admin/Service.ftl new file mode 100644 index 00000000..ba236c16 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/admin/Service.ftl @@ -0,0 +1,66 @@ +package ${package}.service; + +import ${package}.domain.${className}; +import ${package}.service.dto.${className}DTO; +import ${package}.service.dto.${className}QueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; + +/** +* @author ${author} +* @date ${date} +*/ +//@CacheConfig(cacheNames = "${changeClassName}") +public interface ${className}Service { + + /** + * 查询数据分页 + * @param criteria + * @param pageable + * @return + */ + //@Cacheable + Map queryAll(${className}QueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria + * @return + */ + //@Cacheable + List<${className}DTO> queryAll(${className}QueryCriteria criteria); + + /** + * 根据ID查询 + * @param ${pkChangeColName} + * @return + */ + //@Cacheable(key = "#p0") + ${className}DTO findById(${pkColumnType} ${pkChangeColName}); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + ${className}DTO create(${className} resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(${className} resources); + + /** + * 删除 + * @param ${pkChangeColName} + */ + //@CacheEvict(allEntries = true) + void delete(${pkColumnType} ${pkChangeColName}); +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/ServiceImpl.ftl b/yshop-system/src/main/resources/template/generator/admin/ServiceImpl.ftl new file mode 100644 index 00000000..77f11a33 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/admin/ServiceImpl.ftl @@ -0,0 +1,120 @@ +package ${package}.service.impl; + +import ${package}.domain.${className}; +<#if columns??> + <#list columns as column> + <#if column.columnKey = 'UNI'> + <#if column_index = 1> +import EntityExistException; + + + + +import co.yixiang.utils.ValidationUtil; +import ${package}.repository.${className}Repository; +import ${package}.service.${className}Service; +import ${package}.service.dto.${className}DTO; +import ${package}.service.dto.${className}QueryCriteria; +import ${package}.service.mapper.${className}Mapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; +<#if !auto && pkColumnType = 'Long'> +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.IdUtil; + +<#if !auto && pkColumnType = 'String'> +import cn.hutool.core.util.IdUtil; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import java.util.List; +import java.util.Map; + +/** +* @author ${author} +* @date ${date} +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class ${className}ServiceImpl implements ${className}Service { + + @Autowired + private ${className}Repository ${changeClassName}Repository; + + @Autowired + private ${className}Mapper ${changeClassName}Mapper; + + @Override + public Map queryAll(${className}QueryCriteria criteria, Pageable pageable){ + Page<${className}> page = ${changeClassName}Repository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(${changeClassName}Mapper::toDto)); + } + + @Override + public List<${className}DTO> queryAll(${className}QueryCriteria criteria){ + return ${changeClassName}Mapper.toDto(${changeClassName}Repository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public ${className}DTO findById(${pkColumnType} ${pkChangeColName}) { + Optional<${className}> ${changeClassName} = ${changeClassName}Repository.findById(${pkChangeColName}); + ValidationUtil.isNull(${changeClassName},"${className}","${pkChangeColName}",${pkChangeColName}); + return ${changeClassName}Mapper.toDto(${changeClassName}.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public ${className}DTO create(${className} resources) { +<#if !auto && pkColumnType = 'Long'> + Snowflake snowflake = IdUtil.createSnowflake(1, 1); + resources.set${pkCapitalColName}(snowflake.nextId()); + +<#if !auto && pkColumnType = 'String'> + resources.set${pkCapitalColName}(IdUtil.simpleUUID()); + +<#if columns??> + <#list columns as column> + <#if column.columnKey = 'UNI'> + if(${changeClassName}Repository.findBy${column.capitalColumnName}(resources.get${column.capitalColumnName}()) != null){ + throw new EntityExistException(${className}.class,"${column.columnName}",resources.get${column.capitalColumnName}()); + } + + + + return ${changeClassName}Mapper.toDto(${changeClassName}Repository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(${className} resources) { + Optional<${className}> optional${className} = ${changeClassName}Repository.findById(resources.get${pkCapitalColName}()); + ValidationUtil.isNull( optional${className},"${className}","id",resources.get${pkCapitalColName}()); + ${className} ${changeClassName} = optional${className}.get(); +<#if columns??> + <#list columns as column> + <#if column.columnKey = 'UNI'> + <#if column_index = 1> + ${className} ${changeClassName}1 = null; + + ${changeClassName}1 = ${changeClassName}Repository.findBy${column.capitalColumnName}(resources.get${column.capitalColumnName}()); + if(${changeClassName}1 != null && !${changeClassName}1.get${pkCapitalColName}().equals(${changeClassName}.get${pkCapitalColName}())){ + throw new EntityExistException(${className}.class,"${column.columnName}",resources.get${column.capitalColumnName}()); + } + + + + ${changeClassName}.copy(resources); + ${changeClassName}Repository.save(${changeClassName}); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(${pkColumnType} ${pkChangeColName}) { + ${changeClassName}Repository.deleteById(${pkChangeColName}); + } +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/front/api.ftl b/yshop-system/src/main/resources/template/generator/front/api.ftl new file mode 100644 index 00000000..a39d3bc7 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/front/api.ftl @@ -0,0 +1,24 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/${changeClassName}', + method: 'post', + data + }) +} + +export function del(${pkChangeColName}) { + return request({ + url: 'api/${changeClassName}/' + ${pkChangeColName}, + method: 'delete' + }) +} + +export function edit(data) { + return request({ + url: 'api/${changeClassName}', + method: 'put', + data + }) +} diff --git a/yshop-system/src/main/resources/template/generator/front/eForm.ftl b/yshop-system/src/main/resources/template/generator/front/eForm.ftl new file mode 100644 index 00000000..1e8fbcd9 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/front/eForm.ftl @@ -0,0 +1,108 @@ + + + + + diff --git a/yshop-system/src/main/resources/template/generator/front/index.ftl b/yshop-system/src/main/resources/template/generator/front/index.ftl new file mode 100644 index 00000000..c5e6ab88 --- /dev/null +++ b/yshop-system/src/main/resources/template/generator/front/index.ftl @@ -0,0 +1,160 @@ +<#--noinspection ALL--> + + + + + diff --git a/yshop-system/src/test/java/co/yixiang/EladminSystemApplicationTests.java b/yshop-system/src/test/java/co/yixiang/EladminSystemApplicationTests.java new file mode 100644 index 00000000..d0fc4b07 --- /dev/null +++ b/yshop-system/src/test/java/co/yixiang/EladminSystemApplicationTests.java @@ -0,0 +1,17 @@ +package co.yixiang; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class EladminSystemApplicationTests { + + @Test + public void contextLoads() { + } + +} + diff --git a/yshop-tools/pom.xml b/yshop-tools/pom.xml new file mode 100644 index 00000000..63288951 --- /dev/null +++ b/yshop-tools/pom.xml @@ -0,0 +1,57 @@ + + + + yshop + co.yixiang + 1.0 + + 4.0.0 + + yshop-tools + 工具模块 + + + 1.4.7 + [7.2.0, 7.2.99] + 3.1.0 + + + + + + co.yixiang + yshop-logging + 1.0 + + + + + javax.mail + mail + ${mail.version} + + + + + com.qiniu + qiniu-java-sdk + ${qiniu.version} + + + + + com.alipay.sdk + alipay-sdk-java + ${alipay.version} + + + + com.google.code.gson + gson + 2.8.5 + + + + \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/config/MultipartConfig.java b/yshop-tools/src/main/java/co/yixiang/config/MultipartConfig.java new file mode 100644 index 00000000..f45af7a2 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/config/MultipartConfig.java @@ -0,0 +1,30 @@ +package co.yixiang.config; + +import org.springframework.boot.web.servlet.MultipartConfigFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import javax.servlet.MultipartConfigElement; +import java.io.File; + +/** + * @date 2018-12-28 + * @author https://blog.csdn.net/llibin1024530411/article/details/79474953 + */ +@Configuration +public class MultipartConfig { + + /** + * 文件上传临时路径 + */ + @Bean + MultipartConfigElement multipartConfigElement() { + MultipartConfigFactory factory = new MultipartConfigFactory(); + String location = System.getProperty("user.home") + "/.eladmin/file/tmp"; + File tmpFile = new File(location); + if (!tmpFile.exists()) { + tmpFile.mkdirs(); + } + factory.setLocation(location); + return factory.createMultipartConfig(); + } +} \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/domain/AlipayConfig.java b/yshop-tools/src/main/java/co/yixiang/domain/AlipayConfig.java new file mode 100644 index 00000000..ba0a264b --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/AlipayConfig.java @@ -0,0 +1,85 @@ +package co.yixiang.domain; + +import lombok.Data; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 支付宝配置类 + * @author Zheng Jie + * @date 2018-12-31 + */ +@Data +@Entity +@Table(name = "alipay_config") +public class AlipayConfig implements Serializable { + + @Id + private Long id; + + /** + * 应用ID,APPID,收款账号既是APPID对应支付宝账号 + */ + @NotBlank + @Column(name = "app_id") + private String appID; + + /** + * 商户私钥,您的PKCS8格式RSA2私钥 + */ + @NotBlank + @Column(name = "private_key", columnDefinition = "text") + private String privateKey; + + /** + * 支付宝公钥 + */ + @NotBlank + @Column(name = "public_key", columnDefinition = "text") + private String publicKey; + + /** + * 签名方式,固定格式 + */ + @Column(name = "sign_type") + private String signType="RSA2"; + + /** + * 支付宝开放安全地址,一般不会变 + */ + @Column(name = "gateway_url") + private String gatewayUrl = "https://openapi.alipaydev.com/gateway.do"; + + /** + * 编码,固定格式 + */ + private String charset= "utf-8"; + + /** + * 异步通知地址 + */ + @NotBlank + @Column(name = "notify_url") + private String notifyUrl; + + /** + * 订单完成后返回的页面 + */ + @NotBlank + @Column(name = "return_url") + private String returnUrl; + + /** + * 类型,固定格式 + */ + private String format="JSON"; + + /** + * 商户号 + */ + @NotBlank + @Column(name = "sys_service_provider_id") + private String sysServiceProviderId; + +} diff --git a/yshop-tools/src/main/java/co/yixiang/domain/EmailConfig.java b/yshop-tools/src/main/java/co/yixiang/domain/EmailConfig.java new file mode 100644 index 00000000..006f99e7 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/EmailConfig.java @@ -0,0 +1,49 @@ +package co.yixiang.domain; + +import lombok.Data; + +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 邮件配置类,数据存覆盖式存入数据存 + * @author Zheng Jie + * @date 2018-12-26 + */ +@Entity +@Data +@Table(name = "email_config") +public class EmailConfig implements Serializable { + + @Id + private Long id; + + /** + *邮件服务器SMTP地址 + */ + @NotBlank + private String host; + + /** + * 邮件服务器SMTP端口 + */ + @NotBlank + private String port; + + /** + * 发件者用户名,默认为发件人邮箱前缀 + */ + @NotBlank + private String user; + + @NotBlank + private String pass; + + /** + * 收件人 + */ + @NotBlank + @Column(name = "from_user") + private String fromUser; +} diff --git a/yshop-tools/src/main/java/co/yixiang/domain/LocalStorage.java b/yshop-tools/src/main/java/co/yixiang/domain/LocalStorage.java new file mode 100644 index 00000000..fa6c9649 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/LocalStorage.java @@ -0,0 +1,83 @@ +package co.yixiang.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import lombok.NoArgsConstructor; +import org.hibernate.annotations.CreationTimestamp; +import org.hibernate.annotations.UpdateTimestamp; + +import javax.persistence.*; +import java.sql.Timestamp; +import java.io.Serializable; + +/** +* @author Zheng Jie +* @date 2019-09-05 +*/ +@Entity +@Data +@Table(name="local_storage") +@AllArgsConstructor +@NoArgsConstructor +public class LocalStorage implements Serializable { + + // ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + + // 真实文件名 + @Column(name = "real_name") + private String realName; + + // 文件名 + @Column(name = "name") + private String name; + + // 后缀 + @Column(name = "suffix") + private String suffix; + + // 路径 + @Column(name = "path") + private String path; + + // 类型 + @Column(name = "type") + private String type; + + // 大小 + @Column(name = "size") + private String size; + + // 操作人 + @Column(name = "operate") + private String operate; + + // 创建日期 + @Column(name = "create_time") + @CreationTimestamp + private Timestamp createTime; + + // 修改日期 + @Column(name = "update_time") + @UpdateTimestamp + private Timestamp updateTime; + + public LocalStorage(String realName,String name, String suffix, String path, String type, String size, String operate) { + this.realName = realName; + this.name = name; + this.suffix = suffix; + this.path = path; + this.type = type; + this.size = size; + this.operate = operate; + } + + public void copy(LocalStorage source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/domain/Picture.java b/yshop-tools/src/main/java/co/yixiang/domain/Picture.java new file mode 100644 index 00000000..3bd0268a --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/Picture.java @@ -0,0 +1,53 @@ +package co.yixiang.domain; + +import lombok.Data; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Timestamp; + +/** + * sm.ms图床 + * + * @author Zheng Jie + * @date 2018-12-27 + */ +@Data +@Entity +@Table(name = "picture") +public class Picture implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String filename; + + private String url; + + private String size; + + private String height; + + private String width; + + /** + * delete URl + */ + @Column(name = "delete_url") + private String delete; + + private String username; + + @CreationTimestamp + @Column(name = "create_time") + private Timestamp createTime; + + @Override + public String toString() { + return "Picture{" + + "filename='" + filename + '\'' + + '}'; + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/domain/QiniuConfig.java b/yshop-tools/src/main/java/co/yixiang/domain/QiniuConfig.java new file mode 100644 index 00000000..895aea31 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/QiniuConfig.java @@ -0,0 +1,62 @@ +package co.yixiang.domain; + +import lombok.Data; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 七牛云对象存储配置类 + * @author Zheng Jie + * @date 2018-12-31 + */ +@Data +@Entity +@Table(name = "qiniu_config") +public class QiniuConfig implements Serializable { + + @Id + private Long id; + + /** + * 一个账号最多拥有两对密钥(Access/Secret Key) + */ + @NotBlank + @Column(name = "access_key", columnDefinition = "text") + private String accessKey; + + /** + * 一个账号最多拥有两对密钥(Access/Secret Key) + */ + @NotBlank + @Column(name = "secret_key", columnDefinition = "text") + private String secretKey; + + /** + * 存储空间名称作为唯一的 Bucket 识别符 + */ + @NotBlank + private String bucket; + + /** + * Zone表示与机房的对应关系 + * 华东 Zone.zone0() + * 华北 Zone.zone1() + * 华南 Zone.zone2() + * 北美 Zone.zoneNa0() + * 东南亚 Zone.zoneAs0() + */ + @NotBlank + private String zone; + + /** + * 外链域名,可自定义,需在七牛云绑定 + */ + @NotBlank + private String host; + + /** + * 空间类型:公开/私有 + */ + private String type = "公开"; +} diff --git a/yshop-tools/src/main/java/co/yixiang/domain/QiniuContent.java b/yshop-tools/src/main/java/co/yixiang/domain/QiniuContent.java new file mode 100644 index 00000000..46620950 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/QiniuContent.java @@ -0,0 +1,58 @@ +package co.yixiang.domain; + +import lombok.Data; +import org.hibernate.annotations.UpdateTimestamp; + +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Timestamp; + +/** + * 上传成功后,存储结果 + * @author Zheng Jie + * @date 2018-12-31 + */ +@Data +@Entity +@Table(name = "qiniu_content") +public class QiniuContent implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + /** + * 文件名,如qiniu.jpg + */ + @Column(name = "name",unique = false) + private String key; + + /** + * 空间名 + */ + private String bucket; + + /** + * 大小 + */ + private String size; + + /** + * 文件地址 + */ + private String url; + + private String suffix; + + /** + * 空间类型:公开/私有 + */ + private String type = "公开"; + + /** + * 更新时间 + */ + @UpdateTimestamp + @Column(name = "update_time") + private Timestamp updateTime; +} diff --git a/yshop-tools/src/main/java/co/yixiang/domain/VerificationCode.java b/yshop-tools/src/main/java/co/yixiang/domain/VerificationCode.java new file mode 100644 index 00000000..3ba74880 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/VerificationCode.java @@ -0,0 +1,65 @@ +package co.yixiang.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import java.sql.Timestamp; + +/** + * @author Zheng Jie + * @date 2018-12-26 + */ +@Data +@Entity +@AllArgsConstructor +@NoArgsConstructor +@Table(name = "verification_code") +public class VerificationCode { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String code; + + /** + * 使用场景,自己定义 + */ + private String scenes; + + /** + * true 为有效,false 为无效,验证时状态+时间+具体的邮箱或者手机号 + */ + private Boolean status = true; + + + /** + * 类型 :phone 和 email + */ + @NotBlank + private String type; + + /** + * 具体的phone与email + */ + @NotBlank + private String value; + + /** + * 创建日期 + */ + @CreationTimestamp + @Column(name = "create_time") + private Timestamp createTime; + + public VerificationCode(String code, String scenes, @NotBlank String type, @NotBlank String value) { + this.code = code; + this.scenes = scenes; + this.type = type; + this.value = value; + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/domain/vo/EmailVo.java b/yshop-tools/src/main/java/co/yixiang/domain/vo/EmailVo.java new file mode 100644 index 00000000..41bd89db --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/vo/EmailVo.java @@ -0,0 +1,32 @@ +package co.yixiang.domain.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * 发送邮件时,接收参数的类 + * @author 郑杰 + * @date 2018/09/28 12:02:14 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class EmailVo { + + /** + * 收件人,支持多个收件人,用逗号分隔 + */ + @NotEmpty + private List tos; + + @NotBlank + private String subject; + + @NotBlank + private String content; +} diff --git a/yshop-tools/src/main/java/co/yixiang/domain/vo/TradeVo.java b/yshop-tools/src/main/java/co/yixiang/domain/vo/TradeVo.java new file mode 100644 index 00000000..1ac6b030 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/domain/vo/TradeVo.java @@ -0,0 +1,65 @@ +package co.yixiang.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.sql.Date; +import java.sql.Timestamp; + +/** + * 交易详情,按需应该存入数据库,这里存入数据库,仅供临时测试 + * @author Zheng Jie + * @date 2018-12-31 + */ +@Data +public class TradeVo { + + /** + * (必填)商品描述 + */ + @NotBlank + private String body; + + /** + * (必填)商品名称 + */ + @NotBlank + private String subject; + + /** + * (必填)商户订单号,应该由后台生成 + */ + @ApiModelProperty(hidden = true) + private String outTradeNo; + + /** + * (必填)第三方订单号 + */ + @ApiModelProperty(hidden = true) + private String tradeNo; + + /** + * (必填)价格 + */ + @NotBlank + private String totalAmount; + + /** + * 订单状态,已支付,未支付,作废 + */ + @ApiModelProperty(hidden = true) + private String state; + + /** + * 创建时间,存入数据库时需要 + */ + @ApiModelProperty(hidden = true) + private Timestamp createTime; + + /** + * 作废时间,存入数据库时需要 + */ + @ApiModelProperty(hidden = true) + private Date cancelTime; +} diff --git a/yshop-tools/src/main/java/co/yixiang/repository/AlipayRepository.java b/yshop-tools/src/main/java/co/yixiang/repository/AlipayRepository.java new file mode 100644 index 00000000..20b68dd5 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/repository/AlipayRepository.java @@ -0,0 +1,11 @@ +package co.yixiang.repository; + +import co.yixiang.domain.AlipayConfig; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * @author Zheng Jie + * @date 2018-12-31 + */ +public interface AlipayRepository extends JpaRepository { +} diff --git a/yshop-tools/src/main/java/co/yixiang/repository/EmailRepository.java b/yshop-tools/src/main/java/co/yixiang/repository/EmailRepository.java new file mode 100644 index 00000000..8341ed48 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/repository/EmailRepository.java @@ -0,0 +1,11 @@ +package co.yixiang.repository; + +import co.yixiang.domain.EmailConfig; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * @author Zheng Jie + * @date 2018-12-26 + */ +public interface EmailRepository extends JpaRepository { +} diff --git a/yshop-tools/src/main/java/co/yixiang/repository/LocalStorageRepository.java b/yshop-tools/src/main/java/co/yixiang/repository/LocalStorageRepository.java new file mode 100644 index 00000000..fdeae9d3 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/repository/LocalStorageRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.repository; + +import co.yixiang.domain.LocalStorage; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author Zheng Jie +* @date 2019-09-05 +*/ +public interface LocalStorageRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/repository/PictureRepository.java b/yshop-tools/src/main/java/co/yixiang/repository/PictureRepository.java new file mode 100644 index 00000000..3bf944bd --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/repository/PictureRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.repository; + +import co.yixiang.domain.Picture; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** + * @author Zheng Jie + * @date 2018-12-27 + */ +public interface PictureRepository extends JpaRepository, JpaSpecificationExecutor { +} diff --git a/yshop-tools/src/main/java/co/yixiang/repository/QiNiuConfigRepository.java b/yshop-tools/src/main/java/co/yixiang/repository/QiNiuConfigRepository.java new file mode 100644 index 00000000..957e0abe --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/repository/QiNiuConfigRepository.java @@ -0,0 +1,17 @@ +package co.yixiang.repository; + +import co.yixiang.domain.QiniuConfig; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; + +/** + * @author Zheng Jie + * @date 2018-12-31 + */ +public interface QiNiuConfigRepository extends JpaRepository { + + @Modifying + @Query(value = "update qiniu_content set type = ?1", nativeQuery = true) + void update(String type); +} diff --git a/yshop-tools/src/main/java/co/yixiang/repository/QiniuContentRepository.java b/yshop-tools/src/main/java/co/yixiang/repository/QiniuContentRepository.java new file mode 100644 index 00000000..18a0741f --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/repository/QiniuContentRepository.java @@ -0,0 +1,19 @@ +package co.yixiang.repository; + +import co.yixiang.domain.QiniuContent; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** + * @author Zheng Jie + * @date 2018-12-31 + */ +public interface QiniuContentRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * 根据key查询 + * @param key + * @return + */ + QiniuContent findByKey(String key); +} diff --git a/yshop-tools/src/main/java/co/yixiang/repository/VerificationCodeRepository.java b/yshop-tools/src/main/java/co/yixiang/repository/VerificationCodeRepository.java new file mode 100644 index 00000000..a3155ed2 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/repository/VerificationCodeRepository.java @@ -0,0 +1,20 @@ +package co.yixiang.repository; + +import co.yixiang.domain.VerificationCode; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * @author Zheng Jie + * @date 2018-12-26 + */ +public interface VerificationCodeRepository extends JpaRepository { + + /** + * 获取有效的验证码 + * @param scenes 业务场景,如重置密码,重置邮箱等等 + * @param type + * @param value + * @return + */ + VerificationCode findByScenesAndTypeAndValueAndStatusIsTrue(String scenes, String type, String value); +} diff --git a/yshop-tools/src/main/java/co/yixiang/rest/AliPayController.java b/yshop-tools/src/main/java/co/yixiang/rest/AliPayController.java new file mode 100644 index 00000000..dfbf3354 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/rest/AliPayController.java @@ -0,0 +1,123 @@ +package co.yixiang.rest; + +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.aop.log.Log; +import co.yixiang.domain.AlipayConfig; +import co.yixiang.domain.vo.TradeVo; +import co.yixiang.service.AlipayService; +import co.yixiang.utils.AliPayStatusEnum; +import co.yixiang.utils.AlipayUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +/** + * @author Zheng Jie + * @date 2018-12-31 + */ +@Slf4j +@RestController +@RequestMapping("/api") +public class AliPayController { + + @Autowired + AlipayUtils alipayUtils; + + @Autowired + private AlipayService alipayService; + + @GetMapping(value = "/aliPay") + public ResponseEntity get(){ + return new ResponseEntity<>(alipayService.find(),HttpStatus.OK); + } + + @Log("配置支付宝") + @PutMapping(value = "/aliPay") + public ResponseEntity payConfig(@Validated @RequestBody AlipayConfig alipayConfig){ + alipayConfig.setId(1L); + alipayService.update(alipayConfig); + return new ResponseEntity(HttpStatus.OK); + } + + @Log("支付宝PC网页支付") + @ApiOperation(value = "PC网页支付") + @PostMapping(value = "/aliPay/toPayAsPC") + public ResponseEntity toPayAsPC(@Validated@RequestBody TradeVo trade) throws Exception{ + AlipayConfig alipay = alipayService.find(); + trade.setOutTradeNo(alipayUtils.getOrderCode()); + String payUrl = alipayService.toPayAsPC(alipay,trade); + return ResponseEntity.ok(payUrl); + } + + @Log("支付宝手机网页支付") + @ApiOperation(value = "手机网页支付") + @PostMapping(value = "/aliPay/toPayAsWeb") + public ResponseEntity toPayAsWeb(@Validated @RequestBody TradeVo trade) throws Exception{ + AlipayConfig alipay = alipayService.find(); + trade.setOutTradeNo(alipayUtils.getOrderCode()); + String payUrl = alipayService.toPayAsWeb(alipay,trade); + return ResponseEntity.ok(payUrl); + } + + @ApiIgnore + @GetMapping("/aliPay/return") + @ApiOperation(value = "支付之后跳转的链接") + public ResponseEntity returnPage(HttpServletRequest request, HttpServletResponse response) throws Exception { + AlipayConfig alipay = alipayService.find(); + response.setContentType("text/html;charset=" + alipay.getCharset()); + //内容验签,防止黑客篡改参数 + if(alipayUtils.rsaCheck(request,alipay)){ + //商户订单号 + String outTradeNo = new String(request.getParameter("out_trade_no").getBytes("ISO-8859-1"),"UTF-8"); + //支付宝交易号 + String tradeNo = new String(request.getParameter("trade_no").getBytes("ISO-8859-1"),"UTF-8"); + System.out.println("商户订单号"+outTradeNo+" "+"第三方交易号"+tradeNo); + + /** + * 根据业务需要返回数据,这里统一返回OK + */ + return new ResponseEntity<>("payment successful",HttpStatus.OK); + }else{ + /** + * 根据业务需要返回数据 + */ + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + } + + @ApiIgnore + @RequestMapping("/aliPay/notify") + @ApiOperation(value = "支付异步通知(要公网访问),接收异步通知,检查通知内容app_id、out_trade_no、total_amount是否与请求中的一致,根据trade_status进行后续业务处理") + public ResponseEntity notify(HttpServletRequest request) throws Exception{ + AlipayConfig alipay = alipayService.find(); + Map parameterMap = request.getParameterMap(); + StringBuilder notifyBuild = new StringBuilder("/****************************** pay notify ******************************/\n"); + parameterMap.forEach((key, value) -> notifyBuild.append(key + "=" + value[0] + "\n") ); + //内容验签,防止黑客篡改参数 + if (alipayUtils.rsaCheck(request,alipay)) { + //交易状态 + String tradeStatus = new String(request.getParameter("trade_status").getBytes("ISO-8859-1"),"UTF-8"); + // 商户订单号 + String outTradeNo = new String(request.getParameter("out_trade_no").getBytes("ISO-8859-1"),"UTF-8"); + //支付宝交易号 + String tradeNo = new String(request.getParameter("trade_no").getBytes("ISO-8859-1"),"UTF-8"); + //付款金额 + String totalAmount = new String(request.getParameter("total_amount").getBytes("ISO-8859-1"),"UTF-8"); + //验证 + if(tradeStatus.equals(AliPayStatusEnum.SUCCESS.getValue())||tradeStatus.equals(AliPayStatusEnum.FINISHED.getValue())){ + /** + * 验证通过后应该根据业务需要处理订单 + */ + } + return new ResponseEntity(HttpStatus.OK); + } + return new ResponseEntity(HttpStatus.BAD_REQUEST); + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/rest/EmailController.java b/yshop-tools/src/main/java/co/yixiang/rest/EmailController.java new file mode 100644 index 00000000..b585af25 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/rest/EmailController.java @@ -0,0 +1,46 @@ +package co.yixiang.rest; + +import lombok.extern.slf4j.Slf4j; +import co.yixiang.aop.log.Log; +import co.yixiang.domain.EmailConfig; +import co.yixiang.domain.vo.EmailVo; +import co.yixiang.service.EmailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 发送邮件 + * @author 郑杰 + * @date 2018/09/28 6:55:53 + */ +@Slf4j +@RestController +@RequestMapping("api") +public class EmailController { + + @Autowired + private EmailService emailService; + + @GetMapping(value = "/email") + public ResponseEntity get(){ + return new ResponseEntity(emailService.find(),HttpStatus.OK); + } + + @Log("配置邮件") + @PutMapping(value = "/email") + public ResponseEntity emailConfig(@Validated @RequestBody EmailConfig emailConfig){ + emailService.update(emailConfig,emailService.find()); + return new ResponseEntity(HttpStatus.OK); + } + + @Log("发送邮件") + @PostMapping(value = "/email") + public ResponseEntity send(@Validated @RequestBody EmailVo emailVo) throws Exception { + log.warn("REST request to send Email : {}" +emailVo); + emailService.send(emailVo,emailService.find()); + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/rest/LocalStorageController.java b/yshop-tools/src/main/java/co/yixiang/rest/LocalStorageController.java new file mode 100644 index 00000000..f84cd221 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/rest/LocalStorageController.java @@ -0,0 +1,70 @@ +package co.yixiang.rest; + +import co.yixiang.aop.log.Log; +import co.yixiang.domain.LocalStorage; +import co.yixiang.service.LocalStorageService; +import co.yixiang.service.dto.LocalStorageQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.*; +import org.springframework.web.multipart.MultipartFile; + +/** +* @author Zheng Jie +* @date 2019-09-05 +*/ +@Api(tags = "本地存储管理") +@RestController +@RequestMapping("api") +public class LocalStorageController { + + @Autowired + private LocalStorageService localStorageService; + + @ApiOperation(value = "查询文件") + @GetMapping(value = "/localStorage") + @PreAuthorize("hasAnyRole('ADMIN','LOCALSTORAGE_ALL','LOCALSTORAGE_SELECT')") + public ResponseEntity getLocalStorages(LocalStorageQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity(localStorageService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @ApiOperation(value = "上传文件") + @PostMapping(value = "/localStorage") + @PreAuthorize("hasAnyRole('ADMIN','LOCALSTORAGE_ALL','LOCALSTORAGE_CREATE')") + public ResponseEntity create(@RequestParam String name, @RequestParam("file") MultipartFile file){ + return new ResponseEntity(localStorageService.create(name, file),HttpStatus.CREATED); + } + + @ApiOperation(value = "修改文件") + @PutMapping(value = "/localStorage") + @PreAuthorize("hasAnyRole('ADMIN','LOCALSTORAGE_ALL','LOCALSTORAGE_EDIT')") + public ResponseEntity update(@Validated @RequestBody LocalStorage resources){ + localStorageService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @ApiOperation(value = "删除文件") + @DeleteMapping(value = "/localStorage/{id}") + @PreAuthorize("hasAnyRole('ADMIN','LOCALSTORAGE_ALL','LOCALSTORAGE_DELETE')") + public ResponseEntity delete(@PathVariable Long id){ + localStorageService.delete(id); + return new ResponseEntity(HttpStatus.OK); + } + + /** + * 删除多张图片 + * @param ids + * @return + */ + @Log("删除图片") + @DeleteMapping(value = "/localStorage") + public ResponseEntity deleteAll(@RequestBody Long[] ids) { + localStorageService.deleteAll(ids); + return new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/rest/PictureController.java b/yshop-tools/src/main/java/co/yixiang/rest/PictureController.java new file mode 100644 index 00000000..ef95927a --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/rest/PictureController.java @@ -0,0 +1,80 @@ +package co.yixiang.rest; + +import co.yixiang.aop.log.Log; +import co.yixiang.domain.Picture; +import co.yixiang.service.PictureService; +import co.yixiang.service.dto.PictureQueryCriteria; +import co.yixiang.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import java.util.HashMap; +import java.util.Map; + +/** + * @author 郑杰 + * @date 2018/09/20 14:13:32 + */ +@RestController +@RequestMapping("/api") +public class PictureController { + + @Autowired + private PictureService pictureService; + + @Log("查询图片") + @PreAuthorize("hasAnyRole('ADMIN','PICTURE_ALL','PICTURE_SELECT')") + @GetMapping(value = "/pictures") + public ResponseEntity getRoles(PictureQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity(pictureService.queryAll(criteria,pageable),HttpStatus.OK); + } + + /** + * 上传图片 + * @param file + * @return + * @throws Exception + */ + @Log("上传图片") + @PreAuthorize("hasAnyRole('ADMIN','PICTURE_ALL','PICTURE_UPLOAD')") + @PostMapping(value = "/pictures") + public ResponseEntity upload(@RequestParam MultipartFile file){ + String userName = SecurityUtils.getUsername(); + Picture picture = pictureService.upload(file,userName); + Map map = new HashMap<>(3); + map.put("errno",0); + map.put("id",picture.getId()); + map.put("data",new String[]{picture.getUrl()}); + return new ResponseEntity(map,HttpStatus.OK); + } + + /** + * 删除图片 + * @param id + * @return + */ + @Log("删除图片") + @PreAuthorize("hasAnyRole('ADMIN','PICTURE_ALL','PICTURE_DELETE')") + @DeleteMapping(value = "/pictures/{id}") + public ResponseEntity delete(@PathVariable Long id) { + pictureService.delete(pictureService.findById(id)); + return new ResponseEntity(HttpStatus.OK); + } + + /** + * 删除多张图片 + * @param ids + * @return + */ + @Log("删除图片") + @PreAuthorize("hasAnyRole('ADMIN','PICTURE_ALL','PICTURE_DELETE')") + @DeleteMapping(value = "/pictures") + public ResponseEntity deleteAll(@RequestBody Long[] ids) { + pictureService.deleteAll(ids); + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/rest/QiniuController.java b/yshop-tools/src/main/java/co/yixiang/rest/QiniuController.java new file mode 100644 index 00000000..3db878f6 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/rest/QiniuController.java @@ -0,0 +1,117 @@ +package co.yixiang.rest; + +import lombok.extern.slf4j.Slf4j; +import co.yixiang.aop.log.Log; +import co.yixiang.domain.QiniuConfig; +import co.yixiang.domain.QiniuContent; +import co.yixiang.service.QiNiuService; +import co.yixiang.service.dto.QiniuQueryCriteria; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import java.util.HashMap; +import java.util.Map; + +/** + * 发送邮件 + * @author 郑杰 + * @date 2018/09/28 6:55:53 + */ +@Slf4j +@RestController +@RequestMapping("api") +public class QiniuController { + + @Autowired + private QiNiuService qiNiuService; + + @GetMapping(value = "/qiNiuConfig") + public ResponseEntity get(){ + return new ResponseEntity(qiNiuService.find(), HttpStatus.OK); + } + + @Log("配置七牛云存储") + @PutMapping(value = "/qiNiuConfig") + public ResponseEntity emailConfig(@Validated @RequestBody QiniuConfig qiniuConfig){ + qiNiuService.update(qiniuConfig); + qiNiuService.update(qiniuConfig.getType()); + return new ResponseEntity(HttpStatus.OK); + } + + @Log("查询文件") + @GetMapping(value = "/qiNiuContent") + public ResponseEntity getRoles(QiniuQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity(qiNiuService.queryAll(criteria,pageable),HttpStatus.OK); + } + + /** + * 上传文件到七牛云 + * @param file + * @return + */ + @Log("上传文件") + @PostMapping(value = "/qiNiuContent") + public ResponseEntity upload(@RequestParam MultipartFile file){ + QiniuContent qiniuContent = qiNiuService.upload(file,qiNiuService.find()); + Map map = new HashMap(3); + map.put("id",qiniuContent.getId()); + map.put("errno",0); + map.put("data",new String[]{qiniuContent.getUrl()}); + return new ResponseEntity(map,HttpStatus.OK); + } + + /** + * 同步七牛云数据到数据库 + * @return + */ + @Log("同步七牛云数据") + @PostMapping(value = "/qiNiuContent/synchronize") + public ResponseEntity synchronize(){ + log.warn("REST request to synchronize qiNiu : {}"); + qiNiuService.synchronize(qiNiuService.find()); + return new ResponseEntity(HttpStatus.OK); + } + + /** + * 下载七牛云文件 + * @param id + * @return + * @throws Exception + */ + @Log("下载文件") + @GetMapping(value = "/qiNiuContent/download/{id}") + public ResponseEntity download(@PathVariable Long id){ + Map map = new HashMap(1); + map.put("url", qiNiuService.download(qiNiuService.findByContentId(id),qiNiuService.find())); + return new ResponseEntity(map,HttpStatus.OK); + } + + /** + * 删除七牛云文件 + * @param id + * @return + * @throws Exception + */ + @Log("删除文件") + @DeleteMapping(value = "/qiNiuContent/{id}") + public ResponseEntity delete(@PathVariable Long id){ + qiNiuService.delete(qiNiuService.findByContentId(id),qiNiuService.find()); + return new ResponseEntity(HttpStatus.OK); + } + + /** + * 删除多张图片 + * @param ids + * @return + */ + @Log("删除图片") + @DeleteMapping(value = "/qiNiuContent") + public ResponseEntity deleteAll(@RequestBody Long[] ids) { + qiNiuService.deleteAll(ids, qiNiuService.find()); + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/rest/VerificationCodeController.java b/yshop-tools/src/main/java/co/yixiang/rest/VerificationCodeController.java new file mode 100644 index 00000000..8d576614 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/rest/VerificationCodeController.java @@ -0,0 +1,57 @@ +package co.yixiang.rest; + +import co.yixiang.domain.VerificationCode; +import co.yixiang.domain.vo.EmailVo; +import co.yixiang.service.EmailService; +import co.yixiang.service.VerificationCodeService; +import co.yixiang.utils.ElAdminConstant; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.web.bind.annotation.*; + +/** + * @author Zheng Jie + * @date 2018-12-26 + */ +@RestController +@RequestMapping("api") +public class VerificationCodeController { + + @Autowired + private VerificationCodeService verificationCodeService; + + @Autowired + @Qualifier("jwtUserDetailsService") + private UserDetailsService userDetailsService; + + @Autowired + private EmailService emailService; + + @PostMapping(value = "/code/resetEmail") + public ResponseEntity resetEmail(@RequestBody VerificationCode code) throws Exception { + code.setScenes(ElAdminConstant.RESET_MAIL); + EmailVo emailVo = verificationCodeService.sendEmail(code); + emailService.send(emailVo,emailService.find()); + return new ResponseEntity(HttpStatus.OK); + } + + @PostMapping(value = "/code/email/resetPass") + public ResponseEntity resetPass(@RequestParam String email) throws Exception { + VerificationCode code = new VerificationCode(); + code.setType("email"); + code.setValue(email); + code.setScenes(ElAdminConstant.RESET_MAIL); + EmailVo emailVo = verificationCodeService.sendEmail(code); + emailService.send(emailVo,emailService.find()); + return new ResponseEntity(HttpStatus.OK); + } + + @GetMapping(value = "/code/validated") + public ResponseEntity validated(VerificationCode code){ + verificationCodeService.validated(code); + return new ResponseEntity(HttpStatus.OK); + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/AlipayService.java b/yshop-tools/src/main/java/co/yixiang/service/AlipayService.java new file mode 100644 index 00000000..46440a92 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/AlipayService.java @@ -0,0 +1,48 @@ +package co.yixiang.service; + +import co.yixiang.domain.AlipayConfig; +import co.yixiang.domain.vo.TradeVo; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; + +/** + * @author Zheng Jie + * @date 2018-12-31 + */ +@CacheConfig(cacheNames = "alipay") +public interface AlipayService { + + /** + * 处理来自PC的交易请求 + * @param alipay + * @param trade + * @return + * @throws Exception + */ + String toPayAsPC(AlipayConfig alipay, TradeVo trade) throws Exception; + + /** + * 处理来自手机网页的交易请求 + * @param alipay + * @param trade + * @return + * @throws Exception + */ + String toPayAsWeb(AlipayConfig alipay, TradeVo trade) throws Exception; + + /** + * 查询配置 + * @return + */ + @Cacheable(key = "'1'") + AlipayConfig find(); + + /** + * 更新配置 + * @param alipayConfig + * @return + */ + @CachePut(key = "'1'") + AlipayConfig update(AlipayConfig alipayConfig); +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/EmailService.java b/yshop-tools/src/main/java/co/yixiang/service/EmailService.java new file mode 100644 index 00000000..5c63942c --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/EmailService.java @@ -0,0 +1,41 @@ +package co.yixiang.service; + +import co.yixiang.domain.vo.EmailVo; +import co.yixiang.domain.EmailConfig; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.scheduling.annotation.Async; + +/** + * @author Zheng Jie + * @date 2018-12-26 + */ +@CacheConfig(cacheNames = "email") +public interface EmailService { + + /** + * 更新邮件配置 + * @param emailConfig + * @param old + * @return + */ + @CachePut(key = "'1'") + EmailConfig update(EmailConfig emailConfig, EmailConfig old); + + /** + * 查询配置 + * @return + */ + @Cacheable(key = "'1'") + EmailConfig find(); + + /** + * 发送邮件 + * @param emailVo + * @param emailConfig + * @throws Exception + */ + @Async + void send(EmailVo emailVo, EmailConfig emailConfig) throws Exception; +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/LocalStorageService.java b/yshop-tools/src/main/java/co/yixiang/service/LocalStorageService.java new file mode 100644 index 00000000..46e86c7e --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/LocalStorageService.java @@ -0,0 +1,69 @@ +package co.yixiang.service; + +import co.yixiang.domain.LocalStorage; +import co.yixiang.service.dto.LocalStorageDTO; +import co.yixiang.service.dto.LocalStorageQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; +import org.springframework.web.multipart.MultipartFile; + +/** +* @author Zheng Jie +* @date 2019-09-05 +*/ +@CacheConfig(cacheNames = "localStorage") +public interface LocalStorageService { + + /** + * queryAll 分页 + * @param criteria + * @param pageable + * @return + */ + @Cacheable + Object queryAll(LocalStorageQueryCriteria criteria, Pageable pageable); + + /** + * queryAll 不分页 + * @param criteria + * @return + */ + @Cacheable + public Object queryAll(LocalStorageQueryCriteria criteria); + + /** + * findById + * @param id + * @return + */ + @Cacheable(key = "#p0") + LocalStorageDTO findById(Long id); + + /** + * create + * @param name + * @param file + * @return + */ + @CacheEvict(allEntries = true) + LocalStorageDTO create(String name, MultipartFile file); + + /** + * update + * @param resources + */ + @CacheEvict(allEntries = true) + void update(LocalStorage resources); + + /** + * delete + * @param id + */ + @CacheEvict(allEntries = true) + void delete(Long id); + + @CacheEvict(allEntries = true) + void deleteAll(Long[] ids); +} \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/service/PictureService.java b/yshop-tools/src/main/java/co/yixiang/service/PictureService.java new file mode 100644 index 00000000..924a374b --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/PictureService.java @@ -0,0 +1,56 @@ +package co.yixiang.service; + +import co.yixiang.domain.Picture; +import co.yixiang.service.dto.PictureQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; +import org.springframework.web.multipart.MultipartFile; +/** + * @author Zheng Jie + * @date 2018-12-27 + */ +@CacheConfig(cacheNames = "picture") +public interface PictureService { + + /** + * 查询图片 + * @param criteria + * @param pageable + * @return + */ + @Cacheable + Object queryAll(PictureQueryCriteria criteria, Pageable pageable); + + /** + * 上传图片 + * @param file + * @param username + * @return + */ + @CacheEvict(allEntries = true) + Picture upload(MultipartFile file, String username); + + /** + * 根据ID查询 + * @param id + * @return + */ + @Cacheable(key = "#p0") + Picture findById(Long id); + + /** + * 删除图片 + * @param picture + */ + @CacheEvict(allEntries = true) + void delete(Picture picture); + + /** + * 删除图片 + * @param ids + */ + @CacheEvict(allEntries = true) + void deleteAll(Long[] ids); +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/QiNiuService.java b/yshop-tools/src/main/java/co/yixiang/service/QiNiuService.java new file mode 100644 index 00000000..e2cbe5bb --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/QiNiuService.java @@ -0,0 +1,95 @@ +package co.yixiang.service; + +import co.yixiang.domain.QiniuConfig; +import co.yixiang.domain.QiniuContent; +import co.yixiang.service.dto.QiniuQueryCriteria; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Pageable; +import org.springframework.web.multipart.MultipartFile; + +/** + * @author Zheng Jie + * @date 2018-12-31 + */ +@CacheConfig(cacheNames = "qiNiu") +public interface QiNiuService { + + /** + * 查询文件 + * @param criteria + * @param pageable + * @return + */ + @Cacheable + Object queryAll(QiniuQueryCriteria criteria, Pageable pageable); + + /** + * 查配置 + * @return + */ + @Cacheable(cacheNames = "qiNiuConfig", key = "'1'") + QiniuConfig find(); + + /** + * 修改配置 + * @param qiniuConfig + * @return + */ + @CachePut(cacheNames = "qiNiuConfig", key = "'1'") + QiniuConfig update(QiniuConfig qiniuConfig); + + /** + * 上传文件 + * @param file + * @param qiniuConfig + * @return + */ + @CacheEvict(allEntries = true) + QiniuContent upload(MultipartFile file, QiniuConfig qiniuConfig); + + /** + * 查询文件 + * @param id + * @return + */ + @Cacheable(key = "'content:'+#p0") + QiniuContent findByContentId(Long id); + + /** + * 下载文件 + * @param content + * @param config + * @return + */ + String download(QiniuContent content, QiniuConfig config); + + /** + * 删除文件 + * @param content + * @param config + * @return + */ + @CacheEvict(allEntries = true) + void delete(QiniuContent content, QiniuConfig config); + + /** + * 同步数据 + * @param config + */ + @CacheEvict(allEntries = true) + void synchronize(QiniuConfig config); + + /** + * 删除文件 + * @param ids + * @param config + */ + @CacheEvict(allEntries = true) + void deleteAll(Long[] ids, QiniuConfig config); + + @CacheEvict(allEntries = true) + void update(String type); +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/VerificationCodeService.java b/yshop-tools/src/main/java/co/yixiang/service/VerificationCodeService.java new file mode 100644 index 00000000..207c0fc1 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/VerificationCodeService.java @@ -0,0 +1,23 @@ +package co.yixiang.service; + +import co.yixiang.domain.vo.EmailVo; +import co.yixiang.domain.VerificationCode; + +/** + * @author Zheng Jie + * @date 2018-12-26 + */ +public interface VerificationCodeService { + + /** + * 发送邮件验证码 + * @param code + */ + EmailVo sendEmail(VerificationCode code); + + /** + * 验证 + * @param code + */ + void validated(VerificationCode code); +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/dto/LocalStorageDTO.java b/yshop-tools/src/main/java/co/yixiang/service/dto/LocalStorageDTO.java new file mode 100644 index 00000000..3b38eb2f --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/dto/LocalStorageDTO.java @@ -0,0 +1,41 @@ +package co.yixiang.service.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import java.sql.Timestamp; +import java.io.Serializable; + + +/** +* @author Zheng Jie +* @date 2019-09-05 +*/ +@Data +public class LocalStorageDTO implements Serializable { + + // ID + private Long id; + + private String realName; + + // 文件名 + private String name; + + // 后缀 + private String suffix; + + // 类型 + private String type; + + // 大小 + private String size; + + // 操作人 + private String operate; + + // 创建日期 + private Timestamp createTime; + + // 修改日期 + private Timestamp updateTime; +} \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/service/dto/LocalStorageQueryCriteria.java b/yshop-tools/src/main/java/co/yixiang/service/dto/LocalStorageQueryCriteria.java new file mode 100644 index 00000000..e817e4a0 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/dto/LocalStorageQueryCriteria.java @@ -0,0 +1,16 @@ +package co.yixiang.service.dto; + +import lombok.Data; +import co.yixiang.annotation.Query; + +/** +* @author Zheng Jie +* @date 2019-09-05 +*/ +@Data +public class LocalStorageQueryCriteria{ + + // 模糊 + @Query(blurry = "name,suffix,type,operate,size") + private String blurry; +} \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/service/dto/PictureQueryCriteria.java b/yshop-tools/src/main/java/co/yixiang/service/dto/PictureQueryCriteria.java new file mode 100644 index 00000000..c4c15a5e --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/dto/PictureQueryCriteria.java @@ -0,0 +1,20 @@ +package co.yixiang.service.dto; + +import lombok.Data; +import co.yixiang.annotation.Query; + +/** + * sm.ms图床 + * + * @author Zheng Jie + * @date 2019-6-4 09:52:09 + */ +@Data +public class PictureQueryCriteria{ + + @Query(type = Query.Type.INNER_LIKE) + private String filename; + + @Query(type = Query.Type.INNER_LIKE) + private String username; +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/dto/QiniuQueryCriteria.java b/yshop-tools/src/main/java/co/yixiang/service/dto/QiniuQueryCriteria.java new file mode 100644 index 00000000..4714d095 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/dto/QiniuQueryCriteria.java @@ -0,0 +1,15 @@ +package co.yixiang.service.dto; + +import lombok.Data; +import co.yixiang.annotation.Query; + +/** + * @author Zheng Jie + * @date 2019-6-4 09:54:37 + */ +@Data +public class QiniuQueryCriteria{ + + @Query(type = Query.Type.INNER_LIKE) + private String key; +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/impl/AlipayServiceImpl.java b/yshop-tools/src/main/java/co/yixiang/service/impl/AlipayServiceImpl.java new file mode 100644 index 00000000..c9314f7c --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/impl/AlipayServiceImpl.java @@ -0,0 +1,131 @@ +package co.yixiang.service.impl; + +import co.yixiang.domain.AlipayConfig; +import co.yixiang.domain.vo.TradeVo; +import co.yixiang.utils.AlipayUtils; +import com.alipay.api.AlipayClient; +import com.alipay.api.DefaultAlipayClient; +import com.alipay.api.request.AlipayTradePagePayRequest; +import com.alipay.api.request.AlipayTradeWapPayRequest; +import co.yixiang.exception.BadRequestException; +import co.yixiang.repository.AlipayRepository; +import co.yixiang.service.AlipayService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; + +/** + * @author Zheng Jie + * @date 2018-12-31 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class AlipayServiceImpl implements AlipayService { + + @Autowired + AlipayUtils alipayUtils; + + @Autowired + private AlipayRepository alipayRepository; + + @Override + public String toPayAsPC(AlipayConfig alipay, TradeVo trade) throws Exception { + + if(alipay.getId() == null){ + throw new BadRequestException("请先添加相应配置,再操作"); + } + AlipayClient alipayClient = new DefaultAlipayClient(alipay.getGatewayUrl(), alipay.getAppID(), alipay.getPrivateKey(), alipay.getFormat(), alipay.getCharset(), alipay.getPublicKey(), alipay.getSignType()); + + double money = Double.parseDouble(trade.getTotalAmount()); + + /** + * 创建API对应的request(电脑网页版) + */ + AlipayTradePagePayRequest request = new AlipayTradePagePayRequest(); + + /** + * 订单完成后返回的页面和异步通知地址 + */ + request.setReturnUrl(alipay.getReturnUrl()); + request.setNotifyUrl(alipay.getNotifyUrl()); + /** + * 填充订单参数 + */ + request.setBizContent("{" + + " \"out_trade_no\":\""+trade.getOutTradeNo()+"\"," + + " \"product_code\":\"FAST_INSTANT_TRADE_PAY\"," + + " \"total_amount\":"+trade.getTotalAmount()+"," + + " \"subject\":\""+trade.getSubject()+"\"," + + " \"body\":\""+trade.getBody()+"\"," + + " \"extend_params\":{" + + " \"sys_service_provider_id\":\""+alipay.getSysServiceProviderId()+"\"" + + " }"+ + " }");//填充业务参数 + /** + * 调用SDK生成表单 + * 通过GET方式,口可以获取url + */ + return alipayClient.pageExecute(request, "GET").getBody(); + + } + + @Override + public String toPayAsWeb(AlipayConfig alipay, TradeVo trade) throws Exception { + if(alipay.getId() == null){ + throw new BadRequestException("请先添加相应配置,再操作"); + } + AlipayClient alipayClient = new DefaultAlipayClient(alipay.getGatewayUrl(), alipay.getAppID(), alipay.getPrivateKey(), alipay.getFormat(), alipay.getCharset(), alipay.getPublicKey(), alipay.getSignType()); + + double money = Double.parseDouble(trade.getTotalAmount()); + if(money <= 0 || money >= 5000){ + throw new BadRequestException("测试金额过大"); + } + + /** + * 创建API对应的request(手机网页版) + */ + AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest(); + + /** + * 订单完成后返回的页面和异步通知地址 + */ + request.setReturnUrl(alipay.getReturnUrl()); + request.setNotifyUrl(alipay.getNotifyUrl()); + /** + * 填充订单参数 + */ + request.setBizContent("{" + + " \"out_trade_no\":\""+trade.getOutTradeNo()+"\"," + + " \"product_code\":\"FAST_INSTANT_TRADE_PAY\"," + + " \"total_amount\":"+trade.getTotalAmount()+"," + + " \"subject\":\""+trade.getSubject()+"\"," + + " \"body\":\""+trade.getBody()+"\"," + + " \"extend_params\":{" + + " \"sys_service_provider_id\":\""+alipay.getSysServiceProviderId()+"\"" + + " }"+ + " }");//填充业务参数 + /** + * 调用SDK生成表单 + * 通过GET方式,口可以获取url + */ + return alipayClient.pageExecute(request, "GET").getBody(); + } + + @Override + public AlipayConfig find() { + Optional alipayConfig = alipayRepository.findById(1L); + if (alipayConfig.isPresent()){ + return alipayConfig.get(); + } else { + return new AlipayConfig(); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public AlipayConfig update(AlipayConfig alipayConfig) { + return alipayRepository.save(alipayConfig); + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/impl/EmailServiceImpl.java b/yshop-tools/src/main/java/co/yixiang/service/impl/EmailServiceImpl.java new file mode 100644 index 00000000..7e6d5244 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/impl/EmailServiceImpl.java @@ -0,0 +1,91 @@ +package co.yixiang.service.impl; + +import cn.hutool.extra.mail.Mail; +import cn.hutool.extra.mail.MailAccount; +import co.yixiang.domain.EmailConfig; +import co.yixiang.domain.vo.EmailVo; +import co.yixiang.service.EmailService; +import co.yixiang.exception.BadRequestException; +import co.yixiang.repository.EmailRepository; +import co.yixiang.utils.EncryptUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; + +/** + * @author Zheng Jie + * @date 2018-12-26 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class EmailServiceImpl implements EmailService { + + @Autowired + private EmailRepository emailRepository; + + @Override + @Transactional(rollbackFor = Exception.class) + public EmailConfig update(EmailConfig emailConfig, EmailConfig old) { + try { + if(!emailConfig.getPass().equals(old.getPass())){ + // 对称加密 + emailConfig.setPass(EncryptUtils.desEncrypt(emailConfig.getPass())); + } + } catch (Exception e) { + e.printStackTrace(); + } + return emailRepository.save(emailConfig); + } + + @Override + public EmailConfig find() { + Optional emailConfig = emailRepository.findById(1L); + if(emailConfig.isPresent()){ + return emailConfig.get(); + } else { + return new EmailConfig(); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void send(EmailVo emailVo, EmailConfig emailConfig){ + if(emailConfig == null){ + throw new BadRequestException("请先配置,再操作"); + } + /** + * 封装 + */ + MailAccount account = new MailAccount(); + account.setHost(emailConfig.getHost()); + account.setPort(Integer.parseInt(emailConfig.getPort())); + account.setAuth(true); + try { + // 对称解密 + account.setPass(EncryptUtils.desDecrypt(emailConfig.getPass())); + } catch (Exception e) { + throw new BadRequestException(e.getMessage()); + } + account.setFrom(emailConfig.getUser()+"<"+emailConfig.getFromUser()+">"); + //ssl方式发送 + account.setSslEnable(true); + String content = emailVo.getContent(); + /** + * 发送 + */ + try { + Mail.create(account) + .setTos(emailVo.getTos().toArray(new String[emailVo.getTos().size()])) + .setTitle(emailVo.getSubject()) + .setContent(content) + .setHtml(true) + //关闭session + .setUseGlobalSession(false) + .send(); + }catch (Exception e){ + throw new BadRequestException(e.getMessage()); + } + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/impl/LocalStorageServiceImpl.java b/yshop-tools/src/main/java/co/yixiang/service/impl/LocalStorageServiceImpl.java new file mode 100644 index 00000000..3491e754 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/impl/LocalStorageServiceImpl.java @@ -0,0 +1,120 @@ +package co.yixiang.service.impl; + +import co.yixiang.domain.LocalStorage; +import co.yixiang.service.LocalStorageService; +import co.yixiang.utils.*; +import co.yixiang.utils.*; +import co.yixiang.repository.LocalStorageRepository; +import co.yixiang.service.dto.LocalStorageDTO; +import co.yixiang.service.dto.LocalStorageQueryCriteria; +import co.yixiang.service.mapper.LocalStorageMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.io.File; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.web.multipart.MultipartFile; + +/** +* @author Zheng Jie +* @date 2019-09-05 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class LocalStorageServiceImpl implements LocalStorageService { + + @Autowired + private LocalStorageRepository localStorageRepository; + + @Autowired + private LocalStorageMapper localStorageMapper; + + @Value("${file.path}") + private String path; + + @Value("${file.maxSize}") + private long maxSize; + + @Override + public Object queryAll(LocalStorageQueryCriteria criteria, Pageable pageable){ + Page page = localStorageRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(localStorageMapper::toDto)); + } + + @Override + public Object queryAll(LocalStorageQueryCriteria criteria){ + return localStorageMapper.toDto(localStorageRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public LocalStorageDTO findById(Long id) { + Optional localStorage = localStorageRepository.findById(id); + ValidationUtil.isNull(localStorage,"LocalStorage","id",id); + return localStorageMapper.toDto(localStorage.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public LocalStorageDTO create(String name, MultipartFile multipartFile) { + FileUtil.checkSize(maxSize, multipartFile.getSize()); + String suffix = FileUtil.getExtensionName(multipartFile.getOriginalFilename()); + // 可自行选择方式 +// String type = FileUtil.getFileTypeByMimeType(suffix); + String type = FileUtil.getFileType(suffix); + File file = FileUtil.upload(multipartFile, path + type + File.separator); + try { + name = StringUtils.isBlank(name) ? FileUtil.getFileNameNoEx(multipartFile.getOriginalFilename()) : name; + LocalStorage localStorage = new LocalStorage( + file.getName(), + name, + suffix, + file.getPath(), + type, + FileUtil.getSize(multipartFile.getSize()), + SecurityUtils.getUsername() + ); + return localStorageMapper.toDto(localStorageRepository.save(localStorage)); + }catch (Exception e){ + FileUtil.del(file); + throw e; + } + } + + public static void main(String[] args) { + File file = new File("C:\\Users\\Jie\\Pictures\\Saved Pictures\\demo1.jpg"); + System.out.println(FileUtil.getType(file)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(LocalStorage resources) { + Optional optionalLocalStorage = localStorageRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalLocalStorage,"LocalStorage","id",resources.getId()); + LocalStorage localStorage = optionalLocalStorage.get(); + localStorage.copy(resources); + localStorageRepository.save(localStorage); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + LocalStorage storage = localStorageRepository.findById(id).get(); + FileUtil.del(storage.getPath()); + localStorageRepository.delete(storage); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(Long[] ids) { + for (Long id : ids) { + LocalStorage storage = localStorageRepository.findById(id).get(); + FileUtil.del(storage.getPath()); + localStorageRepository.delete(storage); + } + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/impl/PictureServiceImpl.java b/yshop-tools/src/main/java/co/yixiang/service/impl/PictureServiceImpl.java new file mode 100644 index 00000000..3b40d551 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/impl/PictureServiceImpl.java @@ -0,0 +1,99 @@ +package co.yixiang.service.impl; + +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import co.yixiang.domain.Picture; +import co.yixiang.service.dto.PictureQueryCriteria; +import co.yixiang.utils.*; +import com.alibaba.fastjson.JSON; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.exception.BadRequestException; +import co.yixiang.repository.PictureRepository; +import co.yixiang.service.PictureService; +import co.yixiang.utils.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; +import java.io.File; +import java.util.HashMap; +import java.util.Optional; + +/** + * @author Zheng Jie + * @date 2018-12-27 + */ +@Slf4j +@Service(value = "pictureService") +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class PictureServiceImpl implements PictureService { + + @Autowired + private PictureRepository pictureRepository; + + public static final String SUCCESS = "success"; + + public static final String CODE = "code"; + + public static final String MSG = "message"; + + @Override + public Object queryAll(PictureQueryCriteria criteria, Pageable pageable){ + return PageUtil.toPage(pictureRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable)); + } + + @Override + @Transactional(rollbackFor = Throwable.class) + public Picture upload(MultipartFile multipartFile, String username) { + File file = FileUtil.toFile(multipartFile); + HashMap paramMap = new HashMap<>(1); + + paramMap.put("smfile", file); + String result= HttpUtil.post(ElAdminConstant.Url.SM_MS_URL, paramMap); + + JSONObject jsonObject = JSONUtil.parseObj(result); + Picture picture = null; + if(!jsonObject.get(CODE).toString().equals(SUCCESS)){ + throw new BadRequestException(TranslatorUtil.translate(jsonObject.get(MSG).toString())); + } + //转成实体类 + picture = JSON.parseObject(jsonObject.get("data").toString(), Picture.class); + picture.setSize(FileUtil.getSize(Integer.valueOf(picture.getSize()))); + picture.setUsername(username); + picture.setFilename(FileUtil.getFileNameNoEx(multipartFile.getOriginalFilename())+"."+FileUtil.getExtensionName(multipartFile.getOriginalFilename())); + pictureRepository.save(picture); + //删除临时文件 + FileUtil.del(file); + return picture; + + } + + @Override + public Picture findById(Long id) { + Optional picture = pictureRepository.findById(id); + ValidationUtil.isNull(picture,"Picture","id",id); + return picture.get(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Picture picture) { + try { + String result= HttpUtil.get(picture.getDelete()); + pictureRepository.delete(picture); + } catch(Exception e){ + pictureRepository.delete(picture); + } + + } + + @Override + public void deleteAll(Long[] ids) { + for (Long id : ids) { + delete(findById(id)); + } + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/impl/QiNiuServiceImpl.java b/yshop-tools/src/main/java/co/yixiang/service/impl/QiNiuServiceImpl.java new file mode 100644 index 00000000..977cc48b --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/impl/QiNiuServiceImpl.java @@ -0,0 +1,248 @@ +package co.yixiang.service.impl; + +import co.yixiang.domain.QiniuConfig; +import co.yixiang.domain.QiniuContent; +import co.yixiang.repository.QiniuContentRepository; +import co.yixiang.service.QiNiuService; +import co.yixiang.service.dto.QiniuQueryCriteria; +import co.yixiang.utils.*; +import com.alibaba.fastjson.JSON; +import com.google.gson.Gson; +import com.qiniu.common.QiniuException; +import com.qiniu.http.Response; +import com.qiniu.storage.BucketManager; +import com.qiniu.storage.Configuration; +import com.qiniu.storage.UploadManager; +import com.qiniu.storage.model.DefaultPutRet; +import com.qiniu.storage.model.FileInfo; +import com.qiniu.util.Auth; +import co.yixiang.exception.BadRequestException; +import co.yixiang.repository.QiNiuConfigRepository; +import co.yixiang.utils.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; +import java.util.Optional; + +/** + * @author Zheng Jie + * @date 2018-12-31 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class QiNiuServiceImpl implements QiNiuService { + + @Autowired + private QiNiuConfigRepository qiNiuConfigRepository; + + @Autowired + private QiniuContentRepository qiniuContentRepository; + + @Value("${qiniu.max-size}") + private Long maxSize; + + private final String TYPE = "公开"; + + @Override + public Object queryAll(QiniuQueryCriteria criteria, Pageable pageable){ + return PageUtil.toPage(qiniuContentRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable)); + } + + @Override + public QiniuConfig find() { + Optional qiniuConfig = qiNiuConfigRepository.findById(1L); + if(qiniuConfig.isPresent()){ + return qiniuConfig.get(); + } else { + return new QiniuConfig(); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public QiniuConfig update(QiniuConfig qiniuConfig) { + if (!(qiniuConfig.getHost().toLowerCase().startsWith("http://")||qiniuConfig.getHost().toLowerCase().startsWith("https://"))) { + throw new BadRequestException("外链域名必须以http://或者https://开头"); + } + qiniuConfig.setId(1L); + return qiNiuConfigRepository.save(qiniuConfig); + } + + @Override + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public QiniuContent upload(MultipartFile file, QiniuConfig qiniuConfig) { + FileUtil.checkSize(maxSize, file.getSize()); + if(qiniuConfig.getId() == null){ + throw new BadRequestException("请先添加相应配置,再操作"); + } + // 构造一个带指定Zone对象的配置类 + Configuration cfg = new Configuration(QiNiuUtil.getRegion(qiniuConfig.getZone())); + UploadManager uploadManager = new UploadManager(cfg); + Auth auth = Auth.create(qiniuConfig.getAccessKey(), qiniuConfig.getSecretKey()); + String upToken = auth.uploadToken(qiniuConfig.getBucket()); + try { + String key = file.getOriginalFilename(); + if(qiniuContentRepository.findByKey(key) != null) { + key = QiNiuUtil.getKey(key); + } + Response response = uploadManager.put(file.getBytes(), key, upToken); + //解析上传成功的结果 + + DefaultPutRet putRet = JSON.parseObject(response.bodyString(), DefaultPutRet.class); + //存入数据库 + QiniuContent qiniuContent = new QiniuContent(); + qiniuContent.setSuffix(FileUtil.getExtensionName(putRet.key)); + qiniuContent.setBucket(qiniuConfig.getBucket()); + qiniuContent.setType(qiniuConfig.getType()); + qiniuContent.setKey(FileUtil.getFileNameNoEx(putRet.key)); + qiniuContent.setUrl(qiniuConfig.getHost()+"/"+putRet.key); + qiniuContent.setSize(FileUtil.getSize(Integer.parseInt(file.getSize()+""))); + return qiniuContentRepository.save(qiniuContent); + } catch (Exception e) { + //e.printStackTrace(); + throw new BadRequestException(e.getMessage()); + } + } + +// @Override +// @Transactional(rollbackFor = Exception.class) +// public QiniuContent upload(MultipartFile file, QiniuConfig qiniuConfig) { +// FileUtil.checkSize(maxSize, file.getSize()); +// if(qiniuConfig.getId() == null){ +// throw new BadRequestException("请先添加相应配置,再操作"); +// } +// /** +// * 构造一个带指定Zone对象的配置类 +// */ +// Configuration cfg = new Configuration(QiNiuUtil.getRegion(qiniuConfig.getZone())); +// UploadManager uploadManager = new UploadManager(cfg); +// System.out.println(uploadManager); +// Auth auth = Auth.create(qiniuConfig.getAccessKey(), qiniuConfig.getSecretKey()); +// String upToken = auth.uploadToken(qiniuConfig.getBucket()); +// try { +// String key = file.getOriginalFilename(); +// +// System.out.println("key:"+key); +// if(qiniuContentRepository.findByKey(key) != null) { +// key = QiNiuUtil.getKey(key); +// } +// +// System.out.println("key1:"+key); +// System.out.println("upToken:"+upToken); +// System.out.println(file.getBytes()); +// Response response = uploadManager.put(file.getBytes(), key, upToken); +// +// System.out.println("333333333"); +// System.out.println("response:"+response); +// //解析上传成功的结果 +// DefaultPutRet putRet = new Gson().fromJson(response.bodyString(), DefaultPutRet.class); +// +// System.out.println("putRet:"+putRet); +// +// //存入数据库 +// QiniuContent qiniuContent = new QiniuContent(); +// qiniuContent.setSuffix(FileUtil.getExtensionName(putRet.key)); +// qiniuContent.setBucket(qiniuConfig.getBucket()); +// qiniuContent.setType(qiniuConfig.getType()); +// qiniuContent.setKey(FileUtil.getFileNameNoEx(putRet.key)); +// qiniuContent.setUrl(qiniuConfig.getHost()+"/"+putRet.key); +// qiniuContent.setSize(FileUtil.getSize(Integer.parseInt(file.getSize()+""))); +// return qiniuContentRepository.save(qiniuContent); +// } catch (Exception e) { +// throw new BadRequestException(e.getMessage()); +// } +// } + + @Override + public QiniuContent findByContentId(Long id) { + Optional qiniuContent = qiniuContentRepository.findById(id); + ValidationUtil.isNull(qiniuContent,"QiniuContent", "id",id); + return qiniuContent.get(); + } + + @Override + public String download(QiniuContent content,QiniuConfig config){ + String finalUrl = null; + if(TYPE.equals(content.getType())){ + finalUrl = content.getUrl(); + } else { + Auth auth = Auth.create(config.getAccessKey(), config.getSecretKey()); + /** + * 1小时,可以自定义链接过期时间 + */ + long expireInSeconds = 3600; + finalUrl = auth.privateDownloadUrl(content.getUrl(), expireInSeconds); + } + return finalUrl; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(QiniuContent content, QiniuConfig config) { + //构造一个带指定Zone对象的配置类 + Configuration cfg = new Configuration(QiNiuUtil.getRegion(config.getZone())); + Auth auth = Auth.create(config.getAccessKey(), config.getSecretKey()); + BucketManager bucketManager = new BucketManager(auth, cfg); + try { + bucketManager.delete(content.getBucket(), content.getKey() + "." + content.getSuffix()); + qiniuContentRepository.delete(content); + } catch (QiniuException ex) { + qiniuContentRepository.delete(content); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void synchronize(QiniuConfig config) { + if(config.getId() == null){ + throw new BadRequestException("请先添加相应配置,再操作"); + } + //构造一个带指定Zone对象的配置类 + Configuration cfg = new Configuration(QiNiuUtil.getRegion(config.getZone())); + Auth auth = Auth.create(config.getAccessKey(), config.getSecretKey()); + BucketManager bucketManager = new BucketManager(auth, cfg); + //文件名前缀 + String prefix = ""; + //每次迭代的长度限制,最大1000,推荐值 1000 + int limit = 1000; + //指定目录分隔符,列出所有公共前缀(模拟列出目录效果)。缺省值为空字符串 + String delimiter = ""; + //列举空间文件列表 + BucketManager.FileListIterator fileListIterator = bucketManager.createFileListIterator(config.getBucket(), prefix, limit, delimiter); + while (fileListIterator.hasNext()) { + //处理获取的file list结果 + QiniuContent qiniuContent = null; + FileInfo[] items = fileListIterator.next(); + for (FileInfo item : items) { + if(qiniuContentRepository.findByKey(FileUtil.getFileNameNoEx(item.key)) == null){ + qiniuContent = new QiniuContent(); + qiniuContent.setSize(FileUtil.getSize(Integer.parseInt(item.fsize+""))); + qiniuContent.setSuffix(FileUtil.getExtensionName(item.key)); + qiniuContent.setKey(FileUtil.getFileNameNoEx(item.key)); + qiniuContent.setType(config.getType()); + qiniuContent.setBucket(config.getBucket()); + qiniuContent.setUrl(config.getHost()+"/"+item.key); + qiniuContentRepository.save(qiniuContent); + } + } + } + } + + @Override + public void deleteAll(Long[] ids, QiniuConfig config) { + for (Long id : ids) { + delete(findByContentId(id), config); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(String type) { + qiNiuConfigRepository.update(type); + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/impl/VerificationCodeServiceImpl.java b/yshop-tools/src/main/java/co/yixiang/service/impl/VerificationCodeServiceImpl.java new file mode 100644 index 00000000..48343cdd --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/impl/VerificationCodeServiceImpl.java @@ -0,0 +1,85 @@ +package co.yixiang.service.impl; + +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.extra.template.Template; +import cn.hutool.extra.template.TemplateConfig; +import cn.hutool.extra.template.TemplateEngine; +import cn.hutool.extra.template.TemplateUtil; +import co.yixiang.domain.VerificationCode; +import co.yixiang.domain.vo.EmailVo; +import co.yixiang.repository.VerificationCodeRepository; +import co.yixiang.service.VerificationCodeService; +import co.yixiang.exception.BadRequestException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Arrays; +import java.util.concurrent.*; + +/** + * @author Zheng Jie + * @date 2018-12-26 + */ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class VerificationCodeServiceImpl implements VerificationCodeService { + + @Autowired + private VerificationCodeRepository verificationCodeRepository; + + @Value("${code.expiration}") + private Integer expiration; + + @Override + @Transactional(rollbackFor = Exception.class) + public EmailVo sendEmail(VerificationCode code) { + EmailVo emailVo = null; + String content = ""; + VerificationCode verificationCode = verificationCodeRepository.findByScenesAndTypeAndValueAndStatusIsTrue(code.getScenes(),code.getType(),code.getValue()); + // 如果不存在有效的验证码,就创建一个新的 + TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); + Template template = engine.getTemplate("email/email.ftl"); + if(verificationCode == null){ + code.setCode(RandomUtil.randomNumbers (6)); + content = template.render(Dict.create().set("code",code.getCode())); + emailVo = new EmailVo(Arrays.asList(code.getValue()),"eladmin后台管理系统",content); + timedDestruction(verificationCodeRepository.save(code)); + // 存在就再次发送原来的验证码 + } else { + content = template.render(Dict.create().set("code",verificationCode.getCode())); + emailVo = new EmailVo(Arrays.asList(verificationCode.getValue()),"eladmin后台管理系统",content); + } + return emailVo; + } + + @Override + public void validated(VerificationCode code) { + VerificationCode verificationCode = verificationCodeRepository.findByScenesAndTypeAndValueAndStatusIsTrue(code.getScenes(),code.getType(),code.getValue()); + if(verificationCode == null || !verificationCode.getCode().equals(code.getCode())){ + throw new BadRequestException("无效验证码"); + } else { + verificationCode.setStatus(false); + verificationCodeRepository.save(verificationCode); + } + } + + /** + * 定时任务,指定分钟后改变验证码状态 + * @param verifyCode + */ + private void timedDestruction(VerificationCode verifyCode) { + //以下示例为程序调用结束继续运行 + ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); + try { + executorService.schedule(() -> { + verifyCode.setStatus(false); + verificationCodeRepository.save(verifyCode); + }, expiration * 60 * 1000L, TimeUnit.MILLISECONDS); + }catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/service/mapper/LocalStorageMapper.java b/yshop-tools/src/main/java/co/yixiang/service/mapper/LocalStorageMapper.java new file mode 100644 index 00000000..f13e097a --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/service/mapper/LocalStorageMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.service.mapper; + +import co.yixiang.domain.LocalStorage; +import co.yixiang.service.dto.LocalStorageDTO; +import co.yixiang.mapper.EntityMapper; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-09-05 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface LocalStorageMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-tools/src/main/java/co/yixiang/utils/AliPayStatusEnum.java b/yshop-tools/src/main/java/co/yixiang/utils/AliPayStatusEnum.java new file mode 100644 index 00000000..439958ea --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/utils/AliPayStatusEnum.java @@ -0,0 +1,41 @@ +package co.yixiang.utils; + +/** + * 支付状态 + * @author zhengjie + * @date 2018/08/01 16:45:43 + */ +public enum AliPayStatusEnum { + + /** + * 交易成功 + */ + FINISHED("交易成功", "TRADE_FINISHED"), + + /** + * 支付成功 + */ + SUCCESS("支付成功", "TRADE_SUCCESS"), + + /** + * 交易创建 + */ + BUYER_PAY("交易创建", "WAIT_BUYER_PAY"), + + /** + * 交易关闭 + */ + CLOSED("交易关闭", "TRADE_CLOSED"); + + private String name; + private String value; + + AliPayStatusEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/utils/AlipayUtils.java b/yshop-tools/src/main/java/co/yixiang/utils/AlipayUtils.java new file mode 100644 index 00000000..1e15df78 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/utils/AlipayUtils.java @@ -0,0 +1,79 @@ +package co.yixiang.utils; + +import cn.hutool.core.util.StrUtil; +import com.alipay.api.AlipayApiException; +import com.alipay.api.internal.util.AlipaySignature; +import co.yixiang.domain.AlipayConfig; +import org.springframework.stereotype.Component; +import javax.servlet.http.HttpServletRequest; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * 支付宝工具类 + * @author zhengjie + * @date 2018/09/30 14:04:35 + */ +@Component +public class AlipayUtils { + + /** + * 生成订单号 + * @return + */ + public String getOrderCode() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + int a = (int)(Math.random() * 9000.0D) + 1000; + System.out.println(a); + Date date = new Date(); + String str = sdf.format(date); + String[] split = str.split("-"); + String s = split[0] + split[1] + split[2]; + String[] split1 = s.split(" "); + String s1 = split1[0] + split1[1]; + String[] split2 = s1.split(":"); + String s2 = split2[0] + split2[1] + split2[2] + a; + return s2; + } + + /** + * 校验签名 + * @param request + * @return + */ + public boolean rsaCheck(HttpServletRequest request, AlipayConfig alipay){ + + /** + * 获取支付宝POST过来反馈信息 + */ + Map params = new HashMap<>(1); + Map requestParams = request.getParameterMap(); + for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext();) { + String name = (String) iter.next(); + String[] values = (String[]) requestParams.get(name); + String valueStr = ""; + for (int i = 0; i < values.length; i++) { + valueStr = (i == values.length - 1) ? valueStr + values[i] + : valueStr + values[i] + ","; + } + params.put(name, valueStr); + } + + try { + boolean verifyResult = AlipaySignature.rsaCheckV1(params, + alipay.getPublicKey(), + alipay.getCharset(), + alipay.getSignType()); + return verifyResult; + } catch (AlipayApiException e) { + return false; + } + } + + public boolean isEmpty(String str){ + return StrUtil.isEmpty(str); + } +} diff --git a/yshop-tools/src/main/java/co/yixiang/utils/QiNiuUtil.java b/yshop-tools/src/main/java/co/yixiang/utils/QiNiuUtil.java new file mode 100644 index 00000000..9937c6e1 --- /dev/null +++ b/yshop-tools/src/main/java/co/yixiang/utils/QiNiuUtil.java @@ -0,0 +1,58 @@ +package co.yixiang.utils; + +import com.qiniu.storage.Region; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * 七牛云存储工具类 + * @author Zheng Jie + * @date 2018-12-31 + */ +public class QiNiuUtil { + + public static final String HUAD = "华东"; + + public static final String HUAB = "华北"; + + public static final String HUAN = "华南"; + + public static final String BEIM = "北美"; + + /** + * 得到机房的对应关系 + * @param zone + * @return + */ + public static Region getRegion(String zone){ + + if(HUAD.equals(zone)){ + return Region.huadong(); + } else if(HUAB.equals(zone)){ + return Region.huabei(); + } else if(HUAN.equals(zone)){ + return Region.huanan(); + } else if (BEIM.equals(zone)){ + return Region.beimei(); + // 否则就是东南亚 + } else { + return Region.qvmHuadong(); + } + } + + /** + * 默认不指定key的情况下,以文件内容的hash值作为文件名 + * @param file + * @return + */ + public static String getKey(String file){ + StringBuffer key = new StringBuffer(FileUtil.getFileNameNoEx(file)); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); + Date date = new Date(); + key.append("-"); + key.append(sdf.format(date)); + key.append("."); + key.append(FileUtil.getExtensionName(file)); + return key.toString(); + } +}