diff --git a/.gitignore b/.gitignore index a1415862..9363e7a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ -*.classpath -*.project +### IDEA ### +.idea/* *.iml -*.factorypath -target -.idea/ -*.log +*/target/* +*/*.iml +/fx.jpg +/poster.jpg +/simsunb.ttf +/spy.log +/Alibaba-PuHuiTi-Regular.otf 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 index e7e0aa82..6770b0ca 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,14 @@ #### 项目简介 -yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2+Jpa+MybatisPlus+SpringSecurity+jwt+redis+Vue的前后端分离的商城系统, 包含商城、拼团、砍价、商户管理、 秒杀、优惠券、积分、分销、会员、充值、到店核销等功能,更适合企业或个人二次开发;; +yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2+Jpa+MybatisPlus+SpringSecurity+jwt+redis+Vue的前后端分离的商城系统, 包含商城、拼团、砍价、商户管理、 秒杀、优惠券、积分、分销、会员、充值、多门店等功能,更适合企业或个人二次开发;; -**开发文档** 【[查看文档](https://gitee.com/guchengwuyue/yshopmall/wikis/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83?sort_id=1718722)】 -#### 体验地址 +#### 体验地址(里面有演示地址与文档) -| | 后台系统 | 前端(公众号+小程序(mpvue2.0),关注公众号即可体验公众号与小程序) | +| | 官网文档地址 | https://www.yixiang.co | |--- |--- | --- | -| | https://www.yixiang.co |H5:https://h5.yixiang.co 测试号:hupeng/123456,也可以自行注册 | -| | 后台体验账号/密码:admin/123456 | 公众号:![输入图片说明](https://images.gitee.com/uploads/images/2019/1116/060936_fd73496c_477893.jpeg "qrcode_for_gh_95df5a2881cc_258.jpg") | + #### 项目源码 @@ -21,38 +19,19 @@ yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2 | 码云 | https://gitee.com/guchengwuyue/yshopmall | https://gitee.com/guchengwuyue/yshopmall_qd | | github | https://github.com/guchengwuyue/yshopmall |https://github.com/guchengwuyue/yshopmall_qd | -#### 开源版本与VIP版本说明 -### 开源版 -1.包括整个商城系统后台、数据库 - -2.开源整个商城的管理后台(后台已经封装好了图片素材库、编辑器、配置等等组件), 它可以用于所有的Web应用程序,如网站商城管理后台,网站会员中心, -CMS,CRM,OA等等本版本本身属于独立后台商城管理系统; - -3.可以个人、企业直接使用。 - -### VIP版 -1.包括了开源版,还包括了移动端(H5+公众号)、小程序(mpvue2框架)、移动端API - -2.本版本是演示的所有功能代码; - -3.加入VIP、享有后续所有功能免费升级及其技术支持等。 - -4、VIP为终身,【[详情请查看](https://gitee.com/guchengwuyue/yshopmall/wikis/pages?sort_id=1715823&doc_id=441578)】 ## 商城功能 * 一:商品模块:商品添加、规格设置,商品上下架等 * 二:订单模块:下单、购物车、支付,发货、收货、评价、退款等 -* 三:营销模块:积分、优惠券、分销、砍价、拼团、秒杀(、到店核销等 +* 三:营销模块:积分、优惠券、分销、砍价、拼团、秒杀、多门店等 * 四:微信模块:自定义菜单、自动回复、微信授权、图文管理、模板消息推送 * 五:配置模块:各种配置 -* 六:用户模块:登陆、注册、会员卡等 +* 六:用户模块:登陆、注册、会员卡、充值等 * 七:其他等 -#### 已经完成功能 -- 可以具体查看演示地址查看当前版本已经完成的功能,不再絮叨啦 #### 项目结构 项目采用分模块开发方式 @@ -86,16 +65,8 @@ CMS,CRM,OA等等本版本本身属于独立后台商城管理系统; - - - - - - - - - - + +
@@ -123,49 +94,9 @@ CMS,CRM,OA等等本版本本身属于独立后台商城管理系统; * 前端使用技术 * 2.1 Vue 全家桶 * 2.2 Element - * 2.3 mpvue + * 2.3 mpvue + * 2.3 uniapp -#### 项目发布明细 - -- 1.0版本 -- 1.1版本新增积分与优惠券抵扣 -- 1.2版本分销功能已经发布 -- 1.2.1增加了未付款订单取消功能库存销量退出、优惠券、积分功能,个人中心增加了积分流水 -- 1.3版本新增拼团功能,已经发布 -- 1.3.1版本手机端新增商户管理、后台新增统计 -- 1.3.2新增后台微信相关及其支付配置,新增自动回复配置 -- 1.3.3新增 后台微信图文发送功能,小程序配置,增加小程序授权等,修复一些bug等 -- yshop1.6.1发布:新增移动端浏览记录,下单增加简单ReentrantLock锁 -- yshop1.6.2发布:修复用户昵称带有表情导致入库失败问题,修复下单订单金额为0不能支付的问题 -- yshop1.6.4发布:后台新增修改订单价格与备注优化订单详情显示明细,修复积分记录标题不显示的问题 -- yshop1.9.1,新增城市接口,修复小程序登陆与支付问题,发布mpvue1.0小程序 -- yshop1.9.4,新增小程序普通二维码功能及其修复小程序其他问题,详情登陆演示后台查看明细 -- yshop2.0发布更新如下: -- 1、优化代码结构与名称,修改get请求参数其统一继承分页参数 -- 2、新增redis监听未付款30分钟取消功能与7天自动收货功能,mq队列作为备选(注释掉) -- 3、新增门店到店核销功能 -- 4、新增分销全局开关#I19HB1 -- 5、积分新增消费限制#I19TUR -- 6、新增充值功能#I18V5D -- 7、后台菜单调整,新增财务模块 -- 8、优化后台配置赋值写法 -- 9、修复管理后台新增表单之后如果直接再新增数据导致默认数据缺失问题#I1AFBK -- 10、修复提交购物车可能查询多条数据的问题 -- 11、后台登陆背景图固定#I1A0LS -- 12、增加常量与枚举优化硬编码问题 -- 13、微信支付、公众号、模板消息修改 -- 14、修复代码生成器不全的问题#I1AIO4 -- 15、修复营销产品拼团等轮播图不能修改的问题#I1AHXR -- 16、移除yshop-monitor模块 -- 17、修复退货理由文字错误#I1AQ7D -- 18、修复新增分类的图片自动显示上次一次的图片#I1AQBK -- 19、新增微信jssdk接口返回所需js权限 -- 20、新增余额充值变动模板消息通知 -- 21、首页数据缓存优化 -- 22、新增未支付订单显示到期时间 -- 23、修复加入购物车购买后,后台订单中的商品信息数据重复#I1AXNX -- 24、修复后台-管理商品-规格属性 属性无法删除问题#I1AYL2 -- 25、修复公众号商品直接微信分享标题不显示的问题#I1AX0R diff --git a/pom.xml b/pom.xml index c932c3c1..87a09e42 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ co.yixiang yshop pom - 2.2 + 2.1 yshop-common @@ -18,7 +18,6 @@ yshop-api yshop-mp yshop-shop - yshop-mproot YSHOP商城管理系统 @@ -126,17 +125,12 @@ swagger-models 1.5.21 - - - - com.github.xiaoymin - knife4j-spring-boot-starter - 2.0.1 + mysql diff --git a/sql/2.1升级yx_system_group_data.sql b/sql/2.1升级yx_system_group_data.sql index 16ac7c74..cd6a33a5 100644 --- a/sql/2.1升级yx_system_group_data.sql +++ b/sql/2.1升级yx_system_group_data.sql @@ -1,78 +1,78 @@ -/* - Navicat Premium Data Transfer - - Source Server : localhost - Source Server Type : MySQL - Source Server Version : 50723 - Source Host : localhost:3306 - Source Schema : yxshop - - Target Server Type : MySQL - Target Server Version : 50723 - File Encoding : 65001 - - Date: 08/04/2020 14:33:54 -*/ - -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- 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', - `group_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '对应的数据名称', - `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) NULL DEFAULT 0 COMMENT '数据排序', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态(1:开启;2:关闭;)', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 237 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组合数据详情表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_system_group_data --- ---------------------------- -INSERT INTO `yx_system_group_data` VALUES (177, 'yshop_home_banner', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\"],\"name\":\"banner\",\"id\":177,\"pic\":\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\",\"sort\":1,\"url\":\"wwww\",\"status\":1}', 1571387677, 1, 1); -INSERT INTO `yx_system_group_data` VALUES (180, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e85bfa61251d.png\"],\"uniapp_url\":\"/pages/shop/GoodsClass/index\",\"name\":\"全部商品\",\"id\":180,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa61251d.png\",\"sort\":9,\"url\":\"/goods_list\",\"wxapp_url\":\"/pages/shop/GoodsClass/main\",\"status\":1}', 1571390842, 9, 1); -INSERT INTO `yx_system_group_data` VALUES (182, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":182,\"pic\":\"https://i.loli.net/2019/10/18/DqOUgNf7wjuFpPT.png\",\"sort\":2,\"title\":\"分销、拼团、商户功能上线啦!\",\"url\":\"/news_list\",\"info\":\"yshop2.0上线啦\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 0, 2, 1); -INSERT INTO `yx_system_group_data` VALUES (183, 'yshop_hot_search', '{\"id\":183,\"title\":\"照片\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (184, 'yshop_hot_search', '{\"id\":184,\"title\":\"springboot\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (187, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":187,\"sort\":1,\"url\":\"/news_list\",\"info\":\"springboot2+JPA+Mybatisplus商城系统\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1572086163, 1, 1); -INSERT INTO `yx_system_group_data` VALUES (188, 'yshop_hot_search', '{\"id\":188,\"title\":\"打印\"}', 1572086172, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (189, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dec896eeb25a.png\"],\"uniapp_url\":\"/pages/user/UserVip/index\",\"name\":\"会员中心\",\"id\":189,\"pic\":\"https://image.dayouqiantu.cn/5dec896eeb25a.png\",\"sort\":9,\"url\":\"/user/vip\",\"wxapp_url\":\"/pages/user/UserVip/main\",\"status\":1}', 1572087722, 9, 1); -INSERT INTO `yx_system_group_data` VALUES (190, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428984d64d.png\"],\"uniapp_url\":\"/pages/user/coupon/UserCoupon/index\",\"name\":\"优惠券\",\"id\":190,\"pic\":\"https://image.dayouqiantu.cn/5db428984d64d.png\",\"sort\":8,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/UserCoupon/main\",\"status\":1}', 0, 8, 1); -INSERT INTO `yx_system_group_data` VALUES (191, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"收藏商品\",\"id\":191,\"pic\":\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 0, 7, 1); -INSERT INTO `yx_system_group_data` VALUES (192, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428bd61b73.png\"],\"uniapp_url\":\"/pages/user/address/AddressManagement/index\",\"name\":\"地址管理\",\"id\":192,\"pic\":\"https://image.dayouqiantu.cn/5db428bd61b73.png\",\"sort\":6,\"url\":\"/user/add_manage\",\"wxapp_url\":\"/pages/user/address/AddressManagement/main\",\"status\":1}', 0, 6, 1); -INSERT INTO `yx_system_group_data` VALUES (193, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428e28dd48.png\"],\"uniapp_url\":\"/pages/user/promotion/UserPromotion/index\",\"name\":\"我的推广\",\"id\":193,\"pic\":\"https://image.dayouqiantu.cn/5db428e28dd48.png\",\"sort\":5,\"url\":\"/user/user_promotion\",\"wxapp_url\":\"/pages/user/promotion/UserPromotion/main\",\"status\":1}', 0, 5, 1); -INSERT INTO `yx_system_group_data` VALUES (194, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db42a4208c55.png\"],\"uniapp_url\":\"/pages/user/UserAccount/index\",\"name\":\"我的余额\",\"id\":194,\"pic\":\"https://image.dayouqiantu.cn/5db42a4208c55.png\",\"sort\":4,\"url\":\"/user/account\",\"wxapp_url\":\"/pages/user/UserAccount/main\",\"status\":1}', 0, 4, 1); -INSERT INTO `yx_system_group_data` VALUES (195, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428f410462.png\"],\"uniapp_url\":\"/pages/user/signIn/Integral/index\",\"name\":\"我的积分\",\"id\":195,\"pic\":\"https://image.dayouqiantu.cn/5db428f410462.png\",\"sort\":3,\"url\":\"/user/integral\",\"wxapp_url\":\"/pages/user/signIn/Integral/main\",\"status\":1}', 0, 3, 1); -INSERT INTO `yx_system_group_data` VALUES (196, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93f004713.png\"],\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"name\":\"图文资讯\",\"id\":196,\"pic\":\"https://image.dayouqiantu.cn/5e85bfea151b7.png\",\"sort\":8,\"url\":\"/news_list\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1573109648, 8, 1); -INSERT INTO `yx_system_group_data` VALUES (197, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e939507b5e.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"我的收藏\",\"id\":197,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa55f352.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 1573109723, 7, 1); -INSERT INTO `yx_system_group_data` VALUES (199, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93c9a8304.png\"],\"uniapp_url\":\"/pages/user/coupon/GetCoupon/index\",\"name\":\"优惠券\",\"id\":199,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa6621ca.png\",\"sort\":6,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/GetCoupon/main\",\"status\":1}', 1573387422, 6, 1); -INSERT INTO `yx_system_group_data` VALUES (200, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e925140b57.png\"],\"uniapp_url\":\"/pages/activity/GoodsGroup/index\",\"name\":\"拼团专区\",\"id\":200,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa4b273f.png\",\"sort\":5,\"url\":\"/activity/group\",\"wxapp_url\":\"/pages/activity/GoodsGroup/main\",\"status\":1}', 0, 5, 1); -INSERT INTO `yx_system_group_data` VALUES (201, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\"],\"uniapp_url\":\"/pages/orderAdmin/OrderIndex/index\",\"name\":\"商户管理\",\"id\":201,\"pic\":\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\",\"sort\":2,\"url\":\"/customer/index\",\"wxapp_url\":\"/pages/orderAdmin/OrderIndex/main\",\"status\":1}', 0, 2, 1); -INSERT INTO `yx_system_group_data` VALUES (202, 'yshop_sign_day_num', '{\"sign_num\":\"10\",\"id\":205,\"day\":\"第一天\"}', 0, 9, 1); -INSERT INTO `yx_system_group_data` VALUES (203, 'yshop_sign_day_num', '{\"sign_num\":\"20\",\"id\":\"\",\"day\":\"第二天\"}', 0, 8, 1); -INSERT INTO `yx_system_group_data` VALUES (204, 'yshop_sign_day_num', '{\"sign_num\":\"30\",\"id\":\"\",\"day\":\"第三天\"}', 0, 7, 1); -INSERT INTO `yx_system_group_data` VALUES (205, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"40\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第四天\",\"status\":\"\"}', 0, 6, 1); -INSERT INTO `yx_system_group_data` VALUES (206, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"50\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第五天\",\"status\":\"\"}', 0, 5, 1); -INSERT INTO `yx_system_group_data` VALUES (207, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"60\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第六天\",\"status\":\"\"}', 0, 4, 1); -INSERT INTO `yx_system_group_data` VALUES (208, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"100\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"奖励\",\"status\":\"\"}', 0, 3, 1); -INSERT INTO `yx_system_group_data` VALUES (209, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93010a248.png\"],\"uniapp_url\":\"/pages/user/signIn/Sign/index\",\"name\":\"积分签到\",\"id\":209,\"pic\":\"https://image.dayouqiantu.cn/5e85bf8e494f2.png\",\"sort\":4,\"url\":\"/user/sign\",\"wxapp_url\":\"/pages/user/signIn/Sign/main\",\"status\":1}', 0, 4, 1); -INSERT INTO `yx_system_group_data` VALUES (210, 'yshop_seckill_time', '{\"continued\":2,\"id\":\"\",\"time\":5}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (211, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"7\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (212, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"2\",\"id\":\"\",\"sort\":\"\",\"time\":\"10\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (213, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"12\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (214, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"4\",\"id\":\"\",\"sort\":\"\",\"time\":\"15\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (215, 'yshop_seckill_time', '{\"continued\":\"2\",\"id\":223,\"time\":\"19\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (216, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e929f9be59.png\"],\"uniapp_url\":\"/pages/activity/GoodsSeckill/index\",\"name\":\"秒杀专区\",\"id\":216,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa5a9f85.png\",\"sort\":3,\"url\":\"/activity/goods_seckill\",\"wxapp_url\":\"/pages/activity/GoodsSeckill/main\",\"status\":1}', 0, 3, 1); -INSERT INTO `yx_system_group_data` VALUES (217, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e9276c608f.png\"],\"uniapp_url\":\"/pages/activity/GoodsBargain/index\",\"name\":\"砍价专区\",\"id\":217,\"pic\":\"https://image.dayouqiantu.cn/5e85bfe9b1da8.png\",\"sort\":2,\"url\":\"/activity/bargain\",\"wxapp_url\":\"/pages/activity/GoodsBargain/main\",\"status\":1}', 0, 2, 1); -INSERT INTO `yx_system_group_data` VALUES (218, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dfd7b748e053.png\"],\"uniapp_url\":\"/pages/activity/BargainRecord/index\",\"name\":\"砍价记录\",\"id\":218,\"pic\":\"https://image.dayouqiantu.cn/5dfd7b748e053.png\",\"sort\":1,\"url\":\"/activity/bargain/record\",\"wxapp_url\":\"/pages/activity/BargainRecord/main\",\"status\":1}', 0, 1, 1); -INSERT INTO `yx_system_group_data` VALUES (219, 'yshop_home_banner', '{\"name\":\"222\",\"id\":\"\",\"pic\":\"https://image.dayouqiantu.cn/5c9f117f624ee.jpg\",\"sort\":\"\",\"url\":\"/\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (221, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e60da498cfdd.png\"],\"name\":\"订单核销\",\"id\":230,\"pic\":\"https://image.dayouqiantu.cn/5e60da498cfdd.png\",\"sort\":0,\"url\":\"/order/order_cancellation\",\"wxapp_url\":\"\",\"status\":1}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (222, 'yshop_recharge_price_ways', '{\"give_price\":\"10\",\"price\":\"100\",\"id\":\"\",\"sort\":0,\"status\":1}', 0, 1, 1); -INSERT INTO `yx_system_group_data` VALUES (223, 'yshop_recharge_price_ways', '{\"give_price\":\"1\",\"price\":1,\"id\":\"\",\"sort\":0,\"status\":1}', 0, 0, 1); - -SET FOREIGN_KEY_CHECKS = 1; +/* + Navicat Premium Data Transfer + + Source Server : localhost + Source Server Type : MySQL + Source Server Version : 50723 + Source Host : localhost:3306 + Source Schema : yxshop + + Target Server Type : MySQL + Target Server Version : 50723 + File Encoding : 65001 + + Date: 08/04/2020 14:33:54 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- 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', + `group_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '对应的数据名称', + `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) NULL DEFAULT 0 COMMENT '数据排序', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态(1:开启;2:关闭;)', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 237 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组合数据详情表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_group_data +-- ---------------------------- +INSERT INTO `yx_system_group_data` VALUES (177, 'yshop_home_banner', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\"],\"name\":\"banner\",\"id\":177,\"pic\":\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\",\"sort\":1,\"url\":\"wwww\",\"status\":1}', 1571387677, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (180, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e85bfa61251d.png\"],\"uniapp_url\":\"/pages/shop/GoodsClass/index\",\"name\":\"全部商品\",\"id\":180,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa61251d.png\",\"sort\":9,\"url\":\"/goods_list\",\"wxapp_url\":\"/pages/shop/GoodsClass/main\",\"status\":1}', 1571390842, 9, 1); +INSERT INTO `yx_system_group_data` VALUES (182, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":182,\"pic\":\"https://i.loli.net/2019/10/18/DqOUgNf7wjuFpPT.png\",\"sort\":2,\"title\":\"分销、拼团、商户功能上线啦!\",\"url\":\"/news_list\",\"info\":\"yshop2.0上线啦\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 0, 2, 1); +INSERT INTO `yx_system_group_data` VALUES (183, 'yshop_hot_search', '{\"id\":183,\"title\":\"照片\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (184, 'yshop_hot_search', '{\"id\":184,\"title\":\"springboot\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (187, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":187,\"sort\":1,\"url\":\"/news_list\",\"info\":\"springboot2+JPA+Mybatisplus商城系统\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1572086163, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (188, 'yshop_hot_search', '{\"id\":188,\"title\":\"打印\"}', 1572086172, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (189, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dec896eeb25a.png\"],\"uniapp_url\":\"/pages/user/UserVip/index\",\"name\":\"会员中心\",\"id\":189,\"pic\":\"https://image.dayouqiantu.cn/5dec896eeb25a.png\",\"sort\":9,\"url\":\"/user/vip\",\"wxapp_url\":\"/pages/user/UserVip/main\",\"status\":1}', 1572087722, 9, 1); +INSERT INTO `yx_system_group_data` VALUES (190, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428984d64d.png\"],\"uniapp_url\":\"/pages/user/coupon/UserCoupon/index\",\"name\":\"优惠券\",\"id\":190,\"pic\":\"https://image.dayouqiantu.cn/5db428984d64d.png\",\"sort\":8,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/UserCoupon/main\",\"status\":1}', 0, 8, 1); +INSERT INTO `yx_system_group_data` VALUES (191, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"收藏商品\",\"id\":191,\"pic\":\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 0, 7, 1); +INSERT INTO `yx_system_group_data` VALUES (192, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428bd61b73.png\"],\"uniapp_url\":\"/pages/user/address/AddressManagement/index\",\"name\":\"地址管理\",\"id\":192,\"pic\":\"https://image.dayouqiantu.cn/5db428bd61b73.png\",\"sort\":6,\"url\":\"/user/add_manage\",\"wxapp_url\":\"/pages/user/address/AddressManagement/main\",\"status\":1}', 0, 6, 1); +INSERT INTO `yx_system_group_data` VALUES (193, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428e28dd48.png\"],\"uniapp_url\":\"/pages/user/promotion/UserPromotion/index\",\"name\":\"我的推广\",\"id\":193,\"pic\":\"https://image.dayouqiantu.cn/5db428e28dd48.png\",\"sort\":5,\"url\":\"/user/user_promotion\",\"wxapp_url\":\"/pages/user/promotion/UserPromotion/main\",\"status\":1}', 0, 5, 1); +INSERT INTO `yx_system_group_data` VALUES (194, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db42a4208c55.png\"],\"uniapp_url\":\"/pages/user/UserAccount/index\",\"name\":\"我的余额\",\"id\":194,\"pic\":\"https://image.dayouqiantu.cn/5db42a4208c55.png\",\"sort\":4,\"url\":\"/user/account\",\"wxapp_url\":\"/pages/user/UserAccount/main\",\"status\":1}', 0, 4, 1); +INSERT INTO `yx_system_group_data` VALUES (195, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428f410462.png\"],\"uniapp_url\":\"/pages/user/signIn/Integral/index\",\"name\":\"我的积分\",\"id\":195,\"pic\":\"https://image.dayouqiantu.cn/5db428f410462.png\",\"sort\":3,\"url\":\"/user/integral\",\"wxapp_url\":\"/pages/user/signIn/Integral/main\",\"status\":1}', 0, 3, 1); +INSERT INTO `yx_system_group_data` VALUES (196, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93f004713.png\"],\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"name\":\"图文资讯\",\"id\":196,\"pic\":\"https://image.dayouqiantu.cn/5e85bfea151b7.png\",\"sort\":8,\"url\":\"/news_list\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1573109648, 8, 1); +INSERT INTO `yx_system_group_data` VALUES (197, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e939507b5e.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"我的收藏\",\"id\":197,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa55f352.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 1573109723, 7, 1); +INSERT INTO `yx_system_group_data` VALUES (199, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93c9a8304.png\"],\"uniapp_url\":\"/pages/user/coupon/GetCoupon/index\",\"name\":\"优惠券\",\"id\":199,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa6621ca.png\",\"sort\":6,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/GetCoupon/main\",\"status\":1}', 1573387422, 6, 1); +INSERT INTO `yx_system_group_data` VALUES (200, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e925140b57.png\"],\"uniapp_url\":\"/pages/activity/GoodsGroup/index\",\"name\":\"拼团专区\",\"id\":200,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa4b273f.png\",\"sort\":5,\"url\":\"/activity/group\",\"wxapp_url\":\"/pages/activity/GoodsGroup/main\",\"status\":1}', 0, 5, 1); +INSERT INTO `yx_system_group_data` VALUES (201, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\"],\"uniapp_url\":\"/pages/orderAdmin/OrderIndex/index\",\"name\":\"商户管理\",\"id\":201,\"pic\":\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\",\"sort\":2,\"url\":\"/customer/index\",\"wxapp_url\":\"/pages/orderAdmin/OrderIndex/main\",\"status\":1}', 0, 2, 1); +INSERT INTO `yx_system_group_data` VALUES (202, 'yshop_sign_day_num', '{\"sign_num\":\"10\",\"id\":205,\"day\":\"第一天\"}', 0, 9, 1); +INSERT INTO `yx_system_group_data` VALUES (203, 'yshop_sign_day_num', '{\"sign_num\":\"20\",\"id\":\"\",\"day\":\"第二天\"}', 0, 8, 1); +INSERT INTO `yx_system_group_data` VALUES (204, 'yshop_sign_day_num', '{\"sign_num\":\"30\",\"id\":\"\",\"day\":\"第三天\"}', 0, 7, 1); +INSERT INTO `yx_system_group_data` VALUES (205, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"40\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第四天\",\"status\":\"\"}', 0, 6, 1); +INSERT INTO `yx_system_group_data` VALUES (206, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"50\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第五天\",\"status\":\"\"}', 0, 5, 1); +INSERT INTO `yx_system_group_data` VALUES (207, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"60\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第六天\",\"status\":\"\"}', 0, 4, 1); +INSERT INTO `yx_system_group_data` VALUES (208, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"100\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"奖励\",\"status\":\"\"}', 0, 3, 1); +INSERT INTO `yx_system_group_data` VALUES (209, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93010a248.png\"],\"uniapp_url\":\"/pages/user/signIn/Sign/index\",\"name\":\"积分签到\",\"id\":209,\"pic\":\"https://image.dayouqiantu.cn/5e85bf8e494f2.png\",\"sort\":4,\"url\":\"/user/sign\",\"wxapp_url\":\"/pages/user/signIn/Sign/main\",\"status\":1}', 0, 4, 1); +INSERT INTO `yx_system_group_data` VALUES (210, 'yshop_seckill_time', '{\"continued\":2,\"id\":\"\",\"time\":5}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (211, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"7\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (212, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"2\",\"id\":\"\",\"sort\":\"\",\"time\":\"10\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (213, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"12\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (214, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"4\",\"id\":\"\",\"sort\":\"\",\"time\":\"15\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (215, 'yshop_seckill_time', '{\"continued\":\"2\",\"id\":223,\"time\":\"19\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (216, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e929f9be59.png\"],\"uniapp_url\":\"/pages/activity/GoodsSeckill/index\",\"name\":\"秒杀专区\",\"id\":216,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa5a9f85.png\",\"sort\":3,\"url\":\"/activity/goods_seckill\",\"wxapp_url\":\"/pages/activity/GoodsSeckill/main\",\"status\":1}', 0, 3, 1); +INSERT INTO `yx_system_group_data` VALUES (217, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e9276c608f.png\"],\"uniapp_url\":\"/pages/activity/GoodsBargain/index\",\"name\":\"砍价专区\",\"id\":217,\"pic\":\"https://image.dayouqiantu.cn/5e85bfe9b1da8.png\",\"sort\":2,\"url\":\"/activity/bargain\",\"wxapp_url\":\"/pages/activity/GoodsBargain/main\",\"status\":1}', 0, 2, 1); +INSERT INTO `yx_system_group_data` VALUES (218, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dfd7b748e053.png\"],\"uniapp_url\":\"/pages/activity/BargainRecord/index\",\"name\":\"砍价记录\",\"id\":218,\"pic\":\"https://image.dayouqiantu.cn/5dfd7b748e053.png\",\"sort\":1,\"url\":\"/activity/bargain/record\",\"wxapp_url\":\"/pages/activity/BargainRecord/main\",\"status\":1}', 0, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (219, 'yshop_home_banner', '{\"name\":\"222\",\"id\":\"\",\"pic\":\"https://image.dayouqiantu.cn/5c9f117f624ee.jpg\",\"sort\":\"\",\"url\":\"/\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (221, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e60da498cfdd.png\"],\"name\":\"订单核销\",\"id\":230,\"pic\":\"https://image.dayouqiantu.cn/5e60da498cfdd.png\",\"sort\":0,\"url\":\"/order/order_cancellation\",\"wxapp_url\":\"\",\"status\":1}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (222, 'yshop_recharge_price_ways', '{\"give_price\":\"10\",\"price\":\"100\",\"id\":\"\",\"sort\":0,\"status\":1}', 0, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (223, 'yshop_recharge_price_ways', '{\"give_price\":\"1\",\"price\":1,\"id\":\"\",\"sort\":0,\"status\":1}', 0, 0, 1); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/sql/yshop2.1升级sql.txt b/sql/yshop2.1升级sql.txt index c1df9781..4b99ab42 100644 --- a/sql/yshop2.1升级sql.txt +++ b/sql/yshop2.1升级sql.txt @@ -1,29 +1,29 @@ -CREATE TABLE `yx_system_store_staff` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `uid` int(10) unsigned NOT NULL COMMENT '微信用户id', - `nickname` varchar(50) NOT NULL, - `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '店员头像', - `store_id` int(11) NOT NULL COMMENT '门店id', - `store_name` varchar(50) DEFAULT NULL, - `staff_name` varchar(64) DEFAULT '' COMMENT '店员名称', - `phone` char(15) DEFAULT NULL COMMENT '手机号码', - `verify_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '核销开关', - `status` tinyint(2) DEFAULT '1' COMMENT '状态', - `add_time` int(10) DEFAULT NULL COMMENT '添加时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='门店店员表'; - - -ALTER TABLE `yx_user_recharge` -ADD COLUMN `give_price` decimal(8, 2) NULL DEFAULT 0 COMMENT '赠送金额' AFTER `price` - -ALTER TABLE `yx_system_attachment` -ADD COLUMN `uid` int(0) UNSIGNED NULL DEFAULT 0 COMMENT '用户id' AFTER `module_type`, -ADD COLUMN `invite_code` varchar(50) NULL DEFAULT '' COMMENT '邀请码' AFTER `uid` - -ALTER TABLE `yx_store_seckill` -ADD COLUMN `time_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '时间段id' AFTER `start_time_date` - -ALTER TABLE `yx_store_category` -ADD COLUMN `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态' AFTER `add_time` - +CREATE TABLE `yx_system_store_staff` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `uid` int(10) unsigned NOT NULL COMMENT '微信用户id', + `nickname` varchar(50) NOT NULL, + `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '店员头像', + `store_id` int(11) NOT NULL COMMENT '门店id', + `store_name` varchar(50) DEFAULT NULL, + `staff_name` varchar(64) DEFAULT '' COMMENT '店员名称', + `phone` char(15) DEFAULT NULL COMMENT '手机号码', + `verify_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '核销开关', + `status` tinyint(2) DEFAULT '1' COMMENT '状态', + `add_time` int(10) DEFAULT NULL COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='门店店员表'; + + +ALTER TABLE `yx_user_recharge` +ADD COLUMN `give_price` decimal(8, 2) NULL DEFAULT 0 COMMENT '赠送金额' AFTER `price` + +ALTER TABLE `yx_system_attachment` +ADD COLUMN `uid` int(0) UNSIGNED NULL DEFAULT 0 COMMENT '用户id' AFTER `module_type`, +ADD COLUMN `invite_code` varchar(50) NULL DEFAULT '' COMMENT '邀请码' AFTER `uid` + +ALTER TABLE `yx_store_seckill` +ADD COLUMN `time_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '时间段id' AFTER `start_time_date` + +ALTER TABLE `yx_store_category` +ADD COLUMN `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态' AFTER `add_time` + diff --git a/sql/yxshop2.1.sql b/sql/yxshop2.1.sql index ac8e7251..4388f403 100644 --- a/sql/yxshop2.1.sql +++ b/sql/yxshop2.1.sql @@ -1,2861 +1,2861 @@ -/* - Navicat Premium Data Transfer - - Source Server : localhost - Source Server Type : MySQL - Source Server Version : 50723 - Source Host : localhost:3306 - Source Schema : yxshop - - Target Server Type : MySQL - Target Server Version : 50723 - File Encoding : 65001 - - Date: 07/04/2020 17:02:09 -*/ - -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 COMMENT = '支付宝配置类' 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 column_config --- ---------------------------- -DROP TABLE IF EXISTS `column_config`; -CREATE TABLE `column_config` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `column_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `column_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `dict_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `extra` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `form_show` bit(1) NULL DEFAULT NULL, - `form_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `key_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `list_show` bit(1) NULL DEFAULT NULL, - `not_null` bit(1) NULL DEFAULT NULL, - `query_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `date_annotation` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 292 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成字段信息存储' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of column_config --- ---------------------------- -INSERT INTO `column_config` VALUES (1, 'gen_test', 'id', 'int', NULL, 'auto_increment', b'0', NULL, 'PRI', b'0', b'1', NULL, 'ID', NULL); -INSERT INTO `column_config` VALUES (2, 'gen_test', 'sex', 'int', NULL, '', b'1', NULL, '', b'1', b'0', 'NotNull', '性别', NULL); -INSERT INTO `column_config` VALUES (3, 'gen_test', 'create_time', 'datetime', NULL, '', b'0', NULL, '', b'1', b'0', 'BetWeen', '', NULL); -INSERT INTO `column_config` VALUES (139, 'users_roles', 'user_id', 'bigint', NULL, '', b'1', NULL, 'PRI', b'1', b'1', NULL, '用户ID', NULL); -INSERT INTO `column_config` VALUES (140, 'users_roles', 'role_id', 'bigint', NULL, '', b'1', NULL, 'PRI', b'1', b'1', NULL, '角色ID', NULL); -INSERT INTO `column_config` VALUES (141, 'user_avatar', 'id', 'bigint', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '', NULL); -INSERT INTO `column_config` VALUES (142, 'user_avatar', 'real_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '真实文件名', NULL); -INSERT INTO `column_config` VALUES (143, 'user_avatar', 'path', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '路径', NULL); -INSERT INTO `column_config` VALUES (144, 'user_avatar', 'size', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '大小', NULL); -INSERT INTO `column_config` VALUES (145, 'user_avatar', 'create_time', 'datetime', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '创建时间', NULL); -INSERT INTO `column_config` VALUES (146, 'yx_material_group', 'id', 'varchar', NULL, '', b'1', NULL, 'PRI', b'1', b'1', NULL, 'PK', NULL); -INSERT INTO `column_config` VALUES (147, 'yx_material_group', 'user_id', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '所属租户', NULL); -INSERT INTO `column_config` VALUES (148, 'yx_material_group', 'del_flag', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '逻辑删除标记(0:显示;1:隐藏)', NULL); -INSERT INTO `column_config` VALUES (149, 'yx_material_group', 'create_time', 'datetime', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '创建时间', NULL); -INSERT INTO `column_config` VALUES (150, 'yx_material_group', 'update_time', 'timestamp', NULL, 'on update CURRENT_TIMESTAMP', b'1', NULL, '', b'1', b'1', NULL, '最后更新时间', NULL); -INSERT INTO `column_config` VALUES (151, 'yx_material_group', 'create_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '创建者ID', NULL); -INSERT INTO `column_config` VALUES (152, 'yx_material_group', 'name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '分组名', NULL); -INSERT INTO `column_config` VALUES (153, 'yx_material', 'id', 'varchar', NULL, '', b'1', NULL, 'PRI', b'1', b'1', NULL, 'PK', NULL); -INSERT INTO `column_config` VALUES (154, 'yx_material', 'user_id', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '所属租户', NULL); -INSERT INTO `column_config` VALUES (155, 'yx_material', 'del_flag', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '逻辑删除标记(0:显示;1:隐藏)', NULL); -INSERT INTO `column_config` VALUES (156, 'yx_material', 'create_time', 'datetime', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '创建时间', NULL); -INSERT INTO `column_config` VALUES (157, 'yx_material', 'update_time', 'timestamp', NULL, 'on update CURRENT_TIMESTAMP', b'1', NULL, '', b'1', b'1', NULL, '最后更新时间', NULL); -INSERT INTO `column_config` VALUES (158, 'yx_material', 'create_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '创建者ID', NULL); -INSERT INTO `column_config` VALUES (159, 'yx_material', 'type', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '类型1、图片;2、视频', NULL); -INSERT INTO `column_config` VALUES (160, 'yx_material', 'group_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '分组ID', NULL); -INSERT INTO `column_config` VALUES (161, 'yx_material', 'name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '素材名', NULL); -INSERT INTO `column_config` VALUES (162, 'yx_material', 'url', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '素材链接', NULL); -INSERT INTO `column_config` VALUES (163, 'yx_user', 'uid', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '用户id', NULL); -INSERT INTO `column_config` VALUES (164, 'yx_user', 'username', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'0', NULL, '用户账户(跟accout一样)', NULL); -INSERT INTO `column_config` VALUES (165, 'yx_user', 'account', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '用户账号', NULL); -INSERT INTO `column_config` VALUES (166, 'yx_user', 'password', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户密码(跟pwd)', NULL); -INSERT INTO `column_config` VALUES (167, 'yx_user', 'pwd', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户密码', NULL); -INSERT INTO `column_config` VALUES (168, 'yx_user', 'real_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '真实姓名', NULL); -INSERT INTO `column_config` VALUES (169, 'yx_user', 'birthday', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '生日', NULL); -INSERT INTO `column_config` VALUES (170, 'yx_user', 'card_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '身份证号码', NULL); -INSERT INTO `column_config` VALUES (171, 'yx_user', 'mark', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户备注', NULL); -INSERT INTO `column_config` VALUES (172, 'yx_user', 'partner_id', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '合伙人id', NULL); -INSERT INTO `column_config` VALUES (173, 'yx_user', 'group_id', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户分组id', NULL); -INSERT INTO `column_config` VALUES (174, 'yx_user', 'nickname', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户昵称', NULL); -INSERT INTO `column_config` VALUES (175, 'yx_user', 'avatar', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户头像', NULL); -INSERT INTO `column_config` VALUES (176, 'yx_user', 'phone', 'char', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '手机号码', NULL); -INSERT INTO `column_config` VALUES (177, 'yx_user', 'add_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '添加时间', NULL); -INSERT INTO `column_config` VALUES (178, 'yx_user', 'add_ip', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '添加ip', NULL); -INSERT INTO `column_config` VALUES (179, 'yx_user', 'last_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '最后一次登录时间', NULL); -INSERT INTO `column_config` VALUES (180, 'yx_user', 'last_ip', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '最后一次登录ip', NULL); -INSERT INTO `column_config` VALUES (181, 'yx_user', 'now_money', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户余额', NULL); -INSERT INTO `column_config` VALUES (182, 'yx_user', 'brokerage_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '佣金金额', NULL); -INSERT INTO `column_config` VALUES (183, 'yx_user', 'integral', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户剩余积分', NULL); -INSERT INTO `column_config` VALUES (184, 'yx_user', 'sign_num', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '连续签到天数', NULL); -INSERT INTO `column_config` VALUES (185, 'yx_user', 'status', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '1为正常,0为禁止', NULL); -INSERT INTO `column_config` VALUES (186, 'yx_user', 'level', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '等级', NULL); -INSERT INTO `column_config` VALUES (187, 'yx_user', 'spread_uid', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '推广元id', NULL); -INSERT INTO `column_config` VALUES (188, 'yx_user', 'spread_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '推广员关联时间', NULL); -INSERT INTO `column_config` VALUES (189, 'yx_user', 'user_type', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户类型', NULL); -INSERT INTO `column_config` VALUES (190, 'yx_user', 'is_promoter', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '是否为推广员', NULL); -INSERT INTO `column_config` VALUES (191, 'yx_user', 'pay_count', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户购买次数', NULL); -INSERT INTO `column_config` VALUES (192, 'yx_user', 'spread_count', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '下级人数', NULL); -INSERT INTO `column_config` VALUES (193, 'yx_user', 'clean_time', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '清理会员时间', NULL); -INSERT INTO `column_config` VALUES (194, 'yx_user', 'addres', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '详细地址', NULL); -INSERT INTO `column_config` VALUES (195, 'yx_user', 'adminid', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '管理员编号 ', NULL); -INSERT INTO `column_config` VALUES (196, 'yx_user', 'login_type', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户登陆类型,h5,wechat,routine', NULL); -INSERT INTO `column_config` VALUES (197, 'yx_wechat_media', 'id', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '微信视频音频id', NULL); -INSERT INTO `column_config` VALUES (198, 'yx_wechat_media', 'type', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '回复类型', NULL); -INSERT INTO `column_config` VALUES (199, 'yx_wechat_media', 'path', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '文件路径', NULL); -INSERT INTO `column_config` VALUES (200, 'yx_wechat_media', 'media_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '微信服务器返回的id', NULL); -INSERT INTO `column_config` VALUES (201, 'yx_wechat_media', 'url', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '地址', NULL); -INSERT INTO `column_config` VALUES (202, 'yx_wechat_media', 'temporary', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '是否永久或者临时 0永久1临时', NULL); -INSERT INTO `column_config` VALUES (203, 'yx_wechat_media', 'add_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '添加时间', NULL); -INSERT INTO `column_config` VALUES (204, 'yx_store_order', 'id', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '订单ID', NULL); -INSERT INTO `column_config` VALUES (205, 'yx_store_order', 'order_id', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '订单号', NULL); -INSERT INTO `column_config` VALUES (206, 'yx_store_order', 'extend_order_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '额外订单号', NULL); -INSERT INTO `column_config` VALUES (207, 'yx_store_order', 'uid', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '用户id', NULL); -INSERT INTO `column_config` VALUES (208, 'yx_store_order', 'real_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户姓名', NULL); -INSERT INTO `column_config` VALUES (209, 'yx_store_order', 'user_phone', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户电话', NULL); -INSERT INTO `column_config` VALUES (210, 'yx_store_order', 'user_address', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '详细地址', NULL); -INSERT INTO `column_config` VALUES (211, 'yx_store_order', 'cart_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '购物车id', NULL); -INSERT INTO `column_config` VALUES (212, 'yx_store_order', 'freight_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '运费金额', NULL); -INSERT INTO `column_config` VALUES (213, 'yx_store_order', 'total_num', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '订单商品总数', NULL); -INSERT INTO `column_config` VALUES (214, 'yx_store_order', 'total_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '订单总价', NULL); -INSERT INTO `column_config` VALUES (215, 'yx_store_order', 'total_postage', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '邮费', NULL); -INSERT INTO `column_config` VALUES (216, 'yx_store_order', 'pay_price', 'decimal', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '实际支付金额', NULL); -INSERT INTO `column_config` VALUES (217, 'yx_store_order', 'pay_postage', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '支付邮费', NULL); -INSERT INTO `column_config` VALUES (218, 'yx_store_order', 'deduction_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '抵扣金额', NULL); -INSERT INTO `column_config` VALUES (219, 'yx_store_order', 'coupon_id', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '优惠券id', NULL); -INSERT INTO `column_config` VALUES (220, 'yx_store_order', 'coupon_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '优惠券金额', NULL); -INSERT INTO `column_config` VALUES (221, 'yx_store_order', 'paid', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '支付状态', NULL); -INSERT INTO `column_config` VALUES (222, 'yx_store_order', 'pay_time', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'0', NULL, '支付时间', NULL); -INSERT INTO `column_config` VALUES (223, 'yx_store_order', 'pay_type', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '支付方式', NULL); -INSERT INTO `column_config` VALUES (224, 'yx_store_order', 'add_time', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '创建时间', NULL); -INSERT INTO `column_config` VALUES (225, 'yx_store_order', 'status', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款)', NULL); -INSERT INTO `column_config` VALUES (226, 'yx_store_order', 'refund_status', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '0 未退款 1 申请中 2 已退款', NULL); -INSERT INTO `column_config` VALUES (227, 'yx_store_order', 'refund_reason_wap_img', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '退款图片', NULL); -INSERT INTO `column_config` VALUES (228, 'yx_store_order', 'refund_reason_wap_explain', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '退款用户说明', NULL); -INSERT INTO `column_config` VALUES (229, 'yx_store_order', 'refund_reason_time', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '退款时间', NULL); -INSERT INTO `column_config` VALUES (230, 'yx_store_order', 'refund_reason_wap', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '前台退款原因', NULL); -INSERT INTO `column_config` VALUES (231, 'yx_store_order', 'refund_reason', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '不退款的理由', NULL); -INSERT INTO `column_config` VALUES (232, 'yx_store_order', 'refund_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '退款金额', NULL); -INSERT INTO `column_config` VALUES (233, 'yx_store_order', 'delivery_sn', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '快递公司编号', NULL); -INSERT INTO `column_config` VALUES (234, 'yx_store_order', 'delivery_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '快递名称/送货人姓名', NULL); -INSERT INTO `column_config` VALUES (235, 'yx_store_order', 'delivery_type', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '发货类型', NULL); -INSERT INTO `column_config` VALUES (236, 'yx_store_order', 'delivery_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '快递单号/手机号', NULL); -INSERT INTO `column_config` VALUES (237, 'yx_store_order', 'gain_integral', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '消费赚取积分', NULL); -INSERT INTO `column_config` VALUES (238, 'yx_store_order', 'use_integral', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '使用积分', NULL); -INSERT INTO `column_config` VALUES (239, 'yx_store_order', 'back_integral', 'decimal', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '给用户退了多少积分', NULL); -INSERT INTO `column_config` VALUES (240, 'yx_store_order', 'mark', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '备注', NULL); -INSERT INTO `column_config` VALUES (241, 'yx_store_order', 'is_del', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '是否删除', NULL); -INSERT INTO `column_config` VALUES (242, 'yx_store_order', 'unique', 'char', NULL, '', b'1', NULL, 'UNI', b'1', b'1', NULL, '唯一id(md5加密)类似id', NULL); -INSERT INTO `column_config` VALUES (243, 'yx_store_order', 'remark', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '管理员备注', NULL); -INSERT INTO `column_config` VALUES (244, 'yx_store_order', 'mer_id', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '商户ID', NULL); -INSERT INTO `column_config` VALUES (245, 'yx_store_order', 'is_mer_check', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '', NULL); -INSERT INTO `column_config` VALUES (246, 'yx_store_order', 'combination_id', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '拼团产品id0一般产品', NULL); -INSERT INTO `column_config` VALUES (247, 'yx_store_order', 'pink_id', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '拼团id 0没有拼团', NULL); -INSERT INTO `column_config` VALUES (248, 'yx_store_order', 'cost', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '成本价', NULL); -INSERT INTO `column_config` VALUES (249, 'yx_store_order', 'seckill_id', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '秒杀产品ID', NULL); -INSERT INTO `column_config` VALUES (250, 'yx_store_order', 'bargain_id', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '砍价id', NULL); -INSERT INTO `column_config` VALUES (251, 'yx_store_order', 'verify_code', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '核销码', NULL); -INSERT INTO `column_config` VALUES (252, 'yx_store_order', 'store_id', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '门店id', NULL); -INSERT INTO `column_config` VALUES (253, 'yx_store_order', 'shipping_type', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '配送方式 1=快递 ,2=门店自提', NULL); -INSERT INTO `column_config` VALUES (254, 'yx_store_order', 'is_channel', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '支付渠道(0微信公众号1微信小程序)', NULL); -INSERT INTO `column_config` VALUES (255, 'yx_store_order', 'is_remind', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '', NULL); -INSERT INTO `column_config` VALUES (256, 'yx_store_order', 'is_system_del', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '', NULL); -INSERT INTO `column_config` VALUES (257, 'yx_user_recharge', 'id', 'int', NULL, 'auto_increment', b'0', NULL, 'PRI', b'1', b'0', NULL, '', NULL); -INSERT INTO `column_config` VALUES (258, 'yx_user_recharge', 'uid', 'int', NULL, '', b'0', NULL, 'MUL', b'0', b'0', NULL, '充值用户UID', NULL); -INSERT INTO `column_config` VALUES (259, 'yx_user_recharge', 'order_id', 'varchar', NULL, '', b'0', NULL, 'UNI', b'1', b'0', NULL, '订单号', NULL); -INSERT INTO `column_config` VALUES (260, 'yx_user_recharge', 'price', 'decimal', NULL, '', b'0', NULL, '', b'1', b'0', NULL, '充值金额', NULL); -INSERT INTO `column_config` VALUES (261, 'yx_user_recharge', 'recharge_type', 'varchar', NULL, '', b'0', NULL, 'MUL', b'1', b'0', NULL, '充值类型', NULL); -INSERT INTO `column_config` VALUES (262, 'yx_user_recharge', 'paid', 'tinyint', NULL, '', b'0', NULL, 'MUL', b'1', b'0', NULL, '是否充值', NULL); -INSERT INTO `column_config` VALUES (263, 'yx_user_recharge', 'pay_time', 'int', NULL, '', b'0', NULL, '', b'1', b'0', NULL, '充值支付时间', NULL); -INSERT INTO `column_config` VALUES (264, 'yx_user_recharge', 'add_time', 'int', NULL, '', b'0', NULL, '', b'1', b'0', NULL, '充值时间', NULL); -INSERT INTO `column_config` VALUES (265, 'yx_user_recharge', 'refund_price', 'decimal', NULL, '', b'0', NULL, '', b'0', b'0', NULL, '退款金额', NULL); -INSERT INTO `column_config` VALUES (266, 'yx_user_recharge', 'nickname', 'varchar', NULL, '', b'0', NULL, '', b'1', b'0', 'Like', '昵称', NULL); -INSERT INTO `column_config` VALUES (267, 'yx_system_store', 'id', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '', NULL); -INSERT INTO `column_config` VALUES (268, 'yx_system_store', 'name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '门店名称', NULL); -INSERT INTO `column_config` VALUES (269, 'yx_system_store', 'introduction', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '简介', NULL); -INSERT INTO `column_config` VALUES (270, 'yx_system_store', 'phone', 'char', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '手机号码', NULL); -INSERT INTO `column_config` VALUES (271, 'yx_system_store', 'address', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '省市区', NULL); -INSERT INTO `column_config` VALUES (272, 'yx_system_store', 'detailed_address', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '详细地址', NULL); -INSERT INTO `column_config` VALUES (273, 'yx_system_store', 'image', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '门店logo', NULL); -INSERT INTO `column_config` VALUES (274, 'yx_system_store', 'latitude', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '纬度', NULL); -INSERT INTO `column_config` VALUES (275, 'yx_system_store', 'longitude', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '经度', NULL); -INSERT INTO `column_config` VALUES (276, 'yx_system_store', 'valid_time', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '核销有效日期', NULL); -INSERT INTO `column_config` VALUES (277, 'yx_system_store', 'day_time', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '每日营业开关时间', NULL); -INSERT INTO `column_config` VALUES (278, 'yx_system_store', 'add_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '添加时间', NULL); -INSERT INTO `column_config` VALUES (279, 'yx_system_store', 'is_show', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '是否显示', NULL); -INSERT INTO `column_config` VALUES (280, 'yx_system_store', 'is_del', 'tinyint', NULL, '', b'1', NULL, '', b'0', b'1', NULL, '是否删除', NULL); -INSERT INTO `column_config` VALUES (281, 'yx_system_store_staff', 'id', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '', NULL); -INSERT INTO `column_config` VALUES (282, 'yx_system_store_staff', 'uid', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '微信用户id', NULL); -INSERT INTO `column_config` VALUES (283, 'yx_system_store_staff', 'avatar', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '店员头像', NULL); -INSERT INTO `column_config` VALUES (284, 'yx_system_store_staff', 'store_id', 'int', NULL, '', b'1', 'Select', '', b'1', b'1', NULL, '门店id', NULL); -INSERT INTO `column_config` VALUES (285, 'yx_system_store_staff', 'staff_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', 'Like', '店员名称', NULL); -INSERT INTO `column_config` VALUES (286, 'yx_system_store_staff', 'phone', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '手机号码', NULL); -INSERT INTO `column_config` VALUES (287, 'yx_system_store_staff', 'verify_status', 'tinyint', NULL, '', b'1', 'Radio', '', b'1', b'1', NULL, '核销开关', NULL); -INSERT INTO `column_config` VALUES (288, 'yx_system_store_staff', 'status', 'tinyint', NULL, '', b'1', 'Radio', '', b'1', b'0', NULL, '状态', NULL); -INSERT INTO `column_config` VALUES (289, 'yx_system_store_staff', 'add_time', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '添加时间', NULL); -INSERT INTO `column_config` VALUES (290, 'yx_system_store_staff', 'nickname', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', 'Like', '微信昵称', NULL); -INSERT INTO `column_config` VALUES (291, 'yx_system_store_staff', 'store_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '所属门店', NULL); - --- ---------------------------- --- 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 '上级部门', - `enabled` bit(1) NOT NULL COMMENT '状态', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of dept --- ---------------------------- -INSERT INTO `dept` VALUES (1, 'YSHOP', 0, b'1', '2019-03-01 12:07:37'); -INSERT INTO `dept` VALUES (2, '研发部', 7, b'1', '2019-03-25 09:15:32'); -INSERT INTO `dept` VALUES (5, '运维部', 7, b'1', '2019-03-25 09:20:44'); -INSERT INTO `dept` VALUES (6, '测试部', 8, b'1', '2019-03-25 09:52:18'); -INSERT INTO `dept` VALUES (7, '华南分部', 1, b'1', '2019-03-25 11:04:50'); -INSERT INTO `dept` VALUES (8, '华北分部', 1, b'1', '2019-03-25 11:04:53'); -INSERT INTO `dept` VALUES (11, '人事部', 8, b'1', '2019-03-25 11:07:58'); - --- ---------------------------- --- 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 '描述', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据字典' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of dict --- ---------------------------- -INSERT INTO `dict` VALUES (1, 'user_status', '用户状态', '2019-10-27 20:31:36'); -INSERT INTO `dict` VALUES (4, 'dept_status', '部门状态', '2019-10-27 20:31:36'); -INSERT INTO `dict` VALUES (5, 'job_status', '岗位状态', '2019-10-27 20:31:36'); - --- ---------------------------- --- 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', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - 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 = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据字典详情' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of dict_detail --- ---------------------------- -INSERT INTO `dict_detail` VALUES (1, '激活', 'true', '1', 1, '2019-10-27 20:31:36'); -INSERT INTO `dict_detail` VALUES (2, '禁用', 'false', '2', 1, NULL); -INSERT INTO `dict_detail` VALUES (3, '启用', 'true', '1', 4, NULL); -INSERT INTO `dict_detail` VALUES (4, '停用', 'false', '2', 4, '2019-10-27 20:31:36'); -INSERT INTO `dict_detail` VALUES (5, '启用', 'true', '1', 5, NULL); -INSERT INTO `dict_detail` VALUES (6, '停用', 'false', '2', 5, '2019-10-27 20:31:36'); - --- ---------------------------- --- 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 COMMENT = '邮箱配置' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of email_config --- ---------------------------- -INSERT INTO `email_config` VALUES (1, '111@qq.com', '111', '111', '111', '1'); - --- ---------------------------- --- Table structure for gen_config --- ---------------------------- -DROP TABLE IF EXISTS `gen_config`; -CREATE TABLE `gen_config` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表名', - `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 COMMENT '前端Api文件路径', - `prefix` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表前缀', - `api_alias` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '接口名称', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成器配置' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of gen_config --- ---------------------------- -INSERT INTO `gen_config` VALUES (3, 'gen_test', 'Zheng Jie', b'1', 'eladmin-system', 'me.zhengjie.gen', 'E:\\workspace\\me\\front\\eladmin-web\\src\\views\\gen', 'E:\\workspace\\me\\front\\eladmin-web\\src\\api', NULL, '测试生成'); -INSERT INTO `gen_config` VALUES (4, 'yx_material_group', 'hupeng', b'0', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\output', 'E:\\output\\', NULL, '素材'); -INSERT INTO `gen_config` VALUES (5, 'yx_material', 'hupeng', b'0', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\output', 'E:\\output\\', NULL, '素材管理'); -INSERT INTO `gen_config` VALUES (6, 'yx_user', 'hupeng', b'0', 'yshop-system', 'co.yixiang.modules', 'aa', 'aa\\', NULL, '用户'); -INSERT INTO `gen_config` VALUES (7, 'yx_wechat_media', 'hupeng', b'0', 'yshop-system', 'co.yixiang.modules', 'E:\\book\\img', 'E:\\book\\img\\', NULL, 'ceshi'); -INSERT INTO `gen_config` VALUES (8, 'yx_user_recharge', 'hupeng', b'0', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\java\\yxshop-private\\yshop-web\\src\\views\\shop\\recharge', 'E:\\java\\yxshop-private\\yshop-web\\src\\api', '', '充值管理'); -INSERT INTO `gen_config` VALUES (9, 'yx_system_store', 'hupeng', b'0', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\java\\yxshop-private\\yshop-web\\src\\views\\shop\\store', 'E:\\java\\yxshop-private\\yshop-web\\src\\api', NULL, '门店'); -INSERT INTO `gen_config` VALUES (10, 'yx_system_store_staff', 'hupeng', b'1', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\java\\yxshop-private\\yshop-web\\src\\views\\shop\\storestaff', 'E:\\java\\yxshop-private\\yshop-web\\src\\api', NULL, '门店店员'); - --- ---------------------------- --- Table structure for gen_test --- ---------------------------- -DROP TABLE IF EXISTS `gen_test`; -CREATE TABLE `gen_test` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `sex` int(255) NULL DEFAULT NULL COMMENT '性别', - `create_time` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成测试' ROW_FORMAT = Compact; - --- ---------------------------- --- Table structure for job --- ---------------------------- -DROP TABLE IF EXISTS `job`; -CREATE TABLE `job` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '岗位名称', - `enabled` bit(1) NOT NULL COMMENT '岗位状态', - `sort` bigint(20) NOT NULL COMMENT '岗位排序', - `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - 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 = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '岗位' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of job --- ---------------------------- -INSERT INTO `job` VALUES (8, '人事专员', b'1', 3, 11, '2019-03-29 14:52:28'); -INSERT INTO `job` VALUES (10, '产品经理', b'1', 4, 2, '2019-03-29 14:55:51'); -INSERT INTO `job` VALUES (11, '全栈开发', b'1', 2, 2, '2019-03-31 13:39:30'); -INSERT INTO `job` VALUES (12, '软件测试', b'1', 5, 2, '2019-03-31 13:39:43'); - --- ---------------------------- --- 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 COMMENT '文件真实的名称', - `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(0) NULL DEFAULT NULL COMMENT '创建日期', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 46 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '本地存储' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of local_storage --- ---------------------------- -INSERT INTO `local_storage` VALUES (1, 'list_30-20200107120524671.png', 'list_30', 'png', 'E:\\yshop\\file\\图片\\list_30-20200107120524671.png', '图片', '28.57KB ', 'admin', '2020-01-07 12:05:25'); -INSERT INTO `local_storage` VALUES (2, 'list_34-20200109071140374.png', 'list_34', 'png', 'E:\\yshop\\file\\图片\\list_34-20200109071140374.png', '图片', '27.05KB ', 'admin', '2020-01-09 19:11:40'); -INSERT INTO `local_storage` VALUES (3, 'list_22-20200109072256534.png', 'list_22', 'png', 'E:\\yshop\\file\\pic\\list_22-20200109072256534.png', 'pic', '28.23KB ', 'admin', '2020-01-09 19:22:57'); -INSERT INTO `local_storage` VALUES (4, 'list_32-20200109093407741.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109093407741.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:34:08'); -INSERT INTO `local_storage` VALUES (5, 'list_32-20200109094223500.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109094223500.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:42:24'); -INSERT INTO `local_storage` VALUES (6, 'list_32-20200109094413459.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109094413459.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:44:13'); -INSERT INTO `local_storage` VALUES (7, 'list_32-20200109094652138.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109094652138.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:46:52'); -INSERT INTO `local_storage` VALUES (8, 'list_34-20200109095146476.png', 'list_34', 'png', 'E:\\yshop\\file\\pic\\list_34-20200109095146476.png', 'pic', '27.05KB ', 'admin', '2020-01-09 21:51:47'); -INSERT INTO `local_storage` VALUES (9, 'list_32-20200109095700685.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109095700685.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:57:01'); -INSERT INTO `local_storage` VALUES (10, 'list_20-20200109095936988.png', 'list_20', 'png', 'E:\\yshop\\file\\pic\\list_20-20200109095936988.png', 'pic', '22.92KB ', 'admin', '2020-01-09 21:59:37'); -INSERT INTO `local_storage` VALUES (11, 'list_32-20200109100213309.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109100213309.png', 'pic', '27.65KB ', 'admin', '2020-01-09 22:02:13'); -INSERT INTO `local_storage` VALUES (12, 'list_30-20200109104513493.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-20200109104513493.png', 'pic', '28.57KB ', 'admin', '2020-01-09 22:45:13'); -INSERT INTO `local_storage` VALUES (13, 'list_16-20200110120838173.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200110120838173.png', 'pic', '28.93KB ', 'admin', '2020-01-10 12:08:38'); -INSERT INTO `local_storage` VALUES (14, 'list_32-20200110035831202.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200110035831202.png', 'pic', '27.65KB ', 'admin', '2020-01-10 15:58:31'); -INSERT INTO `local_storage` VALUES (15, 'list_32-2020011004054091.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-2020011004054091.png', 'pic', '27.65KB ', 'admin', '2020-01-10 16:05:40'); -INSERT INTO `local_storage` VALUES (16, 'list_30-20200110053337209.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-20200110053337209.png', 'pic', '28.57KB ', 'admin', '2020-01-10 17:33:37'); -INSERT INTO `local_storage` VALUES (17, 'list_32-20200110064436937.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200110064436937.png', 'pic', '27.65KB ', 'admin', '2020-01-10 18:44:37'); -INSERT INTO `local_storage` VALUES (18, 'list_22-20200110104217508.png', 'list_22', 'png', 'E:\\yshop\\file\\pic\\list_22-20200110104217508.png', 'pic', '28.23KB ', 'admin', '2020-01-10 22:42:18'); -INSERT INTO `local_storage` VALUES (19, 'list_18-20200111051038569.png', 'list_18', 'png', 'E:\\yshop\\file\\pic\\list_18-20200111051038569.png', 'pic', '29.62KB ', '15136175246', '2020-01-11 17:10:39'); -INSERT INTO `local_storage` VALUES (20, 'list_30-2020011105115469.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-2020011105115469.png', 'pic', '28.57KB ', '15136175246', '2020-01-11 17:11:54'); -INSERT INTO `local_storage` VALUES (21, 'list_30-20200111051343335.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-20200111051343335.png', 'pic', '28.57KB ', '15136175246', '2020-01-11 17:13:43'); -INSERT INTO `local_storage` VALUES (22, 'list_16-20200111051622984.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200111051622984.png', 'pic', '28.93KB ', '15136175246', '2020-01-11 17:16:23'); -INSERT INTO `local_storage` VALUES (23, 'list_24-20200111051630227.png', 'list_24', 'png', 'E:\\yshop\\file\\pic\\list_24-20200111051630227.png', 'pic', '27.31KB ', '15136175246', '2020-01-11 17:16:30'); -INSERT INTO `local_storage` VALUES (24, 'logo-20200131103905417.png', 'logo', 'png', 'E:\\yshop\\file\\pic\\logo-20200131103905417.png', 'pic', '48.39KB ', 'admin', '2020-01-31 10:39:05'); -INSERT INTO `local_storage` VALUES (25, 'avatar-20200131103928688.png', 'avatar', 'png', 'E:\\yshop\\file\\pic\\avatar-20200131103928688.png', 'pic', '1.82KB ', 'admin', '2020-01-31 10:39:29'); -INSERT INTO `local_storage` VALUES (26, 'list_13-2020013110394473.png', 'list_13', 'png', 'E:\\yshop\\file\\pic\\list_13-2020013110394473.png', 'pic', '23.05KB ', 'admin', '2020-01-31 10:39:44'); -INSERT INTO `local_storage` VALUES (27, 'list_18-2020013110394988.png', 'list_18', 'png', 'E:\\yshop\\file\\pic\\list_18-2020013110394988.png', 'pic', '29.62KB ', 'admin', '2020-01-31 10:39:49'); -INSERT INTO `local_storage` VALUES (28, 'list_22-20200131103952926.png', 'list_22', 'png', 'E:\\yshop\\file\\pic\\list_22-20200131103952926.png', 'pic', '28.23KB ', 'admin', '2020-01-31 10:39:53'); -INSERT INTO `local_storage` VALUES (29, 'list_26-20200131103956836.png', 'list_26', 'png', 'E:\\yshop\\file\\pic\\list_26-20200131103956836.png', 'pic', '28.36KB ', 'admin', '2020-01-31 10:39:57'); -INSERT INTO `local_storage` VALUES (30, 'list_28-20200131104001169.png', 'list_28', 'png', 'E:\\yshop\\file\\pic\\list_28-20200131104001169.png', 'pic', '28.38KB ', 'admin', '2020-01-31 10:40:01'); -INSERT INTO `local_storage` VALUES (31, 'list_16-20200207061544740.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200207061544740.png', 'pic', '28.93KB ', 'hupeng', '2020-02-07 18:15:45'); -INSERT INTO `local_storage` VALUES (32, 'list_30-2020020706162996.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-2020020706162996.png', 'pic', '28.57KB ', 'hupeng', '2020-02-07 18:16:29'); -INSERT INTO `local_storage` VALUES (33, 'list_16-20200207061714702.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200207061714702.png', 'pic', '28.93KB ', 'hupeng', '2020-02-07 18:17:15'); -INSERT INTO `local_storage` VALUES (34, 'list_18-20200207061743361.png', 'list_18', 'png', 'E:\\yshop\\file\\pic\\list_18-20200207061743361.png', 'pic', '29.62KB ', 'hupeng', '2020-02-07 18:17:43'); -INSERT INTO `local_storage` VALUES (35, 'list_30-20200207062920744.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-20200207062920744.png', 'pic', '28.57KB ', 'hupeng', '2020-02-07 18:29:21'); -INSERT INTO `local_storage` VALUES (36, '05ea40b831858a8cf423aa709840507c-20200228083801500.png', '05ea40b831858a8cf423aa709840507c', 'png', 'E:\\yshop\\file\\pic\\05ea40b831858a8cf423aa709840507c-20200228083801500.png', 'pic', '5.19KB ', 'admin', '2020-02-28 20:38:02'); -INSERT INTO `local_storage` VALUES (37, '05ea40b831858a8cf423aa709840507c-20200311043711341.png', '05ea40b831858a8cf423aa709840507c', 'png', 'E:\\yshop\\file\\pic\\05ea40b831858a8cf423aa709840507c-20200311043711341.png', 'pic', '5.19KB ', 'admin', '2020-03-11 16:37:11'); -INSERT INTO `local_storage` VALUES (38, '秒杀-2020031104371672.png', '秒杀', 'png', 'E:\\yshop\\file\\pic\\秒杀-2020031104371672.png', 'pic', '6.07KB ', 'admin', '2020-03-11 16:37:16'); -INSERT INTO `local_storage` VALUES (39, '砍价-20200311043720679.png', '砍价', 'png', 'E:\\yshop\\file\\pic\\砍价-20200311043720679.png', 'pic', '6.13KB ', 'admin', '2020-03-11 16:37:21'); -INSERT INTO `local_storage` VALUES (40, '优惠券-20200311043724709.png', '优惠券', 'png', 'E:\\yshop\\file\\pic\\优惠券-20200311043724709.png', 'pic', '5.45KB ', 'admin', '2020-03-11 16:37:25'); -INSERT INTO `local_storage` VALUES (41, '资讯-20200311043727918.png', '资讯', 'png', 'E:\\yshop\\file\\pic\\资讯-20200311043727918.png', 'pic', '5.19KB ', 'admin', '2020-03-11 16:37:28'); -INSERT INTO `local_storage` VALUES (42, 'list_16-20200322071324803.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200322071324803.png', 'pic', '28.93KB ', 'admin', '2020-03-22 19:13:25'); -INSERT INTO `local_storage` VALUES (43, 'list_22-20200322071348844.png', 'list_22', 'png', 'E:\\yshop\\file\\pic\\list_22-20200322071348844.png', 'pic', '28.23KB ', 'admin', '2020-03-22 19:13:49'); -INSERT INTO `local_storage` VALUES (44, 'list_34-2020032207154023.png', 'list_34', 'png', 'E:\\yshop\\file\\pic\\list_34-2020032207154023.png', 'pic', '27.05KB ', 'admin', '2020-03-22 19:15:40'); -INSERT INTO `local_storage` VALUES (45, '钻石-20200328094531898.jpg', '钻石', 'jpg', 'E:\\yshop\\file\\pic\\钻石-20200328094531898.jpg', 'pic', '32.42KB ', 'admin', '2020-03-28 21:45:32'); - --- ---------------------------- --- Table structure for log --- ---------------------------- -DROP TABLE IF EXISTS `log`; -CREATE TABLE `log` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `create_time` datetime(0) 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 '', - `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, - `browser` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `type` int(1) NULL DEFAULT 0, - `uid` bigint(20) NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 416611 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统日志' ROW_FORMAT = Compact; - --- ---------------------------- --- Table structure for menu --- ---------------------------- -DROP TABLE IF EXISTS `menu`; -CREATE TABLE `menu` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `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' COMMENT '缓存', - `hidden` bit(1) NULL DEFAULT b'0' COMMENT '是否隐藏', - `component_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '-' COMMENT '组件名称', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - `permission` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限', - `type` int(11) NULL DEFAULT NULL COMMENT '类型', - PRIMARY KEY (`id`) USING BTREE, - INDEX `FKqcf9gem97gqa5qjm4d3elcqt5`(`pid`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 184 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; - --- ---------------------------- --- Records of menu --- ---------------------------- -INSERT INTO `menu` VALUES (1, b'0', '系统管理', NULL, 0, 99, 'system', 'system', b'0', b'0', NULL, '2018-12-18 15:11:29', NULL, 1); -INSERT INTO `menu` VALUES (2, b'0', '用户管理', 'system/user/index', 1, 2, 'peoples', 'user', b'0', b'0', 'User', '2018-12-18 15:14:44', NULL, 1); -INSERT INTO `menu` VALUES (3, b'0', '角色管理', 'system/role/index', 1, 3, 'role', 'role', b'0', b'0', 'Role', '2018-12-18 15:16:07', NULL, 1); -INSERT INTO `menu` VALUES (5, b'0', '菜单管理', 'system/menu/index', 1, 5, 'menu', 'menu', b'0', b'0', 'Menu', '2018-12-18 15:17:28', 'admin,menu:list,roles:list', 1); -INSERT INTO `menu` VALUES (6, b'0', '系统监控', NULL, 0, 100, 'monitor', 'monitor', b'0', b'0', NULL, '2018-12-18 15:17:48', NULL, 1); -INSERT INTO `menu` VALUES (7, b'0', '操作日志', 'monitor/log/index', 6, 11, 'log', 'logs', b'1', b'0', 'Log', '2018-12-18 15:18:26', NULL, 1); -INSERT INTO `menu` VALUES (9, b'0', 'SQL监控', 'monitor/sql/index', 6, 14, 'sqlMonitor', 'druid', b'0', b'0', 'Sql', '2018-12-18 15:19:34', NULL, 1); -INSERT INTO `menu` VALUES (14, b'0', '邮件工具', 'tools/email/index', 36, 24, 'email', 'email', b'0', b'0', 'Email', '2018-12-27 10:13:09', NULL, 1); -INSERT INTO `menu` VALUES (16, b'0', '图床管理', 'tools/picture/index', 36, 25, 'image', 'pictures', b'0', b'0', 'Pictures', '2018-12-28 09:36:53', 'pictures:list', 1); -INSERT INTO `menu` VALUES (18, b'0', '存储管理', 'tools/storage/index', 36, 23, 'qiniu', 'storage', b'0', b'0', 'Storage', '2018-12-31 11:12:15', 'storage:list', 1); -INSERT INTO `menu` VALUES (19, b'0', '支付宝工具', 'tools/aliPay/index', 36, 27, 'alipay', 'aliPay', b'0', b'0', 'AliPay', '2018-12-31 14:52:38', NULL, 1); -INSERT INTO `menu` VALUES (28, b'0', '定时任务', 'system/timing/index', 36, 21, 'timing', 'timing', b'0', b'0', 'Timing', '2019-01-07 20:34:40', 'timing:list', 1); -INSERT INTO `menu` VALUES (30, b'0', '代码生成', 'generator/index', 36, 22, 'dev', 'generator', b'0', b'0', 'GeneratorIndex', '2019-01-11 15:45:55', NULL, 1); -INSERT INTO `menu` VALUES (32, b'0', '异常日志', 'monitor/log/errorLog', 6, 12, 'error', 'errorLog', b'0', b'0', 'ErrorLog', '2019-01-13 13:49:03', NULL, 1); -INSERT INTO `menu` VALUES (35, b'0', '部门管理', 'system/dept/index', 1, 6, 'dept', 'dept', b'0', b'0', 'Dept', '2019-03-25 09:46:00', NULL, 1); -INSERT INTO `menu` VALUES (36, b'0', '系统工具', '', 0, 101, 'sys-tools', 'sys-tools', b'0', b'0', NULL, '2019-03-29 10:57:35', NULL, 1); -INSERT INTO `menu` VALUES (37, b'0', '岗位管理', 'system/job/index', 1, 7, 'Steve-Jobs', 'job', b'0', b'0', 'Job', '2019-03-29 13:51:18', NULL, 1); -INSERT INTO `menu` VALUES (39, b'0', '字典管理', 'system/dict/index', 1, 8, 'dictionary', 'dict', b'0', b'0', 'Dict', '2019-04-10 11:49:04', NULL, 1); -INSERT INTO `menu` VALUES (40, b'0', '商品管理', '', 0, 1, 'shop', 'shop', b'1', b'0', '', '2019-10-03 17:40:19', NULL, 1); -INSERT INTO `menu` VALUES (41, b'0', '商品分类', 'shop/cate/index', 40, 11, 'icon', 'cate', b'0', b'0', 'Cate', '2019-10-03 17:42:35', 'YXSTORECATEGORY_SELECT', 1); -INSERT INTO `menu` VALUES (45, b'0', '管理商品', 'shop/goods/tab', 40, 12, 'develop', 'goods', b'1', b'0', 'Goods', '2019-10-04 15:34:35', 'YXSTOREPRODUCT_SELECT', 1); -INSERT INTO `menu` VALUES (46, b'0', '会员管理', '', 0, 2, 'peoples', 'member', b'0', b'0', '', '2019-10-06 16:18:05', NULL, 1); -INSERT INTO `menu` VALUES (47, b'0', '会员', 'shop/user/index', 46, 21, 'peoples', 'member', b'0', b'0', 'Member', '2019-10-06 16:20:17', 'YXUSER_SELECT', 1); -INSERT INTO `menu` VALUES (48, b'0', '微信管理', '', 0, 3, 'weixin', 'wechat', b'0', b'0', '', '2019-10-06 18:28:54', NULL, 1); -INSERT INTO `menu` VALUES (49, b'0', '微信菜单', 'wechat/menu/index', 48, 31, 'menu', 'wemenu', b'0', b'0', 'WeMenu', '2019-10-06 18:31:06', NULL, 1); -INSERT INTO `menu` VALUES (50, b'0', '图文管理', 'wechat/article/index', 48, 32, 'article', 'wearticle', b'0', b'0', 'WeArticle', '2019-10-07 17:33:45', NULL, 1); -INSERT INTO `menu` VALUES (51, b'0', '自动回复', 'wechat/reply/index', 48, 33, 'reply', 'wereply', b'0', b'0', 'Wereply', '2019-10-10 09:58:31', NULL, 1); -INSERT INTO `menu` VALUES (52, b'0', '公众号配置', 'wechat/config/index', 48, 34, 'configure', 'weconfig', b'0', b'0', 'WeConfig', '2019-10-10 15:52:24', NULL, 1); -INSERT INTO `menu` VALUES (53, b'0', '订单管理', '', 0, 4, 'lock', 'order', b'0', b'0', '', '2019-10-14 14:35:18', NULL, 1); -INSERT INTO `menu` VALUES (54, b'0', '订单', 'shop/order/index', 53, 41, 'order', 'order', b'0', b'0', 'Order', '2019-10-14 14:36:28', 'YXSTOREORDER_SELECT', 1); -INSERT INTO `menu` VALUES (55, b'0', '商城配置', '', 0, 5, 'configure', 'set', b'0', b'0', '', '2019-10-18 15:21:26', NULL, 1); -INSERT INTO `menu` VALUES (56, b'0', '首页幻灯片', 'shop/set/index', 55, 51, 'banner', 'homeBanner', b'0', b'0', 'HomeBanner', '2019-10-18 15:24:30', NULL, 1); -INSERT INTO `menu` VALUES (57, b'0', '首页导航按钮', 'shop/set/menu', 55, 52, 'button', 'homeMenus', b'0', b'0', 'HomeMenus', '2019-10-18 17:23:35', NULL, 1); -INSERT INTO `menu` VALUES (59, b'0', '首页滚动新闻', 'shop/set/roll', 55, 54, 'news', 'roll', b'0', b'0', 'Roll', '2019-10-21 16:41:30', NULL, 1); -INSERT INTO `menu` VALUES (60, b'0', '热门搜索', 'shop/set/hot', 55, 55, 'search', 'hot', b'0', b'0', 'Hot', '2019-10-26 18:21:54', NULL, 1); -INSERT INTO `menu` VALUES (61, b'0', '个人中心菜单', 'shop/set/usermenu', 55, 56, 'menu', 'userMenu', b'0', b'0', 'UserMenu', '2019-10-26 18:42:18', NULL, 1); -INSERT INTO `menu` VALUES (62, b'0', '评论管理', 'shop/reply/index', 53, 42, 'comment', 'reply', b'0', b'0', 'Reply', '2019-11-03 14:39:09', 'YXSTOREPRODUCTREPLY_SELECT', 1); -INSERT INTO `menu` VALUES (63, b'0', '营销管理', '', 0, 6, 'yingxiao', 'activity', b'0', b'0', '', '2019-11-09 14:17:42', NULL, 1); -INSERT INTO `menu` VALUES (64, b'0', '优惠券制作', 'activity/coupon/index', 63, 61, 'coupon', 'coupon', b'0', b'0', 'Coupon', '2019-11-09 14:18:58', 'YXSTORECOUPON_SELECT', 1); -INSERT INTO `menu` VALUES (65, b'0', '已发布优惠券', 'activity/couponissue/index', 63, 62, 'coupon2', 'couponissue', b'0', b'0', 'Couponissue', '2019-11-09 14:20:35', 'YXSTORECOUPONISSUE_SELECT', 1); -INSERT INTO `menu` VALUES (66, b'0', '优惠券领取记录', 'activity/storecouponuser/index', 63, 63, 'log', 'couponuser', b'0', b'0', 'Couponuser', '2019-11-09 14:21:35', NULL, 1); -INSERT INTO `menu` VALUES (67, b'0', '优惠券配置', 'activity/coupon/set', 63, 64, 'log', 'couponset', b'0', b'1', 'Couponset', '2019-11-09 14:22:17', NULL, 1); -INSERT INTO `menu` VALUES (68, b'0', '积分配置', 'wechat/config/point', 55, 59, 'configure', 'pointConfig', b'0', b'0', 'PointConfig', '2019-11-10 18:45:55', NULL, 1); -INSERT INTO `menu` VALUES (69, b'0', '分销管理', '', 0, 7, 'fenxiao', 'promoter', b'0', b'0', '', '2019-11-11 10:42:16', NULL, 1); -INSERT INTO `menu` VALUES (70, b'0', '分销配置', 'wechat/config/promoter', 69, 71, 'configure', 'promoterconfig', b'0', b'0', 'Promoterconfig', '2019-11-11 10:48:37', NULL, 1); -INSERT INTO `menu` VALUES (71, b'0', '分销员', 'shop/user/aindex', 69, 72, 'user', 'agent', b'0', b'0', 'Agent', '2019-11-13 18:32:00', NULL, 1); -INSERT INTO `menu` VALUES (72, b'0', '提现管理', 'activity/extract/index', 176, 81, 'tixian', 'extract', b'0', b'0', 'Extract', '2019-11-14 10:49:39', NULL, 1); -INSERT INTO `menu` VALUES (73, b'0', '拼团产品', 'activity/combination/index', 63, 64, 'peoples', 'combination', b'0', b'0', 'Combination', '2019-11-18 14:23:04', 'YXSTORECOMBINATION_SELECT', 1); -INSERT INTO `menu` VALUES (74, b'0', '拼团列表', 'activity/combinlist/index', 63, 65, 'list', 'pink', b'0', b'0', 'Pink', '2019-11-21 19:35:58', NULL, 1); -INSERT INTO `menu` VALUES (75, b'0', '微信支付配置', 'wechat/config/pay', 48, 35, 'wxpay', 'wxpayconfig', b'0', b'0', 'Wxpayconfig', '2019-11-28 17:06:22', NULL, 1); -INSERT INTO `menu` VALUES (76, b'0', '小程序配置', 'wechat/config/wxapp', 48, 36, 'configure', 'wxapp', b'0', b'0', 'Wxapp', '2019-11-29 15:13:46', NULL, 1); -INSERT INTO `menu` VALUES (77, b'0', '会员等级', 'shop/userlevel/index', 46, 22, 'dengji', 'userlevel', b'0', b'0', 'Userlevel', '2019-12-04 16:35:41', 'YXSYSTEMUSERLEVEL_SELECT', 1); -INSERT INTO `menu` VALUES (78, b'0', '等级任务', 'shop/usertask/index', 46, 23, 'task manege', 'usertask', b'0', b'0', 'Usertask', '2019-12-04 17:26:19', 'YXSYSTEMUSERTASK_SELECT', 1); -INSERT INTO `menu` VALUES (79, b'0', '签到天数配置', 'shop/set/sign', 55, 57, 'sign2', 'signday', b'0', b'0', 'Signday', '2019-12-05 14:12:16', NULL, 1); -INSERT INTO `menu` VALUES (80, b'0', '用户账单', 'shop/user/bill', 46, 24, 'list', 'bill', b'0', b'0', 'Bill', '2019-12-11 17:28:38', NULL, 1); -INSERT INTO `menu` VALUES (81, b'0', '物流快递', 'shop/express/index', 53, 43, 'express', 'express', b'0', b'0', 'Express', '2019-12-12 16:36:00', 'YXEXPRESS_SELECT', 1); -INSERT INTO `menu` VALUES (82, b'0', '微信模板消息', 'wechat/template/index', 48, 35, 'anq', 'template', b'0', b'0', 'Template', '2019-12-13 14:42:50', NULL, 1); -INSERT INTO `menu` VALUES (83, b'0', '秒杀产品', 'activity/seckill/index', 63, 66, 'seckill', 'seckill', b'0', b'0', 'Seckill', '2019-12-16 13:06:29', 'YXSTORESECKILL_SELECT', 1); -INSERT INTO `menu` VALUES (84, b'0', '秒杀配置', 'shop/set/seckill', 63, 67, 'configure', 'seckillconfig', b'0', b'0', 'Seckillconfig', '2019-12-16 16:07:42', NULL, 1); -INSERT INTO `menu` VALUES (86, b'0', '砍价产品', 'activity/bargain/index', 63, 956, 'Sign', 'bargain', b'0', b'0', 'Bargain', '2019-12-22 12:25:55', 'YXSTOREBARGAIN_SELECT', 1); -INSERT INTO `menu` VALUES (87, b'0', '生成配置', 'generator/config', 36, 33, 'dev', 'generator/config/:tableName', b'1', b'1', 'GeneratorConfig', '2019-11-17 20:08:56', '', 1); -INSERT INTO `menu` VALUES (88, b'0', '生成预览', 'generator/preview', 36, 999, 'java', 'generator/preview/:tableName', b'1', b'1', 'Preview', '2019-11-26 14:54:36', NULL, 1); -INSERT INTO `menu` VALUES (116, b'0', '生成配置', 'generator/config', 36, 33, 'dev', 'generator/config/:tableName', b'1', b'1', 'GeneratorConfig', '2019-11-17 20:08:56', '', 1); -INSERT INTO `menu` VALUES (117, b'0', '图表库', 'components/Echarts', 10, 50, 'chart', 'echarts', b'1', b'0', 'Echarts', '2019-11-21 09:04:32', '', 1); -INSERT INTO `menu` VALUES (118, b'0', '新增', NULL, 45, 1, NULL, NULL, b'0', b'0', NULL, '2019-12-24 13:00:47', 'YXSTOREPRODUCT_EDIT', 2); -INSERT INTO `menu` VALUES (119, b'0', '修改', NULL, 45, 3, NULL, NULL, b'0', b'0', NULL, '2019-12-24 13:02:23', 'YXSTOREPRODUCT_CREATE', 2); -INSERT INTO `menu` VALUES (120, b'0', '删除', NULL, 45, 4, NULL, NULL, b'0', b'0', NULL, '2019-12-24 13:03:51', 'YXSTOREPRODUCT_DELETE', 2); -INSERT INTO `menu` VALUES (121, b'0', '在线用户', 'monitor/online/index', 6, 10, 'Steve-Jobs', 'online', b'0', b'0', 'OnlineUser', '2020-01-06 22:46:43', NULL, 1); -INSERT INTO `menu` VALUES (122, b'0', '浏览记录', 'monitor/log/mlog', 40, 13, 'log', 'viewlog', b'0', b'0', 'Viewlog', '2020-01-07 13:17:21', NULL, 1); -INSERT INTO `menu` VALUES (123, b'0', '后台接口文档', 'tools/swagger/index', 36, 31, 'swagger', 'swagger2', b'0', b'0', 'Swagger', '2020-01-07 18:05:52', NULL, 1); -INSERT INTO `menu` VALUES (124, b'0', '在线会员', 'monitor/online/indext', 46, 25, 'Steve-Jobs', 'onlinet', b'0', b'0', 'OnlineMember', '2020-01-13 10:53:07', NULL, 1); -INSERT INTO `menu` VALUES (125, b'0', '邮费配置', 'wechat/config/postage', 55, 58, 'configure', 'postageConfig', b'0', b'0', 'PostageConfig', '2020-02-13 15:38:24', NULL, 1); -INSERT INTO `menu` VALUES (126, b'0', '编辑', NULL, 54, 1, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:05:28', 'YXSTOREORDER_EDIT', 2); -INSERT INTO `menu` VALUES (127, b'0', '用户新增', NULL, 2, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:12:21', 'user:add', 2); -INSERT INTO `menu` VALUES (128, b'0', '用户编辑', NULL, 2, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:12:47', 'user:edit', 2); -INSERT INTO `menu` VALUES (129, b'0', '用户删除', NULL, 2, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:13:08', 'user:del', 2); -INSERT INTO `menu` VALUES (130, b'0', '角色创建', NULL, 3, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:13:49', 'roles:add', 2); -INSERT INTO `menu` VALUES (131, b'0', '角色修改', NULL, 3, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:14:11', 'roles:edit', 2); -INSERT INTO `menu` VALUES (132, b'0', '角色删除', NULL, 3, 999, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:14:38', '4', 2); -INSERT INTO `menu` VALUES (133, b'0', '菜单新增', NULL, 5, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:15:05', 'menu:add', 2); -INSERT INTO `menu` VALUES (134, b'0', '菜单编辑', NULL, 5, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:18:44', 'menu:edit', 2); -INSERT INTO `menu` VALUES (135, b'0', '菜单删除', NULL, 5, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:19:05', 'menu:del', 2); -INSERT INTO `menu` VALUES (136, b'0', '部门新增', NULL, 35, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:21:07', 'dept:add', 2); -INSERT INTO `menu` VALUES (137, b'0', '部门编辑', NULL, 35, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:21:33', 'dept:edit', 2); -INSERT INTO `menu` VALUES (138, b'0', '部门删除', NULL, 35, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:21:53', 'dept:del', 2); -INSERT INTO `menu` VALUES (139, b'0', '岗位新增', NULL, 37, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:29:04', 'job:add', 2); -INSERT INTO `menu` VALUES (140, b'0', '岗位编辑', NULL, 37, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:48:38', 'job:edit', 2); -INSERT INTO `menu` VALUES (141, b'0', '岗位删除', NULL, 37, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:49:00', 'job:del', 2); -INSERT INTO `menu` VALUES (142, b'0', '字典新增', NULL, 39, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:49:26', 'dict:add', 2); -INSERT INTO `menu` VALUES (143, b'0', '字典编辑', NULL, 39, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:49:39', 'dict:edit', 2); -INSERT INTO `menu` VALUES (144, b'0', '字典删除', NULL, 39, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:49:56', 'dict:del', 2); -INSERT INTO `menu` VALUES (145, b'0', '图片上传', NULL, 16, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:52:31', 'pictures:add', 2); -INSERT INTO `menu` VALUES (146, b'0', '图片删除', NULL, 16, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:52:56', 'pictures:del', 2); -INSERT INTO `menu` VALUES (147, b'0', '上传文件', NULL, 18, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:53:49', 'storage:add', 2); -INSERT INTO `menu` VALUES (148, b'0', '文件编辑', NULL, 18, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:54:06', 'storage:edit', 2); -INSERT INTO `menu` VALUES (149, b'0', '文件删除', NULL, 18, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:54:27', 'storage:del', 2); -INSERT INTO `menu` VALUES (150, b'0', '任务新增', NULL, 28, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:55:58', 'timing:add', 2); -INSERT INTO `menu` VALUES (151, b'0', '任务编辑', NULL, 28, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:56:54', 'timing:edit', 2); -INSERT INTO `menu` VALUES (152, b'0', '任务删除', NULL, 28, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:57:10', 'timing:del', 2); -INSERT INTO `menu` VALUES (153, b'0', '新增分类', NULL, 41, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:00:41', 'YXSTORECATEGORY_CREATE', 2); -INSERT INTO `menu` VALUES (154, b'0', '分类编辑', NULL, 41, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:01:15', 'YXSTORECATEGORY_EDIT', 2); -INSERT INTO `menu` VALUES (155, b'0', '分类删除', NULL, 41, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:01:37', 'YXSTORECATEGORY_DELETE', 2); -INSERT INTO `menu` VALUES (156, b'0', '修改会员', NULL, 47, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:03:40', 'YXUSER_EDIT', 2); -INSERT INTO `menu` VALUES (157, b'0', '等级新增', NULL, 77, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:06:55', 'YXSYSTEMUSERLEVEL_CREATE', 2); -INSERT INTO `menu` VALUES (158, b'0', '等级编辑', NULL, 77, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:08:03', 'YXSYSTEMUSERLEVEL_EDIT', 2); -INSERT INTO `menu` VALUES (159, b'0', '等级删除', NULL, 77, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:08:41', 'YXSYSTEMUSERLEVEL_DELETE', 2); -INSERT INTO `menu` VALUES (160, b'0', '编辑任务', NULL, 78, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:10:08', 'YXSYSTEMUSERTASK_EDIT', 2); -INSERT INTO `menu` VALUES (161, b'0', '评论删除', NULL, 62, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:14:22', 'YXSTOREPRODUCTREPLY_DELETE', 2); -INSERT INTO `menu` VALUES (162, b'0', '新增物流', NULL, 81, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:15:33', 'YXEXPRESS_CREATE', 2); -INSERT INTO `menu` VALUES (163, b'0', '编辑物流', NULL, 81, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:15:53', 'YXEXPRESS_EDIT', 2); -INSERT INTO `menu` VALUES (164, b'0', '删除物流', NULL, 81, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:16:11', 'YXEXPRESS_DELETE', 2); -INSERT INTO `menu` VALUES (165, b'0', '新增优惠券', NULL, 64, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:18:32', 'YXSTORECOUPON_CREATE', 2); -INSERT INTO `menu` VALUES (166, b'0', '编辑优惠券', NULL, 64, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:18:50', 'YXSTORECOUPON_EDIT', 2); -INSERT INTO `menu` VALUES (167, b'0', '删除优惠券', NULL, 64, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:19:10', 'YXSTORECOUPON_DELETE', 2); -INSERT INTO `menu` VALUES (168, b'0', '编辑已发布', NULL, 65, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:20:23', 'YXSTORECOUPONISSUE_EDIT', 2); -INSERT INTO `menu` VALUES (169, b'0', '删除已发布', NULL, 65, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:20:42', 'YXSTORECOUPONISSUE_DELETE', 2); -INSERT INTO `menu` VALUES (170, b'0', '编辑拼团', NULL, 73, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:24:15', 'YXSTORECOMBINATION_EDIT', 2); -INSERT INTO `menu` VALUES (171, b'0', '删除拼团', NULL, 73, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:24:37', 'YXSTORECOMBINATION_DELETE', 2); -INSERT INTO `menu` VALUES (172, b'0', '编辑秒杀', NULL, 83, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:25:23', 'YXSTORESECKILL_EDIT', 2); -INSERT INTO `menu` VALUES (173, b'0', '删除秒杀', NULL, 83, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:25:41', 'YXSTORESECKILL_DELETE', 2); -INSERT INTO `menu` VALUES (174, b'0', '编辑砍价', NULL, 86, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:26:20', 'YXSTOREBARGAIN_EDIT', 2); -INSERT INTO `menu` VALUES (175, b'0', '删除砍价', NULL, 86, 999, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:26:40', 'YXSTOREBARGAIN_DELETE', 2); -INSERT INTO `menu` VALUES (176, b'0', '财务管理', NULL, 0, 8, 'price', 'price', b'0', b'0', NULL, '2020-03-02 22:30:23', NULL, 1); -INSERT INTO `menu` VALUES (177, b'0', '充值管理', 'shop/recharge/index', 176, 82, 'rec', 'recharge', b'0', b'0', 'Recharge', '2020-03-02 23:05:26', NULL, 1); -INSERT INTO `menu` VALUES (178, b'0', '门店管理', NULL, 0, 9, 'store', 'store', b'0', b'0', NULL, '2020-03-03 17:27:53', NULL, 1); -INSERT INTO `menu` VALUES (179, b'0', '门店列表', 'shop/store/index', 178, 92, 'edit', 'storeinfo', b'0', b'0', 'Storeinfo', '2020-03-03 17:29:09', NULL, 1); -INSERT INTO `menu` VALUES (180, b'0', '门店配置', 'shop/store/set', 178, 91, 'configure', 'storeset', b'0', b'0', 'Storeset', '2020-03-04 13:09:54', NULL, 1); -INSERT INTO `menu` VALUES (181, b'0', '核销订单', 'shop/order/indext', 178, 95, 'order', 'ordert', b'0', b'0', 'Ordert', '2020-03-05 17:04:12', NULL, 1); -INSERT INTO `menu` VALUES (182, b'0', '充值金额配置', 'shop/set/recharge', 55, 60, 'money', 'rechargeset', b'0', b'0', 'Rechargeset', '2020-03-21 14:24:05', NULL, 1); -INSERT INTO `menu` VALUES (183, b'0', '店员列表', 'shop/storestaff/index', 178, 94, 'peoples', 'staff', b'0', b'0', 'Staff', '2020-03-22 14:11:36', NULL, 1); - --- ---------------------------- --- Table structure for mnt_app --- ---------------------------- -DROP TABLE IF EXISTS `mnt_app`; -CREATE TABLE `mnt_app` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '应用ID', - `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应用名称', - `upload_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上传目录', - `deploy_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部署路径', - `backup_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备份路径', - `port` int(255) NULL DEFAULT NULL COMMENT '应用端口', - `start_script` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '启动脚本', - `deploy_script` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部署脚本', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '应用管理' ROW_FORMAT = Compact; - --- ---------------------------- --- Table structure for mnt_database --- ---------------------------- -DROP TABLE IF EXISTS `mnt_database`; -CREATE TABLE `mnt_database` ( - `id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编号', - `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称', - `jdbc_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'jdbc连接', - `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账号', - `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码', - `create_time` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据库管理' ROW_FORMAT = Compact; - --- ---------------------------- --- Table structure for mnt_deploy --- ---------------------------- -DROP TABLE IF EXISTS `mnt_deploy`; -CREATE TABLE `mnt_deploy` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', - `app_id` bigint(20) NULL DEFAULT NULL COMMENT '应用编号', - `create_time` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE, - INDEX `FK6sy157pseoxx4fmcqr1vnvvhy`(`app_id`) USING BTREE, - CONSTRAINT `FK6sy157pseoxx4fmcqr1vnvvhy` FOREIGN KEY (`app_id`) REFERENCES `mnt_app` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部署管理' ROW_FORMAT = Compact; - --- ---------------------------- --- Table structure for mnt_deploy_history --- ---------------------------- -DROP TABLE IF EXISTS `mnt_deploy_history`; -CREATE TABLE `mnt_deploy_history` ( - `id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编号', - `app_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '应用名称', - `deploy_date` datetime(0) NOT NULL COMMENT '部署日期', - `deploy_user` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '部署用户', - `ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '服务器IP', - `deploy_id` bigint(20) NULL DEFAULT NULL COMMENT '部署编号', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部署历史管理' ROW_FORMAT = Compact; - --- ---------------------------- --- Table structure for mnt_deploy_server --- ---------------------------- -DROP TABLE IF EXISTS `mnt_deploy_server`; -CREATE TABLE `mnt_deploy_server` ( - `deploy_id` bigint(20) NOT NULL, - `server_id` bigint(20) NOT NULL, - PRIMARY KEY (`deploy_id`, `server_id`) USING BTREE, - INDEX `FKeaaha7jew9a02b3bk9ghols53`(`server_id`) USING BTREE, - CONSTRAINT `FK3cehr56tedph6nk3gxsmeq0pb` FOREIGN KEY (`deploy_id`) REFERENCES `mnt_deploy` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, - CONSTRAINT `FKeaaha7jew9a02b3bk9ghols53` FOREIGN KEY (`server_id`) REFERENCES `mnt_server` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '应用与服务器关联' ROW_FORMAT = Compact; - --- ---------------------------- --- Table structure for mnt_server --- ---------------------------- -DROP TABLE IF EXISTS `mnt_server`; -CREATE TABLE `mnt_server` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'IP地址', - `account` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账号', - `ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'IP地址', - `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', - `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码', - `port` int(11) NULL DEFAULT NULL COMMENT '端口', - `create_time` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '服务器管理' ROW_FORMAT = Compact; - --- ---------------------------- --- Table structure for monitor_server --- ---------------------------- -DROP TABLE IF EXISTS `monitor_server`; -CREATE TABLE `monitor_server` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `cpu_core` int(11) NULL DEFAULT NULL COMMENT 'CPU内核数', - `cpu_rate` double NULL DEFAULT NULL COMMENT 'CPU使用率', - `disk_total` double NULL DEFAULT NULL COMMENT '磁盘总量', - `disk_used` double NULL DEFAULT NULL COMMENT '磁盘使用量', - `mem_total` double NULL DEFAULT NULL COMMENT '内存总数', - `mem_used` double NULL DEFAULT NULL COMMENT '内存使用量', - `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', - `port` int(11) NULL DEFAULT NULL COMMENT '访问端口', - `sort` int(11) NULL DEFAULT NULL COMMENT '排序', - `state` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态', - `swap_total` double NULL DEFAULT NULL COMMENT '交换区总量', - `swap_used` double NULL DEFAULT NULL COMMENT '交换区使用量', - `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '服务地址', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '服务监控' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of monitor_server --- ---------------------------- -INSERT INTO `monitor_server` VALUES (1, 8, 0.05924018, 465.12402, 91.66521, 7.849415, 7.6052284, '本地', 8777, 999, '0', 14.599415, 11.263367, 'localhost'); - --- ---------------------------- --- Table structure for picture --- ---------------------------- -DROP TABLE IF EXISTS `picture`; -CREATE TABLE `picture` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `create_time` datetime(0) 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 '图片宽度', - `md5code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件的MD5值', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Sm.Ms图床' 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 COMMENT = '七牛云配置' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of qiniu_config --- ---------------------------- -INSERT INTO `qiniu_config` VALUES (1, '111111', 'yixiang', 'https://image.dayouqiantu.cn', '22222', '公开', '华东'); - --- ---------------------------- --- 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(0) 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 = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '七牛云文件存储' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of qiniu_content --- ---------------------------- -INSERT INTO `qiniu_content` VALUES (1, 'yixiang', 'list_34', '27.05KB ', '公开', '2020-01-07 12:05:41', 'https://pic.dayouqiantu.cn/list_34.png', 'png'); -INSERT INTO `qiniu_content` VALUES (2, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-07 12:11:15', 'https://pic.dayouqiantu.cn/list_32.png', 'png'); -INSERT INTO `qiniu_content` VALUES (3, 'yixiang', 'list_30', '28.57KB ', '公开', '2020-01-07 12:13:26', 'https://image.dayouqiantu.cn/list_30.png', 'png'); -INSERT INTO `qiniu_content` VALUES (4, 'yixiang', 'list_34', '27.05KB ', '公开', '2020-01-07 12:32:15', 'https://image.dayouqiantu.cn/list_34.png', 'png'); -INSERT INTO `qiniu_content` VALUES (5, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-07 12:53:11', 'https://image.dayouqiantu.cn/list_32.png', 'png'); -INSERT INTO `qiniu_content` VALUES (6, 'yixiang', 'list_34', '27.05KB ', '公开', '2020-01-07 13:05:55', 'https://image.dayouqiantu.cn/list_34.png', 'png'); -INSERT INTO `qiniu_content` VALUES (7, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-07 13:08:32', 'https://image.dayouqiantu.cn/list_32.png', 'png'); -INSERT INTO `qiniu_content` VALUES (8, 'yixiang', 'list_22', '28.23KB ', '公开', '2020-01-07 13:08:38', 'https://image.dayouqiantu.cn/list_22.png', 'png'); -INSERT INTO `qiniu_content` VALUES (9, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-07 13:08:49', 'https://image.dayouqiantu.cn/list_32.png', 'png'); -INSERT INTO `qiniu_content` VALUES (10, 'yixiang', 'list_34', '27.05KB ', '公开', '2020-01-10 12:02:24', 'https://image.dayouqiantu.cn/list_34.png', 'png'); -INSERT INTO `qiniu_content` VALUES (11, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-10 16:49:48', 'https://image.dayouqiantu.cn/list_32.png', 'png'); -INSERT INTO `qiniu_content` VALUES (12, 'yixiang', 'list_20', '22.92KB ', '公开', '2020-01-10 22:43:47', 'https://image.dayouqiantu.cn/list_20.png', 'png'); -INSERT INTO `qiniu_content` VALUES (13, 'yixiang', 'list_24', '27.31KB ', '公开', '2020-01-10 22:44:21', 'https://image.dayouqiantu.cn/list_24.png', 'png'); -INSERT INTO `qiniu_content` VALUES (14, 'yixiang', 'list_28', '28.38KB ', '公开', '2020-01-11 17:06:00', 'https://image.dayouqiantu.cn/list_28.png', 'png'); - --- ---------------------------- --- 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 '备注', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务' 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(0) 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 = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务日志' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of quartz_log --- ---------------------------- -INSERT INTO `quartz_log` VALUES (1, 'visitsTask', '2020-01-10 00:00:00', '0 0 0 * * ?', NULL, b'1', '更新访客记录', 'run', NULL, 160); -INSERT INTO `quartz_log` VALUES (2, 'visitsTask', '2020-03-10 00:00:00', '0 0 0 * * ?', NULL, b'1', '更新访客记录', 'run', NULL, 42); -INSERT INTO `quartz_log` VALUES (3, 'visitsTask', '2020-04-02 00:00:00', '0 0 0 * * ?', NULL, b'1', '更新访客记录', 'run', NULL, 60); - --- ---------------------------- --- Table structure for role --- ---------------------------- -DROP TABLE IF EXISTS `role`; -CREATE TABLE `role` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `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 COMMENT '数据权限', - `level` int(255) NULL DEFAULT NULL COMMENT '角色级别', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - `permission` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '功能权限', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of role --- ---------------------------- -INSERT INTO `role` VALUES (1, '超级管理员', '-', '全部', 1, '2018-11-23 11:04:37', 'admin'); -INSERT INTO `role` VALUES (2, '普通用户', '-', '本级', 2, '2018-11-23 13:09:06', 'common'); -INSERT INTO `role` VALUES (3, '管理员2', '222', '全部', 3, '2020-01-31 16:53:25', '22'); - --- ---------------------------- --- 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 COMMENT = '角色部门关联' ROW_FORMAT = Compact; - --- ---------------------------- --- 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 COMMENT = '角色菜单关联' 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 (5, 1); -INSERT INTO `roles_menus` VALUES (6, 1); -INSERT INTO `roles_menus` VALUES (7, 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 (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 (40, 1); -INSERT INTO `roles_menus` VALUES (41, 1); -INSERT INTO `roles_menus` VALUES (44, 1); -INSERT INTO `roles_menus` VALUES (45, 1); -INSERT INTO `roles_menus` VALUES (46, 1); -INSERT INTO `roles_menus` VALUES (47, 1); -INSERT INTO `roles_menus` VALUES (48, 1); -INSERT INTO `roles_menus` VALUES (49, 1); -INSERT INTO `roles_menus` VALUES (50, 1); -INSERT INTO `roles_menus` VALUES (51, 1); -INSERT INTO `roles_menus` VALUES (52, 1); -INSERT INTO `roles_menus` VALUES (53, 1); -INSERT INTO `roles_menus` VALUES (54, 1); -INSERT INTO `roles_menus` VALUES (55, 1); -INSERT INTO `roles_menus` VALUES (56, 1); -INSERT INTO `roles_menus` VALUES (57, 1); -INSERT INTO `roles_menus` VALUES (58, 1); -INSERT INTO `roles_menus` VALUES (59, 1); -INSERT INTO `roles_menus` VALUES (60, 1); -INSERT INTO `roles_menus` VALUES (61, 1); -INSERT INTO `roles_menus` VALUES (62, 1); -INSERT INTO `roles_menus` VALUES (63, 1); -INSERT INTO `roles_menus` VALUES (64, 1); -INSERT INTO `roles_menus` VALUES (65, 1); -INSERT INTO `roles_menus` VALUES (66, 1); -INSERT INTO `roles_menus` VALUES (67, 1); -INSERT INTO `roles_menus` VALUES (68, 1); -INSERT INTO `roles_menus` VALUES (69, 1); -INSERT INTO `roles_menus` VALUES (70, 1); -INSERT INTO `roles_menus` VALUES (71, 1); -INSERT INTO `roles_menus` VALUES (72, 1); -INSERT INTO `roles_menus` VALUES (73, 1); -INSERT INTO `roles_menus` VALUES (74, 1); -INSERT INTO `roles_menus` VALUES (75, 1); -INSERT INTO `roles_menus` VALUES (76, 1); -INSERT INTO `roles_menus` VALUES (77, 1); -INSERT INTO `roles_menus` VALUES (78, 1); -INSERT INTO `roles_menus` VALUES (79, 1); -INSERT INTO `roles_menus` VALUES (80, 1); -INSERT INTO `roles_menus` VALUES (81, 1); -INSERT INTO `roles_menus` VALUES (82, 1); -INSERT INTO `roles_menus` VALUES (83, 1); -INSERT INTO `roles_menus` VALUES (84, 1); -INSERT INTO `roles_menus` VALUES (86, 1); -INSERT INTO `roles_menus` VALUES (87, 1); -INSERT INTO `roles_menus` VALUES (88, 1); -INSERT INTO `roles_menus` VALUES (116, 1); -INSERT INTO `roles_menus` VALUES (118, 1); -INSERT INTO `roles_menus` VALUES (119, 1); -INSERT INTO `roles_menus` VALUES (120, 1); -INSERT INTO `roles_menus` VALUES (121, 1); -INSERT INTO `roles_menus` VALUES (122, 1); -INSERT INTO `roles_menus` VALUES (123, 1); -INSERT INTO `roles_menus` VALUES (124, 1); -INSERT INTO `roles_menus` VALUES (125, 1); -INSERT INTO `roles_menus` VALUES (176, 1); -INSERT INTO `roles_menus` VALUES (177, 1); -INSERT INTO `roles_menus` VALUES (178, 1); -INSERT INTO `roles_menus` VALUES (179, 1); -INSERT INTO `roles_menus` VALUES (180, 1); -INSERT INTO `roles_menus` VALUES (181, 1); -INSERT INTO `roles_menus` VALUES (182, 1); -INSERT INTO `roles_menus` VALUES (183, 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 (5, 2); -INSERT INTO `roles_menus` VALUES (6, 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 (18, 2); -INSERT INTO `roles_menus` VALUES (19, 2); -INSERT INTO `roles_menus` VALUES (21, 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 (40, 2); -INSERT INTO `roles_menus` VALUES (41, 2); -INSERT INTO `roles_menus` VALUES (44, 2); -INSERT INTO `roles_menus` VALUES (45, 2); -INSERT INTO `roles_menus` VALUES (48, 2); -INSERT INTO `roles_menus` VALUES (49, 2); -INSERT INTO `roles_menus` VALUES (50, 2); -INSERT INTO `roles_menus` VALUES (53, 2); -INSERT INTO `roles_menus` VALUES (54, 2); -INSERT INTO `roles_menus` VALUES (77, 2); -INSERT INTO `roles_menus` VALUES (78, 2); -INSERT INTO `roles_menus` VALUES (79, 2); -INSERT INTO `roles_menus` VALUES (118, 2); -INSERT INTO `roles_menus` VALUES (119, 2); -INSERT INTO `roles_menus` VALUES (126, 2); -INSERT INTO `roles_menus` VALUES (154, 2); - --- ---------------------------- --- 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 '头像', - `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 '用户名', - `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门名称', - `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码', - `job_id` bigint(20) NULL DEFAULT NULL COMMENT '岗位名称', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', - `last_password_reset_time` datetime(0) NULL DEFAULT NULL COMMENT '最后修改密码的日期', - `nick_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `sex` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci 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 COMMENT = '系统用户' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of user --- ---------------------------- -INSERT INTO `user` VALUES (1, NULL, 'yshop@qq.com', 1, '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', 'admin', 2, '18888888888', 11, '2018-08-23 09:11:56', '2019-05-18 17:34:21', '管理员', '男'); -INSERT INTO `user` VALUES (3, NULL, 'test@yshopnet', 1, '$2a$10$HhxyGZy.ulf3RvAwaHUGb.k.2i9PBpv4YbLMJWp8pES7pPhTyRCF.', 'test', 2, '17777777777', 12, '2018-12-27 20:05:26', '2019-04-01 09:15:24', '测试', '男'); -INSERT INTO `user` VALUES (4, NULL, 'test2@qq.com', 1, '$2a$10$IjehtV8MiXb8ni.Qz0wBteE7FjVn49cEcsSj2.ZBUqqHjnC3umSh.', 'test2', 2, '15136175247', 11, '2020-02-15 20:39:16', NULL, 'test2', '男'); -INSERT INTO `user` VALUES (5, NULL, '444@qq.com', 0, '$2a$10$f/VH35NBOBszycV9KEA1HenQ0qVjazDm8LacQU9PO.A4UizFxLMuq', 'qqqqq', 11, '15136175249', 8, '2020-02-17 11:12:01', NULL, 'eeeeee', '男'); - --- ---------------------------- --- 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 COMMENT '真实文件名', - `path` 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 '大小', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统用户头像' 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 COMMENT = '用户角色关联' 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 (4, 2); -INSERT INTO `users_roles` VALUES (5, 2); - --- ---------------------------- --- 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(0) 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 COMMENT = '验证码' 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(0) 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 = 94 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '访客记录' ROW_FORMAT = Compact; - --- ---------------------------- --- Records of visits --- ---------------------------- -INSERT INTO `visits` VALUES (21, '2019-12-31 11:40:24', '2019-12-31', 2, 4, 'Tue'); -INSERT INTO `visits` VALUES (22, '2020-01-06 16:55:15', '2020-01-06', 4, 25, 'Mon'); -INSERT INTO `visits` VALUES (23, '2020-01-07 11:32:57', '2020-01-07', 4, 8, 'Tue'); -INSERT INTO `visits` VALUES (24, '2020-01-08 00:04:57', '2020-01-08', 2, 17, 'Wed'); -INSERT INTO `visits` VALUES (25, '2020-01-09 14:28:38', '2020-01-09', 3, 3, 'Thu'); -INSERT INTO `visits` VALUES (26, '2020-01-10 00:00:00', '2020-01-10', 6, 16, 'Fri'); -INSERT INTO `visits` VALUES (27, '2020-01-11 11:06:01', '2020-01-11', 1, 2, 'Sat'); -INSERT INTO `visits` VALUES (28, '2020-01-12 17:19:42', '2020-01-12', 1, 1, 'Sun'); -INSERT INTO `visits` VALUES (29, '2020-01-13 10:18:00', '2020-01-13', 1, 2, 'Mon'); -INSERT INTO `visits` VALUES (30, '2020-01-14 17:34:40', '2020-01-14', 1, 3, 'Tue'); -INSERT INTO `visits` VALUES (31, '2020-01-15 11:23:03', '2020-01-15', 1, 1, 'Wed'); -INSERT INTO `visits` VALUES (32, '2020-01-16 10:45:22', '2020-01-16', 1, 1, 'Thu'); -INSERT INTO `visits` VALUES (33, '2020-01-17 18:07:10', '2020-01-17', 1, 1, 'Fri'); -INSERT INTO `visits` VALUES (34, '2020-01-18 18:19:03', '2020-01-18', 1, 2, 'Sat'); -INSERT INTO `visits` VALUES (35, '2020-01-19 09:53:20', '2020-01-19', 1, 1, 'Sun'); -INSERT INTO `visits` VALUES (36, '2020-01-20 14:01:00', '2020-01-20', 1, 1, 'Mon'); -INSERT INTO `visits` VALUES (37, '2020-01-31 10:38:18', '2020-01-31', 1, 2, 'Fri'); -INSERT INTO `visits` VALUES (38, '2020-02-02 14:27:41', '2020-02-02', 1, 2, 'Sun'); -INSERT INTO `visits` VALUES (39, '2020-02-03 14:11:42', '2020-02-03', 1, 1, 'Mon'); -INSERT INTO `visits` VALUES (40, '2020-02-04 10:27:33', '2020-02-04', 1, 1, 'Tue'); -INSERT INTO `visits` VALUES (41, '2020-02-05 10:40:14', '2020-02-05', 1, 2, 'Wed'); -INSERT INTO `visits` VALUES (42, '2020-02-07 10:17:32', '2020-02-07', 1, 1, 'Fri'); -INSERT INTO `visits` VALUES (43, '2020-02-09 13:31:49', '2020-02-09', 1, 1, 'Sun'); -INSERT INTO `visits` VALUES (44, '2020-02-10 10:07:12', '2020-02-10', 1, 3, 'Mon'); -INSERT INTO `visits` VALUES (45, '2020-02-11 21:31:13', '2020-02-11', 1, 1, 'Tue'); -INSERT INTO `visits` VALUES (46, '2020-02-13 14:47:22', '2020-02-13', 1, 3, 'Thu'); -INSERT INTO `visits` VALUES (47, '2020-02-14 13:32:26', '2020-02-14', 3, 5, 'Fri'); -INSERT INTO `visits` VALUES (48, '2020-02-15 20:37:36', '2020-02-15', 1, 4, 'Sat'); -INSERT INTO `visits` VALUES (49, '2020-02-16 20:11:40', '2020-02-16', 1, 4, 'Sun'); -INSERT INTO `visits` VALUES (50, '2020-02-17 09:48:36', '2020-02-17', 1, 2, 'Mon'); -INSERT INTO `visits` VALUES (51, '2020-02-19 10:34:18', '2020-02-19', 1, 3, 'Wed'); -INSERT INTO `visits` VALUES (52, '2020-02-20 21:19:04', '2020-02-20', 1, 1, 'Thu'); -INSERT INTO `visits` VALUES (53, '2020-02-21 10:25:10', '2020-02-21', 1, 1, 'Fri'); -INSERT INTO `visits` VALUES (54, '2020-02-23 16:34:09', '2020-02-23', 1, 2, 'Sun'); -INSERT INTO `visits` VALUES (55, '2020-02-24 14:30:06', '2020-02-24', 1, 2, 'Mon'); -INSERT INTO `visits` VALUES (56, '2020-02-26 15:24:09', '2020-02-26', 1, 1, 'Wed'); -INSERT INTO `visits` VALUES (57, '2020-02-27 12:55:34', '2020-02-27', 2, 3, 'Thu'); -INSERT INTO `visits` VALUES (58, '2020-02-28 15:31:37', '2020-02-28', 2, 4, 'Fri'); -INSERT INTO `visits` VALUES (59, '2020-02-29 14:37:48', '2020-02-29', 2, 3, 'Sat'); -INSERT INTO `visits` VALUES (60, '2020-03-01 13:43:01', '2020-03-01', 2, 5, 'Sun'); -INSERT INTO `visits` VALUES (61, '2020-03-02 18:36:56', '2020-03-02', 2, 7, 'Mon'); -INSERT INTO `visits` VALUES (62, '2020-03-03 02:51:42', '2020-03-03', 2, 9, 'Tue'); -INSERT INTO `visits` VALUES (63, '2020-03-04 12:55:53', '2020-03-04', 1, 11, 'Wed'); -INSERT INTO `visits` VALUES (64, '2020-03-05 12:55:28', '2020-03-05', 1, 2, 'Thu'); -INSERT INTO `visits` VALUES (65, '2020-03-06 02:48:11', '2020-03-06', 2, 2, 'Fri'); -INSERT INTO `visits` VALUES (66, '2020-03-07 09:58:45', '2020-03-07', 1, 2, 'Sat'); -INSERT INTO `visits` VALUES (67, '2020-03-08 10:24:41', '2020-03-08', 1, 1, 'Sun'); -INSERT INTO `visits` VALUES (68, '2020-03-09 22:57:23', '2020-03-09', 1, 2, 'Mon'); -INSERT INTO `visits` VALUES (69, '2020-03-10 00:00:00', '2020-03-10', 1, 2, 'Tue'); -INSERT INTO `visits` VALUES (70, '2020-03-11 16:10:12', '2020-03-11', 2, 10, 'Wed'); -INSERT INTO `visits` VALUES (71, '2020-03-12 12:37:42', '2020-03-12', 1, 1, 'Thu'); -INSERT INTO `visits` VALUES (72, '2020-03-13 13:13:48', '2020-03-13', 1, 5, 'Fri'); -INSERT INTO `visits` VALUES (73, '2020-03-14 09:59:04', '2020-03-14', 1, 7, 'Sat'); -INSERT INTO `visits` VALUES (74, '2020-03-15 12:38:59', '2020-03-15', 1, 5, 'Sun'); -INSERT INTO `visits` VALUES (75, '2020-03-18 20:37:00', '2020-03-18', 1, 1, 'Wed'); -INSERT INTO `visits` VALUES (76, '2020-03-19 14:19:16', '2020-03-19', 1, 2, 'Thu'); -INSERT INTO `visits` VALUES (77, '2020-03-21 13:23:28', '2020-03-21', 1, 4, 'Sat'); -INSERT INTO `visits` VALUES (78, '2020-03-22 14:01:05', '2020-03-22', 1, 6, 'Sun'); -INSERT INTO `visits` VALUES (79, '2020-03-23 13:08:06', '2020-03-23', 1, 2, 'Mon'); -INSERT INTO `visits` VALUES (80, '2020-03-24 13:52:07', '2020-03-24', 1, 6, 'Tue'); -INSERT INTO `visits` VALUES (81, '2020-03-25 11:18:01', '2020-03-25', 1, 2, 'Wed'); -INSERT INTO `visits` VALUES (82, '2020-03-26 13:40:28', '2020-03-26', 1, 2, 'Thu'); -INSERT INTO `visits` VALUES (83, '2020-03-27 11:11:32', '2020-03-27', 1, 2, 'Fri'); -INSERT INTO `visits` VALUES (84, '2020-03-28 15:24:09', '2020-03-28', 1, 3, 'Sat'); -INSERT INTO `visits` VALUES (85, '2020-03-29 21:56:39', '2020-03-29', 1, 1, 'Sun'); -INSERT INTO `visits` VALUES (86, '2020-03-31 16:50:56', '2020-03-31', 1, 2, 'Tue'); -INSERT INTO `visits` VALUES (87, '2020-04-01 13:52:04', '2020-04-01', 1, 3, 'Wed'); -INSERT INTO `visits` VALUES (88, '2020-04-02 00:00:00', '2020-04-02', 1, 8, 'Thu'); -INSERT INTO `visits` VALUES (89, '2020-04-03 10:50:28', '2020-04-03', 1, 29, 'Fri'); -INSERT INTO `visits` VALUES (90, '2020-04-04 17:56:12', '2020-04-04', 1, 1, 'Sat'); -INSERT INTO `visits` VALUES (91, '2020-04-05 09:24:56', '2020-04-05', 1, 3, 'Sun'); -INSERT INTO `visits` VALUES (92, '2020-04-06 21:38:54', '2020-04-06', 1, 2, 'Mon'); -INSERT INTO `visits` VALUES (93, '2020-04-07 15:06:27', '2020-04-07', 1, 2, 'Tue'); - --- ---------------------------- --- 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 '文章简介', - `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, - `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 NULL DEFAULT 0 COMMENT '排序', - `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原文链接', - `status` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '状态', - `add_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '添加时间', - `hide` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否隐藏', - `admin_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '管理员id', - `mer_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '商户id', - `product_id` int(10) NULL DEFAULT 0 COMMENT '产品关联id', - `is_hot` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否热门(小程序)', - `is_banner` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否轮播图(小程序)', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章管理表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_article --- ---------------------------- -INSERT INTO `yx_article` VALUES (2, '', 'yshop1.3版本上线了', 'yshop', 'http://localhost:8000/file/pic/list_16-20200110120838173.png', 'yshop1.3版本上线了', '

yshop1.3版本上线了

', '', '', '4', NULL, '', NULL, '2019-08-22 12:26', NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `yx_article` VALUES (3, '', '333', '333', 'http://localhost:8000/file/pic/list_16-20200110120838173.png', '11111', '

11111

', '', '', '', NULL, '', NULL, '1580631108', NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `yx_article` VALUES (5, '', '444', '4444', 'http://localhost:8000/file/pic/砍价-20200311043720679.png', '444', '

4444

', '', '', '', NULL, '', NULL, '2020-03-13 14:15', NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `yx_article` VALUES (6, '', '555', '555', 'http://localhost:8000/file/pic/秒杀-2020031104371672.png', '555', '

555

', '', '', '5', NULL, '', NULL, '2020-03-13 14:55', NULL, NULL, NULL, NULL, NULL, NULL); - --- ---------------------------- --- Table structure for yx_wechat_menu --- ---------------------------- -DROP TABLE IF EXISTS `yx_wechat_menu`; -CREATE TABLE `yx_wechat_menu` ( - `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; - --- ---------------------------- --- Records of yx_wechat_menu --- ---------------------------- -INSERT INTO `yx_wechat_menu` VALUES ('wechat_menus', '[{\"subButtons\":[{\"name\":\"公众号演示\",\"type\":\"view\",\"url\":\"https://h5.dayouqiantu.cn\"}],\"name\":\"Yshop商城3\",\"type\":\"click\",\"key\":\"yshop\"},{\"subButtons\":[{\"appId\":\"wxa82b5b7fcb0ec161\",\"name\":\"小程序演示\",\"pagePath\":\"pages/index\",\"type\":\"miniprogram\",\"url\":\"pages/index\"}],\"name\":\"供货商城\",\"type\":\"click\",\"key\":\"supply\"},{\"subButtons\":[],\"name\":\"3333\",\"type\":\"click\",\"key\":\"2222\"}]', 1570435277); - --- ---------------------------- --- 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 = 430 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '快递公司表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_express --- ---------------------------- -INSERT INTO `yx_express` VALUES (426, 'STO', '申通快递', 0, 0); -INSERT INTO `yx_express` VALUES (427, 'SF', '顺丰速运', 0, 0); -INSERT INTO `yx_express` VALUES (428, 'ZTO', '中通快递', 0, 0); -INSERT INTO `yx_express` VALUES (429, 'YTO', '圆通速递', 0, 0); - --- ---------------------------- --- Table structure for yx_material --- ---------------------------- -DROP TABLE IF EXISTS `yx_material`; -CREATE TABLE `yx_material` ( - `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'PK', - `del_flag` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '逻辑删除标记(0:显示;1:隐藏)', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `create_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者ID', - `type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '类型1、图片;2、视频', - `group_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '分组ID', - `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '素材名', - `url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '素材链接', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '素材库' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_material --- ---------------------------- -INSERT INTO `yx_material` VALUES ('005cde72c90844d6ba241823960c1fee', '0', '2020-03-28 21:45:32', 'admin', '1', NULL, '钻石.jpg', 'http://localhost:8000/file/pic/钻石-20200328094531898.jpg'); -INSERT INTO `yx_material` VALUES ('00d67e57516745f88bffa7be8702d4d1', '0', '2020-03-11 16:37:21', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '砍价.png', 'http://localhost:8000/file/pic/砍价-20200311043720679.png'); -INSERT INTO `yx_material` VALUES ('15603c4ffb074a62ae3a63bf1fddde54', '0', '2020-03-22 19:13:25', 'admin', '1', NULL, 'list_16.png', 'http://localhost:8000/file/pic/list_16-20200322071324803.png'); -INSERT INTO `yx_material` VALUES ('7218f3bbbc544ce99761815f729afa90', '0', '2020-03-22 19:15:40', 'admin', '1', NULL, 'list_34.png', 'http://localhost:8000/file/pic/list_34-2020032207154023.png'); -INSERT INTO `yx_material` VALUES ('b80364b37e6c46958c24a224d7cd66bd', '0', '2020-03-11 16:37:16', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '秒杀.png', 'http://localhost:8000/file/pic/秒杀-2020031104371672.png'); -INSERT INTO `yx_material` VALUES ('bb933bebe27643298e6aae585a6c9d09', '0', '2020-03-11 16:37:12', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '05ea40b831858a8cf423aa709840507c.png', 'http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200311043711341.png'); -INSERT INTO `yx_material` VALUES ('e6797fa415c14765829d37e02e51feae', '0', '2020-03-11 16:37:25', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '优惠券.png', 'http://localhost:8000/file/pic/优惠券-20200311043724709.png'); -INSERT INTO `yx_material` VALUES ('eb2c13a9155f4b748fee2558ccee2ae8', '0', '2020-03-11 16:37:28', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '资讯.png', 'http://localhost:8000/file/pic/资讯-20200311043727918.png'); -INSERT INTO `yx_material` VALUES ('fc0caf898b58449c8a3b27aa44d8931a', '0', '2020-03-22 19:13:49', 'admin', '1', NULL, 'list_22.png', 'http://localhost:8000/file/pic/list_22-20200322071348844.png'); - --- ---------------------------- --- Table structure for yx_material_group --- ---------------------------- -DROP TABLE IF EXISTS `yx_material_group`; -CREATE TABLE `yx_material_group` ( - `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'PK', - `del_flag` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '逻辑删除标记(0:显示;1:隐藏)', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `create_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者ID', - `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '分组名', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '素材分组' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_material_group --- ---------------------------- -INSERT INTO `yx_material_group` VALUES ('f55aea3aa6e94ef3b2257df8e025ff71', '0', '2020-03-15 12:48:56', NULL, '222'); - --- ---------------------------- --- 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 '砍价产品分享量', - `end_time_date` datetime(0) NOT NULL, - `start_time_date` datetime(0) NOT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '砍价表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_bargain --- ---------------------------- -INSERT INTO `yx_store_bargain` VALUES (2, 24, '砍价测试01', 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '张', 100, 1, 'https://image.dayouqiantu.cn/5ca05103ad634.jpg,https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', 1577090495, 1608660000, '70gA4彩色打印复印', 10.00, 0.01, 1, 2.00, 0.01, 1, 1, '

7文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



', 0.00, '70gA4彩色打印复印', 0.50, 0, 0, 0, 1577090553, 1, 0.00, '

这里是规则

', 90, 2, '2020-12-23 02:00:00', '2019-12-23 16:41:35'); -INSERT INTO `yx_store_bargain` VALUES (3, 24, '砍价活动2', 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '张', 99, 2, 'https://image.dayouqiantu.cn/5ca05103ad634.jpg,https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg,http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200228083801500.png', 1578412800, 1603900800, '70gA4彩色打印复印', 0.01, 0.01, 1, 10.00, 0.01, 1, 1, '

7文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



', 0.00, '70gA4彩色打印复印', 0.50, 0, 0, 0, 1577101179, 1, 0.00, '

444444

', 34, 1, '2020-10-29 00:00:00', '2020-01-08 00:00:00'); - --- ---------------------------- --- 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 = 38 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 = 39 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(50) 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 = 161 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '购物车表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_cart --- ---------------------------- -INSERT INTO `yx_store_cart` VALUES (123, 11, 'product', 19, '', 2, 1582885462, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (124, 12, 'product', 19, '', 1, 1582897654, 0, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (125, 11, 'product', 19, '', 2, 1582970873, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (126, 11, 'product', 19, '', 1, 1582971001, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (127, 11, 'product', 19, '', 1, 1582971278, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (128, 11, 'product', 19, '', 1, 1582990627, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (129, 11, 'product', 19, '', 1, 1583330733, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (130, 11, 'product', 19, '', 1, 1583393646, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (131, 11, 'product', 19, '', 1, 1583394583, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (132, 11, 'product', 19, '', 1, 1583399181, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (133, 11, 'product', 19, '', 1, 1583403251, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (134, 11, 'product', 19, '', 1, 1583410813, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (135, 11, 'product', 19, '', 1, 1583416029, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (136, 11, 'product', 20, '2e51e5d2d86a44748f81cdd5bf7a51c0', 1, 1583422305, 0, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (137, 11, 'product', 19, '', 1, 1583479387, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (138, 11, 'product', 19, '', 1, 1583486497, 1, 0, 0, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (139, 11, 'product', 20, '2e51e5d2d86a44748f81cdd5bf7a51c0', 1, 1583486504, 1, 0, 0, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (140, 11, 'product', 19, '', 1, 1584171669, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (141, 11, 'product', 20, '', 1, 1584175842, 1, 0, 1, 0, 2, 0); -INSERT INTO `yx_store_cart` VALUES (142, 11, 'product', 19, '', 1, 1584177295, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (143, 11, 'product', 24, '', 1, 1585051721, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (144, 11, 'product', 19, '', 1, 1585144729, 0, 0, 0, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (145, 12, 'product', 24, '', 1, 1585224558, 0, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (146, 11, 'product', 19, '', 1, 1585293362, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (147, 11, 'product', 19, '', 1, 1585385719, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (148, 11, 'product', 24, '', 1, 1585899825, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (149, 11, 'product', 24, '', 1, 1585900220, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (150, 11, 'product', 24, '', 1, 1585900404, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (151, 11, 'product', 24, '', 1, 1585900426, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (152, 11, 'product', 24, '', 1, 1585900444, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (153, 11, 'product', 24, '', 1, 1585900487, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (154, 11, 'product', 24, '', 1, 1585900506, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (155, 11, 'product', 24, '', 1, 1585901825, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (156, 11, 'product', 24, '', 1, 1585901980, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (157, 11, 'product', 24, '', 1, 1585907975, 1, 0, 1, 0, 0, 3); -INSERT INTO `yx_store_cart` VALUES (158, 11, 'product', 24, '', 1, 1586065022, 1, 0, 1, 0, 1, 0); -INSERT INTO `yx_store_cart` VALUES (159, 11, 'product', 19, '', 1, 1586065167, 1, 0, 1, 0, 0, 0); -INSERT INTO `yx_store_cart` VALUES (160, 11, 'product', 19, '', 1, 1586066223, 0, 0, 1, 2, 0, 0); - --- ---------------------------- --- 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) NULL DEFAULT NULL COMMENT '排序', - `pic` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '图标', - `is_show` tinyint(1) NULL DEFAULT 1 COMMENT '是否推荐', - `add_time` int(11) NULL DEFAULT NULL COMMENT '添加时间', - `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 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 = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品分类表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_category --- ---------------------------- -INSERT INTO `yx_store_category` VALUES (1, 0, '图文广告', 1, '', 1, 1584876792, 0); -INSERT INTO `yx_store_category` VALUES (2, 1, '写真', 1, 'http://localhost:8000/file/pic/资讯-20200311043727918.png', 1, 1586244998, 1); -INSERT INTO `yx_store_category` VALUES (3, 1, '平面设计', 1, 'http://localhost:8000/file/pic/资讯-20200311043727918.png', 1, 1584945190, 0); -INSERT INTO `yx_store_category` VALUES (5, 1, '名片', 1, 'http://localhost:8000/file/pic/砍价-20200311043720679.png', 1, 1586245178, 0); - --- ---------------------------- --- 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 '单位名', - `end_time_date` datetime(0) NOT NULL, - `start_time_date` datetime(0) NOT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '拼团产品表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_combination --- ---------------------------- -INSERT INTO `yx_store_combination` VALUES (1, 19, NULL, 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', 'https://image.dayouqiantu.cn/5ca01c7fc9238.jpg,https://image.dayouqiantu.cn/5ca01c7676042.jpg', '70gA4黑白打印复印', NULL, 2, '打印复印资料A4黑白彩色印刷画册书本装订图文数码快印服务', 1.00, 1, 19, 98, '1574064564', 1, 1, 0, 1, NULL, 1, 0.00, '

文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



    

', 1574064557, 1606320000, 24, 0, 0, '张', '2020-11-26 00:00:00', '2019-11-18 16:09:17'); -INSERT INTO `yx_store_combination` VALUES (2, 19, NULL, 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', 'https://image.dayouqiantu.cn/5ca01c7fc9238.jpg,http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200228083801500.png', '70gA4黑白打印复印', NULL, 2, '打印复印资料A4黑白彩色印刷画册书本装订图文数码快印服务', 1.00, 1, 28, 89, '1574066608', 1, 1, 0, 1, NULL, 1, 0.00, '

文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



    

', 1574066592, 1609344000, 24, 0, 0, '张', '2020-12-31 00:00:00', '2019-11-18 16:43:12'); -INSERT INTO `yx_store_combination` VALUES (3, 22, 0, 'http://localhost:8000/file/pic/list_16-20200110120838173.png', 'http://localhost:8000/file/pic/list_16-20200110120838173.png,http://localhost:8000/file/pic/list_32-20200109100213309.png', '3333', NULL, 2, '3333', 1.00, 0, 0, 11, '1578644367', 0, 1, 1, 1, NULL, 0, 0.00, '

4444

', 1578644348, 1585213664, 24, 1, 0, '333', '2020-01-29 00:00:00', '2020-01-10 16:19:08'); - --- ---------------------------- --- 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 = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_coupon --- ---------------------------- -INSERT INTO `yx_store_coupon` VALUES (1, '双十一', 0, 1.00, 100.00, 10, 0, 1, 1573281957, 0); -INSERT INTO `yx_store_coupon` VALUES (2, '44444446', 0, 1.00, 1.00, 1, 0, 1, 1574130748, 0); -INSERT INTO `yx_store_coupon` VALUES (3, '999', 0, 1.00, 1.00, 1, 1, 1, 1574131073, 0); -INSERT INTO `yx_store_coupon` VALUES (4, '333', 0, 3.00, 3.00, 1, 0, 1, 1582894050, 0); -INSERT INTO `yx_store_coupon` VALUES (5, '555', 0, 3.00, 1.00, 1, 0, 1, 1582894121, 0); -INSERT INTO `yx_store_coupon` VALUES (6, '44', 0, 4.00, 4.00, 1, 0, 1, 1582894183, 0); - --- ---------------------------- --- 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, - `cname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '', - `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 '优惠券添加时间', - `end_time_date` datetime(0) NOT NULL, - `start_time_date` datetime(0) NOT NULL, - 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 = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券前台领取表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_coupon_issue --- ---------------------------- -INSERT INTO `yx_store_coupon_issue` VALUES (11, '双十一', 1, 1573352364, 1585039774, 1000, 998, 0, 1, 0, 1573352375, '2020-01-15 01:00:00', '2019-12-02 10:19:24'); -INSERT INTO `yx_store_coupon_issue` VALUES (12, '双十一', 1, 1573353166, 1585039774, 100, 99, 0, 1, 0, 1573353175, '2019-12-26 00:00:00', '2019-11-10 10:32:46'); -INSERT INTO `yx_store_coupon_issue` VALUES (13, '双十一', 1, 1573353254, 1585039774, 10, 9, 0, 1, 0, 1573353261, '2019-12-26 00:00:00', '2019-11-10 10:34:14'); -INSERT INTO `yx_store_coupon_issue` VALUES (14, '999', 3, 1582530746, 1585039774, 100, 100, 0, 0, 1, 1582530755, '2020-02-29 00:00:00', '2020-02-24 15:52:26'); - --- ---------------------------- --- Table structure for yx_store_coupon_issue_user --- ---------------------------- -DROP TABLE IF EXISTS `yx_store_coupon_issue_user`; -CREATE TABLE `yx_store_coupon_issue_user` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `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 '领取时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uid`(`uid`, `issue_coupon_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券前台用户领取记录表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_coupon_issue_user --- ---------------------------- -INSERT INTO `yx_store_coupon_issue_user` VALUES (1, 12, 11, 1573353024); -INSERT INTO `yx_store_coupon_issue_user` VALUES (2, 12, 12, 1573353194); -INSERT INTO `yx_store_coupon_issue_user` VALUES (3, 12, 13, 1573353269); -INSERT INTO `yx_store_coupon_issue_user` VALUES (4, 11, 11, 1584177287); - --- ---------------------------- --- 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 = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券发放记录表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_coupon_user --- ---------------------------- -INSERT INTO `yx_store_coupon_user` VALUES (1, 1, 12, '双十一', 1.00, 100.00, 1573353024, 1574217024, 0, 'get', 2, 0); -INSERT INTO `yx_store_coupon_user` VALUES (2, 1, 12, '双十一', 1.00, 100.00, 1573353194, 1574217194, 1573380051, 'get', 1, 0); -INSERT INTO `yx_store_coupon_user` VALUES (3, 1, 12, '双十一', 1.00, 100.00, 1573353269, 1574217269, 0, 'get', 2, 0); -INSERT INTO `yx_store_coupon_user` VALUES (4, 1, 11, '双十一', 1.00, 100.00, 1584177287, 1585041287, 0, 'get', 2, 0); - --- ---------------------------- --- 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 '订单号', - `extend_order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 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_sn` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' 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(50) 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 = 154 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` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `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` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '唯一id', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `oid`(`oid`, `unique`) USING BTREE, - INDEX `cart_id`(`cart_id`) USING BTREE, - INDEX `product_id`(`product_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 151 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` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `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 '操作时间', - PRIMARY KEY (`id`) USING BTREE, - INDEX `oid`(`oid`) USING BTREE, - INDEX `change_type`(`change_type`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 276 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 = 9 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 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 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 NULL DEFAULT 0.00 COMMENT '会员价格', - `ot_price` decimal(8, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '市场价', - `postage` decimal(8, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '邮费', - `unit_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位名', - `sort` smallint(11) NULL DEFAULT 0 COMMENT '排序', - `sales` mediumint(11) UNSIGNED NULL DEFAULT 0 COMMENT '销量', - `stock` mediumint(11) UNSIGNED NULL DEFAULT 0 COMMENT '库存', - `is_show` tinyint(1) NULL DEFAULT 1 COMMENT '状态(0:未上架,1:上架)', - `is_hot` tinyint(1) NULL DEFAULT 0 COMMENT '是否热卖', - `is_benefit` tinyint(1) NULL DEFAULT 0 COMMENT '是否优惠', - `is_best` tinyint(1) NULL DEFAULT 0 COMMENT '是否精品', - `is_new` tinyint(1) NULL DEFAULT 0 COMMENT '是否新品', - `description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '产品描述', - `add_time` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '添加时间', - `is_postage` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否包邮', - `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否删除', - `mer_use` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '商户是否代理 0不可代理1可代理', - `give_integral` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '获得积分', - `cost` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '成本价', - `is_seckill` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '秒杀状态 0 未开启 1已开启', - `is_bargain` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '砍价状态 0未开启 1开启', - `is_good` tinyint(1) 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 `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 = 26 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_product --- ---------------------------- -INSERT INTO `yx_store_product` VALUES (19, NULL, 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', 'https://image.dayouqiantu.cn/5ca01c7fc9238.jpg,https://image.dayouqiantu.cn/5ca01c7676042.jpg', '70gA4黑白打印复印', '打印复印资料A4黑白彩色印刷画册书本装订图文数码快印服务', '打印复印', '', '3', 120.00, 0.20, 0.50, 0.00, '张', 1, 49, 75, 1, 1, 1, 1, 1, '

文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



    

', NULL, 1, 0, 0, 1.00, 0.20, 0, 0, 1, NULL, NULL, '', ''); -INSERT INTO `yx_store_product` VALUES (24, 0, 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', '彩色打印', '彩色打印', '彩色打印', '', '2', 1.00, 0.00, 1.00, 0.00, '张', 0, 10, 9989, 1, 1, 1, 1, 1, '

彩色打印

', 1582894605, 0, 1, 0, 0.00, 0.00, 0, 0, 1, 0, 0, '', ''); -INSERT INTO `yx_store_product` VALUES (25, 0, 'http://localhost:8000/file/pic/list_34-2020032207154023.png', 'http://localhost:8000/file/pic/list_22-20200322071348844.png', '照片打印', '照片打印', '照片打印', '', '3', 1.00, 0.00, 2.00, 0.00, '张', 0, 0, 1000, 1, 1, 1, 1, 1, '

照片打印

', 1585278846, 1, 0, 0, 0.00, 0.00, 0, 0, 1, 0, 0, '', ''); - --- ---------------------------- --- Table structure for yx_store_product_attr --- ---------------------------- -DROP TABLE IF EXISTS `yx_store_product_attr`; -CREATE TABLE `yx_store_product_attr` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `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 '属性值', - PRIMARY KEY (`id`) USING BTREE, - INDEX `store_id`(`product_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_product_attr --- ---------------------------- -INSERT INTO `yx_store_product_attr` VALUES (14, 20, '纸张', 'A3,A4'); -INSERT INTO `yx_store_product_attr` VALUES (15, 20, '颜色', '白色,红色'); - --- ---------------------------- --- Table structure for yx_store_product_attr_result --- ---------------------------- -DROP TABLE IF EXISTS `yx_store_product_attr_result`; -CREATE TABLE `yx_store_product_attr_result` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `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 '上次修改时间', - PRIMARY KEY (`id`) USING BTREE, - INDEX `product_id`(`product_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 9 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 (8, 20, '{\"attr\":[{\"attrHidden\":true,\"detailValue\":\"\",\"detail\":[\"A3\",\"A4\"],\"value\":\"纸张\"},{\"attrHidden\":true,\"detailValue\":\"\",\"detail\":[\"白色\",\"红色\"],\"value\":\"颜色\"}],\"value\":[{\"cost\":0.5,\"price\":0.5,\"pic\":\"https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg\",\"detail\":{\"颜色\":\"白色\",\"纸张\":\"A3\"},\"check\":false,\"sales\":\"999\"},{\"cost\":0.5,\"price\":0.5,\"pic\":\"https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg\",\"detail\":{\"颜色\":\"红色\",\"纸张\":\"A3\"},\"check\":false,\"sales\":\"999\"},{\"cost\":0.5,\"price\":\"0.2\",\"pic\":\"https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg\",\"detail\":{\"颜色\":\"白色\",\"纸张\":\"A4\"},\"check\":false,\"sales\":\"999\"},{\"cost\":0.5,\"price\":\"0.2\",\"pic\":\"https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg\",\"detail\":{\"颜色\":\"红色\",\"纸张\":\"A4\"},\"check\":false,\"sales\":\"999\"}]}', 1578320995); - --- ---------------------------- --- Table structure for yx_store_product_attr_value --- ---------------------------- -DROP TABLE IF EXISTS `yx_store_product_attr_value`; -CREATE TABLE `yx_store_product_attr_value` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `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 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` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '唯一值', - `cost` decimal(8, 2) UNSIGNED NOT NULL COMMENT '成本价', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `unique`(`unique`, `suk`) USING BTREE, - INDEX `store_id`(`product_id`, `suk`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 30 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 (26, 20, 'A3,白色', 996, NULL, 0.50, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '2e51e5d2d86a44748f81cdd5bf7a51c0', 0.50); -INSERT INTO `yx_store_product_attr_value` VALUES (27, 20, 'A3,红色', 999, NULL, 0.50, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', 'fd545718bbdb4634aa54228ecca6febe', 0.50); -INSERT INTO `yx_store_product_attr_value` VALUES (28, 20, 'A4,白色', 999, NULL, 0.20, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '5e0ae3241d8c4ea793368666f862dd3b', 0.50); -INSERT INTO `yx_store_product_attr_value` VALUES (29, 20, 'A4,红色', 999, NULL, 0.20, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '4b4b306134434832885a52f3a85955ce', 0.50); - --- ---------------------------- --- Table structure for yx_store_product_relation --- ---------------------------- -DROP TABLE IF EXISTS `yx_store_product_relation`; -CREATE TABLE `yx_store_product_relation` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `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 '添加时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uid`(`uid`, `product_id`, `type`, `category`) USING BTREE, - INDEX `type`(`type`) USING BTREE, - INDEX `category`(`category`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品点赞和收藏表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_product_relation --- ---------------------------- -INSERT INTO `yx_store_product_relation` VALUES (1, 11, 20, 'collect', 'product', 1586059338); -INSERT INTO `yx_store_product_relation` VALUES (2, 11, 24, 'collect', 'product', 1586064573); -INSERT INTO `yx_store_product_relation` VALUES (4, 11, 19, 'collect', 'product', 1586065940); - --- ---------------------------- --- 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 = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '评论表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_product_reply --- ---------------------------- -INSERT INTO `yx_store_product_reply` VALUES (5, 11, 0, '', 19, 'product', 0, 0, '', '', 0, NULL, NULL, 0, 0); - --- ---------------------------- --- 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` int(11) NOT NULL DEFAULT 0 COMMENT '开始时间', - `stop_time` int(11) NOT NULL DEFAULT 0 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 '显示', - `end_time_date` datetime(0) NOT NULL, - `start_time_date` datetime(0) NOT NULL, - `time_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '时间段id', - 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 = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品秒杀产品表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_store_seckill --- ---------------------------- -INSERT INTO `yx_store_seckill` VALUES (1, 24, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', 'https://image.dayouqiantu.cn/5ca05103ad634.jpg,https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '70gA4彩色打印复印', '70gA4彩色打印复印', 1.00, 0.50, 1.00, 0.00, 0, 99, 2, '张', 0.00, '

7文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



', 1576476046, 1609257600, '1576476055', 1, 1, 0, 0, 1, 1, '2020-01-29 00:00:00', '2019-12-16 14:00:46', 213); -INSERT INTO `yx_store_seckill` VALUES (2, 24, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', 'https://image.dayouqiantu.cn/5ca05103ad634.jpg,http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200228083801500.png', '70gA4彩色打印复印2', '70gA4彩色打印复印', 1.00, 0.50, 1.00, 0.00, 0, 98, 3, '张', 0.00, '

7文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



', 1576477734, 1609257600, '1576477741', 1, 1, 0, 0, 1, 1, '2020-12-30 00:00:00', '2019-12-16 14:28:54', 214); - --- ---------------------------- --- 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_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 用户生成', - `uid` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '用户id', - `invite_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '邀请码', - PRIMARY KEY (`att_id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 29 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 '字段名称', - `value` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '默认值', - `sort` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '排序', - `status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否隐藏', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 212 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '配置表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_system_config --- ---------------------------- -INSERT INTO `yx_system_config` VALUES (162, 'wechat_share_img', 'https://image.dayouqiantu.cn/list_34.png', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (165, 'wechat_avatar', '', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (172, 'wechat_share_synopsis', '4444444', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (174, 'api', 'http://你的H5端域名/api/wechat/serve', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (175, 'wechat_share_title', '4444', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (177, 'store_postage', '1', 0, 0); -INSERT INTO `yx_system_config` VALUES (178, 'store_free_postage', '200', 0, 0); -INSERT INTO `yx_system_config` VALUES (179, 'integral_ratio', '1', 0, 0); -INSERT INTO `yx_system_config` VALUES (180, 'store_brokerage_ratio', '70', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (181, 'store_brokerage_statu', '2', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (182, 'user_extract_min_price', '1', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (183, 'store_brokerage_two', '30', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (184, 'site_url', 'http://localhost:8080', 0, 0); -INSERT INTO `yx_system_config` VALUES (185, 'api_url', 'http://127.0.0.1:8009', 0, 0); -INSERT INTO `yx_system_config` VALUES (186, 'order_cancel_job_time', '20', 0, 0); -INSERT INTO `yx_system_config` VALUES (187, 'wechat_appid', '11112', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (188, 'wechat_appsecret', '222266', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (189, 'wechat_encodingaeskey', '6666', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (190, 'wechat_token', '999', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (191, 'wxpay_mchId', '2222', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (192, 'wxpay_appId', '111111', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (193, 'wxpay_mchKey', '55555', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (194, 'wxapp_appId', '22222', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (195, 'wxapp_secret', '22222222', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (196, 'wxpay_keyPath', 'http://localhost:8000/file/pic/list_30-20200110053337209.png', 0, 0); -INSERT INTO `yx_system_config` VALUES (197, 'imageArr', '[\"https://image.dayouqiantu.cn/list_34.png\"]', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (198, 'store_brokerage_open', '1', 0, 0); -INSERT INTO `yx_system_config` VALUES (199, 'integral_full', '0', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (200, 'integral_max', '0', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (201, 'store_user_min_recharge', '1', 0, 0); -INSERT INTO `yx_system_config` VALUES (203, 'store_self_mention', '1', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (204, 'tengxun_map_key', 'OGABZ-Y5OCF-5UWJ5-N7DHH-VFIG7-DHFEB', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (205, 'wechat_id', '', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (206, 'wechat_type', '', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (207, 'wechat_encode', '', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (208, 'wechat_sourceid', '', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (209, 'wechat_name', '', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (210, 'wechat_qrcode', '', NULL, NULL); -INSERT INTO `yx_system_config` VALUES (211, 'wx_native_app_appId', '11111', NULL, NULL); - --- ---------------------------- --- 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', - `group_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '对应的数据名称', - `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) NULL DEFAULT 0 COMMENT '数据排序', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态(1:开启;2:关闭;)', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 237 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组合数据详情表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_system_group_data --- ---------------------------- -INSERT INTO `yx_system_group_data` VALUES (177, 'yshop_home_banner', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\"],\"name\":\"banner\",\"id\":177,\"pic\":\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\",\"sort\":1,\"url\":\"wwww\",\"status\":1}', 1571387677, 1, 1); -INSERT INTO `yx_system_group_data` VALUES (180, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e85bfa61251d.png\"],\"uniapp_url\":\"/pages/shop/GoodsClass/index\",\"name\":\"全部商品\",\"id\":180,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa61251d.png\",\"sort\":9,\"url\":\"/goods_list\",\"wxapp_url\":\"/pages/shop/GoodsClass/main\",\"status\":1}', 1571390842, 9, 1); -INSERT INTO `yx_system_group_data` VALUES (182, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":182,\"pic\":\"https://i.loli.net/2019/10/18/DqOUgNf7wjuFpPT.png\",\"sort\":2,\"title\":\"分销、拼团、商户功能上线啦!\",\"url\":\"/news_list\",\"info\":\"yshop2.0上线啦\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 0, 2, 1); -INSERT INTO `yx_system_group_data` VALUES (183, 'yshop_hot_search', '{\"id\":183,\"title\":\"照片\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (184, 'yshop_hot_search', '{\"id\":184,\"title\":\"springboot\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (187, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":187,\"sort\":1,\"url\":\"/news_list\",\"info\":\"springboot2+JPA+Mybatisplus商城系统\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1572086163, 1, 1); -INSERT INTO `yx_system_group_data` VALUES (188, 'yshop_hot_search', '{\"id\":188,\"title\":\"打印\"}', 1572086172, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (189, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dec896eeb25a.png\"],\"uniapp_url\":\"/pages/user/UserVip/index\",\"name\":\"会员中心\",\"id\":189,\"pic\":\"https://image.dayouqiantu.cn/5dec896eeb25a.png\",\"sort\":9,\"url\":\"/user/vip\",\"wxapp_url\":\"/pages/user/UserVip/main\",\"status\":1}', 1572087722, 9, 1); -INSERT INTO `yx_system_group_data` VALUES (190, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428984d64d.png\"],\"uniapp_url\":\"/pages/user/coupon/UserCoupon/index\",\"name\":\"优惠券\",\"id\":190,\"pic\":\"https://image.dayouqiantu.cn/5db428984d64d.png\",\"sort\":8,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/UserCoupon/main\",\"status\":1}', 0, 8, 1); -INSERT INTO `yx_system_group_data` VALUES (191, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"收藏商品\",\"id\":191,\"pic\":\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 0, 7, 1); -INSERT INTO `yx_system_group_data` VALUES (192, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428bd61b73.png\"],\"uniapp_url\":\"/pages/user/address/AddressManagement/index\",\"name\":\"地址管理\",\"id\":192,\"pic\":\"https://image.dayouqiantu.cn/5db428bd61b73.png\",\"sort\":6,\"url\":\"/user/add_manage\",\"wxapp_url\":\"/pages/user/address/AddressManagement/main\",\"status\":1}', 0, 6, 1); -INSERT INTO `yx_system_group_data` VALUES (193, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428e28dd48.png\"],\"uniapp_url\":\"/pages/user/promotion/UserPromotion/index\",\"name\":\"我的推广\",\"id\":193,\"pic\":\"https://image.dayouqiantu.cn/5db428e28dd48.png\",\"sort\":5,\"url\":\"/user/user_promotion\",\"wxapp_url\":\"/pages/user/promotion/UserPromotion/main\",\"status\":1}', 0, 5, 1); -INSERT INTO `yx_system_group_data` VALUES (194, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db42a4208c55.png\"],\"uniapp_url\":\"/pages/user/UserAccount/index\",\"name\":\"我的余额\",\"id\":194,\"pic\":\"https://image.dayouqiantu.cn/5db42a4208c55.png\",\"sort\":4,\"url\":\"/user/account\",\"wxapp_url\":\"/pages/user/UserAccount/main\",\"status\":1}', 0, 4, 1); -INSERT INTO `yx_system_group_data` VALUES (195, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428f410462.png\"],\"uniapp_url\":\"/pages/user/signIn/Integral/index\",\"name\":\"我的积分\",\"id\":195,\"pic\":\"https://image.dayouqiantu.cn/5db428f410462.png\",\"sort\":3,\"url\":\"/user/integral\",\"wxapp_url\":\"/pages/user/signIn/Integral/main\",\"status\":1}', 0, 3, 1); -INSERT INTO `yx_system_group_data` VALUES (196, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93f004713.png\"],\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"name\":\"图文资讯\",\"id\":196,\"pic\":\"https://image.dayouqiantu.cn/5e85bfea151b7.png\",\"sort\":8,\"url\":\"/news_list\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1573109648, 8, 1); -INSERT INTO `yx_system_group_data` VALUES (197, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e939507b5e.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"我的收藏\",\"id\":197,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa55f352.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 1573109723, 7, 1); -INSERT INTO `yx_system_group_data` VALUES (199, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93c9a8304.png\"],\"uniapp_url\":\"/pages/user/coupon/GetCoupon/index\",\"name\":\"优惠券\",\"id\":199,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa6621ca.png\",\"sort\":6,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/GetCoupon/main\",\"status\":1}', 1573387422, 6, 1); -INSERT INTO `yx_system_group_data` VALUES (200, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e925140b57.png\"],\"uniapp_url\":\"/pages/activity/GoodsGroup/index\",\"name\":\"拼团专区\",\"id\":200,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa4b273f.png\",\"sort\":5,\"url\":\"/activity/group\",\"wxapp_url\":\"/pages/activity/GoodsGroup/main\",\"status\":1}', 0, 5, 1); -INSERT INTO `yx_system_group_data` VALUES (201, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\"],\"uniapp_url\":\"/pages/orderAdmin/OrderIndex/index\",\"name\":\"商户管理\",\"id\":201,\"pic\":\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\",\"sort\":2,\"url\":\"/customer/index\",\"wxapp_url\":\"/pages/orderAdmin/OrderIndex/main\",\"status\":1}', 0, 2, 1); -INSERT INTO `yx_system_group_data` VALUES (202, 'yshop_sign_day_num', '{\"sign_num\":\"10\",\"id\":205,\"day\":\"第一天\"}', 0, 9, 1); -INSERT INTO `yx_system_group_data` VALUES (203, 'yshop_sign_day_num', '{\"sign_num\":\"20\",\"id\":\"\",\"day\":\"第二天\"}', 0, 8, 1); -INSERT INTO `yx_system_group_data` VALUES (204, 'yshop_sign_day_num', '{\"sign_num\":\"30\",\"id\":\"\",\"day\":\"第三天\"}', 0, 7, 1); -INSERT INTO `yx_system_group_data` VALUES (205, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"40\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第四天\",\"status\":\"\"}', 0, 6, 1); -INSERT INTO `yx_system_group_data` VALUES (206, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"50\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第五天\",\"status\":\"\"}', 0, 5, 1); -INSERT INTO `yx_system_group_data` VALUES (207, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"60\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第六天\",\"status\":\"\"}', 0, 4, 1); -INSERT INTO `yx_system_group_data` VALUES (208, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"100\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"奖励\",\"status\":\"\"}', 0, 3, 1); -INSERT INTO `yx_system_group_data` VALUES (209, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93010a248.png\"],\"uniapp_url\":\"/pages/user/signIn/Sign/index\",\"name\":\"积分签到\",\"id\":209,\"pic\":\"https://image.dayouqiantu.cn/5e85bf8e494f2.png\",\"sort\":4,\"url\":\"/user/sign\",\"wxapp_url\":\"/pages/user/signIn/Sign/main\",\"status\":1}', 0, 4, 1); -INSERT INTO `yx_system_group_data` VALUES (210, 'yshop_seckill_time', '{\"continued\":2,\"id\":\"\",\"time\":5}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (211, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"7\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (212, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"2\",\"id\":\"\",\"sort\":\"\",\"time\":\"10\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (213, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"12\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (214, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"4\",\"id\":\"\",\"sort\":\"\",\"time\":\"15\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (215, 'yshop_seckill_time', '{\"continued\":\"2\",\"id\":223,\"time\":\"19\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (216, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e929f9be59.png\"],\"uniapp_url\":\"/pages/activity/GoodsSeckill/index\",\"name\":\"秒杀专区\",\"id\":216,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa5a9f85.png\",\"sort\":3,\"url\":\"/activity/goods_seckill\",\"wxapp_url\":\"/pages/activity/GoodsSeckill/main\",\"status\":1}', 0, 3, 1); -INSERT INTO `yx_system_group_data` VALUES (217, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e9276c608f.png\"],\"uniapp_url\":\"/pages/activity/GoodsBargain/index\",\"name\":\"砍价专区\",\"id\":217,\"pic\":\"https://image.dayouqiantu.cn/5e85bfe9b1da8.png\",\"sort\":2,\"url\":\"/activity/bargain\",\"wxapp_url\":\"/pages/activity/GoodsBargain/main\",\"status\":1}', 0, 2, 1); -INSERT INTO `yx_system_group_data` VALUES (218, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dfd7b748e053.png\"],\"uniapp_url\":\"/pages/activity/BargainRecord/index\",\"name\":\"砍价记录\",\"id\":218,\"pic\":\"https://image.dayouqiantu.cn/5dfd7b748e053.png\",\"sort\":1,\"url\":\"/activity/bargain/record\",\"wxapp_url\":\"/pages/activity/BargainRecord/main\",\"status\":1}', 0, 1, 1); -INSERT INTO `yx_system_group_data` VALUES (219, 'yshop_home_banner', '{\"name\":\"222\",\"id\":\"\",\"pic\":\"https://image.dayouqiantu.cn/5c9f117f624ee.jpg\",\"sort\":\"\",\"url\":\"/\",\"status\":\"\"}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (221, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e60da498cfdd.png\"],\"name\":\"订单核销\",\"id\":230,\"pic\":\"https://image.dayouqiantu.cn/5e60da498cfdd.png\",\"sort\":0,\"url\":\"/order/order_cancellation\",\"wxapp_url\":\"\",\"status\":1}', 0, 0, 1); -INSERT INTO `yx_system_group_data` VALUES (222, 'yshop_recharge_price_ways', '{\"give_price\":\"10\",\"price\":\"100\",\"id\":\"\",\"sort\":0,\"status\":1}', 0, 1, 1); -INSERT INTO `yx_system_group_data` VALUES (223, 'yshop_recharge_price_ways', '{\"give_price\":\"1\",\"price\":1,\"id\":\"\",\"sort\":0,\"status\":1}', 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 '是否删除', - `day_time_end` datetime(0) NULL DEFAULT NULL, - `day_time_start` datetime(0) NULL DEFAULT NULL, - `valid_time_end` datetime(0) NULL DEFAULT NULL, - `valid_time_start` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE, - INDEX `phone`(`phone`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店自提' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_system_store --- ---------------------------- -INSERT INTO `yx_system_store` VALUES (3, 'yshop店铺', 'springboot商城', '15136175234', '河南省漯河市', '', 'https://image.dayouqiantu.cn/noMeal_tt.png', '33.54528', '113.9202', '2020-03-09 - 2020-04-30', '11:33:49 - 19:33:49', 1583300059, 0, 0, '2020-03-04 19:33:49', '2020-03-04 11:33:49', '2020-04-30 00:00:00', '2020-03-09 00:00:00'); -INSERT INTO `yx_system_store` VALUES (4, '信阳门店', '信阳门店', '15136275234', '河南省信阳市', '', 'http://localhost:8000/file/pic/砍价-20200311043720679.png', '32.11683', '114.05857', '2020-03-21 - 2020-03-31', '17:11:13 - 20:11:13', 1584781880, 1, 0, '2020-03-21 20:11:13', '2020-03-21 17:11:13', '2020-03-31 00:00:00', '2020-03-21 00:00:00'); -INSERT INTO `yx_system_store` VALUES (5, '郑州门店', '郑州门店', '15136175246', '河南省郑州', '', 'http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200311043711341.png', '34.72468', '113.6401', '2020-03-21 - 2020-03-31', '17:11:13 - 20:11:15', 1584782199, 1, 0, '2020-03-21 20:11:15', '2020-03-21 17:11:13', '2020-03-31 00:00:00', '2020-03-21 00:00:00'); - --- ---------------------------- --- Table structure for yx_system_store_staff --- ---------------------------- -DROP TABLE IF EXISTS `yx_system_store_staff`; -CREATE TABLE `yx_system_store_staff` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `uid` int(10) UNSIGNED NOT NULL COMMENT '微信用户id', - `nickname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, - `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '店员头像', - `store_id` int(11) NOT NULL COMMENT '门店id', - `store_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `staff_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '店员名称', - `phone` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码', - `verify_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '核销开关', - `status` tinyint(2) NULL DEFAULT 1 COMMENT '状态', - `add_time` int(10) NULL DEFAULT NULL COMMENT '添加时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店店员表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_system_store_staff --- ---------------------------- -INSERT INTO `yx_system_store_staff` VALUES (2, 12, '会敲代码的喵2', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', 4, '信阳门店', 'tttt', '15136175423', 1, 1, 1584868920); -INSERT INTO `yx_system_store_staff` VALUES (3, 11, '会敲代码的喵88', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', 5, '郑州门店', 'tttt', '16136175234', 1, 1, 1585213920); -INSERT INTO `yx_system_store_staff` VALUES (4, 19, '15136175528', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', 5, '郑州门店', '111', '15136175246', 1, 1, 1586180635); - --- ---------------------------- --- 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 = 8 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, '普通会员', 20.00, 0, 1, 0, 1, 1, 99.00, 'http://pic.dayouqiantu.cn/5c9ccca8cd632.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8bc1e0.png', '普通会员', 1553824559, 0); -INSERT INTO `yx_system_user_level` VALUES (2, 0, '青铜会员', 0.00, 0, 1, 0, 1, 2, 98.00, 'http://pic.dayouqiantu.cn/5c9ccca904016.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8f0a30.png', '青铜会员', 1553824639, 0); -INSERT INTO `yx_system_user_level` VALUES (3, 0, '黄铜会员', 0.00, 0, 1, 0, 1, 3, 95.00, 'http://pic.dayouqiantu.cn/5c9ccca8b27f1.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8e9365.png', '黄铜会员', 1553824742, 0); -INSERT INTO `yx_system_user_level` VALUES (4, 0, '白银会员', 0.00, 0, 1, 0, 1, 4, 94.00, 'http://pic.dayouqiantu.cn/5c9ccca8d6ae1.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8a27f0.png', '白银会员', 1553824797, 0); -INSERT INTO `yx_system_user_level` VALUES (5, 0, '黄金会员', 0.00, 0, 1, 0, 1, 5, 90.00, 'http://pic.dayouqiantu.cn/5c9ccca8b27f1.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8aa5b9.png', '黄金会员', 1553824837, 0); -INSERT INTO `yx_system_user_level` VALUES (6, 0, '钻石会员', 0.00, 0, 1, 0, 1, 6, 88.00, 'http://localhost:8000/file/pic/钻石-20200328094531898.jpg', 'http://pic.dayouqiantu.cn/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 = 19 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, '满足积分20分', '积分数', 'SatisfactionIntegral', 20, 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天', '累计签到', 'CumulativeAttendance', 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, '消费满10000元', '消费次数', 'ConsumptionAmount', 10000, 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); -INSERT INTO `yx_system_user_task` VALUES (15, '消费满1000元', '消费金额', 'ConsumptionAmount', 1000, 4, 0, 1, 1, '', 1575456513); -INSERT INTO `yx_system_user_task` VALUES (16, '累计签到2天', '累计签到', 'CumulativeAttendance', 2, 1, 0, 1, 1, '', 1575456576); -INSERT INTO `yx_system_user_task` VALUES (17, '消费满100元', '消费次数', 'ConsumptionAmount', 100, 2, 0, 1, 1, '', 1575456612); -INSERT INTO `yx_system_user_task` VALUES (18, '消费满1000元', '消费金额', 'ConsumptionAmount', 1000, 3, 0, 1, 1, '', 1575456692); - --- ---------------------------- --- 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', - `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户账户(跟accout一样)', - `account` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户账号', - `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户密码(跟pwd)', - `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户密码', - `real_name` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '真实姓名', - `birthday` int(11) NULL DEFAULT 0 COMMENT '生日', - `card_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '身份证号码', - `mark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户备注', - `partner_id` int(11) NULL DEFAULT 0 COMMENT '合伙人id', - `group_id` int(11) NULL DEFAULT 0 COMMENT '用户分组id', - `nickname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户昵称', - `avatar` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 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 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 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, - UNIQUE INDEX `username`(`username`) 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 = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_user --- ---------------------------- -INSERT INTO `yx_user` VALUES (11, 'hupeng', 'hupeng', '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', 'e10adc3949ba59abbe56e057f20f883e', '', 0, '', '', 0, 0, '会敲代码的喵88', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175246', 1573120584, '', 1573120584, '', 7619.91, 26.86, 988.06, 1, 1, 1, 0, 1, 'h5', 0, 39, 4, 0, '', 1, ''); -INSERT INTO `yx_user` VALUES (12, '15136175246', 'hupeng2', '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', 'e10adc3949ba59abbe56e057f20f883e', '', 0, '', '', 0, 0, '会敲代码的喵2', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175246', 1573120881, '', 1573120881, '', 8766.20, 28.00, 70.51, 2, 1, 1, 11, 1582896799, 'h5', 0, 20, 0, 0, '', 1, ''); -INSERT INTO `yx_user` VALUES (14, '15136175247', '15136175247', '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', 'e10adc3949ba59abbe56e057f20f883e', '', 0, '', '', 0, 0, '15136175247', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175247', 1573612696, '', 1573612696, '', 9200.00, 0.00, 2.00, 0, 1, 0, 11, 1584189298, 'h5', 0, 5, 0, 0, '', 0, ''); -INSERT INTO `yx_user` VALUES (15, '15136175249', '15136175249', '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', '$2a$10$IG/fc8idkW35ezw7VtiM.OjUU1fvS2d/Bw7TmU76UUTbd5/4eCd9a', '', 0, '', '', 0, 0, '15136175249', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175249', 1578839477, '', 1578839477, '', 0.00, 0.00, 0.00, 0, 1, 0, 0, 0, 'h5', 0, 0, 0, 0, '', 0, ''); -INSERT INTO `yx_user` VALUES (18, '15136175523', '15136175523', '$2a$10$kMjK.K8lezzqiHfPjJCAUuSYajA7dAZhtUdtEyKd5RilPi8sWf4gC', '$2a$10$DhiQooA85GOl2Z4tZrAwAejwgf8O6SrMsv8jaVwQsXkR1VcyTp0eC', '', 0, '', '', 0, 0, '15136175523', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175523', 1584171347, '', 1584171347, '', 0.00, 0.00, 0.00, 0, 1, 0, 0, 0, 'h5', 0, 0, 0, 0, '', 0, ''); -INSERT INTO `yx_user` VALUES (19, '15136175528', '15136175528', '$2a$10$8d4xZEX3x7jaojPTv0WDheEG8syzV1br2z1RpZ0ceV/p0OTaKOq1u', '$2a$10$zLLJrrxGKbikzbAiP34N/Od5nlNgREMtoaih7rlqSzk7oOnurFneO', '', 0, '', '', 0, 0, '15136175528', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175528', 1584535079, '', 1584535079, '', 0.00, 0.00, 0.00, 0, 1, 0, 11, 1584535081, 'h5', 0, 0, 0, 0, '', 0, ''); -INSERT INTO `yx_user` VALUES (20, '15136171112', '15136171112', '$2a$10$MsTr57nPX9bSOLvlA4C/Z.MaUGTJM/anEzDasPucezf4GVfPpmmji', '$2a$10$62PLFod7JnPPmW8Hx0MZ9uhkGXmXZZ2N3ZixnvUzfBTZ157oiFCSm', '', 0, '', '', 0, 0, '15136171112', 'https://image.dayouqiantu.cn/5e79f6cfd33b6.png', '15136171112', 1585385387, '', 1585385387, '', 0.00, 0.00, 0.00, 0, 1, 0, 11, 1585385387, 'h5', 0, 0, 0, 0, '', 0, ''); - --- ---------------------------- --- 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` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' 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 = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户地址表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_user_address --- ---------------------------- -INSERT INTO `yx_user_address` VALUES (9, 8, '胡鹏', '15136175246', '山西', '大同市', '灵丘县', '999', '', '0', '0', 1, 0, 1573119435); -INSERT INTO `yx_user_address` VALUES (10, 11, '胡鹏', '15139175246', '重庆', '荣昌县', '广顺镇', '999', '', '0', '0', 1, 0, 1573120628); -INSERT INTO `yx_user_address` VALUES (11, 12, 'hu', '15136175246', '上海', '闸北区', '城区', '99999', '', '0', '0', 1, 0, 1573123595); -INSERT INTO `yx_user_address` VALUES (12, 14, 'zhang', '15136175247', '上海', '静安区', '城区', '999', '', '0', '0', 1, 0, 1573612804); - --- ---------------------------- --- 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 = 128 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户账单表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_user_bill --- ---------------------------- -INSERT INTO `yx_user_bill` VALUES (3, 3, '8', 0, '购买商品', 'now_money', 'pay_product', 100.00, 10000.00, '余额支付', 1572416780, 1); -INSERT INTO `yx_user_bill` VALUES (4, 3, '9', 0, '购买商品', 'now_money', 'pay_product', 300.00, 9900.00, '余额支付', 1572416917, 1); -INSERT INTO `yx_user_bill` VALUES (5, 3, '10', 0, '购买商品', 'now_money', 'pay_product', 100.00, 9600.00, '余额支付', 1572425699, 1); -INSERT INTO `yx_user_bill` VALUES (6, 3, '11', 0, '购买商品', 'now_money', 'pay_product', 100.00, 9500.00, '余额支付', 1572427199, 1); -INSERT INTO `yx_user_bill` VALUES (7, 3, '11', 1, '购买商品赠送积分', 'integral', 'gain', 10.00, 0.00, '购买商品赠送', 1572693386, 1); -INSERT INTO `yx_user_bill` VALUES (8, 3, '10', 1, '商品退款', 'now_money', 'pay_product_refund', 100.00, 9500.00, '订单退款到余额', 1573040186, 1); -INSERT INTO `yx_user_bill` VALUES (9, 3, '12', 0, '购买商品', 'now_money', 'pay_product', 100.00, 9500.00, '余额支付', 1573040704, 1); -INSERT INTO `yx_user_bill` VALUES (10, 12, '12', 1, '购买商品赠送积分', 'integral', 'gain', 10.00, 10.00, '购买商品赠送', 1573041037, 1); -INSERT INTO `yx_user_bill` VALUES (11, 3, '26', 0, '购买商品', 'now_money', 'pay_product', 0.20, 9400.00, '余额支付', 1573119034, 1); -INSERT INTO `yx_user_bill` VALUES (12, 12, '34', 0, '购买商品', 'now_money', 'pay_product', 0.20, 10000.00, '余额支付', 1573124900, 1); -INSERT INTO `yx_user_bill` VALUES (13, 12, '33', 0, '购买商品', 'now_money', 'pay_product', 0.20, 9999.80, '余额支付', 1573124914, 1); -INSERT INTO `yx_user_bill` VALUES (14, 12, '35', 0, '购买商品', 'now_money', 'pay_product', 119.00, 9999.60, '余额支付', 1573380051, 1); -INSERT INTO `yx_user_bill` VALUES (15, 12, '105e06edb7bf4113aff646a45b13abaa', 0, '积分抵扣', 'integral', 'deduction', 10.00, 10.00, '购买商品使用', 1573381947, 1); -INSERT INTO `yx_user_bill` VALUES (16, 12, '36', 0, '购买商品', 'now_money', 'pay_product', 160.00, 9880.60, '余额支付', 1573381947, 1); -INSERT INTO `yx_user_bill` VALUES (17, 14, '37', 0, '购买商品', 'now_money', 'pay_product', 120.00, 10000.00, '余额支付', 1573612822, 1); -INSERT INTO `yx_user_bill` VALUES (18, 14, '37', 1, '购买商品赠送积分', 'integral', 'gain', 1.00, 0.00, '购买商品赠送', 1573613426, 1); -INSERT INTO `yx_user_bill` VALUES (19, 12, '37', 1, '获得推广佣金', 'now_money', 'brokerage', 14.00, 14.00, '15136175247成功消费120.00元,奖励推广佣金14.0', 1573613427, 1); -INSERT INTO `yx_user_bill` VALUES (20, 11, '37', 1, '获得推广佣金', 'now_money', 'brokerage', 6.00, 6.00, '二级推广人15136175247成功消费120.00元,奖励推广佣金6.0', 1573613427, 1); -INSERT INTO `yx_user_bill` VALUES (21, 11, '1', 0, '佣金提现', 'now_money', 'extract', 1.00, 5.00, '使用微信提现1元', 1573648445, 1); -INSERT INTO `yx_user_bill` VALUES (25, 11, '1', 1, '提现失败', 'now_money', 'extract', 1.00, 6.00, '提现失败,退回佣金1元', 1573710526, 1); -INSERT INTO `yx_user_bill` VALUES (26, 14, '84892a2626a341939dd05cd7f2adff9e', 0, '积分抵扣', 'integral', 'deduction', 1.00, 1.00, '购买商品使用', 1573888321, 1); -INSERT INTO `yx_user_bill` VALUES (27, 14, '39', 1, '积分回退', 'integral', 'deduction', 1.00, 0.00, '购买商品失败,回退积分', 1573888707, 1); -INSERT INTO `yx_user_bill` VALUES (28, 14, '42', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9880.00, '余额支付', 1573979565, 1); -INSERT INTO `yx_user_bill` VALUES (29, 14, '61', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9760.00, '余额支付', 1573991796, 1); -INSERT INTO `yx_user_bill` VALUES (30, 14, '67', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9640.00, '余额支付', 1573996204, 1); -INSERT INTO `yx_user_bill` VALUES (31, 14, '68', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9520.00, '余额支付', 1573996429, 1); -INSERT INTO `yx_user_bill` VALUES (32, 14, '68', 1, '购买商品赠送积分', 'integral', 'gain', 1.00, 1.00, '购买商品赠送', 1574048275, 1); -INSERT INTO `yx_user_bill` VALUES (33, 12, '68', 1, '获得推广佣金', 'now_money', 'brokerage', 14.00, 28.00, '15136175247成功消费120.00元,奖励推广佣金14.0', 1574048275, 1); -INSERT INTO `yx_user_bill` VALUES (34, 11, '68', 1, '获得推广佣金', 'now_money', 'brokerage', 6.00, 12.00, '二级推广人15136175247成功消费120.00元,奖励推广佣金6.0', 1574048275, 1); -INSERT INTO `yx_user_bill` VALUES (35, 12, '89', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9720.60, '余额支付', 1574221758, 1); -INSERT INTO `yx_user_bill` VALUES (36, 12, '90', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9600.60, '余额支付', 1574243179, 1); -INSERT INTO `yx_user_bill` VALUES (37, 12, '91', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9480.60, '余额支付', 1574244175, 1); -INSERT INTO `yx_user_bill` VALUES (38, 12, '92', 0, '购买商品', 'now_money', 'pay_product', 1.00, 9360.60, '余额支付', 1574327309, 1); -INSERT INTO `yx_user_bill` VALUES (39, 11, '93', 0, '购买商品', 'now_money', 'pay_product', 1.00, 10000.00, '余额支付', 1574329404, 1); -INSERT INTO `yx_user_bill` VALUES (40, 12, '96', 0, '购买商品', 'now_money', 'pay_product', 1.00, 9359.60, '余额支付', 1574425447, 1); -INSERT INTO `yx_user_bill` VALUES (41, 12, '91', 1, '商品退款', 'now_money', 'pay_product_refund', 120.00, 9478.60, '订单退款到余额', 1574757130, 1); -INSERT INTO `yx_user_bill` VALUES (42, 12, '91', 1, '商品退款', 'now_money', 'pay_product_refund', 120.00, 9598.60, '订单退款到余额', 1574757363, 1); -INSERT INTO `yx_user_bill` VALUES (43, 11, '0', 1, '充值', 'now_money', 'recharge', 10.00, 9410.00, '系统增加了10.0余额', 1575446946, 1); -INSERT INTO `yx_user_bill` VALUES (44, 14, '0', 0, '系统增加余额', 'now_money', 'system_sub', 10.00, 9400.00, '系统扣除了10.0余额', 1575447084, 1); -INSERT INTO `yx_user_bill` VALUES (45, 12, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 0.00, '', 1575549244, 1); -INSERT INTO `yx_user_bill` VALUES (46, 12, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 10.00, '', 1575684021, 1); -INSERT INTO `yx_user_bill` VALUES (47, 12, '99', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9598.60, '余额支付', 1575771514, 1); -INSERT INTO `yx_user_bill` VALUES (48, 12, '0', 1, '签到奖励', 'integral', 'sign', 20.00, 20.00, '', 1575771932, 1); -INSERT INTO `yx_user_bill` VALUES (49, 11, '96', 1, '获得推广佣金', 'now_money', 'brokerage', 0.70, 12.70, '会敲代码的喵2成功消费1.00元,奖励推广佣金0.7', 1575868078, 1); -INSERT INTO `yx_user_bill` VALUES (50, 12, '100', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9479.80, '余额支付', 1576234308, 1); -INSERT INTO `yx_user_bill` VALUES (51, 12, '91', 1, '商品退款', 'now_money', 'pay_product_refund', 120.00, 9481.00, '订单退款到余额', 1576286856, 1); -INSERT INTO `yx_user_bill` VALUES (52, 12, '101', 0, '购买商品', 'now_money', 'pay_product', 1.00, 9481.00, '余额支付', 1576565376, 1); -INSERT INTO `yx_user_bill` VALUES (53, 12, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 40.00, '', 1577026465, 1); -INSERT INTO `yx_user_bill` VALUES (54, 12, '102', 0, '购买商品', 'now_money', 'pay_product', 1.00, 9480.00, '余额支付', 1577086164, 1); -INSERT INTO `yx_user_bill` VALUES (55, 12, '0', 1, '签到奖励', 'integral', 'sign', 20.00, 50.00, '', 1577099436, 1); -INSERT INTO `yx_user_bill` VALUES (56, 12, '103', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9479.00, '余额支付', 1577345071, 1); -INSERT INTO `yx_user_bill` VALUES (57, 12, '25f5693f8e82419bba4f581af126dc47', 0, '积分抵扣', 'integral', 'deduction', 0.50, 70.00, '购买商品使用', 1577442136, 1); -INSERT INTO `yx_user_bill` VALUES (58, 12, '104', 0, '购买商品', 'now_money', 'pay_product', 0.00, 9360.20, '余额支付', 1577442136, 1); -INSERT INTO `yx_user_bill` VALUES (59, 12, '104', 1, '商品退款', 'now_money', 'pay_product_refund', 0.00, 9360.20, '订单退款到余额', 1577586525, 1); -INSERT INTO `yx_user_bill` VALUES (60, 12, '105', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9360.20, '余额支付', 1577611680, 1); -INSERT INTO `yx_user_bill` VALUES (61, 12, '106', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9241.40, '余额支付', 1577774706, 1); -INSERT INTO `yx_user_bill` VALUES (62, 14, '0', 1, '系统增加余额', 'now_money', 'system_add', 0.00, 9400.00, '系统增加了0.0余额', 1578321034, 1); -INSERT INTO `yx_user_bill` VALUES (63, 12, '108', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9122.60, '余额支付', 1578386338, 1); -INSERT INTO `yx_user_bill` VALUES (64, 11, '1', 1, '提现失败', 'now_money', 'extract', 1.00, 13.70, '提现失败,退回佣金1元', 1578455379, 1); -INSERT INTO `yx_user_bill` VALUES (65, 12, '110', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9003.80, '余额支付', 1578482250, 1); -INSERT INTO `yx_user_bill` VALUES (66, 12, '99', 1, '购买商品赠送积分', 'integral', 'gain', 1.00, 69.51, '购买商品赠送', 1578733510, 1); -INSERT INTO `yx_user_bill` VALUES (67, 11, '99', 1, '获得推广佣金', 'now_money', 'brokerage', 13.16, 26.86, '会敲代码的喵2成功消费118.80元,奖励推广佣金13.16', 1578733510, 1); -INSERT INTO `yx_user_bill` VALUES (68, 12, '111', 0, '购买商品', 'now_money', 'pay_product', 118.80, 8885.00, '余额支付', 1578839691, 1); -INSERT INTO `yx_user_bill` VALUES (69, 15, '0', 0, '系统减少余额', 'now_money', 'system_sub', 10.00, 0.00, '系统扣除了10.0余额', 1580440677, 1); -INSERT INTO `yx_user_bill` VALUES (70, 14, '0', 0, '系统减少余额', 'now_money', 'system_sub', 100.00, 9300.00, '系统扣除了100.0余额', 1580440694, 1); -INSERT INTO `yx_user_bill` VALUES (71, 14, '0', 0, '系统减少余额', 'now_money', 'recharge', 100.00, 9200.00, '系统扣除了100.0余额', 1580440702, 1); -INSERT INTO `yx_user_bill` VALUES (72, 12, '104', 1, '商品退款', 'now_money', 'pay_product_refund', 0.00, 8766.20, '订单退款到余额', 1580440738, 1); -INSERT INTO `yx_user_bill` VALUES (73, 12, '104', 1, '商品退款', 'now_money', 'pay_product_refund', 0.00, 8766.20, '订单退款到余额', 1580440967, 1); -INSERT INTO `yx_user_bill` VALUES (74, 11, '112', 0, '购买商品', 'now_money', 'pay_product', 15.50, 9999.00, '余额支付', 1581586206, 1); -INSERT INTO `yx_user_bill` VALUES (75, 11, '113', 0, '购买商品', 'now_money', 'pay_product', 11.00, 9983.50, '余额支付', 1582080107, 1); -INSERT INTO `yx_user_bill` VALUES (76, 11, '114', 0, '购买商品', 'now_money', 'pay_product', 11.00, 9972.50, '余额支付', 1582080948, 1); -INSERT INTO `yx_user_bill` VALUES (77, 11, '115', 0, '购买商品', 'now_money', 'pay_product', 11.00, 9961.50, '余额支付', 1582081730, 1); -INSERT INTO `yx_user_bill` VALUES (78, 11, '116', 0, '购买商品', 'now_money', 'pay_product', 11.00, 9950.50, '余额支付', 1582081800, 1); -INSERT INTO `yx_user_bill` VALUES (79, 11, '117', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9939.50, '余额支付', 1582704871, 1); -INSERT INTO `yx_user_bill` VALUES (80, 11, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 0.00, '', 1582781884, 1); -INSERT INTO `yx_user_bill` VALUES (81, 11, '118', 0, '购买商品', 'now_money', 'pay_product', 15.50, 9819.50, '余额支付', 1582809322, 1); -INSERT INTO `yx_user_bill` VALUES (82, 11, '120', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9804.00, '余额支付', 1582810596, 1); -INSERT INTO `yx_user_bill` VALUES (83, 11, '120', 1, '购买商品赠送积分', 'integral', 'gain', 1.00, 10.00, '购买商品赠送', 1582812352, 1); -INSERT INTO `yx_user_bill` VALUES (84, 11, '8f93eb694f7142c5aeddd8acc6876eaf', 0, '积分抵扣', 'integral', 'deduction', 100.00, 1100.00, '购买商品使用', 1582970347, 1); -INSERT INTO `yx_user_bill` VALUES (85, 11, '122', 0, '购买商品', 'now_money', 'pay_product', 140.00, 9684.00, '余额支付', 1582970348, 1); -INSERT INTO `yx_user_bill` VALUES (86, 11, 'ac31a1bb85f14cfe92c16169495c7db7', 0, '积分抵扣', 'integral', 'deduction', 100.00, 1000.00, '购买商品使用', 1582970945, 1); -INSERT INTO `yx_user_bill` VALUES (87, 11, '123', 0, '购买商品', 'now_money', 'pay_product', 140.00, 9544.00, '余额支付', 1582970946, 1); -INSERT INTO `yx_user_bill` VALUES (88, 11, 'a51e7f23efa8430499f45ad76d45d696', 0, '积分抵扣', 'integral', 'deduction', 120.00, 900.00, '购买商品使用', 1582971169, 1); -INSERT INTO `yx_user_bill` VALUES (89, 11, '124', 0, '购买商品', 'now_money', 'pay_product', 0.00, 9404.00, '余额支付', 1582971170, 1); -INSERT INTO `yx_user_bill` VALUES (90, 11, 'f3ced8276fb64d1a90fe03c5efbad68a', 0, '积分抵扣', 'integral', 'deduction', 100.00, 100.00, '购买商品使用', 1582971472, 1); -INSERT INTO `yx_user_bill` VALUES (91, 11, '125', 0, '购买商品', 'now_money', 'pay_product', 20.00, 9404.00, '余额支付', 1582971472, 1); -INSERT INTO `yx_user_bill` VALUES (92, 11, '126', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9384.00, '余额支付', 1582990630, 1); -INSERT INTO `yx_user_bill` VALUES (93, 11, '127', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9264.00, '余额支付', 1583392756, 1); -INSERT INTO `yx_user_bill` VALUES (94, 11, '128', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9144.00, '余额支付', 1583393731, 1); -INSERT INTO `yx_user_bill` VALUES (95, 11, '129', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9024.00, '余额支付', 1583394584, 1); -INSERT INTO `yx_user_bill` VALUES (96, 11, '130', 0, '购买商品', 'now_money', 'pay_product', 130.00, 8904.00, '余额支付', 1583399210, 1); -INSERT INTO `yx_user_bill` VALUES (97, 11, '131', 0, '购买商品', 'now_money', 'pay_product', 120.00, 8774.00, '余额支付', 1583403288, 1); -INSERT INTO `yx_user_bill` VALUES (98, 11, '132', 0, '购买商品', 'now_money', 'pay_product', 120.00, 8654.00, '余额支付', 1583410828, 1); -INSERT INTO `yx_user_bill` VALUES (99, 11, '133', 0, '购买商品', 'now_money', 'pay_product', 130.00, 8534.00, '余额支付', 1583416032, 1); -INSERT INTO `yx_user_bill` VALUES (100, 11, '135', 0, '购买商品', 'now_money', 'pay_product', 135.50, 8404.00, '余额支付', 1583486513, 1); -INSERT INTO `yx_user_bill` VALUES (101, 11, '136', 0, '购买商品', 'now_money', 'pay_product', 130.00, 8268.50, '余额支付', 1584171672, 1); -INSERT INTO `yx_user_bill` VALUES (102, 11, '137', 0, '购买商品', 'now_money', 'pay_product', 11.00, 8138.50, '余额支付', 1584175854, 1); -INSERT INTO `yx_user_bill` VALUES (103, 11, '138', 0, '购买商品', 'now_money', 'pay_product', 120.00, 8127.50, '余额支付', 1585207556, 1); -INSERT INTO `yx_user_bill` VALUES (104, 11, '139', 0, '购买商品', 'now_money', 'pay_product', 130.00, 8007.50, '余额支付', 1585293458, 1); -INSERT INTO `yx_user_bill` VALUES (105, 11, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 0.00, '', 1585296317, 1); -INSERT INTO `yx_user_bill` VALUES (106, 11, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 10.00, '', 1585297108, 1); -INSERT INTO `yx_user_bill` VALUES (107, 11, '140', 0, '购买商品', 'now_money', 'pay_product', 128.80, 7877.50, '余额支付', 1585385723, 1); -INSERT INTO `yx_user_bill` VALUES (108, 11, '8cb56603f508449a8be484906978e566', 0, '积分抵扣', 'integral', 'deduction', 5.00, 10.00, '购买商品使用', 1585899809, 1); -INSERT INTO `yx_user_bill` VALUES (109, 11, '141', 0, '购买商品', 'now_money', 'pay_product', 5.99, 7748.70, '余额支付', 1585899809, 1); -INSERT INTO `yx_user_bill` VALUES (110, 11, '58d4c7bf44e046e7a90791cd7feeca2e', 0, '积分抵扣', 'integral', 'deduction', 5.00, 5.00, '购买商品使用', 1585899833, 1); -INSERT INTO `yx_user_bill` VALUES (111, 11, 'a7bab1ca9e824141af8759d0c637c9ec', 0, '积分抵扣', 'integral', 'deduction', 1.99, 1000.00, '购买商品使用', 1585900321, 1); -INSERT INTO `yx_user_bill` VALUES (112, 11, '143', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900321, 1); -INSERT INTO `yx_user_bill` VALUES (113, 11, '94db868bbd0f48f8ac9b882a48ecf04e', 0, '积分抵扣', 'integral', 'deduction', 1.99, 998.01, '购买商品使用', 1585900414, 1); -INSERT INTO `yx_user_bill` VALUES (114, 11, '144', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900414, 1); -INSERT INTO `yx_user_bill` VALUES (115, 11, '2863a49ed88846cf920447ded1049908', 0, '积分抵扣', 'integral', 'deduction', 1.99, 996.02, '购买商品使用', 1585900433, 1); -INSERT INTO `yx_user_bill` VALUES (116, 11, '145', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900433, 1); -INSERT INTO `yx_user_bill` VALUES (117, 11, 'e530119f15094f99b710d0dbaaf2243f', 0, '积分抵扣', 'integral', 'deduction', 1.99, 994.03, '购买商品使用', 1585900497, 1); -INSERT INTO `yx_user_bill` VALUES (118, 11, '147', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900497, 1); -INSERT INTO `yx_user_bill` VALUES (119, 11, 'bae5bdd2288840369cdaab1953d2b243', 0, '积分抵扣', 'integral', 'deduction', 1.99, 992.04, '购买商品使用', 1585900580, 1); -INSERT INTO `yx_user_bill` VALUES (120, 11, '148', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900580, 1); -INSERT INTO `yx_user_bill` VALUES (121, 11, '59c0e78109fc4d44bae85e1de7a7f8a5', 0, '积分抵扣', 'integral', 'deduction', 0.00, 990.05, '购买商品使用', 1585901832, 1); -INSERT INTO `yx_user_bill` VALUES (122, 11, '149', 0, '购买商品', 'now_money', 'pay_product', 1.99, 7742.71, '余额支付', 1585901832, 1); -INSERT INTO `yx_user_bill` VALUES (123, 11, '7903fe2a57a2443794540fc4908aba36', 0, '积分抵扣', 'integral', 'deduction', 1.99, 990.05, '购买商品使用', 1585901988, 1); -INSERT INTO `yx_user_bill` VALUES (124, 11, '150', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7740.72, '余额支付', 1585901989, 1); -INSERT INTO `yx_user_bill` VALUES (125, 11, '151', 0, '购买商品', 'now_money', 'pay_product', 1.01, 7740.72, '余额支付', 1585907993, 1); -INSERT INTO `yx_user_bill` VALUES (126, 11, '152', 0, '购买商品', 'now_money', 'pay_product', 1.00, 7739.71, '余额支付', 1586065086, 1); -INSERT INTO `yx_user_bill` VALUES (127, 11, '153', 0, '购买商品', 'now_money', 'pay_product', 118.80, 7738.71, '余额支付', 1586065172, 1); - --- ---------------------------- --- 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 = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户提现表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_user_extract --- ---------------------------- -INSERT INTO `yx_user_extract` VALUES (1, 11, '会敲代码的喵', 'weixin', '0', '', '', 1.00, NULL, 5.00, '失败了', 1578455379, 1573648445, -1, 'hu'); - --- ---------------------------- --- 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 = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户等级记录表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_user_level --- ---------------------------- -INSERT INTO `yx_user_level` VALUES (4, 11, 1, 1, 0, 1, 0, 1, '恭喜你成为了普通会员', 0, 0, 1585297281, 99); - --- ---------------------------- --- 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', - `nickname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '', - `order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '订单号', - `price` decimal(8, 2) NULL DEFAULT NULL COMMENT '充值金额', - `give_price` decimal(8, 2) NULL DEFAULT 0.00 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 = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户充值表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_user_recharge --- ---------------------------- -INSERT INTO `yx_user_recharge` VALUES (1, 11, 'hupeng', '1234428298159718400', 200.00, 0.00, 'weixin', 0, NULL, 1583145615, 0.00); -INSERT INTO `yx_user_recharge` VALUES (2, 11, '会敲代码的喵88', '1235853569362493440', 110.00, 0.00, 'weixin', 0, NULL, 1583485426, 0.00); -INSERT INTO `yx_user_recharge` VALUES (3, 11, '会敲代码的喵88', '1235874304738983936', 111.00, 0.00, 'weixin', 0, NULL, 1583490370, 0.00); -INSERT INTO `yx_user_recharge` VALUES (4, 11, '会敲代码的喵88', '1235874561447165952', 111.00, 0.00, 'weixin', 0, NULL, 1583490431, 0.00); -INSERT INTO `yx_user_recharge` VALUES (5, 11, '会敲代码的喵88', '1235874725738053632', 111.00, 0.00, 'weixin', 0, NULL, 1583490470, 0.00); -INSERT INTO `yx_user_recharge` VALUES (6, 11, '会敲代码的喵88', '1235875114126409728', 1111.00, 0.00, 'weixin', 0, NULL, 1583490563, 0.00); -INSERT INTO `yx_user_recharge` VALUES (7, 11, '会敲代码的喵88', '1235876251080589312', 1111.00, 0.00, 'weixin', 0, NULL, 1583490834, 0.00); -INSERT INTO `yx_user_recharge` VALUES (8, 11, '会敲代码的喵88', '1242024244678754304', 100.00, 10.00, 'weixin', 0, NULL, 1584956630, 0.00); -INSERT INTO `yx_user_recharge` VALUES (9, 11, '会敲代码的喵88', '1242024501730869248', 111.00, 111.00, 'weixin', 0, NULL, 1584956691, 0.00); -INSERT INTO `yx_user_recharge` VALUES (10, 11, '会敲代码的喵88', '1242025322262560768', 222.00, 0.00, 'weixin', 0, NULL, 1584956887, 0.00); -INSERT INTO `yx_user_recharge` VALUES (11, 11, '会敲代码的喵88', '1246020207407792128', 1.00, 1.00, 'weixin', 0, NULL, 1585909342, 0.00); -INSERT INTO `yx_user_recharge` VALUES (12, 11, '会敲代码的喵88', '1246379540565983232', 10.00, 100.00, 'weixin', 0, NULL, 1585995013, 0.00); -INSERT INTO `yx_user_recharge` VALUES (13, 11, '会敲代码的喵88', '1246379584941719552', 1.00, 1.00, 'weixin', 0, NULL, 1585995024, 0.00); -INSERT INTO `yx_user_recharge` VALUES (14, 11, '会敲代码的喵88', '1246383201052524544', 10.00, 100.00, 'weixin', 0, NULL, 1585995886, 0.00); -INSERT INTO `yx_user_recharge` VALUES (15, 11, '会敲代码的喵88', '1246383225413042176', 10.00, 100.00, 'weixin', 0, NULL, 1585995892, 0.00); - --- ---------------------------- --- 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 = 10 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 = 17 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户任务完成记录表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_user_task_finish --- ---------------------------- -INSERT INTO `yx_user_task_finish` VALUES (13, 1, 11, 0, 1585297278); -INSERT INTO `yx_user_task_finish` VALUES (14, 2, 11, 0, 1585297278); -INSERT INTO `yx_user_task_finish` VALUES (15, 16, 11, 0, 1585297278); -INSERT INTO `yx_user_task_finish` VALUES (16, 17, 11, 0, 1585297369); - --- ---------------------------- --- 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_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 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 = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信关键字回复表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_wechat_reply --- ---------------------------- -INSERT INTO `yx_wechat_reply` VALUES (1, 'subscribe', 'text', '{\"content\":\"2222222222244449999\"}', 1, NULL); - --- ---------------------------- --- 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 = 15 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 (13, 'OPENTM207791277', '订单支付成功通知', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n支付金额:{{keyword2.DATA}}\n{{remark.DATA}}', 'hJV1d1OwWB_lbPrSaRHi9RGr5CFAF4PJcZdYeg73Mtg', '1528966759', 1); -INSERT INTO `yx_wechat_template` VALUES (14, 'OPENTM405847076', '帐户资金变动提醒', '{{first.DATA}}\n变动类型:{{keyword1.DATA}}\n变动时间:{{keyword2.DATA}}\n变动金额:{{keyword3.DATA}}\n{{remark.DATA}}', 'ePF4RS3ONCEuS9AuPyqZ2Th_B-HZ6E1CIpnJRt7ACwI', '1528966759', 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, - UNIQUE INDEX `openid`(`openid`) 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 -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信用户表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of yx_wechat_user --- ---------------------------- -INSERT INTO `yx_wechat_user` VALUES (1, NULL, NULL, NULL, 'hupeng', '', 0, '', '', '', '', NULL, 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'wechat'); - -SET FOREIGN_KEY_CHECKS = 1; +/* + Navicat Premium Data Transfer + + Source Server : localhost + Source Server Type : MySQL + Source Server Version : 50723 + Source Host : localhost:3306 + Source Schema : yxshop + + Target Server Type : MySQL + Target Server Version : 50723 + File Encoding : 65001 + + Date: 07/04/2020 17:02:09 +*/ + +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 COMMENT = '支付宝配置类' 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 column_config +-- ---------------------------- +DROP TABLE IF EXISTS `column_config`; +CREATE TABLE `column_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `column_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `column_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `dict_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `extra` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `form_show` bit(1) NULL DEFAULT NULL, + `form_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `key_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `list_show` bit(1) NULL DEFAULT NULL, + `not_null` bit(1) NULL DEFAULT NULL, + `query_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `date_annotation` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 292 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成字段信息存储' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of column_config +-- ---------------------------- +INSERT INTO `column_config` VALUES (1, 'gen_test', 'id', 'int', NULL, 'auto_increment', b'0', NULL, 'PRI', b'0', b'1', NULL, 'ID', NULL); +INSERT INTO `column_config` VALUES (2, 'gen_test', 'sex', 'int', NULL, '', b'1', NULL, '', b'1', b'0', 'NotNull', '性别', NULL); +INSERT INTO `column_config` VALUES (3, 'gen_test', 'create_time', 'datetime', NULL, '', b'0', NULL, '', b'1', b'0', 'BetWeen', '', NULL); +INSERT INTO `column_config` VALUES (139, 'users_roles', 'user_id', 'bigint', NULL, '', b'1', NULL, 'PRI', b'1', b'1', NULL, '用户ID', NULL); +INSERT INTO `column_config` VALUES (140, 'users_roles', 'role_id', 'bigint', NULL, '', b'1', NULL, 'PRI', b'1', b'1', NULL, '角色ID', NULL); +INSERT INTO `column_config` VALUES (141, 'user_avatar', 'id', 'bigint', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '', NULL); +INSERT INTO `column_config` VALUES (142, 'user_avatar', 'real_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '真实文件名', NULL); +INSERT INTO `column_config` VALUES (143, 'user_avatar', 'path', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '路径', NULL); +INSERT INTO `column_config` VALUES (144, 'user_avatar', 'size', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '大小', NULL); +INSERT INTO `column_config` VALUES (145, 'user_avatar', 'create_time', 'datetime', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '创建时间', NULL); +INSERT INTO `column_config` VALUES (146, 'yx_material_group', 'id', 'varchar', NULL, '', b'1', NULL, 'PRI', b'1', b'1', NULL, 'PK', NULL); +INSERT INTO `column_config` VALUES (147, 'yx_material_group', 'user_id', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '所属租户', NULL); +INSERT INTO `column_config` VALUES (148, 'yx_material_group', 'del_flag', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '逻辑删除标记(0:显示;1:隐藏)', NULL); +INSERT INTO `column_config` VALUES (149, 'yx_material_group', 'create_time', 'datetime', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '创建时间', NULL); +INSERT INTO `column_config` VALUES (150, 'yx_material_group', 'update_time', 'timestamp', NULL, 'on update CURRENT_TIMESTAMP', b'1', NULL, '', b'1', b'1', NULL, '最后更新时间', NULL); +INSERT INTO `column_config` VALUES (151, 'yx_material_group', 'create_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '创建者ID', NULL); +INSERT INTO `column_config` VALUES (152, 'yx_material_group', 'name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '分组名', NULL); +INSERT INTO `column_config` VALUES (153, 'yx_material', 'id', 'varchar', NULL, '', b'1', NULL, 'PRI', b'1', b'1', NULL, 'PK', NULL); +INSERT INTO `column_config` VALUES (154, 'yx_material', 'user_id', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '所属租户', NULL); +INSERT INTO `column_config` VALUES (155, 'yx_material', 'del_flag', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '逻辑删除标记(0:显示;1:隐藏)', NULL); +INSERT INTO `column_config` VALUES (156, 'yx_material', 'create_time', 'datetime', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '创建时间', NULL); +INSERT INTO `column_config` VALUES (157, 'yx_material', 'update_time', 'timestamp', NULL, 'on update CURRENT_TIMESTAMP', b'1', NULL, '', b'1', b'1', NULL, '最后更新时间', NULL); +INSERT INTO `column_config` VALUES (158, 'yx_material', 'create_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '创建者ID', NULL); +INSERT INTO `column_config` VALUES (159, 'yx_material', 'type', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '类型1、图片;2、视频', NULL); +INSERT INTO `column_config` VALUES (160, 'yx_material', 'group_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '分组ID', NULL); +INSERT INTO `column_config` VALUES (161, 'yx_material', 'name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '素材名', NULL); +INSERT INTO `column_config` VALUES (162, 'yx_material', 'url', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '素材链接', NULL); +INSERT INTO `column_config` VALUES (163, 'yx_user', 'uid', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '用户id', NULL); +INSERT INTO `column_config` VALUES (164, 'yx_user', 'username', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'0', NULL, '用户账户(跟accout一样)', NULL); +INSERT INTO `column_config` VALUES (165, 'yx_user', 'account', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '用户账号', NULL); +INSERT INTO `column_config` VALUES (166, 'yx_user', 'password', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户密码(跟pwd)', NULL); +INSERT INTO `column_config` VALUES (167, 'yx_user', 'pwd', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户密码', NULL); +INSERT INTO `column_config` VALUES (168, 'yx_user', 'real_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '真实姓名', NULL); +INSERT INTO `column_config` VALUES (169, 'yx_user', 'birthday', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '生日', NULL); +INSERT INTO `column_config` VALUES (170, 'yx_user', 'card_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '身份证号码', NULL); +INSERT INTO `column_config` VALUES (171, 'yx_user', 'mark', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户备注', NULL); +INSERT INTO `column_config` VALUES (172, 'yx_user', 'partner_id', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '合伙人id', NULL); +INSERT INTO `column_config` VALUES (173, 'yx_user', 'group_id', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户分组id', NULL); +INSERT INTO `column_config` VALUES (174, 'yx_user', 'nickname', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户昵称', NULL); +INSERT INTO `column_config` VALUES (175, 'yx_user', 'avatar', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户头像', NULL); +INSERT INTO `column_config` VALUES (176, 'yx_user', 'phone', 'char', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '手机号码', NULL); +INSERT INTO `column_config` VALUES (177, 'yx_user', 'add_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '添加时间', NULL); +INSERT INTO `column_config` VALUES (178, 'yx_user', 'add_ip', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '添加ip', NULL); +INSERT INTO `column_config` VALUES (179, 'yx_user', 'last_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '最后一次登录时间', NULL); +INSERT INTO `column_config` VALUES (180, 'yx_user', 'last_ip', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '最后一次登录ip', NULL); +INSERT INTO `column_config` VALUES (181, 'yx_user', 'now_money', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户余额', NULL); +INSERT INTO `column_config` VALUES (182, 'yx_user', 'brokerage_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '佣金金额', NULL); +INSERT INTO `column_config` VALUES (183, 'yx_user', 'integral', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户剩余积分', NULL); +INSERT INTO `column_config` VALUES (184, 'yx_user', 'sign_num', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '连续签到天数', NULL); +INSERT INTO `column_config` VALUES (185, 'yx_user', 'status', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '1为正常,0为禁止', NULL); +INSERT INTO `column_config` VALUES (186, 'yx_user', 'level', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '等级', NULL); +INSERT INTO `column_config` VALUES (187, 'yx_user', 'spread_uid', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '推广元id', NULL); +INSERT INTO `column_config` VALUES (188, 'yx_user', 'spread_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '推广员关联时间', NULL); +INSERT INTO `column_config` VALUES (189, 'yx_user', 'user_type', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户类型', NULL); +INSERT INTO `column_config` VALUES (190, 'yx_user', 'is_promoter', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '是否为推广员', NULL); +INSERT INTO `column_config` VALUES (191, 'yx_user', 'pay_count', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '用户购买次数', NULL); +INSERT INTO `column_config` VALUES (192, 'yx_user', 'spread_count', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '下级人数', NULL); +INSERT INTO `column_config` VALUES (193, 'yx_user', 'clean_time', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '清理会员时间', NULL); +INSERT INTO `column_config` VALUES (194, 'yx_user', 'addres', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '详细地址', NULL); +INSERT INTO `column_config` VALUES (195, 'yx_user', 'adminid', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '管理员编号 ', NULL); +INSERT INTO `column_config` VALUES (196, 'yx_user', 'login_type', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户登陆类型,h5,wechat,routine', NULL); +INSERT INTO `column_config` VALUES (197, 'yx_wechat_media', 'id', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '微信视频音频id', NULL); +INSERT INTO `column_config` VALUES (198, 'yx_wechat_media', 'type', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '回复类型', NULL); +INSERT INTO `column_config` VALUES (199, 'yx_wechat_media', 'path', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '文件路径', NULL); +INSERT INTO `column_config` VALUES (200, 'yx_wechat_media', 'media_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '微信服务器返回的id', NULL); +INSERT INTO `column_config` VALUES (201, 'yx_wechat_media', 'url', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '地址', NULL); +INSERT INTO `column_config` VALUES (202, 'yx_wechat_media', 'temporary', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '是否永久或者临时 0永久1临时', NULL); +INSERT INTO `column_config` VALUES (203, 'yx_wechat_media', 'add_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '添加时间', NULL); +INSERT INTO `column_config` VALUES (204, 'yx_store_order', 'id', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '订单ID', NULL); +INSERT INTO `column_config` VALUES (205, 'yx_store_order', 'order_id', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '订单号', NULL); +INSERT INTO `column_config` VALUES (206, 'yx_store_order', 'extend_order_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '额外订单号', NULL); +INSERT INTO `column_config` VALUES (207, 'yx_store_order', 'uid', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '用户id', NULL); +INSERT INTO `column_config` VALUES (208, 'yx_store_order', 'real_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户姓名', NULL); +INSERT INTO `column_config` VALUES (209, 'yx_store_order', 'user_phone', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '用户电话', NULL); +INSERT INTO `column_config` VALUES (210, 'yx_store_order', 'user_address', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '详细地址', NULL); +INSERT INTO `column_config` VALUES (211, 'yx_store_order', 'cart_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '购物车id', NULL); +INSERT INTO `column_config` VALUES (212, 'yx_store_order', 'freight_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '运费金额', NULL); +INSERT INTO `column_config` VALUES (213, 'yx_store_order', 'total_num', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '订单商品总数', NULL); +INSERT INTO `column_config` VALUES (214, 'yx_store_order', 'total_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '订单总价', NULL); +INSERT INTO `column_config` VALUES (215, 'yx_store_order', 'total_postage', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '邮费', NULL); +INSERT INTO `column_config` VALUES (216, 'yx_store_order', 'pay_price', 'decimal', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '实际支付金额', NULL); +INSERT INTO `column_config` VALUES (217, 'yx_store_order', 'pay_postage', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '支付邮费', NULL); +INSERT INTO `column_config` VALUES (218, 'yx_store_order', 'deduction_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '抵扣金额', NULL); +INSERT INTO `column_config` VALUES (219, 'yx_store_order', 'coupon_id', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '优惠券id', NULL); +INSERT INTO `column_config` VALUES (220, 'yx_store_order', 'coupon_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '优惠券金额', NULL); +INSERT INTO `column_config` VALUES (221, 'yx_store_order', 'paid', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '支付状态', NULL); +INSERT INTO `column_config` VALUES (222, 'yx_store_order', 'pay_time', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'0', NULL, '支付时间', NULL); +INSERT INTO `column_config` VALUES (223, 'yx_store_order', 'pay_type', 'varchar', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '支付方式', NULL); +INSERT INTO `column_config` VALUES (224, 'yx_store_order', 'add_time', 'int', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '创建时间', NULL); +INSERT INTO `column_config` VALUES (225, 'yx_store_order', 'status', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款)', NULL); +INSERT INTO `column_config` VALUES (226, 'yx_store_order', 'refund_status', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '0 未退款 1 申请中 2 已退款', NULL); +INSERT INTO `column_config` VALUES (227, 'yx_store_order', 'refund_reason_wap_img', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '退款图片', NULL); +INSERT INTO `column_config` VALUES (228, 'yx_store_order', 'refund_reason_wap_explain', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '退款用户说明', NULL); +INSERT INTO `column_config` VALUES (229, 'yx_store_order', 'refund_reason_time', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '退款时间', NULL); +INSERT INTO `column_config` VALUES (230, 'yx_store_order', 'refund_reason_wap', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '前台退款原因', NULL); +INSERT INTO `column_config` VALUES (231, 'yx_store_order', 'refund_reason', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '不退款的理由', NULL); +INSERT INTO `column_config` VALUES (232, 'yx_store_order', 'refund_price', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '退款金额', NULL); +INSERT INTO `column_config` VALUES (233, 'yx_store_order', 'delivery_sn', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '快递公司编号', NULL); +INSERT INTO `column_config` VALUES (234, 'yx_store_order', 'delivery_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '快递名称/送货人姓名', NULL); +INSERT INTO `column_config` VALUES (235, 'yx_store_order', 'delivery_type', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '发货类型', NULL); +INSERT INTO `column_config` VALUES (236, 'yx_store_order', 'delivery_id', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '快递单号/手机号', NULL); +INSERT INTO `column_config` VALUES (237, 'yx_store_order', 'gain_integral', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '消费赚取积分', NULL); +INSERT INTO `column_config` VALUES (238, 'yx_store_order', 'use_integral', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '使用积分', NULL); +INSERT INTO `column_config` VALUES (239, 'yx_store_order', 'back_integral', 'decimal', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '给用户退了多少积分', NULL); +INSERT INTO `column_config` VALUES (240, 'yx_store_order', 'mark', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '备注', NULL); +INSERT INTO `column_config` VALUES (241, 'yx_store_order', 'is_del', 'tinyint', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '是否删除', NULL); +INSERT INTO `column_config` VALUES (242, 'yx_store_order', 'unique', 'char', NULL, '', b'1', NULL, 'UNI', b'1', b'1', NULL, '唯一id(md5加密)类似id', NULL); +INSERT INTO `column_config` VALUES (243, 'yx_store_order', 'remark', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '管理员备注', NULL); +INSERT INTO `column_config` VALUES (244, 'yx_store_order', 'mer_id', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '商户ID', NULL); +INSERT INTO `column_config` VALUES (245, 'yx_store_order', 'is_mer_check', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '', NULL); +INSERT INTO `column_config` VALUES (246, 'yx_store_order', 'combination_id', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '拼团产品id0一般产品', NULL); +INSERT INTO `column_config` VALUES (247, 'yx_store_order', 'pink_id', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '拼团id 0没有拼团', NULL); +INSERT INTO `column_config` VALUES (248, 'yx_store_order', 'cost', 'decimal', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '成本价', NULL); +INSERT INTO `column_config` VALUES (249, 'yx_store_order', 'seckill_id', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '秒杀产品ID', NULL); +INSERT INTO `column_config` VALUES (250, 'yx_store_order', 'bargain_id', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '砍价id', NULL); +INSERT INTO `column_config` VALUES (251, 'yx_store_order', 'verify_code', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '核销码', NULL); +INSERT INTO `column_config` VALUES (252, 'yx_store_order', 'store_id', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '门店id', NULL); +INSERT INTO `column_config` VALUES (253, 'yx_store_order', 'shipping_type', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '配送方式 1=快递 ,2=门店自提', NULL); +INSERT INTO `column_config` VALUES (254, 'yx_store_order', 'is_channel', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '支付渠道(0微信公众号1微信小程序)', NULL); +INSERT INTO `column_config` VALUES (255, 'yx_store_order', 'is_remind', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '', NULL); +INSERT INTO `column_config` VALUES (256, 'yx_store_order', 'is_system_del', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '', NULL); +INSERT INTO `column_config` VALUES (257, 'yx_user_recharge', 'id', 'int', NULL, 'auto_increment', b'0', NULL, 'PRI', b'1', b'0', NULL, '', NULL); +INSERT INTO `column_config` VALUES (258, 'yx_user_recharge', 'uid', 'int', NULL, '', b'0', NULL, 'MUL', b'0', b'0', NULL, '充值用户UID', NULL); +INSERT INTO `column_config` VALUES (259, 'yx_user_recharge', 'order_id', 'varchar', NULL, '', b'0', NULL, 'UNI', b'1', b'0', NULL, '订单号', NULL); +INSERT INTO `column_config` VALUES (260, 'yx_user_recharge', 'price', 'decimal', NULL, '', b'0', NULL, '', b'1', b'0', NULL, '充值金额', NULL); +INSERT INTO `column_config` VALUES (261, 'yx_user_recharge', 'recharge_type', 'varchar', NULL, '', b'0', NULL, 'MUL', b'1', b'0', NULL, '充值类型', NULL); +INSERT INTO `column_config` VALUES (262, 'yx_user_recharge', 'paid', 'tinyint', NULL, '', b'0', NULL, 'MUL', b'1', b'0', NULL, '是否充值', NULL); +INSERT INTO `column_config` VALUES (263, 'yx_user_recharge', 'pay_time', 'int', NULL, '', b'0', NULL, '', b'1', b'0', NULL, '充值支付时间', NULL); +INSERT INTO `column_config` VALUES (264, 'yx_user_recharge', 'add_time', 'int', NULL, '', b'0', NULL, '', b'1', b'0', NULL, '充值时间', NULL); +INSERT INTO `column_config` VALUES (265, 'yx_user_recharge', 'refund_price', 'decimal', NULL, '', b'0', NULL, '', b'0', b'0', NULL, '退款金额', NULL); +INSERT INTO `column_config` VALUES (266, 'yx_user_recharge', 'nickname', 'varchar', NULL, '', b'0', NULL, '', b'1', b'0', 'Like', '昵称', NULL); +INSERT INTO `column_config` VALUES (267, 'yx_system_store', 'id', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '', NULL); +INSERT INTO `column_config` VALUES (268, 'yx_system_store', 'name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '门店名称', NULL); +INSERT INTO `column_config` VALUES (269, 'yx_system_store', 'introduction', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '简介', NULL); +INSERT INTO `column_config` VALUES (270, 'yx_system_store', 'phone', 'char', NULL, '', b'1', NULL, 'MUL', b'1', b'1', NULL, '手机号码', NULL); +INSERT INTO `column_config` VALUES (271, 'yx_system_store', 'address', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '省市区', NULL); +INSERT INTO `column_config` VALUES (272, 'yx_system_store', 'detailed_address', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '详细地址', NULL); +INSERT INTO `column_config` VALUES (273, 'yx_system_store', 'image', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '门店logo', NULL); +INSERT INTO `column_config` VALUES (274, 'yx_system_store', 'latitude', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '纬度', NULL); +INSERT INTO `column_config` VALUES (275, 'yx_system_store', 'longitude', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '经度', NULL); +INSERT INTO `column_config` VALUES (276, 'yx_system_store', 'valid_time', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '核销有效日期', NULL); +INSERT INTO `column_config` VALUES (277, 'yx_system_store', 'day_time', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '每日营业开关时间', NULL); +INSERT INTO `column_config` VALUES (278, 'yx_system_store', 'add_time', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '添加时间', NULL); +INSERT INTO `column_config` VALUES (279, 'yx_system_store', 'is_show', 'tinyint', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '是否显示', NULL); +INSERT INTO `column_config` VALUES (280, 'yx_system_store', 'is_del', 'tinyint', NULL, '', b'1', NULL, '', b'0', b'1', NULL, '是否删除', NULL); +INSERT INTO `column_config` VALUES (281, 'yx_system_store_staff', 'id', 'int', NULL, 'auto_increment', b'1', NULL, 'PRI', b'1', b'0', NULL, '', NULL); +INSERT INTO `column_config` VALUES (282, 'yx_system_store_staff', 'uid', 'int', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '微信用户id', NULL); +INSERT INTO `column_config` VALUES (283, 'yx_system_store_staff', 'avatar', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '店员头像', NULL); +INSERT INTO `column_config` VALUES (284, 'yx_system_store_staff', 'store_id', 'int', NULL, '', b'1', 'Select', '', b'1', b'1', NULL, '门店id', NULL); +INSERT INTO `column_config` VALUES (285, 'yx_system_store_staff', 'staff_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', 'Like', '店员名称', NULL); +INSERT INTO `column_config` VALUES (286, 'yx_system_store_staff', 'phone', 'char', NULL, '', b'1', NULL, '', b'1', b'1', NULL, '手机号码', NULL); +INSERT INTO `column_config` VALUES (287, 'yx_system_store_staff', 'verify_status', 'tinyint', NULL, '', b'1', 'Radio', '', b'1', b'1', NULL, '核销开关', NULL); +INSERT INTO `column_config` VALUES (288, 'yx_system_store_staff', 'status', 'tinyint', NULL, '', b'1', 'Radio', '', b'1', b'0', NULL, '状态', NULL); +INSERT INTO `column_config` VALUES (289, 'yx_system_store_staff', 'add_time', 'int', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '添加时间', NULL); +INSERT INTO `column_config` VALUES (290, 'yx_system_store_staff', 'nickname', 'varchar', NULL, '', b'1', NULL, '', b'1', b'1', 'Like', '微信昵称', NULL); +INSERT INTO `column_config` VALUES (291, 'yx_system_store_staff', 'store_name', 'varchar', NULL, '', b'1', NULL, '', b'1', b'0', NULL, '所属门店', NULL); + +-- ---------------------------- +-- 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 '上级部门', + `enabled` bit(1) NOT NULL COMMENT '状态', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of dept +-- ---------------------------- +INSERT INTO `dept` VALUES (1, 'YSHOP', 0, b'1', '2019-03-01 12:07:37'); +INSERT INTO `dept` VALUES (2, '研发部', 7, b'1', '2019-03-25 09:15:32'); +INSERT INTO `dept` VALUES (5, '运维部', 7, b'1', '2019-03-25 09:20:44'); +INSERT INTO `dept` VALUES (6, '测试部', 8, b'1', '2019-03-25 09:52:18'); +INSERT INTO `dept` VALUES (7, '华南分部', 1, b'1', '2019-03-25 11:04:50'); +INSERT INTO `dept` VALUES (8, '华北分部', 1, b'1', '2019-03-25 11:04:53'); +INSERT INTO `dept` VALUES (11, '人事部', 8, b'1', '2019-03-25 11:07:58'); + +-- ---------------------------- +-- 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 '描述', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据字典' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of dict +-- ---------------------------- +INSERT INTO `dict` VALUES (1, 'user_status', '用户状态', '2019-10-27 20:31:36'); +INSERT INTO `dict` VALUES (4, 'dept_status', '部门状态', '2019-10-27 20:31:36'); +INSERT INTO `dict` VALUES (5, 'job_status', '岗位状态', '2019-10-27 20:31:36'); + +-- ---------------------------- +-- 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', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + 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 = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据字典详情' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of dict_detail +-- ---------------------------- +INSERT INTO `dict_detail` VALUES (1, '激活', 'true', '1', 1, '2019-10-27 20:31:36'); +INSERT INTO `dict_detail` VALUES (2, '禁用', 'false', '2', 1, NULL); +INSERT INTO `dict_detail` VALUES (3, '启用', 'true', '1', 4, NULL); +INSERT INTO `dict_detail` VALUES (4, '停用', 'false', '2', 4, '2019-10-27 20:31:36'); +INSERT INTO `dict_detail` VALUES (5, '启用', 'true', '1', 5, NULL); +INSERT INTO `dict_detail` VALUES (6, '停用', 'false', '2', 5, '2019-10-27 20:31:36'); + +-- ---------------------------- +-- 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 COMMENT = '邮箱配置' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of email_config +-- ---------------------------- +INSERT INTO `email_config` VALUES (1, '111@qq.com', '111', '111', '111', '1'); + +-- ---------------------------- +-- Table structure for gen_config +-- ---------------------------- +DROP TABLE IF EXISTS `gen_config`; +CREATE TABLE `gen_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表名', + `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 COMMENT '前端Api文件路径', + `prefix` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表前缀', + `api_alias` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '接口名称', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成器配置' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of gen_config +-- ---------------------------- +INSERT INTO `gen_config` VALUES (3, 'gen_test', 'Zheng Jie', b'1', 'eladmin-system', 'me.zhengjie.gen', 'E:\\workspace\\me\\front\\eladmin-web\\src\\views\\gen', 'E:\\workspace\\me\\front\\eladmin-web\\src\\api', NULL, '测试生成'); +INSERT INTO `gen_config` VALUES (4, 'yx_material_group', 'hupeng', b'0', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\output', 'E:\\output\\', NULL, '素材'); +INSERT INTO `gen_config` VALUES (5, 'yx_material', 'hupeng', b'0', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\output', 'E:\\output\\', NULL, '素材管理'); +INSERT INTO `gen_config` VALUES (6, 'yx_user', 'hupeng', b'0', 'yshop-system', 'co.yixiang.modules', 'aa', 'aa\\', NULL, '用户'); +INSERT INTO `gen_config` VALUES (7, 'yx_wechat_media', 'hupeng', b'0', 'yshop-system', 'co.yixiang.modules', 'E:\\book\\img', 'E:\\book\\img\\', NULL, 'ceshi'); +INSERT INTO `gen_config` VALUES (8, 'yx_user_recharge', 'hupeng', b'0', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\java\\yxshop-private\\yshop-web\\src\\views\\shop\\recharge', 'E:\\java\\yxshop-private\\yshop-web\\src\\api', '', '充值管理'); +INSERT INTO `gen_config` VALUES (9, 'yx_system_store', 'hupeng', b'0', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\java\\yxshop-private\\yshop-web\\src\\views\\shop\\store', 'E:\\java\\yxshop-private\\yshop-web\\src\\api', NULL, '门店'); +INSERT INTO `gen_config` VALUES (10, 'yx_system_store_staff', 'hupeng', b'1', 'yshop-shop', 'co.yixiang.modules.shop', 'E:\\java\\yxshop-private\\yshop-web\\src\\views\\shop\\storestaff', 'E:\\java\\yxshop-private\\yshop-web\\src\\api', NULL, '门店店员'); + +-- ---------------------------- +-- Table structure for gen_test +-- ---------------------------- +DROP TABLE IF EXISTS `gen_test`; +CREATE TABLE `gen_test` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `sex` int(255) NULL DEFAULT NULL COMMENT '性别', + `create_time` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成测试' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for job +-- ---------------------------- +DROP TABLE IF EXISTS `job`; +CREATE TABLE `job` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '岗位名称', + `enabled` bit(1) NOT NULL COMMENT '岗位状态', + `sort` bigint(20) NOT NULL COMMENT '岗位排序', + `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + 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 = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '岗位' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of job +-- ---------------------------- +INSERT INTO `job` VALUES (8, '人事专员', b'1', 3, 11, '2019-03-29 14:52:28'); +INSERT INTO `job` VALUES (10, '产品经理', b'1', 4, 2, '2019-03-29 14:55:51'); +INSERT INTO `job` VALUES (11, '全栈开发', b'1', 2, 2, '2019-03-31 13:39:30'); +INSERT INTO `job` VALUES (12, '软件测试', b'1', 5, 2, '2019-03-31 13:39:43'); + +-- ---------------------------- +-- 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 COMMENT '文件真实的名称', + `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(0) NULL DEFAULT NULL COMMENT '创建日期', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 46 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '本地存储' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of local_storage +-- ---------------------------- +INSERT INTO `local_storage` VALUES (1, 'list_30-20200107120524671.png', 'list_30', 'png', 'E:\\yshop\\file\\图片\\list_30-20200107120524671.png', '图片', '28.57KB ', 'admin', '2020-01-07 12:05:25'); +INSERT INTO `local_storage` VALUES (2, 'list_34-20200109071140374.png', 'list_34', 'png', 'E:\\yshop\\file\\图片\\list_34-20200109071140374.png', '图片', '27.05KB ', 'admin', '2020-01-09 19:11:40'); +INSERT INTO `local_storage` VALUES (3, 'list_22-20200109072256534.png', 'list_22', 'png', 'E:\\yshop\\file\\pic\\list_22-20200109072256534.png', 'pic', '28.23KB ', 'admin', '2020-01-09 19:22:57'); +INSERT INTO `local_storage` VALUES (4, 'list_32-20200109093407741.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109093407741.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:34:08'); +INSERT INTO `local_storage` VALUES (5, 'list_32-20200109094223500.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109094223500.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:42:24'); +INSERT INTO `local_storage` VALUES (6, 'list_32-20200109094413459.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109094413459.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:44:13'); +INSERT INTO `local_storage` VALUES (7, 'list_32-20200109094652138.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109094652138.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:46:52'); +INSERT INTO `local_storage` VALUES (8, 'list_34-20200109095146476.png', 'list_34', 'png', 'E:\\yshop\\file\\pic\\list_34-20200109095146476.png', 'pic', '27.05KB ', 'admin', '2020-01-09 21:51:47'); +INSERT INTO `local_storage` VALUES (9, 'list_32-20200109095700685.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109095700685.png', 'pic', '27.65KB ', 'admin', '2020-01-09 21:57:01'); +INSERT INTO `local_storage` VALUES (10, 'list_20-20200109095936988.png', 'list_20', 'png', 'E:\\yshop\\file\\pic\\list_20-20200109095936988.png', 'pic', '22.92KB ', 'admin', '2020-01-09 21:59:37'); +INSERT INTO `local_storage` VALUES (11, 'list_32-20200109100213309.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200109100213309.png', 'pic', '27.65KB ', 'admin', '2020-01-09 22:02:13'); +INSERT INTO `local_storage` VALUES (12, 'list_30-20200109104513493.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-20200109104513493.png', 'pic', '28.57KB ', 'admin', '2020-01-09 22:45:13'); +INSERT INTO `local_storage` VALUES (13, 'list_16-20200110120838173.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200110120838173.png', 'pic', '28.93KB ', 'admin', '2020-01-10 12:08:38'); +INSERT INTO `local_storage` VALUES (14, 'list_32-20200110035831202.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200110035831202.png', 'pic', '27.65KB ', 'admin', '2020-01-10 15:58:31'); +INSERT INTO `local_storage` VALUES (15, 'list_32-2020011004054091.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-2020011004054091.png', 'pic', '27.65KB ', 'admin', '2020-01-10 16:05:40'); +INSERT INTO `local_storage` VALUES (16, 'list_30-20200110053337209.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-20200110053337209.png', 'pic', '28.57KB ', 'admin', '2020-01-10 17:33:37'); +INSERT INTO `local_storage` VALUES (17, 'list_32-20200110064436937.png', 'list_32', 'png', 'E:\\yshop\\file\\pic\\list_32-20200110064436937.png', 'pic', '27.65KB ', 'admin', '2020-01-10 18:44:37'); +INSERT INTO `local_storage` VALUES (18, 'list_22-20200110104217508.png', 'list_22', 'png', 'E:\\yshop\\file\\pic\\list_22-20200110104217508.png', 'pic', '28.23KB ', 'admin', '2020-01-10 22:42:18'); +INSERT INTO `local_storage` VALUES (19, 'list_18-20200111051038569.png', 'list_18', 'png', 'E:\\yshop\\file\\pic\\list_18-20200111051038569.png', 'pic', '29.62KB ', '15136175246', '2020-01-11 17:10:39'); +INSERT INTO `local_storage` VALUES (20, 'list_30-2020011105115469.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-2020011105115469.png', 'pic', '28.57KB ', '15136175246', '2020-01-11 17:11:54'); +INSERT INTO `local_storage` VALUES (21, 'list_30-20200111051343335.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-20200111051343335.png', 'pic', '28.57KB ', '15136175246', '2020-01-11 17:13:43'); +INSERT INTO `local_storage` VALUES (22, 'list_16-20200111051622984.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200111051622984.png', 'pic', '28.93KB ', '15136175246', '2020-01-11 17:16:23'); +INSERT INTO `local_storage` VALUES (23, 'list_24-20200111051630227.png', 'list_24', 'png', 'E:\\yshop\\file\\pic\\list_24-20200111051630227.png', 'pic', '27.31KB ', '15136175246', '2020-01-11 17:16:30'); +INSERT INTO `local_storage` VALUES (24, 'logo-20200131103905417.png', 'logo', 'png', 'E:\\yshop\\file\\pic\\logo-20200131103905417.png', 'pic', '48.39KB ', 'admin', '2020-01-31 10:39:05'); +INSERT INTO `local_storage` VALUES (25, 'avatar-20200131103928688.png', 'avatar', 'png', 'E:\\yshop\\file\\pic\\avatar-20200131103928688.png', 'pic', '1.82KB ', 'admin', '2020-01-31 10:39:29'); +INSERT INTO `local_storage` VALUES (26, 'list_13-2020013110394473.png', 'list_13', 'png', 'E:\\yshop\\file\\pic\\list_13-2020013110394473.png', 'pic', '23.05KB ', 'admin', '2020-01-31 10:39:44'); +INSERT INTO `local_storage` VALUES (27, 'list_18-2020013110394988.png', 'list_18', 'png', 'E:\\yshop\\file\\pic\\list_18-2020013110394988.png', 'pic', '29.62KB ', 'admin', '2020-01-31 10:39:49'); +INSERT INTO `local_storage` VALUES (28, 'list_22-20200131103952926.png', 'list_22', 'png', 'E:\\yshop\\file\\pic\\list_22-20200131103952926.png', 'pic', '28.23KB ', 'admin', '2020-01-31 10:39:53'); +INSERT INTO `local_storage` VALUES (29, 'list_26-20200131103956836.png', 'list_26', 'png', 'E:\\yshop\\file\\pic\\list_26-20200131103956836.png', 'pic', '28.36KB ', 'admin', '2020-01-31 10:39:57'); +INSERT INTO `local_storage` VALUES (30, 'list_28-20200131104001169.png', 'list_28', 'png', 'E:\\yshop\\file\\pic\\list_28-20200131104001169.png', 'pic', '28.38KB ', 'admin', '2020-01-31 10:40:01'); +INSERT INTO `local_storage` VALUES (31, 'list_16-20200207061544740.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200207061544740.png', 'pic', '28.93KB ', 'hupeng', '2020-02-07 18:15:45'); +INSERT INTO `local_storage` VALUES (32, 'list_30-2020020706162996.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-2020020706162996.png', 'pic', '28.57KB ', 'hupeng', '2020-02-07 18:16:29'); +INSERT INTO `local_storage` VALUES (33, 'list_16-20200207061714702.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200207061714702.png', 'pic', '28.93KB ', 'hupeng', '2020-02-07 18:17:15'); +INSERT INTO `local_storage` VALUES (34, 'list_18-20200207061743361.png', 'list_18', 'png', 'E:\\yshop\\file\\pic\\list_18-20200207061743361.png', 'pic', '29.62KB ', 'hupeng', '2020-02-07 18:17:43'); +INSERT INTO `local_storage` VALUES (35, 'list_30-20200207062920744.png', 'list_30', 'png', 'E:\\yshop\\file\\pic\\list_30-20200207062920744.png', 'pic', '28.57KB ', 'hupeng', '2020-02-07 18:29:21'); +INSERT INTO `local_storage` VALUES (36, '05ea40b831858a8cf423aa709840507c-20200228083801500.png', '05ea40b831858a8cf423aa709840507c', 'png', 'E:\\yshop\\file\\pic\\05ea40b831858a8cf423aa709840507c-20200228083801500.png', 'pic', '5.19KB ', 'admin', '2020-02-28 20:38:02'); +INSERT INTO `local_storage` VALUES (37, '05ea40b831858a8cf423aa709840507c-20200311043711341.png', '05ea40b831858a8cf423aa709840507c', 'png', 'E:\\yshop\\file\\pic\\05ea40b831858a8cf423aa709840507c-20200311043711341.png', 'pic', '5.19KB ', 'admin', '2020-03-11 16:37:11'); +INSERT INTO `local_storage` VALUES (38, '秒杀-2020031104371672.png', '秒杀', 'png', 'E:\\yshop\\file\\pic\\秒杀-2020031104371672.png', 'pic', '6.07KB ', 'admin', '2020-03-11 16:37:16'); +INSERT INTO `local_storage` VALUES (39, '砍价-20200311043720679.png', '砍价', 'png', 'E:\\yshop\\file\\pic\\砍价-20200311043720679.png', 'pic', '6.13KB ', 'admin', '2020-03-11 16:37:21'); +INSERT INTO `local_storage` VALUES (40, '优惠券-20200311043724709.png', '优惠券', 'png', 'E:\\yshop\\file\\pic\\优惠券-20200311043724709.png', 'pic', '5.45KB ', 'admin', '2020-03-11 16:37:25'); +INSERT INTO `local_storage` VALUES (41, '资讯-20200311043727918.png', '资讯', 'png', 'E:\\yshop\\file\\pic\\资讯-20200311043727918.png', 'pic', '5.19KB ', 'admin', '2020-03-11 16:37:28'); +INSERT INTO `local_storage` VALUES (42, 'list_16-20200322071324803.png', 'list_16', 'png', 'E:\\yshop\\file\\pic\\list_16-20200322071324803.png', 'pic', '28.93KB ', 'admin', '2020-03-22 19:13:25'); +INSERT INTO `local_storage` VALUES (43, 'list_22-20200322071348844.png', 'list_22', 'png', 'E:\\yshop\\file\\pic\\list_22-20200322071348844.png', 'pic', '28.23KB ', 'admin', '2020-03-22 19:13:49'); +INSERT INTO `local_storage` VALUES (44, 'list_34-2020032207154023.png', 'list_34', 'png', 'E:\\yshop\\file\\pic\\list_34-2020032207154023.png', 'pic', '27.05KB ', 'admin', '2020-03-22 19:15:40'); +INSERT INTO `local_storage` VALUES (45, '钻石-20200328094531898.jpg', '钻石', 'jpg', 'E:\\yshop\\file\\pic\\钻石-20200328094531898.jpg', 'pic', '32.42KB ', 'admin', '2020-03-28 21:45:32'); + +-- ---------------------------- +-- Table structure for log +-- ---------------------------- +DROP TABLE IF EXISTS `log`; +CREATE TABLE `log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `create_time` datetime(0) 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 '', + `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, + `browser` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `type` int(1) NULL DEFAULT 0, + `uid` bigint(20) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 416611 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统日志' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for menu +-- ---------------------------- +DROP TABLE IF EXISTS `menu`; +CREATE TABLE `menu` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `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' COMMENT '缓存', + `hidden` bit(1) NULL DEFAULT b'0' COMMENT '是否隐藏', + `component_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '-' COMMENT '组件名称', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + `permission` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限', + `type` int(11) NULL DEFAULT NULL COMMENT '类型', + PRIMARY KEY (`id`) USING BTREE, + INDEX `FKqcf9gem97gqa5qjm4d3elcqt5`(`pid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 184 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of menu +-- ---------------------------- +INSERT INTO `menu` VALUES (1, b'0', '系统管理', NULL, 0, 99, 'system', 'system', b'0', b'0', NULL, '2018-12-18 15:11:29', NULL, 1); +INSERT INTO `menu` VALUES (2, b'0', '用户管理', 'system/user/index', 1, 2, 'peoples', 'user', b'0', b'0', 'User', '2018-12-18 15:14:44', NULL, 1); +INSERT INTO `menu` VALUES (3, b'0', '角色管理', 'system/role/index', 1, 3, 'role', 'role', b'0', b'0', 'Role', '2018-12-18 15:16:07', NULL, 1); +INSERT INTO `menu` VALUES (5, b'0', '菜单管理', 'system/menu/index', 1, 5, 'menu', 'menu', b'0', b'0', 'Menu', '2018-12-18 15:17:28', 'admin,menu:list,roles:list', 1); +INSERT INTO `menu` VALUES (6, b'0', '系统监控', NULL, 0, 100, 'monitor', 'monitor', b'0', b'0', NULL, '2018-12-18 15:17:48', NULL, 1); +INSERT INTO `menu` VALUES (7, b'0', '操作日志', 'monitor/log/index', 6, 11, 'log', 'logs', b'1', b'0', 'Log', '2018-12-18 15:18:26', NULL, 1); +INSERT INTO `menu` VALUES (9, b'0', 'SQL监控', 'monitor/sql/index', 6, 14, 'sqlMonitor', 'druid', b'0', b'0', 'Sql', '2018-12-18 15:19:34', NULL, 1); +INSERT INTO `menu` VALUES (14, b'0', '邮件工具', 'tools/email/index', 36, 24, 'email', 'email', b'0', b'0', 'Email', '2018-12-27 10:13:09', NULL, 1); +INSERT INTO `menu` VALUES (16, b'0', '图床管理', 'tools/picture/index', 36, 25, 'image', 'pictures', b'0', b'0', 'Pictures', '2018-12-28 09:36:53', 'pictures:list', 1); +INSERT INTO `menu` VALUES (18, b'0', '存储管理', 'tools/storage/index', 36, 23, 'qiniu', 'storage', b'0', b'0', 'Storage', '2018-12-31 11:12:15', 'storage:list', 1); +INSERT INTO `menu` VALUES (19, b'0', '支付宝工具', 'tools/aliPay/index', 36, 27, 'alipay', 'aliPay', b'0', b'0', 'AliPay', '2018-12-31 14:52:38', NULL, 1); +INSERT INTO `menu` VALUES (28, b'0', '定时任务', 'system/timing/index', 36, 21, 'timing', 'timing', b'0', b'0', 'Timing', '2019-01-07 20:34:40', 'timing:list', 1); +INSERT INTO `menu` VALUES (30, b'0', '代码生成', 'generator/index', 36, 22, 'dev', 'generator', b'0', b'0', 'GeneratorIndex', '2019-01-11 15:45:55', NULL, 1); +INSERT INTO `menu` VALUES (32, b'0', '异常日志', 'monitor/log/errorLog', 6, 12, 'error', 'errorLog', b'0', b'0', 'ErrorLog', '2019-01-13 13:49:03', NULL, 1); +INSERT INTO `menu` VALUES (35, b'0', '部门管理', 'system/dept/index', 1, 6, 'dept', 'dept', b'0', b'0', 'Dept', '2019-03-25 09:46:00', NULL, 1); +INSERT INTO `menu` VALUES (36, b'0', '系统工具', '', 0, 101, 'sys-tools', 'sys-tools', b'0', b'0', NULL, '2019-03-29 10:57:35', NULL, 1); +INSERT INTO `menu` VALUES (37, b'0', '岗位管理', 'system/job/index', 1, 7, 'Steve-Jobs', 'job', b'0', b'0', 'Job', '2019-03-29 13:51:18', NULL, 1); +INSERT INTO `menu` VALUES (39, b'0', '字典管理', 'system/dict/index', 1, 8, 'dictionary', 'dict', b'0', b'0', 'Dict', '2019-04-10 11:49:04', NULL, 1); +INSERT INTO `menu` VALUES (40, b'0', '商品管理', '', 0, 1, 'shop', 'shop', b'1', b'0', '', '2019-10-03 17:40:19', NULL, 1); +INSERT INTO `menu` VALUES (41, b'0', '商品分类', 'shop/cate/index', 40, 11, 'icon', 'cate', b'0', b'0', 'Cate', '2019-10-03 17:42:35', 'YXSTORECATEGORY_SELECT', 1); +INSERT INTO `menu` VALUES (45, b'0', '管理商品', 'shop/goods/tab', 40, 12, 'develop', 'goods', b'1', b'0', 'Goods', '2019-10-04 15:34:35', 'YXSTOREPRODUCT_SELECT', 1); +INSERT INTO `menu` VALUES (46, b'0', '会员管理', '', 0, 2, 'peoples', 'member', b'0', b'0', '', '2019-10-06 16:18:05', NULL, 1); +INSERT INTO `menu` VALUES (47, b'0', '会员', 'shop/user/index', 46, 21, 'peoples', 'member', b'0', b'0', 'Member', '2019-10-06 16:20:17', 'YXUSER_SELECT', 1); +INSERT INTO `menu` VALUES (48, b'0', '微信管理', '', 0, 3, 'weixin', 'wechat', b'0', b'0', '', '2019-10-06 18:28:54', NULL, 1); +INSERT INTO `menu` VALUES (49, b'0', '微信菜单', 'wechat/menu/index', 48, 31, 'menu', 'wemenu', b'0', b'0', 'WeMenu', '2019-10-06 18:31:06', NULL, 1); +INSERT INTO `menu` VALUES (50, b'0', '图文管理', 'wechat/article/index', 48, 32, 'article', 'wearticle', b'0', b'0', 'WeArticle', '2019-10-07 17:33:45', NULL, 1); +INSERT INTO `menu` VALUES (51, b'0', '自动回复', 'wechat/reply/index', 48, 33, 'reply', 'wereply', b'0', b'0', 'Wereply', '2019-10-10 09:58:31', NULL, 1); +INSERT INTO `menu` VALUES (52, b'0', '公众号配置', 'wechat/config/index', 48, 34, 'configure', 'weconfig', b'0', b'0', 'WeConfig', '2019-10-10 15:52:24', NULL, 1); +INSERT INTO `menu` VALUES (53, b'0', '订单管理', '', 0, 4, 'lock', 'order', b'0', b'0', '', '2019-10-14 14:35:18', NULL, 1); +INSERT INTO `menu` VALUES (54, b'0', '订单', 'shop/order/index', 53, 41, 'order', 'order', b'0', b'0', 'Order', '2019-10-14 14:36:28', 'YXSTOREORDER_SELECT', 1); +INSERT INTO `menu` VALUES (55, b'0', '商城配置', '', 0, 5, 'configure', 'set', b'0', b'0', '', '2019-10-18 15:21:26', NULL, 1); +INSERT INTO `menu` VALUES (56, b'0', '首页幻灯片', 'shop/set/index', 55, 51, 'banner', 'homeBanner', b'0', b'0', 'HomeBanner', '2019-10-18 15:24:30', NULL, 1); +INSERT INTO `menu` VALUES (57, b'0', '首页导航按钮', 'shop/set/menu', 55, 52, 'button', 'homeMenus', b'0', b'0', 'HomeMenus', '2019-10-18 17:23:35', NULL, 1); +INSERT INTO `menu` VALUES (59, b'0', '首页滚动新闻', 'shop/set/roll', 55, 54, 'news', 'roll', b'0', b'0', 'Roll', '2019-10-21 16:41:30', NULL, 1); +INSERT INTO `menu` VALUES (60, b'0', '热门搜索', 'shop/set/hot', 55, 55, 'search', 'hot', b'0', b'0', 'Hot', '2019-10-26 18:21:54', NULL, 1); +INSERT INTO `menu` VALUES (61, b'0', '个人中心菜单', 'shop/set/usermenu', 55, 56, 'menu', 'userMenu', b'0', b'0', 'UserMenu', '2019-10-26 18:42:18', NULL, 1); +INSERT INTO `menu` VALUES (62, b'0', '评论管理', 'shop/reply/index', 53, 42, 'comment', 'reply', b'0', b'0', 'Reply', '2019-11-03 14:39:09', 'YXSTOREPRODUCTREPLY_SELECT', 1); +INSERT INTO `menu` VALUES (63, b'0', '营销管理', '', 0, 6, 'yingxiao', 'activity', b'0', b'0', '', '2019-11-09 14:17:42', NULL, 1); +INSERT INTO `menu` VALUES (64, b'0', '优惠券制作', 'activity/coupon/index', 63, 61, 'coupon', 'coupon', b'0', b'0', 'Coupon', '2019-11-09 14:18:58', 'YXSTORECOUPON_SELECT', 1); +INSERT INTO `menu` VALUES (65, b'0', '已发布优惠券', 'activity/couponissue/index', 63, 62, 'coupon2', 'couponissue', b'0', b'0', 'Couponissue', '2019-11-09 14:20:35', 'YXSTORECOUPONISSUE_SELECT', 1); +INSERT INTO `menu` VALUES (66, b'0', '优惠券领取记录', 'activity/storecouponuser/index', 63, 63, 'log', 'couponuser', b'0', b'0', 'Couponuser', '2019-11-09 14:21:35', NULL, 1); +INSERT INTO `menu` VALUES (67, b'0', '优惠券配置', 'activity/coupon/set', 63, 64, 'log', 'couponset', b'0', b'1', 'Couponset', '2019-11-09 14:22:17', NULL, 1); +INSERT INTO `menu` VALUES (68, b'0', '积分配置', 'wechat/config/point', 55, 59, 'configure', 'pointConfig', b'0', b'0', 'PointConfig', '2019-11-10 18:45:55', NULL, 1); +INSERT INTO `menu` VALUES (69, b'0', '分销管理', '', 0, 7, 'fenxiao', 'promoter', b'0', b'0', '', '2019-11-11 10:42:16', NULL, 1); +INSERT INTO `menu` VALUES (70, b'0', '分销配置', 'wechat/config/promoter', 69, 71, 'configure', 'promoterconfig', b'0', b'0', 'Promoterconfig', '2019-11-11 10:48:37', NULL, 1); +INSERT INTO `menu` VALUES (71, b'0', '分销员', 'shop/user/aindex', 69, 72, 'user', 'agent', b'0', b'0', 'Agent', '2019-11-13 18:32:00', NULL, 1); +INSERT INTO `menu` VALUES (72, b'0', '提现管理', 'activity/extract/index', 176, 81, 'tixian', 'extract', b'0', b'0', 'Extract', '2019-11-14 10:49:39', NULL, 1); +INSERT INTO `menu` VALUES (73, b'0', '拼团产品', 'activity/combination/index', 63, 64, 'peoples', 'combination', b'0', b'0', 'Combination', '2019-11-18 14:23:04', 'YXSTORECOMBINATION_SELECT', 1); +INSERT INTO `menu` VALUES (74, b'0', '拼团列表', 'activity/combinlist/index', 63, 65, 'list', 'pink', b'0', b'0', 'Pink', '2019-11-21 19:35:58', NULL, 1); +INSERT INTO `menu` VALUES (75, b'0', '微信支付配置', 'wechat/config/pay', 48, 35, 'wxpay', 'wxpayconfig', b'0', b'0', 'Wxpayconfig', '2019-11-28 17:06:22', NULL, 1); +INSERT INTO `menu` VALUES (76, b'0', '小程序配置', 'wechat/config/wxapp', 48, 36, 'configure', 'wxapp', b'0', b'0', 'Wxapp', '2019-11-29 15:13:46', NULL, 1); +INSERT INTO `menu` VALUES (77, b'0', '会员等级', 'shop/userlevel/index', 46, 22, 'dengji', 'userlevel', b'0', b'0', 'Userlevel', '2019-12-04 16:35:41', 'YXSYSTEMUSERLEVEL_SELECT', 1); +INSERT INTO `menu` VALUES (78, b'0', '等级任务', 'shop/usertask/index', 46, 23, 'task manege', 'usertask', b'0', b'0', 'Usertask', '2019-12-04 17:26:19', 'YXSYSTEMUSERTASK_SELECT', 1); +INSERT INTO `menu` VALUES (79, b'0', '签到天数配置', 'shop/set/sign', 55, 57, 'sign2', 'signday', b'0', b'0', 'Signday', '2019-12-05 14:12:16', NULL, 1); +INSERT INTO `menu` VALUES (80, b'0', '用户账单', 'shop/user/bill', 46, 24, 'list', 'bill', b'0', b'0', 'Bill', '2019-12-11 17:28:38', NULL, 1); +INSERT INTO `menu` VALUES (81, b'0', '物流快递', 'shop/express/index', 53, 43, 'express', 'express', b'0', b'0', 'Express', '2019-12-12 16:36:00', 'YXEXPRESS_SELECT', 1); +INSERT INTO `menu` VALUES (82, b'0', '微信模板消息', 'wechat/template/index', 48, 35, 'anq', 'template', b'0', b'0', 'Template', '2019-12-13 14:42:50', NULL, 1); +INSERT INTO `menu` VALUES (83, b'0', '秒杀产品', 'activity/seckill/index', 63, 66, 'seckill', 'seckill', b'0', b'0', 'Seckill', '2019-12-16 13:06:29', 'YXSTORESECKILL_SELECT', 1); +INSERT INTO `menu` VALUES (84, b'0', '秒杀配置', 'shop/set/seckill', 63, 67, 'configure', 'seckillconfig', b'0', b'0', 'Seckillconfig', '2019-12-16 16:07:42', NULL, 1); +INSERT INTO `menu` VALUES (86, b'0', '砍价产品', 'activity/bargain/index', 63, 956, 'Sign', 'bargain', b'0', b'0', 'Bargain', '2019-12-22 12:25:55', 'YXSTOREBARGAIN_SELECT', 1); +INSERT INTO `menu` VALUES (87, b'0', '生成配置', 'generator/config', 36, 33, 'dev', 'generator/config/:tableName', b'1', b'1', 'GeneratorConfig', '2019-11-17 20:08:56', '', 1); +INSERT INTO `menu` VALUES (88, b'0', '生成预览', 'generator/preview', 36, 999, 'java', 'generator/preview/:tableName', b'1', b'1', 'Preview', '2019-11-26 14:54:36', NULL, 1); +INSERT INTO `menu` VALUES (116, b'0', '生成配置', 'generator/config', 36, 33, 'dev', 'generator/config/:tableName', b'1', b'1', 'GeneratorConfig', '2019-11-17 20:08:56', '', 1); +INSERT INTO `menu` VALUES (117, b'0', '图表库', 'components/Echarts', 10, 50, 'chart', 'echarts', b'1', b'0', 'Echarts', '2019-11-21 09:04:32', '', 1); +INSERT INTO `menu` VALUES (118, b'0', '新增', NULL, 45, 1, NULL, NULL, b'0', b'0', NULL, '2019-12-24 13:00:47', 'YXSTOREPRODUCT_EDIT', 2); +INSERT INTO `menu` VALUES (119, b'0', '修改', NULL, 45, 3, NULL, NULL, b'0', b'0', NULL, '2019-12-24 13:02:23', 'YXSTOREPRODUCT_CREATE', 2); +INSERT INTO `menu` VALUES (120, b'0', '删除', NULL, 45, 4, NULL, NULL, b'0', b'0', NULL, '2019-12-24 13:03:51', 'YXSTOREPRODUCT_DELETE', 2); +INSERT INTO `menu` VALUES (121, b'0', '在线用户', 'monitor/online/index', 6, 10, 'Steve-Jobs', 'online', b'0', b'0', 'OnlineUser', '2020-01-06 22:46:43', NULL, 1); +INSERT INTO `menu` VALUES (122, b'0', '浏览记录', 'monitor/log/mlog', 40, 13, 'log', 'viewlog', b'0', b'0', 'Viewlog', '2020-01-07 13:17:21', NULL, 1); +INSERT INTO `menu` VALUES (123, b'0', '后台接口文档', 'tools/swagger/index', 36, 31, 'swagger', 'swagger2', b'0', b'0', 'Swagger', '2020-01-07 18:05:52', NULL, 1); +INSERT INTO `menu` VALUES (124, b'0', '在线会员', 'monitor/online/indext', 46, 25, 'Steve-Jobs', 'onlinet', b'0', b'0', 'OnlineMember', '2020-01-13 10:53:07', NULL, 1); +INSERT INTO `menu` VALUES (125, b'0', '邮费配置', 'wechat/config/postage', 55, 58, 'configure', 'postageConfig', b'0', b'0', 'PostageConfig', '2020-02-13 15:38:24', NULL, 1); +INSERT INTO `menu` VALUES (126, b'0', '编辑', NULL, 54, 1, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:05:28', 'YXSTOREORDER_EDIT', 2); +INSERT INTO `menu` VALUES (127, b'0', '用户新增', NULL, 2, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:12:21', 'user:add', 2); +INSERT INTO `menu` VALUES (128, b'0', '用户编辑', NULL, 2, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:12:47', 'user:edit', 2); +INSERT INTO `menu` VALUES (129, b'0', '用户删除', NULL, 2, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:13:08', 'user:del', 2); +INSERT INTO `menu` VALUES (130, b'0', '角色创建', NULL, 3, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:13:49', 'roles:add', 2); +INSERT INTO `menu` VALUES (131, b'0', '角色修改', NULL, 3, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:14:11', 'roles:edit', 2); +INSERT INTO `menu` VALUES (132, b'0', '角色删除', NULL, 3, 999, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:14:38', '4', 2); +INSERT INTO `menu` VALUES (133, b'0', '菜单新增', NULL, 5, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:15:05', 'menu:add', 2); +INSERT INTO `menu` VALUES (134, b'0', '菜单编辑', NULL, 5, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:18:44', 'menu:edit', 2); +INSERT INTO `menu` VALUES (135, b'0', '菜单删除', NULL, 5, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:19:05', 'menu:del', 2); +INSERT INTO `menu` VALUES (136, b'0', '部门新增', NULL, 35, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:21:07', 'dept:add', 2); +INSERT INTO `menu` VALUES (137, b'0', '部门编辑', NULL, 35, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:21:33', 'dept:edit', 2); +INSERT INTO `menu` VALUES (138, b'0', '部门删除', NULL, 35, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:21:53', 'dept:del', 2); +INSERT INTO `menu` VALUES (139, b'0', '岗位新增', NULL, 37, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:29:04', 'job:add', 2); +INSERT INTO `menu` VALUES (140, b'0', '岗位编辑', NULL, 37, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:48:38', 'job:edit', 2); +INSERT INTO `menu` VALUES (141, b'0', '岗位删除', NULL, 37, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:49:00', 'job:del', 2); +INSERT INTO `menu` VALUES (142, b'0', '字典新增', NULL, 39, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:49:26', 'dict:add', 2); +INSERT INTO `menu` VALUES (143, b'0', '字典编辑', NULL, 39, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:49:39', 'dict:edit', 2); +INSERT INTO `menu` VALUES (144, b'0', '字典删除', NULL, 39, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:49:56', 'dict:del', 2); +INSERT INTO `menu` VALUES (145, b'0', '图片上传', NULL, 16, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:52:31', 'pictures:add', 2); +INSERT INTO `menu` VALUES (146, b'0', '图片删除', NULL, 16, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:52:56', 'pictures:del', 2); +INSERT INTO `menu` VALUES (147, b'0', '上传文件', NULL, 18, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:53:49', 'storage:add', 2); +INSERT INTO `menu` VALUES (148, b'0', '文件编辑', NULL, 18, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:54:06', 'storage:edit', 2); +INSERT INTO `menu` VALUES (149, b'0', '文件删除', NULL, 18, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:54:27', 'storage:del', 2); +INSERT INTO `menu` VALUES (150, b'0', '任务新增', NULL, 28, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:55:58', 'timing:add', 2); +INSERT INTO `menu` VALUES (151, b'0', '任务编辑', NULL, 28, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:56:54', 'timing:edit', 2); +INSERT INTO `menu` VALUES (152, b'0', '任务删除', NULL, 28, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 21:57:10', 'timing:del', 2); +INSERT INTO `menu` VALUES (153, b'0', '新增分类', NULL, 41, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:00:41', 'YXSTORECATEGORY_CREATE', 2); +INSERT INTO `menu` VALUES (154, b'0', '分类编辑', NULL, 41, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:01:15', 'YXSTORECATEGORY_EDIT', 2); +INSERT INTO `menu` VALUES (155, b'0', '分类删除', NULL, 41, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:01:37', 'YXSTORECATEGORY_DELETE', 2); +INSERT INTO `menu` VALUES (156, b'0', '修改会员', NULL, 47, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:03:40', 'YXUSER_EDIT', 2); +INSERT INTO `menu` VALUES (157, b'0', '等级新增', NULL, 77, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:06:55', 'YXSYSTEMUSERLEVEL_CREATE', 2); +INSERT INTO `menu` VALUES (158, b'0', '等级编辑', NULL, 77, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:08:03', 'YXSYSTEMUSERLEVEL_EDIT', 2); +INSERT INTO `menu` VALUES (159, b'0', '等级删除', NULL, 77, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:08:41', 'YXSYSTEMUSERLEVEL_DELETE', 2); +INSERT INTO `menu` VALUES (160, b'0', '编辑任务', NULL, 78, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:10:08', 'YXSYSTEMUSERTASK_EDIT', 2); +INSERT INTO `menu` VALUES (161, b'0', '评论删除', NULL, 62, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:14:22', 'YXSTOREPRODUCTREPLY_DELETE', 2); +INSERT INTO `menu` VALUES (162, b'0', '新增物流', NULL, 81, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:15:33', 'YXEXPRESS_CREATE', 2); +INSERT INTO `menu` VALUES (163, b'0', '编辑物流', NULL, 81, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:15:53', 'YXEXPRESS_EDIT', 2); +INSERT INTO `menu` VALUES (164, b'0', '删除物流', NULL, 81, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:16:11', 'YXEXPRESS_DELETE', 2); +INSERT INTO `menu` VALUES (165, b'0', '新增优惠券', NULL, 64, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:18:32', 'YXSTORECOUPON_CREATE', 2); +INSERT INTO `menu` VALUES (166, b'0', '编辑优惠券', NULL, 64, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:18:50', 'YXSTORECOUPON_EDIT', 2); +INSERT INTO `menu` VALUES (167, b'0', '删除优惠券', NULL, 64, 4, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:19:10', 'YXSTORECOUPON_DELETE', 2); +INSERT INTO `menu` VALUES (168, b'0', '编辑已发布', NULL, 65, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:20:23', 'YXSTORECOUPONISSUE_EDIT', 2); +INSERT INTO `menu` VALUES (169, b'0', '删除已发布', NULL, 65, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:20:42', 'YXSTORECOUPONISSUE_DELETE', 2); +INSERT INTO `menu` VALUES (170, b'0', '编辑拼团', NULL, 73, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:24:15', 'YXSTORECOMBINATION_EDIT', 2); +INSERT INTO `menu` VALUES (171, b'0', '删除拼团', NULL, 73, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:24:37', 'YXSTORECOMBINATION_DELETE', 2); +INSERT INTO `menu` VALUES (172, b'0', '编辑秒杀', NULL, 83, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:25:23', 'YXSTORESECKILL_EDIT', 2); +INSERT INTO `menu` VALUES (173, b'0', '删除秒杀', NULL, 83, 3, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:25:41', 'YXSTORESECKILL_DELETE', 2); +INSERT INTO `menu` VALUES (174, b'0', '编辑砍价', NULL, 86, 2, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:26:20', 'YXSTOREBARGAIN_EDIT', 2); +INSERT INTO `menu` VALUES (175, b'0', '删除砍价', NULL, 86, 999, NULL, NULL, b'0', b'0', NULL, '2020-02-14 22:26:40', 'YXSTOREBARGAIN_DELETE', 2); +INSERT INTO `menu` VALUES (176, b'0', '财务管理', NULL, 0, 8, 'price', 'price', b'0', b'0', NULL, '2020-03-02 22:30:23', NULL, 1); +INSERT INTO `menu` VALUES (177, b'0', '充值管理', 'shop/recharge/index', 176, 82, 'rec', 'recharge', b'0', b'0', 'Recharge', '2020-03-02 23:05:26', NULL, 1); +INSERT INTO `menu` VALUES (178, b'0', '门店管理', NULL, 0, 9, 'store', 'store', b'0', b'0', NULL, '2020-03-03 17:27:53', NULL, 1); +INSERT INTO `menu` VALUES (179, b'0', '门店列表', 'shop/store/index', 178, 92, 'edit', 'storeinfo', b'0', b'0', 'Storeinfo', '2020-03-03 17:29:09', NULL, 1); +INSERT INTO `menu` VALUES (180, b'0', '门店配置', 'shop/store/set', 178, 91, 'configure', 'storeset', b'0', b'0', 'Storeset', '2020-03-04 13:09:54', NULL, 1); +INSERT INTO `menu` VALUES (181, b'0', '核销订单', 'shop/order/indext', 178, 95, 'order', 'ordert', b'0', b'0', 'Ordert', '2020-03-05 17:04:12', NULL, 1); +INSERT INTO `menu` VALUES (182, b'0', '充值金额配置', 'shop/set/recharge', 55, 60, 'money', 'rechargeset', b'0', b'0', 'Rechargeset', '2020-03-21 14:24:05', NULL, 1); +INSERT INTO `menu` VALUES (183, b'0', '店员列表', 'shop/storestaff/index', 178, 94, 'peoples', 'staff', b'0', b'0', 'Staff', '2020-03-22 14:11:36', NULL, 1); + +-- ---------------------------- +-- Table structure for mnt_app +-- ---------------------------- +DROP TABLE IF EXISTS `mnt_app`; +CREATE TABLE `mnt_app` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '应用ID', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应用名称', + `upload_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上传目录', + `deploy_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部署路径', + `backup_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备份路径', + `port` int(255) NULL DEFAULT NULL COMMENT '应用端口', + `start_script` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '启动脚本', + `deploy_script` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部署脚本', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '应用管理' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for mnt_database +-- ---------------------------- +DROP TABLE IF EXISTS `mnt_database`; +CREATE TABLE `mnt_database` ( + `id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编号', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称', + `jdbc_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'jdbc连接', + `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账号', + `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码', + `create_time` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据库管理' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for mnt_deploy +-- ---------------------------- +DROP TABLE IF EXISTS `mnt_deploy`; +CREATE TABLE `mnt_deploy` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', + `app_id` bigint(20) NULL DEFAULT NULL COMMENT '应用编号', + `create_time` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `FK6sy157pseoxx4fmcqr1vnvvhy`(`app_id`) USING BTREE, + CONSTRAINT `FK6sy157pseoxx4fmcqr1vnvvhy` FOREIGN KEY (`app_id`) REFERENCES `mnt_app` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部署管理' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for mnt_deploy_history +-- ---------------------------- +DROP TABLE IF EXISTS `mnt_deploy_history`; +CREATE TABLE `mnt_deploy_history` ( + `id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编号', + `app_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '应用名称', + `deploy_date` datetime(0) NOT NULL COMMENT '部署日期', + `deploy_user` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '部署用户', + `ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '服务器IP', + `deploy_id` bigint(20) NULL DEFAULT NULL COMMENT '部署编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部署历史管理' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for mnt_deploy_server +-- ---------------------------- +DROP TABLE IF EXISTS `mnt_deploy_server`; +CREATE TABLE `mnt_deploy_server` ( + `deploy_id` bigint(20) NOT NULL, + `server_id` bigint(20) NOT NULL, + PRIMARY KEY (`deploy_id`, `server_id`) USING BTREE, + INDEX `FKeaaha7jew9a02b3bk9ghols53`(`server_id`) USING BTREE, + CONSTRAINT `FK3cehr56tedph6nk3gxsmeq0pb` FOREIGN KEY (`deploy_id`) REFERENCES `mnt_deploy` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `FKeaaha7jew9a02b3bk9ghols53` FOREIGN KEY (`server_id`) REFERENCES `mnt_server` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '应用与服务器关联' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for mnt_server +-- ---------------------------- +DROP TABLE IF EXISTS `mnt_server`; +CREATE TABLE `mnt_server` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'IP地址', + `account` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账号', + `ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'IP地址', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', + `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码', + `port` int(11) NULL DEFAULT NULL COMMENT '端口', + `create_time` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '服务器管理' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Table structure for monitor_server +-- ---------------------------- +DROP TABLE IF EXISTS `monitor_server`; +CREATE TABLE `monitor_server` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cpu_core` int(11) NULL DEFAULT NULL COMMENT 'CPU内核数', + `cpu_rate` double NULL DEFAULT NULL COMMENT 'CPU使用率', + `disk_total` double NULL DEFAULT NULL COMMENT '磁盘总量', + `disk_used` double NULL DEFAULT NULL COMMENT '磁盘使用量', + `mem_total` double NULL DEFAULT NULL COMMENT '内存总数', + `mem_used` double NULL DEFAULT NULL COMMENT '内存使用量', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', + `port` int(11) NULL DEFAULT NULL COMMENT '访问端口', + `sort` int(11) NULL DEFAULT NULL COMMENT '排序', + `state` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态', + `swap_total` double NULL DEFAULT NULL COMMENT '交换区总量', + `swap_used` double NULL DEFAULT NULL COMMENT '交换区使用量', + `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '服务地址', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '服务监控' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of monitor_server +-- ---------------------------- +INSERT INTO `monitor_server` VALUES (1, 8, 0.05924018, 465.12402, 91.66521, 7.849415, 7.6052284, '本地', 8777, 999, '0', 14.599415, 11.263367, 'localhost'); + +-- ---------------------------- +-- Table structure for picture +-- ---------------------------- +DROP TABLE IF EXISTS `picture`; +CREATE TABLE `picture` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `create_time` datetime(0) 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 '图片宽度', + `md5code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件的MD5值', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Sm.Ms图床' 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 COMMENT = '七牛云配置' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of qiniu_config +-- ---------------------------- +INSERT INTO `qiniu_config` VALUES (1, '111111', 'yixiang', 'https://image.dayouqiantu.cn', '22222', '公开', '华东'); + +-- ---------------------------- +-- 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(0) 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 = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '七牛云文件存储' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of qiniu_content +-- ---------------------------- +INSERT INTO `qiniu_content` VALUES (1, 'yixiang', 'list_34', '27.05KB ', '公开', '2020-01-07 12:05:41', 'https://pic.dayouqiantu.cn/list_34.png', 'png'); +INSERT INTO `qiniu_content` VALUES (2, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-07 12:11:15', 'https://pic.dayouqiantu.cn/list_32.png', 'png'); +INSERT INTO `qiniu_content` VALUES (3, 'yixiang', 'list_30', '28.57KB ', '公开', '2020-01-07 12:13:26', 'https://image.dayouqiantu.cn/list_30.png', 'png'); +INSERT INTO `qiniu_content` VALUES (4, 'yixiang', 'list_34', '27.05KB ', '公开', '2020-01-07 12:32:15', 'https://image.dayouqiantu.cn/list_34.png', 'png'); +INSERT INTO `qiniu_content` VALUES (5, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-07 12:53:11', 'https://image.dayouqiantu.cn/list_32.png', 'png'); +INSERT INTO `qiniu_content` VALUES (6, 'yixiang', 'list_34', '27.05KB ', '公开', '2020-01-07 13:05:55', 'https://image.dayouqiantu.cn/list_34.png', 'png'); +INSERT INTO `qiniu_content` VALUES (7, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-07 13:08:32', 'https://image.dayouqiantu.cn/list_32.png', 'png'); +INSERT INTO `qiniu_content` VALUES (8, 'yixiang', 'list_22', '28.23KB ', '公开', '2020-01-07 13:08:38', 'https://image.dayouqiantu.cn/list_22.png', 'png'); +INSERT INTO `qiniu_content` VALUES (9, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-07 13:08:49', 'https://image.dayouqiantu.cn/list_32.png', 'png'); +INSERT INTO `qiniu_content` VALUES (10, 'yixiang', 'list_34', '27.05KB ', '公开', '2020-01-10 12:02:24', 'https://image.dayouqiantu.cn/list_34.png', 'png'); +INSERT INTO `qiniu_content` VALUES (11, 'yixiang', 'list_32', '27.65KB ', '公开', '2020-01-10 16:49:48', 'https://image.dayouqiantu.cn/list_32.png', 'png'); +INSERT INTO `qiniu_content` VALUES (12, 'yixiang', 'list_20', '22.92KB ', '公开', '2020-01-10 22:43:47', 'https://image.dayouqiantu.cn/list_20.png', 'png'); +INSERT INTO `qiniu_content` VALUES (13, 'yixiang', 'list_24', '27.31KB ', '公开', '2020-01-10 22:44:21', 'https://image.dayouqiantu.cn/list_24.png', 'png'); +INSERT INTO `qiniu_content` VALUES (14, 'yixiang', 'list_28', '28.38KB ', '公开', '2020-01-11 17:06:00', 'https://image.dayouqiantu.cn/list_28.png', 'png'); + +-- ---------------------------- +-- 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 '备注', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务' 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(0) 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 = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务日志' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of quartz_log +-- ---------------------------- +INSERT INTO `quartz_log` VALUES (1, 'visitsTask', '2020-01-10 00:00:00', '0 0 0 * * ?', NULL, b'1', '更新访客记录', 'run', NULL, 160); +INSERT INTO `quartz_log` VALUES (2, 'visitsTask', '2020-03-10 00:00:00', '0 0 0 * * ?', NULL, b'1', '更新访客记录', 'run', NULL, 42); +INSERT INTO `quartz_log` VALUES (3, 'visitsTask', '2020-04-02 00:00:00', '0 0 0 * * ?', NULL, b'1', '更新访客记录', 'run', NULL, 60); + +-- ---------------------------- +-- Table structure for role +-- ---------------------------- +DROP TABLE IF EXISTS `role`; +CREATE TABLE `role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `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 COMMENT '数据权限', + `level` int(255) NULL DEFAULT NULL COMMENT '角色级别', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + `permission` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '功能权限', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of role +-- ---------------------------- +INSERT INTO `role` VALUES (1, '超级管理员', '-', '全部', 1, '2018-11-23 11:04:37', 'admin'); +INSERT INTO `role` VALUES (2, '普通用户', '-', '本级', 2, '2018-11-23 13:09:06', 'common'); +INSERT INTO `role` VALUES (3, '管理员2', '222', '全部', 3, '2020-01-31 16:53:25', '22'); + +-- ---------------------------- +-- 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 COMMENT = '角色部门关联' ROW_FORMAT = Compact; + +-- ---------------------------- +-- 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 COMMENT = '角色菜单关联' 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 (5, 1); +INSERT INTO `roles_menus` VALUES (6, 1); +INSERT INTO `roles_menus` VALUES (7, 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 (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 (40, 1); +INSERT INTO `roles_menus` VALUES (41, 1); +INSERT INTO `roles_menus` VALUES (44, 1); +INSERT INTO `roles_menus` VALUES (45, 1); +INSERT INTO `roles_menus` VALUES (46, 1); +INSERT INTO `roles_menus` VALUES (47, 1); +INSERT INTO `roles_menus` VALUES (48, 1); +INSERT INTO `roles_menus` VALUES (49, 1); +INSERT INTO `roles_menus` VALUES (50, 1); +INSERT INTO `roles_menus` VALUES (51, 1); +INSERT INTO `roles_menus` VALUES (52, 1); +INSERT INTO `roles_menus` VALUES (53, 1); +INSERT INTO `roles_menus` VALUES (54, 1); +INSERT INTO `roles_menus` VALUES (55, 1); +INSERT INTO `roles_menus` VALUES (56, 1); +INSERT INTO `roles_menus` VALUES (57, 1); +INSERT INTO `roles_menus` VALUES (58, 1); +INSERT INTO `roles_menus` VALUES (59, 1); +INSERT INTO `roles_menus` VALUES (60, 1); +INSERT INTO `roles_menus` VALUES (61, 1); +INSERT INTO `roles_menus` VALUES (62, 1); +INSERT INTO `roles_menus` VALUES (63, 1); +INSERT INTO `roles_menus` VALUES (64, 1); +INSERT INTO `roles_menus` VALUES (65, 1); +INSERT INTO `roles_menus` VALUES (66, 1); +INSERT INTO `roles_menus` VALUES (67, 1); +INSERT INTO `roles_menus` VALUES (68, 1); +INSERT INTO `roles_menus` VALUES (69, 1); +INSERT INTO `roles_menus` VALUES (70, 1); +INSERT INTO `roles_menus` VALUES (71, 1); +INSERT INTO `roles_menus` VALUES (72, 1); +INSERT INTO `roles_menus` VALUES (73, 1); +INSERT INTO `roles_menus` VALUES (74, 1); +INSERT INTO `roles_menus` VALUES (75, 1); +INSERT INTO `roles_menus` VALUES (76, 1); +INSERT INTO `roles_menus` VALUES (77, 1); +INSERT INTO `roles_menus` VALUES (78, 1); +INSERT INTO `roles_menus` VALUES (79, 1); +INSERT INTO `roles_menus` VALUES (80, 1); +INSERT INTO `roles_menus` VALUES (81, 1); +INSERT INTO `roles_menus` VALUES (82, 1); +INSERT INTO `roles_menus` VALUES (83, 1); +INSERT INTO `roles_menus` VALUES (84, 1); +INSERT INTO `roles_menus` VALUES (86, 1); +INSERT INTO `roles_menus` VALUES (87, 1); +INSERT INTO `roles_menus` VALUES (88, 1); +INSERT INTO `roles_menus` VALUES (116, 1); +INSERT INTO `roles_menus` VALUES (118, 1); +INSERT INTO `roles_menus` VALUES (119, 1); +INSERT INTO `roles_menus` VALUES (120, 1); +INSERT INTO `roles_menus` VALUES (121, 1); +INSERT INTO `roles_menus` VALUES (122, 1); +INSERT INTO `roles_menus` VALUES (123, 1); +INSERT INTO `roles_menus` VALUES (124, 1); +INSERT INTO `roles_menus` VALUES (125, 1); +INSERT INTO `roles_menus` VALUES (176, 1); +INSERT INTO `roles_menus` VALUES (177, 1); +INSERT INTO `roles_menus` VALUES (178, 1); +INSERT INTO `roles_menus` VALUES (179, 1); +INSERT INTO `roles_menus` VALUES (180, 1); +INSERT INTO `roles_menus` VALUES (181, 1); +INSERT INTO `roles_menus` VALUES (182, 1); +INSERT INTO `roles_menus` VALUES (183, 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 (5, 2); +INSERT INTO `roles_menus` VALUES (6, 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 (18, 2); +INSERT INTO `roles_menus` VALUES (19, 2); +INSERT INTO `roles_menus` VALUES (21, 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 (40, 2); +INSERT INTO `roles_menus` VALUES (41, 2); +INSERT INTO `roles_menus` VALUES (44, 2); +INSERT INTO `roles_menus` VALUES (45, 2); +INSERT INTO `roles_menus` VALUES (48, 2); +INSERT INTO `roles_menus` VALUES (49, 2); +INSERT INTO `roles_menus` VALUES (50, 2); +INSERT INTO `roles_menus` VALUES (53, 2); +INSERT INTO `roles_menus` VALUES (54, 2); +INSERT INTO `roles_menus` VALUES (77, 2); +INSERT INTO `roles_menus` VALUES (78, 2); +INSERT INTO `roles_menus` VALUES (79, 2); +INSERT INTO `roles_menus` VALUES (118, 2); +INSERT INTO `roles_menus` VALUES (119, 2); +INSERT INTO `roles_menus` VALUES (126, 2); +INSERT INTO `roles_menus` VALUES (154, 2); + +-- ---------------------------- +-- 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 '头像', + `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 '用户名', + `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门名称', + `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `job_id` bigint(20) NULL DEFAULT NULL COMMENT '岗位名称', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', + `last_password_reset_time` datetime(0) NULL DEFAULT NULL COMMENT '最后修改密码的日期', + `nick_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `sex` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci 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 COMMENT = '系统用户' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of user +-- ---------------------------- +INSERT INTO `user` VALUES (1, NULL, 'yshop@qq.com', 1, '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', 'admin', 2, '18888888888', 11, '2018-08-23 09:11:56', '2019-05-18 17:34:21', '管理员', '男'); +INSERT INTO `user` VALUES (3, NULL, 'test@yshopnet', 1, '$2a$10$HhxyGZy.ulf3RvAwaHUGb.k.2i9PBpv4YbLMJWp8pES7pPhTyRCF.', 'test', 2, '17777777777', 12, '2018-12-27 20:05:26', '2019-04-01 09:15:24', '测试', '男'); +INSERT INTO `user` VALUES (4, NULL, 'test2@qq.com', 1, '$2a$10$IjehtV8MiXb8ni.Qz0wBteE7FjVn49cEcsSj2.ZBUqqHjnC3umSh.', 'test2', 2, '15136175247', 11, '2020-02-15 20:39:16', NULL, 'test2', '男'); +INSERT INTO `user` VALUES (5, NULL, '444@qq.com', 0, '$2a$10$f/VH35NBOBszycV9KEA1HenQ0qVjazDm8LacQU9PO.A4UizFxLMuq', 'qqqqq', 11, '15136175249', 8, '2020-02-17 11:12:01', NULL, 'eeeeee', '男'); + +-- ---------------------------- +-- 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 COMMENT '真实文件名', + `path` 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 '大小', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统用户头像' 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 COMMENT = '用户角色关联' 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 (4, 2); +INSERT INTO `users_roles` VALUES (5, 2); + +-- ---------------------------- +-- 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(0) 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 COMMENT = '验证码' 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(0) 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 = 94 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '访客记录' ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of visits +-- ---------------------------- +INSERT INTO `visits` VALUES (21, '2019-12-31 11:40:24', '2019-12-31', 2, 4, 'Tue'); +INSERT INTO `visits` VALUES (22, '2020-01-06 16:55:15', '2020-01-06', 4, 25, 'Mon'); +INSERT INTO `visits` VALUES (23, '2020-01-07 11:32:57', '2020-01-07', 4, 8, 'Tue'); +INSERT INTO `visits` VALUES (24, '2020-01-08 00:04:57', '2020-01-08', 2, 17, 'Wed'); +INSERT INTO `visits` VALUES (25, '2020-01-09 14:28:38', '2020-01-09', 3, 3, 'Thu'); +INSERT INTO `visits` VALUES (26, '2020-01-10 00:00:00', '2020-01-10', 6, 16, 'Fri'); +INSERT INTO `visits` VALUES (27, '2020-01-11 11:06:01', '2020-01-11', 1, 2, 'Sat'); +INSERT INTO `visits` VALUES (28, '2020-01-12 17:19:42', '2020-01-12', 1, 1, 'Sun'); +INSERT INTO `visits` VALUES (29, '2020-01-13 10:18:00', '2020-01-13', 1, 2, 'Mon'); +INSERT INTO `visits` VALUES (30, '2020-01-14 17:34:40', '2020-01-14', 1, 3, 'Tue'); +INSERT INTO `visits` VALUES (31, '2020-01-15 11:23:03', '2020-01-15', 1, 1, 'Wed'); +INSERT INTO `visits` VALUES (32, '2020-01-16 10:45:22', '2020-01-16', 1, 1, 'Thu'); +INSERT INTO `visits` VALUES (33, '2020-01-17 18:07:10', '2020-01-17', 1, 1, 'Fri'); +INSERT INTO `visits` VALUES (34, '2020-01-18 18:19:03', '2020-01-18', 1, 2, 'Sat'); +INSERT INTO `visits` VALUES (35, '2020-01-19 09:53:20', '2020-01-19', 1, 1, 'Sun'); +INSERT INTO `visits` VALUES (36, '2020-01-20 14:01:00', '2020-01-20', 1, 1, 'Mon'); +INSERT INTO `visits` VALUES (37, '2020-01-31 10:38:18', '2020-01-31', 1, 2, 'Fri'); +INSERT INTO `visits` VALUES (38, '2020-02-02 14:27:41', '2020-02-02', 1, 2, 'Sun'); +INSERT INTO `visits` VALUES (39, '2020-02-03 14:11:42', '2020-02-03', 1, 1, 'Mon'); +INSERT INTO `visits` VALUES (40, '2020-02-04 10:27:33', '2020-02-04', 1, 1, 'Tue'); +INSERT INTO `visits` VALUES (41, '2020-02-05 10:40:14', '2020-02-05', 1, 2, 'Wed'); +INSERT INTO `visits` VALUES (42, '2020-02-07 10:17:32', '2020-02-07', 1, 1, 'Fri'); +INSERT INTO `visits` VALUES (43, '2020-02-09 13:31:49', '2020-02-09', 1, 1, 'Sun'); +INSERT INTO `visits` VALUES (44, '2020-02-10 10:07:12', '2020-02-10', 1, 3, 'Mon'); +INSERT INTO `visits` VALUES (45, '2020-02-11 21:31:13', '2020-02-11', 1, 1, 'Tue'); +INSERT INTO `visits` VALUES (46, '2020-02-13 14:47:22', '2020-02-13', 1, 3, 'Thu'); +INSERT INTO `visits` VALUES (47, '2020-02-14 13:32:26', '2020-02-14', 3, 5, 'Fri'); +INSERT INTO `visits` VALUES (48, '2020-02-15 20:37:36', '2020-02-15', 1, 4, 'Sat'); +INSERT INTO `visits` VALUES (49, '2020-02-16 20:11:40', '2020-02-16', 1, 4, 'Sun'); +INSERT INTO `visits` VALUES (50, '2020-02-17 09:48:36', '2020-02-17', 1, 2, 'Mon'); +INSERT INTO `visits` VALUES (51, '2020-02-19 10:34:18', '2020-02-19', 1, 3, 'Wed'); +INSERT INTO `visits` VALUES (52, '2020-02-20 21:19:04', '2020-02-20', 1, 1, 'Thu'); +INSERT INTO `visits` VALUES (53, '2020-02-21 10:25:10', '2020-02-21', 1, 1, 'Fri'); +INSERT INTO `visits` VALUES (54, '2020-02-23 16:34:09', '2020-02-23', 1, 2, 'Sun'); +INSERT INTO `visits` VALUES (55, '2020-02-24 14:30:06', '2020-02-24', 1, 2, 'Mon'); +INSERT INTO `visits` VALUES (56, '2020-02-26 15:24:09', '2020-02-26', 1, 1, 'Wed'); +INSERT INTO `visits` VALUES (57, '2020-02-27 12:55:34', '2020-02-27', 2, 3, 'Thu'); +INSERT INTO `visits` VALUES (58, '2020-02-28 15:31:37', '2020-02-28', 2, 4, 'Fri'); +INSERT INTO `visits` VALUES (59, '2020-02-29 14:37:48', '2020-02-29', 2, 3, 'Sat'); +INSERT INTO `visits` VALUES (60, '2020-03-01 13:43:01', '2020-03-01', 2, 5, 'Sun'); +INSERT INTO `visits` VALUES (61, '2020-03-02 18:36:56', '2020-03-02', 2, 7, 'Mon'); +INSERT INTO `visits` VALUES (62, '2020-03-03 02:51:42', '2020-03-03', 2, 9, 'Tue'); +INSERT INTO `visits` VALUES (63, '2020-03-04 12:55:53', '2020-03-04', 1, 11, 'Wed'); +INSERT INTO `visits` VALUES (64, '2020-03-05 12:55:28', '2020-03-05', 1, 2, 'Thu'); +INSERT INTO `visits` VALUES (65, '2020-03-06 02:48:11', '2020-03-06', 2, 2, 'Fri'); +INSERT INTO `visits` VALUES (66, '2020-03-07 09:58:45', '2020-03-07', 1, 2, 'Sat'); +INSERT INTO `visits` VALUES (67, '2020-03-08 10:24:41', '2020-03-08', 1, 1, 'Sun'); +INSERT INTO `visits` VALUES (68, '2020-03-09 22:57:23', '2020-03-09', 1, 2, 'Mon'); +INSERT INTO `visits` VALUES (69, '2020-03-10 00:00:00', '2020-03-10', 1, 2, 'Tue'); +INSERT INTO `visits` VALUES (70, '2020-03-11 16:10:12', '2020-03-11', 2, 10, 'Wed'); +INSERT INTO `visits` VALUES (71, '2020-03-12 12:37:42', '2020-03-12', 1, 1, 'Thu'); +INSERT INTO `visits` VALUES (72, '2020-03-13 13:13:48', '2020-03-13', 1, 5, 'Fri'); +INSERT INTO `visits` VALUES (73, '2020-03-14 09:59:04', '2020-03-14', 1, 7, 'Sat'); +INSERT INTO `visits` VALUES (74, '2020-03-15 12:38:59', '2020-03-15', 1, 5, 'Sun'); +INSERT INTO `visits` VALUES (75, '2020-03-18 20:37:00', '2020-03-18', 1, 1, 'Wed'); +INSERT INTO `visits` VALUES (76, '2020-03-19 14:19:16', '2020-03-19', 1, 2, 'Thu'); +INSERT INTO `visits` VALUES (77, '2020-03-21 13:23:28', '2020-03-21', 1, 4, 'Sat'); +INSERT INTO `visits` VALUES (78, '2020-03-22 14:01:05', '2020-03-22', 1, 6, 'Sun'); +INSERT INTO `visits` VALUES (79, '2020-03-23 13:08:06', '2020-03-23', 1, 2, 'Mon'); +INSERT INTO `visits` VALUES (80, '2020-03-24 13:52:07', '2020-03-24', 1, 6, 'Tue'); +INSERT INTO `visits` VALUES (81, '2020-03-25 11:18:01', '2020-03-25', 1, 2, 'Wed'); +INSERT INTO `visits` VALUES (82, '2020-03-26 13:40:28', '2020-03-26', 1, 2, 'Thu'); +INSERT INTO `visits` VALUES (83, '2020-03-27 11:11:32', '2020-03-27', 1, 2, 'Fri'); +INSERT INTO `visits` VALUES (84, '2020-03-28 15:24:09', '2020-03-28', 1, 3, 'Sat'); +INSERT INTO `visits` VALUES (85, '2020-03-29 21:56:39', '2020-03-29', 1, 1, 'Sun'); +INSERT INTO `visits` VALUES (86, '2020-03-31 16:50:56', '2020-03-31', 1, 2, 'Tue'); +INSERT INTO `visits` VALUES (87, '2020-04-01 13:52:04', '2020-04-01', 1, 3, 'Wed'); +INSERT INTO `visits` VALUES (88, '2020-04-02 00:00:00', '2020-04-02', 1, 8, 'Thu'); +INSERT INTO `visits` VALUES (89, '2020-04-03 10:50:28', '2020-04-03', 1, 29, 'Fri'); +INSERT INTO `visits` VALUES (90, '2020-04-04 17:56:12', '2020-04-04', 1, 1, 'Sat'); +INSERT INTO `visits` VALUES (91, '2020-04-05 09:24:56', '2020-04-05', 1, 3, 'Sun'); +INSERT INTO `visits` VALUES (92, '2020-04-06 21:38:54', '2020-04-06', 1, 2, 'Mon'); +INSERT INTO `visits` VALUES (93, '2020-04-07 15:06:27', '2020-04-07', 1, 2, 'Tue'); + +-- ---------------------------- +-- 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 '文章简介', + `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `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 NULL DEFAULT 0 COMMENT '排序', + `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原文链接', + `status` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '状态', + `add_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '添加时间', + `hide` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否隐藏', + `admin_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '管理员id', + `mer_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '商户id', + `product_id` int(10) NULL DEFAULT 0 COMMENT '产品关联id', + `is_hot` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否热门(小程序)', + `is_banner` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否轮播图(小程序)', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章管理表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_article +-- ---------------------------- +INSERT INTO `yx_article` VALUES (2, '', 'yshop1.3版本上线了', 'yshop', 'http://localhost:8000/file/pic/list_16-20200110120838173.png', 'yshop1.3版本上线了', '

yshop1.3版本上线了

', '', '', '4', NULL, '', NULL, '2019-08-22 12:26', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `yx_article` VALUES (3, '', '333', '333', 'http://localhost:8000/file/pic/list_16-20200110120838173.png', '11111', '

11111

', '', '', '', NULL, '', NULL, '1580631108', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `yx_article` VALUES (5, '', '444', '4444', 'http://localhost:8000/file/pic/砍价-20200311043720679.png', '444', '

4444

', '', '', '', NULL, '', NULL, '2020-03-13 14:15', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `yx_article` VALUES (6, '', '555', '555', 'http://localhost:8000/file/pic/秒杀-2020031104371672.png', '555', '

555

', '', '', '5', NULL, '', NULL, '2020-03-13 14:55', NULL, NULL, NULL, NULL, NULL, NULL); + +-- ---------------------------- +-- Table structure for yx_wechat_menu +-- ---------------------------- +DROP TABLE IF EXISTS `yx_wechat_menu`; +CREATE TABLE `yx_wechat_menu` ( + `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; + +-- ---------------------------- +-- Records of yx_wechat_menu +-- ---------------------------- +INSERT INTO `yx_wechat_menu` VALUES ('wechat_menus', '[{\"subButtons\":[{\"name\":\"公众号演示\",\"type\":\"view\",\"url\":\"https://h5.dayouqiantu.cn\"}],\"name\":\"Yshop商城3\",\"type\":\"click\",\"key\":\"yshop\"},{\"subButtons\":[{\"appId\":\"wxa82b5b7fcb0ec161\",\"name\":\"小程序演示\",\"pagePath\":\"pages/index\",\"type\":\"miniprogram\",\"url\":\"pages/index\"}],\"name\":\"供货商城\",\"type\":\"click\",\"key\":\"supply\"},{\"subButtons\":[],\"name\":\"3333\",\"type\":\"click\",\"key\":\"2222\"}]', 1570435277); + +-- ---------------------------- +-- 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 = 430 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '快递公司表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_express +-- ---------------------------- +INSERT INTO `yx_express` VALUES (426, 'STO', '申通快递', 0, 0); +INSERT INTO `yx_express` VALUES (427, 'SF', '顺丰速运', 0, 0); +INSERT INTO `yx_express` VALUES (428, 'ZTO', '中通快递', 0, 0); +INSERT INTO `yx_express` VALUES (429, 'YTO', '圆通速递', 0, 0); + +-- ---------------------------- +-- Table structure for yx_material +-- ---------------------------- +DROP TABLE IF EXISTS `yx_material`; +CREATE TABLE `yx_material` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'PK', + `del_flag` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '逻辑删除标记(0:显示;1:隐藏)', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者ID', + `type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '类型1、图片;2、视频', + `group_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '分组ID', + `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '素材名', + `url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '素材链接', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '素材库' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_material +-- ---------------------------- +INSERT INTO `yx_material` VALUES ('005cde72c90844d6ba241823960c1fee', '0', '2020-03-28 21:45:32', 'admin', '1', NULL, '钻石.jpg', 'http://localhost:8000/file/pic/钻石-20200328094531898.jpg'); +INSERT INTO `yx_material` VALUES ('00d67e57516745f88bffa7be8702d4d1', '0', '2020-03-11 16:37:21', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '砍价.png', 'http://localhost:8000/file/pic/砍价-20200311043720679.png'); +INSERT INTO `yx_material` VALUES ('15603c4ffb074a62ae3a63bf1fddde54', '0', '2020-03-22 19:13:25', 'admin', '1', NULL, 'list_16.png', 'http://localhost:8000/file/pic/list_16-20200322071324803.png'); +INSERT INTO `yx_material` VALUES ('7218f3bbbc544ce99761815f729afa90', '0', '2020-03-22 19:15:40', 'admin', '1', NULL, 'list_34.png', 'http://localhost:8000/file/pic/list_34-2020032207154023.png'); +INSERT INTO `yx_material` VALUES ('b80364b37e6c46958c24a224d7cd66bd', '0', '2020-03-11 16:37:16', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '秒杀.png', 'http://localhost:8000/file/pic/秒杀-2020031104371672.png'); +INSERT INTO `yx_material` VALUES ('bb933bebe27643298e6aae585a6c9d09', '0', '2020-03-11 16:37:12', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '05ea40b831858a8cf423aa709840507c.png', 'http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200311043711341.png'); +INSERT INTO `yx_material` VALUES ('e6797fa415c14765829d37e02e51feae', '0', '2020-03-11 16:37:25', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '优惠券.png', 'http://localhost:8000/file/pic/优惠券-20200311043724709.png'); +INSERT INTO `yx_material` VALUES ('eb2c13a9155f4b748fee2558ccee2ae8', '0', '2020-03-11 16:37:28', 'admin', '1', '3e4ee0cdbb484aaeb5a40c337a47dba6', '资讯.png', 'http://localhost:8000/file/pic/资讯-20200311043727918.png'); +INSERT INTO `yx_material` VALUES ('fc0caf898b58449c8a3b27aa44d8931a', '0', '2020-03-22 19:13:49', 'admin', '1', NULL, 'list_22.png', 'http://localhost:8000/file/pic/list_22-20200322071348844.png'); + +-- ---------------------------- +-- Table structure for yx_material_group +-- ---------------------------- +DROP TABLE IF EXISTS `yx_material_group`; +CREATE TABLE `yx_material_group` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'PK', + `del_flag` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '逻辑删除标记(0:显示;1:隐藏)', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者ID', + `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '分组名', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '素材分组' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_material_group +-- ---------------------------- +INSERT INTO `yx_material_group` VALUES ('f55aea3aa6e94ef3b2257df8e025ff71', '0', '2020-03-15 12:48:56', NULL, '222'); + +-- ---------------------------- +-- 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 '砍价产品分享量', + `end_time_date` datetime(0) NOT NULL, + `start_time_date` datetime(0) NOT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '砍价表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_bargain +-- ---------------------------- +INSERT INTO `yx_store_bargain` VALUES (2, 24, '砍价测试01', 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '张', 100, 1, 'https://image.dayouqiantu.cn/5ca05103ad634.jpg,https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', 1577090495, 1608660000, '70gA4彩色打印复印', 10.00, 0.01, 1, 2.00, 0.01, 1, 1, '

7文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



', 0.00, '70gA4彩色打印复印', 0.50, 0, 0, 0, 1577090553, 1, 0.00, '

这里是规则

', 90, 2, '2020-12-23 02:00:00', '2019-12-23 16:41:35'); +INSERT INTO `yx_store_bargain` VALUES (3, 24, '砍价活动2', 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '张', 99, 2, 'https://image.dayouqiantu.cn/5ca05103ad634.jpg,https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg,http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200228083801500.png', 1578412800, 1603900800, '70gA4彩色打印复印', 0.01, 0.01, 1, 10.00, 0.01, 1, 1, '

7文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



', 0.00, '70gA4彩色打印复印', 0.50, 0, 0, 0, 1577101179, 1, 0.00, '

444444

', 34, 1, '2020-10-29 00:00:00', '2020-01-08 00:00:00'); + +-- ---------------------------- +-- 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 = 38 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 = 39 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(50) 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 = 161 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '购物车表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_cart +-- ---------------------------- +INSERT INTO `yx_store_cart` VALUES (123, 11, 'product', 19, '', 2, 1582885462, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (124, 12, 'product', 19, '', 1, 1582897654, 0, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (125, 11, 'product', 19, '', 2, 1582970873, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (126, 11, 'product', 19, '', 1, 1582971001, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (127, 11, 'product', 19, '', 1, 1582971278, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (128, 11, 'product', 19, '', 1, 1582990627, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (129, 11, 'product', 19, '', 1, 1583330733, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (130, 11, 'product', 19, '', 1, 1583393646, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (131, 11, 'product', 19, '', 1, 1583394583, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (132, 11, 'product', 19, '', 1, 1583399181, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (133, 11, 'product', 19, '', 1, 1583403251, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (134, 11, 'product', 19, '', 1, 1583410813, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (135, 11, 'product', 19, '', 1, 1583416029, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (136, 11, 'product', 20, '2e51e5d2d86a44748f81cdd5bf7a51c0', 1, 1583422305, 0, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (137, 11, 'product', 19, '', 1, 1583479387, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (138, 11, 'product', 19, '', 1, 1583486497, 1, 0, 0, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (139, 11, 'product', 20, '2e51e5d2d86a44748f81cdd5bf7a51c0', 1, 1583486504, 1, 0, 0, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (140, 11, 'product', 19, '', 1, 1584171669, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (141, 11, 'product', 20, '', 1, 1584175842, 1, 0, 1, 0, 2, 0); +INSERT INTO `yx_store_cart` VALUES (142, 11, 'product', 19, '', 1, 1584177295, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (143, 11, 'product', 24, '', 1, 1585051721, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (144, 11, 'product', 19, '', 1, 1585144729, 0, 0, 0, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (145, 12, 'product', 24, '', 1, 1585224558, 0, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (146, 11, 'product', 19, '', 1, 1585293362, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (147, 11, 'product', 19, '', 1, 1585385719, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (148, 11, 'product', 24, '', 1, 1585899825, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (149, 11, 'product', 24, '', 1, 1585900220, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (150, 11, 'product', 24, '', 1, 1585900404, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (151, 11, 'product', 24, '', 1, 1585900426, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (152, 11, 'product', 24, '', 1, 1585900444, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (153, 11, 'product', 24, '', 1, 1585900487, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (154, 11, 'product', 24, '', 1, 1585900506, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (155, 11, 'product', 24, '', 1, 1585901825, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (156, 11, 'product', 24, '', 1, 1585901980, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (157, 11, 'product', 24, '', 1, 1585907975, 1, 0, 1, 0, 0, 3); +INSERT INTO `yx_store_cart` VALUES (158, 11, 'product', 24, '', 1, 1586065022, 1, 0, 1, 0, 1, 0); +INSERT INTO `yx_store_cart` VALUES (159, 11, 'product', 19, '', 1, 1586065167, 1, 0, 1, 0, 0, 0); +INSERT INTO `yx_store_cart` VALUES (160, 11, 'product', 19, '', 1, 1586066223, 0, 0, 1, 2, 0, 0); + +-- ---------------------------- +-- 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) NULL DEFAULT NULL COMMENT '排序', + `pic` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '图标', + `is_show` tinyint(1) NULL DEFAULT 1 COMMENT '是否推荐', + `add_time` int(11) NULL DEFAULT NULL COMMENT '添加时间', + `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 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 = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品分类表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_category +-- ---------------------------- +INSERT INTO `yx_store_category` VALUES (1, 0, '图文广告', 1, '', 1, 1584876792, 0); +INSERT INTO `yx_store_category` VALUES (2, 1, '写真', 1, 'http://localhost:8000/file/pic/资讯-20200311043727918.png', 1, 1586244998, 1); +INSERT INTO `yx_store_category` VALUES (3, 1, '平面设计', 1, 'http://localhost:8000/file/pic/资讯-20200311043727918.png', 1, 1584945190, 0); +INSERT INTO `yx_store_category` VALUES (5, 1, '名片', 1, 'http://localhost:8000/file/pic/砍价-20200311043720679.png', 1, 1586245178, 0); + +-- ---------------------------- +-- 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 '单位名', + `end_time_date` datetime(0) NOT NULL, + `start_time_date` datetime(0) NOT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '拼团产品表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_combination +-- ---------------------------- +INSERT INTO `yx_store_combination` VALUES (1, 19, NULL, 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', 'https://image.dayouqiantu.cn/5ca01c7fc9238.jpg,https://image.dayouqiantu.cn/5ca01c7676042.jpg', '70gA4黑白打印复印', NULL, 2, '打印复印资料A4黑白彩色印刷画册书本装订图文数码快印服务', 1.00, 1, 19, 98, '1574064564', 1, 1, 0, 1, NULL, 1, 0.00, '

文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



    

', 1574064557, 1606320000, 24, 0, 0, '张', '2020-11-26 00:00:00', '2019-11-18 16:09:17'); +INSERT INTO `yx_store_combination` VALUES (2, 19, NULL, 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', 'https://image.dayouqiantu.cn/5ca01c7fc9238.jpg,http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200228083801500.png', '70gA4黑白打印复印', NULL, 2, '打印复印资料A4黑白彩色印刷画册书本装订图文数码快印服务', 1.00, 1, 28, 89, '1574066608', 1, 1, 0, 1, NULL, 1, 0.00, '

文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



    

', 1574066592, 1609344000, 24, 0, 0, '张', '2020-12-31 00:00:00', '2019-11-18 16:43:12'); +INSERT INTO `yx_store_combination` VALUES (3, 22, 0, 'http://localhost:8000/file/pic/list_16-20200110120838173.png', 'http://localhost:8000/file/pic/list_16-20200110120838173.png,http://localhost:8000/file/pic/list_32-20200109100213309.png', '3333', NULL, 2, '3333', 1.00, 0, 0, 11, '1578644367', 0, 1, 1, 1, NULL, 0, 0.00, '

4444

', 1578644348, 1585213664, 24, 1, 0, '333', '2020-01-29 00:00:00', '2020-01-10 16:19:08'); + +-- ---------------------------- +-- 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 = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_coupon +-- ---------------------------- +INSERT INTO `yx_store_coupon` VALUES (1, '双十一', 0, 1.00, 100.00, 10, 0, 1, 1573281957, 0); +INSERT INTO `yx_store_coupon` VALUES (2, '44444446', 0, 1.00, 1.00, 1, 0, 1, 1574130748, 0); +INSERT INTO `yx_store_coupon` VALUES (3, '999', 0, 1.00, 1.00, 1, 1, 1, 1574131073, 0); +INSERT INTO `yx_store_coupon` VALUES (4, '333', 0, 3.00, 3.00, 1, 0, 1, 1582894050, 0); +INSERT INTO `yx_store_coupon` VALUES (5, '555', 0, 3.00, 1.00, 1, 0, 1, 1582894121, 0); +INSERT INTO `yx_store_coupon` VALUES (6, '44', 0, 4.00, 4.00, 1, 0, 1, 1582894183, 0); + +-- ---------------------------- +-- 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, + `cname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '', + `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 '优惠券添加时间', + `end_time_date` datetime(0) NOT NULL, + `start_time_date` datetime(0) NOT NULL, + 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 = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券前台领取表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_coupon_issue +-- ---------------------------- +INSERT INTO `yx_store_coupon_issue` VALUES (11, '双十一', 1, 1573352364, 1585039774, 1000, 998, 0, 1, 0, 1573352375, '2020-01-15 01:00:00', '2019-12-02 10:19:24'); +INSERT INTO `yx_store_coupon_issue` VALUES (12, '双十一', 1, 1573353166, 1585039774, 100, 99, 0, 1, 0, 1573353175, '2019-12-26 00:00:00', '2019-11-10 10:32:46'); +INSERT INTO `yx_store_coupon_issue` VALUES (13, '双十一', 1, 1573353254, 1585039774, 10, 9, 0, 1, 0, 1573353261, '2019-12-26 00:00:00', '2019-11-10 10:34:14'); +INSERT INTO `yx_store_coupon_issue` VALUES (14, '999', 3, 1582530746, 1585039774, 100, 100, 0, 0, 1, 1582530755, '2020-02-29 00:00:00', '2020-02-24 15:52:26'); + +-- ---------------------------- +-- Table structure for yx_store_coupon_issue_user +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_coupon_issue_user`; +CREATE TABLE `yx_store_coupon_issue_user` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `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 '领取时间', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `uid`(`uid`, `issue_coupon_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券前台用户领取记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_coupon_issue_user +-- ---------------------------- +INSERT INTO `yx_store_coupon_issue_user` VALUES (1, 12, 11, 1573353024); +INSERT INTO `yx_store_coupon_issue_user` VALUES (2, 12, 12, 1573353194); +INSERT INTO `yx_store_coupon_issue_user` VALUES (3, 12, 13, 1573353269); +INSERT INTO `yx_store_coupon_issue_user` VALUES (4, 11, 11, 1584177287); + +-- ---------------------------- +-- 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 = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券发放记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_coupon_user +-- ---------------------------- +INSERT INTO `yx_store_coupon_user` VALUES (1, 1, 12, '双十一', 1.00, 100.00, 1573353024, 1574217024, 0, 'get', 2, 0); +INSERT INTO `yx_store_coupon_user` VALUES (2, 1, 12, '双十一', 1.00, 100.00, 1573353194, 1574217194, 1573380051, 'get', 1, 0); +INSERT INTO `yx_store_coupon_user` VALUES (3, 1, 12, '双十一', 1.00, 100.00, 1573353269, 1574217269, 0, 'get', 2, 0); +INSERT INTO `yx_store_coupon_user` VALUES (4, 1, 11, '双十一', 1.00, 100.00, 1584177287, 1585041287, 0, 'get', 2, 0); + +-- ---------------------------- +-- 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 '订单号', + `extend_order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 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_sn` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' 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(50) 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 = 154 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` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `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` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '唯一id', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `oid`(`oid`, `unique`) USING BTREE, + INDEX `cart_id`(`cart_id`) USING BTREE, + INDEX `product_id`(`product_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 151 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` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `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 '操作时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `oid`(`oid`) USING BTREE, + INDEX `change_type`(`change_type`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 276 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 = 9 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 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 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 NULL DEFAULT 0.00 COMMENT '会员价格', + `ot_price` decimal(8, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '市场价', + `postage` decimal(8, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '邮费', + `unit_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位名', + `sort` smallint(11) NULL DEFAULT 0 COMMENT '排序', + `sales` mediumint(11) UNSIGNED NULL DEFAULT 0 COMMENT '销量', + `stock` mediumint(11) UNSIGNED NULL DEFAULT 0 COMMENT '库存', + `is_show` tinyint(1) NULL DEFAULT 1 COMMENT '状态(0:未上架,1:上架)', + `is_hot` tinyint(1) NULL DEFAULT 0 COMMENT '是否热卖', + `is_benefit` tinyint(1) NULL DEFAULT 0 COMMENT '是否优惠', + `is_best` tinyint(1) NULL DEFAULT 0 COMMENT '是否精品', + `is_new` tinyint(1) NULL DEFAULT 0 COMMENT '是否新品', + `description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '产品描述', + `add_time` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '添加时间', + `is_postage` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否包邮', + `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否删除', + `mer_use` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '商户是否代理 0不可代理1可代理', + `give_integral` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '获得积分', + `cost` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '成本价', + `is_seckill` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '秒杀状态 0 未开启 1已开启', + `is_bargain` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '砍价状态 0未开启 1开启', + `is_good` tinyint(1) 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 `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 = 26 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product +-- ---------------------------- +INSERT INTO `yx_store_product` VALUES (19, NULL, 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', 'https://image.dayouqiantu.cn/5ca01c7fc9238.jpg,https://image.dayouqiantu.cn/5ca01c7676042.jpg', '70gA4黑白打印复印', '打印复印资料A4黑白彩色印刷画册书本装订图文数码快印服务', '打印复印', '', '3', 120.00, 0.20, 0.50, 0.00, '张', 1, 49, 75, 1, 1, 1, 1, 1, '

文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



    

', NULL, 1, 0, 0, 1.00, 0.20, 0, 0, 1, NULL, NULL, '', ''); +INSERT INTO `yx_store_product` VALUES (24, 0, 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', 'https://image.dayouqiantu.cn/5ca011a1cd487.jpg', '彩色打印', '彩色打印', '彩色打印', '', '2', 1.00, 0.00, 1.00, 0.00, '张', 0, 10, 9989, 1, 1, 1, 1, 1, '

彩色打印

', 1582894605, 0, 1, 0, 0.00, 0.00, 0, 0, 1, 0, 0, '', ''); +INSERT INTO `yx_store_product` VALUES (25, 0, 'http://localhost:8000/file/pic/list_34-2020032207154023.png', 'http://localhost:8000/file/pic/list_22-20200322071348844.png', '照片打印', '照片打印', '照片打印', '', '3', 1.00, 0.00, 2.00, 0.00, '张', 0, 0, 1000, 1, 1, 1, 1, 1, '

照片打印

', 1585278846, 1, 0, 0, 0.00, 0.00, 0, 0, 1, 0, 0, '', ''); + +-- ---------------------------- +-- Table structure for yx_store_product_attr +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_attr`; +CREATE TABLE `yx_store_product_attr` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `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 '属性值', + PRIMARY KEY (`id`) USING BTREE, + INDEX `store_id`(`product_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product_attr +-- ---------------------------- +INSERT INTO `yx_store_product_attr` VALUES (14, 20, '纸张', 'A3,A4'); +INSERT INTO `yx_store_product_attr` VALUES (15, 20, '颜色', '白色,红色'); + +-- ---------------------------- +-- Table structure for yx_store_product_attr_result +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_attr_result`; +CREATE TABLE `yx_store_product_attr_result` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `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 '上次修改时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `product_id`(`product_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 9 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 (8, 20, '{\"attr\":[{\"attrHidden\":true,\"detailValue\":\"\",\"detail\":[\"A3\",\"A4\"],\"value\":\"纸张\"},{\"attrHidden\":true,\"detailValue\":\"\",\"detail\":[\"白色\",\"红色\"],\"value\":\"颜色\"}],\"value\":[{\"cost\":0.5,\"price\":0.5,\"pic\":\"https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg\",\"detail\":{\"颜色\":\"白色\",\"纸张\":\"A3\"},\"check\":false,\"sales\":\"999\"},{\"cost\":0.5,\"price\":0.5,\"pic\":\"https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg\",\"detail\":{\"颜色\":\"红色\",\"纸张\":\"A3\"},\"check\":false,\"sales\":\"999\"},{\"cost\":0.5,\"price\":\"0.2\",\"pic\":\"https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg\",\"detail\":{\"颜色\":\"白色\",\"纸张\":\"A4\"},\"check\":false,\"sales\":\"999\"},{\"cost\":0.5,\"price\":\"0.2\",\"pic\":\"https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg\",\"detail\":{\"颜色\":\"红色\",\"纸张\":\"A4\"},\"check\":false,\"sales\":\"999\"}]}', 1578320995); + +-- ---------------------------- +-- Table structure for yx_store_product_attr_value +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_attr_value`; +CREATE TABLE `yx_store_product_attr_value` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `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 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` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '唯一值', + `cost` decimal(8, 2) UNSIGNED NOT NULL COMMENT '成本价', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `unique`(`unique`, `suk`) USING BTREE, + INDEX `store_id`(`product_id`, `suk`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 30 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 (26, 20, 'A3,白色', 996, NULL, 0.50, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '2e51e5d2d86a44748f81cdd5bf7a51c0', 0.50); +INSERT INTO `yx_store_product_attr_value` VALUES (27, 20, 'A3,红色', 999, NULL, 0.50, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', 'fd545718bbdb4634aa54228ecca6febe', 0.50); +INSERT INTO `yx_store_product_attr_value` VALUES (28, 20, 'A4,白色', 999, NULL, 0.20, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '5e0ae3241d8c4ea793368666f862dd3b', 0.50); +INSERT INTO `yx_store_product_attr_value` VALUES (29, 20, 'A4,红色', 999, NULL, 0.20, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '4b4b306134434832885a52f3a85955ce', 0.50); + +-- ---------------------------- +-- Table structure for yx_store_product_relation +-- ---------------------------- +DROP TABLE IF EXISTS `yx_store_product_relation`; +CREATE TABLE `yx_store_product_relation` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `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 '添加时间', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `uid`(`uid`, `product_id`, `type`, `category`) USING BTREE, + INDEX `type`(`type`) USING BTREE, + INDEX `category`(`category`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品点赞和收藏表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product_relation +-- ---------------------------- +INSERT INTO `yx_store_product_relation` VALUES (1, 11, 20, 'collect', 'product', 1586059338); +INSERT INTO `yx_store_product_relation` VALUES (2, 11, 24, 'collect', 'product', 1586064573); +INSERT INTO `yx_store_product_relation` VALUES (4, 11, 19, 'collect', 'product', 1586065940); + +-- ---------------------------- +-- 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 = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '评论表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_product_reply +-- ---------------------------- +INSERT INTO `yx_store_product_reply` VALUES (5, 11, 0, '', 19, 'product', 0, 0, '', '', 0, NULL, NULL, 0, 0); + +-- ---------------------------- +-- 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` int(11) NOT NULL DEFAULT 0 COMMENT '开始时间', + `stop_time` int(11) NOT NULL DEFAULT 0 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 '显示', + `end_time_date` datetime(0) NOT NULL, + `start_time_date` datetime(0) NOT NULL, + `time_id` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '时间段id', + 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 = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品秒杀产品表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_store_seckill +-- ---------------------------- +INSERT INTO `yx_store_seckill` VALUES (1, 24, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', 'https://image.dayouqiantu.cn/5ca05103ad634.jpg,https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', '70gA4彩色打印复印', '70gA4彩色打印复印', 1.00, 0.50, 1.00, 0.00, 0, 99, 2, '张', 0.00, '

7文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



', 1576476046, 1609257600, '1576476055', 1, 1, 0, 0, 1, 1, '2020-01-29 00:00:00', '2019-12-16 14:00:46', 213); +INSERT INTO `yx_store_seckill` VALUES (2, 24, 'https://image.dayouqiantu.cn/5ca04fa9c08ef.jpg', 'https://image.dayouqiantu.cn/5ca05103ad634.jpg,http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200228083801500.png', '70gA4彩色打印复印2', '70gA4彩色打印复印', 1.00, 0.50, 1.00, 0.00, 0, 98, 3, '张', 0.00, '

7文件请传QQ2412733099,

718504558或2412733099@qq.com邮箱,

手机/微信:13733990583

量大请联系店主,一定让您满意而归

   实体店面经营 保质保量

A4黑白2毛/张,量大1毛/张,

A3黑白双面5毛/张,量大3毛/张,

更大量请联系店主报价,

每消费1元可积1分,1分抵现金1毛,

付款时直接抵扣

(如此优惠的基础上还可积分,积分抵现金)



', 1576477734, 1609257600, '1576477741', 1, 1, 0, 0, 1, 1, '2020-12-30 00:00:00', '2019-12-16 14:28:54', 214); + +-- ---------------------------- +-- 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_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 用户生成', + `uid` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '用户id', + `invite_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '邀请码', + PRIMARY KEY (`att_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 29 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 '字段名称', + `value` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '默认值', + `sort` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '排序', + `status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否隐藏', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 212 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '配置表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_config +-- ---------------------------- +INSERT INTO `yx_system_config` VALUES (162, 'wechat_share_img', 'https://image.dayouqiantu.cn/list_34.png', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (165, 'wechat_avatar', '', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (172, 'wechat_share_synopsis', '4444444', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (174, 'api', 'http://你的H5端域名/api/wechat/serve', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (175, 'wechat_share_title', '4444', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (177, 'store_postage', '1', 0, 0); +INSERT INTO `yx_system_config` VALUES (178, 'store_free_postage', '200', 0, 0); +INSERT INTO `yx_system_config` VALUES (179, 'integral_ratio', '1', 0, 0); +INSERT INTO `yx_system_config` VALUES (180, 'store_brokerage_ratio', '70', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (181, 'store_brokerage_statu', '2', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (182, 'user_extract_min_price', '1', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (183, 'store_brokerage_two', '30', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (184, 'site_url', 'http://localhost:8080', 0, 0); +INSERT INTO `yx_system_config` VALUES (185, 'api_url', 'http://127.0.0.1:8009', 0, 0); +INSERT INTO `yx_system_config` VALUES (186, 'order_cancel_job_time', '20', 0, 0); +INSERT INTO `yx_system_config` VALUES (187, 'wechat_appid', '11112', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (188, 'wechat_appsecret', '222266', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (189, 'wechat_encodingaeskey', '6666', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (190, 'wechat_token', '999', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (191, 'wxpay_mchId', '2222', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (192, 'wxpay_appId', '111111', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (193, 'wxpay_mchKey', '55555', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (194, 'wxapp_appId', '22222', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (195, 'wxapp_secret', '22222222', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (196, 'wxpay_keyPath', 'http://localhost:8000/file/pic/list_30-20200110053337209.png', 0, 0); +INSERT INTO `yx_system_config` VALUES (197, 'imageArr', '[\"https://image.dayouqiantu.cn/list_34.png\"]', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (198, 'store_brokerage_open', '1', 0, 0); +INSERT INTO `yx_system_config` VALUES (199, 'integral_full', '0', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (200, 'integral_max', '0', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (201, 'store_user_min_recharge', '1', 0, 0); +INSERT INTO `yx_system_config` VALUES (203, 'store_self_mention', '1', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (204, 'tengxun_map_key', 'OGABZ-Y5OCF-5UWJ5-N7DHH-VFIG7-DHFEB', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (205, 'wechat_id', '', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (206, 'wechat_type', '', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (207, 'wechat_encode', '', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (208, 'wechat_sourceid', '', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (209, 'wechat_name', '', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (210, 'wechat_qrcode', '', NULL, NULL); +INSERT INTO `yx_system_config` VALUES (211, 'wx_native_app_appId', '11111', NULL, NULL); + +-- ---------------------------- +-- 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', + `group_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '对应的数据名称', + `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) NULL DEFAULT 0 COMMENT '数据排序', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态(1:开启;2:关闭;)', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 237 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组合数据详情表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_group_data +-- ---------------------------- +INSERT INTO `yx_system_group_data` VALUES (177, 'yshop_home_banner', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\"],\"name\":\"banner\",\"id\":177,\"pic\":\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\",\"sort\":1,\"url\":\"wwww\",\"status\":1}', 1571387677, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (180, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e85bfa61251d.png\"],\"uniapp_url\":\"/pages/shop/GoodsClass/index\",\"name\":\"全部商品\",\"id\":180,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa61251d.png\",\"sort\":9,\"url\":\"/goods_list\",\"wxapp_url\":\"/pages/shop/GoodsClass/main\",\"status\":1}', 1571390842, 9, 1); +INSERT INTO `yx_system_group_data` VALUES (182, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":182,\"pic\":\"https://i.loli.net/2019/10/18/DqOUgNf7wjuFpPT.png\",\"sort\":2,\"title\":\"分销、拼团、商户功能上线啦!\",\"url\":\"/news_list\",\"info\":\"yshop2.0上线啦\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 0, 2, 1); +INSERT INTO `yx_system_group_data` VALUES (183, 'yshop_hot_search', '{\"id\":183,\"title\":\"照片\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (184, 'yshop_hot_search', '{\"id\":184,\"title\":\"springboot\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (187, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":187,\"sort\":1,\"url\":\"/news_list\",\"info\":\"springboot2+JPA+Mybatisplus商城系统\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1572086163, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (188, 'yshop_hot_search', '{\"id\":188,\"title\":\"打印\"}', 1572086172, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (189, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dec896eeb25a.png\"],\"uniapp_url\":\"/pages/user/UserVip/index\",\"name\":\"会员中心\",\"id\":189,\"pic\":\"https://image.dayouqiantu.cn/5dec896eeb25a.png\",\"sort\":9,\"url\":\"/user/vip\",\"wxapp_url\":\"/pages/user/UserVip/main\",\"status\":1}', 1572087722, 9, 1); +INSERT INTO `yx_system_group_data` VALUES (190, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428984d64d.png\"],\"uniapp_url\":\"/pages/user/coupon/UserCoupon/index\",\"name\":\"优惠券\",\"id\":190,\"pic\":\"https://image.dayouqiantu.cn/5db428984d64d.png\",\"sort\":8,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/UserCoupon/main\",\"status\":1}', 0, 8, 1); +INSERT INTO `yx_system_group_data` VALUES (191, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"收藏商品\",\"id\":191,\"pic\":\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 0, 7, 1); +INSERT INTO `yx_system_group_data` VALUES (192, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428bd61b73.png\"],\"uniapp_url\":\"/pages/user/address/AddressManagement/index\",\"name\":\"地址管理\",\"id\":192,\"pic\":\"https://image.dayouqiantu.cn/5db428bd61b73.png\",\"sort\":6,\"url\":\"/user/add_manage\",\"wxapp_url\":\"/pages/user/address/AddressManagement/main\",\"status\":1}', 0, 6, 1); +INSERT INTO `yx_system_group_data` VALUES (193, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428e28dd48.png\"],\"uniapp_url\":\"/pages/user/promotion/UserPromotion/index\",\"name\":\"我的推广\",\"id\":193,\"pic\":\"https://image.dayouqiantu.cn/5db428e28dd48.png\",\"sort\":5,\"url\":\"/user/user_promotion\",\"wxapp_url\":\"/pages/user/promotion/UserPromotion/main\",\"status\":1}', 0, 5, 1); +INSERT INTO `yx_system_group_data` VALUES (194, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db42a4208c55.png\"],\"uniapp_url\":\"/pages/user/UserAccount/index\",\"name\":\"我的余额\",\"id\":194,\"pic\":\"https://image.dayouqiantu.cn/5db42a4208c55.png\",\"sort\":4,\"url\":\"/user/account\",\"wxapp_url\":\"/pages/user/UserAccount/main\",\"status\":1}', 0, 4, 1); +INSERT INTO `yx_system_group_data` VALUES (195, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428f410462.png\"],\"uniapp_url\":\"/pages/user/signIn/Integral/index\",\"name\":\"我的积分\",\"id\":195,\"pic\":\"https://image.dayouqiantu.cn/5db428f410462.png\",\"sort\":3,\"url\":\"/user/integral\",\"wxapp_url\":\"/pages/user/signIn/Integral/main\",\"status\":1}', 0, 3, 1); +INSERT INTO `yx_system_group_data` VALUES (196, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93f004713.png\"],\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"name\":\"图文资讯\",\"id\":196,\"pic\":\"https://image.dayouqiantu.cn/5e85bfea151b7.png\",\"sort\":8,\"url\":\"/news_list\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1573109648, 8, 1); +INSERT INTO `yx_system_group_data` VALUES (197, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e939507b5e.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"我的收藏\",\"id\":197,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa55f352.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 1573109723, 7, 1); +INSERT INTO `yx_system_group_data` VALUES (199, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93c9a8304.png\"],\"uniapp_url\":\"/pages/user/coupon/GetCoupon/index\",\"name\":\"优惠券\",\"id\":199,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa6621ca.png\",\"sort\":6,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/GetCoupon/main\",\"status\":1}', 1573387422, 6, 1); +INSERT INTO `yx_system_group_data` VALUES (200, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e925140b57.png\"],\"uniapp_url\":\"/pages/activity/GoodsGroup/index\",\"name\":\"拼团专区\",\"id\":200,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa4b273f.png\",\"sort\":5,\"url\":\"/activity/group\",\"wxapp_url\":\"/pages/activity/GoodsGroup/main\",\"status\":1}', 0, 5, 1); +INSERT INTO `yx_system_group_data` VALUES (201, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\"],\"uniapp_url\":\"/pages/orderAdmin/OrderIndex/index\",\"name\":\"商户管理\",\"id\":201,\"pic\":\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\",\"sort\":2,\"url\":\"/customer/index\",\"wxapp_url\":\"/pages/orderAdmin/OrderIndex/main\",\"status\":1}', 0, 2, 1); +INSERT INTO `yx_system_group_data` VALUES (202, 'yshop_sign_day_num', '{\"sign_num\":\"10\",\"id\":205,\"day\":\"第一天\"}', 0, 9, 1); +INSERT INTO `yx_system_group_data` VALUES (203, 'yshop_sign_day_num', '{\"sign_num\":\"20\",\"id\":\"\",\"day\":\"第二天\"}', 0, 8, 1); +INSERT INTO `yx_system_group_data` VALUES (204, 'yshop_sign_day_num', '{\"sign_num\":\"30\",\"id\":\"\",\"day\":\"第三天\"}', 0, 7, 1); +INSERT INTO `yx_system_group_data` VALUES (205, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"40\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第四天\",\"status\":\"\"}', 0, 6, 1); +INSERT INTO `yx_system_group_data` VALUES (206, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"50\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第五天\",\"status\":\"\"}', 0, 5, 1); +INSERT INTO `yx_system_group_data` VALUES (207, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"60\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第六天\",\"status\":\"\"}', 0, 4, 1); +INSERT INTO `yx_system_group_data` VALUES (208, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"100\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"奖励\",\"status\":\"\"}', 0, 3, 1); +INSERT INTO `yx_system_group_data` VALUES (209, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93010a248.png\"],\"uniapp_url\":\"/pages/user/signIn/Sign/index\",\"name\":\"积分签到\",\"id\":209,\"pic\":\"https://image.dayouqiantu.cn/5e85bf8e494f2.png\",\"sort\":4,\"url\":\"/user/sign\",\"wxapp_url\":\"/pages/user/signIn/Sign/main\",\"status\":1}', 0, 4, 1); +INSERT INTO `yx_system_group_data` VALUES (210, 'yshop_seckill_time', '{\"continued\":2,\"id\":\"\",\"time\":5}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (211, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"7\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (212, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"2\",\"id\":\"\",\"sort\":\"\",\"time\":\"10\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (213, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"12\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (214, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"4\",\"id\":\"\",\"sort\":\"\",\"time\":\"15\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (215, 'yshop_seckill_time', '{\"continued\":\"2\",\"id\":223,\"time\":\"19\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (216, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e929f9be59.png\"],\"uniapp_url\":\"/pages/activity/GoodsSeckill/index\",\"name\":\"秒杀专区\",\"id\":216,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa5a9f85.png\",\"sort\":3,\"url\":\"/activity/goods_seckill\",\"wxapp_url\":\"/pages/activity/GoodsSeckill/main\",\"status\":1}', 0, 3, 1); +INSERT INTO `yx_system_group_data` VALUES (217, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e9276c608f.png\"],\"uniapp_url\":\"/pages/activity/GoodsBargain/index\",\"name\":\"砍价专区\",\"id\":217,\"pic\":\"https://image.dayouqiantu.cn/5e85bfe9b1da8.png\",\"sort\":2,\"url\":\"/activity/bargain\",\"wxapp_url\":\"/pages/activity/GoodsBargain/main\",\"status\":1}', 0, 2, 1); +INSERT INTO `yx_system_group_data` VALUES (218, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dfd7b748e053.png\"],\"uniapp_url\":\"/pages/activity/BargainRecord/index\",\"name\":\"砍价记录\",\"id\":218,\"pic\":\"https://image.dayouqiantu.cn/5dfd7b748e053.png\",\"sort\":1,\"url\":\"/activity/bargain/record\",\"wxapp_url\":\"/pages/activity/BargainRecord/main\",\"status\":1}', 0, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (219, 'yshop_home_banner', '{\"name\":\"222\",\"id\":\"\",\"pic\":\"https://image.dayouqiantu.cn/5c9f117f624ee.jpg\",\"sort\":\"\",\"url\":\"/\",\"status\":\"\"}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (221, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e60da498cfdd.png\"],\"name\":\"订单核销\",\"id\":230,\"pic\":\"https://image.dayouqiantu.cn/5e60da498cfdd.png\",\"sort\":0,\"url\":\"/order/order_cancellation\",\"wxapp_url\":\"\",\"status\":1}', 0, 0, 1); +INSERT INTO `yx_system_group_data` VALUES (222, 'yshop_recharge_price_ways', '{\"give_price\":\"10\",\"price\":\"100\",\"id\":\"\",\"sort\":0,\"status\":1}', 0, 1, 1); +INSERT INTO `yx_system_group_data` VALUES (223, 'yshop_recharge_price_ways', '{\"give_price\":\"1\",\"price\":1,\"id\":\"\",\"sort\":0,\"status\":1}', 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 '是否删除', + `day_time_end` datetime(0) NULL DEFAULT NULL, + `day_time_start` datetime(0) NULL DEFAULT NULL, + `valid_time_end` datetime(0) NULL DEFAULT NULL, + `valid_time_start` datetime(0) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `phone`(`phone`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店自提' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_store +-- ---------------------------- +INSERT INTO `yx_system_store` VALUES (3, 'yshop店铺', 'springboot商城', '15136175234', '河南省漯河市', '', 'https://image.dayouqiantu.cn/noMeal_tt.png', '33.54528', '113.9202', '2020-03-09 - 2020-04-30', '11:33:49 - 19:33:49', 1583300059, 0, 0, '2020-03-04 19:33:49', '2020-03-04 11:33:49', '2020-04-30 00:00:00', '2020-03-09 00:00:00'); +INSERT INTO `yx_system_store` VALUES (4, '信阳门店', '信阳门店', '15136275234', '河南省信阳市', '', 'http://localhost:8000/file/pic/砍价-20200311043720679.png', '32.11683', '114.05857', '2020-03-21 - 2020-03-31', '17:11:13 - 20:11:13', 1584781880, 1, 0, '2020-03-21 20:11:13', '2020-03-21 17:11:13', '2020-03-31 00:00:00', '2020-03-21 00:00:00'); +INSERT INTO `yx_system_store` VALUES (5, '郑州门店', '郑州门店', '15136175246', '河南省郑州', '', 'http://localhost:8000/file/pic/05ea40b831858a8cf423aa709840507c-20200311043711341.png', '34.72468', '113.6401', '2020-03-21 - 2020-03-31', '17:11:13 - 20:11:15', 1584782199, 1, 0, '2020-03-21 20:11:15', '2020-03-21 17:11:13', '2020-03-31 00:00:00', '2020-03-21 00:00:00'); + +-- ---------------------------- +-- Table structure for yx_system_store_staff +-- ---------------------------- +DROP TABLE IF EXISTS `yx_system_store_staff`; +CREATE TABLE `yx_system_store_staff` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `uid` int(10) UNSIGNED NOT NULL COMMENT '微信用户id', + `nickname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '店员头像', + `store_id` int(11) NOT NULL COMMENT '门店id', + `store_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `staff_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '店员名称', + `phone` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `verify_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '核销开关', + `status` tinyint(2) NULL DEFAULT 1 COMMENT '状态', + `add_time` int(10) NULL DEFAULT NULL COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店店员表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_system_store_staff +-- ---------------------------- +INSERT INTO `yx_system_store_staff` VALUES (2, 12, '会敲代码的喵2', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', 4, '信阳门店', 'tttt', '15136175423', 1, 1, 1584868920); +INSERT INTO `yx_system_store_staff` VALUES (3, 11, '会敲代码的喵88', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', 5, '郑州门店', 'tttt', '16136175234', 1, 1, 1585213920); +INSERT INTO `yx_system_store_staff` VALUES (4, 19, '15136175528', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', 5, '郑州门店', '111', '15136175246', 1, 1, 1586180635); + +-- ---------------------------- +-- 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 = 8 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, '普通会员', 20.00, 0, 1, 0, 1, 1, 99.00, 'http://pic.dayouqiantu.cn/5c9ccca8cd632.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8bc1e0.png', '普通会员', 1553824559, 0); +INSERT INTO `yx_system_user_level` VALUES (2, 0, '青铜会员', 0.00, 0, 1, 0, 1, 2, 98.00, 'http://pic.dayouqiantu.cn/5c9ccca904016.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8f0a30.png', '青铜会员', 1553824639, 0); +INSERT INTO `yx_system_user_level` VALUES (3, 0, '黄铜会员', 0.00, 0, 1, 0, 1, 3, 95.00, 'http://pic.dayouqiantu.cn/5c9ccca8b27f1.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8e9365.png', '黄铜会员', 1553824742, 0); +INSERT INTO `yx_system_user_level` VALUES (4, 0, '白银会员', 0.00, 0, 1, 0, 1, 4, 94.00, 'http://pic.dayouqiantu.cn/5c9ccca8d6ae1.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8a27f0.png', '白银会员', 1553824797, 0); +INSERT INTO `yx_system_user_level` VALUES (5, 0, '黄金会员', 0.00, 0, 1, 0, 1, 5, 90.00, 'http://pic.dayouqiantu.cn/5c9ccca8b27f1.jpg', 'http://pic.dayouqiantu.cn/5c9ccca8aa5b9.png', '黄金会员', 1553824837, 0); +INSERT INTO `yx_system_user_level` VALUES (6, 0, '钻石会员', 0.00, 0, 1, 0, 1, 6, 88.00, 'http://localhost:8000/file/pic/钻石-20200328094531898.jpg', 'http://pic.dayouqiantu.cn/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 = 19 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, '满足积分20分', '积分数', 'SatisfactionIntegral', 20, 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天', '累计签到', 'CumulativeAttendance', 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, '消费满10000元', '消费次数', 'ConsumptionAmount', 10000, 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); +INSERT INTO `yx_system_user_task` VALUES (15, '消费满1000元', '消费金额', 'ConsumptionAmount', 1000, 4, 0, 1, 1, '', 1575456513); +INSERT INTO `yx_system_user_task` VALUES (16, '累计签到2天', '累计签到', 'CumulativeAttendance', 2, 1, 0, 1, 1, '', 1575456576); +INSERT INTO `yx_system_user_task` VALUES (17, '消费满100元', '消费次数', 'ConsumptionAmount', 100, 2, 0, 1, 1, '', 1575456612); +INSERT INTO `yx_system_user_task` VALUES (18, '消费满1000元', '消费金额', 'ConsumptionAmount', 1000, 3, 0, 1, 1, '', 1575456692); + +-- ---------------------------- +-- 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', + `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户账户(跟accout一样)', + `account` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户账号', + `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户密码(跟pwd)', + `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户密码', + `real_name` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '真实姓名', + `birthday` int(11) NULL DEFAULT 0 COMMENT '生日', + `card_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '身份证号码', + `mark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户备注', + `partner_id` int(11) NULL DEFAULT 0 COMMENT '合伙人id', + `group_id` int(11) NULL DEFAULT 0 COMMENT '用户分组id', + `nickname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户昵称', + `avatar` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 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 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 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, + UNIQUE INDEX `username`(`username`) 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 = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_user +-- ---------------------------- +INSERT INTO `yx_user` VALUES (11, 'hupeng', 'hupeng', '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', 'e10adc3949ba59abbe56e057f20f883e', '', 0, '', '', 0, 0, '会敲代码的喵88', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175246', 1573120584, '', 1573120584, '', 7619.91, 26.86, 988.06, 1, 1, 1, 0, 1, 'h5', 0, 39, 4, 0, '', 1, ''); +INSERT INTO `yx_user` VALUES (12, '15136175246', 'hupeng2', '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', 'e10adc3949ba59abbe56e057f20f883e', '', 0, '', '', 0, 0, '会敲代码的喵2', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175246', 1573120881, '', 1573120881, '', 8766.20, 28.00, 70.51, 2, 1, 1, 11, 1582896799, 'h5', 0, 20, 0, 0, '', 1, ''); +INSERT INTO `yx_user` VALUES (14, '15136175247', '15136175247', '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', 'e10adc3949ba59abbe56e057f20f883e', '', 0, '', '', 0, 0, '15136175247', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175247', 1573612696, '', 1573612696, '', 9200.00, 0.00, 2.00, 0, 1, 0, 11, 1584189298, 'h5', 0, 5, 0, 0, '', 0, ''); +INSERT INTO `yx_user` VALUES (15, '15136175249', '15136175249', '$2a$10$fP.426qKaTmix50Oln8L.uav55gELhAd0Eg66Av4oG86u8km7D/Ky', '$2a$10$IG/fc8idkW35ezw7VtiM.OjUU1fvS2d/Bw7TmU76UUTbd5/4eCd9a', '', 0, '', '', 0, 0, '15136175249', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175249', 1578839477, '', 1578839477, '', 0.00, 0.00, 0.00, 0, 1, 0, 0, 0, 'h5', 0, 0, 0, 0, '', 0, ''); +INSERT INTO `yx_user` VALUES (18, '15136175523', '15136175523', '$2a$10$kMjK.K8lezzqiHfPjJCAUuSYajA7dAZhtUdtEyKd5RilPi8sWf4gC', '$2a$10$DhiQooA85GOl2Z4tZrAwAejwgf8O6SrMsv8jaVwQsXkR1VcyTp0eC', '', 0, '', '', 0, 0, '15136175523', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175523', 1584171347, '', 1584171347, '', 0.00, 0.00, 0.00, 0, 1, 0, 0, 0, 'h5', 0, 0, 0, 0, '', 0, ''); +INSERT INTO `yx_user` VALUES (19, '15136175528', '15136175528', '$2a$10$8d4xZEX3x7jaojPTv0WDheEG8syzV1br2z1RpZ0ceV/p0OTaKOq1u', '$2a$10$zLLJrrxGKbikzbAiP34N/Od5nlNgREMtoaih7rlqSzk7oOnurFneO', '', 0, '', '', 0, 0, '15136175528', 'https://image.dayouqiantu.cn/5dc2c7f3a104c.png', '15136175528', 1584535079, '', 1584535079, '', 0.00, 0.00, 0.00, 0, 1, 0, 11, 1584535081, 'h5', 0, 0, 0, 0, '', 0, ''); +INSERT INTO `yx_user` VALUES (20, '15136171112', '15136171112', '$2a$10$MsTr57nPX9bSOLvlA4C/Z.MaUGTJM/anEzDasPucezf4GVfPpmmji', '$2a$10$62PLFod7JnPPmW8Hx0MZ9uhkGXmXZZ2N3ZixnvUzfBTZ157oiFCSm', '', 0, '', '', 0, 0, '15136171112', 'https://image.dayouqiantu.cn/5e79f6cfd33b6.png', '15136171112', 1585385387, '', 1585385387, '', 0.00, 0.00, 0.00, 0, 1, 0, 11, 1585385387, 'h5', 0, 0, 0, 0, '', 0, ''); + +-- ---------------------------- +-- 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` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' 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 = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户地址表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_user_address +-- ---------------------------- +INSERT INTO `yx_user_address` VALUES (9, 8, '胡鹏', '15136175246', '山西', '大同市', '灵丘县', '999', '', '0', '0', 1, 0, 1573119435); +INSERT INTO `yx_user_address` VALUES (10, 11, '胡鹏', '15139175246', '重庆', '荣昌县', '广顺镇', '999', '', '0', '0', 1, 0, 1573120628); +INSERT INTO `yx_user_address` VALUES (11, 12, 'hu', '15136175246', '上海', '闸北区', '城区', '99999', '', '0', '0', 1, 0, 1573123595); +INSERT INTO `yx_user_address` VALUES (12, 14, 'zhang', '15136175247', '上海', '静安区', '城区', '999', '', '0', '0', 1, 0, 1573612804); + +-- ---------------------------- +-- 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 = 128 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户账单表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_user_bill +-- ---------------------------- +INSERT INTO `yx_user_bill` VALUES (3, 3, '8', 0, '购买商品', 'now_money', 'pay_product', 100.00, 10000.00, '余额支付', 1572416780, 1); +INSERT INTO `yx_user_bill` VALUES (4, 3, '9', 0, '购买商品', 'now_money', 'pay_product', 300.00, 9900.00, '余额支付', 1572416917, 1); +INSERT INTO `yx_user_bill` VALUES (5, 3, '10', 0, '购买商品', 'now_money', 'pay_product', 100.00, 9600.00, '余额支付', 1572425699, 1); +INSERT INTO `yx_user_bill` VALUES (6, 3, '11', 0, '购买商品', 'now_money', 'pay_product', 100.00, 9500.00, '余额支付', 1572427199, 1); +INSERT INTO `yx_user_bill` VALUES (7, 3, '11', 1, '购买商品赠送积分', 'integral', 'gain', 10.00, 0.00, '购买商品赠送', 1572693386, 1); +INSERT INTO `yx_user_bill` VALUES (8, 3, '10', 1, '商品退款', 'now_money', 'pay_product_refund', 100.00, 9500.00, '订单退款到余额', 1573040186, 1); +INSERT INTO `yx_user_bill` VALUES (9, 3, '12', 0, '购买商品', 'now_money', 'pay_product', 100.00, 9500.00, '余额支付', 1573040704, 1); +INSERT INTO `yx_user_bill` VALUES (10, 12, '12', 1, '购买商品赠送积分', 'integral', 'gain', 10.00, 10.00, '购买商品赠送', 1573041037, 1); +INSERT INTO `yx_user_bill` VALUES (11, 3, '26', 0, '购买商品', 'now_money', 'pay_product', 0.20, 9400.00, '余额支付', 1573119034, 1); +INSERT INTO `yx_user_bill` VALUES (12, 12, '34', 0, '购买商品', 'now_money', 'pay_product', 0.20, 10000.00, '余额支付', 1573124900, 1); +INSERT INTO `yx_user_bill` VALUES (13, 12, '33', 0, '购买商品', 'now_money', 'pay_product', 0.20, 9999.80, '余额支付', 1573124914, 1); +INSERT INTO `yx_user_bill` VALUES (14, 12, '35', 0, '购买商品', 'now_money', 'pay_product', 119.00, 9999.60, '余额支付', 1573380051, 1); +INSERT INTO `yx_user_bill` VALUES (15, 12, '105e06edb7bf4113aff646a45b13abaa', 0, '积分抵扣', 'integral', 'deduction', 10.00, 10.00, '购买商品使用', 1573381947, 1); +INSERT INTO `yx_user_bill` VALUES (16, 12, '36', 0, '购买商品', 'now_money', 'pay_product', 160.00, 9880.60, '余额支付', 1573381947, 1); +INSERT INTO `yx_user_bill` VALUES (17, 14, '37', 0, '购买商品', 'now_money', 'pay_product', 120.00, 10000.00, '余额支付', 1573612822, 1); +INSERT INTO `yx_user_bill` VALUES (18, 14, '37', 1, '购买商品赠送积分', 'integral', 'gain', 1.00, 0.00, '购买商品赠送', 1573613426, 1); +INSERT INTO `yx_user_bill` VALUES (19, 12, '37', 1, '获得推广佣金', 'now_money', 'brokerage', 14.00, 14.00, '15136175247成功消费120.00元,奖励推广佣金14.0', 1573613427, 1); +INSERT INTO `yx_user_bill` VALUES (20, 11, '37', 1, '获得推广佣金', 'now_money', 'brokerage', 6.00, 6.00, '二级推广人15136175247成功消费120.00元,奖励推广佣金6.0', 1573613427, 1); +INSERT INTO `yx_user_bill` VALUES (21, 11, '1', 0, '佣金提现', 'now_money', 'extract', 1.00, 5.00, '使用微信提现1元', 1573648445, 1); +INSERT INTO `yx_user_bill` VALUES (25, 11, '1', 1, '提现失败', 'now_money', 'extract', 1.00, 6.00, '提现失败,退回佣金1元', 1573710526, 1); +INSERT INTO `yx_user_bill` VALUES (26, 14, '84892a2626a341939dd05cd7f2adff9e', 0, '积分抵扣', 'integral', 'deduction', 1.00, 1.00, '购买商品使用', 1573888321, 1); +INSERT INTO `yx_user_bill` VALUES (27, 14, '39', 1, '积分回退', 'integral', 'deduction', 1.00, 0.00, '购买商品失败,回退积分', 1573888707, 1); +INSERT INTO `yx_user_bill` VALUES (28, 14, '42', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9880.00, '余额支付', 1573979565, 1); +INSERT INTO `yx_user_bill` VALUES (29, 14, '61', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9760.00, '余额支付', 1573991796, 1); +INSERT INTO `yx_user_bill` VALUES (30, 14, '67', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9640.00, '余额支付', 1573996204, 1); +INSERT INTO `yx_user_bill` VALUES (31, 14, '68', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9520.00, '余额支付', 1573996429, 1); +INSERT INTO `yx_user_bill` VALUES (32, 14, '68', 1, '购买商品赠送积分', 'integral', 'gain', 1.00, 1.00, '购买商品赠送', 1574048275, 1); +INSERT INTO `yx_user_bill` VALUES (33, 12, '68', 1, '获得推广佣金', 'now_money', 'brokerage', 14.00, 28.00, '15136175247成功消费120.00元,奖励推广佣金14.0', 1574048275, 1); +INSERT INTO `yx_user_bill` VALUES (34, 11, '68', 1, '获得推广佣金', 'now_money', 'brokerage', 6.00, 12.00, '二级推广人15136175247成功消费120.00元,奖励推广佣金6.0', 1574048275, 1); +INSERT INTO `yx_user_bill` VALUES (35, 12, '89', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9720.60, '余额支付', 1574221758, 1); +INSERT INTO `yx_user_bill` VALUES (36, 12, '90', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9600.60, '余额支付', 1574243179, 1); +INSERT INTO `yx_user_bill` VALUES (37, 12, '91', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9480.60, '余额支付', 1574244175, 1); +INSERT INTO `yx_user_bill` VALUES (38, 12, '92', 0, '购买商品', 'now_money', 'pay_product', 1.00, 9360.60, '余额支付', 1574327309, 1); +INSERT INTO `yx_user_bill` VALUES (39, 11, '93', 0, '购买商品', 'now_money', 'pay_product', 1.00, 10000.00, '余额支付', 1574329404, 1); +INSERT INTO `yx_user_bill` VALUES (40, 12, '96', 0, '购买商品', 'now_money', 'pay_product', 1.00, 9359.60, '余额支付', 1574425447, 1); +INSERT INTO `yx_user_bill` VALUES (41, 12, '91', 1, '商品退款', 'now_money', 'pay_product_refund', 120.00, 9478.60, '订单退款到余额', 1574757130, 1); +INSERT INTO `yx_user_bill` VALUES (42, 12, '91', 1, '商品退款', 'now_money', 'pay_product_refund', 120.00, 9598.60, '订单退款到余额', 1574757363, 1); +INSERT INTO `yx_user_bill` VALUES (43, 11, '0', 1, '充值', 'now_money', 'recharge', 10.00, 9410.00, '系统增加了10.0余额', 1575446946, 1); +INSERT INTO `yx_user_bill` VALUES (44, 14, '0', 0, '系统增加余额', 'now_money', 'system_sub', 10.00, 9400.00, '系统扣除了10.0余额', 1575447084, 1); +INSERT INTO `yx_user_bill` VALUES (45, 12, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 0.00, '', 1575549244, 1); +INSERT INTO `yx_user_bill` VALUES (46, 12, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 10.00, '', 1575684021, 1); +INSERT INTO `yx_user_bill` VALUES (47, 12, '99', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9598.60, '余额支付', 1575771514, 1); +INSERT INTO `yx_user_bill` VALUES (48, 12, '0', 1, '签到奖励', 'integral', 'sign', 20.00, 20.00, '', 1575771932, 1); +INSERT INTO `yx_user_bill` VALUES (49, 11, '96', 1, '获得推广佣金', 'now_money', 'brokerage', 0.70, 12.70, '会敲代码的喵2成功消费1.00元,奖励推广佣金0.7', 1575868078, 1); +INSERT INTO `yx_user_bill` VALUES (50, 12, '100', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9479.80, '余额支付', 1576234308, 1); +INSERT INTO `yx_user_bill` VALUES (51, 12, '91', 1, '商品退款', 'now_money', 'pay_product_refund', 120.00, 9481.00, '订单退款到余额', 1576286856, 1); +INSERT INTO `yx_user_bill` VALUES (52, 12, '101', 0, '购买商品', 'now_money', 'pay_product', 1.00, 9481.00, '余额支付', 1576565376, 1); +INSERT INTO `yx_user_bill` VALUES (53, 12, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 40.00, '', 1577026465, 1); +INSERT INTO `yx_user_bill` VALUES (54, 12, '102', 0, '购买商品', 'now_money', 'pay_product', 1.00, 9480.00, '余额支付', 1577086164, 1); +INSERT INTO `yx_user_bill` VALUES (55, 12, '0', 1, '签到奖励', 'integral', 'sign', 20.00, 50.00, '', 1577099436, 1); +INSERT INTO `yx_user_bill` VALUES (56, 12, '103', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9479.00, '余额支付', 1577345071, 1); +INSERT INTO `yx_user_bill` VALUES (57, 12, '25f5693f8e82419bba4f581af126dc47', 0, '积分抵扣', 'integral', 'deduction', 0.50, 70.00, '购买商品使用', 1577442136, 1); +INSERT INTO `yx_user_bill` VALUES (58, 12, '104', 0, '购买商品', 'now_money', 'pay_product', 0.00, 9360.20, '余额支付', 1577442136, 1); +INSERT INTO `yx_user_bill` VALUES (59, 12, '104', 1, '商品退款', 'now_money', 'pay_product_refund', 0.00, 9360.20, '订单退款到余额', 1577586525, 1); +INSERT INTO `yx_user_bill` VALUES (60, 12, '105', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9360.20, '余额支付', 1577611680, 1); +INSERT INTO `yx_user_bill` VALUES (61, 12, '106', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9241.40, '余额支付', 1577774706, 1); +INSERT INTO `yx_user_bill` VALUES (62, 14, '0', 1, '系统增加余额', 'now_money', 'system_add', 0.00, 9400.00, '系统增加了0.0余额', 1578321034, 1); +INSERT INTO `yx_user_bill` VALUES (63, 12, '108', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9122.60, '余额支付', 1578386338, 1); +INSERT INTO `yx_user_bill` VALUES (64, 11, '1', 1, '提现失败', 'now_money', 'extract', 1.00, 13.70, '提现失败,退回佣金1元', 1578455379, 1); +INSERT INTO `yx_user_bill` VALUES (65, 12, '110', 0, '购买商品', 'now_money', 'pay_product', 118.80, 9003.80, '余额支付', 1578482250, 1); +INSERT INTO `yx_user_bill` VALUES (66, 12, '99', 1, '购买商品赠送积分', 'integral', 'gain', 1.00, 69.51, '购买商品赠送', 1578733510, 1); +INSERT INTO `yx_user_bill` VALUES (67, 11, '99', 1, '获得推广佣金', 'now_money', 'brokerage', 13.16, 26.86, '会敲代码的喵2成功消费118.80元,奖励推广佣金13.16', 1578733510, 1); +INSERT INTO `yx_user_bill` VALUES (68, 12, '111', 0, '购买商品', 'now_money', 'pay_product', 118.80, 8885.00, '余额支付', 1578839691, 1); +INSERT INTO `yx_user_bill` VALUES (69, 15, '0', 0, '系统减少余额', 'now_money', 'system_sub', 10.00, 0.00, '系统扣除了10.0余额', 1580440677, 1); +INSERT INTO `yx_user_bill` VALUES (70, 14, '0', 0, '系统减少余额', 'now_money', 'system_sub', 100.00, 9300.00, '系统扣除了100.0余额', 1580440694, 1); +INSERT INTO `yx_user_bill` VALUES (71, 14, '0', 0, '系统减少余额', 'now_money', 'recharge', 100.00, 9200.00, '系统扣除了100.0余额', 1580440702, 1); +INSERT INTO `yx_user_bill` VALUES (72, 12, '104', 1, '商品退款', 'now_money', 'pay_product_refund', 0.00, 8766.20, '订单退款到余额', 1580440738, 1); +INSERT INTO `yx_user_bill` VALUES (73, 12, '104', 1, '商品退款', 'now_money', 'pay_product_refund', 0.00, 8766.20, '订单退款到余额', 1580440967, 1); +INSERT INTO `yx_user_bill` VALUES (74, 11, '112', 0, '购买商品', 'now_money', 'pay_product', 15.50, 9999.00, '余额支付', 1581586206, 1); +INSERT INTO `yx_user_bill` VALUES (75, 11, '113', 0, '购买商品', 'now_money', 'pay_product', 11.00, 9983.50, '余额支付', 1582080107, 1); +INSERT INTO `yx_user_bill` VALUES (76, 11, '114', 0, '购买商品', 'now_money', 'pay_product', 11.00, 9972.50, '余额支付', 1582080948, 1); +INSERT INTO `yx_user_bill` VALUES (77, 11, '115', 0, '购买商品', 'now_money', 'pay_product', 11.00, 9961.50, '余额支付', 1582081730, 1); +INSERT INTO `yx_user_bill` VALUES (78, 11, '116', 0, '购买商品', 'now_money', 'pay_product', 11.00, 9950.50, '余额支付', 1582081800, 1); +INSERT INTO `yx_user_bill` VALUES (79, 11, '117', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9939.50, '余额支付', 1582704871, 1); +INSERT INTO `yx_user_bill` VALUES (80, 11, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 0.00, '', 1582781884, 1); +INSERT INTO `yx_user_bill` VALUES (81, 11, '118', 0, '购买商品', 'now_money', 'pay_product', 15.50, 9819.50, '余额支付', 1582809322, 1); +INSERT INTO `yx_user_bill` VALUES (82, 11, '120', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9804.00, '余额支付', 1582810596, 1); +INSERT INTO `yx_user_bill` VALUES (83, 11, '120', 1, '购买商品赠送积分', 'integral', 'gain', 1.00, 10.00, '购买商品赠送', 1582812352, 1); +INSERT INTO `yx_user_bill` VALUES (84, 11, '8f93eb694f7142c5aeddd8acc6876eaf', 0, '积分抵扣', 'integral', 'deduction', 100.00, 1100.00, '购买商品使用', 1582970347, 1); +INSERT INTO `yx_user_bill` VALUES (85, 11, '122', 0, '购买商品', 'now_money', 'pay_product', 140.00, 9684.00, '余额支付', 1582970348, 1); +INSERT INTO `yx_user_bill` VALUES (86, 11, 'ac31a1bb85f14cfe92c16169495c7db7', 0, '积分抵扣', 'integral', 'deduction', 100.00, 1000.00, '购买商品使用', 1582970945, 1); +INSERT INTO `yx_user_bill` VALUES (87, 11, '123', 0, '购买商品', 'now_money', 'pay_product', 140.00, 9544.00, '余额支付', 1582970946, 1); +INSERT INTO `yx_user_bill` VALUES (88, 11, 'a51e7f23efa8430499f45ad76d45d696', 0, '积分抵扣', 'integral', 'deduction', 120.00, 900.00, '购买商品使用', 1582971169, 1); +INSERT INTO `yx_user_bill` VALUES (89, 11, '124', 0, '购买商品', 'now_money', 'pay_product', 0.00, 9404.00, '余额支付', 1582971170, 1); +INSERT INTO `yx_user_bill` VALUES (90, 11, 'f3ced8276fb64d1a90fe03c5efbad68a', 0, '积分抵扣', 'integral', 'deduction', 100.00, 100.00, '购买商品使用', 1582971472, 1); +INSERT INTO `yx_user_bill` VALUES (91, 11, '125', 0, '购买商品', 'now_money', 'pay_product', 20.00, 9404.00, '余额支付', 1582971472, 1); +INSERT INTO `yx_user_bill` VALUES (92, 11, '126', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9384.00, '余额支付', 1582990630, 1); +INSERT INTO `yx_user_bill` VALUES (93, 11, '127', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9264.00, '余额支付', 1583392756, 1); +INSERT INTO `yx_user_bill` VALUES (94, 11, '128', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9144.00, '余额支付', 1583393731, 1); +INSERT INTO `yx_user_bill` VALUES (95, 11, '129', 0, '购买商品', 'now_money', 'pay_product', 120.00, 9024.00, '余额支付', 1583394584, 1); +INSERT INTO `yx_user_bill` VALUES (96, 11, '130', 0, '购买商品', 'now_money', 'pay_product', 130.00, 8904.00, '余额支付', 1583399210, 1); +INSERT INTO `yx_user_bill` VALUES (97, 11, '131', 0, '购买商品', 'now_money', 'pay_product', 120.00, 8774.00, '余额支付', 1583403288, 1); +INSERT INTO `yx_user_bill` VALUES (98, 11, '132', 0, '购买商品', 'now_money', 'pay_product', 120.00, 8654.00, '余额支付', 1583410828, 1); +INSERT INTO `yx_user_bill` VALUES (99, 11, '133', 0, '购买商品', 'now_money', 'pay_product', 130.00, 8534.00, '余额支付', 1583416032, 1); +INSERT INTO `yx_user_bill` VALUES (100, 11, '135', 0, '购买商品', 'now_money', 'pay_product', 135.50, 8404.00, '余额支付', 1583486513, 1); +INSERT INTO `yx_user_bill` VALUES (101, 11, '136', 0, '购买商品', 'now_money', 'pay_product', 130.00, 8268.50, '余额支付', 1584171672, 1); +INSERT INTO `yx_user_bill` VALUES (102, 11, '137', 0, '购买商品', 'now_money', 'pay_product', 11.00, 8138.50, '余额支付', 1584175854, 1); +INSERT INTO `yx_user_bill` VALUES (103, 11, '138', 0, '购买商品', 'now_money', 'pay_product', 120.00, 8127.50, '余额支付', 1585207556, 1); +INSERT INTO `yx_user_bill` VALUES (104, 11, '139', 0, '购买商品', 'now_money', 'pay_product', 130.00, 8007.50, '余额支付', 1585293458, 1); +INSERT INTO `yx_user_bill` VALUES (105, 11, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 0.00, '', 1585296317, 1); +INSERT INTO `yx_user_bill` VALUES (106, 11, '0', 1, '签到奖励', 'integral', 'sign', 10.00, 10.00, '', 1585297108, 1); +INSERT INTO `yx_user_bill` VALUES (107, 11, '140', 0, '购买商品', 'now_money', 'pay_product', 128.80, 7877.50, '余额支付', 1585385723, 1); +INSERT INTO `yx_user_bill` VALUES (108, 11, '8cb56603f508449a8be484906978e566', 0, '积分抵扣', 'integral', 'deduction', 5.00, 10.00, '购买商品使用', 1585899809, 1); +INSERT INTO `yx_user_bill` VALUES (109, 11, '141', 0, '购买商品', 'now_money', 'pay_product', 5.99, 7748.70, '余额支付', 1585899809, 1); +INSERT INTO `yx_user_bill` VALUES (110, 11, '58d4c7bf44e046e7a90791cd7feeca2e', 0, '积分抵扣', 'integral', 'deduction', 5.00, 5.00, '购买商品使用', 1585899833, 1); +INSERT INTO `yx_user_bill` VALUES (111, 11, 'a7bab1ca9e824141af8759d0c637c9ec', 0, '积分抵扣', 'integral', 'deduction', 1.99, 1000.00, '购买商品使用', 1585900321, 1); +INSERT INTO `yx_user_bill` VALUES (112, 11, '143', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900321, 1); +INSERT INTO `yx_user_bill` VALUES (113, 11, '94db868bbd0f48f8ac9b882a48ecf04e', 0, '积分抵扣', 'integral', 'deduction', 1.99, 998.01, '购买商品使用', 1585900414, 1); +INSERT INTO `yx_user_bill` VALUES (114, 11, '144', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900414, 1); +INSERT INTO `yx_user_bill` VALUES (115, 11, '2863a49ed88846cf920447ded1049908', 0, '积分抵扣', 'integral', 'deduction', 1.99, 996.02, '购买商品使用', 1585900433, 1); +INSERT INTO `yx_user_bill` VALUES (116, 11, '145', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900433, 1); +INSERT INTO `yx_user_bill` VALUES (117, 11, 'e530119f15094f99b710d0dbaaf2243f', 0, '积分抵扣', 'integral', 'deduction', 1.99, 994.03, '购买商品使用', 1585900497, 1); +INSERT INTO `yx_user_bill` VALUES (118, 11, '147', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900497, 1); +INSERT INTO `yx_user_bill` VALUES (119, 11, 'bae5bdd2288840369cdaab1953d2b243', 0, '积分抵扣', 'integral', 'deduction', 1.99, 992.04, '购买商品使用', 1585900580, 1); +INSERT INTO `yx_user_bill` VALUES (120, 11, '148', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7742.71, '余额支付', 1585900580, 1); +INSERT INTO `yx_user_bill` VALUES (121, 11, '59c0e78109fc4d44bae85e1de7a7f8a5', 0, '积分抵扣', 'integral', 'deduction', 0.00, 990.05, '购买商品使用', 1585901832, 1); +INSERT INTO `yx_user_bill` VALUES (122, 11, '149', 0, '购买商品', 'now_money', 'pay_product', 1.99, 7742.71, '余额支付', 1585901832, 1); +INSERT INTO `yx_user_bill` VALUES (123, 11, '7903fe2a57a2443794540fc4908aba36', 0, '积分抵扣', 'integral', 'deduction', 1.99, 990.05, '购买商品使用', 1585901988, 1); +INSERT INTO `yx_user_bill` VALUES (124, 11, '150', 0, '购买商品', 'now_money', 'pay_product', 0.00, 7740.72, '余额支付', 1585901989, 1); +INSERT INTO `yx_user_bill` VALUES (125, 11, '151', 0, '购买商品', 'now_money', 'pay_product', 1.01, 7740.72, '余额支付', 1585907993, 1); +INSERT INTO `yx_user_bill` VALUES (126, 11, '152', 0, '购买商品', 'now_money', 'pay_product', 1.00, 7739.71, '余额支付', 1586065086, 1); +INSERT INTO `yx_user_bill` VALUES (127, 11, '153', 0, '购买商品', 'now_money', 'pay_product', 118.80, 7738.71, '余额支付', 1586065172, 1); + +-- ---------------------------- +-- 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 = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户提现表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_user_extract +-- ---------------------------- +INSERT INTO `yx_user_extract` VALUES (1, 11, '会敲代码的喵', 'weixin', '0', '', '', 1.00, NULL, 5.00, '失败了', 1578455379, 1573648445, -1, 'hu'); + +-- ---------------------------- +-- 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 = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户等级记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_user_level +-- ---------------------------- +INSERT INTO `yx_user_level` VALUES (4, 11, 1, 1, 0, 1, 0, 1, '恭喜你成为了普通会员', 0, 0, 1585297281, 99); + +-- ---------------------------- +-- 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', + `nickname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '', + `order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '订单号', + `price` decimal(8, 2) NULL DEFAULT NULL COMMENT '充值金额', + `give_price` decimal(8, 2) NULL DEFAULT 0.00 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 = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户充值表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_user_recharge +-- ---------------------------- +INSERT INTO `yx_user_recharge` VALUES (1, 11, 'hupeng', '1234428298159718400', 200.00, 0.00, 'weixin', 0, NULL, 1583145615, 0.00); +INSERT INTO `yx_user_recharge` VALUES (2, 11, '会敲代码的喵88', '1235853569362493440', 110.00, 0.00, 'weixin', 0, NULL, 1583485426, 0.00); +INSERT INTO `yx_user_recharge` VALUES (3, 11, '会敲代码的喵88', '1235874304738983936', 111.00, 0.00, 'weixin', 0, NULL, 1583490370, 0.00); +INSERT INTO `yx_user_recharge` VALUES (4, 11, '会敲代码的喵88', '1235874561447165952', 111.00, 0.00, 'weixin', 0, NULL, 1583490431, 0.00); +INSERT INTO `yx_user_recharge` VALUES (5, 11, '会敲代码的喵88', '1235874725738053632', 111.00, 0.00, 'weixin', 0, NULL, 1583490470, 0.00); +INSERT INTO `yx_user_recharge` VALUES (6, 11, '会敲代码的喵88', '1235875114126409728', 1111.00, 0.00, 'weixin', 0, NULL, 1583490563, 0.00); +INSERT INTO `yx_user_recharge` VALUES (7, 11, '会敲代码的喵88', '1235876251080589312', 1111.00, 0.00, 'weixin', 0, NULL, 1583490834, 0.00); +INSERT INTO `yx_user_recharge` VALUES (8, 11, '会敲代码的喵88', '1242024244678754304', 100.00, 10.00, 'weixin', 0, NULL, 1584956630, 0.00); +INSERT INTO `yx_user_recharge` VALUES (9, 11, '会敲代码的喵88', '1242024501730869248', 111.00, 111.00, 'weixin', 0, NULL, 1584956691, 0.00); +INSERT INTO `yx_user_recharge` VALUES (10, 11, '会敲代码的喵88', '1242025322262560768', 222.00, 0.00, 'weixin', 0, NULL, 1584956887, 0.00); +INSERT INTO `yx_user_recharge` VALUES (11, 11, '会敲代码的喵88', '1246020207407792128', 1.00, 1.00, 'weixin', 0, NULL, 1585909342, 0.00); +INSERT INTO `yx_user_recharge` VALUES (12, 11, '会敲代码的喵88', '1246379540565983232', 10.00, 100.00, 'weixin', 0, NULL, 1585995013, 0.00); +INSERT INTO `yx_user_recharge` VALUES (13, 11, '会敲代码的喵88', '1246379584941719552', 1.00, 1.00, 'weixin', 0, NULL, 1585995024, 0.00); +INSERT INTO `yx_user_recharge` VALUES (14, 11, '会敲代码的喵88', '1246383201052524544', 10.00, 100.00, 'weixin', 0, NULL, 1585995886, 0.00); +INSERT INTO `yx_user_recharge` VALUES (15, 11, '会敲代码的喵88', '1246383225413042176', 10.00, 100.00, 'weixin', 0, NULL, 1585995892, 0.00); + +-- ---------------------------- +-- 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 = 10 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 = 17 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户任务完成记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_user_task_finish +-- ---------------------------- +INSERT INTO `yx_user_task_finish` VALUES (13, 1, 11, 0, 1585297278); +INSERT INTO `yx_user_task_finish` VALUES (14, 2, 11, 0, 1585297278); +INSERT INTO `yx_user_task_finish` VALUES (15, 16, 11, 0, 1585297278); +INSERT INTO `yx_user_task_finish` VALUES (16, 17, 11, 0, 1585297369); + +-- ---------------------------- +-- 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_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 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 = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信关键字回复表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_wechat_reply +-- ---------------------------- +INSERT INTO `yx_wechat_reply` VALUES (1, 'subscribe', 'text', '{\"content\":\"2222222222244449999\"}', 1, NULL); + +-- ---------------------------- +-- 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 = 15 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 (13, 'OPENTM207791277', '订单支付成功通知', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n支付金额:{{keyword2.DATA}}\n{{remark.DATA}}', 'hJV1d1OwWB_lbPrSaRHi9RGr5CFAF4PJcZdYeg73Mtg', '1528966759', 1); +INSERT INTO `yx_wechat_template` VALUES (14, 'OPENTM405847076', '帐户资金变动提醒', '{{first.DATA}}\n变动类型:{{keyword1.DATA}}\n变动时间:{{keyword2.DATA}}\n变动金额:{{keyword3.DATA}}\n{{remark.DATA}}', 'ePF4RS3ONCEuS9AuPyqZ2Th_B-HZ6E1CIpnJRt7ACwI', '1528966759', 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, + UNIQUE INDEX `openid`(`openid`) 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 +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信用户表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of yx_wechat_user +-- ---------------------------- +INSERT INTO `yx_wechat_user` VALUES (1, NULL, NULL, NULL, 'hupeng', '', 0, '', '', '', '', NULL, 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'wechat'); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/sql/数据库说明.txt b/sql/数据库说明.txt index 17822a6b..efa0c8cf 100644 --- a/sql/数据库说明.txt +++ b/sql/数据库说明.txt @@ -1,5 +1,5 @@ -新项目 直接导入yshop2.1.sql即可 -2.0升级到2.1,直接把yshop2.1升级sql.txt里面sql语句运行即可 - -2.0.1:yx_cache表修改为yx_wechat_menu表 - +新项目 直接导入yshop2.1.sql即可 +2.0升级到2.1,直接把yshop2.1升级sql.txt里面sql语句运行即可 + +2.0.1:yx_cache表修改为yx_wechat_menu表 + diff --git a/yshop-api/pom.xml b/yshop-api/pom.xml index 1b3601e4..e113b267 100644 --- a/yshop-api/pom.xml +++ b/yshop-api/pom.xml @@ -5,7 +5,7 @@ yshop co.yixiang - 2.2 + 2.1 4.0.0 @@ -21,12 +21,12 @@ co.yixiang yshop-tools - 2.2 + 2.1 co.yixiang yshop-mp - 2.2 + 2.1 @@ -113,4 +113,4 @@ - + \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/config/RedisConfigProperties.java b/yshop-api/src/main/java/co/yixiang/config/RedisConfigProperties.java index d94c0e0f..58099bc2 100644 --- a/yshop-api/src/main/java/co/yixiang/config/RedisConfigProperties.java +++ b/yshop-api/src/main/java/co/yixiang/config/RedisConfigProperties.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/config/RedisListenerConfig.java b/yshop-api/src/main/java/co/yixiang/config/RedisListenerConfig.java index 1538aa2e..549b5679 100644 --- a/yshop-api/src/main/java/co/yixiang/config/RedisListenerConfig.java +++ b/yshop-api/src/main/java/co/yixiang/config/RedisListenerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/listener/RedisKeyExpirationListener.java b/yshop-api/src/main/java/co/yixiang/listener/RedisKeyExpirationListener.java index 0e0acbcd..ef0f2f4c 100644 --- a/yshop-api/src/main/java/co/yixiang/listener/RedisKeyExpirationListener.java +++ b/yshop-api/src/main/java/co/yixiang/listener/RedisKeyExpirationListener.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/entity/YxStoreSeckill.java b/yshop-api/src/main/java/co/yixiang/modules/activity/entity/YxStoreSeckill.java index 06efda5f..9e47053b 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/entity/YxStoreSeckill.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/entity/YxStoreSeckill.java @@ -20,7 +20,7 @@ import java.util.Date; * 商品秒杀产品表 *

* - * @author hupeng + * @author xuwenbo * @since 2019-12-14 */ @Data diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/mapper/YxStoreSeckillMapper.java b/yshop-api/src/main/java/co/yixiang/modules/activity/mapper/YxStoreSeckillMapper.java index 48934df8..d4513f97 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/mapper/YxStoreSeckillMapper.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/mapper/YxStoreSeckillMapper.java @@ -20,7 +20,7 @@ import java.util.List; * 商品秒杀产品表 Mapper 接口 *

* - * @author hupeng + * @author xuwenbo * @since 2019-12-14 */ @Repository diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainService.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainService.java index d0109c5d..a76cafcc 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainUserHelpService.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainUserHelpService.java index 61c78356..92976ead 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainUserHelpService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainUserHelpService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainUserService.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainUserService.java index 821bb055..afa13207 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainUserService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainUserService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreCombinationService.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreCombinationService.java index b5675367..cecfc035 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreCombinationService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreCombinationService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStorePinkService.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStorePinkService.java index 80fcd6cd..f69d9270 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStorePinkService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStorePinkService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreSeckillService.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreSeckillService.java index 54b6bd42..21728e9d 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreSeckillService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/YxStoreSeckillService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -23,7 +23,7 @@ import java.util.List; * 商品秒杀产品表 服务类 *

* - * @author hupeng + * @author xuwenbo * @since 2019-12-14 */ public interface YxStoreSeckillService extends BaseService { diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java index 25173dd6..95a001b4 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainUserHelpServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainUserHelpServiceImpl.java index 1dca8791..e630dbcf 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainUserHelpServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainUserHelpServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainUserServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainUserServiceImpl.java index 8c82c054..93d61686 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainUserServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainUserServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java index 2c27b1a6..96af7a5f 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStorePinkServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStorePinkServiceImpl.java index cf9c6aad..f92b1437 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStorePinkServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStorePinkServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java index 5a03a1df..26aa75c7 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreBargainController.java b/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreBargainController.java index 4e1bb9ac..be086eab 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreBargainController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreBargainController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -16,7 +16,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.extra.qrcode.QrCodeUtil; import cn.hutool.http.HttpUtil; import co.yixiang.annotation.AnonymousAccess; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.enums.AppFromEnum; diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreCombinationController.java b/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreCombinationController.java index 5c666010..afdb09d3 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreCombinationController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreCombinationController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -15,7 +15,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.extra.qrcode.QrCodeUtil; import cn.hutool.http.HttpUtil; import co.yixiang.annotation.AnonymousAccess; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.enums.AppFromEnum; diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreSeckillController.java b/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreSeckillController.java index e1706c4f..5ae4c127 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreSeckillController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/web/controller/StoreSeckillController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/web/param/YxStoreSeckillQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/activity/web/param/YxStoreSeckillQueryParam.java index 5d7f276f..c67b55b0 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/web/param/YxStoreSeckillQueryParam.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/web/param/YxStoreSeckillQueryParam.java @@ -11,7 +11,7 @@ import co.yixiang.common.web.param.QueryParam; * 商品秒杀产品表 查询参数对象 *

* - * @author hupeng + * @author xuwenbo * @date 2019-12-14 */ @Data diff --git a/yshop-api/src/main/java/co/yixiang/modules/activity/web/vo/YxStoreSeckillQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/activity/web/vo/YxStoreSeckillQueryVo.java index 0864e20d..458009ee 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/activity/web/vo/YxStoreSeckillQueryVo.java +++ b/yshop-api/src/main/java/co/yixiang/modules/activity/web/vo/YxStoreSeckillQueryVo.java @@ -16,7 +16,7 @@ import java.util.List; * 商品秒杀产品表 查询结果对象 *

* - * @author hupeng + * @author xuwenbo * @date 2019-12-14 */ @Data @@ -116,4 +116,4 @@ public class YxStoreSeckillQueryVo implements Serializable{ -} +} \ No newline at end of file diff --git a/yshop-api/src/main/java/co/yixiang/modules/manage/service/YxExpressService.java b/yshop-api/src/main/java/co/yixiang/modules/manage/service/YxExpressService.java index b15c5381..9b5a4322 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/manage/service/YxExpressService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/manage/service/YxExpressService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/manage/service/impl/YxExpressServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/manage/service/impl/YxExpressServiceImpl.java index a9a132a2..dcb1673b 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/manage/service/impl/YxExpressServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/manage/service/impl/YxExpressServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/manage/web/controller/ShoperController.java b/yshop-api/src/main/java/co/yixiang/modules/manage/web/controller/ShoperController.java index 8aac2ab9..e1bc8047 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/manage/web/controller/ShoperController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/manage/web/controller/ShoperController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 24afb1fe..a6b1067c 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index b306ff85..2ed8bee6 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 445d3b4d..9e89ada1 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 59cbbe74..74974904 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 92ba935a..d4dfda9e 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -11,10 +11,11 @@ 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 co.yixiang.logging.service.mapper.LogMapper; import lombok.AllArgsConstructor; 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; @@ -33,7 +34,7 @@ import java.util.stream.Collectors; public class VisitsServiceImpl implements VisitsService { private final VisitsRepository visitsRepository; - private final LogMapper logMapper; + private final LogRepository logRepository; @Override public void save() { @@ -54,7 +55,7 @@ public class VisitsServiceImpl implements VisitsService { LocalDate localDate = LocalDate.now(); Visits visits = visitsRepository.findByDate(localDate.toString()); visits.setPvCounts(visits.getPvCounts()+1); - long ipCounts = logMapper.findIp(localDate.toString(), localDate.plusDays(1).toString()); + long ipCounts = logRepository.findIp(localDate.toString(), localDate.plusDays(1).toString()); visits.setIpCounts(ipCounts); visitsRepository.save(visits); } diff --git a/yshop-api/src/main/java/co/yixiang/modules/notify/AliyunSmsSender.java b/yshop-api/src/main/java/co/yixiang/modules/notify/AliyunSmsSender.java index fe326111..3b0d1cc1 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/notify/AliyunSmsSender.java +++ b/yshop-api/src/main/java/co/yixiang/modules/notify/AliyunSmsSender.java @@ -1,6 +1,6 @@ package co.yixiang.modules.notify; -import co.yixiang.tools.utils.JacksonUtil; +import co.yixiang.utils.JacksonUtil; import com.aliyuncs.CommonRequest; import com.aliyuncs.CommonResponse; import com.aliyuncs.DefaultAcsClient; 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 index d4c3c9d3..7a151e31 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 762dfe27..91ea66f5 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index aaab19a6..a5ebc66d 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 007c3321..2e714e4a 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 9c1d6921..44fbb1dc 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -16,8 +16,8 @@ import cn.hutool.core.util.StrUtil; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.web.vo.Paging; import co.yixiang.constant.ShopConstants; -import co.yixiang.tools.domain.AlipayConfig; -import co.yixiang.tools.domain.vo.TradeVo; +import co.yixiang.domain.AlipayConfig; +import co.yixiang.domain.vo.TradeVo; import co.yixiang.enums.*; import co.yixiang.exception.ErrorRequestException; import co.yixiang.modules.activity.service.*; @@ -59,7 +59,7 @@ import co.yixiang.modules.user.web.vo.YxWechatUserQueryVo; import co.yixiang.mp.service.YxPayService; import co.yixiang.mp.service.YxTemplateService; import co.yixiang.mp.service.YxMiniPayService; -import co.yixiang.tools.service.AlipayConfigService; +import co.yixiang.service.AlipayService; import co.yixiang.utils.OrderUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -142,7 +142,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl map = new LinkedHashMap<>(); + map.put("token", token); + map.put("expires_time", expiresTimeStr); + + if (singleLogin) { + //踢掉之前已经登录的token + onlineUserService.checkLoginOnUser(jwtUserT.getUsername(), token); + } + + //设置推广关系 + if (StrUtil.isNotEmpty(spread) && !spread.equals("NaN")) { + userService.setSpread(Integer.valueOf(spread), + jwtUserT.getId().intValue()); + } + + // 返回 token + return ApiResult.ok(map); + } catch (WxErrorException e) { + e.printStackTrace(); + log.error(e.getMessage()); + return ApiResult.fail("授权失败"); + } + } @@ -162,8 +304,135 @@ public class AuthController { * 2、目前登陆授权打通方式适用于新项目(也就是你yx_user、yx_wechat_user都是空的) * 3、如果你以前已经有数据请自行处理 */ - return ApiResult.ok(userService.wxappAuth(loginParam,request)) ; + String code = loginParam.getCode(); + String encryptedData = loginParam.getEncryptedData(); + String iv = loginParam.getIv(); + String spread = loginParam.getSpread(); + try { + //读取redis配置 + String appId = RedisUtil.get(RedisKeyEnum.WXAPP_APPID.getValue()); + String secret = RedisUtil.get(RedisKeyEnum.WXAPP_SECRET.getValue()); + if (StrUtil.isBlank(appId) || StrUtil.isBlank(secret)) { + throw new ErrorRequestException("请先配置小程序"); + } + WxMaDefaultConfigImpl wxMaConfig = new WxMaDefaultConfigImpl(); + wxMaConfig.setAppid(appId); + wxMaConfig.setSecret(secret); + wxMaService.setWxMaConfig(wxMaConfig); + WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(code); + String openid = session.getOpenid(); + //如果开启了UnionId + if (StrUtil.isNotBlank(session.getUnionid())) { + openid = session.getUnionid(); + } + + YxUser yxUser = userService.findByName(openid); + String username = ""; + if(ObjectUtil.isNull(yxUser)){ + + WxMaUserInfo wxMpUser = wxMaService.getUserService() + .getUserInfo(session.getSessionKey(), encryptedData, iv); + //过滤掉表情 + String nickname = EmojiParser.removeAllEmojis(wxMpUser.getNickName()); + //用户保存 + YxUser user = new YxUser(); + user.setAccount(nickname); + + //如果开启了UnionId + if (StrUtil.isNotBlank(wxMpUser.getUnionId())) { + username = wxMpUser.getUnionId(); + user.setUsername(wxMpUser.getUnionId()); + }else{ + username = wxMpUser.getOpenId(); + user.setUsername(wxMpUser.getOpenId()); + } + user.setPassword(passwordEncoder.encode(ShopConstants.YSHOP_DEFAULT_PWD)); + user.setPwd(passwordEncoder.encode(ShopConstants.YSHOP_DEFAULT_PWD)); + user.setPhone(""); + user.setUserType(AppFromEnum.ROUNTINE.getValue()); + user.setAddTime(OrderUtil.getSecondTimestampTwo()); + user.setLastTime(OrderUtil.getSecondTimestampTwo()); + user.setNickname(nickname); + user.setAvatar(wxMpUser.getAvatarUrl()); + user.setNowMoney(BigDecimal.ZERO); + user.setBrokeragePrice(BigDecimal.ZERO); + user.setIntegral(BigDecimal.ZERO); + + userService.save(user); + + + //保存微信用户 + YxWechatUser yxWechatUser = new YxWechatUser(); + // System.out.println("wxMpUser:"+wxMpUser); + yxWechatUser.setAddTime(OrderUtil.getSecondTimestampTwo()); + yxWechatUser.setNickname(nickname); + yxWechatUser.setRoutineOpenid(wxMpUser.getOpenId()); + int sub = 0; + yxWechatUser.setSubscribe(sub); + yxWechatUser.setSex(Integer.valueOf(wxMpUser.getGender())); + yxWechatUser.setLanguage(wxMpUser.getLanguage()); + yxWechatUser.setCity(wxMpUser.getCity()); + yxWechatUser.setProvince(wxMpUser.getProvince()); + yxWechatUser.setCountry(wxMpUser.getCountry()); + yxWechatUser.setHeadimgurl(wxMpUser.getAvatarUrl()); + if (StrUtil.isNotBlank(wxMpUser.getUnionId())) { + yxWechatUser.setUnionid(wxMpUser.getUnionId()); + } + yxWechatUser.setUid(user.getUid()); + + wechatUserService.save(yxWechatUser); + + }else{ + username = yxUser.getUsername(); + if(StrUtil.isNotBlank(session.getOpenid()) || StrUtil.isNotBlank(session.getUnionid())){ + YxWechatUser wechatUser = new YxWechatUser(); + wechatUser.setUid(yxUser.getUid()); + wechatUser.setUnionid(session.getUnionid()); + wechatUser.setRoutineOpenid(session.getOpenid()); + + wechatUserService.updateById(wechatUser); + } + } + + + UsernamePasswordAuthenticationToken authenticationToken = + new UsernamePasswordAuthenticationToken(username, + ShopConstants.YSHOP_DEFAULT_PWD); + + Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken); + SecurityContextHolder.getContext().setAuthentication(authentication); + // 生成令牌 + String token = tokenProvider.createToken(authentication); + final JwtUser jwtUserT = (JwtUser) authentication.getPrincipal(); + // 保存在线信息 + onlineUserService.save(jwtUserT, token, request); + + Date expiresTime = tokenProvider.getExpirationDateFromToken(token); + String expiresTimeStr = DateUtil.formatDateTime(expiresTime); + + + Map map = new LinkedHashMap<>(); + map.put("token", token); + map.put("expires_time", expiresTimeStr); + + if (singleLogin) { + //踢掉之前已经登录的token + onlineUserService.checkLoginOnUser(jwtUserT.getUsername(), token); + } + + //设置推广关系 + if (StrUtil.isNotEmpty(spread)) { + userService.setSpread(Integer.valueOf(spread), + jwtUserT.getId().intValue()); + } + + // 返回 token + return ApiResult.ok(map); + } catch (WxErrorException e) { + log.error(e.getMessage(), e); + return ApiResult.fail(e.toString()); + } } 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 index 88e5cddf..424bdc61 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/service/OnlineUserService.java b/yshop-api/src/main/java/co/yixiang/modules/security/service/OnlineUserService.java index 85dced35..bbff3e0f 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/security/service/OnlineUserService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/security/service/OnlineUserService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/security/service/UserDetailsServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/security/service/UserDetailsServiceImpl.java index eaa0bf1a..7584ae63 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/security/service/UserDetailsServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/security/service/UserDetailsServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/ArticleService.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/ArticleService.java index 098862db..30f9666c 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/shop/service/ArticleService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/ArticleService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 2347b29e..2da77581 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 5cf9f0ed..596192e3 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 4d9ddc0f..26ea2957 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 85eb96b1..db2aa7a2 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 2047fbbd..813f1d12 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index dafecd98..445251cf 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 601b9a8d..e17be8e2 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 468b7884..8bbea3a5 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 61edea2c..01723e5a 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index c79cc9a3..0f48f940 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index e015d7f8..2e8da9f9 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 33e43cf3..c512e00a 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index ea891751..951204d2 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index ffc4891f..e52e4be4 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 59cbe477..34656529 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/ArticleServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/ArticleServiceImpl.java index eb06a555..e5c2b1c8 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/ArticleServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/ArticleServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index e8d39d5a..1b608069 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 3621e546..03d5881f 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 85fe4784..c6a5b1db 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 61879956..56a798d3 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index cc60ba45..a24d8f1c 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 65e1afd7..86c78e86 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 1e3e7aa6..416cce3c 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 9198112b..49f7e530 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 6a282ea8..313085c1 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index ccc11a91..845876aa 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index a1349527..bacfc15e 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 3ce6106e..ee3b1379 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index eaabdacd..a979eeb9 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index aee6eb4b..77566dd1 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java index 8f51e64f..20d1506b 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreStaffServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreStaffServiceImpl.java index b395ed68..9aebcc06 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreStaffServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreStaffServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 685d2778..e441a2d5 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 6ccb690d..f6bb4cf7 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -9,7 +9,7 @@ package co.yixiang.modules.shop.web.controller; import cn.hutool.core.util.ObjectUtil; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.enums.CouponEnum; 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 index af59c7cf..ea2abade 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 40b2dc6c..7e1e82fd 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -9,7 +9,7 @@ package co.yixiang.modules.shop.web.controller; import cn.hutool.core.util.ObjectUtil; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.modules.shop.service.YxStoreCartService; 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 index cbf61d7e..013b3f5f 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index bd52ebde..fb63cff0 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -12,8 +12,9 @@ import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.qrcode.QrCodeUtil; +import cn.hutool.http.HttpUtil; import co.yixiang.annotation.AnonymousAccess; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.enums.AppFromEnum; @@ -28,6 +29,7 @@ import co.yixiang.modules.user.entity.YxSystemAttachment; import co.yixiang.modules.user.service.YxSystemAttachmentService; import co.yixiang.modules.user.service.YxUserService; import co.yixiang.modules.user.web.vo.YxUserQueryVo; +import co.yixiang.utils.OrderUtil; import co.yixiang.utils.SecurityUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemAttachmentService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemAttachmentService.java index 190a89cc..59be0570 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemAttachmentService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemAttachmentService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemUserLevelService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemUserLevelService.java index 8f5ccb26..1964d29e 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemUserLevelService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemUserLevelService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemUserTaskService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemUserTaskService.java index 27a549c7..c9b71cba 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemUserTaskService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxSystemUserTaskService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index c8e58387..378b93a4 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 663b9906..85e0b329 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserExtractService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserExtractService.java index fcdc4ae7..4c94dc71 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserExtractService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserExtractService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserLevelService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserLevelService.java index a3fead10..48a569af 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserLevelService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserLevelService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserRechargeService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserRechargeService.java index 28d88887..502d1345 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserRechargeService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserRechargeService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index bcb4db26..48dbbe00 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -11,14 +11,12 @@ package co.yixiang.modules.user.service; import co.yixiang.common.service.BaseService; import co.yixiang.common.web.vo.Paging; import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo; -import co.yixiang.modules.security.rest.param.LoginParam; import co.yixiang.modules.user.entity.YxUser; import co.yixiang.modules.user.web.dto.PromUserDTO; import co.yixiang.modules.user.web.param.PromParam; import co.yixiang.modules.user.web.param.YxUserQueryParam; import co.yixiang.modules.user.web.vo.YxUserQueryVo; -import javax.servlet.http.HttpServletRequest; import java.io.Serializable; import java.util.List; @@ -73,7 +71,4 @@ public interface YxUserService extends BaseService { */ Paging getYxUserPageList(YxUserQueryParam yxUserQueryParam) throws Exception; - Object authLogin(String code, String spread, HttpServletRequest request); - - Object wxappAuth(LoginParam loginParam, HttpServletRequest request); } diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserSignService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserSignService.java index 40e1b001..014e6e8f 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserSignService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserSignService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserTaskFinishService.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserTaskFinishService.java index 363f97cf..2f8082ee 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserTaskFinishService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/YxUserTaskFinishService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 556035fd..77e2a4c6 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemAttachmentServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemAttachmentServiceImpl.java index f9cc33d2..57c96b71 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemAttachmentServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemAttachmentServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemUserLevelServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemUserLevelServiceImpl.java index a4e5bee0..2017720a 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemUserLevelServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemUserLevelServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemUserTaskServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemUserTaskServiceImpl.java index 890bcd22..814aeafc 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemUserTaskServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxSystemUserTaskServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 3d9f4813..f8b3abce 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index a2f64342..ded1faff 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserExtractServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserExtractServiceImpl.java index f1df5b77..0e041a6d 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserExtractServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserExtractServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserLevelServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserLevelServiceImpl.java index c28c5489..d7c6de1e 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserLevelServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserLevelServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java index c4c81170..807847df 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserRechargeServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 30b9799b..27010c01 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -8,71 +8,42 @@ */ package co.yixiang.modules.user.service.impl; -import cn.binarywang.wx.miniapp.api.WxMaService; -import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; -import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; -import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; -import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import co.yixiang.common.api.ApiResult; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.web.vo.Paging; -import co.yixiang.constant.ShopConstants; -import co.yixiang.enums.AppFromEnum; -import co.yixiang.enums.RedisKeyEnum; -import co.yixiang.exception.BadRequestException; import co.yixiang.exception.ErrorRequestException; import co.yixiang.modules.order.service.YxStoreOrderService; import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo; -import co.yixiang.modules.security.rest.param.LoginParam; -import co.yixiang.modules.security.security.TokenProvider; -import co.yixiang.modules.security.security.vo.JwtUser; -import co.yixiang.modules.security.service.OnlineUserService; import co.yixiang.modules.shop.service.YxStoreCouponUserService; import co.yixiang.modules.shop.service.YxSystemConfigService; import co.yixiang.modules.shop.service.YxSystemStoreStaffService; import co.yixiang.modules.user.entity.YxUser; import co.yixiang.modules.user.entity.YxUserBill; import co.yixiang.modules.user.entity.YxUserLevel; -import co.yixiang.modules.user.entity.YxWechatUser; import co.yixiang.modules.user.mapper.YxUserMapper; import co.yixiang.modules.user.service.YxUserBillService; import co.yixiang.modules.user.service.YxUserLevelService; import co.yixiang.modules.user.service.YxUserService; -import co.yixiang.modules.user.service.YxWechatUserService; import co.yixiang.modules.user.web.dto.PromUserDTO; import co.yixiang.modules.user.web.param.PromParam; import co.yixiang.modules.user.web.param.YxUserQueryParam; import co.yixiang.modules.user.web.vo.YxUserQueryVo; -import co.yixiang.mp.config.WxMpConfiguration; import co.yixiang.utils.OrderUtil; -import co.yixiang.utils.RedisUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.vdurmont.emoji.EmojiParser; import lombok.extern.slf4j.Slf4j; -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.Value; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletRequest; import java.io.Serializable; import java.math.BigDecimal; -import java.util.*; +import java.util.ArrayList; +import java.util.List; import java.util.stream.Collectors; @@ -104,22 +75,7 @@ public class YxUserServiceImpl extends BaseServiceImpl imp private YxStoreCouponUserService storeCouponUserService; @Autowired private YxSystemStoreStaffService systemStoreStaffService; - @Autowired - private PasswordEncoder passwordEncoder; - @Autowired - private OnlineUserService onlineUserService; - @Autowired - private TokenProvider tokenProvider; - @Autowired - private AuthenticationManagerBuilder authenticationManagerBuilder; - @Autowired - private WxMaService wxMaService; - @Autowired - private YxWechatUserService wechatUserService; - @Value("${single.login:true}") - private Boolean singleLogin; - @Value("${yshop.notify.sms.enable}") - private Boolean enableSms; + /** @@ -509,265 +465,4 @@ public class YxUserServiceImpl extends BaseServiceImpl imp wrapper.eq("username",name); return getOne(wrapper); } - @Override - @Transactional(rollbackFor = Exception.class) - public Object authLogin(String code, String spread, HttpServletRequest request){ - try { - WxMpService wxService = WxMpConfiguration.getWxMpService(); - WxMpOAuth2AccessToken wxMpOAuth2AccessToken = wxService.oauth2getAccessToken(code); - WxMpUser wxMpUser = wxService.oauth2getUserInfo(wxMpOAuth2AccessToken, null); - String openid = wxMpUser.getOpenId(); - - //如果开启了UnionId - if (StrUtil.isNotBlank(wxMpUser.getUnionId())) { - openid = wxMpUser.getUnionId(); - } - YxUser yxUser = this.findByName(openid); - - String username = ""; - if(ObjectUtil.isNull(yxUser)){ - //过滤掉表情 - String nickname = EmojiParser.removeAllEmojis(wxMpUser.getNickname()); - log.info("昵称:{}", nickname); - //用户保存 - YxUser user = new YxUser(); - user.setAccount(nickname); - //如果开启了UnionId - if (StrUtil.isNotBlank(wxMpUser.getUnionId())) { - username = wxMpUser.getUnionId(); - user.setUsername(wxMpUser.getUnionId()); - }else{ - username = wxMpUser.getOpenId(); - user.setUsername(wxMpUser.getOpenId()); - } - user.setPassword(passwordEncoder.encode(ShopConstants.YSHOP_DEFAULT_PWD)); - user.setPwd(passwordEncoder.encode(ShopConstants.YSHOP_DEFAULT_PWD)); - user.setPhone(""); - user.setUserType(AppFromEnum.WECHAT.getValue()); - user.setLoginType(AppFromEnum.WECHAT.getValue()); - user.setAddTime(OrderUtil.getSecondTimestampTwo()); - user.setLastTime(OrderUtil.getSecondTimestampTwo()); - user.setNickname(nickname); - user.setAvatar(wxMpUser.getHeadImgUrl()); - user.setNowMoney(BigDecimal.ZERO); - user.setBrokeragePrice(BigDecimal.ZERO); - user.setIntegral(BigDecimal.ZERO); - - this.save(user); - - - //保存微信用户 - YxWechatUser yxWechatUser = new YxWechatUser(); - yxWechatUser.setAddTime(OrderUtil.getSecondTimestampTwo()); - yxWechatUser.setNickname(nickname); - 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.isNotBlank(wxMpUser.getUnionId())) { - yxWechatUser.setUnionid(wxMpUser.getUnionId()); - } - if (StrUtil.isNotEmpty(wxMpUser.getRemark())) { - yxWechatUser.setUnionid(wxMpUser.getRemark()); - } - if (ObjectUtil.isNotEmpty(wxMpUser.getGroupId())) { - yxWechatUser.setGroupid(wxMpUser.getGroupId()); - } - yxWechatUser.setUid(user.getUid()); - - wechatUserService.save(yxWechatUser); - - }else{ - username = yxUser.getUsername(); - if(StrUtil.isNotBlank(wxMpUser.getOpenId()) || StrUtil.isNotBlank(wxMpUser.getUnionId())){ - YxWechatUser wechatUser = new YxWechatUser(); - wechatUser.setUid(yxUser.getUid()); - wechatUser.setUnionid(wxMpUser.getUnionId()); - wechatUser.setOpenid(wxMpUser.getOpenId()); - - wechatUserService.updateById(wechatUser); - } - } - - - UsernamePasswordAuthenticationToken authenticationToken = - new UsernamePasswordAuthenticationToken(username, - ShopConstants.YSHOP_DEFAULT_PWD); - - Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken); - SecurityContextHolder.getContext().setAuthentication(authentication); - // 生成令牌 - String token = tokenProvider.createToken(authentication); - final JwtUser jwtUserT = (JwtUser) authentication.getPrincipal(); - // 保存在线信息 - onlineUserService.save(jwtUserT, token, request); - - Date expiresTime = tokenProvider.getExpirationDateFromToken(token); - String expiresTimeStr = DateUtil.formatDateTime(expiresTime); - - Map map = new LinkedHashMap<>(); - map.put("token", token); - map.put("expires_time", expiresTimeStr); - - if (singleLogin) { - //踢掉之前已经登录的token - onlineUserService.checkLoginOnUser(jwtUserT.getUsername(), token); - } - - //设置推广关系 - if (StrUtil.isNotEmpty(spread) && !spread.equals("NaN")) { - this.setSpread(Integer.valueOf(spread), - jwtUserT.getId().intValue()); - } - - // 返回 token - return map; - } catch (WxErrorException e) { - e.printStackTrace(); - log.error(e.getMessage()); - throw new BadRequestException(e.toString()); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Object wxappAuth(LoginParam loginParam, HttpServletRequest request){ - String code = loginParam.getCode(); - String encryptedData = loginParam.getEncryptedData(); - String iv = loginParam.getIv(); - String spread = loginParam.getSpread(); - try { - //读取redis配置 - String appId = RedisUtil.get(RedisKeyEnum.WXAPP_APPID.getValue()); - String secret = RedisUtil.get(RedisKeyEnum.WXAPP_SECRET.getValue()); - if (StrUtil.isBlank(appId) || StrUtil.isBlank(secret)) { - throw new ErrorRequestException("请先配置小程序"); - } - WxMaDefaultConfigImpl wxMaConfig = new WxMaDefaultConfigImpl(); - wxMaConfig.setAppid(appId); - wxMaConfig.setSecret(secret); - - wxMaService.setWxMaConfig(wxMaConfig); - WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(code); - String openid = session.getOpenid(); - //如果开启了UnionId - if (StrUtil.isNotBlank(session.getUnionid())) { - openid = session.getUnionid(); - } - - YxUser yxUser = this.findByName(openid); - String username = ""; - if(ObjectUtil.isNull(yxUser)){ - - WxMaUserInfo wxMpUser = wxMaService.getUserService() - .getUserInfo(session.getSessionKey(), encryptedData, iv); - //过滤掉表情 - String nickname = EmojiParser.removeAllEmojis(wxMpUser.getNickName()); - //用户保存 - YxUser user = new YxUser(); - user.setAccount(nickname); - - //如果开启了UnionId - if (StrUtil.isNotBlank(wxMpUser.getUnionId())) { - username = wxMpUser.getUnionId(); - user.setUsername(wxMpUser.getUnionId()); - }else{ - username = wxMpUser.getOpenId(); - user.setUsername(wxMpUser.getOpenId()); - } - user.setPassword(passwordEncoder.encode(ShopConstants.YSHOP_DEFAULT_PWD)); - user.setPwd(passwordEncoder.encode(ShopConstants.YSHOP_DEFAULT_PWD)); - user.setPhone(""); - user.setUserType(AppFromEnum.ROUNTINE.getValue()); - user.setAddTime(OrderUtil.getSecondTimestampTwo()); - user.setLastTime(OrderUtil.getSecondTimestampTwo()); - user.setNickname(nickname); - user.setAvatar(wxMpUser.getAvatarUrl()); - user.setNowMoney(BigDecimal.ZERO); - user.setBrokeragePrice(BigDecimal.ZERO); - user.setIntegral(BigDecimal.ZERO); - - this.save(user); - - - //保存微信用户 - YxWechatUser yxWechatUser = new YxWechatUser(); - // System.out.println("wxMpUser:"+wxMpUser); - yxWechatUser.setAddTime(OrderUtil.getSecondTimestampTwo()); - yxWechatUser.setNickname(nickname); - yxWechatUser.setRoutineOpenid(wxMpUser.getOpenId()); - int sub = 0; - yxWechatUser.setSubscribe(sub); - yxWechatUser.setSex(Integer.valueOf(wxMpUser.getGender())); - yxWechatUser.setLanguage(wxMpUser.getLanguage()); - yxWechatUser.setCity(wxMpUser.getCity()); - yxWechatUser.setProvince(wxMpUser.getProvince()); - yxWechatUser.setCountry(wxMpUser.getCountry()); - yxWechatUser.setHeadimgurl(wxMpUser.getAvatarUrl()); - if (StrUtil.isNotBlank(wxMpUser.getUnionId())) { - yxWechatUser.setUnionid(wxMpUser.getUnionId()); - } - yxWechatUser.setUid(user.getUid()); - - wechatUserService.save(yxWechatUser); - - }else{ - username = yxUser.getUsername(); - if(StrUtil.isNotBlank(session.getOpenid()) || StrUtil.isNotBlank(session.getUnionid())){ - YxWechatUser wechatUser = new YxWechatUser(); - wechatUser.setUid(yxUser.getUid()); - wechatUser.setUnionid(session.getUnionid()); - wechatUser.setRoutineOpenid(session.getOpenid()); - - wechatUserService.updateById(wechatUser); - } - } - - - UsernamePasswordAuthenticationToken authenticationToken = - new UsernamePasswordAuthenticationToken(username, - ShopConstants.YSHOP_DEFAULT_PWD); - - Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken); - SecurityContextHolder.getContext().setAuthentication(authentication); - // 生成令牌 - String token = tokenProvider.createToken(authentication); - final JwtUser jwtUserT = (JwtUser) authentication.getPrincipal(); - // 保存在线信息 - onlineUserService.save(jwtUserT, token, request); - - Date expiresTime = tokenProvider.getExpirationDateFromToken(token); - String expiresTimeStr = DateUtil.formatDateTime(expiresTime); - - - Map map = new LinkedHashMap<>(); - map.put("token", token); - map.put("expires_time", expiresTimeStr); - - if (singleLogin) { - //踢掉之前已经登录的token - onlineUserService.checkLoginOnUser(jwtUserT.getUsername(), token); - } - - //设置推广关系 - if (StrUtil.isNotEmpty(spread)) { - this.setSpread(Integer.valueOf(spread), - jwtUserT.getId().intValue()); - } - // 返回 token - return map; - } catch (WxErrorException e) { - log.error(e.getMessage(), e); - throw new BadRequestException(e.toString()); - } - } } diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserSignServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserSignServiceImpl.java index c7882abd..c3a51256 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserSignServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserSignServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserTaskFinishServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserTaskFinishServiceImpl.java index d7e62edb..ebe5ea26 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserTaskFinishServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/service/impl/YxUserTaskFinishServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index 87acb6b3..b37dc2db 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 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 index ce001e9b..145c7cf9 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -9,7 +9,7 @@ package co.yixiang.modules.user.web.controller; import cn.hutool.core.util.StrUtil; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.common.web.param.IdParam; diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserBillController.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserBillController.java index 5803594f..4ce40fbf 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserBillController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserBillController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -14,7 +14,7 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.qrcode.QrCodeUtil; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.enums.AppFromEnum; 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 index 2fa79488..74e80855 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -9,7 +9,7 @@ package co.yixiang.modules.user.web.controller; import co.yixiang.annotation.AnonymousAccess; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.constant.ShopConstants; diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserExtractController.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserExtractController.java index 4cbca52e..3fedb072 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserExtractController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserExtractController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserLevelController.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserLevelController.java index a1de8786..8bcca890 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserLevelController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserLevelController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -8,7 +8,7 @@ */ package co.yixiang.modules.user.web.controller; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.common.api.ApiResult; import co.yixiang.common.web.controller.BaseController; import co.yixiang.modules.user.service.YxSystemUserLevelService; diff --git a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserRechargeController.java b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserRechargeController.java index 3a0c7234..8b46967c 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserRechargeController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/user/web/controller/UserRechargeController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/entity/YxWechatTemplate.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/entity/YxWechatTemplate.java index 24ecab8c..01d54677 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/wechat/entity/YxWechatTemplate.java +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/entity/YxWechatTemplate.java @@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode; * 微信模板 *

* - * @author hupeng + * @author xuwenbo * @since 2019-12-10 */ @Data diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/mapper/YxWechatTemplateMapper.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/mapper/YxWechatTemplateMapper.java index f106e1b7..f16b6f41 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/wechat/mapper/YxWechatTemplateMapper.java +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/mapper/YxWechatTemplateMapper.java @@ -16,7 +16,7 @@ import java.io.Serializable; * 微信模板 Mapper 接口 *

* - * @author hupeng + * @author xuwenbo * @since 2019-12-10 */ @Repository diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/service/YxWechatTemplateService.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/service/YxWechatTemplateService.java index 2475b839..a0e5250c 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/wechat/service/YxWechatTemplateService.java +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/service/YxWechatTemplateService.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -21,7 +21,7 @@ import java.io.Serializable; * 微信模板 服务类 *

* - * @author hupeng + * @author xuwenbo * @since 2019-12-10 */ public interface YxWechatTemplateService extends BaseService { diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/service/impl/WechatTemplateServiceImpl.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/service/impl/WechatTemplateServiceImpl.java index e7db5f9e..00783cea 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/wechat/service/impl/WechatTemplateServiceImpl.java +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/service/impl/WechatTemplateServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 @@ -31,7 +31,7 @@ import java.io.Serializable; * 微信模板 服务实现类 *

* - * @author hupeng + * @author xuwenbo * @since 2019-12-10 */ @Slf4j 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 index f0b63d37..b3ec8944 100644 --- 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WxMaUserController.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WxMaUserController.java index 6a9b05bd..9dd3fd0a 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WxMaUserController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WxMaUserController.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2019 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/param/YxWechatTemplateQueryParam.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/param/YxWechatTemplateQueryParam.java index 4f9ffd14..3c471d14 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/param/YxWechatTemplateQueryParam.java +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/param/YxWechatTemplateQueryParam.java @@ -10,7 +10,7 @@ import lombok.EqualsAndHashCode; * 微信模板 查询参数对象 *

* - * @author hupeng + * @author xuwenbo * @date 2019-12-10 */ @Data diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/vo/YxWechatTemplateQueryVo.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/vo/YxWechatTemplateQueryVo.java index d3cda546..957cdd93 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/vo/YxWechatTemplateQueryVo.java +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/vo/YxWechatTemplateQueryVo.java @@ -11,7 +11,7 @@ import java.io.Serializable; * 微信模板 查询结果对象 *

* - * @author hupeng + * @author xuwenbo * @date 2019-12-10 */ @Data @@ -40,4 +40,4 @@ public class YxWechatTemplateQueryVo implements Serializable { @ApiModelProperty(value = "状态") private Integer status; -} +} \ No newline at end of file diff --git a/yshop-api/src/main/resources/config/application-dev.yml b/yshop-api/src/main/resources/config/application-dev.yml index c9b54ac6..bdc452ac 100644 --- a/yshop-api/src/main/resources/config/application-dev.yml +++ b/yshop-api/src/main/resources/config/application-dev.yml @@ -71,7 +71,7 @@ swagger: enabled: true title: yshop商城移动端API serverUrl: http://localhost:8009 - version: 2.1 + version: 2.0 # 文件存储路径 file: diff --git a/yshop-common/pom.xml b/yshop-common/pom.xml index 2250a7df..451d4058 100644 --- a/yshop-common/pom.xml +++ b/yshop-common/pom.xml @@ -5,47 +5,11 @@ yshop co.yixiang - 2.2 + 2.1 4.0.0 yshop-common 公共模块 - - - net.sf.dozer - dozer-spring - 5.5.1 - - - net.sf.dozer - dozer - 5.5.1 - - - jcl-over-slf4j - org.slf4j - - - - - com.google.zxing - core - 3.2.1 - - - co.yixiang - yshop-mproot - 2.2 - - - org.apache.httpcomponents - httpcore - - - org.apache.httpcomponents - httpclient - - - + \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/annotation/AnonymousAccess.java b/yshop-common/src/main/java/co/yixiang/annotation/AnonymousAccess.java index 723525e7..b0150e99 100644 --- a/yshop-common/src/main/java/co/yixiang/annotation/AnonymousAccess.java +++ b/yshop-common/src/main/java/co/yixiang/annotation/AnonymousAccess.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.annotation; import java.lang.annotation.ElementType; diff --git a/yshop-common/src/main/java/co/yixiang/annotation/Limit.java b/yshop-common/src/main/java/co/yixiang/annotation/Limit.java index 4f7f0a07..4c1b64c6 100644 --- a/yshop-common/src/main/java/co/yixiang/annotation/Limit.java +++ b/yshop-common/src/main/java/co/yixiang/annotation/Limit.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.annotation; import co.yixiang.aspect.LimitType; diff --git a/yshop-common/src/main/java/co/yixiang/annotation/Query.java b/yshop-common/src/main/java/co/yixiang/annotation/Query.java index 7cc5becb..3cce7ebf 100644 --- a/yshop-common/src/main/java/co/yixiang/annotation/Query.java +++ b/yshop-common/src/main/java/co/yixiang/annotation/Query.java @@ -1,12 +1,3 @@ -/* -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.annotation; import java.lang.annotation.ElementType; @@ -17,8 +8,7 @@ import java.lang.annotation.Target; /** * @author Zheng Jie * @date 2019-6-4 13:52:30 - *//* - + */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface Query { @@ -28,25 +18,19 @@ public @interface Query { // Dong ZhaoYang 2017/8/7 查询方式 Type type() default Type.EQUAL; - */ -/** + /** * 连接查询的属性名,如User类中的dept - *//* - + */ String joinName() default ""; - */ -/** + /** * 默认左连接 - *//* - + */ Join join() default Join.LEFT; - */ -/** + /** * 多字段模糊搜索,仅支持String类型字段,多个用逗号隔开, 如@Query(blurry = "email,username") - *//* - + */ String blurry() default ""; enum Type { @@ -72,21 +56,18 @@ public @interface Query { ,BETWEEN // 不为空 ,NOT_NULL + // 查询时间 + ,UNIX_TIMESTAMP } - */ -/** + /** * @author Zheng Jie * 适用于简单连接查询,复杂的请自定义该注解,或者使用sql查询 - *//* - + */ enum Join { - */ -/** jie 2019-6-4 13:18:30 左右连接 *//* - + /** jie 2019-6-4 13:18:30 左右连接 */ LEFT, 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 index 52cfff8d..27dba4ae 100644 --- a/yshop-common/src/main/java/co/yixiang/aspect/LimitAspect.java +++ b/yshop-common/src/main/java/co/yixiang/aspect/LimitAspect.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.aspect; import co.yixiang.utils.RequestHolder; diff --git a/yshop-common/src/main/java/co/yixiang/aspect/LimitType.java b/yshop-common/src/main/java/co/yixiang/aspect/LimitType.java index 91b6f597..0bf8dbee 100644 --- a/yshop-common/src/main/java/co/yixiang/aspect/LimitType.java +++ b/yshop-common/src/main/java/co/yixiang/aspect/LimitType.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.aspect; /** diff --git a/yshop-common/src/main/java/co/yixiang/base/BaseDTO.java b/yshop-common/src/main/java/co/yixiang/base/BaseDTO.java new file mode 100644 index 00000000..71f2b070 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/base/BaseDTO.java @@ -0,0 +1,30 @@ +package co.yixiang.base; + +import lombok.Getter; +import lombok.Setter; +import java.io.Serializable; +import java.sql.Timestamp; + +/** + * @author Zheng Jie + * @Date 2019年10月24日20:48:53 + */ +@Getter +@Setter +public class BaseDTO implements Serializable { + + private Boolean isDelete; + + private Timestamp createTime; + + private Timestamp updateTime; + + @Override + public String toString() { + return "BaseDTO{" + + "isDelete=" + isDelete + + ", createTime=" + createTime + + ", updateTime=" + updateTime + + '}'; + } +} diff --git a/yshop-common/src/main/java/co/yixiang/base/BaseEntity.java b/yshop-common/src/main/java/co/yixiang/base/BaseEntity.java new file mode 100644 index 00000000..6eeb4fe5 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/base/BaseEntity.java @@ -0,0 +1,50 @@ +package co.yixiang.base; + +import lombok.*; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.hibernate.annotations.CreationTimestamp; +import org.hibernate.annotations.UpdateTimestamp; +import javax.persistence.Column; +import javax.persistence.MappedSuperclass; +import java.io.Serializable; +import java.sql.Timestamp; +import java.lang.reflect.Field; + +/** + * @author Zheng Jie + * @Date 2019年10月24日20:46:32 + */ +@Getter +@Setter +@MappedSuperclass +public class BaseEntity implements Serializable { + + /** 删除标识 **/ + @Column(name = "is_delete", columnDefinition = "bit default 0") + private Boolean isDelete = false; + + @Column(name = "create_time") + @CreationTimestamp + private Timestamp createTime; + + @Column(name = "update_time") + @UpdateTimestamp + private Timestamp updateTime; + + public @interface Update {} + + @Override + public String toString() { + ToStringBuilder builder = new ToStringBuilder(this); + Field[] fields = this.getClass().getDeclaredFields(); + try { + for (Field f : fields) { + f.setAccessible(true); + builder.append(f.getName(), f.get(this)).append("\n"); + } + } catch (Exception e) { + builder.append("toString builder encounter an error"); + } + return builder.toString(); + } +} diff --git a/yshop-common/src/main/java/co/yixiang/base/BaseMapper.java b/yshop-common/src/main/java/co/yixiang/base/BaseMapper.java new file mode 100644 index 00000000..14103409 --- /dev/null +++ b/yshop-common/src/main/java/co/yixiang/base/BaseMapper.java @@ -0,0 +1,38 @@ +package co.yixiang.base; + +import java.util.List; + +/** + * @author Zheng Jie + * @date 2018-11-23 + */ +public interface BaseMapper { + + /** + * 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/config/ElPermissionConfig.java b/yshop-common/src/main/java/co/yixiang/config/ElPermissionConfig.java index 8879a578..38520c77 100644 --- a/yshop-common/src/main/java/co/yixiang/config/ElPermissionConfig.java +++ b/yshop-common/src/main/java/co/yixiang/config/ElPermissionConfig.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config; import co.yixiang.utils.SecurityUtils; diff --git a/yshop-common/src/main/java/co/yixiang/config/RedisConfig.java b/yshop-common/src/main/java/co/yixiang/config/RedisConfig.java index 665d8e1b..ce1b4457 100644 --- a/yshop-common/src/main/java/co/yixiang/config/RedisConfig.java +++ b/yshop-common/src/main/java/co/yixiang/config/RedisConfig.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config; import cn.hutool.core.lang.Assert; diff --git a/yshop-common/src/main/java/co/yixiang/config/SwaggerConfig.java b/yshop-common/src/main/java/co/yixiang/config/SwaggerConfig.java index 59272650..93a60c74 100644 --- a/yshop-common/src/main/java/co/yixiang/config/SwaggerConfig.java +++ b/yshop-common/src/main/java/co/yixiang/config/SwaggerConfig.java @@ -1,15 +1,6 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config; import com.fasterxml.classmate.TypeResolver; -import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; import com.google.common.base.Predicates; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -17,10 +8,8 @@ import lombok.Data; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; import org.springframework.core.Ordered; import org.springframework.data.domain.Pageable; -import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ParameterBuilder; import springfox.documentation.builders.PathSelectors; @@ -106,9 +95,6 @@ public class SwaggerConfig { * 将Pageable转换展示在swagger中 */ @Configuration -@EnableSwagger2 -@EnableKnife4j -@Import(BeanValidatorPluginsConfiguration.class) class SwaggerDataConfig { @Bean diff --git a/yshop-common/src/main/java/co/yixiang/constant/ShopConstants.java b/yshop-common/src/main/java/co/yixiang/constant/ShopConstants.java index f6def566..c8df8fac 100644 --- a/yshop-common/src/main/java/co/yixiang/constant/ShopConstants.java +++ b/yshop-common/src/main/java/co/yixiang/constant/ShopConstants.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.constant; /** @@ -110,25 +102,8 @@ public interface ShopConstants { /** * 签到天数 */ - String YSHOP_SIGN_DAY_NUM = "sign_day_num"; + String YSHOP_SIGN_DAY_NUM = "yshop_sign_day_num"; - /** - * 打印机配置 - */ - String YSHOP_ORDER_PRINT_COUNT = "order_print_count"; - /** - * 飞蛾用户信息 - */ - String YSHOP_FEI_E_USER = "fei_e_user"; - /** - * 飞蛾用户密钥 - */ - String YSHOP_FEI_E_UKEY= "fei_e_ukey"; - - /** - * 打印机配置 - */ - String YSHOP_ORDER_PRINT_COUNT_DETAIL = "order_print_count_detail"; diff --git a/yshop-common/src/main/java/co/yixiang/dozer/config/DozerMapperConfig.java b/yshop-common/src/main/java/co/yixiang/dozer/config/DozerMapperConfig.java deleted file mode 100644 index 7782f2aa..00000000 --- a/yshop-common/src/main/java/co/yixiang/dozer/config/DozerMapperConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.dozer.config; - -import co.yixiang.dozer.service.EJBGenerator; -import co.yixiang.dozer.service.IGenerator; -import org.dozer.spring.DozerBeanMapperFactoryBean; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.io.Resource; - -/** - * @author :LionCity - * @date :Created in 2019/10/9 10:40 - * @description:Dozer转换 - * @modified By: - * @version: 1.0 - */ -@Configuration -public class DozerMapperConfig { - @Bean - public DozerBeanMapperFactoryBean dozerBeanMapperFactoryBean(@Value("classpath*:dozer/*.xml" ) Resource[] resources) throws Exception { - final DozerBeanMapperFactoryBean dozerBeanMapperFactoryBean = new DozerBeanMapperFactoryBean(); - dozerBeanMapperFactoryBean.setMappingFiles(resources); - return dozerBeanMapperFactoryBean; - } - - /* @Bean - public IGenerator ejbGenerator() { - return new EJBGenerator(); - }*/ -} diff --git a/yshop-common/src/main/java/co/yixiang/dozer/service/EJBGenerator.java b/yshop-common/src/main/java/co/yixiang/dozer/service/EJBGenerator.java deleted file mode 100644 index 93fda8e7..00000000 --- a/yshop-common/src/main/java/co/yixiang/dozer/service/EJBGenerator.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.dozer.service; - -import co.yixiang.common.web.vo.Paging; -import org.dozer.Mapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Component; - -import java.lang.reflect.Array; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * @author :LionCity - * @date :Created in 2019/10/9 10:43 - * @description:dozer实现类 - * @modified By: - * @version: 1.0 - */ -@Component -@Lazy(true) -public class EJBGenerator implements IGenerator { - - @Autowired - protected Mapper dozerMapper; - - @Override - public T convert(final S s, Class clz) { - return s == null ? null : this.dozerMapper.map(s, clz); - } - - @Override - public List convert(List s, Class clz) { - return s == null ? null : s.stream().map(vs -> this.dozerMapper.map(vs, clz)).collect(Collectors.toList()); - } - - @Override - public Paging convertPaging(Paging paging, Class clz) { - Paging pagingVo=new Paging(); - pagingVo.setRecords(convert(paging.getRecords(),clz)); - pagingVo.setTotal(paging.getTotal()); - return pagingVo; - } - - @Override - public Set convert(Set s, Class clz) { - return s == null ? null : s.stream().map(vs -> this.dozerMapper.map(vs, clz)).collect(Collectors.toSet()); - } - - @Override - public T[] convert(S[] s, Class clz) { - if (s == null) { - return null; - } - @SuppressWarnings("unchecked") - T[] arr = (T[]) Array.newInstance(clz, s.length); - for (int i = 0; i < s.length; i++) { - arr[i] = this.dozerMapper.map(s[i], clz); - } - return arr; - } -} diff --git a/yshop-common/src/main/java/co/yixiang/dozer/service/IGenerator.java b/yshop-common/src/main/java/co/yixiang/dozer/service/IGenerator.java deleted file mode 100644 index de8983d1..00000000 --- a/yshop-common/src/main/java/co/yixiang/dozer/service/IGenerator.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.dozer.service; - -import co.yixiang.common.web.vo.Paging; - -import java.util.List; -import java.util.Set; - -/** - * @author :LionCity - * @date :Created in 2019/10/9 10:42 - * @description:doczer转换接口 - * @modified By: - * @version: 1.0 - */ -public interface IGenerator { - - /** - * 转换 - * - * @param s 数据对象 - * @param clz 复制目标类型 - * @return {@link T} - * @Description: 单个对象的深度复制及类型转换,vo/domain , po - * @author banjuer@outlook.com - * @Time 2018年5月9日 下午3:53:24 - */ - T convert(S s, Class clz); - - /** - * @Description: 深度复制结果集(ResultSet为自定义的分页结果集) - * @param s 数据对象 - * @param clz 复制目标类型 - * @return - * @author banjuer@outlook.com - * @Time 2018年5月9日 下午3:53:24 - */ - // Result convert(Result s, Class clz); - - /** - * 转换 - * @param s 数据对象 - * @param clz 复制目标类型 - * @return {@link List} - * @Description: list深度复制 - * @author banjuer@outlook.com - * @Time 2018年5月9日 下午3:54:08 - */ - List convert(List s, Class clz); - - /** - * - * @param s - * @param clz - * @param - * @param - * @return - */ - Paging convertPaging(Paging s, Class clz); - /** - * @param s 数据对象 - * @param clz 复制目标类型 - * @return - * @Description: set深度复制 - * @author banjuer@outlook.com - * @Time 2018年5月9日 下午3:54:39 - */ - Set convert(Set s, Class clz); - - /** - * @param s 数据对象 - * @param clz 复制目标类型 - * @return - * @Description: 数组深度复制 - * @author banjuer@outlook.com - * @Time 2018年5月9日 下午3:54:57 - */ - T[] convert(S[] s, Class clz); -} diff --git a/yshop-common/src/main/java/co/yixiang/enums/AppFromEnum.java b/yshop-common/src/main/java/co/yixiang/enums/AppFromEnum.java index 8a596d0f..948f9d8b 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/AppFromEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/AppFromEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/BillDetailEnum.java b/yshop-common/src/main/java/co/yixiang/enums/BillDetailEnum.java index b5b3ede6..0556cc53 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/BillDetailEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/BillDetailEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/BillEnum.java b/yshop-common/src/main/java/co/yixiang/enums/BillEnum.java index ea84b62e..935955de 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/BillEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/BillEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/BillInfoEnum.java b/yshop-common/src/main/java/co/yixiang/enums/BillInfoEnum.java index aed852f8..523aac02 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/BillInfoEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/BillInfoEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/CommonEnum.java b/yshop-common/src/main/java/co/yixiang/enums/CommonEnum.java index fc39ee52..d914829d 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/CommonEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/CommonEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/CouponEnum.java b/yshop-common/src/main/java/co/yixiang/enums/CouponEnum.java index 5cb4cc3b..32b80f77 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/CouponEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/CouponEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/OrderCountEnum.java b/yshop-common/src/main/java/co/yixiang/enums/OrderCountEnum.java index 1391907c..5f13a848 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/OrderCountEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/OrderCountEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/OrderInfoEnum.java b/yshop-common/src/main/java/co/yixiang/enums/OrderInfoEnum.java index ddd93ef2..4ac18715 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/OrderInfoEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/OrderInfoEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/OrderStatusEnum.java b/yshop-common/src/main/java/co/yixiang/enums/OrderStatusEnum.java index 20dffb10..98c287b6 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/OrderStatusEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/OrderStatusEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/PayTypeEnum.java b/yshop-common/src/main/java/co/yixiang/enums/PayTypeEnum.java index 53c87eb7..cc710564 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/PayTypeEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/PayTypeEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/ProductEnum.java b/yshop-common/src/main/java/co/yixiang/enums/ProductEnum.java index 0b834156..f79fe66f 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/ProductEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/ProductEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/enums/RedisKeyEnum.java b/yshop-common/src/main/java/co/yixiang/enums/RedisKeyEnum.java index 996c3a21..9d6c94ab 100644 --- a/yshop-common/src/main/java/co/yixiang/enums/RedisKeyEnum.java +++ b/yshop-common/src/main/java/co/yixiang/enums/RedisKeyEnum.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.enums; import lombok.AllArgsConstructor; diff --git a/yshop-common/src/main/java/co/yixiang/exception/BadRequestException.java b/yshop-common/src/main/java/co/yixiang/exception/BadRequestException.java index 3f4c5937..be670698 100644 --- a/yshop-common/src/main/java/co/yixiang/exception/BadRequestException.java +++ b/yshop-common/src/main/java/co/yixiang/exception/BadRequestException.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.exception; import lombok.Getter; diff --git a/yshop-common/src/main/java/co/yixiang/exception/EntityExistException.java b/yshop-common/src/main/java/co/yixiang/exception/EntityExistException.java index 6c8abd09..78df41af 100644 --- a/yshop-common/src/main/java/co/yixiang/exception/EntityExistException.java +++ b/yshop-common/src/main/java/co/yixiang/exception/EntityExistException.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.exception; import org.springframework.util.StringUtils; @@ -24,4 +16,4 @@ public class EntityExistException extends RuntimeException { return StringUtils.capitalize(entity) + " with " + field + " "+ val + " existed"; } -} +} \ 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 index 0f29a5e0..50d8f0c9 100644 --- a/yshop-common/src/main/java/co/yixiang/exception/EntityNotFoundException.java +++ b/yshop-common/src/main/java/co/yixiang/exception/EntityNotFoundException.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.exception; import org.springframework.util.StringUtils; @@ -24,4 +16,4 @@ public class EntityNotFoundException extends RuntimeException { return StringUtils.capitalize(entity) + " with " + field + " "+ val + " does not exist"; } -} +} \ 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 index 870050d9..f90d4bdd 100644 --- a/yshop-common/src/main/java/co/yixiang/exception/ErrorRequestException.java +++ b/yshop-common/src/main/java/co/yixiang/exception/ErrorRequestException.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.exception; import lombok.Getter; 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 index 13c050fe..8c8bf5d1 100644 --- a/yshop-common/src/main/java/co/yixiang/exception/handler/ApiErr.java +++ b/yshop-common/src/main/java/co/yixiang/exception/handler/ApiErr.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.exception.handler; import com.fasterxml.jackson.annotation.JsonFormat; 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 index 97363d2a..f1a5d403 100644 --- a/yshop-common/src/main/java/co/yixiang/exception/handler/ApiError.java +++ b/yshop-common/src/main/java/co/yixiang/exception/handler/ApiError.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.exception.handler; import com.fasterxml.jackson.annotation.JsonFormat; 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 index a7f6589d..f1dc687b 100644 --- a/yshop-common/src/main/java/co/yixiang/exception/handler/GlobalExceptionHandler.java +++ b/yshop-common/src/main/java/co/yixiang/exception/handler/GlobalExceptionHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.exception.handler; import co.yixiang.exception.BadRequestException; diff --git a/yshop-common/src/main/java/co/yixiang/mapper/EntityMapper.java b/yshop-common/src/main/java/co/yixiang/mapper/EntityMapper.java index 14e919ac..0f1be70b 100644 --- a/yshop-common/src/main/java/co/yixiang/mapper/EntityMapper.java +++ b/yshop-common/src/main/java/co/yixiang/mapper/EntityMapper.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mapper; import java.util.List; diff --git a/yshop-common/src/main/java/co/yixiang/print/OrderPrint.java b/yshop-common/src/main/java/co/yixiang/print/OrderPrint.java deleted file mode 100644 index c19263a5..00000000 --- a/yshop-common/src/main/java/co/yixiang/print/OrderPrint.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.print; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 打印订单数据 - */ -@Builder -@Data -@NoArgsConstructor -@AllArgsConstructor -public class OrderPrint { - private String title; - private String price; - private String num; -} diff --git a/yshop-common/src/main/java/co/yixiang/print/PrintOrderDataVO.java b/yshop-common/src/main/java/co/yixiang/print/PrintOrderDataVO.java deleted file mode 100644 index 224b5785..00000000 --- a/yshop-common/src/main/java/co/yixiang/print/PrintOrderDataVO.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.print; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * @author :LionCity - * @date :Created in 2020-05-11 10:33 - * @description:打印数据VO - * @modified By: - * @version: V1.0 - */ -@Builder -@Data -@NoArgsConstructor -@AllArgsConstructor -public class PrintOrderDataVO implements Serializable{ - @ApiModelProperty(value = "订单号") - private String orderId; - @ApiModelProperty(value = "实际支付金额") - private BigDecimal payPrice; - @ApiModelProperty(value = "用户姓名") - private String realName; - @ApiModelProperty(value = "详细地址") - private String userAddress; - @ApiModelProperty(value = "用户电话") - private String userPhone; - @ApiModelProperty(value = "备注") - private String mark; - @ApiModelProperty(value = "门店名称") - private String storeName; -} diff --git a/yshop-common/src/main/java/co/yixiang/print/PrintStoreOrderVO.java b/yshop-common/src/main/java/co/yixiang/print/PrintStoreOrderVO.java deleted file mode 100644 index 2e594508..00000000 --- a/yshop-common/src/main/java/co/yixiang/print/PrintStoreOrderVO.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.print; - -import co.yixiang.utils.OrderUtil; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - * @author :LionCity - * @date :Created in 2020-05-11 11:01 - * @description:门店销售数据 - * @modified By: - * @version: V1.0 - */ -@Builder -@Data -@NoArgsConstructor -@AllArgsConstructor -public class PrintStoreOrderVO implements Serializable { - @ApiModelProperty(value = "开始时间") - private String startTime; - @ApiModelProperty(value = "结束时间") - private String endTime; - @ApiModelProperty(value = "打印机编号") - private String driverNo; - @ApiModelProperty(value = "门店列表") - private Integer storeId; -@ApiModelProperty(hidden = true) - long startSecond; - @ApiModelProperty(hidden = true) - long endSecond; -} diff --git a/yshop-common/src/main/java/co/yixiang/print/PrintUtil4.java b/yshop-common/src/main/java/co/yixiang/print/PrintUtil4.java deleted file mode 100644 index 4b0c9774..00000000 --- a/yshop-common/src/main/java/co/yixiang/print/PrintUtil4.java +++ /dev/null @@ -1,595 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.print; - -import co.yixiang.constant.ShopConstants; -import co.yixiang.utils.DateUtils; -import co.yixiang.utils.RedisUtil; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; - -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@SuppressWarnings("static-access") -public class PrintUtil4 { - public static final String URL = "http://api.feieyun.cn/Api/Open/";//不需要修改 - - public static final String USER = RedisUtil.get(ShopConstants.YSHOP_FEI_E_USER);//*必填*:账号名 - public static final String UKEY = RedisUtil.get(ShopConstants.YSHOP_FEI_E_UKEY);//*必填*: 飞鹅云后台注册账号后生成的UKEY 【备注:这不是填打印机的KEY】 - public static final String SN = "918502791";//*必填*:打印机编号,必须要在管理后台里添加打印机或调用API接口添加之后,才能调用API - - /** - * 保存文件到磁盘 - * - * @param path 保存路径 - * @param content 打印内容 - * writeFile("E:/retlog.txt", result); - */ - public void writeFile(String path, String content) { - content = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒").format(new Date()) + ",保存的订单日志信息为: " + content; - FileOutputStream fos = null; - try { - fos = new FileOutputStream(path, true); - fos.write(content.getBytes()); - fos.write("\r
".getBytes()); - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (fos != null) { - try { - fos.flush(); - fos.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } - - - public static void main(String[] args) { - try { - System.out.println(new String(addPrintEquip("918502791", "nvz8kw5n", "测试", "").getBytes("ISO-8859-1"), "UTF-8")); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - - /** - * 添加打印机 - * - * @param sn 编号 - * @param key 密钥 - * @param remark 备注 - * @param phone 流量卡号码 - * @return 返回打印结果 - */ - public static String addPrintEquip(String sn, String key, String remark, String phone) { - String printerContent = sn + " # " + key + " # " + remark + " # " + phone; - List nvps = new ArrayList(); - nvps.add(new BasicNameValuePair("user", USER)); - String STIME = String.valueOf(System.currentTimeMillis() / 1000); - nvps.add(new BasicNameValuePair("stime", STIME)); - nvps.add(new BasicNameValuePair("sig", signature(USER, UKEY, STIME))); - nvps.add(new BasicNameValuePair("apiname", "Open_printerAddlist")); - nvps.add(new BasicNameValuePair("printerContent", printerContent));// 固定值,不需要修改 - return sendHttpRequest(nvps); - } - - /** - * 编辑打印机信息 - * - * @param sn 编号 - * @param remark 备注 - * @param phone 电话 - * @return 结果 - */ - public static String editPrintEquip(String sn, String remark, String phone) { - List nvps = new ArrayList(); - nvps.add(new BasicNameValuePair("user", USER)); - String STIME = String.valueOf(System.currentTimeMillis() / 1000); - nvps.add(new BasicNameValuePair("stime", STIME)); - nvps.add(new BasicNameValuePair("sig", signature(USER, UKEY, STIME))); - nvps.add(new BasicNameValuePair("apiname", "Open_printerEdit")); - nvps.add(new BasicNameValuePair("sn", sn)); - nvps.add(new BasicNameValuePair("name", remark)); - nvps.add(new BasicNameValuePair("phonenum", phone)); - return sendHttpRequest(nvps); - } - - /** - * 打印订单数据 - * - * @param sn 打印机编号 - * @param contentTitle 打印标题 - * @param orderList 订单数据 - * @param order - * @return - */ - public static String printOrder(String sn, String contentTitle, List orderList, PrintOrderDataVO order, int lian) { - String content = getPrintContent(contentTitle, orderList, 14, 6, 3, 6, order, lian + 1);//orderList为数组 b1代表名称列占用(14个字节) b2单价列(6个字节) b3数量列(3个字节) b4金额列(6个字节)-->这里的字节数可按自己需求自由改写,14+6+3+6再加上代码写的3个空格就是32了,58mm打印机一行总占32字节 -// List nvps = new ArrayList(); -// nvps.add(new BasicNameValuePair("user", USER)); -// String STIME = String.valueOf(System.currentTimeMillis() / 1000); -// nvps.add(new BasicNameValuePair("stime", STIME)); -// nvps.add(new BasicNameValuePair("sig", signature(USER, UKEY, STIME))); -// nvps.add(new BasicNameValuePair("apiname", "Open_printMsg"));// 固定值,不需要修改 -// nvps.add(new BasicNameValuePair("sn", sn)); -// nvps.add(new BasicNameValuePair("content", content)); -// nvps.add(new BasicNameValuePair("times", "1"));// 打印联数 -// return sendHttpRequest(nvps); - return print(sn, content); - } - - - /** - * 打印预养订单 - * - * @param orderList 订单数据 - * @param title 标题 - * @param mobile 联系方式 - * @param name 用户姓名 - * @param payPrice 实际支付 - * @return - */ - public static String printOrderByAdvance(List orderList, String title, String mobile, String name, String payPrice) { - String content = getOrderByAdvance(orderList, 14, 6, 3, 6, title, mobile, name, payPrice);//orderList为数组 b1代表名称列占用(14个字节) b2单价列(6个字节) b3数量列(3个字节) b4金额列(6个字节)-->这里的字节数可按自己需求自由改写,14+6+3+6再加上代码写的3个空格就是32了,58mm打印机一行总占32字节 -// List nvps = new ArrayList(); -// nvps.add(new BasicNameValuePair("user", USER)); -// String STIME = String.valueOf(System.currentTimeMillis() / 1000); -// nvps.add(new BasicNameValuePair("stime", STIME)); -// nvps.add(new BasicNameValuePair("sig", signature(USER, UKEY, STIME))); -// nvps.add(new BasicNameValuePair("apiname", "Open_printMsg"));// 固定值,不需要修改 -// nvps.add(new BasicNameValuePair("sn", SN)); -// nvps.add(new BasicNameValuePair("content", content)); -// nvps.add(new BasicNameValuePair("times", "1"));// 打印联数 -// return sendHttpRequest(nvps); - return print(SN, content); - } - - /** - * 打印订单数据 - * - * @param contentTitle 打印标题 - * @param orderList 订单数据 - * @return - */ - public static String printContentByStore(String contentTitle, List orderList, int b1, int b3, PrintStoreOrderVO printStoreOrder, int lian) { - String content = getPrintContentByStore(contentTitle, orderList, b1, b3, printStoreOrder, lian + 1);//orderList为数组 b1代表名称列占用(14个字节) b2单价列(6个字节) b3数量列(3个字节) b4金额列(6个字节)-->这里的字节数可按自己需求自由改写,14+6+3+6再加上代码写的3个空格就是32了,58mm打印机一行总占32字节 -// List nvps = new ArrayList(); -// nvps.add(new BasicNameValuePair("user", USER)); -// String STIME = String.valueOf(System.currentTimeMillis() / 1000); -// nvps.add(new BasicNameValuePair("stime", STIME)); -// nvps.add(new BasicNameValuePair("sig", signature(USER, UKEY, STIME))); -// nvps.add(new BasicNameValuePair("apiname", "Open_printMsg"));// 固定值,不需要修改 -// nvps.add(new BasicNameValuePair("sn", sn)); -// nvps.add(new BasicNameValuePair("content", content)); -// nvps.add(new BasicNameValuePair("times", "1"));// 打印联数 -// return sendHttpRequest(nvps); - return print(printStoreOrder.getDriverNo(), content); - } - - /** - * 打印订单数据 - * - * @param sn 打印机编号 - * @param content 打印内容 - * @return - */ - public static String print(String sn, String content) { - List nvps = new ArrayList(); - nvps.add(new BasicNameValuePair("user", USER)); - String STIME = String.valueOf(System.currentTimeMillis() / 1000); - nvps.add(new BasicNameValuePair("stime", STIME)); - nvps.add(new BasicNameValuePair("sig", signature(USER, UKEY, STIME))); - nvps.add(new BasicNameValuePair("apiname", "Open_printMsg"));// 固定值,不需要修改 - nvps.add(new BasicNameValuePair("sn", sn)); - nvps.add(new BasicNameValuePair("content", content)); - nvps.add(new BasicNameValuePair("times", "1"));// 打印联数 - return sendHttpRequest(nvps); - } - - - /** - * 获取预养订单文本信息 - * - * @return - */ - public static String getOrderByAdvance(List orderList, int b1, int b2, int b3, int b4, String headTitle, String mobile, String name, String payPrice) { - String orderInfo = "" + headTitle + "
"; - orderInfo += "名称 单价 数量 金额
"; - orderInfo += "--------------------------------
"; - double totals = 0.0; - for (int i = 0; i < orderList.size(); i++) { - String title = orderList.get(i).getTitle(); - String price = orderList.get(i).getPrice(); - String num = orderList.get(i).getNum(); - String total = "" + Double.valueOf(price) * Integer.parseInt(num); - totals += Double.parseDouble(total); - price = addSpace(price, b2); - num = addSpace(num, b3); - total = addSpace(total, b4); - String otherStr = " " + price + num + " " + total; - - int tl = 0; - try { - tl = title.getBytes("GBK").length; - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - int spaceNum = (tl / b1 + 1) * b1 - tl; - if (tl < b1) { - for (int k = 0; k < spaceNum; k++) { - title += " "; - } - title += otherStr; - } else if (tl == b1) { - title += otherStr; - } else { - List list = null; - if (isEn(title)) { - list = getStrList(title, b1); - } else { - list = getStrList(title, b1 / 2); - } - String s0 = titleAddSpace(list.get(0)); - title = s0 + otherStr + "
";// 添加 单价 数量 总额 - String s = ""; - for (int k = 1; k < list.size(); k++) { - s += list.get(k); - } - try { - s = getStringByEnter(b1, s); - } catch (Exception e) { - e.printStackTrace(); - } - title += s; - } - orderInfo += title + "
"; - } - orderInfo += "--------------------------------
"; - - orderInfo += "合计:" + totals + "元
"; - orderInfo += "实付:" + payPrice + "元
"; - //orderInfo += "送货地点:广州市南沙区xx路xx号
"; - orderInfo += "联系人:" + name + "
"; - orderInfo += "联系电话:" + mobile + "
"; - orderInfo += "下单时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "
"; - //orderInfo += "https://admin.jidanguo10.com/weixin?id=2"; - return orderInfo; - } - - - /** - * 打印各门店订单数据信息 - * - * @param contentTitle - * @param orderList - * @param b1 - * @param b3 - * @param lian - * @return - */ - public static String getPrintContentByStore(String contentTitle, List orderList, int b1, int b3, PrintStoreOrderVO printStoreOrder, int lian) { - String orderInfo = "----第" + lian + "联----
"; - orderInfo += "" + contentTitle + "
"; - orderInfo += "名称 数量
"; - orderInfo += "--------------------------------
"; - for (int i = 0; i < orderList.size(); i++) { - String title = orderList.get(i).getTitle(); - String num = orderList.get(i).getNum(); - num = addSpace(num, b3); - String otherStr = " " + num; - - int tl = 0; - try { - tl = title.getBytes("GBK").length; - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - int spaceNum = (tl / b1 + 1) * b1 - tl; - if (tl < b1) { - for (int k = 0; k < spaceNum; k++) { - title += " "; - } - title += otherStr; - } else if (tl == b1) { - title += otherStr; - } else { - List list = null; - if (isEn(title)) { - list = getStrList(title, b1); - } else { - list = getStrList(title, b1 / 2); - } - String s0 = titleAddSpace(list.get(0)); - title = s0 + otherStr + "
";// 添加 单价 数量 总额 - String s = ""; - for (int k = 1; k < list.size(); k++) { - s += list.get(k); - } - try { - s = getStringByEnter(b1, s); - } catch (Exception e) { - e.printStackTrace(); - } - title += s; - } - orderInfo += title + "
"; - } - orderInfo += "--------------------------------
"; - orderInfo += "社区门店:" + contentTitle + "
"; - orderInfo += "开始时间:" + printStoreOrder.getStartTime() + "
"; - orderInfo += "截止时间:" + printStoreOrder.getEndTime() + "
"; - orderInfo += "打印时间:" + DateUtils.getTime() + "
"; - //orderInfo += "https://admin.jidanguo10.com/weixin?id=2"; - return orderInfo; - } - - - //orderList为数组 b1代表名称列占用字节 b2单价列 b3数量列 b4金额列-->这里的字节数可按自己需求自由改写,详细往上看112行调用实际例子运用 - - /** - * 获取打印订单的文本内容 - * - * @param contentTitle 打印内容标题 - * @param orderList 订单数据 - * @param b1 - * @param b2 - * @param b3 - * @param b4 - * @param order - * @return - */ - public static String getPrintContent(String contentTitle, List orderList, int b1, int b2, int b3, int b4, PrintOrderDataVO order, int lian) { - String orderInfo = "----第" + lian + "联----
"; - orderInfo += "" + contentTitle + "
"; - orderInfo += "名称 单价 数量 金额
"; - orderInfo += "--------------------------------
"; - double totals = 0.0; - for (int i = 0; i < orderList.size(); i++) { - String title = orderList.get(i).getTitle(); - String price = orderList.get(i).getPrice(); - String num = orderList.get(i).getNum(); - String total = "" + Double.valueOf(price) * Integer.parseInt(num); - totals += Double.parseDouble(total); - price = addSpace(price, b2); - num = addSpace(num, b3); - total = addSpace(total, b4); - String otherStr = " " + price + num + " " + total; - - int tl = 0; - try { - tl = title.getBytes("GBK").length; - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - int spaceNum = (tl / b1 + 1) * b1 - tl; - if (tl < b1) { - for (int k = 0; k < spaceNum; k++) { - title += " "; - } - title += otherStr; - } else if (tl == b1) { - title += otherStr; - } else { - List list = null; - if (isEn(title)) { - list = getStrList(title, b1); - } else { - list = getStrList(title, b1 / 2); - } - String s0 = titleAddSpace(list.get(0)); - title = s0 + otherStr + "
";// 添加 单价 数量 总额 - String s = ""; - for (int k = 1; k < list.size(); k++) { - s += list.get(k); - } - try { - s = getStringByEnter(b1, s); - } catch (Exception e) { - e.printStackTrace(); - } - title += s; - } - orderInfo += title + "
"; - } - orderInfo += "--------------------------------
"; - orderInfo += "社区门店:" + order.getStoreName() + "
"; - orderInfo += "订单编号:" + order.getOrderId() + "
"; - orderInfo += "合计:" + totals + "元
"; - orderInfo += "实付:" + order.getPayPrice() + "元
"; - //orderInfo += "送货地点:广州市南沙区xx路xx号
"; - orderInfo += "联系人:" + order.getRealName() + "
"; - orderInfo += "详细地址:" + order.getUserAddress() + "
"; - orderInfo += "联系电话:" + order.getUserPhone() + "
"; - orderInfo += "下单时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "
"; - orderInfo += "备注:" + order.getMark() + "
"; - //orderInfo += "https://admin.jidanguo10.com/weixin?id=2"; - return orderInfo; - } - - - /** - * 发送打印请求 - * - * @param nvps - * @return - */ - public static String sendHttpRequest(List nvps) { - // 通过POST请求,发送打印信息到服务器 - RequestConfig requestConfig = RequestConfig.custom() - .setSocketTimeout(30000)// 读取超时 - .setConnectTimeout(30000)// 连接超时 - .build(); - - CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build(); - - HttpPost post = new HttpPost(URL); - CloseableHttpResponse response = null; - String result = null; - try { - post.setEntity(new UrlEncodedFormEntity(nvps, "utf-8")); - response = httpClient.execute(post); - int statecode = response.getStatusLine().getStatusCode(); - if (statecode == 200) { - HttpEntity httpentity = response.getEntity(); - if (httpentity != null) { - // 服务器返回的JSON字符串,建议要当做日志记录起来 - result = EntityUtils.toString(httpentity); - } - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - close(response, post, httpClient); - } - return result; - } - - /** - * 关闭流 - * - * @param response - * @param post - * @param httpClient - */ - public static void close(CloseableHttpResponse response, HttpPost post, CloseableHttpClient httpClient) { - try { - if (response != null) { - response.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - try { - post.abort(); - } catch (Exception e) { - e.printStackTrace(); - } - try { - httpClient.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - - public static String titleAddSpace(String str) { - int k = 0; - int b = 14; - try { - k = str.getBytes("GBK").length; - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - for (int i = 0; i < b - k; i++) { - str += " "; - } - return str; - } - - public static String getStringByEnter(int length, String string) throws Exception { - for (int i = 1; i <= string.length(); i++) { - if (string.substring(0, i).getBytes("GBK").length > length) { - return string.substring(0, i - 1) + "
" + getStringByEnter(length, string.substring(i - 1)); - } - } - return string; - } - - /** - * 添加空格,文本对齐 - * - * @param str - * @param size - * @return - */ - public static String addSpace(String str, int size) { - int len = str.length(); - if (len < size) { - for (int i = 0; i < size - len; i++) { - str += " "; - } - } - return str; - } - - public static Boolean isEn(String str) { - Boolean b = false; - try { - b = str.getBytes("GBK").length == str.length(); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - return b; - } - - public static List getStrList(String inputString, int length) { - int size = inputString.length() / length; - if (inputString.length() % length != 0) { - size += 1; - } - return getStrList(inputString, length, size); - } - - public static List getStrList(String inputString, int length, int size) { - List list = new ArrayList(); - for (int index = 0; index < size; index++) { - String childStr = substring(inputString, index * length, (index + 1) * length); - list.add(childStr); - } - return list; - } - - /** - * 字符串切割 - * - * @param str - * @param f - * @param t - * @return - */ - public static String substring(String str, int f, int t) { - if (f > str.length()) - return null; - if (t > str.length()) { - return str.substring(f, str.length()); - } else { - return str.substring(f, t); - } - } - - /** - * 签名 - * - * @param USER 用户 - * @param UKEY UKEY - * @param STIME 时间戳 - * @return {@link String} - */ - private static String signature(String USER, String UKEY, String STIME) { - return DigestUtils.sha1Hex(USER + UKEY + STIME); - } -} diff --git a/yshop-common/src/main/java/co/yixiang/utils/BeanUtil.java b/yshop-common/src/main/java/co/yixiang/utils/BeanUtil.java index e79d041c..c203808d 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/BeanUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/BeanUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.springframework.beans.BeansException; @@ -29,4 +21,4 @@ public class BeanUtil implements ApplicationContextAware { public static T getBean(Class c){ return context.getBean(c); } -} +} \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/utils/BigNum.java b/yshop-common/src/main/java/co/yixiang/utils/BigNum.java deleted file mode 100644 index c739f0cb..00000000 --- a/yshop-common/src/main/java/co/yixiang/utils/BigNum.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.utils; -import java.math.BigDecimal; -import java.text.DecimalFormat; - -public class BigNum { - public static final String BIG_NUM_FMT_COMMA = "#,###,###,###,###,###,##0.00";//千位分隔符 方便查看金额具体大小 - public static final String BIG_NUM_FMT = "##################0.00";//不带千位分隔符 - public static final String BIG_NUM_HUNDRED = "100";//100常量 - public static final int BIG_NUM_SCALE = 2;//保留两位小数 - - - // 除法运算默认精度 - private static final int DEF_DIV_SCALE = 10; - - - /** - * 精确加法 - */ - public static BigDecimal add(double value1, double value2) { - BigDecimal b1 = BigDecimal.valueOf(value1); - BigDecimal b2 = BigDecimal.valueOf(value2); - return new BigDecimal(b1.add(b2).toString()); - } - - /** - * 精确加法 - */ - public static BigDecimal add(Object value1, Object value2) { - BigDecimal b1 = new BigDecimal(value1.toString()); - BigDecimal b2 = new BigDecimal(value2.toString()); - return new BigDecimal(b1.add(b2).toString()); - } - - /** - * 精确减法 - */ - public static BigDecimal sub(double value1, double value2) { - BigDecimal b1 = BigDecimal.valueOf(value1); - BigDecimal b2 = BigDecimal.valueOf(value2); - return new BigDecimal(b1.subtract(b2).toString()); - } - - /** - * 精确减法 - */ - public static BigDecimal sub(Object value1, Object value2) { - BigDecimal b1 = new BigDecimal(value1.toString()); - BigDecimal b2 = new BigDecimal(value2.toString()); - return new BigDecimal(b1.subtract(b2).toString()); - } - - /** - * 精确乘法 - */ - public static BigDecimal mul(double value1, double value2) { - BigDecimal b1 = BigDecimal.valueOf(value1); - BigDecimal b2 = BigDecimal.valueOf(value2); - return new BigDecimal(b1.multiply(b2).toString()); - } - - /** - * 精确乘法 - */ - public static BigDecimal mul(Object value1, Object value2) { - BigDecimal b1 = new BigDecimal(value1.toString()); - BigDecimal b2 = new BigDecimal(value2.toString()); - return new BigDecimal(b1.multiply(b2).toString()); - } - - /** - * 精确除法 使用默认精度 - */ - public static BigDecimal div(double value1, double value2) throws IllegalAccessException { - return div(value1, value2, DEF_DIV_SCALE); - } - - /** - * 精确除法 使用默认精度 - */ - public static BigDecimal div(String value1, String value2) throws IllegalAccessException { - return div(value1, value2, DEF_DIV_SCALE); - } - - /** - * 精确除法 - * - * @param scale - * 精度 - */ - public static BigDecimal div(double value1, double value2, int scale) throws IllegalAccessException { - if (scale < 0) { - throw new IllegalAccessException("精确度不能小于0"); - } - BigDecimal b1 = BigDecimal.valueOf(value1); - BigDecimal b2 = BigDecimal.valueOf(value2); - // return b1.divide(b2, scale).doubleValue(); - return new BigDecimal(b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).toString()); - } - - /** - * 精确除法 - * - * @param scale - * 精度 - */ - public static BigDecimal div(String value1, String value2, int scale) throws IllegalAccessException { - if (scale < 0) { - throw new IllegalAccessException("精确度不能小于0"); - } - BigDecimal b1 = new BigDecimal(value1); - BigDecimal b2 = new BigDecimal(value2); - // return b1.divide(b2, scale).doubleValue(); - return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP); - } - - /** - * 四舍五入 - * - * @param scale - * 小数点后保留几位 - */ - public static BigDecimal round(double v, int scale) throws IllegalAccessException { - return div(v, 1, scale); - } - - /** - * 四舍五入 - * - * @param scale - * 小数点后保留几位 - */ - public static BigDecimal round(String v, int scale) throws IllegalAccessException { - return div(v, "1", scale); - } - - /** - * 比较大小 - */ - public static boolean equalTo(BigDecimal b1, BigDecimal b2) { - if (b1 == null || b2 == null) { - return false; - } - return 0 == b1.compareTo(b2); - } - - - /** - * 分转换成元 - * @param v - * @return - */ - public static BigDecimal penny2dollar(String v){ - BigDecimal s = new BigDecimal("0.00");//保留两位小数 - try { - s = div(v,"100",2); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - return s; - } - - /** - * 元转换成分 - * @param v - * @return - */ - public static BigDecimal dollar2penny(String v){ - return mul(v, "100"); - } - - /** - * 格式化金额 - * 千位分隔符 方便查看金额具体大小 BIG_NUM_FMT = "#,###,###,###,###,###,##0.00" - * 精确两位小数 .99 -> 0.99 - * 1111111.985 -> 1,111,111.99 - * @param v - * @return - */ - public static String formatNumber(String v){ - return formatNumber(v,BIG_NUM_FMT_COMMA); - } - - /** - * 格式化金额 - * @param v - * @param pattern BigNum类中的常量 BIG_NUM_FMT_COMMA,BIG_NUM_FMT - * @return - */ - public static String formatNumber(String v,String pattern) { - return new DecimalFormat(pattern).format(new BigDecimal(v)); - } - - public static void main(String[] args) { - System.out.println(new BigDecimal("0.00").toString()); - } -} diff --git a/yshop-common/src/main/java/co/yixiang/utils/CateDTO.java b/yshop-common/src/main/java/co/yixiang/utils/CateDTO.java index 3b70a57c..6e23fbb3 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/CateDTO.java +++ b/yshop-common/src/main/java/co/yixiang/utils/CateDTO.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; diff --git a/yshop-common/src/main/java/co/yixiang/utils/DateUtils.java b/yshop-common/src/main/java/co/yixiang/utils/DateUtils.java deleted file mode 100644 index 071d0031..00000000 --- a/yshop-common/src/main/java/co/yixiang/utils/DateUtils.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.utils; - -import org.apache.commons.lang3.time.DateFormatUtils; - -import java.lang.management.ManagementFactory; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * 时间工具类 - */ -public class DateUtils extends org.apache.commons.lang3.time.DateUtils { - public static String YYYY = "yyyy"; - - public static String YYYY_MM = "yyyy-MM"; - - public static String YYYY_MM_DD = "yyyy-MM-dd"; - - public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; - - public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; - - private static String[] parsePatterns = { - "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", - "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", - "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; - - /** - * 获取当前Date型日期 - * - * @return Date() 当前日期 - */ - public static Date getNowDate() { - return new Date(); - } - - /** - * 获取当前日期, 默认格式为yyyy-MM-dd - * - * @return String - */ - public static String getDate() { - return dateTimeNow(YYYY_MM_DD); - } - - public static final String getTime() { - return dateTimeNow(YYYY_MM_DD_HH_MM_SS); - } - - public static final String dateTimeNow() { - return dateTimeNow(YYYYMMDDHHMMSS); - } - - public static final String dateTimeNow(final String format) { - return parseDateToStr(format, new Date()); - } - - public static final String dateTime(final Date date) { - return parseDateToStr(YYYY_MM_DD, date); - } - - public static final String parseDateToStr(final String format, final Date date) { - return new SimpleDateFormat(format).format(date); - } - - public static final Date dateTime(final String format, final String ts) { - try { - return new SimpleDateFormat(format).parse(ts); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } - - /** - * 日期路径 即年/月/日 如2018/08/08 - */ - public static final String datePath() { - Date now = new Date(); - return DateFormatUtils.format(now, "yyyy/MM/dd"); - } - - /** - * 日期路径 即年/月/日 如20180808 - */ - public static final String dateTime() { - Date now = new Date(); - return DateFormatUtils.format(now, "yyyyMMdd"); - } - - /** - * 日期型字符串转化为日期 格式 - */ - public static Date parseDate(Object str) { - if (str == null) { - return null; - } - try { - return parseDate(str.toString(), parsePatterns); - } catch (ParseException e) { - return null; - } - } - - /** - * 获取服务器启动时间 - */ - public static Date getServerStartDate() { - long time = ManagementFactory.getRuntimeMXBean().getStartTime(); - return new Date(time); - } - - /** - * 计算两个时间差 - */ - public static String getDatePoor(Date endDate, Date nowDate) { - long nd = 1000 * 24 * 60 * 60; - long nh = 1000 * 60 * 60; - long nm = 1000 * 60; - // long ns = 1000; - // 获得两个时间的毫秒时间差异 - long diff = endDate.getTime() - nowDate.getTime(); - // 计算差多少天 - long day = diff / nd; - // 计算差多少小时 - long hour = diff % nd / nh; - // 计算差多少分钟 - long min = diff % nd % nh / nm; - // 计算差多少秒//输出结果 - // long sec = diff % nd % nh % nm / ns; - return day + "天" + hour + "小时" + min + "分钟"; - } -} diff --git a/yshop-common/src/main/java/co/yixiang/utils/ElAdminConstant.java b/yshop-common/src/main/java/co/yixiang/utils/ElAdminConstant.java index f9c779d7..c4d68b06 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/ElAdminConstant.java +++ b/yshop-common/src/main/java/co/yixiang/utils/ElAdminConstant.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; /** diff --git a/yshop-common/src/main/java/co/yixiang/utils/EncryptUtils.java b/yshop-common/src/main/java/co/yixiang/utils/EncryptUtils.java index 3d84bf61..df145562 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/EncryptUtils.java +++ b/yshop-common/src/main/java/co/yixiang/utils/EncryptUtils.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.springframework.util.DigestUtils; diff --git a/yshop-common/src/main/java/co/yixiang/utils/FeiEHttpUtil.java b/yshop-common/src/main/java/co/yixiang/utils/FeiEHttpUtil.java deleted file mode 100644 index 722b669e..00000000 --- a/yshop-common/src/main/java/co/yixiang/utils/FeiEHttpUtil.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.utils; - -/** - * @author :LionCity - * @date :Created in 2020-04-21 17:30 - * @description:飞鹅打印机打印帮助类 - * @modified By: - * @version: V1.0 - */ -public class FeiEHttpUtil { - -} diff --git a/yshop-common/src/main/java/co/yixiang/utils/FileUtil.java b/yshop-common/src/main/java/co/yixiang/utils/FileUtil.java index 4ced6f4e..2a01ed94 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/FileUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/FileUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import cn.hutool.core.codec.Base64; @@ -20,7 +12,6 @@ import javax.activation.MimetypesFileTypeMap; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.awt.image.BufferedImage; import java.io.*; import java.security.MessageDigest; import java.text.DecimalFormat; @@ -346,36 +337,4 @@ public class FileUtil extends cn.hutool.core.io.FileUtil { } } - public static BufferedImage inputImage(MultipartFile file) { - BufferedImage srcImage = null; - try { - FileInputStream in = (FileInputStream) file.getInputStream(); - srcImage = javax.imageio.ImageIO.read(in); - } catch (IOException e) { - System.out.println("读取图片文件出错!" + e.getMessage()); - } - return srcImage; - } - /** - * 自动调节精度(经验数值) - * - * @param size 源图片大小 - * @return 图片压缩质量比 - */ - public static float getAccuracy(long size) { - float accuracy; - if (size < 400) { - accuracy = 0.85f; - } else if (size < 900) { - accuracy = 0.75f; - } else if (size < 2047) { - accuracy = 0.6f; - } else if (size < 3275) { - accuracy = 0.44f; - } else { - accuracy = 0.4f; - } - return accuracy; - } - } diff --git a/yshop-common/src/main/java/co/yixiang/utils/FontUtil.java b/yshop-common/src/main/java/co/yixiang/utils/FontUtil.java deleted file mode 100644 index 73f36d21..00000000 --- a/yshop-common/src/main/java/co/yixiang/utils/FontUtil.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.utils; - -import java.awt.*; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * 字体工具类 - * Created by 刘彦民 on 2018/5/5. - */ -public class FontUtil { - /** - * 默认字体 - */ - public static final int DEFAULT_FONT = 1; - /** - * PingFangSC字体 - */ - public static final int PINGFANG_FONT = 2; - /** - * PingFangSCBold字体 - */ - public static final int PINGFANG_BOLD_FONT = 3; - /** - * 方正兰亭特黑GBK - */ - public static final int FZLTTH_GBK_FONT = 4; - - - /** - * 根据字体类型获取字体 - * @param type - * @param size - * @return - */ - public static Font getFont(int type, float size) { - // 字体路径 - String path = ""; - switch (type) { - case DEFAULT_FONT: - path = "D:/upload/resources/font/simhei.ttf"; - break; - case PINGFANG_FONT: - path = "D:/upload/resources/font/PingFangSC.ttf"; - break; - case PINGFANG_BOLD_FONT: - path = "D:/upload/resources/font/PingFangBold.ttf"; - break; - case FZLTTH_GBK_FONT: - path = "D:/upload/resources/font/fzltthjwgb10.ttf"; - break; - default: - path = "D:/upload/resources/font/simhei.ttf"; - } - - File file = new File(path); - InputStream inputStream = null; - try { - inputStream = new FileInputStream(file); - Font sPfBoldFont = Font.createFont(Font.TRUETYPE_FONT, inputStream); - sPfBoldFont = sPfBoldFont.deriveFont(size); - return sPfBoldFont; - } catch (FontFormatException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } finally { - try { - if (inputStream != null) { - inputStream.close(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - return null; - } -} diff --git a/yshop-common/src/main/java/co/yixiang/utils/LocationUtils.java b/yshop-common/src/main/java/co/yixiang/utils/LocationUtils.java index d51227ba..0a486cd1 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/LocationUtils.java +++ b/yshop-common/src/main/java/co/yixiang/utils/LocationUtils.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import cn.hutool.core.util.NumberUtil; diff --git a/yshop-common/src/main/java/co/yixiang/utils/OrderUtil.java b/yshop-common/src/main/java/co/yixiang/utils/OrderUtil.java index 023876d2..204393c2 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/OrderUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/OrderUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import cn.hutool.core.date.DateTime; @@ -51,31 +43,29 @@ public class OrderUtil { /** * 获取俩个数之间的随机数 - * * @param min * @param max * @return */ - public static Double randomNumber(double min, double max) { + public static Double randomNumber(double min,double max){ return NumberUtil.add(min, NumberUtil.mul(Math.random(), - NumberUtil.sub(max, min))); + NumberUtil.sub(max,min))); } /** * 时间戳订单号 - * * @return */ - public static String orderSn() { + public static String orderSn(){ Date date = DateUtil.date(); - return DateUtil.format(date, "yyyyMMddHHmmssSSS"); + return DateUtil.format(date,"yyyyMMddHHmmssSSS"); } /* * 将时间戳转换为时间 */ - public static String stampToDate(String s) { + public static String stampToDate(String s){ String res; SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); long lt = new Long(s) * 1000; @@ -87,7 +77,7 @@ public class OrderUtil { /* * 将时间戳转换为date */ - public static Date stampToDateObj(String s) { + public static Date stampToDateObj(String s){ long lt = new Long(s) * 1000; Date date = new Date(lt); return date; @@ -96,70 +86,59 @@ public class OrderUtil { /** * 获取精确到秒的时间戳 - * * @return **/ - public static int getSecondTimestampTwo() { - String timestamp = String.valueOf(new Date().getTime() / 1000); + public static int getSecondTimestampTwo(){ + String timestamp = String.valueOf(new Date().getTime()/1000); return Integer.valueOf(timestamp); } /** * 获取精确到秒的时间戳 - * * @return **/ - public static int dateToTimestamp(Date date) { - String timestamp = String.valueOf(date.getTime() / 1000); + public static int dateToTimestamp(Date date){ + String timestamp = String.valueOf(date.getTime()/1000); return Integer.valueOf(timestamp); } /** * 获取精确到秒的时间戳 - * * @return **/ - public static int dateToTimestampT(DateTime date) { - String timestamp = String.valueOf(date.getTime() / 1000); + public static int dateToTimestampT(DateTime date){ + String timestamp = String.valueOf(date.getTime()/1000); return Integer.valueOf(timestamp); } - public static long dateToSecond(String str) throws Exception { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date = simpleDateFormat.parse(str); - long ts = date.getTime(); - return ts/1000; - } - /** * 获取订单状态名称 - * * @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) { + public static String orderStatusStr(int paid,int status, + int shipping_type,int refund_status){ String statusName = ""; - if (paid == 0 && status == 0) { + if(paid == 0 && status == 0){ statusName = "未支付"; - } else if (paid == 1 && status == 0 && shipping_type == 1 && refund_status == 0) { + }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) { + }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) { + }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) { + }else if(paid == 1 && status == 1 && shipping_type == 2 && refund_status == 0){ statusName = "未核销"; - } else if (paid == 1 && status == 2 && refund_status == 0) { + }else if(paid == 1 && status == 2 && refund_status == 0){ statusName = "待评价"; - } else if (paid == 1 && status == 3 && refund_status == 0) { + }else if(paid == 1 && status == 3 && refund_status == 0){ statusName = "已完成"; - } else if (paid == 1 && refund_status == 1) { + }else if(paid == 1 && refund_status == 1){ statusName = "退款中"; - } else if (paid == 1 && refund_status == 2) { + }else if(paid == 1 && refund_status == 2){ statusName = "已退款"; } @@ -169,30 +148,29 @@ public class OrderUtil { /** * 获取状态数值 - * * @param paid * @param status * @param refund_status * @return */ - public static int orderStatus(int paid, int status, int refund_status) { + 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) { + if(paid == 0 && status == 0 && refund_status == 0){ _status = 1; - } else if (paid == 1 && status == 0 && refund_status == 0) { + }else if(paid == 1 && status == 0 && refund_status == 0){ _status = 2; - } else if (paid == 1 && refund_status == 1) { + }else if(paid == 1 && refund_status == 1){ _status = 3; - } else if (paid == 1 && status == 1 && refund_status == 0) { + }else if(paid == 1 && status == 1 && refund_status == 0){ _status = 4; - } else if (paid == 1 && status == 2 && refund_status == 0) { + }else if(paid == 1 && status == 2 && refund_status == 0){ _status = 5; - } else if (paid == 1 && status == 3 && refund_status == 0) { + }else if(paid == 1 && status == 3 && refund_status == 0){ _status = 6; - } else if (paid == 1 && refund_status == 2) { - _status = 7; + }else if(paid == 1 && refund_status == 2){ + _status =7 ; } return _status; @@ -202,15 +180,14 @@ public class OrderUtil { /** * 支付方式 - * * @param pay_type * @param paid * @return */ - public static String payTypeName(String pay_type, int paid) { + public static String payTypeName(String pay_type, int paid){ String payTypeName = ""; - if (paid == 1) { - switch (pay_type) { + if(paid == 1 ){ + switch(pay_type){ case "weixin": payTypeName = "微信支付"; break; @@ -224,8 +201,8 @@ public class OrderUtil { payTypeName = "其他支付"; break; } - } else { - switch (pay_type) { + }else{ + switch(pay_type){ default: payTypeName = "未支付"; break; @@ -234,24 +211,13 @@ public class OrderUtil { break; } } + + return payTypeName; } - /** - * 支付渠道(0微信公众号1微信小程序) - * - * @return - */ - public static String payChannel(Integer pay_channel) { - if (pay_channel.equals(1)) { - return "微信小程序"; - } else { - return "微信公众号"; - } - } - //todo 订单类型 - public static String orderType(int pinkId) { + public static String orderType(int pinkId){ 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 index 3af6212c..dc67537e 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/PageUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/PageUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.springframework.data.domain.Page; @@ -43,8 +35,6 @@ public class PageUtil extends cn.hutool.core.util.PageUtil { 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 index 869060bf..27bc9a9f 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/QueryHelp.java +++ b/yshop-common/src/main/java/co/yixiang/utils/QueryHelp.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import cn.hutool.core.collection.CollUtil; diff --git a/yshop-common/src/main/java/co/yixiang/utils/RecodeUtil.java b/yshop-common/src/main/java/co/yixiang/utils/RecodeUtil.java deleted file mode 100644 index 3a530243..00000000 --- a/yshop-common/src/main/java/co/yixiang/utils/RecodeUtil.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.utils; -import com.google.zxing.BarcodeFormat; -import com.google.zxing.EncodeHintType; -import com.google.zxing.MultiFormatWriter; -import com.google.zxing.WriterException; -import com.google.zxing.common.BitMatrix; -import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; - -import javax.imageio.ImageIO; -import javax.servlet.http.HttpServletResponse; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.util.Hashtable; - -/** - * @author :LionCity - * @date :Created in 2020/2/27 15:33 - * @description: - * @modified By: - * @version: - */ -public class RecodeUtil { - - public static void creatRrCode(String contents, int width, int height, HttpServletResponse response) { - Hashtable hints = new Hashtable(); - - hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); //容错级别最高 - hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); //设置字符编码 - hints.put(EncodeHintType.MARGIN, 1); //二维码空白区域,最小为0也有白边,只是很小,最小是6像素左右 - try { - BitMatrix bitMatrix = new MultiFormatWriter().encode(contents, BarcodeFormat.QR_CODE, width, height, hints); // 1、读取文件转换为字节数组 -// ByteArrayOutputStream out = new ByteArrayOutputStream(); - BufferedImage image = toBufferedImage(bitMatrix); - //转换成png格式的IO流 - ImageIO.write(image, "png", response.getOutputStream()); -// byte[] bytes = out.toByteArray(); -// // 2、将字节数组转为二进制 -// BASE64Encoder encoder = new BASE64Encoder(); -// binary = encoder.encodeBuffer(bytes).trim(); - } catch (WriterException e) { // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - - - - /** - * image流数据处理 - * - * @author ianly - */ - public static BufferedImage toBufferedImage(BitMatrix matrix) { - int width = matrix.getWidth(); - int height = matrix.getHeight(); - BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); - for (int x = 0; x < width; x++) { - for (int y = 0; y < height; y++) { - image.setRGB(x, y, matrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF); - } - } - return image; - } -} diff --git a/yshop-common/src/main/java/co/yixiang/utils/RedisUtil.java b/yshop-common/src/main/java/co/yixiang/utils/RedisUtil.java index 74c94813..c5091dc6 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/RedisUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/RedisUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.springframework.data.redis.core.RedisTemplate; @@ -147,4 +139,4 @@ public class RedisUtil { } return redisTemplate.opsForValue().increment(key, -delta); } -} +} \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/utils/RedisUtils.java b/yshop-common/src/main/java/co/yixiang/utils/RedisUtils.java index b98b0b8b..b4b45c5d 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/RedisUtils.java +++ b/yshop-common/src/main/java/co/yixiang/utils/RedisUtils.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.springframework.beans.factory.annotation.Value; diff --git a/yshop-common/src/main/java/co/yixiang/utils/RequestHolder.java b/yshop-common/src/main/java/co/yixiang/utils/RequestHolder.java index 71adfac6..5d89d776 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/RequestHolder.java +++ b/yshop-common/src/main/java/co/yixiang/utils/RequestHolder.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.springframework.web.context.request.RequestContextHolder; diff --git a/yshop-common/src/main/java/co/yixiang/utils/SecurityUtils.java b/yshop-common/src/main/java/co/yixiang/utils/SecurityUtils.java index 695fb809..5cb26fca 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/SecurityUtils.java +++ b/yshop-common/src/main/java/co/yixiang/utils/SecurityUtils.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import cn.hutool.json.JSONObject; @@ -37,7 +29,7 @@ public class SecurityUtils { */ public static String getUsername(){ Object obj = getUserDetails(); - return new JSONObject(obj).get("username", String.class); + return new JSONObject(obj).get("username", String.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 index fcf6354f..4e3b6f51 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/SpringContextHolder.java +++ b/yshop-common/src/main/java/co/yixiang/utils/SpringContextHolder.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import lombok.extern.slf4j.Slf4j; diff --git a/yshop-common/src/main/java/co/yixiang/utils/SpringContextUtils.java b/yshop-common/src/main/java/co/yixiang/utils/SpringContextUtils.java index 59296615..4e57a575 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/SpringContextUtils.java +++ b/yshop-common/src/main/java/co/yixiang/utils/SpringContextUtils.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.springframework.beans.BeansException; @@ -18,7 +10,7 @@ import org.springframework.stereotype.Component; */ @Component public class SpringContextUtils implements ApplicationContextAware { - public static ApplicationContext applicationContext; + public static ApplicationContext applicationContext; @Override public void setApplicationContext(ApplicationContext applicationContext) @@ -46,4 +38,4 @@ public class SpringContextUtils implements ApplicationContextAware { return applicationContext.getType(name); } -} +} \ No newline at end of file diff --git a/yshop-common/src/main/java/co/yixiang/utils/StringUtils.java b/yshop-common/src/main/java/co/yixiang/utils/StringUtils.java index 974ca18c..e5302232 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/StringUtils.java +++ b/yshop-common/src/main/java/co/yixiang/utils/StringUtils.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import cn.hutool.core.io.resource.ClassPathResource; diff --git a/yshop-common/src/main/java/co/yixiang/utils/ThrowableUtil.java b/yshop-common/src/main/java/co/yixiang/utils/ThrowableUtil.java index e526362d..0d9ac45c 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/ThrowableUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/ThrowableUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import co.yixiang.exception.BadRequestException; diff --git a/yshop-common/src/main/java/co/yixiang/utils/TranslatorUtil.java b/yshop-common/src/main/java/co/yixiang/utils/TranslatorUtil.java index 131fab48..357c9d80 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/TranslatorUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/TranslatorUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import cn.hutool.json.JSONArray; diff --git a/yshop-common/src/main/java/co/yixiang/utils/TreeUtil.java b/yshop-common/src/main/java/co/yixiang/utils/TreeUtil.java index 3c351497..87b02521 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/TreeUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/TreeUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; diff --git a/yshop-common/src/main/java/co/yixiang/utils/ValidationUtil.java b/yshop-common/src/main/java/co/yixiang/utils/ValidationUtil.java index 05fba791..d5a49d95 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/ValidationUtil.java +++ b/yshop-common/src/main/java/co/yixiang/utils/ValidationUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import cn.hutool.core.util.ObjectUtil; diff --git a/yshop-common/src/main/java/co/yixiang/utils/YshopConstant.java b/yshop-common/src/main/java/co/yixiang/utils/YshopConstant.java index 786cd51e..0f0fb8ec 100644 --- a/yshop-common/src/main/java/co/yixiang/utils/YshopConstant.java +++ b/yshop-common/src/main/java/co/yixiang/utils/YshopConstant.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; /** diff --git a/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/util/ArrayRefProperty.java b/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/util/ArrayRefProperty.java deleted file mode 100644 index 434f63d6..00000000 --- a/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/util/ArrayRefProperty.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.github.xiaoymin.knife4j.spring.util; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.refs.GenericRef; -import io.swagger.models.refs.RefType; - -/** - * @author :LionCity - * @date :Created in 2019/9/24 17:17 - * @description: 同时拥有ArrayProperty和RefProperty的特性 - * @modified By: - * @version: - */ -public class ArrayRefProperty extends ArrayProperty { - private GenericRef genericRef; - - public String get$ref() { - return genericRef.getRef(); - } - - public void set$ref(String ref) { - this.genericRef = new GenericRef(RefType.DEFINITION, ref); - - // $ref - RefProperty items = new RefProperty(); - items.setType(ref); - items.set$ref(ref); - this.items(items); - } -} diff --git a/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/util/SwaggerUtil.java b/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/util/SwaggerUtil.java deleted file mode 100644 index eeb03792..00000000 --- a/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/util/SwaggerUtil.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.github.xiaoymin.knife4j.spring.util; - -import io.swagger.models.Model; -import io.swagger.models.properties.*; -import io.swagger.models.properties.PropertyBuilder.PropertyId; -import org.springframework.beans.BeanUtils; - -import java.util.HashMap; -import java.util.Map; - -/** - * - * @author LionCitys - * @modified By: - * @version: 1.0 - * @date 2020/01/07 - */ -public class SwaggerUtil { - - /** - * 判断是否Swagger基本类型 - * - * @param type 类型 - * @return boolean - */ - private static boolean isBaseType(String type) { - return SwaggerUtil.getSwaggerProperty(type) != null; - } - - /** - * 获取Swagger支持的类型 - * - * @return {@link Map} - */ - private static Map getPropMap() { - Map map = new HashMap<>(8); - map.put("integer", new IntegerProperty()); - map.put("int", new IntegerProperty()); - map.put("long", new LongProperty()); - map.put("string", new StringProperty()); - map.put("object", new ObjectProperty()); - map.put("array", new ArrayProperty()); - map.put("boolean", new BooleanProperty()); - map.put("date", new DateTimeProperty()); - return map; - } - - /** - * 通过java类型获取Swagger类型 - * @param type javaType - * @return swaggerType - */ - private static AbstractProperty getSwaggerProperty(String type) { - type = type.toLowerCase(); - return SwaggerUtil.getPropMap().get(type); - } - - private static boolean isMap(String type) { - type = type.toLowerCase(); - return type.startsWith("map"); - } - - private static boolean isIterable(String type) { - type = type.toLowerCase(); - return type.startsWith("list") || type.startsWith("set"); - } - - /** - * 获取非基本类型的T
- * new String[] { "A>", "A", "A>>>" } - * - * @param type 类型 - * @return C1, C2, C3, C4 - */ - public static String getRef(String type) { - try { - String m = type.substring(type.lastIndexOf("«") + 1, type.indexOf("»")); - String[] cc = m.split(","); - for (String c : cc) { - if (!SwaggerUtil.isBaseType(c)) { - return c; - } - } - return type; - } catch (Exception ignored) { - - } - return "!!Unknown T!!"; - } - - /** - * 获取对象类型,主要是剥离第一层<> - * @param type JsonResult>>> - * @return Map>> - */ - public static String getRealType(String type) { - try { - return type.substring(type.indexOf("«") + 1, type.lastIndexOf("»")); - } catch (Exception ignored) { - - } - return type; - } - - /** - * 判断是否存在非基本类型<参照类型> - * - * @param type 类型 - * @return boolean - */ - private static boolean hasRef(String type) { - if (type.indexOf("»") > 0) { - try { - String m = type.substring(type.lastIndexOf("«") + 1, type.indexOf("»")); - String[] cc = m.split(","); - for (String c : cc) { - if (!SwaggerUtil.isBaseType(c)) { - return true; - } - } - return false; - } catch (Exception e) { - return false; - } - } else { - return !SwaggerUtil.isBaseType(type); - } - } - - /** - * 递归处理泛型类型
- * JsonResult, List>>> - * - * @param dataProp 数据支撑 - * @param type 类型 - * @param definitions 定义 - * @return {@link Property} - */ - public static Property getNewProp(Property dataProp, String type, Map definitions) { - Property newProp = null; - Model model = definitions.get(type); - Map props = null; - if (null != model) { - props = model.getProperties(); - } - if (null == props) { - props = new HashMap<>(2); - } - String realType = SwaggerUtil.getRealType(type); - if (SwaggerUtil.isMap(type)) { - String[] realTypes = SwaggerUtil.splitByComma(realType); - - Map argsK = new HashMap<>(2); - argsK.put(PropertyId.DESCRIPTION, "Map的键"); - argsK.put(PropertyId.TYPE, realTypes[0].toLowerCase()); - AbstractProperty prop0 = SwaggerUtil.getSwaggerProperty(realTypes[0]); - Property propK = PropertyBuilder.build(null == prop0 ? "object" : prop0.getType(), - null == prop0 ? null : prop0.getFormat(), argsK); - propK.setName("key"); - - Map argsV = new HashMap<>(2); - argsV.put(PropertyId.DESCRIPTION, "Map的值"); - argsV.put(PropertyId.TYPE, realTypes[1].toLowerCase()); - AbstractProperty prop1 = SwaggerUtil.getSwaggerProperty(realTypes[1]); - Property propV = PropertyBuilder.build(null == prop1 ? "object" : prop1.getType(), - null == prop1 ? null : prop1.getFormat(), argsV); - propV.setName("value"); - - if (!realType.equals(type)) { - propK = SwaggerUtil.getNewProp(propK, realTypes[0], definitions); - propV = SwaggerUtil.getNewProp(propV, realTypes[1], definitions); - } - - props.put(propK.getName(), propK); - props.put(propV.getName(), propV); - - newProp = new RefProperty(); - BeanUtils.copyProperties(dataProp, newProp); - ((RefProperty) newProp).set$ref(type); - } else if (SwaggerUtil.isIterable(type)) { - String ref = SwaggerUtil.getRealType(type); - newProp = new ArrayRefProperty(); - BeanUtils.copyProperties(dataProp, newProp); - ((ArrayRefProperty) newProp).set$ref(ref); - ((ArrayRefProperty) newProp).setType(ArrayRefProperty.TYPE); - if (!realType.equals(type)) { - SwaggerUtil.getNewProp(dataProp, realType, definitions); - } - } else if (SwaggerUtil.isBaseType(type)) { - Map args = new HashMap<>(2); - args.put(PropertyId.DESCRIPTION, dataProp.getDescription()); - args.put(PropertyId.TYPE, type.toLowerCase()); - AbstractProperty prop = SwaggerUtil.getSwaggerProperty(type); - newProp = PropertyBuilder.build(prop.getType(), prop.getFormat(), args); - newProp.setName(dataProp.getName()); - } else if (SwaggerUtil.hasRef(type)) { - newProp = new RefProperty(); - BeanUtils.copyProperties(dataProp, newProp); - ((RefProperty) newProp).set$ref(type); - } - if (null != model) { - model.setProperties(props); - } - - return newProp; - } - - private static String[] splitByComma(String str) { - int index = 0; - int has = 0; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if ("«".equals(c + "")) { - has++; - } - if ("»".equals(c + "")) { - has--; - } - if (",".equals(c + "") && has == 0) { - index = i; - } - } - - String[] arr = new String[2]; - arr[0] = str.substring(0, index); - arr[1] = str.substring(index + 1); - return arr; - } - - public static void main(String[] args) { - String[] ss = new String[] { "A«List«C1»»", "A«C2»", "A«B«String,«String,List«C4»»»»" }; - for (String s : ss) { - String c = SwaggerUtil.getRealType(s); - System.out.println(c); - } - - String[] s2 = new String[] { "A,B«List«C1»»", "Map«A,B»,C«List«D»»", - "Map«Map«A,B»,C«List«D»»,Map«A,B»,C«List«D»»»,C«List«D»»" }; - for (String s : s2) { - String[] arr = SwaggerUtil.splitByComma(s); - System.out.println(arr[0]); - System.out.println(arr[1]); - } - } -} diff --git a/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/web/Knife4jController.java b/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/web/Knife4jController.java deleted file mode 100644 index f39c5bc7..00000000 --- a/yshop-common/src/main/java/com/github/xiaoymin/knife4j/spring/web/Knife4jController.java +++ /dev/null @@ -1,419 +0,0 @@ -package com.github.xiaoymin.knife4j.spring.web; - -import com.github.xiaoymin.knife4j.annotations.ApiOperationSort; -import com.github.xiaoymin.knife4j.annotations.ApiSort; -import com.github.xiaoymin.knife4j.spring.common.SwaggerBootstrapUiHostNameProvider; -import com.github.xiaoymin.knife4j.spring.model.*; -import com.github.xiaoymin.knife4j.spring.util.SwaggerUtil; -import com.google.common.base.Function; -import com.google.common.base.Strings; -import com.google.common.collect.FluentIterable; -import com.google.common.collect.Lists; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.models.Model; -import io.swagger.models.Swagger; -import io.swagger.models.properties.Property; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.BeanFactoryUtils; -import org.springframework.beans.factory.ObjectProvider; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.util.ClassUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.context.WebApplicationContext; -import org.springframework.web.context.support.WebApplicationContextUtils; -import org.springframework.web.method.HandlerMethod; -import org.springframework.web.servlet.HandlerMapping; -import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition; -import org.springframework.web.servlet.mvc.method.RequestMappingInfo; -import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; -import org.springframework.web.util.UriComponents; -import springfox.documentation.RequestHandler; -import springfox.documentation.annotations.ApiIgnore; -import springfox.documentation.service.Documentation; -import springfox.documentation.service.Tag; -import springfox.documentation.spi.service.RequestHandlerProvider; -import springfox.documentation.spring.web.DocumentationCache; -import springfox.documentation.spring.web.WebMvcRequestHandler; -import springfox.documentation.spring.web.json.Json; -import springfox.documentation.spring.web.json.JsonSerializer; -import springfox.documentation.swagger.common.HostNameProvider; -import springfox.documentation.swagger2.mappers.ServiceModelToSwagger2Mapper; - -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; -import java.util.*; -import java.util.regex.Pattern; - -import static org.springframework.util.MimeTypeUtils.APPLICATION_JSON_VALUE; - -/** - * @author LionCitys - */ -@Controller -@ApiIgnore -public class Knife4jController { - private static final String DEFAULT_SORT_URL = "/v2/api-docs-ext"; - private static final String HAL_MEDIA_TYPE = "application/hal+json"; - private static final Logger LOGGER = LoggerFactory.getLogger(Knife4jController.class); - private final ServiceModelToSwagger2Mapper mapper; - private final DocumentationCache documentationCache; - private final JsonSerializer jsonSerializer; - private final String hostNameOverride; - private final List handlerProviders; - private final MarkdownFiles markdownFiles; - private ArrayList globalHandlerMappings = new ArrayList<>(); - private final RequestMethod[] globalRequestMethods; - - @Autowired - public Knife4jController(Environment environment, ServiceModelToSwagger2Mapper mapper, DocumentationCache documentationCache, JsonSerializer jsonSerializer, List handlerProviders, ObjectProvider markdownFilesObjectProvider) { - this.globalRequestMethods = new RequestMethod[]{RequestMethod.POST, RequestMethod.GET, RequestMethod.PUT, RequestMethod.DELETE, RequestMethod.PATCH, RequestMethod.OPTIONS, RequestMethod.HEAD}; - this.mapper = mapper; - this.documentationCache = documentationCache; - this.jsonSerializer = jsonSerializer; - this.hostNameOverride = environment.getProperty("springfox.documentation.swagger.v2.host", "DEFAULT"); - this.handlerProviders = handlerProviders; - this.markdownFiles = (MarkdownFiles)markdownFilesObjectProvider.getIfAvailable(); - } - - private Function> handlers() { - return new Function>() { - @Override - public Iterable apply(RequestHandlerProvider input) { - return input.requestHandlers(); - } - }; - } - - @RequestMapping(value = DEFAULT_SORT_URL, - method = RequestMethod.GET, - produces = {APPLICATION_JSON_VALUE, HAL_MEDIA_TYPE}) - @ResponseBody - public ResponseEntity apiSorts(@RequestParam(value = "group",required = false) String swaggerGroup, HttpServletRequest request) { - String groupName = Optional.ofNullable(swaggerGroup).orElse("default"); - Documentation documentation = this.documentationCache.documentationByGroup(groupName); - if (documentation == null) { - LOGGER.warn("Unable to find specification for group {},use default", groupName); - documentation = this.documentationCache.documentationByGroup("default"); - if (documentation == null) { - LOGGER.warn("Unable to find specification for group default"); - return new ResponseEntity<>(HttpStatus.NOT_FOUND); - } - } - - Swagger swagger = this.mapper.mapDocumentation(documentation); - UriComponents uriComponents = null; - - try { - uriComponents = HostNameProvider.componentsFrom(request, swagger.getBasePath()); - } catch (Throwable var9) { - LOGGER.error(var9.getClass().getName() + ":" + var9.getMessage()); - if (var9 instanceof NoClassDefFoundError) { - String msg = var9.getMessage(); - if (msg != null && !"".equals(msg) && msg.endsWith("HostNameProvider")) { - uriComponents = SwaggerBootstrapUiHostNameProvider.componentsFrom(request, swagger.getBasePath()); - } - } - } - - swagger.basePath(Strings.isNullOrEmpty(uriComponents.getPath()) ? "/" : uriComponents.getPath()); - if (Strings.isNullOrEmpty(swagger.getHost())) { - swagger.host(this.hostName(uriComponents)); - } - extend(swagger); - SwaggerExt swaggerExt = new SwaggerExt(swagger); - swaggerExt.setSwaggerBootstrapUi(this.initSwaggerBootstrapUi(request, documentation, swaggerExt)); - return new ResponseEntity<>(this.jsonSerializer.toJson(swaggerExt), HttpStatus.OK); - } - - private SwaggerBootstrapUi initSwaggerBootstrapUi(HttpServletRequest request, Documentation documentation, SwaggerExt swaggerExt) { - SwaggerBootstrapUi swaggerBootstrapUi = new SwaggerBootstrapUi(); - WebApplicationContext wc = WebApplicationContextUtils.getWebApplicationContext(request.getServletContext()); - if (wc == null) { - String msg = "WebApplicationContext is Empty~!,Enable SwaggerBootstrapUi fun fail~!"; - LOGGER.warn(msg); - swaggerBootstrapUi.setErrorMsg(msg); - return swaggerBootstrapUi; - } else { - Iterator tags = documentation.getTags().iterator(); - this.initGlobalRequestMappingArray(swaggerExt); - List targetTagLists = Lists.newArrayList(); - - ArrayList targetPathLists; - SwaggerBootstrapUiTag tag; - label64: - for(targetPathLists = Lists.newArrayList(); tags.hasNext(); targetTagLists.add(tag)) { - Tag sourceTag = tags.next(); - String tagName = sourceTag.getName(); - int order = 2147483647; - tag = new SwaggerBootstrapUiTag(order); - tag.name(tagName).description(sourceTag.getDescription()); - Api tagApi = null; - RestHandlerMapping tagMapping = null; - Iterator var15 = this.globalHandlerMappings.iterator(); - while(true) { - while(true) { - while(var15.hasNext()) { - RestHandlerMapping rhm = var15.next(); - Api api = (Api)rhm.getBeanType().getAnnotation(Api.class); - if (api != null) { - api.tags(); - if (api.tags().length > 0) { - if (Lists.newArrayList(api.tags()).contains(tagName)) { - tagApi = api; - tagMapping = rhm; - this.createPathInstance(rhm, targetPathLists); - } else { - String firstTag = api.tags()[0]; - if (StringUtils.isEmpty(firstTag) && this.checkExists(tagName, rhm.getBeanType())) { - tagApi = api; - tagMapping = rhm; - this.createPathInstance(rhm, targetPathLists); - } - } - } else if (this.checkExists(tagName, rhm.getBeanType())) { - if (!StringUtils.isEmpty(api.value())) { - tag.name(api.value()); - } - tagApi = api; - tagMapping = rhm; - this.createPathInstance(rhm, targetPathLists); - } - } else if (this.checkExists(tagName, rhm.getBeanType())) { - tagMapping = rhm; - this.createPathInstance(rhm, targetPathLists); - } - } - if (tagMapping != null) { - tag.setOrder(this.getRestTagOrder(tagMapping.getBeanType(), tagApi)); - } - continue label64; - } - } - } - - Collections.sort(targetTagLists, new Comparator() { - @Override - public int compare(SwaggerBootstrapUiTag o1, SwaggerBootstrapUiTag o2) { - return o1.getOrder().compareTo(o2.getOrder()); - } - }); - targetPathLists.sort(new Comparator() { - @Override - public int compare(SwaggerBootstrapUiPath o1, SwaggerBootstrapUiPath o2) { - return o1.getOrder().compareTo(o2.getOrder()); - } - }); - swaggerBootstrapUi.setTagSortLists(targetTagLists); - swaggerBootstrapUi.setPathSortLists(targetPathLists); - if (this.markdownFiles != null) { - swaggerBootstrapUi.setMarkdownFiles(this.markdownFiles.getMarkdownFiles()); - } - - return swaggerBootstrapUi; - } - } - - private void initGlobalRequestMappingArray(SwaggerExt swaggerExt) { - if (this.globalHandlerMappings.size() == 0) { - String parentPath = ""; - if (!StringUtils.isEmpty(swaggerExt.getBasePath()) && !"/".equals(swaggerExt.getBasePath())) { - parentPath = parentPath + swaggerExt.getBasePath(); - } - - try { - List requestHandlers = FluentIterable.from(this.handlerProviders).transformAndConcat(this.handlers()).toList(); - Iterator var4 = requestHandlers.iterator(); - - while(true) { - RequestHandler requestHandler; - do { - if (!var4.hasNext()) { - return; - } - - requestHandler = var4.next(); - } while(!(requestHandler instanceof WebMvcRequestHandler)); - - WebMvcRequestHandler webMvcRequestHandler = (WebMvcRequestHandler)requestHandler; - Set patterns = webMvcRequestHandler.getRequestMapping().getPatternsCondition().getPatterns(); - Set restMethods = webMvcRequestHandler.getRequestMapping().getMethodsCondition().getMethods(); - HandlerMethod handlerMethod = webMvcRequestHandler.getHandlerMethod(); - Class controllerClazz = ClassUtils.getUserClass(handlerMethod.getBeanType()); - Method method = ClassUtils.getMostSpecificMethod(handlerMethod.getMethod(), controllerClazz); - - String url; - for(Iterator var12 = patterns.iterator(); var12.hasNext(); this.globalHandlerMappings.add(new RestHandlerMapping(parentPath + url, controllerClazz, method, restMethods))) { - url = var12.next(); - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("url:" + url + "\r\nclass:" + controllerClazz.toString() + "\r\nmethod:" + method.toString()); - } - } - } - } catch (Exception var14) { - LOGGER.error(var14.getMessage(), var14); - } - } - - } - - /** @deprecated */ - @Deprecated - private void initGlobalRequestMappingArray(WebApplicationContext wc, SwaggerExt swaggerExt) { - if (this.globalHandlerMappings.size() == 0) { - String parentPath = ""; - if (!StringUtils.isEmpty(swaggerExt.getBasePath()) && !"/".equals(swaggerExt.getBasePath())) { - parentPath = parentPath + swaggerExt.getBasePath(); - } - - Map requestMappings = BeanFactoryUtils.beansOfTypeIncludingAncestors(wc, HandlerMapping.class, true, false); - Iterator var5 = requestMappings.values().iterator(); - - while(true) { - HandlerMapping handlerMapping; - do { - if (!var5.hasNext()) { - return; - } - handlerMapping = var5.next(); - } while(!(handlerMapping instanceof RequestMappingHandlerMapping)); - RequestMappingHandlerMapping rmhMapping = (RequestMappingHandlerMapping)handlerMapping; - Map handlerMethods = rmhMapping.getHandlerMethods(); - for (RequestMappingInfo rmi : handlerMethods.keySet()) { - PatternsRequestCondition prc = rmi.getPatternsCondition(); - Set restMethods = rmi.getMethodsCondition().getMethods(); - Set patterns = prc.getPatterns(); - HandlerMethod handlerMethod = (HandlerMethod) handlerMethods.get(rmi); - - String url; - Class clazz; - Method method; - for (Iterator var15 = patterns.iterator(); var15.hasNext(); this.globalHandlerMappings.add(new RestHandlerMapping(parentPath + url, clazz, method, restMethods))) { - url = var15.next(); - clazz = ClassUtils.getUserClass(handlerMethod.getBeanType()); - method = ClassUtils.getMostSpecificMethod(handlerMethod.getMethod(), clazz); - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("url:" + url + "\r\nclass:" + clazz.toString() + "\r\nmethod:" + method.toString()); - } - } - } - } - } - - } - - private void createPathInstance(RestHandlerMapping rhm, List targetPathLists) { - if (rhm.getRequestMethods() != null && rhm.getRequestMethods().size() != 0) { - Iterator var7 = rhm.getRequestMethods().iterator(); - - while(var7.hasNext()) { - RequestMethod requestMethod = var7.next(); - targetPathLists.add(new SwaggerBootstrapUiPath(rhm.getUrl(), requestMethod.name().toUpperCase(), this.getRestMethodOrder(rhm.getBeanOfMethod()))); - } - } else { - RequestMethod[] var3 = this.globalRequestMethods; - int var4 = var3.length; - - for(int var5 = 0; var5 < var4; ++var5) { - RequestMethod requestMethod = var3[var5]; - targetPathLists.add(new SwaggerBootstrapUiPath(rhm.getUrl(), requestMethod.name().toUpperCase(), this.getRestMethodOrder(rhm.getBeanOfMethod()))); - } - } - - } - - private int getRestTagOrder(Class aClass, Api api) { - int order = 2147483647; - if (api != null) { - int post = api.position(); - if (post == 0) { - if (aClass != null) { - ApiSort annotation = (ApiSort) ClassUtils.getUserClass(aClass).getAnnotation(ApiSort.class); - if (annotation != null) { - order = annotation.value(); - } - } - } else { - order = post; - } - } else if (aClass != null) { - ApiSort annotation = (ApiSort) ClassUtils.getUserClass(aClass).getAnnotation(ApiSort.class); - if (annotation != null) { - order = annotation.value(); - } - } - - return order; - } - - private int getRestMethodOrder(Method target) { - int pathOrder = 2147483647; - ApiOperation apiOperation = (ApiOperation)target.getAnnotation(ApiOperation.class); - ApiOperationSort apiOperationSort; - if (apiOperation != null) { - if (apiOperation.position() != 0) { - pathOrder = apiOperation.position(); - } else { - apiOperationSort = (ApiOperationSort)target.getAnnotation(ApiOperationSort.class); - if (apiOperationSort != null) { - pathOrder = apiOperationSort.value(); - } - } - } else { - apiOperationSort = (ApiOperationSort)target.getAnnotation(ApiOperationSort.class); - if (apiOperationSort != null) { - pathOrder = apiOperationSort.value(); - } - } - - return pathOrder; - } - - private boolean checkExists(String tagName, Class aClass) { - boolean flag = false; - if (!StringUtils.isEmpty(tagName)) { - String regexStr = tagName.replaceAll("-", ".*?"); - Pattern pattern = Pattern.compile(regexStr, 2); - if (pattern.matcher(aClass.getSimpleName()).matches()) { - flag = true; - } - } - - return flag; - } - - private String hostName(UriComponents uriComponents) { - if ("DEFAULT".equals(hostNameOverride)) { - String host = uriComponents.getHost(); - int port = uriComponents.getPort(); - if (port > -1) { - return String.format("%s:%d", host, port); - } - return host; - } - return hostNameOverride; - } - - private void extend(Swagger swagger) { - // 响应返回参数增强 - for (Map.Entry entry : swagger.getDefinitions().entrySet()) { - Model model = entry.getValue(); - String key = entry.getKey(); - if (key.contains("ApiResult") && !SwaggerUtil.getRealType(key).contains("ApiResult")) { - Map props = model.getProperties(); - Property dataProp = props.get("data"); - Property newProp = SwaggerUtil.getNewProp(dataProp, SwaggerUtil.getRealType(key), swagger.getDefinitions()); - props.put("data", newProp); - } - } - } -} \ No newline at end of file diff --git a/yshop-common/src/main/java/springfox/documentation/swagger2/web/Swagger2Controller.java b/yshop-common/src/main/java/springfox/documentation/swagger2/web/Swagger2Controller.java deleted file mode 100644 index 936015cf..00000000 --- a/yshop-common/src/main/java/springfox/documentation/swagger2/web/Swagger2Controller.java +++ /dev/null @@ -1,117 +0,0 @@ -package springfox.documentation.swagger2.web; - -import com.github.xiaoymin.knife4j.spring.util.SwaggerUtil; -import com.google.common.base.Strings; -import io.swagger.models.Model; -import io.swagger.models.Swagger; -import io.swagger.models.properties.Property; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.util.UriComponents; -import springfox.documentation.annotations.ApiIgnore; -import springfox.documentation.service.Documentation; -import springfox.documentation.spring.web.DocumentationCache; -import springfox.documentation.spring.web.PropertySourcedMapping; -import springfox.documentation.spring.web.json.JsonSerializer; -import springfox.documentation.swagger.common.HostNameProvider; -import springfox.documentation.swagger2.mappers.ServiceModelToSwagger2Mapper; - -import javax.servlet.http.HttpServletRequest; -import java.util.Map; -import java.util.Optional; - -import static org.springframework.util.MimeTypeUtils.APPLICATION_JSON_VALUE; - -/** - * Swagger2控制器 - * - * @author LionCitys - * @date 2020/01/07 - */ -@Controller -@ApiIgnore -public class Swagger2Controller { - private static final String DEFAULT_URL = "/v2/api-docs"; - private static final Logger LOGGER = LoggerFactory.getLogger(Swagger2Controller.class); - private static final String HAL_MEDIA_TYPE = "application/hal+json"; - private final String hostNameOverride; - private final DocumentationCache documentationCache; - private final ServiceModelToSwagger2Mapper mapper; - private final JsonSerializer jsonSerializer; - - @Autowired - public Swagger2Controller(Environment environment, DocumentationCache documentationCache, ServiceModelToSwagger2Mapper mapper, JsonSerializer jsonSerializer) { - this.hostNameOverride = environment.getProperty("springfox.documentation.swagger.v2.host", "DEFAULT"); - this.documentationCache = documentationCache; - this.mapper = mapper; - this.jsonSerializer = jsonSerializer; - } - - @RequestMapping( - value = {DEFAULT_URL}, - method = {RequestMethod.GET}, - produces = {APPLICATION_JSON_VALUE, HAL_MEDIA_TYPE} - ) - @PropertySourcedMapping( - value = "${springfox.documentation.swagger.v2.path}", - propertyKey = "springfox.documentation.swagger.v2.path" - ) - @ResponseBody - public ResponseEntity getDocumentation(@RequestParam(value = "group",required = false) String swaggerGroup, HttpServletRequest servletRequest) { - String groupName = (String) Optional.ofNullable(swaggerGroup).orElse("default"); - Documentation documentation = this.documentationCache.documentationByGroup(groupName); - if (documentation == null) { - LOGGER.warn("Unable to find specification for group {}", groupName); - return new ResponseEntity(HttpStatus.NOT_FOUND); - } else { - Swagger swagger = this.mapper.mapDocumentation(documentation); - UriComponents uriComponents = HostNameProvider.componentsFrom(servletRequest, swagger.getBasePath()); - swagger.basePath(Strings.isNullOrEmpty(uriComponents.getPath()) ? "/" : uriComponents.getPath()); - if (Strings.isNullOrEmpty(swagger.getHost())) { - swagger.host(this.hostName(uriComponents)); - } - // 扩展 - swagger = extend(swagger); - - return new ResponseEntity(this.jsonSerializer.toJson(swagger), HttpStatus.OK); - } - } - - private String hostName(UriComponents uriComponents) { - return getString(uriComponents, this.hostNameOverride); - } - - private static String getString(UriComponents uriComponents, String hostNameOverride) { - if ("DEFAULT".equals(hostNameOverride)) { - String host = uriComponents.getHost(); - int port = uriComponents.getPort(); - return port > -1 ? String.format("%s:%d", host, port) : host; - } else { - return hostNameOverride; - } - } - - private Swagger extend(Swagger swagger) { - // 响应返回参数增强 - for (Map.Entry entry : swagger.getDefinitions().entrySet()) { - Model model = entry.getValue(); - String key = entry.getKey(); - if (key.contains("ApiResult") && !SwaggerUtil.getRealType(key).contains("ApiResult")) { - Map props = model.getProperties(); - Property dataProp = props.get("data"); - Property newProp = SwaggerUtil.getNewProp(dataProp, SwaggerUtil.getRealType(key), swagger.getDefinitions()); - props.put("data", newProp); - } - } - return swagger; - } -} diff --git a/yshop-common/src/main/resources/META-INF/spring.factories b/yshop-common/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 69507c53..00000000 --- a/yshop-common/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - co.yixiang.dozer.config.DozerMapperConfig \ No newline at end of file diff --git a/yshop-common/src/main/resources/dozer/bean-mappings.xml b/yshop-common/src/main/resources/dozer/bean-mappings.xml deleted file mode 100644 index 323a656f..00000000 --- a/yshop-common/src/main/resources/dozer/bean-mappings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - \ No newline at end of file diff --git a/yshop-common/src/main/resources/dozer/global-configuration.xml b/yshop-common/src/main/resources/dozer/global-configuration.xml deleted file mode 100644 index 8d514ab5..00000000 --- a/yshop-common/src/main/resources/dozer/global-configuration.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - yyyy-MM-dd HH:mm:ss - true - false - - - - \ No newline at end of file diff --git a/yshop-common/src/test/java/co/yixiang/utils/EncryptUtilsTest.java b/yshop-common/src/test/java/co/yixiang/utils/EncryptUtilsTest.java index 9962b6b8..5a19230e 100644 --- a/yshop-common/src/test/java/co/yixiang/utils/EncryptUtilsTest.java +++ b/yshop-common/src/test/java/co/yixiang/utils/EncryptUtilsTest.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.junit.Assert; diff --git a/yshop-common/src/test/java/co/yixiang/utils/FileUtilTest.java b/yshop-common/src/test/java/co/yixiang/utils/FileUtilTest.java index a241537c..526b3f8b 100644 --- a/yshop-common/src/test/java/co/yixiang/utils/FileUtilTest.java +++ b/yshop-common/src/test/java/co/yixiang/utils/FileUtilTest.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.utils; import org.junit.Assert; diff --git a/yshop-generator/pom.xml b/yshop-generator/pom.xml index 5ff6a1a2..4d1c8cd3 100644 --- a/yshop-generator/pom.xml +++ b/yshop-generator/pom.xml @@ -5,7 +5,7 @@ yshop co.yixiang - 2.2 + 2.1 4.0.0 @@ -20,7 +20,7 @@ co.yixiang yshop-common - 2.2 + 2.1 @@ -36,4 +36,4 @@ ${configuration.version}
- + \ No newline at end of file diff --git a/yshop-generator/src/main/java/co/yixiang/gen/domain/ColumnConfig.java b/yshop-generator/src/main/java/co/yixiang/domain/ColumnInfo.java similarity index 64% rename from yshop-generator/src/main/java/co/yixiang/gen/domain/ColumnConfig.java rename to yshop-generator/src/main/java/co/yixiang/domain/ColumnInfo.java index 7f668084..d8800e67 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/domain/ColumnConfig.java +++ b/yshop-generator/src/main/java/co/yixiang/domain/ColumnInfo.java @@ -1,30 +1,25 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.domain; +package co.yixiang.domain; -import co.yixiang.gen.utils.GenUtil; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import co.yixiang.utils.GenUtil; import lombok.Data; import lombok.NoArgsConstructor; +import javax.persistence.*; + /** * 列的数据信息 * @author Zheng Jie * @date 2019-01-02 */ @Data +@Entity @NoArgsConstructor -@TableName("column_config") -public class ColumnConfig { +@Table(name = "column_config") +public class ColumnInfo { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Long id; private String tableName; @@ -65,7 +60,7 @@ public class ColumnConfig { /** 日期注解 */ private String dateAnnotation; - public ColumnConfig(String tableName, String columnName, Boolean notNull, String columnType, String remark, String keyType, String extra) { + public ColumnInfo(String tableName, String columnName, Boolean notNull, String columnType, String remark, String keyType, String extra) { this.tableName = tableName; this.columnName = columnName; this.columnType = columnType; diff --git a/yshop-generator/src/main/java/co/yixiang/gen/domain/GenConfig.java b/yshop-generator/src/main/java/co/yixiang/domain/GenConfig.java similarity index 59% rename from yshop-generator/src/main/java/co/yixiang/gen/domain/GenConfig.java rename to yshop-generator/src/main/java/co/yixiang/domain/GenConfig.java index b396a0c6..1efbae6d 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/domain/GenConfig.java +++ b/yshop-generator/src/main/java/co/yixiang/domain/GenConfig.java @@ -1,17 +1,9 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.domain; +package co.yixiang.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.NoArgsConstructor; +import javax.persistence.*; +import javax.validation.constraints.NotBlank; /** * 代码生成配置 @@ -19,8 +11,9 @@ import lombok.NoArgsConstructor; * @date 2019-01-03 */ @Data +@Entity @NoArgsConstructor -@TableName("gen_config") +@Table(name = "gen_config") public class GenConfig { public GenConfig(String tableName) { @@ -29,25 +22,32 @@ public class GenConfig { this.tableName = tableName; } - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Long id; - /**表明**/ + @NotBlank private String tableName; /** 接口名称 **/ private String apiAlias; /** 包路径 */ + @NotBlank private String pack; /** 模块名 */ + @Column(name = "module_name") + @NotBlank private String moduleName; /** 前端文件路径 */ + @NotBlank private String path; /** 前端文件路径 */ + @Column(name = "api_path") private String apiPath; /** 作者 */ diff --git a/yshop-generator/src/main/java/co/yixiang/gen/domain/vo/ColumnInfo.java b/yshop-generator/src/main/java/co/yixiang/domain/vo/ColumnInfo.java similarity index 66% rename from yshop-generator/src/main/java/co/yixiang/gen/domain/vo/ColumnInfo.java rename to yshop-generator/src/main/java/co/yixiang/domain/vo/ColumnInfo.java index a30e6d14..b7c66f27 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/domain/vo/ColumnInfo.java +++ b/yshop-generator/src/main/java/co/yixiang/domain/vo/ColumnInfo.java @@ -1,12 +1,4 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.domain.vo; +package co.yixiang.domain.vo; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/yshop-generator/src/main/java/co/yixiang/gen/domain/vo/TableInfo.java b/yshop-generator/src/main/java/co/yixiang/domain/vo/TableInfo.java similarity index 55% rename from yshop-generator/src/main/java/co/yixiang/gen/domain/vo/TableInfo.java rename to yshop-generator/src/main/java/co/yixiang/domain/vo/TableInfo.java index 5b7b442f..a1770cd2 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/domain/vo/TableInfo.java +++ b/yshop-generator/src/main/java/co/yixiang/domain/vo/TableInfo.java @@ -1,12 +1,4 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.domain.vo; +package co.yixiang.domain.vo; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/yshop-generator/src/main/java/co/yixiang/gen/service/GenConfigService.java b/yshop-generator/src/main/java/co/yixiang/gen/service/GenConfigService.java deleted file mode 100644 index c73db177..00000000 --- a/yshop-generator/src/main/java/co/yixiang/gen/service/GenConfigService.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.service; - -import co.yixiang.gen.domain.GenConfig; - -/** - * @author Zheng Jie - * @date 2019-01-14 - */ -public interface GenConfigService { - - /** - * 查询表配置 - * @param tableName 表名 - * @return 表配置 - */ - GenConfig find(String tableName); - - /** - * 更新表配置 - * @param tableName 表名 - * @param genConfig 表配置 - * @return 表配置 - */ - GenConfig update(String tableName, GenConfig genConfig); -} diff --git a/yshop-generator/src/main/java/co/yixiang/gen/service/mapper/ColumnInfoMapper.java b/yshop-generator/src/main/java/co/yixiang/gen/service/mapper/ColumnInfoMapper.java deleted file mode 100644 index 03e7bf01..00000000 --- a/yshop-generator/src/main/java/co/yixiang/gen/service/mapper/ColumnInfoMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.service.mapper; - -import co.yixiang.gen.domain.ColumnConfig; -import co.yixiang.common.mapper.CoreMapper; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -@Repository -@Mapper -public interface ColumnInfoMapper extends CoreMapper { -} diff --git a/yshop-generator/src/main/java/co/yixiang/gen/service/mapper/GenConfigMapper.java b/yshop-generator/src/main/java/co/yixiang/gen/service/mapper/GenConfigMapper.java deleted file mode 100644 index 1669bf9e..00000000 --- a/yshop-generator/src/main/java/co/yixiang/gen/service/mapper/GenConfigMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.service.mapper; - -import co.yixiang.gen.domain.GenConfig; -import co.yixiang.common.mapper.CoreMapper; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -@Repository -@Mapper -public interface GenConfigMapper extends CoreMapper { -} diff --git a/yshop-generator/src/main/java/co/yixiang/repository/ColumnInfoRepository.java b/yshop-generator/src/main/java/co/yixiang/repository/ColumnInfoRepository.java new file mode 100644 index 00000000..a703c4bf --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/repository/ColumnInfoRepository.java @@ -0,0 +1,19 @@ +package co.yixiang.repository; + +import co.yixiang.domain.ColumnInfo; +import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + +/** + * @author Zheng Jie + * @date 2019-01-14 + */ +public interface ColumnInfoRepository extends JpaRepository { + + /** + * 查询表信息 + * @param tableName 表格名 + * @return 表信息 + */ + List findByTableNameOrderByIdAsc(String tableName); +} 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..dc2c72f1 --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/repository/GenConfigRepository.java @@ -0,0 +1,18 @@ +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 { + + /** + * 查询表配置 + * @param tableName 表名 + * @return / + */ + GenConfig findByTableName(String tableName); +} diff --git a/yshop-generator/src/main/java/co/yixiang/gen/rest/GenConfigController.java b/yshop-generator/src/main/java/co/yixiang/rest/GenConfigController.java similarity index 70% rename from yshop-generator/src/main/java/co/yixiang/gen/rest/GenConfigController.java rename to yshop-generator/src/main/java/co/yixiang/rest/GenConfigController.java index bb0600f0..3e2ea586 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/rest/GenConfigController.java +++ b/yshop-generator/src/main/java/co/yixiang/rest/GenConfigController.java @@ -1,15 +1,7 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.rest; +package co.yixiang.rest; -import co.yixiang.gen.service.GenConfigService; -import co.yixiang.gen.domain.GenConfig; +import co.yixiang.domain.GenConfig; +import co.yixiang.service.GenConfigService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.http.HttpStatus; diff --git a/yshop-generator/src/main/java/co/yixiang/gen/rest/GeneratorController.java b/yshop-generator/src/main/java/co/yixiang/rest/GeneratorController.java similarity index 85% rename from yshop-generator/src/main/java/co/yixiang/gen/rest/GeneratorController.java rename to yshop-generator/src/main/java/co/yixiang/rest/GeneratorController.java index ed5a4fc0..1a50b11e 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/rest/GeneratorController.java +++ b/yshop-generator/src/main/java/co/yixiang/rest/GeneratorController.java @@ -1,16 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.rest; +package co.yixiang.rest; -import co.yixiang.gen.domain.ColumnConfig; -import co.yixiang.gen.service.GenConfigService; -import co.yixiang.gen.service.GeneratorService; +import co.yixiang.domain.ColumnInfo; +import co.yixiang.service.GenConfigService; +import co.yixiang.service.GeneratorService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import co.yixiang.exception.BadRequestException; @@ -62,13 +54,13 @@ public class GeneratorController { @ApiOperation("查询字段数据") @GetMapping(value = "/columns") public ResponseEntity getTables(@RequestParam String tableName){ - List columnInfos = generatorService.getColumns(tableName); + List columnInfos = generatorService.getColumns(tableName); return new ResponseEntity<>(PageUtil.toPage(columnInfos,columnInfos.size()), HttpStatus.OK); } @ApiOperation("保存字段数据") @PutMapping - public ResponseEntity save(@RequestBody List columnInfos){ + public ResponseEntity save(@RequestBody List columnInfos){ generatorService.save(columnInfos); 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..1a4c57df --- /dev/null +++ b/yshop-generator/src/main/java/co/yixiang/service/GenConfigService.java @@ -0,0 +1,25 @@ +package co.yixiang.service; + +import co.yixiang.domain.GenConfig; + +/** + * @author Zheng Jie + * @date 2019-01-14 + */ +public interface GenConfigService { + + /** + * 查询表配置 + * @param tableName 表名 + * @return 表配置 + */ + GenConfig find(String tableName); + + /** + * 更新表配置 + * @param tableName 表名 + * @param genConfig 表配置 + * @return 表配置 + */ + GenConfig update(String tableName, GenConfig genConfig); +} diff --git a/yshop-generator/src/main/java/co/yixiang/gen/service/GeneratorService.java b/yshop-generator/src/main/java/co/yixiang/service/GeneratorService.java similarity index 60% rename from yshop-generator/src/main/java/co/yixiang/gen/service/GeneratorService.java rename to yshop-generator/src/main/java/co/yixiang/service/GeneratorService.java index ee3f215e..91545079 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/service/GeneratorService.java +++ b/yshop-generator/src/main/java/co/yixiang/service/GeneratorService.java @@ -1,15 +1,7 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.service; +package co.yixiang.service; -import co.yixiang.gen.domain.ColumnConfig; -import co.yixiang.gen.domain.GenConfig; +import co.yixiang.domain.ColumnInfo; +import co.yixiang.domain.GenConfig; import org.springframework.http.ResponseEntity; import org.springframework.scheduling.annotation.Async; import javax.servlet.http.HttpServletRequest; @@ -35,7 +27,7 @@ public interface GeneratorService { * @param name 表名 * @return / */ - List getColumns(String name); + List getColumns(String name); /** * 同步表数据 @@ -43,13 +35,13 @@ public interface GeneratorService { * @param columnInfoList */ @Async - void sync(List columnInfos, List columnInfoList); + void sync(List columnInfos, List columnInfoList); /** * 保持数据 * @param columnInfos / */ - void save(List columnInfos); + void save(List columnInfos); /** * 获取所有table @@ -62,7 +54,7 @@ public interface GeneratorService { * @param genConfig 配置信息 * @param columns 字段信息 */ - void generator(GenConfig genConfig, List columns); + void generator(GenConfig genConfig, List columns); /** * 预览 @@ -70,7 +62,7 @@ public interface GeneratorService { * @param columns 字段信息 * @return / */ - ResponseEntity preview(GenConfig genConfig, List columns); + ResponseEntity preview(GenConfig genConfig, List columns); /** * 打包下载 @@ -79,12 +71,12 @@ public interface GeneratorService { * @param request / * @param response / */ - void download(GenConfig genConfig, List columns, HttpServletRequest request, HttpServletResponse response); + void download(GenConfig genConfig, List columns, HttpServletRequest request, HttpServletResponse response); /** * 查询数据库的表字段数据数据 * @param table / * @return / */ - List query(String table); + List query(String table); } diff --git a/yshop-generator/src/main/java/co/yixiang/gen/service/impl/GenConfigServiceImpl.java b/yshop-generator/src/main/java/co/yixiang/service/impl/GenConfigServiceImpl.java similarity index 54% rename from yshop-generator/src/main/java/co/yixiang/gen/service/impl/GenConfigServiceImpl.java rename to yshop-generator/src/main/java/co/yixiang/service/impl/GenConfigServiceImpl.java index ce1cb87d..4d4103b2 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/service/impl/GenConfigServiceImpl.java +++ b/yshop-generator/src/main/java/co/yixiang/service/impl/GenConfigServiceImpl.java @@ -1,19 +1,12 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.service.impl; +package co.yixiang.service.impl; -import co.yixiang.gen.service.mapper.GenConfigMapper; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.gen.domain.GenConfig; -import co.yixiang.gen.service.GenConfigService; +import co.yixiang.domain.GenConfig; +import co.yixiang.repository.GenConfigRepository; +import co.yixiang.service.GenConfigService; import co.yixiang.utils.StringUtils; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import java.io.File; @@ -22,13 +15,19 @@ import java.io.File; * @date 2019-01-14 */ @Service -//@CacheConfig(cacheNames = "genConfig") -public class GenConfigServiceImpl extends BaseServiceImpl implements GenConfigService { +@CacheConfig(cacheNames = "genConfig") +public class GenConfigServiceImpl implements GenConfigService { + + private final GenConfigRepository genConfigRepository; + + public GenConfigServiceImpl(GenConfigRepository genConfigRepository) { + this.genConfigRepository = genConfigRepository; + } @Override -// @Cacheable(key = "#p0") + @Cacheable(key = "#p0") public GenConfig find(String tableName) { - GenConfig genConfig = this.getOne(new QueryWrapper().eq("table_name",tableName)); + GenConfig genConfig = genConfigRepository.findByTableName(tableName); if(genConfig == null){ return new GenConfig(tableName); } @@ -36,7 +35,7 @@ public class GenConfigServiceImpl extends BaseServiceImpl implements GeneratorService { +public class GeneratorServiceImpl implements GeneratorService { @PersistenceContext private EntityManager em; + private final ColumnInfoRepository columnInfoRepository; + + public GeneratorServiceImpl(ColumnInfoRepository columnInfoRepository) { + this.columnInfoRepository = columnInfoRepository; + } @Override public Object getTables() { @@ -76,39 +71,35 @@ public class GeneratorServiceImpl extends BaseServiceImpl getColumns(String tableName) { - List columnInfos = this.list(new QueryWrapper() - .eq("table_name",tableName).orderByAsc("id")); + public List getColumns(String tableName) { + List columnInfos = columnInfoRepository.findByTableNameOrderByIdAsc(tableName); if(CollectionUtil.isNotEmpty(columnInfos)){ return columnInfos; } else { columnInfos = query(tableName); - this.saveBatch(columnInfos); - return columnInfos; + return columnInfoRepository.saveAll(columnInfos); } } @Override - public List query(String tableName){ + public List query(String tableName){ // 使用预编译防止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,tableName); List result = query.getResultList(); - List columnInfos = new ArrayList<>(); + List columnInfos = new ArrayList<>(); for (Object obj : result) { Object[] arr = (Object[]) obj; columnInfos.add( - new ColumnConfig( + new ColumnInfo( tableName, arr[0].toString(), "NO".equals(arr[1]), @@ -122,44 +113,44 @@ public class GeneratorServiceImpl extends BaseServiceImpl columnInfos, List columnInfoList) { + public void sync(List columnInfos, List columnInfoList) { // 第一种情况,数据库类字段改变或者新增字段 - for (ColumnConfig columnInfo : columnInfoList) { + for (ColumnInfo columnInfo : columnInfoList) { // 根据字段名称查找 - List columns = new ArrayList(columnInfos.stream().filter(c-> c.getColumnName().equals(columnInfo.getColumnName())).collect(Collectors.toList())); + List columns = new ArrayList(columnInfos.stream().filter(c-> c.getColumnName().equals(columnInfo.getColumnName())).collect(Collectors.toList())); // 如果能找到,就修改部分可能被字段 if(CollectionUtil.isNotEmpty(columns)){ - ColumnConfig column = columns.get(0); + ColumnInfo column = columns.get(0); column.setColumnType(columnInfo.getColumnType()); column.setExtra(columnInfo.getExtra()); column.setKeyType(columnInfo.getKeyType()); if(StringUtils.isBlank(column.getRemark())){ column.setRemark(columnInfo.getRemark()); } - this.save(column); + columnInfoRepository.save(column); } else { // 如果找不到,则保存新字段信息 - this.save(columnInfo); + columnInfoRepository.save(columnInfo); } } // 第二种情况,数据库字段删除了 - for (ColumnConfig columnInfo : columnInfos) { + for (ColumnInfo columnInfo : columnInfos) { // 根据字段名称查找 - List columns = new ArrayList(columnInfoList.stream().filter(c-> c.getColumnName().equals(columnInfo.getColumnName())).collect(Collectors.toList())); + List columns = new ArrayList(columnInfoList.stream().filter(c-> c.getColumnName().equals(columnInfo.getColumnName())).collect(Collectors.toList())); // 如果找不到,就代表字段被删除了,则需要删除该字段 if(CollectionUtil.isEmpty(columns)){ - this.removeById(columnInfo.getId()); + columnInfoRepository.delete(columnInfo); } } } @Override - public void save(List columnInfos) { - this.saveOrUpdateBatch(columnInfos); + public void save(List columnInfos) { + columnInfoRepository.saveAll(columnInfos); } @Override - public void generator(GenConfig genConfig, List columns) { + public void generator(GenConfig genConfig, List columns) { if(genConfig.getId() == null){ throw new BadRequestException("请先配置生成器"); } @@ -172,7 +163,7 @@ public class GeneratorServiceImpl extends BaseServiceImpl preview(GenConfig genConfig, List columns) { + public ResponseEntity preview(GenConfig genConfig, List columns) { if(genConfig.getId() == null){ throw new BadRequestException("请先配置生成器"); } @@ -181,7 +172,7 @@ public class GeneratorServiceImpl extends BaseServiceImpl columns, HttpServletRequest request, HttpServletResponse response) { + public void download(GenConfig genConfig, List columns, HttpServletRequest request, HttpServletResponse response) { if(genConfig.getId() == null){ throw new BadRequestException("请先配置生成器"); } diff --git a/yshop-generator/src/main/java/co/yixiang/gen/utils/ColUtil.java b/yshop-generator/src/main/java/co/yixiang/utils/ColUtil.java similarity index 66% rename from yshop-generator/src/main/java/co/yixiang/gen/utils/ColUtil.java rename to yshop-generator/src/main/java/co/yixiang/utils/ColUtil.java index 51f16ee9..a00097b9 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/utils/ColUtil.java +++ b/yshop-generator/src/main/java/co/yixiang/utils/ColUtil.java @@ -1,12 +1,4 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.utils; +package co.yixiang.utils; import org.apache.commons.configuration.*; diff --git a/yshop-generator/src/main/java/co/yixiang/gen/utils/GenUtil.java b/yshop-generator/src/main/java/co/yixiang/utils/GenUtil.java similarity index 85% rename from yshop-generator/src/main/java/co/yixiang/gen/utils/GenUtil.java rename to yshop-generator/src/main/java/co/yixiang/utils/GenUtil.java index 6b0d530b..5707eb04 100644 --- a/yshop-generator/src/main/java/co/yixiang/gen/utils/GenUtil.java +++ b/yshop-generator/src/main/java/co/yixiang/utils/GenUtil.java @@ -1,20 +1,10 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.gen.utils; +package co.yixiang.utils; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.template.*; -import co.yixiang.gen.domain.GenConfig; -import co.yixiang.utils.FileUtil; -import co.yixiang.utils.StringUtils; import lombok.extern.slf4j.Slf4j; -import co.yixiang.gen.domain.ColumnConfig; +import co.yixiang.domain.GenConfig; +import co.yixiang.domain.ColumnInfo; import org.springframework.util.ObjectUtils; import java.io.File; import java.io.FileWriter; @@ -46,22 +36,14 @@ public class GenUtil { */ private static List getAdminTemplateNames() { List templateNames = new ArrayList<>(); - /*templateNames.add("Entity"); + templateNames.add("Entity"); templateNames.add("Dto"); templateNames.add("Mapper"); templateNames.add("Controller"); templateNames.add("QueryCriteria"); templateNames.add("Service"); templateNames.add("ServiceImpl"); - templateNames.add("Repository");*/ - templateNames.add("EntityP"); - templateNames.add("DtoP"); - templateNames.add("MapperP"); - templateNames.add("ControllerP"); - templateNames.add("QueryCriteriaP"); - templateNames.add("ServiceP"); - templateNames.add("ServiceImplP"); - //templateNames.add("Repository"); + templateNames.add("Repository"); return templateNames; } @@ -76,7 +58,7 @@ public class GenUtil { return templateNames; } - public static List> preview(List columns, GenConfig genConfig) { + public static List> preview(List columns, GenConfig genConfig) { Map genMap = getGenMap(columns, genConfig); List> genList = new ArrayList<>(); // 获取后端模版 @@ -102,7 +84,7 @@ public class GenUtil { return genList; } - public static String download(List columns, GenConfig genConfig) throws IOException { + public static String download(List columns, GenConfig genConfig) throws IOException { String tempPath =System.getProperty("java.io.tmpdir") + "yshop-gen-temp" + File.separator + genConfig.getTableName() + File.separator; Map genMap = getGenMap(columns, genConfig); TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); @@ -140,7 +122,7 @@ public class GenUtil { return tempPath; } - public static void generatorCode(List columnInfos, GenConfig genConfig) throws IOException { + public static void generatorCode(List columnInfos, GenConfig genConfig) throws IOException { Map genMap = getGenMap(columnInfos, genConfig); TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); // 生成后端代码 @@ -179,7 +161,7 @@ public class GenUtil { } // 获取模版数据 - private static Map getGenMap(List columnInfos, GenConfig genConfig) { + private static Map getGenMap(List columnInfos, GenConfig genConfig) { // 存储模版字段数据 Map genMap = new HashMap<>(16); // 接口别名 @@ -209,8 +191,6 @@ public class GenUtil { genMap.put("changeClassName", changeClassName); // 存在 Timestamp 字段 genMap.put("hasTimestamp",false); - // 存在 Images 字段 - genMap.put("hasImages",false); // 查询类中存在 Timestamp 字段 genMap.put("queryHasTimestamp",false); // 存在 BigDecimal 字段 @@ -236,7 +216,7 @@ public class GenUtil { // 存储不为空的字段信息 List> isNotNullColumns = new ArrayList<>(); - for (ColumnConfig column : columnInfos) { + for (ColumnInfo column : columnInfos) { Map listMap = new HashMap<>(16); // 字段描述 listMap.put("remark",column.getRemark()); @@ -256,10 +236,6 @@ public class GenUtil { // 存储大写开头的字段名 genMap.put("pkCapitalColName",capitalColumnName); } - if("Images".equals(column.getFormType())){ - // 存在 Images 字段 - genMap.put("hasImages",true); - } // 是否存在 Timestamp 类型的字段 if(TIMESTAMP.equals(colType)){ genMap.put("hasTimestamp",true); @@ -355,50 +331,30 @@ public class GenUtil { if ("Entity".equals(templateName)) { return packagePath + "domain" + File.separator + className + ".java"; } - if ("EntityP".equals(templateName)) { - return packagePath + "domain" + File.separator + className + ".java"; - } + if ("Controller".equals(templateName)) { return packagePath + "rest" + File.separator + className + "Controller.java"; } - if ("ControllerP".equals(templateName)) { - return packagePath + "rest" + File.separator + className + "Controller.java"; - } + if ("Service".equals(templateName)) { return packagePath + "service" + File.separator + className + "Service.java"; } - if ("ServiceP".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 ("ServiceImplP".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 ("DtoP".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 ("QueryCriteriaP".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 ("MapperP".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"; diff --git a/yshop-logging/pom.xml b/yshop-logging/pom.xml index fd9c41c3..5c955447 100644 --- a/yshop-logging/pom.xml +++ b/yshop-logging/pom.xml @@ -5,7 +5,7 @@ yshop co.yixiang - 2.2 + 2.1 4.0.0 @@ -16,13 +16,7 @@ co.yixiang yshop-common - 2.2 - - - co.yixiang - yshop-mproot - 2.2 - compile + 2.1 - + \ 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..69654e69 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/aop/log/Log.java @@ -0,0 +1,17 @@ +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 ""; + int type() default 0; +} diff --git a/yshop-logging/src/main/java/co/yixiang/logging/aspect/LogAspect.java b/yshop-logging/src/main/java/co/yixiang/aspect/LogAspect.java similarity index 83% rename from yshop-logging/src/main/java/co/yixiang/logging/aspect/LogAspect.java rename to yshop-logging/src/main/java/co/yixiang/aspect/LogAspect.java index e10529d8..b0eebb81 100644 --- a/yshop-logging/src/main/java/co/yixiang/logging/aspect/LogAspect.java +++ b/yshop-logging/src/main/java/co/yixiang/aspect/LogAspect.java @@ -1,16 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.aspect; +package co.yixiang.aspect; import lombok.extern.slf4j.Slf4j; -import co.yixiang.logging.domain.Log; -import co.yixiang.logging.service.LogService; +import co.yixiang.domain.Log; +import co.yixiang.service.LogService; import co.yixiang.utils.RequestHolder; import co.yixiang.utils.SecurityUtils; import co.yixiang.utils.StringUtils; @@ -26,7 +18,7 @@ import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-24 */ @Component @@ -45,7 +37,7 @@ public class LogAspect { /** * 配置切入点 */ - @Pointcut("@annotation(co.yixiang.logging.aop.log.Log)") + @Pointcut("@annotation(co.yixiang.aop.log.Log)") public void logPointcut() { // 该方法无方法体,主要为了让同类中其他方法使用此切入点 } diff --git a/yshop-logging/src/main/java/co/yixiang/logging/domain/Log.java b/yshop-logging/src/main/java/co/yixiang/domain/Log.java similarity index 60% rename from yshop-logging/src/main/java/co/yixiang/logging/domain/Log.java rename to yshop-logging/src/main/java/co/yixiang/domain/Log.java index d7aa8f79..1a7671fc 100644 --- a/yshop-logging/src/main/java/co/yixiang/logging/domain/Log.java +++ b/yshop-logging/src/main/java/co/yixiang/domain/Log.java @@ -1,17 +1,5 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.domain; +package co.yixiang.domain; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.annotations.CreationTimestamp; @@ -20,15 +8,17 @@ import java.io.Serializable; import java.sql.Timestamp; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-24 */ +@Entity @Data -@TableName("log") +@Table(name = "log") @NoArgsConstructor public class Log implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; /** 操作用户 */ @@ -45,15 +35,19 @@ public class Log implements Serializable { private Integer type; /** 参数 */ + @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; /** 浏览器 */ @@ -63,10 +57,12 @@ public class Log implements Serializable { private Long time; /** 异常详细 */ + @Column(name = "exception_detail", columnDefinition = "text") private byte[] exceptionDetail; /** 创建日期 */ - @TableField(fill = FieldFill.INSERT) + @CreationTimestamp + @Column(name = "create_time") private Timestamp createTime; public Log(String logType, Long time) { diff --git a/yshop-logging/src/main/java/co/yixiang/logging/aop/log/Log.java b/yshop-logging/src/main/java/co/yixiang/logging/aop/log/Log.java deleted file mode 100644 index 6b28ce2f..00000000 --- a/yshop-logging/src/main/java/co/yixiang/logging/aop/log/Log.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.aop.log; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author hupeng - * @date 2018-11-24 - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface Log { - String value() default ""; - int type() default 0; -} diff --git a/yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogSmallDTO.java b/yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogSmallDTO.java deleted file mode 100644 index 3a7d9907..00000000 --- a/yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogSmallDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.service.dto; - -import lombok.Data; -import java.io.Serializable; -import java.sql.Timestamp; - -/** - * @author hupeng - * @date 2019-5-22 - */ -@Data -public class LogSmallDTO implements Serializable { - - private String description; - - private String requestIp; - - private Long time; - - private String address; - - private String browser; - - private Timestamp createTime; -} diff --git a/yshop-logging/src/main/java/co/yixiang/logging/service/mapper/LogMapper.java b/yshop-logging/src/main/java/co/yixiang/logging/service/mapper/LogMapper.java deleted file mode 100644 index 79c9045b..00000000 --- a/yshop-logging/src/main/java/co/yixiang/logging/service/mapper/LogMapper.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.logging.domain.Log; -import org.apache.ibatis.annotations.Delete; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.springframework.stereotype.Repository; -import java.util.List; - -/** - * @author hupeng - * @date 2019-5-22 - */ -@Repository -@Mapper -public interface LogMapper extends CoreMapper { - - @Delete("delete from log where log_type = #{logType}") - void deleteByLogType(@Param("logType") String logType); - @Select("") - List findAllByPageable(@Param("nickname") String nickname); - @Select( "select count(*) FROM (select request_ip FROM log where create_time between #{date1} and #{date2} GROUP BY request_ip) as s") - long findIp(@Param("date1") String date1, @Param("date2")String date2); -} 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..b4fb713e --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/repository/LogRepository.java @@ -0,0 +1,50 @@ +package co.yixiang.repository; + +import co.yixiang.domain.Log; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +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 org.springframework.stereotype.Repository; + +import java.util.Map; + +/** + * @author Zheng Jie + * @date 2018-11-24 + */ +@Repository +public interface LogRepository extends JpaRepository, JpaSpecificationExecutor { + + + + @Query(nativeQuery = true, + value = "select l.id,l.create_time as createTime,l.description," + + "l.request_ip as requestIp,l.address," + + "u.nickname from log l left join yx_user u on u.uid=l.uid " + + " where l.type=1" + + " and if(?1 !='',u.nickname LIKE CONCAT('%',?1,'%'),1=1) order by l.id desc", + countQuery = "select count(*) from log l left join yx_user u on u.uid=l.uid" + + " where l.type=1 " + + "and if(?1 !='',u.nickname LIKE CONCAT('%',?1,'%'),1=1)") + Page findAllByPageable(String nickname, + Pageable pageable); + /** + * 获取一个时间段的IP记录 + * @param date1 startTime + * @param date2 entTime + * @return IP数目 + */ + @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); + + /** + * 根据日志类型删除信息 + * @param logType 日志类型 + */ + @Query(nativeQuery = true,value = "delete from log where log_type = ?1") + @Modifying + void deleteByLogType(String logType); +} diff --git a/yshop-logging/src/main/java/co/yixiang/logging/rest/LogController.java b/yshop-logging/src/main/java/co/yixiang/rest/LogController.java similarity index 77% rename from yshop-logging/src/main/java/co/yixiang/logging/rest/LogController.java rename to yshop-logging/src/main/java/co/yixiang/rest/LogController.java index 638230d6..d6541149 100644 --- a/yshop-logging/src/main/java/co/yixiang/logging/rest/LogController.java +++ b/yshop-logging/src/main/java/co/yixiang/rest/LogController.java @@ -1,18 +1,10 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.rest; +package co.yixiang.rest; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import co.yixiang.logging.service.LogService; -import co.yixiang.logging.service.dto.LogQueryCriteria; +import co.yixiang.service.LogService; +import co.yixiang.service.dto.LogQueryCriteria; import co.yixiang.utils.SecurityUtils; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; @@ -23,7 +15,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-24 */ @RestController @@ -41,7 +33,7 @@ public class LogController { @Log("导出数据") @ApiOperation("导出数据") @GetMapping(value = "/download") - @PreAuthorize("@el.check('admin','log:list')") + @PreAuthorize("@el.check()") public void download(HttpServletResponse response, LogQueryCriteria criteria) throws IOException { criteria.setLogType("INFO"); logService.download(logService.queryAll(criteria), response); @@ -50,21 +42,21 @@ public class LogController { @Log("导出错误数据") @ApiOperation("导出错误数据") @GetMapping(value = "/error/download") - @PreAuthorize("@el.check('admin','log:list')") + @PreAuthorize("@el.check()") public void errorDownload(HttpServletResponse response, LogQueryCriteria criteria) throws IOException { criteria.setLogType("ERROR"); logService.download(logService.queryAll(criteria), response); } @GetMapping @ApiOperation("日志查询") - @PreAuthorize("@el.check('admin','log:list')") + @PreAuthorize("@el.check()") public ResponseEntity getLogs(LogQueryCriteria criteria, Pageable pageable){ criteria.setLogType("INFO"); criteria.setType(0); return new ResponseEntity<>(logService.queryAll(criteria,pageable), HttpStatus.OK); } @GetMapping(value = "/mlogs") - @PreAuthorize("@el.check('admin','log:list')") + @PreAuthorize("@el.check()") public ResponseEntity getApiLogs(LogQueryCriteria criteria, Pageable pageable){ criteria.setLogType("INFO"); criteria.setType(1); @@ -80,7 +72,7 @@ public class LogController { @GetMapping(value = "/error") @ApiOperation("错误日志查询") - @PreAuthorize("@el.check('admin','logError:list')") + @PreAuthorize("@el.check()") public ResponseEntity getErrorLogs(LogQueryCriteria criteria, Pageable pageable){ criteria.setLogType("ERROR"); return new ResponseEntity<>(logService.queryAll(criteria,pageable), HttpStatus.OK); @@ -88,14 +80,14 @@ public class LogController { @GetMapping(value = "/error/{id}") @ApiOperation("日志异常详情查询") - @PreAuthorize("@el.check('admin','logError:detail')") + @PreAuthorize("@el.check()") public ResponseEntity getErrorLogs(@PathVariable Long id){ return new ResponseEntity<>(logService.findByErrDetail(id), HttpStatus.OK); } @DeleteMapping(value = "/del/error") @Log("删除所有ERROR日志") @ApiOperation("删除所有ERROR日志") - @PreAuthorize("@el.check('admin','logError:remove')") + @PreAuthorize("@el.check()") public ResponseEntity delAllByError(){ logService.delAllByError(); return new ResponseEntity<>(HttpStatus.OK); @@ -104,7 +96,7 @@ public class LogController { @DeleteMapping(value = "/del/info") @Log("删除所有INFO日志") @ApiOperation("删除所有INFO日志") - @PreAuthorize("@el.check('admin','logInfo:remove')") + @PreAuthorize("@el.check()") public ResponseEntity delAllByInfo(){ logService.delAllByInfo(); return new ResponseEntity<>(HttpStatus.OK); diff --git a/yshop-logging/src/main/java/co/yixiang/logging/service/LogService.java b/yshop-logging/src/main/java/co/yixiang/service/LogService.java similarity index 73% rename from yshop-logging/src/main/java/co/yixiang/logging/service/LogService.java rename to yshop-logging/src/main/java/co/yixiang/service/LogService.java index d842f14a..1d47163f 100644 --- a/yshop-logging/src/main/java/co/yixiang/logging/service/LogService.java +++ b/yshop-logging/src/main/java/co/yixiang/service/LogService.java @@ -1,16 +1,7 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.service; +package co.yixiang.service; -import co.yixiang.logging.domain.Log; -import co.yixiang.common.service.BaseService; -import co.yixiang.logging.service.dto.LogQueryCriteria; +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; @@ -20,10 +11,10 @@ import java.io.IOException; import java.util.List; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-24 */ -public interface LogService extends BaseService { +public interface LogService { diff --git a/yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogErrorDTO.java b/yshop-logging/src/main/java/co/yixiang/service/dto/LogErrorDTO.java similarity index 50% rename from yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogErrorDTO.java rename to yshop-logging/src/main/java/co/yixiang/service/dto/LogErrorDTO.java index e01e4fde..9104e78a 100644 --- a/yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogErrorDTO.java +++ b/yshop-logging/src/main/java/co/yixiang/service/dto/LogErrorDTO.java @@ -1,19 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.service.dto; +package co.yixiang.service.dto; import lombok.Data; import java.io.Serializable; import java.sql.Timestamp; /** -* @author hupeng +* @author Zheng Jie * @date 2019-5-22 */ @Data @@ -36,4 +28,4 @@ public class LogErrorDTO implements Serializable { private String address; private Timestamp createTime; -} +} \ No newline at end of file diff --git a/yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogQueryCriteria.java b/yshop-logging/src/main/java/co/yixiang/service/dto/LogQueryCriteria.java similarity index 53% rename from yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogQueryCriteria.java rename to yshop-logging/src/main/java/co/yixiang/service/dto/LogQueryCriteria.java index a8316926..f376fe76 100644 --- a/yshop-logging/src/main/java/co/yixiang/logging/service/dto/LogQueryCriteria.java +++ b/yshop-logging/src/main/java/co/yixiang/service/dto/LogQueryCriteria.java @@ -1,21 +1,13 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.service.dto; +package co.yixiang.service.dto; -import co.yixiang.annotation.Query; import lombok.Data; +import co.yixiang.annotation.Query; import java.sql.Timestamp; import java.util.List; /** * 日志查询类 - * @author hupeng + * @author Zheng Jie * @date 2019-6-4 09:23:07 */ @Data 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..740fed79 --- /dev/null +++ b/yshop-logging/src/main/java/co/yixiang/service/dto/LogSmallDTO.java @@ -0,0 +1,25 @@ +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; + + private String requestIp; + + private Long time; + + private String address; + + private String browser; + + private Timestamp createTime; +} diff --git a/yshop-logging/src/main/java/co/yixiang/logging/service/impl/LogServiceImpl.java b/yshop-logging/src/main/java/co/yixiang/service/impl/LogServiceImpl.java similarity index 58% rename from yshop-logging/src/main/java/co/yixiang/logging/service/impl/LogServiceImpl.java rename to yshop-logging/src/main/java/co/yixiang/service/impl/LogServiceImpl.java index ceab876a..09c3269a 100644 --- a/yshop-logging/src/main/java/co/yixiang/logging/service/impl/LogServiceImpl.java +++ b/yshop-logging/src/main/java/co/yixiang/service/impl/LogServiceImpl.java @@ -1,29 +1,18 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.logging.service.impl; +package co.yixiang.service.impl; import cn.hutool.core.lang.Dict; import cn.hutool.core.util.ObjectUtil; import cn.hutool.json.JSONObject; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.logging.service.mapper.LogMapper; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.dozer.service.IGenerator; -import co.yixiang.logging.service.LogService; -import co.yixiang.logging.service.dto.LogErrorDTO; -import co.yixiang.logging.service.dto.LogQueryCriteria; -import co.yixiang.logging.service.dto.LogSmallDTO; +import co.yixiang.domain.Log; +import co.yixiang.repository.LogRepository; +import co.yixiang.service.LogService; +import co.yixiang.service.dto.LogQueryCriteria; +import co.yixiang.service.mapper.LogErrorMapper; +import co.yixiang.service.mapper.LogSmallMapper; import co.yixiang.utils.*; -import com.github.pagehelper.PageInfo; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; @@ -38,74 +27,64 @@ import java.util.List; import java.util.Map; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-24 */ @Service @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class LogServiceImpl extends BaseServiceImpl implements LogService { +public class LogServiceImpl implements LogService { + private final LogRepository logRepository; - private final LogMapper logMapper; + private final LogErrorMapper logErrorMapper; - private final IGenerator generator; + private final LogSmallMapper logSmallMapper; - public LogServiceImpl(LogMapper logMapper, IGenerator generator) { - this.logMapper = logMapper; - this.generator = generator; - } @Override public Object findAllByPageable(String nickname, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(logMapper.findAllByPageable(nickname)); + Page page = logRepository.findAllByPageable(nickname,pageable); Map map = new LinkedHashMap<>(2); - map.put("content",page.getList()); - map.put("totalElements",page.getTotal()); + map.put("content",page.getContent()); + map.put("totalElements",page.getTotalElements()); return map; } + public LogServiceImpl(LogRepository logRepository, LogErrorMapper logErrorMapper, LogSmallMapper logSmallMapper) { + this.logRepository = logRepository; + this.logErrorMapper = logErrorMapper; + this.logSmallMapper = logSmallMapper; + } @Override public Object queryAll(LogQueryCriteria criteria, Pageable pageable){ - - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); + Page page = logRepository.findAll(((root, criteriaQuery, cb) -> QueryHelp.getPredicate(root, criteria, cb)),pageable); String status = "ERROR"; - if(status.equals(criteria.getLogType())){ - map.put("content", generator.convert(page.getList(), LogErrorDTO.class)); - map.put("totalElements", page.getTotal()); + if (status.equals(criteria.getLogType())) { + return PageUtil.toPage(page.map(logErrorMapper::toDto)); } - map.put("content", page.getList()); - map.put("totalElements", page.getTotal()); - return map; + return page; } @Override - public List queryAll(LogQueryCriteria criteria) { - return baseMapper.selectList(QueryHelpPlus.getPredicate(co.yixiang.logging.domain.Log.class, criteria)); + public List queryAll(LogQueryCriteria criteria) { + return logRepository.findAll(((root, criteriaQuery, cb) -> QueryHelp.getPredicate(root, criteria, cb))); } @Override public Object queryAllByUser(LogQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), LogSmallDTO.class)); - map.put("totalElements", page.getTotal()); - return map; - + 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, - co.yixiang.logging.domain.Log log, Long uid){ + Log log,Long uid){ MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod(); - Log aopLog = method.getAnnotation(Log.class); + co.yixiang.aop.log.Log aopLog = method.getAnnotation(co.yixiang.aop.log.Log.class); // 方法路径 String methodName = joinPoint.getTarget().getClass().getName()+"."+signature.getName()+"()"; @@ -145,21 +124,21 @@ public class LogServiceImpl extends BaseServiceImpl logs, HttpServletResponse response) throws IOException { + public void download(List logs, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); - for (co.yixiang.logging.domain.Log log : logs) { + for (Log log : logs) { Map map = new LinkedHashMap<>(); map.put("用户名", log.getUsername()); map.put("IP", log.getRequestIp()); @@ -177,12 +156,12 @@ public class LogServiceImpl extends BaseServiceImpl { + +} \ 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..d4c85630 --- /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.base.BaseMapper; +import co.yixiang.service.dto.LogSmallDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2019-5-22 + */ +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface LogSmallMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/yshop-mp/pom.xml b/yshop-mp/pom.xml index 37b29d80..643f31ab 100644 --- a/yshop-mp/pom.xml +++ b/yshop-mp/pom.xml @@ -5,7 +5,7 @@ yshop co.yixiang - 2.2 + 2.1 4.0.0 @@ -35,9 +35,9 @@ co.yixiang yshop-common - 2.2 + 2.1 - + \ 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 index 9f88b7c8..3750a15f 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/builder/AbstractBuilder.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/builder/AbstractBuilder.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.builder; import me.chanjar.weixin.mp.api.WxMpService; 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 index becb3593..a2f30709 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/builder/ImageBuilder.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/builder/ImageBuilder.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.builder; import me.chanjar.weixin.mp.api.WxMpService; 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 index cfb387b3..a98cadfe 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/builder/TextBuilder.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/builder/TextBuilder.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.builder; import me.chanjar.weixin.mp.api.WxMpService; 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 index ec5d89b4..76b870b7 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/config/WxMpConfiguration.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/config/WxMpConfiguration.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.config; import cn.hutool.core.util.StrUtil; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/config/WxPayConfiguration.java b/yshop-mp/src/main/java/co/yixiang/mp/config/WxPayConfiguration.java index 2df09e4e..130f9d0f 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/config/WxPayConfiguration.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/config/WxPayConfiguration.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.config; import co.yixiang.constant.ShopConstants; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatArticleController.java b/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatArticleController.java index cd911c06..9581a22d 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatArticleController.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatArticleController.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.controller; import cn.hutool.core.date.DateUtil; @@ -13,11 +5,10 @@ import cn.hutool.core.util.StrUtil; import co.yixiang.exception.BadRequestException; import co.yixiang.mp.domain.YxArticle; import co.yixiang.mp.service.YxArticleService; -import co.yixiang.mp.service.dto.YxArticleDto; +import co.yixiang.mp.service.dto.YxArticleDTO; import co.yixiang.mp.service.dto.YxArticleQueryCriteria; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.BeanUtils; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -55,7 +46,7 @@ public class WechatArticleController { @PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_CREATE')") public ResponseEntity create(@Validated @RequestBody YxArticle resources){ resources.setAddTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm")); - return new ResponseEntity(yxArticleService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxArticleService.create(resources),HttpStatus.CREATED); } @@ -63,7 +54,7 @@ public class WechatArticleController { @PutMapping(value = "/yxArticle") @PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_EDIT')") public ResponseEntity update(@Validated @RequestBody YxArticle resources){ - yxArticleService.saveOrUpdate(resources); + yxArticleService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -73,7 +64,7 @@ public class WechatArticleController { @PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxArticleService.removeById(id); + yxArticleService.delete(id); return new ResponseEntity(HttpStatus.OK); } @@ -82,11 +73,9 @@ public class WechatArticleController { @PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')") public ResponseEntity publish(@PathVariable Integer id) throws Exception{ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - YxArticleDto yxArticleDTO= new YxArticleDto(); - YxArticle yxArticle = yxArticleService.getById(id); - BeanUtils.copyProperties(yxArticle,yxArticleDTO); + YxArticleDTO yxArticleDTO= yxArticleService.findById(id); yxArticleService.uploadNews(yxArticleDTO); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatMenuController.java b/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatMenuController.java index 2daf7fa1..77d35b06 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatMenuController.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatMenuController.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.controller; @@ -18,7 +10,6 @@ import co.yixiang.utils.OrderUtil; import co.yixiang.utils.RedisUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import me.chanjar.weixin.common.bean.menu.WxMenu; @@ -50,7 +41,7 @@ public class WechatMenuController { @GetMapping(value = "/YxWechatMenu") @PreAuthorize("@el.check('admin','YxWechatMenu_ALL','YxWechatMenu_SELECT')") public ResponseEntity getYxWechatMenus(){ - return new ResponseEntity(YxWechatMenuService.getOne(new QueryWrapper().eq("`key`","wechat_menus")),HttpStatus.OK); + return new ResponseEntity(YxWechatMenuService.findById("wechat_menus"),HttpStatus.OK); } @@ -69,12 +60,12 @@ public class WechatMenuController { if(isExist){ YxWechatMenu.setKey("wechat_menus"); YxWechatMenu.setResult(jsonButton); - YxWechatMenuService.saveOrUpdate(YxWechatMenu); + YxWechatMenuService.update(YxWechatMenu); }else { YxWechatMenu.setKey("wechat_menus"); YxWechatMenu.setResult(jsonButton); YxWechatMenu.setAddTime(OrderUtil.getSecondTimestampTwo()); - YxWechatMenuService.save(YxWechatMenu); + YxWechatMenuService.create(YxWechatMenu); } @@ -93,4 +84,4 @@ public class WechatMenuController { -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatReplyController.java b/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatReplyController.java index 9d045f13..a115dafa 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatReplyController.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatReplyController.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.controller; import cn.hutool.core.util.ObjectUtil; @@ -62,7 +54,7 @@ public class WechatReplyController { yxWechatReplyService.create(yxWechatReply); }else{ yxWechatReply.setId(isExist.getId()); - yxWechatReplyService.upDate(yxWechatReply); + yxWechatReplyService.update(yxWechatReply); } return new ResponseEntity(HttpStatus.CREATED); @@ -72,4 +64,4 @@ public class WechatReplyController { -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatTemplateController.java b/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatTemplateController.java index f60563ff..9a75c5b8 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatTemplateController.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/controller/WechatTemplateController.java @@ -1,24 +1,12 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.controller; import cn.hutool.core.util.StrUtil; -import co.yixiang.dozer.service.IGenerator; import co.yixiang.exception.BadRequestException; import co.yixiang.mp.domain.YxWechatTemplate; import co.yixiang.mp.service.YxWechatTemplateService; -import co.yixiang.mp.service.dto.YxWechatTemplateDto; import co.yixiang.mp.service.dto.YxWechatTemplateQueryCriteria; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import lombok.extern.java.Log; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; @@ -27,61 +15,51 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Arrays; - /** -* @author hupeng +* @author xuwenbo * @date 2019-12-10 */ @Api(tags = "商城:微信模板管理") @RestController -@RequestMapping("/api/yxWechatTemplate") -@AllArgsConstructor +@RequestMapping("api") public class WechatTemplateController { - private final YxWechatTemplateService yxWechatTemplateService; - private final IGenerator generator; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('admin','yxWechatTemplate:list')") - public void download(HttpServletResponse response, YxWechatTemplateQueryCriteria criteria) throws IOException { - yxWechatTemplateService.download(generator.convert(yxWechatTemplateService.queryAll(criteria), YxWechatTemplateDto.class), response); + public WechatTemplateController(YxWechatTemplateService yxWechatTemplateService) { + this.yxWechatTemplateService = yxWechatTemplateService; } - @GetMapping - @ApiOperation("查询微信模板消息") - @PreAuthorize("@el.check('admin','yxWechatTemplate:list')") - public ResponseEntity getYxWechatTemplates(YxWechatTemplateQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(yxWechatTemplateService.queryAll(criteria,pageable),HttpStatus.OK); + @ApiOperation(value = "查询") + @GetMapping(value = "/yxWechatTemplate") + @PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_SELECT')") + public ResponseEntity getYxWechatTemplates(YxWechatTemplateQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity(yxWechatTemplateService.queryAll(criteria,pageable),HttpStatus.OK); } - @PostMapping - @ApiOperation("新增微信模板消息") - @PreAuthorize("@el.check('admin','yxWechatTemplate:add')") - public ResponseEntity create(@Validated @RequestBody YxWechatTemplate resources){ - return new ResponseEntity<>(yxWechatTemplateService.save(resources),HttpStatus.CREATED); + @ApiOperation(value = "新增") + @PostMapping(value = "/yxWechatTemplate") + @PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_CREATE')") + public ResponseEntity create(@Validated @RequestBody YxWechatTemplate resources){ + //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); + return new ResponseEntity(yxWechatTemplateService.create(resources),HttpStatus.CREATED); } - @PutMapping - @ApiOperation("修改微信模板消息") - @PreAuthorize("@el.check('admin','yxWechatTemplate:edit')") - public ResponseEntity update(@Validated @RequestBody YxWechatTemplate resources){ - yxWechatTemplateService.updateById(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); + @ApiOperation(value = "修改") + @PutMapping(value = "/yxWechatTemplate") + @PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_EDIT')") + public ResponseEntity update(@Validated @RequestBody YxWechatTemplate resources){ + //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); + yxWechatTemplateService.update(resources); + return new ResponseEntity(HttpStatus.NO_CONTENT); } - @ApiOperation("删除微信模板消息") - @PreAuthorize("@el.check('admin','yxWechatTemplate:del')") - @DeleteMapping - public ResponseEntity deleteAll(@RequestBody Integer[] ids) { - Arrays.asList(ids).forEach(id->{ - yxWechatTemplateService.removeById(id); - }); - return new ResponseEntity<>(HttpStatus.OK); + @ApiOperation(value = "删除") + @DeleteMapping(value = "/yxWechatTemplate/{id}") + @PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_DELETE')") + public ResponseEntity delete(@PathVariable Integer id){ + //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); + yxWechatTemplateService.delete(id); + return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/domain/YxArticle.java b/yshop-mp/src/main/java/co/yixiang/mp/domain/YxArticle.java index e317d1bb..19099fb7 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/domain/YxArticle.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/domain/YxArticle.java @@ -1,111 +1,103 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-07 */ +@Entity @Data -@TableName("yx_article") +@Table(name="yx_article") public class YxArticle implements Serializable { - /** 文章管理ID */ - @TableId + // 文章管理ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 分类id */ + // 分类id + @Column(name = "cid") private String cid; - - /** 文章标题 */ + // 文章标题 + @Column(name = "title",nullable = false) private String title; - - /** 文章作者 */ + // 文章作者 + @Column(name = "author") private String author; - - /** 文章图片 */ - private String imageInput; - - - /** 文章简介 */ - private String synopsis; - - + @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; - - /** 添加时间 */ - @TableField(fill= FieldFill.INSERT) + // 添加时间 + @Column(name = "add_time",nullable = false) private String addTime; - - /** 是否隐藏 */ + // 是否隐藏 + @Column(name = "hide",nullable = false) private Integer hide; - - /** 管理员id */ + // 管理员id + @Column(name = "admin_id",nullable = false) private Integer adminId; - - /** 商户id */ + // 商户id + @Column(name = "mer_id") private Integer merId; - - /** 产品关联id */ + // 产品关联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-mp/src/main/java/co/yixiang/mp/domain/YxWechatMenu.java b/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatMenu.java index 5a03e136..94ffe637 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatMenu.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatMenu.java @@ -1,40 +1,38 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-06 */ +@Entity @Data -@TableName("yx_wechat_menu") +@Table(name="yx_wechat_menu") public class YxWechatMenu implements Serializable { - @TableId(value = "`key`") + + @Id + @Column(name = "`key`") private String key; - - /** 缓存数据 */ + // 缓存数据 + @Column(name = "result") private String result; - - /** 缓存时间 */ - @TableField(fill= FieldFill.INSERT) + // 缓存时间 + @Column(name = "add_time") private Integer addTime; - public void copy(YxWechatMenu source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatReply.java b/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatReply.java index fc560f45..e2d4a583 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatReply.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatReply.java @@ -1,55 +1,48 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableField; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-10 */ +@Entity @Data -@TableName("yx_wechat_reply") +@Table(name="yx_wechat_reply") public class YxWechatReply implements Serializable { - /** 微信关键字回复id */ - @TableId + // 微信关键字回复id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 关键字 */ - @TableField(value = "`key`") + // 关键字 + @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 =可用 */ + // 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-mp/src/main/java/co/yixiang/mp/domain/YxWechatTemplate.java b/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatTemplate.java index 43bf0201..f2a6d2b9 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatTemplate.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/domain/YxWechatTemplate.java @@ -1,63 +1,51 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; + import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; import javax.persistence.*; -import javax.validation.constraints.*; import java.io.Serializable; /** -* @author hupeng -* @date 2020-05-12 +* @author xuwenbo +* @date 2019-12-10 */ +@Entity @Data -@TableName("yx_wechat_template") +@Table(name="yx_wechat_template") public class YxWechatTemplate implements Serializable { - /** 模板id */ - @TableId + // 模板id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 模板编号 */ + // 模板编号 + @Column(name = "tempkey",nullable = false) private String tempkey; - - /** 模板名 */ + // 模板名 + @Column(name = "name",nullable = false) private String name; - - /** 回复内容 */ + // 回复内容 + @Column(name = "content",nullable = false) private String content; - - /** 模板ID */ + // 模板ID + @Column(name = "tempid") private String tempid; - - /** 添加时间 */ - @TableField(fill= FieldFill.INSERT) + // 添加时间 + @Column(name = "add_time",nullable = false) private String addTime; - - /** 状态 */ + // 状态 + @Column(name = "status",nullable = false) private Integer status; - public void copy(YxWechatTemplate source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file 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 index e9b41f60..e62ca986 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorController.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorController.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.error; import org.springframework.stereotype.Controller; 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 index a5cbeb66..a1198fe3 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorPageConfiguration.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/error/ErrorPageConfiguration.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.error; import org.springframework.boot.web.server.ErrorPage; 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 index 764bfe93..3cd624ba 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/AbstractHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/AbstractHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import me.chanjar.weixin.mp.api.WxMpMessageHandler; 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 index acb1cbcd..effaa4d7 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/KfSessionHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/KfSessionHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import me.chanjar.weixin.common.session.WxSessionManager; 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 index 0c3a755b..9c44df35 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/LocationHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/LocationHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import co.yixiang.mp.builder.TextBuilder; 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 index 12d48bf9..4cca2a26 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/LogHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/LogHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import co.yixiang.mp.utils.JsonUtils; 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 index a223beb3..9d0e8400 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/MenuHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/MenuHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import me.chanjar.weixin.common.session.WxSessionManager; 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 index 01a2d4b4..50dadb77 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/MsgHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/MsgHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import co.yixiang.mp.builder.TextBuilder; 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 index d7e8425c..d3651f17 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/NullHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/NullHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import me.chanjar.weixin.common.session.WxSessionManager; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/handler/RedisHandler.java b/yshop-mp/src/main/java/co/yixiang/mp/handler/RedisHandler.java index 3a98ed9d..b1018880 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/RedisHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/RedisHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; 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 index bb392b0d..be6f4462 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/ScanHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/ScanHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import java.util.Map; 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 index 5195df6f..ce692c02 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/StoreCheckNotifyHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/StoreCheckNotifyHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import me.chanjar.weixin.common.session.WxSessionManager; 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 index 611bcbac..259e5368 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/SubscribeHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/SubscribeHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import java.io.UnsupportedEncodingException; 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 index 0f07567a..97f0c9d8 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/handler/UnsubscribeHandler.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/handler/UnsubscribeHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.handler; import me.chanjar.weixin.common.session.WxSessionManager; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/repository/YxArticleRepository.java b/yshop-mp/src/main/java/co/yixiang/mp/repository/YxArticleRepository.java new file mode 100644 index 00000000..c6c6bdbb --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/repository/YxArticleRepository.java @@ -0,0 +1,13 @@ +package co.yixiang.mp.repository; + + +import co.yixiang.mp.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-mp/src/main/java/co/yixiang/mp/repository/YxWechatMenuRepository.java b/yshop-mp/src/main/java/co/yixiang/mp/repository/YxWechatMenuRepository.java new file mode 100644 index 00000000..0929b310 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/repository/YxWechatMenuRepository.java @@ -0,0 +1,13 @@ +package co.yixiang.mp.repository; + + +import co.yixiang.mp.domain.YxWechatMenu; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +public interface YxWechatMenuRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/repository/YxWechatReplyRepository.java b/yshop-mp/src/main/java/co/yixiang/mp/repository/YxWechatReplyRepository.java new file mode 100644 index 00000000..d7fb0eb0 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/repository/YxWechatReplyRepository.java @@ -0,0 +1,19 @@ +package co.yixiang.mp.repository; + +import co.yixiang.mp.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-mp/src/main/java/co/yixiang/mp/repository/YxWechatTemplateRepository.java b/yshop-mp/src/main/java/co/yixiang/mp/repository/YxWechatTemplateRepository.java new file mode 100644 index 00000000..d724494a --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/repository/YxWechatTemplateRepository.java @@ -0,0 +1,13 @@ +package co.yixiang.mp.repository; + +import co.yixiang.mp.domain.YxWechatTemplate; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author xuwenbo +* @date 2019-12-10 +*/ +public interface YxWechatTemplateRepository extends JpaRepository, JpaSpecificationExecutor { + YxWechatTemplate findByTempkey(String key); +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/WxMpTemplateMessageService.java b/yshop-mp/src/main/java/co/yixiang/mp/service/WxMpTemplateMessageService.java index d5c41357..943e46e0 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/WxMpTemplateMessageService.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/WxMpTemplateMessageService.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service; import java.util.Map; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/YxArticleService.java b/yshop-mp/src/main/java/co/yixiang/mp/service/YxArticleService.java index a8bf1ac3..5ec99ac1 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/YxArticleService.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/YxArticleService.java @@ -1,51 +1,68 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service; -import co.yixiang.common.service.BaseService; + + import co.yixiang.mp.domain.YxArticle; -import co.yixiang.mp.service.dto.YxArticleDto; +import co.yixiang.mp.service.dto.YxArticleDTO; import co.yixiang.mp.service.dto.YxArticleQueryCriteria; -import me.chanjar.weixin.common.error.WxErrorException; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-07 */ -public interface YxArticleService extends BaseService{ +//@CacheConfig(cacheNames = "yxArticle") +public interface YxArticleService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxArticleQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxArticleQueryCriteria criteria); + //@Cacheable + List queryAll(YxArticleQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxArticleDTO findById(Integer id); - void uploadNews(YxArticleDto yxArticleDTO) throws WxErrorException; -} + /** + * 创建 + * @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); + + void uploadNews(YxArticleDTO yxArticleDTO) throws Exception; + +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/YxMiniPayService.java b/yshop-mp/src/main/java/co/yixiang/mp/service/YxMiniPayService.java index b4cd6e52..ac2d1bcc 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/YxMiniPayService.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/YxMiniPayService.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service; import cn.hutool.core.util.StrUtil; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/YxPayService.java b/yshop-mp/src/main/java/co/yixiang/mp/service/YxPayService.java index 6b311acc..c26cb261 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/YxPayService.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/YxPayService.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service; import cn.hutool.core.util.StrUtil; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/YxTemplateService.java b/yshop-mp/src/main/java/co/yixiang/mp/service/YxTemplateService.java index 49d57548..821b5f16 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/YxTemplateService.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/YxTemplateService.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service; import co.yixiang.mp.domain.YxWechatTemplate; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatMenuService.java b/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatMenuService.java index d84d754b..debe5ab8 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatMenuService.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatMenuService.java @@ -1,50 +1,67 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service; -import co.yixiang.common.service.BaseService; + + import co.yixiang.mp.domain.YxWechatMenu; -import co.yixiang.mp.service.dto.YxWechatMenuDto; +import co.yixiang.mp.service.dto.YxWechatMenuDTO; import co.yixiang.mp.service.dto.YxWechatMenuQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-06 */ -public interface YxWechatMenuService extends BaseService{ +//@CacheConfig(cacheNames = "YxWechatMenu") +public interface YxWechatMenuService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxWechatMenuQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxWechatMenuQueryCriteria criteria); + //@Cacheable + List queryAll(YxWechatMenuQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param key + * @return + */ + //@Cacheable(key = "#p0") + YxWechatMenuDTO findById(String key); - Boolean isExist(String wechat_menus); -} + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxWechatMenuDTO create(YxWechatMenu resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxWechatMenu resources); + + /** + * 删除 + * @param key + */ + //@CacheEvict(allEntries = true) + void delete(String key); + + boolean isExist(String key); +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatReplyService.java b/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatReplyService.java index 48bb1f0b..222ced9d 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatReplyService.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatReplyService.java @@ -1,54 +1,68 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service; -import co.yixiang.common.service.BaseService; + + import co.yixiang.mp.domain.YxWechatReply; -import co.yixiang.mp.service.dto.YxWechatReplyDto; +import co.yixiang.mp.service.dto.YxWechatReplyDTO; import co.yixiang.mp.service.dto.YxWechatReplyQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-10 */ -public interface YxWechatReplyService extends BaseService{ +//@CacheConfig(cacheNames = "yxWechatReply") +public interface YxWechatReplyService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxWechatReplyQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxWechatReplyQueryCriteria criteria); + //@Cacheable + List queryAll(YxWechatReplyQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxWechatReplyDTO findById(Integer id); - YxWechatReply isExist(String subscribe); + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxWechatReplyDTO create(YxWechatReply resources); - void create(YxWechatReply yxWechatReply); + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxWechatReply resources); - void upDate(YxWechatReply yxWechatReply); -} + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); + + YxWechatReply isExist(String key); + +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatTemplateService.java b/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatTemplateService.java index a88653ed..4a8d7886 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatTemplateService.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/YxWechatTemplateService.java @@ -1,50 +1,66 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.mp.domain.YxWechatTemplate; -import co.yixiang.mp.service.dto.YxWechatTemplateDto; +import co.yixiang.mp.service.dto.YxWechatTemplateDTO; import co.yixiang.mp.service.dto.YxWechatTemplateQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** -* @author hupeng -* @date 2020-05-12 +* @author xuwenbo +* @date 2019-12-10 */ -public interface YxWechatTemplateService extends BaseService{ +//@CacheConfig(cacheNames = "yxWechatTemplate") +public interface YxWechatTemplateService { -/** + YxWechatTemplate findByTempkey(String key); + + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxWechatTemplateQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxWechatTemplateQueryCriteria criteria); + //@Cacheable + List queryAll(YxWechatTemplateQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxWechatTemplateDTO findById(Integer id); - YxWechatTemplate findByTempkey(String recharge_success_key); -} + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxWechatTemplateDTO create(YxWechatTemplate resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxWechatTemplate resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleDTO.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleDTO.java new file mode 100644 index 00000000..45d58d4a --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleDTO.java @@ -0,0 +1,75 @@ +package co.yixiang.mp.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; + + private String thumbMediaId; +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleDto.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleDto.java deleted file mode 100644 index 02f2e5ed..00000000 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleDto.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.mp.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@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; - - private String thumbMediaId; -} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleQueryCriteria.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleQueryCriteria.java index 464115c7..fc041b2f 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleQueryCriteria.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxArticleQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-07 */ @Data public class YxArticleQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuDTO.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuDTO.java new file mode 100644 index 00000000..b335c3ae --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuDTO.java @@ -0,0 +1,22 @@ +package co.yixiang.mp.service.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Data +public class YxWechatMenuDTO implements Serializable { + + private String key; + + // 缓存数据 + private String result; + + // 缓存时间 + private Integer addTime; +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuDto.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuDto.java deleted file mode 100644 index db6565b1..00000000 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuDto.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.mp.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxWechatMenuDto implements Serializable { - - private String key; - - /** 缓存数据 */ - private String result; - - /** 缓存时间 */ - private Integer addTime; -} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuQueryCriteria.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuQueryCriteria.java index 4919f6d2..75c0c919 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuQueryCriteria.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatMenuQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-06 */ @Data public class YxWechatMenuQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyDTO.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyDTO.java new file mode 100644 index 00000000..ff003fa0 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyDTO.java @@ -0,0 +1,32 @@ +package co.yixiang.mp.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-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyDto.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyDto.java deleted file mode 100644 index 1e9db1f9..00000000 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyDto.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.mp.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@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; -} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyQueryCriteria.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyQueryCriteria.java index a89d1012..c8d31929 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyQueryCriteria.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatReplyQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-10 */ @Data public class YxWechatReplyQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateDTO.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateDTO.java new file mode 100644 index 00000000..3f25905b --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateDTO.java @@ -0,0 +1,34 @@ +package co.yixiang.mp.service.dto; + +import lombok.Data; +import java.io.Serializable; + + +/** +* @author xuwenbo +* @date 2019-12-10 +*/ +@Data +public class YxWechatTemplateDTO implements Serializable { + + // 模板id + private Integer id; + + // 模板编号 + private String tempkey; + + // 模板名 + private String name; + + // 回复内容 + private String content; + + // 模板ID + private String tempid; + + // 添加时间 + private String addTime; + + // 状态 + private Integer status; +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateDto.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateDto.java deleted file mode 100644 index 9df7b93e..00000000 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateDto.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.mp.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxWechatTemplateDto implements Serializable { - - /** 模板id */ - private Integer id; - - /** 模板编号 */ - private String tempkey; - - /** 模板名 */ - private String name; - - /** 回复内容 */ - private String content; - - /** 模板ID */ - private String tempid; - - /** 添加时间 */ - private String addTime; - - /** 状态 */ - private Integer status; -} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateQueryCriteria.java b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateQueryCriteria.java index e9d0e060..4df0d6e2 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateQueryCriteria.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/dto/YxWechatTemplateQueryCriteria.java @@ -1,21 +1,12 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service.dto; import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; /** -* @author hupeng -* @date 2020-05-12 +* @author xuwenbo +* @date 2019-12-10 */ @Data public class YxWechatTemplateQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/impl/WxMpTemplateMessageServiceImpl.java b/yshop-mp/src/main/java/co/yixiang/mp/service/impl/WxMpTemplateMessageServiceImpl.java index d1c3fd82..e69495d7 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/impl/WxMpTemplateMessageServiceImpl.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/impl/WxMpTemplateMessageServiceImpl.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service.impl; import cn.hutool.core.util.StrUtil; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxArticleServiceImpl.java b/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxArticleServiceImpl.java index 0ea06d9a..d342b4de 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxArticleServiceImpl.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxArticleServiceImpl.java @@ -1,29 +1,22 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service.impl; + +import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ReUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONUtil; +import co.yixiang.exception.BadRequestException; import co.yixiang.exception.ErrorRequestException; import co.yixiang.mp.config.WxMpConfiguration; import co.yixiang.mp.domain.YxArticle; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.mp.utils.URLUtils; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.mp.repository.YxArticleRepository; import co.yixiang.mp.service.YxArticleService; -import co.yixiang.mp.service.dto.YxArticleDto; +import co.yixiang.mp.service.dto.YxArticleDTO; import co.yixiang.mp.service.dto.YxArticleQueryCriteria; -import co.yixiang.mp.service.mapper.ArticleMapper; +import co.yixiang.mp.service.mapper.YxArticleMapper; +import co.yixiang.mp.utils.URLUtils; +import co.yixiang.utils.*; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.error.WxErrorException; @@ -36,91 +29,82 @@ import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult; import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult; import org.apache.commons.lang3.StringUtils; 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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Pageable; import java.io.File; import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-07 */ @Slf4j @Service -//@CacheConfig(cacheNames = "yxArticle") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxArticleServiceImpl extends BaseServiceImpl implements YxArticleService { +public class YxArticleServiceImpl implements YxArticleService { + + private final YxArticleRepository yxArticleRepository; + + private final YxArticleMapper yxArticleMapper; + + public YxArticleServiceImpl(YxArticleRepository yxArticleRepository, YxArticleMapper yxArticleMapper) { + this.yxArticleRepository = yxArticleRepository; + this.yxArticleMapper = yxArticleMapper; + } - private final IGenerator generator; @Value("${file.path}") private String uploadDirStr; - public YxArticleServiceImpl(IGenerator generator) { - this.generator = generator; + @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 - //@Cacheable - public Map queryAll(YxArticleQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxArticleDto.class)); - map.put("totalElements", page.getTotal()); - return map; + 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); } @Override - //@Cacheable - public List queryAll(YxArticleQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxArticle.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxArticleDto yxArticle : all) { - Map map = new LinkedHashMap<>(); - map.put("分类id", yxArticle.getCid()); - map.put("文章标题", yxArticle.getTitle()); - map.put("文章作者", yxArticle.getAuthor()); - map.put("文章图片", yxArticle.getImageInput()); - map.put("文章简介", yxArticle.getSynopsis()); - map.put(" content", yxArticle.getContent()); - map.put("文章分享标题", yxArticle.getShareTitle()); - map.put("文章分享简介", yxArticle.getShareSynopsis()); - map.put("浏览次数", yxArticle.getVisit()); - map.put("排序", yxArticle.getSort()); - map.put("原文链接", yxArticle.getUrl()); - map.put("状态", yxArticle.getStatus()); - map.put("添加时间", yxArticle.getAddTime()); - map.put("是否隐藏", yxArticle.getHide()); - map.put("管理员id", yxArticle.getAdminId()); - map.put("商户id", yxArticle.getMerId()); - map.put("产品关联id", yxArticle.getProductId()); - map.put("是否热门(小程序)", yxArticle.getIsHot()); - map.put("是否轮播图(小程序)", yxArticle.getIsBanner()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public void uploadNews(YxArticleDto wxNewsArticleItem) throws WxErrorException { + public void uploadNews(YxArticleDTO wxNewsArticleItem) throws Exception { WxMpService wxMpService = WxMpConfiguration.getWxMpService(); @@ -177,9 +161,9 @@ public class YxArticleServiceImpl extends BaseServiceImpl implements YxWechatMenuService { +public class YxWechatMenuServiceImpl implements YxWechatMenuService { - private final IGenerator generator; + private final YxWechatMenuRepository YxWechatMenuRepository; - @Override - //@Cacheable - public Map queryAll(YxWechatMenuQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxWechatMenuDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } + private final YxWechatMenuMapper YxWechatMenuMapper; - - @Override - //@Cacheable - public List queryAll(YxWechatMenuQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxWechatMenu.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxWechatMenuDto yxWechatMenu : all) { - Map map = new LinkedHashMap<>(); - map.put("缓存数据", yxWechatMenu.getResult()); - map.put("缓存时间", yxWechatMenu.getAddTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxWechatMenuServiceImpl(YxWechatMenuRepository YxWechatMenuRepository, YxWechatMenuMapper YxWechatMenuMapper) { + this.YxWechatMenuRepository = YxWechatMenuRepository; + this.YxWechatMenuMapper = YxWechatMenuMapper; } @Override - public Boolean isExist(String wechat_menus) { - YxWechatMenu yxWechatMenu = this.getOne(new QueryWrapper().eq("`key`",wechat_menus)); - if(yxWechatMenu == null){ + public Map queryAll(YxWechatMenuQueryCriteria criteria, Pageable pageable){ + Page page = YxWechatMenuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(YxWechatMenuMapper::toDto)); + } + + @Override + public List queryAll(YxWechatMenuQueryCriteria criteria){ + return YxWechatMenuMapper.toDto(YxWechatMenuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxWechatMenuDTO findById(String key) { + Optional YxWechatMenu = YxWechatMenuRepository.findById(key); + ValidationUtil.isNull(YxWechatMenu,"YxWechatMenu","key",key); + return YxWechatMenuMapper.toDto(YxWechatMenu.get()); + } + + @Override + public boolean isExist(String key) { + Optional YxWechatMenu = YxWechatMenuRepository.findById(key); + if(!YxWechatMenu.isPresent()){ return false; } return true; } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxWechatMenuDTO create(YxWechatMenu resources) { + //resources.setKey(IdUtil.simpleUUID()); + return YxWechatMenuMapper.toDto(YxWechatMenuRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxWechatMenu resources) { + Optional optionalYxWechatMenu = YxWechatMenuRepository.findById(resources.getKey()); + ValidationUtil.isNull( optionalYxWechatMenu,"YxWechatMenu","id",resources.getKey()); + YxWechatMenu YxWechatMenu = optionalYxWechatMenu.get(); + YxWechatMenu.copy(resources); + YxWechatMenuRepository.save(YxWechatMenu); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String key) { + YxWechatMenuRepository.deleteById(key); + } +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxWechatReplyServiceImpl.java b/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxWechatReplyServiceImpl.java index 47adc6d8..6135c1f8 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxWechatReplyServiceImpl.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxWechatReplyServiceImpl.java @@ -1,108 +1,95 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service.impl; -import co.yixiang.mp.domain.YxWechatReply; import co.yixiang.exception.EntityExistException; -import co.yixiang.common.service.impl.BaseServiceImpl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.mp.domain.YxWechatReply; +import co.yixiang.mp.repository.YxWechatReplyRepository; import co.yixiang.mp.service.YxWechatReplyService; -import co.yixiang.mp.service.dto.YxWechatReplyDto; +import co.yixiang.mp.service.dto.YxWechatReplyDTO; import co.yixiang.mp.service.dto.YxWechatReplyQueryCriteria; -import co.yixiang.mp.service.mapper.WechatReplyMapper; +import co.yixiang.mp.service.mapper.YxWechatReplyMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Pageable; -import java.util.*; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-10 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxWechatReply") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxWechatReplyServiceImpl extends BaseServiceImpl implements YxWechatReplyService { +public class YxWechatReplyServiceImpl implements YxWechatReplyService { - private final IGenerator generator; + private final YxWechatReplyRepository yxWechatReplyRepository; - @Override - //@Cacheable - public Map queryAll(YxWechatReplyQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxWechatReplyDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxWechatReplyMapper yxWechatReplyMapper; + + public YxWechatReplyServiceImpl(YxWechatReplyRepository yxWechatReplyRepository, YxWechatReplyMapper yxWechatReplyMapper) { + this.yxWechatReplyRepository = yxWechatReplyRepository; + this.yxWechatReplyMapper = yxWechatReplyMapper; } - @Override - //@Cacheable - public List queryAll(YxWechatReplyQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxWechatReply.class, criteria)); + 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 void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxWechatReplyDto yxWechatReply : all) { - Map map = new LinkedHashMap<>(); - map.put("关键字", yxWechatReply.getKey()); - map.put("回复类型", yxWechatReply.getType()); - map.put("回复数据", yxWechatReply.getData()); - map.put("0=不可用 1 =可用", yxWechatReply.getStatus()); - map.put("是否隐藏", yxWechatReply.getHide()); - list.add(map); + 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()); } - FileUtil.downloadExcel(list, response); + return yxWechatReplyMapper.toDto(yxWechatReplyRepository.save(resources)); } @Override - public YxWechatReply isExist(String key) { - YxWechatReply yxWechatReply = this.getOne(new QueryWrapper().eq("`key`",key)); - return yxWechatReply; - } - - @Override - public void create(YxWechatReply yxWechatReply) { - if(this.isExist(yxWechatReply.getKey()) != null){ - throw new EntityExistException(YxWechatReply.class,"key",yxWechatReply.getKey()); - } - this.save(yxWechatReply); - } - - @Override - public void upDate(YxWechatReply resources) { - YxWechatReply yxWechatReply = this.getById(resources.getId()); + @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 = this.isExist(resources.getKey()); + yxWechatReply1 = yxWechatReplyRepository.findByKey(resources.getKey()); if(yxWechatReply1 != null && !yxWechatReply1.getId().equals(yxWechatReply.getId())){ throw new EntityExistException(YxWechatReply.class,"key",resources.getKey()); } yxWechatReply.copy(resources); - this.save(yxWechatReply); + 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-mp/src/main/java/co/yixiang/mp/service/impl/YxWechatTemplateServiceImpl.java b/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxWechatTemplateServiceImpl.java index 735d95a1..3b162d42 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxWechatTemplateServiceImpl.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/impl/YxWechatTemplateServiceImpl.java @@ -1,90 +1,83 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.service.impl; import co.yixiang.mp.domain.YxWechatTemplate; -import co.yixiang.common.service.impl.BaseServiceImpl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.mp.repository.YxWechatTemplateRepository; import co.yixiang.mp.service.YxWechatTemplateService; -import co.yixiang.mp.service.dto.YxWechatTemplateDto; +import co.yixiang.mp.service.dto.YxWechatTemplateDTO; import co.yixiang.mp.service.dto.YxWechatTemplateQueryCriteria; -import co.yixiang.mp.service.mapper.WechatTemplateMapper; +import co.yixiang.mp.service.mapper.YxWechatTemplateMapper; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; +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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; /** -* @author hupeng -* @date 2020-05-12 +* @author xuwenbo +* @date 2019-12-10 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxWechatTemplate") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxWechatTemplateServiceImpl extends BaseServiceImpl implements YxWechatTemplateService { +public class YxWechatTemplateServiceImpl implements YxWechatTemplateService { - private final IGenerator generator; + private final YxWechatTemplateRepository yxWechatTemplateRepository; - @Override - //@Cacheable - public Map queryAll(YxWechatTemplateQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxWechatTemplateDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } + private final YxWechatTemplateMapper yxWechatTemplateMapper; - - @Override - //@Cacheable - public List queryAll(YxWechatTemplateQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxWechatTemplate.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxWechatTemplateDto yxWechatTemplate : all) { - Map map = new LinkedHashMap<>(); - map.put("模板编号", yxWechatTemplate.getTempkey()); - map.put("模板名", yxWechatTemplate.getName()); - map.put("回复内容", yxWechatTemplate.getContent()); - map.put("模板ID", yxWechatTemplate.getTempid()); - map.put("添加时间", yxWechatTemplate.getAddTime()); - map.put("状态", yxWechatTemplate.getStatus()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxWechatTemplateServiceImpl(YxWechatTemplateRepository yxWechatTemplateRepository, YxWechatTemplateMapper yxWechatTemplateMapper) { + this.yxWechatTemplateRepository = yxWechatTemplateRepository; + this.yxWechatTemplateMapper = yxWechatTemplateMapper; } @Override - public YxWechatTemplate findByTempkey(String recharge_success_key) { - return this.getOne(new QueryWrapper().eq("tempkey",recharge_success_key)); + public YxWechatTemplate findByTempkey(String key) { + return yxWechatTemplateRepository.findByTempkey(key); } -} + + @Override + public Map queryAll(YxWechatTemplateQueryCriteria criteria, Pageable pageable){ + Page page = yxWechatTemplateRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxWechatTemplateMapper::toDto)); + } + + @Override + public List queryAll(YxWechatTemplateQueryCriteria criteria){ + return yxWechatTemplateMapper.toDto(yxWechatTemplateRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxWechatTemplateDTO findById(Integer id) { + Optional yxWechatTemplate = yxWechatTemplateRepository.findById(id); + ValidationUtil.isNull(yxWechatTemplate,"YxWechatTemplate","id",id); + return yxWechatTemplateMapper.toDto(yxWechatTemplate.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxWechatTemplateDTO create(YxWechatTemplate resources) { + return yxWechatTemplateMapper.toDto(yxWechatTemplateRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxWechatTemplate resources) { + Optional optionalYxWechatTemplate = yxWechatTemplateRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxWechatTemplate,"YxWechatTemplate","id",resources.getId()); + YxWechatTemplate yxWechatTemplate = optionalYxWechatTemplate.get(); + yxWechatTemplate.copy(resources); + yxWechatTemplateRepository.save(yxWechatTemplate); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxWechatTemplateRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/ArticleMapper.java b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/ArticleMapper.java deleted file mode 100644 index 2a2833c8..00000000 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/ArticleMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.mp.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.mp.domain.YxArticle; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface ArticleMapper extends CoreMapper { - -} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatMenuMapper.java b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatMenuMapper.java deleted file mode 100644 index 9a64ddfd..00000000 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatMenuMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.mp.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.mp.domain.YxWechatMenu; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface WechatMenuMapper extends CoreMapper { - -} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatReplyMapper.java b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatReplyMapper.java deleted file mode 100644 index ad04bc5c..00000000 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatReplyMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.mp.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.mp.domain.YxWechatReply; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface WechatReplyMapper extends CoreMapper { - -} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatTemplateMapper.java b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatTemplateMapper.java deleted file mode 100644 index b48d0d0c..00000000 --- a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/WechatTemplateMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.mp.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.mp.domain.YxWechatTemplate; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface WechatTemplateMapper extends CoreMapper { - -} diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxArticleMapper.java b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxArticleMapper.java new file mode 100644 index 00000000..abf999aa --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxArticleMapper.java @@ -0,0 +1,17 @@ +package co.yixiang.mp.service.mapper; + +import co.yixiang.mapper.EntityMapper; + +import co.yixiang.mp.domain.YxArticle; +import co.yixiang.mp.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-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatMenuMapper.java b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatMenuMapper.java new file mode 100644 index 00000000..18615ca2 --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatMenuMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.mp.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.mp.domain.YxWechatMenu; +import co.yixiang.mp.service.dto.YxWechatMenuDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxWechatMenuMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatReplyMapper.java b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatReplyMapper.java new file mode 100644 index 00000000..8c8f58dd --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatReplyMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.mp.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.mp.domain.YxWechatReply; +import co.yixiang.mp.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-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatTemplateMapper.java b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatTemplateMapper.java new file mode 100644 index 00000000..5536a8de --- /dev/null +++ b/yshop-mp/src/main/java/co/yixiang/mp/service/mapper/YxWechatTemplateMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.mp.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.mp.domain.YxWechatTemplate; +import co.yixiang.mp.service.dto.YxWechatTemplateDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author xuwenbo +* @date 2019-12-10 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxWechatTemplateMapper extends EntityMapper { + +} \ No newline at end of file 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 index d485c76b..5eb49193 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/utils/JsonUtils.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/utils/JsonUtils.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.utils; import com.google.gson.Gson; diff --git a/yshop-mp/src/main/java/co/yixiang/mp/utils/URLUtils.java b/yshop-mp/src/main/java/co/yixiang/mp/utils/URLUtils.java index 349bbb2a..5cb42a9d 100644 --- a/yshop-mp/src/main/java/co/yixiang/mp/utils/URLUtils.java +++ b/yshop-mp/src/main/java/co/yixiang/mp/utils/URLUtils.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.mp.utils; import java.util.HashMap; diff --git a/yshop-mproot/pom.xml b/yshop-mproot/pom.xml deleted file mode 100644 index 5f02e377..00000000 --- a/yshop-mproot/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - yshop - co.yixiang - 2.2 - - 4.0.0 - MyBatisPlus模块 - yshop-mproot - - - 0.10.6 - 3.2.0 - - - - com.baomidou - mybatis-plus-boot-starter - ${mybatis-plus-boot-starter.version} - - - - - com.github.pagehelper - pagehelper-spring-boot-starter - 1.2.5 - - - mybatis-spring - org.mybatis - - - mybatis - org.mybatis - - - - - diff --git a/yshop-mproot/src/main/java/co/yixiang/annotation/Query.java b/yshop-mproot/src/main/java/co/yixiang/annotation/Query.java deleted file mode 100644 index 5c931b82..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/annotation/Query.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -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 - */ - String joinName() default ""; - - /** - * 默认左连接 - */ - Join join() default Join.LEFT; - - /** - * 多字段模糊搜索,仅支持String类型字段,多个用逗号隔开, 如@Query(blurry = "email,username") - */ - 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 - // 不等于 - ,NOT_EQUAL - // between - ,BETWEEN - // 不为空 - ,NOT_NULL - // 查询时间 - ,UNIX_TIMESTAMP - } - - /** - * @author Zheng Jie - * 适用于简单连接查询,复杂的请自定义该注解,或者使用sql查询 - */ - enum Join { - /** jie 2019-6-4 13:18:30 左右连接 */ - LEFT, RIGHT - } - -} - diff --git a/yshop-mproot/src/main/java/co/yixiang/common/entity/BaseEntity.java b/yshop-mproot/src/main/java/co/yixiang/common/entity/BaseEntity.java deleted file mode 100644 index 4bac8232..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/common/entity/BaseEntity.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -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-mproot/src/main/java/co/yixiang/common/mapper/CoreMapper.java b/yshop-mproot/src/main/java/co/yixiang/common/mapper/CoreMapper.java deleted file mode 100644 index ef0be03e..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/common/mapper/CoreMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.common.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @param - * @author LionCity - */ -public interface CoreMapper extends BaseMapper { - -} diff --git a/yshop-mproot/src/main/java/co/yixiang/common/service/BaseService.java b/yshop-mproot/src/main/java/co/yixiang/common/service/BaseService.java deleted file mode 100644 index 23377b51..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/common/service/BaseService.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.common.service; - -import com.baomidou.mybatisplus.extension.service.IService; - - -public interface BaseService extends IService { - -} diff --git a/yshop-mproot/src/main/java/co/yixiang/common/service/impl/BaseServiceImpl.java b/yshop-mproot/src/main/java/co/yixiang/common/service/impl/BaseServiceImpl.java deleted file mode 100644 index 3ca9ca91..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/common/service/impl/BaseServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.common.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import co.yixiang.common.service.BaseService; -import co.yixiang.common.web.param.OrderQueryParam; -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 com.github.pagehelper.PageHelper; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.domain.Pageable; - -import java.util.Arrays; -import java.util.List; - -/** - * @author hupeng - * @since 2019-10-16 - */ -@Slf4j -@SuppressWarnings("unchecked") -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.getPage()); - // 设置页大小 - page.setSize(queryParam.getLimit()); - /** - * 如果是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; - } - - protected void getPage(Pageable pageable) { - String order=null; - if(pageable.getSort()!=null){ - order= pageable.getSort().toString(); - order=order.replace(":",""); - if("UNSORTED".equals(order)){ - order="id desc"; - } - } - PageHelper.startPage(pageable.getPageNumber()+1, pageable.getPageSize(),order); - } - -} diff --git a/yshop-mproot/src/main/java/co/yixiang/common/utils/QueryHelpPlus.java b/yshop-mproot/src/main/java/co/yixiang/common/utils/QueryHelpPlus.java deleted file mode 100644 index 5b646e10..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/common/utils/QueryHelpPlus.java +++ /dev/null @@ -1,218 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.common.utils; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.ObjectUtil; -import co.yixiang.common.web.vo.Paging; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.extern.slf4j.Slf4j; -import co.yixiang.annotation.Query; - -import javax.persistence.criteria.*; -import java.lang.reflect.Field; -import java.sql.Wrapper; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.function.Consumer; - -/** - * @author Zheng Jie - * @date 2019-6-4 14:59:48 - */ -@Slf4j -@SuppressWarnings({"unchecked", "all"}) -public class QueryHelpPlus { - - public static QueryWrapper getPredicate(R obj, Q query) { - QueryWrapper queryWrapper = new QueryWrapper(); - if (query == null) { - return queryWrapper; - } - 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; - attributeName = humpToUnderline(attributeName); - 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(","); - //queryWrapper.or(); - queryWrapper.and(wrapper -> { - for (int i=0;i< blurrys.length;i++) { - String column = humpToUnderline(blurrys[i]); - //if(i!=0){ - wrapper.or(); - //} - wrapper.like(column, val.toString()); - } - }); - continue; - } - /*if (ObjectUtil.isNotEmpty(joinName)) { - String[] joinNames = joinName.split(">"); - for (String name : joinNames) { - switch (q.join()) { - case LEFT: - if (ObjectUtil.isNotNull(join)) { - join = join.join(name, JoinType.LEFT); - } else { - join = root.join(name, JoinType.LEFT); - } - break; - case RIGHT: - if (ObjectUtil.isNotNull(join)) { - join = join.join(name, JoinType.RIGHT); - } else { - join = root.join(name, JoinType.RIGHT); - } - break; - default: - break; - } - } - }*/ - String finalAttributeName = attributeName; - switch (q.type()) { - case EQUAL: - //queryWrapper.and(wrapper -> wrapper.eq(finalAttributeName, val)); - queryWrapper.eq(attributeName, val); - break; - case GREATER_THAN: - queryWrapper.ge(finalAttributeName, val); - break; - case LESS_THAN: - queryWrapper.le(finalAttributeName, val); - break; - case LESS_THAN_NQ: - queryWrapper.lt(finalAttributeName, val); - break; - case INNER_LIKE: - queryWrapper.like(finalAttributeName, val); - break; - case LEFT_LIKE: - queryWrapper.likeLeft(finalAttributeName, val); - break; - case RIGHT_LIKE: - queryWrapper.likeRight(finalAttributeName, val); - break; - case IN: - if (CollUtil.isNotEmpty((Collection) val)) { - queryWrapper.in(finalAttributeName, (Collection) val); - } - break; - case NOT_EQUAL: - queryWrapper.ne(finalAttributeName, val); - break; - case NOT_NULL: - queryWrapper.isNotNull(finalAttributeName); - break; - case BETWEEN: - List between = new ArrayList<>((List) val); - queryWrapper.between(finalAttributeName, between.get(0), between.get(1)); - break; - case UNIX_TIMESTAMP: - List UNIX_TIMESTAMP = new ArrayList<>((List)val); - if(!UNIX_TIMESTAMP.isEmpty()){ - SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - long time1 = fm.parse(UNIX_TIMESTAMP.get(0).toString()).getTime()/1000; - long time2 = fm.parse(UNIX_TIMESTAMP.get(1).toString()).getTime()/1000; - queryWrapper.between(finalAttributeName, time1, time2); - } - break; - default: - break; - } - } - field.setAccessible(accessible); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - } - - return queryWrapper; - } - - @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); - } - } - - private 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))) { - return false; - } - } - return true; - } - - private static List getAllFields(Class clazz, List fields) { - if (clazz != null) { - fields.addAll(Arrays.asList(clazz.getDeclaredFields())); - getAllFields(clazz.getSuperclass(), fields); - } - return fields; - } - - /*** - * 驼峰命名转为下划线命名 - * - * @param para - * 驼峰命名的字符串 - */ - - public static String humpToUnderline(String para) { - StringBuilder sb = new StringBuilder(para); - int temp = 0;//定位 - if (!para.contains("_")) { - for (int i = 0; i < para.length(); i++) { - if (Character.isUpperCase(para.charAt(i))) { - sb.insert(i + temp, "_"); - temp += 1; - } - } - } - return sb.toString(); - } - - public static void main(String[] args) { - QueryWrapper query = new QueryWrapper(); - //query.or(); - query.or(wrapper -> wrapper.eq("store_id", 1).or().eq("store_id", 2)); - //query.like("a",1); - //query.or(); - //query.like("b",2); - //query.and(wrapper->wrapper.eq("c",1)); - query.eq("1", 1); - - System.out.println(query.getSqlSegment()); - } -} diff --git a/yshop-mproot/src/main/java/co/yixiang/common/web/param/OrderQueryParam.java b/yshop-mproot/src/main/java/co/yixiang/common/web/param/OrderQueryParam.java deleted file mode 100644 index e32230b1..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/common/web/param/OrderQueryParam.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -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-mproot/src/main/java/co/yixiang/common/web/param/QueryParam.java b/yshop-mproot/src/main/java/co/yixiang/common/web/param/QueryParam.java deleted file mode 100644 index ec4c4e3d..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/common/web/param/QueryParam.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.common.web.param; - -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 page =1; - @ApiModelProperty(value = "页大小,默认为10") - private Integer limit = 10; - @ApiModelProperty(value = "搜索字符串") - private String keyword; - - public void setCurrent(Integer current) { - if (current == null || current <= 0){ - this.page = 1; - }else{ - this.page = current; - } - } - - public void setSize(Integer size) { - if (size == null || size <= 0){ - this.limit = 10; - }else{ - this.limit = size; - } - } - -} diff --git a/yshop-mproot/src/main/java/co/yixiang/common/web/vo/Paging.java b/yshop-mproot/src/main/java/co/yixiang/common/web/vo/Paging.java deleted file mode 100644 index 741f983e..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/common/web/vo/Paging.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -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("分页") -@SuppressWarnings("unchecked") -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-mproot/src/main/java/co/yixiang/config/MetaHandler.java b/yshop-mproot/src/main/java/co/yixiang/config/MetaHandler.java deleted file mode 100644 index 608738c0..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/config/MetaHandler.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.config; - -/** - * @author :LionCity - * @date :Created in 2020-04-10 15:47 - * @description:自动注入时间处理 - * @modified By: - * @version: - */ - -import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; -import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.reflection.MetaObject; -import org.springframework.stereotype.Component; - -import java.sql.Timestamp; -import java.util.Date; - -/** - * 处理新增和更新的基础数据填充,配合BaseEntity和MyBatisPlusConfig使用 - */ -@Slf4j -@Component -public class MetaHandler implements MetaObjectHandler { - - - /** - * 新增数据执行 - * - * @param metaObject - */ - @Override - public void insertFill(MetaObject metaObject) { - try { - Timestamp time=new Timestamp(System.currentTimeMillis()); - if (metaObject.hasSetter("createTime")) { - log.debug("自动插入 createTime"); - this.setFieldValByName("createTime", time, metaObject); - } - if (metaObject.hasSetter("updateTime")) { - log.debug("自动插入 updateTime"); - this.setFieldValByName("updateTime", time, metaObject); - } - if (metaObject.hasSetter("createDate")) { - log.debug("自动插入 createDate"); - this.setFieldValByName("createDate", time, metaObject); - } - if (metaObject.hasSetter("updateDate")) { - log.debug("自动插入 updateDate"); - this.setFieldValByName("updateDate", time, metaObject); - } - if (metaObject.hasSetter("delFlag")) { - log.debug("自动插入 delFlag"); - this.setFieldValByName("delFlag", false, metaObject); - } - } catch (Exception e) { - log.error("自动注入失败:{}", e); - } - } - - /** - * 更新数据执行 - * - * @param metaObject - */ - @Override - public void updateFill(MetaObject metaObject) { - try { - Timestamp time=new Timestamp(System.currentTimeMillis()); - if (metaObject.hasSetter("updateTime")) { - log.debug("自动插入 updateTime"); - this.setFieldValByName("updateTime", time, metaObject); - } - if (metaObject.hasSetter("updateDate")) { - log.debug("自动插入 updateDate"); - this.setFieldValByName("updateDate", time, metaObject); - } - if (metaObject.hasSetter("delFlag")) { - log.debug("自动插入 delFlag"); - this.setFieldValByName("delFlag", null, metaObject); - } - if (metaObject.hasSetter("createTime")) { - log.debug("自动插入 createTime"); - this.setFieldValByName("createTime", null, metaObject); - } - } catch (Exception e) { - log.error("自动注入失败:{}", e); - } - } - -} diff --git a/yshop-mproot/src/main/java/co/yixiang/config/MybatisConfig.java b/yshop-mproot/src/main/java/co/yixiang/config/MybatisConfig.java deleted file mode 100644 index 30d79a2a..00000000 --- a/yshop-mproot/src/main/java/co/yixiang/config/MybatisConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.config; - -/** - * @author :LionCity - * @date :Created in 2020-04-10 15:11 - * @description:MybatisConfig - * @modified By: - * @version: - */ - -import com.github.pagehelper.PageHelper; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.Properties; - -@Configuration -public class MybatisConfig { - /** - * 配置mybatis的分页插件pageHelper - * @return - */ - @Bean - public PageHelper pageHelper(){ - PageHelper pageHelper = new PageHelper(); - Properties properties = new Properties(); - properties.setProperty("offsetAsPageNum","true"); - properties.setProperty("rowBoundsWithCount","true"); - properties.setProperty("reasonable","true"); - //配置mysql数据库的方言 - properties.setProperty("dialect","mysql"); - pageHelper.setProperties(properties); - return pageHelper; - } -} diff --git a/yshop-mproot/src/main/resources/META-INF/spring.factories b/yshop-mproot/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 66132c84..00000000 --- a/yshop-mproot/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,3 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - co.yixiang.config.MetaHandler,\ - co.yixiang.config.MybatisConfig \ No newline at end of file diff --git a/yshop-shop/pom.xml b/yshop-shop/pom.xml index 1c7e1808..e84b1a17 100644 --- a/yshop-shop/pom.xml +++ b/yshop-shop/pom.xml @@ -5,7 +5,7 @@ yshop co.yixiang - 2.2 + 2.1 4.0.0 @@ -21,13 +21,13 @@ co.yixiang yshop-tools - 2.2 + 2.1 co.yixiang yshop-mp - 2.2 + 2.1 co.yixiang @@ -38,4 +38,4 @@ - + \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreBargain.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreBargain.java index 646dc463..5420f7cd 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreBargain.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreBargain.java @@ -1,160 +1,177 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-22 */ +@Entity @Data -@TableName(value="yx_store_bargain") +@Table(name="yx_store_bargain") public class YxStoreBargain implements Serializable { - /** 砍价产品ID */ - @TableId + // 砍价产品ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 关联产品ID */ + // 关联产品ID + @Column(name = "product_id",nullable = false) private Integer productId; - - /** 砍价活动名称 */ + // 砍价活动名称 + @Column(name = "title",nullable = false) + @NotBlank(message = "请输入砍价活动名称") private String title; - - /** 砍价活动图片 */ + // 砍价活动图片 + @Column(name = "image",nullable = false) + @NotBlank(message = "请上传产品图片") private String image; - - /** 单位名称 */ + // 单位名称 + @Column(name = "unit_name") + @NotBlank(message = "单位名不能为空") private String unitName; - - /** 库存 */ + // 库存 + @Column(name = "stock") + @NotNull(message = "库存必填") private Integer stock; - - /** 销量 */ + // 销量 + @Column(name = "sales") + @NotNull(message = "销量必填") private Integer sales; - - /** 砍价产品轮播图 */ + // 砍价产品轮播图 + @Column(name = "images",nullable = false) + @NotBlank(message = "请上传产品轮播图") private String images; - - /** 砍价开启时间 */ + // 砍价开启时间 + @Column(name = "start_time",nullable = false) private Integer startTime; - - /** 砍价结束时间 */ + // 砍价结束时间 + @Column(name = "stop_time",nullable = false) private Integer stopTime; + @NotNull(message = "开始时间不能为空") + private Date startTimeDate; - /** 砍价产品名称 */ + @NotNull(message = "结束时间不能为空") + private Date endTimeDate; + + // 砍价产品名称 + @Column(name = "store_name") private String storeName; - - /** 砍价金额 */ + // 砍价金额 + @Column(name = "price") + @NotNull(message = "砍价金额必填") + @Min(value = 0,message = "砍价金额必须大于等于0") private BigDecimal price; - - /** 砍价商品最低价 */ + // 砍价商品最低价 + @Column(name = "min_price") + @NotNull(message = "砍价商品最低价必填") + @Min(value = 0,message = "砍价商品最低价必须大于等于0") private BigDecimal minPrice; - - /** 每次购买的砍价产品数量 */ + // 每次购买的砍价产品数量 + @Column(name = "num") + @NotNull(message = "购买的砍价产品数量必填") + @Min(value = 0,message = "购买的砍价产品数量必须大于等于0") private Integer num; - - /** 用户每次砍价的最大金额 */ + // 用户每次砍价的最大金额 + @Column(name = "bargain_max_price") + @NotNull(message = "砍价的最大金额必填") private BigDecimal bargainMaxPrice; - - /** 用户每次砍价的最小金额 */ + // 用户每次砍价的最小金额 + @Column(name = "bargain_min_price") + @NotNull(message = "砍价的最小金额必填") private BigDecimal bargainMinPrice; - - /** 用户每次砍价的次数 */ + // 用户每次砍价的次数 + @Column(name = "bargain_num",insertable = false) private Integer bargainNum; - - /** 砍价状态 0(到砍价时间不自动开启) 1(到砍价时间自动开启时间) */ + // 砍价状态 0(到砍价时间不自动开启) 1(到砍价时间自动开启时间) + @Column(name = "status",nullable = false) + @NotNull(message = "请选择活动状态") private Integer status; - - /** 砍价详情 */ + // 砍价详情 + @Column(name = "description") private String description; - - /** 反多少积分 */ + // 反多少积分 + @Column(name = "give_integral",insertable = false) private BigDecimal giveIntegral; - - /** 砍价活动简介 */ + // 砍价活动简介 + @Column(name = "info") private String info; - - /** 成本价 */ + // 成本价 + @Column(name = "cost") + @NotNull(message = "成本价必填") private BigDecimal cost; - - /** 排序 */ + // 排序 + @Column(name = "sort",nullable = false) + @NotNull(message = "排序必填") private Integer sort; - - /** 是否推荐0不推荐1推荐 */ + // 是否推荐0不推荐1推荐 + @Column(name = "is_hot",insertable = false) private Integer isHot; - - /** 是否删除 0未删除 1删除 */ + // 是否删除 0未删除 1删除 + @Column(name = "is_del",insertable = false) private Integer isDel; - - /** 添加时间 */ + // 添加时间 + @Column(name = "add_time") private Integer addTime; - - /** 是否包邮 0不包邮 1包邮 */ + // 是否包邮 0不包邮 1包邮 + @Column(name = "is_postage",nullable = false) + @NotNull(message = "请选择是否包邮") private Integer isPostage; - - /** 邮费 */ + // 邮费 + @Column(name = "postage") private BigDecimal postage; - - /** 砍价规则 */ + // 砍价规则 + @Column(name = "rule") private String rule; - - /** 砍价产品浏览量 */ + // 砍价产品浏览量 + @Column(name = "look",insertable = false) private Integer look; - - /** 砍价产品分享量 */ + // 砍价产品分享量 + @Column(name = "share",insertable = false) private Integer share; - - private Timestamp endTimeDate; - - - private Timestamp startTimeDate; - - public void copy(YxStoreBargain source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCombination.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCombination.java index ac6d7fb6..387c0fce 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCombination.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCombination.java @@ -1,145 +1,160 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ +@Entity @Data -@TableName("yx_store_combination") +@Table(name="yx_store_combination") public class YxStoreCombination implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 商品id */ + // 商品id + @Column(name = "product_id",nullable = false) private Integer productId; - - /** 商户id */ + // 商户id + @Column(name = "mer_id",insertable = false) private Integer merId; - - /** 推荐图 */ + // 推荐图 + @Column(name = "image",nullable = false) + @NotBlank(message = "请上传产品图片") private String image; - - /** 轮播图 */ + // 轮播图 + @Column(name = "images",nullable = false) + @NotBlank(message = "请上传产品轮播图") private String images; - - /** 活动标题 */ + // 活动标题 + @Column(name = "title",nullable = false) + @NotBlank(message = "请输入拼团名称") private String title; - - /** 活动属性 */ + // 活动属性 + @Column(name = "attr") private String attr; - - /** 参团人数 */ + // 参团人数 + @Column(name = "people",nullable = false) + @NotNull(message = "拼团人数必填") + @Min(value = 2,message = "拼团人数必须大于1") private Integer people; - - /** 简介 */ + // 简介 + @Column(name = "info",nullable = false) + @NotBlank(message = "请输入拼团简介") private String info; - - /** 价格 */ + // 价格 + @Column(name = "price",nullable = false) + @NotNull(message = "拼团价必填") + @Min(value = 0,message = "拼团价必须大于0") private BigDecimal price; - - /** 排序 */ + // 排序 + @Column(name = "sort",nullable = false) + @NotNull(message = "排序必填") private Integer sort; - - /** 销量 */ + // 销量 + @Column(name = "sales",nullable = false) + @NotNull(message = "销量必填") private Integer sales; - - /** 库存 */ + // 库存 + @Column(name = "stock",nullable = false) + @NotNull(message = "库存必填") private Integer stock; - - /** 添加时间 */ + // 添加时间 + @Column(name = "add_time",nullable = false) private String addTime; - - /** 推荐 */ + // 推荐 + @Column(name = "is_host",nullable = false) + @NotNull(message = "推荐必须选择") private Integer isHost; - - /** 产品状态 */ + // 产品状态 + @Column(name = "is_show",nullable = false) + @NotNull(message = "状态必须选择") private Integer isShow; - + @Column(name = "is_del",nullable = false,insertable = false) private Integer isDel; - + @Column(name = "combination",nullable = false,insertable = false) private Integer combination; - - /** 商户是否可用1可用0不可用 */ + // 商户是否可用1可用0不可用 + @Column(name = "mer_use") private Integer merUse; - - /** 是否包邮1是0否 */ + // 是否包邮1是0否 + @Column(name = "is_postage",nullable = false) + @NotNull(message = "包邮状态必须选择") private Integer isPostage; - - /** 邮费 */ + // 邮费 + @Column(name = "postage",nullable = false) + @NotNull(message = "邮费必填") private BigDecimal postage; - - /** 拼团内容 */ + // 拼团内容 + @Column(name = "description",nullable = false) + @NotBlank(message = "拼团内容不能为空") private String description; - - /** 拼团开始时间 */ + // 拼团开始时间 + @Column(name = "start_time",nullable = false) private Integer startTime; - - /** 拼团结束时间 */ + // 拼团结束时间 + @Column(name = "stop_time",nullable = false) private Integer stopTime; + @NotNull(message = "开始时间不能为空") + private Date startTimeDate; - /** 拼团订单有效时间 */ + @NotNull(message = "结束时间不能为空") + private Date endTimeDate; + + // 拼团订单有效时间 + @Column(name = "effective_time",nullable = false) private Integer effectiveTime; - - /** 拼图产品成本 */ + // 拼图产品成本 + @Column(name = "cost",nullable = false) private Integer cost; - - /** 浏览量 */ + // 浏览量 + @Column(name = "browse") private Integer browse; - - /** 单位名 */ + // 单位名 + @Column(name = "unit_name",nullable = false) private String unitName; - - private Timestamp endTimeDate; - - - private Timestamp startTimeDate; - - public void copy(YxStoreCombination source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCoupon.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCoupon.java index 1172de4d..b3224f5d 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCoupon.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCoupon.java @@ -1,69 +1,70 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ +@Entity @Data -@TableName("yx_store_coupon") +@Table(name="yx_store_coupon") public class YxStoreCoupon implements Serializable { - /** 优惠券表ID */ - @TableId + // 优惠券表ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 优惠券名称 */ + // 优惠券名称 + @Column(name = "title",nullable = false) + @NotBlank(message = "名称必填") private String title; - - /** 兑换消耗积分值 */ + // 兑换消耗积分值 + @Column(name = "integral",nullable = false) private Integer integral; - - /** 兑换的优惠券面值 */ + // 兑换的优惠券面值 + @Column(name = "coupon_price",nullable = false) + @Min(value = 1,message = "面值必须大于1") private BigDecimal couponPrice; - - /** 最低消费多少金额可用优惠券 */ + // 最低消费多少金额可用优惠券 + @Column(name = "use_min_price",nullable = false) + @Min(value = 1,message = "最低消费必须大于1") private BigDecimal useMinPrice; - - /** 优惠券有效期限(单位:天) */ + // 优惠券有效期限(单位:天) + @Column(name = "coupon_time",nullable = false) private Integer couponTime; - - /** 排序 */ + // 排序 + @Column(name = "sort",nullable = false) private Integer sort; - - /** 状态(0:关闭,1:开启) */ + // 状态(0:关闭,1:开启) + @Column(name = "status",nullable = false) private Integer status; - - /** 兑换项目添加时间 */ + // 兑换项目添加时间 + @Column(name = "add_time",nullable = false) private Integer addTime; - - /** 是否删除 */ + // 是否删除 + @Column(name = "is_del",nullable = false,insertable = false) private Integer isDel; - public void copy(YxStoreCoupon source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponIssue.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponIssue.java index 3fbf5fba..a8175429 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponIssue.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponIssue.java @@ -1,76 +1,73 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; +import lombok.Data; + +import javax.persistence.*; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.util.Date; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ +@Entity @Data -@TableName("yx_store_coupon_issue") +@Table(name="yx_store_coupon_issue") public class YxStoreCouponIssue implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - private String cname; - - - /** 优惠券ID */ + // 优惠券ID + @Column(name = "cid") private Integer cid; + @Column(name = "cname") + private String cname; - /** 优惠券领取开启时间 */ + // 优惠券领取开启时间 + @Column(name = "start_time") private Integer startTime; + @NotNull(message = "领取时间不能为空") + private Date startTimeDate; - /** 优惠券领取结束时间 */ + @NotNull(message = "结束时间不能为空") + private Date endTimeDate; + + // 优惠券领取结束时间 + @Column(name = "end_time") private Integer endTime; - - /** 优惠券领取数量 */ + // 优惠券领取数量 + @Column(name = "total_count") private Integer totalCount; - - /** 优惠券剩余领取数量 */ + // 优惠券剩余领取数量 + @Column(name = "remain_count") private Integer remainCount; - - /** 是否无限张数 */ + // 是否无限张数 + @Column(name = "is_permanent",nullable = false) private Integer isPermanent; - - /** 1 正常 0 未开启 -1 已无效 */ + // 1 正常 0 未开启 -1 已无效 + @Column(name = "status",nullable = false) private Integer status; - + @Column(name = "is_del",nullable = false) private Integer isDel; - - /** 优惠券添加时间 */ + // 优惠券添加时间 + @Column(name = "add_time") private Integer addTime; - - private Timestamp endTimeDate; - - - private Timestamp startTimeDate; - - public void copy(YxStoreCouponIssue source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponIssueUser.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponIssueUser.java index 32f6e941..ba5b4ce6 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponIssueUser.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponIssueUser.java @@ -1,43 +1,39 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ +@Entity @Data -@TableName("yx_store_coupon_issue_user") +@Table(name="yx_store_coupon_issue_user") public class YxStoreCouponIssueUser implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 领取优惠券用户ID */ + // 领取优惠券用户ID + @Column(name = "uid") private Integer uid; - - /** 优惠券前台领取ID */ + // 优惠券前台领取ID + @Column(name = "issue_coupon_id") private Integer issueCouponId; - - /** 领取时间 */ + // 领取时间 + @Column(name = "add_time") private Integer addTime; - public void copy(YxStoreCouponIssueUser source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponUser.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponUser.java index 3311e82a..b7eb329a 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponUser.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreCouponUser.java @@ -1,77 +1,73 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-10 */ +@Entity @Data -@TableName("yx_store_coupon_user") +@Table(name="yx_store_coupon_user") public class YxStoreCouponUser implements Serializable { - /** 优惠券发放记录id */ - @TableId + // 优惠券发放记录id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 兑换的项目id */ + // 兑换的项目id + @Column(name = "cid",nullable = false) private Integer cid; - - /** 优惠券所属用户 */ + // 优惠券所属用户 + @Column(name = "uid",nullable = false) private Integer uid; - - /** 优惠券名称 */ + // 优惠券名称 + @Column(name = "coupon_title",nullable = false) private String couponTitle; - - /** 优惠券的面值 */ + // 优惠券的面值 + @Column(name = "coupon_price",nullable = false) private BigDecimal couponPrice; - - /** 最低消费多少金额可用优惠券 */ + // 最低消费多少金额可用优惠券 + @Column(name = "use_min_price",nullable = false) private BigDecimal useMinPrice; - - /** 优惠券创建时间 */ + // 优惠券创建时间 + @Column(name = "add_time",nullable = false) private Integer addTime; - - /** 优惠券结束时间 */ + // 优惠券结束时间 + @Column(name = "end_time",nullable = false) private Integer endTime; - - /** 使用时间 */ + // 使用时间 + @Column(name = "use_time",nullable = false) private Integer useTime; - - /** 获取方式 */ + // 获取方式 + @Column(name = "type",nullable = false) private String type; - - /** 状态(0:未使用,1:已使用, 2:已过期) */ + // 状态(0:未使用,1:已使用, 2:已过期) + @Column(name = "status",nullable = false) private Integer status; - - /** 是否有效 */ + // 是否有效 + @Column(name = "is_fail",nullable = false) private Integer isFail; - public void copy(YxStoreCouponUser source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStorePink.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStorePink.java index 8e95f237..f31a9822 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStorePink.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStorePink.java @@ -1,91 +1,87 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-18 */ +@Entity @Data -@TableName("yx_store_pink") +@Table(name="yx_store_pink") public class YxStorePink implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 用户id */ + // 用户id + @Column(name = "uid",nullable = false) private Integer uid; - - /** 订单id 生成 */ + // 订单id 生成 + @Column(name = "order_id",nullable = false) private String orderId; - - /** 订单id 数据库 */ + // 订单id 数据库 + @Column(name = "order_id_key",nullable = false) private Integer orderIdKey; - - /** 购买商品个数 */ + // 购买商品个数 + @Column(name = "total_num",nullable = false) private Integer totalNum; - - /** 购买总金额 */ + // 购买总金额 + @Column(name = "total_price",nullable = false) private BigDecimal totalPrice; - - /** 拼团产品id */ + // 拼团产品id + @Column(name = "cid",nullable = false) private Integer cid; - - /** 产品id */ + // 产品id + @Column(name = "pid",nullable = false) private Integer pid; - - /** 拼图总人数 */ + // 拼图总人数 + @Column(name = "people",nullable = false) private Integer people; - - /** 拼团产品单价 */ + // 拼团产品单价 + @Column(name = "price",nullable = false) private BigDecimal price; - - /** 开始时间 */ + // 开始时间 + @Column(name = "add_time",nullable = false) private String addTime; - + @Column(name = "stop_time",nullable = false) private String stopTime; - - /** 团长id 0为团长 */ + // 团长id 0为团长 + @Column(name = "k_id",nullable = false) private Integer kId; - - /** 是否发送模板消息0未发送1已发送 */ + // 是否发送模板消息0未发送1已发送 + @Column(name = "is_tpl",nullable = false) private Integer isTpl; - - /** 是否退款 0未退款 1已退款 */ + // 是否退款 0未退款 1已退款 + @Column(name = "is_refund",nullable = false) private Integer isRefund; - - /** 状态1进行中2已完成3未完成 */ + // 状态1进行中2已完成3未完成 + @Column(name = "status",nullable = false) private Integer status; - public void copy(YxStorePink source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreSeckill.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreSeckill.java index 388074c5..3c69404b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreSeckill.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreSeckill.java @@ -1,140 +1,157 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-14 */ +@Entity @Data -@TableName("yx_store_seckill") +@Table(name="yx_store_seckill") public class YxStoreSeckill implements Serializable { - /** 商品秒杀产品表id */ - @TableId + // 商品秒杀产品表id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 商品id */ + // 商品id + @Column(name = "product_id",nullable = false) private Integer productId; - - /** 推荐图 */ + // 推荐图 + @Column(name = "image",nullable = false) + @NotBlank(message = "请上传产品图片") private String image; - - /** 轮播图 */ + // 轮播图 + @Column(name = "images",nullable = false) + @NotBlank(message = "请上传产品轮播图") private String images; - - /** 活动标题 */ + // 活动标题 + @Column(name = "title",nullable = false) + @NotBlank(message = "请输入产品标题") private String title; - - /** 简介 */ + // 简介 + @Column(name = "info",nullable = false) + @NotBlank(message = "请输入秒杀简介") private String info; - - /** 价格 */ + // 价格 + @Column(name = "price",nullable = false) + @NotNull(message = "秒杀价必填") + @Min(value = 0,message = "秒杀价必须大于0") private BigDecimal price; - - /** 成本 */ + // 成本 + @Column(name = "cost",nullable = false) + @NotNull(message = "成本价必填") + @Min(value = 0,message = "成本价必须大于0") private BigDecimal cost; - - /** 原价 */ + // 原价 + @Column(name = "ot_price",nullable = false) + @NotNull(message = "原价必填") + @Min(value = 0,message = "原价必须大于0") private BigDecimal otPrice; - - /** 返多少积分 */ + // 返多少积分 + @Column(name = "give_integral",nullable = false) private BigDecimal giveIntegral; - - /** 排序 */ + // 排序 + @Column(name = "sort",nullable = false) + @NotNull(message = "排序必填") private Integer sort; - - /** 库存 */ + // 库存 + @Column(name = "stock",nullable = false) + @NotNull(message = "库存必填") private Integer stock; - - /** 销量 */ + // 销量 + @Column(name = "sales",nullable = false) + @NotNull(message = "销量必填") private Integer sales; - - /** 单位名 */ + // 单位名 + @Column(name = "unit_name",nullable = false) + @NotBlank(message = "单位名不能为空") private String unitName; - - /** 邮费 */ + // 邮费 + @Column(name = "postage",nullable = false) + @NotNull(message = "邮费必填") private BigDecimal postage; - - /** 内容 */ + // 内容 + @Column(name = "description") private String description; - - /** 开始时间 */ + // 开始时间 + @Column(name = "start_time",nullable = false) private Integer startTime; - - /** 结束时间 */ + // 结束时间 + @Column(name = "stop_time",nullable = false) private Integer stopTime; + @NotNull(message = "开始时间不能为空") + private Date startTimeDate; - /** 添加时间 */ + @NotNull(message = "结束时间不能为空") + private Date endTimeDate; + + // 添加时间 + @Column(name = "add_time",nullable = false) private String addTime; - - /** 产品状态 */ + // 产品状态 + @Column(name = "status",nullable = false) + @NotNull(message = "活动状态必须选择") private Integer status; - - /** 是否包邮 */ + // 是否包邮 + @Column(name = "is_postage",nullable = false) + @NotNull(message = "包邮状态必须选择") private Integer isPostage; - - /** 热门推荐 */ + // 热门推荐 + @Column(name = "is_hot",insertable = false) private Integer isHot; - - /** 删除 0未删除1已删除 */ + // 删除 0未删除1已删除 + @Column(name = "is_del",insertable = false) private Integer isDel; - - /** 最多秒杀几个 */ + // 最多秒杀几个 + @Column(name = "num",nullable = false) + @NotNull(message = "限购必填") + @Min(value = 1,message = "限购必须大于0") private Integer num; - - /** 显示 */ + // 显示 + @Column(name = "is_show",nullable = false) private Integer isShow; - - private Timestamp endTimeDate; - - - private Timestamp startTimeDate; - - - /** 时间段id */ + @NotNull(message = "请选择开始时间") private Integer timeId; - public void copy(YxStoreSeckill source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreVisit.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreVisit.java index a597e425..787031b0 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreVisit.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxStoreVisit.java @@ -1,63 +1,59 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ +@Entity @Data -@TableName("yx_store_visit") +@Table(name="yx_store_visit") public class YxStoreVisit implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 产品ID */ + // 产品ID + @Column(name = "product_id") private Integer productId; - - /** 产品类型 */ + // 产品类型 + @Column(name = "product_type") private String productType; - - /** 产品分类ID */ + // 产品分类ID + @Column(name = "cate_id") private Integer cateId; - - /** 产品类型 */ + // 产品类型 + @Column(name = "type") private String type; - - /** 用户ID */ + // 用户ID + @Column(name = "uid") private Integer uid; - - /** 访问次数 */ + // 访问次数 + @Column(name = "count") private Integer count; - - /** 备注描述 */ + // 备注描述 + @Column(name = "content") private String content; - - /** 添加时间 */ + // 添加时间 + @Column(name = "add_time") private Integer addTime; - public void copy(YxStoreVisit source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxUserExtract.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxUserExtract.java index 060f2a91..49e4bdfb 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxUserExtract.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/domain/YxUserExtract.java @@ -1,84 +1,80 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-14 */ +@Entity @Data -@TableName("yx_user_extract") +@Table(name="yx_user_extract") public class YxUserExtract implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - + @Column(name = "uid") private Integer uid; - - /** 名称 */ + // 名称 + @Column(name = "real_name") private String realName; - - /** bank = 银行卡 alipay = 支付宝wx=微信 */ + // bank = 银行卡 alipay = 支付宝wx=微信 + @Column(name = "extract_type") private String extractType; - - /** 银行卡 */ + // 银行卡 + @Column(name = "bank_code") private String bankCode; - - /** 开户地址 */ + // 开户地址 + @Column(name = "bank_address") private String bankAddress; - - /** 支付宝账号 */ + // 支付宝账号 + @Column(name = "alipay_code") private String alipayCode; - - /** 提现金额 */ + // 提现金额 + @Column(name = "extract_price") private BigDecimal extractPrice; - + @Column(name = "mark") private String mark; - + @Column(name = "balance") private BigDecimal balance; - - /** 无效原因 */ + // 无效原因 + @Column(name = "fail_msg") private String failMsg; - + @Column(name = "fail_time") private Integer failTime; - - /** 添加时间 */ + // 添加时间 + @Column(name = "add_time") private Integer addTime; - - /** -1 未通过 0 审核中 1 已提现 */ + // -1 未通过 0 审核中 1 已提现 + @Column(name = "status") private Integer status; - - /** 微信号 */ + // 微信号 + @Column(name = "wechat") private String wechat; - public void copy(YxUserExtract source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreBargainRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreBargainRepository.java new file mode 100644 index 00000000..85fd5b0a --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreBargainRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStoreBargain; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author xuwenbo +* @date 2019-12-22 +*/ +public interface YxStoreBargainRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCombinationRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCombinationRepository.java new file mode 100644 index 00000000..61743177 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCombinationRepository.java @@ -0,0 +1,18 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStoreCombination; +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-11-18 +*/ +public interface YxStoreCombinationRepository extends JpaRepository, JpaSpecificationExecutor { + @Modifying + @Query(value = "update yx_store_combination set is_show = ?1 where id = ?2",nativeQuery = true) + void updateOnsale(int status, int id); + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponIssueRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponIssueRepository.java new file mode 100644 index 00000000..cb9accbb --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponIssueRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStoreCouponIssue; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-11-09 +*/ +public interface YxStoreCouponIssueRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponIssueUserRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponIssueUserRepository.java new file mode 100644 index 00000000..f76e0f64 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponIssueUserRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStoreCouponIssueUser; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-11-09 +*/ +public interface YxStoreCouponIssueUserRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponRepository.java new file mode 100644 index 00000000..4549838a --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStoreCoupon; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-11-09 +*/ +public interface YxStoreCouponRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponUserRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponUserRepository.java new file mode 100644 index 00000000..910953bc --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreCouponUserRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStoreCouponUser; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-11-10 +*/ +public interface YxStoreCouponUserRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStorePinkRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStorePinkRepository.java new file mode 100644 index 00000000..f395db23 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStorePinkRepository.java @@ -0,0 +1,20 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStorePink; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-11-18 +*/ +public interface YxStorePinkRepository extends JpaRepository, JpaSpecificationExecutor { + int countByCid(int cid); + + int countByCidAndKId(int cid, int kid); + + int countByKId(int kid); + + YxStorePink findByOrderIdKey(int id); + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreSeckillRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreSeckillRepository.java new file mode 100644 index 00000000..593f7114 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreSeckillRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStoreSeckill; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author xuwenbo +* @date 2019-12-14 +*/ +public interface YxStoreSeckillRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreVisitRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreVisitRepository.java new file mode 100644 index 00000000..5c9bfb95 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxStoreVisitRepository.java @@ -0,0 +1,13 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxStoreVisit; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-11-18 +*/ +public interface YxStoreVisitRepository extends JpaRepository, JpaSpecificationExecutor { + int countByProductIdAndProductType(int productId, String productType); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxUserExtractRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxUserExtractRepository.java new file mode 100644 index 00000000..20d35a14 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/repository/YxUserExtractRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.activity.repository; + +import co.yixiang.modules.activity.domain.YxUserExtract; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-11-14 +*/ +public interface YxUserExtractRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreBargainController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreBargainController.java index 2e51c214..a0eac56d 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreBargainController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreBargainController.java @@ -1,15 +1,9 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; import cn.hutool.core.util.ObjectUtil; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.activity.domain.YxStoreBargain; import co.yixiang.modules.activity.service.YxStoreBargainService; import co.yixiang.modules.activity.service.dto.YxStoreBargainQueryCriteria; @@ -24,7 +18,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; /** -* @author hupeng +* @author xuwenbo * @date 2019-12-22 */ @Api(tags = "商城:砍价管理") @@ -64,9 +58,9 @@ public class StoreBargainController { } if(ObjectUtil.isNull(resources.getId())){ resources.setAddTime(OrderUtil.getSecondTimestampTwo()); - return new ResponseEntity(yxStoreBargainService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxStoreBargainService.create(resources),HttpStatus.CREATED); }else{ - yxStoreBargainService.saveOrUpdate(resources); + yxStoreBargainService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } } @@ -77,7 +71,7 @@ public class StoreBargainController { @PreAuthorize("@el.check('admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxStoreBargainService.removeById(id); + yxStoreBargainService.delete(id); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java index 3641571f..13b57379 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java @@ -1,15 +1,9 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; import cn.hutool.core.util.ObjectUtil; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.activity.domain.YxStoreCombination; import co.yixiang.modules.activity.service.YxStoreCombinationService; import co.yixiang.modules.activity.service.dto.YxStoreCombinationQueryCriteria; @@ -65,9 +59,9 @@ public class StoreCombinationController { } if(ObjectUtil.isNull(resources.getId())){ resources.setAddTime(String.valueOf(OrderUtil.getSecondTimestampTwo())); - return new ResponseEntity(yxStoreCombinationService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxStoreCombinationService.create(resources),HttpStatus.CREATED); }else{ - yxStoreCombinationService.saveOrUpdate(resources); + yxStoreCombinationService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -93,7 +87,7 @@ public class StoreCombinationController { YxStoreCombination combination = new YxStoreCombination(); combination.setIsDel(1); combination.setId(id); - yxStoreCombinationService.saveOrUpdate(combination); + yxStoreCombinationService.update(combination); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java index afad8af3..7851b347 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java @@ -1,14 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.activity.domain.YxStoreCoupon; import co.yixiang.modules.activity.service.YxStoreCouponService; import co.yixiang.modules.activity.service.dto.YxStoreCouponQueryCriteria; @@ -51,7 +45,7 @@ public class StoreCouponController { @PreAuthorize("@el.check('admin','YXSTORECOUPON_ALL','YXSTORECOUPON_CREATE')") public ResponseEntity create(@Validated @RequestBody YxStoreCoupon resources){ resources.setAddTime(OrderUtil.getSecondTimestampTwo()); - return new ResponseEntity(yxStoreCouponService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxStoreCouponService.create(resources),HttpStatus.CREATED); } @Log("修改") @@ -59,7 +53,7 @@ public class StoreCouponController { @PutMapping(value = "/yxStoreCoupon") @PreAuthorize("@el.check('admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT')") public ResponseEntity update(@Validated @RequestBody YxStoreCoupon resources){ - yxStoreCouponService.saveOrUpdate(resources); + yxStoreCouponService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -72,7 +66,7 @@ public class StoreCouponController { YxStoreCoupon resources = new YxStoreCoupon(); resources.setId(id); resources.setIsDel(1); - yxStoreCouponService.saveOrUpdate(resources); + yxStoreCouponService.update(resources); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java index a8d54b28..95356961 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java @@ -1,15 +1,9 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; import cn.hutool.core.util.ObjectUtil; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.activity.domain.YxStoreCouponIssue; import co.yixiang.modules.activity.service.YxStoreCouponIssueService; import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueQueryCriteria; @@ -64,7 +58,7 @@ public class StoreCouponIssueController { resources.setRemainCount(resources.getTotalCount()); } resources.setAddTime(OrderUtil.getSecondTimestampTwo()); - return new ResponseEntity(yxStoreCouponIssueService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxStoreCouponIssueService.create(resources),HttpStatus.CREATED); } @Log("修改状态") @@ -72,7 +66,7 @@ public class StoreCouponIssueController { @PutMapping(value = "/yxStoreCouponIssue") @PreAuthorize("@el.check('admin','YXSTORECOUPONISSUE_ALL','YXSTORECOUPONISSUE_EDIT')") public ResponseEntity update(@Validated @RequestBody YxStoreCouponIssue resources){ - yxStoreCouponIssueService.saveOrUpdate(resources); + yxStoreCouponIssueService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -85,7 +79,7 @@ public class StoreCouponIssueController { YxStoreCouponIssue resources = new YxStoreCouponIssue(); resources.setId(id); resources.setIsDel(1); - yxStoreCouponIssueService.saveOrUpdate(resources); + yxStoreCouponIssueService.update(resources); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueUserController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueUserController.java index 9e1c5116..ac108ed4 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueUserController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueUserController.java @@ -1,14 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.activity.domain.YxStoreCouponIssueUser; import co.yixiang.modules.activity.service.YxStoreCouponIssueUserService; import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserQueryCriteria; @@ -49,7 +43,7 @@ public class StoreCouponIssueUserController { @PostMapping(value = "/yxStoreCouponIssueUser") @PreAuthorize("@el.check('admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_CREATE')") public ResponseEntity create(@Validated @RequestBody YxStoreCouponIssueUser resources){ - return new ResponseEntity(yxStoreCouponIssueUserService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxStoreCouponIssueUserService.create(resources),HttpStatus.CREATED); } @Log("修改") @@ -57,7 +51,7 @@ public class StoreCouponIssueUserController { @PutMapping(value = "/yxStoreCouponIssueUser") @PreAuthorize("@el.check('admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_EDIT')") public ResponseEntity update(@Validated @RequestBody YxStoreCouponIssueUser resources){ - yxStoreCouponIssueUserService.saveOrUpdate(resources); + yxStoreCouponIssueUserService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -67,7 +61,7 @@ public class StoreCouponIssueUserController { @PreAuthorize("@el.check('admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxStoreCouponIssueUserService.removeById(id); + yxStoreCouponIssueUserService.delete(id); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponUserController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponUserController.java index 10cf9741..dd0fc7f9 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponUserController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreCouponUserController.java @@ -1,14 +1,7 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.activity.domain.YxStoreCouponUser; import co.yixiang.modules.activity.service.YxStoreCouponUserService; import co.yixiang.modules.activity.service.dto.YxStoreCouponUserQueryCriteria; import io.swagger.annotations.Api; @@ -17,6 +10,7 @@ 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.*; /** @@ -43,4 +37,4 @@ public class StoreCouponUserController { } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StorePinkController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StorePinkController.java index 415f9814..96ed4631 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StorePinkController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StorePinkController.java @@ -1,14 +1,7 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.activity.domain.YxStorePink; import co.yixiang.modules.activity.service.YxStorePinkService; import co.yixiang.modules.activity.service.dto.YxStorePinkQueryCriteria; import io.swagger.annotations.Api; @@ -17,6 +10,7 @@ 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.*; /** @@ -43,4 +37,4 @@ public class StorePinkController { } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java index b85aa415..cfc7f804 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java @@ -1,15 +1,9 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; import cn.hutool.core.util.ObjectUtil; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.activity.domain.YxStoreSeckill; import co.yixiang.modules.activity.service.YxStoreSeckillService; import co.yixiang.modules.activity.service.dto.YxStoreSeckillQueryCriteria; @@ -24,7 +18,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; /** -* @author hupeng +* @author xuwenbo * @date 2019-12-14 */ @Api(tags = "商城:秒杀管理") @@ -63,9 +57,9 @@ public class StoreSeckillController { } if(ObjectUtil.isNull(resources.getId())){ resources.setAddTime(String.valueOf(OrderUtil.getSecondTimestampTwo())); - return new ResponseEntity(yxStoreSeckillService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxStoreSeckillService.create(resources),HttpStatus.CREATED); }else{ - yxStoreSeckillService.saveOrUpdate(resources); + yxStoreSeckillService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } } @@ -76,7 +70,7 @@ public class StoreSeckillController { @PreAuthorize("@el.check('admin','YXSTORESECKILL_ALL','YXSTORESECKILL_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxStoreSeckillService.removeById(id); + yxStoreSeckillService.delete(id); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/UserExtractController.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/UserExtractController.java index ecd4f3db..18ef2148 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/UserExtractController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/rest/UserExtractController.java @@ -1,34 +1,25 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.rest; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.dozer.service.IGenerator; +import co.yixiang.aop.log.Log; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.activity.domain.YxUserExtract; import co.yixiang.modules.activity.service.YxUserExtractService; import co.yixiang.modules.activity.service.dto.YxUserExtractQueryCriteria; -import co.yixiang.modules.shop.domain.YxUser; import co.yixiang.modules.shop.domain.YxUserBill; -import co.yixiang.modules.shop.domain.YxWechatUser; import co.yixiang.modules.shop.service.YxUserBillService; import co.yixiang.modules.shop.service.YxUserService; import co.yixiang.modules.shop.service.YxWechatUserService; -import co.yixiang.modules.shop.service.dto.YxUserDto; -import co.yixiang.modules.shop.service.dto.YxWechatUserDto; +import co.yixiang.modules.shop.service.dto.YxUserDTO; +import co.yixiang.modules.shop.service.dto.YxWechatUserDTO; +import co.yixiang.mp.config.WxPayConfiguration; import co.yixiang.mp.service.YxPayService; import co.yixiang.utils.OrderUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.binarywang.wxpay.bean.entpay.EntPayRequest; 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 org.springframework.data.domain.Pageable; @@ -54,17 +45,15 @@ public class UserExtractController { private final YxUserBillService yxUserBillService; private final YxWechatUserService wechatUserService; private final YxPayService payService; - private final IGenerator generator; - public UserExtractController(YxUserExtractService yxUserExtractService, YxUserService yxUserService, - YxUserBillService yxUserBillService, YxWechatUserService wechatUserService, - YxPayService payService, IGenerator generator) { + public UserExtractController(YxUserExtractService yxUserExtractService,YxUserService yxUserService, + YxUserBillService yxUserBillService,YxWechatUserService wechatUserService, + YxPayService payService) { this.yxUserExtractService = yxUserExtractService; this.yxUserService = yxUserService; this.yxUserBillService = yxUserBillService; this.wechatUserService = wechatUserService; this.payService = payService; - this.generator = generator; } @Log("查询") @@ -93,7 +82,7 @@ public class UserExtractController { throw new BadRequestException("请填写失败原因"); } String mark = "提现失败,退回佣金"+resources.getExtractPrice()+"元"; - YxUserDto userDTO = generator.convert(yxUserService.getOne(new QueryWrapper().eq("uid",resources.getUid())),YxUserDto.class); + YxUserDTO userDTO = yxUserService.findById(resources.getUid()); //增加流水 YxUserBill userBill = new YxUserBill(); @@ -108,7 +97,7 @@ public class UserExtractController { userBill.setStatus(1); userBill.setAddTime(OrderUtil.getSecondTimestampTwo()); userBill.setPm(1); - yxUserBillService.save(userBill); + yxUserBillService.create(userBill); //返回提现金额 yxUserService.incBrokeragePrice(resources.getExtractPrice().doubleValue() @@ -120,7 +109,7 @@ public class UserExtractController { //todo 此处为企业付款,没经过测试 boolean isTest = true; if(!isTest){ - YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new QueryWrapper().eq("uid",resources.getUid())),YxWechatUserDto.class); + YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid()); if(ObjectUtil.isNotNull(wechatUser)){ try { payService.entPay(wechatUser.getOpenid(),resources.getId().toString(), @@ -134,9 +123,9 @@ public class UserExtractController { } } - yxUserExtractService.saveOrUpdate(resources); + yxUserExtractService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainService.java index 9de77fcb..5ae975da 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreBargainService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStoreBargain; -import co.yixiang.modules.activity.service.dto.YxStoreBargainDto; +import co.yixiang.modules.activity.service.dto.YxStoreBargainDTO; import co.yixiang.modules.activity.service.dto.YxStoreBargainQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-22 */ -public interface YxStoreBargainService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreBargain") +public interface YxStoreBargainService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreBargainQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreBargainQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreBargainQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreBargainDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStoreBargainDTO create(YxStoreBargain resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStoreBargain resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCombinationService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCombinationService.java index e8834827..bfd28607 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCombinationService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCombinationService.java @@ -1,50 +1,66 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStoreCombination; -import co.yixiang.modules.activity.service.dto.YxStoreCombinationDto; +import co.yixiang.modules.activity.service.dto.YxStoreCombinationDTO; import co.yixiang.modules.activity.service.dto.YxStoreCombinationQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ -public interface YxStoreCombinationService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreCombination") +public interface YxStoreCombinationService { -/** + void onSale(Integer id, Integer status); + + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreCombinationQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreCombinationQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreCombinationQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreCombinationDTO findById(Integer id); - void onSale(Integer id, int status); -} + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStoreCombinationDTO create(YxStoreCombination resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStoreCombination resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponIssueService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponIssueService.java index 263f3344..9320cc36 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponIssueService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponIssueService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStoreCouponIssue; -import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueDto; +import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueDTO; import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ -public interface YxStoreCouponIssueService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreCouponIssue") +public interface YxStoreCouponIssueService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreCouponIssueQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreCouponIssueQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreCouponIssueQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreCouponIssueDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStoreCouponIssueDTO create(YxStoreCouponIssue resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStoreCouponIssue resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponIssueUserService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponIssueUserService.java index fc642ad6..e648422b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponIssueUserService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponIssueUserService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStoreCouponIssueUser; -import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserDto; +import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserDTO; import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ -public interface YxStoreCouponIssueUserService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreCouponIssueUser") +public interface YxStoreCouponIssueUserService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreCouponIssueUserQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreCouponIssueUserQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreCouponIssueUserQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreCouponIssueUserDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStoreCouponIssueUserDTO create(YxStoreCouponIssueUser resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStoreCouponIssueUser resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponService.java index 80943ac0..e9d65518 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStoreCoupon; -import co.yixiang.modules.activity.service.dto.YxStoreCouponDto; +import co.yixiang.modules.activity.service.dto.YxStoreCouponDTO; import co.yixiang.modules.activity.service.dto.YxStoreCouponQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ -public interface YxStoreCouponService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreCoupon") +public interface YxStoreCouponService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreCouponQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreCouponQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreCouponQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreCouponDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStoreCouponDTO create(YxStoreCoupon resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStoreCoupon resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponUserService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponUserService.java index 27b58071..92160bb4 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponUserService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreCouponUserService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStoreCouponUser; -import co.yixiang.modules.activity.service.dto.YxStoreCouponUserDto; +import co.yixiang.modules.activity.service.dto.YxStoreCouponUserDTO; import co.yixiang.modules.activity.service.dto.YxStoreCouponUserQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-10 */ -public interface YxStoreCouponUserService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreCouponUser") +public interface YxStoreCouponUserService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreCouponUserQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreCouponUserQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreCouponUserQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreCouponUserDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStoreCouponUserDTO create(YxStoreCouponUser resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStoreCouponUser resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStorePinkService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStorePinkService.java index 6dbeeccf..394c8a02 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStorePinkService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStorePinkService.java @@ -1,48 +1,66 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStorePink; -import co.yixiang.modules.activity.service.dto.YxStorePinkDto; +import co.yixiang.modules.activity.service.dto.YxStorePinkDTO; import co.yixiang.modules.activity.service.dto.YxStorePinkQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-18 */ -public interface YxStorePinkService extends BaseService{ +//@CacheConfig(cacheNames = "yxStorePink") +public interface YxStorePinkService { -/** + int countPeople(int id); + + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStorePinkQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStorePinkQueryCriteria criteria); + //@Cacheable + List queryAll(YxStorePinkQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStorePinkDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStorePinkDTO create(YxStorePink resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStorePink resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreSeckillService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreSeckillService.java index 1ec23e45..6ac336a0 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreSeckillService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreSeckillService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStoreSeckill; -import co.yixiang.modules.activity.service.dto.YxStoreSeckillDto; +import co.yixiang.modules.activity.service.dto.YxStoreSeckillDTO; import co.yixiang.modules.activity.service.dto.YxStoreSeckillQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-14 */ -public interface YxStoreSeckillService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreSeckill") +public interface YxStoreSeckillService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreSeckillQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreSeckillQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreSeckillQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreSeckillDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStoreSeckillDTO create(YxStoreSeckill resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStoreSeckill resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreVisitService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreVisitService.java index f4afe1b6..6e0c548b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreVisitService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxStoreVisitService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxStoreVisit; -import co.yixiang.modules.activity.service.dto.YxStoreVisitDto; +import co.yixiang.modules.activity.service.dto.YxStoreVisitDTO; import co.yixiang.modules.activity.service.dto.YxStoreVisitQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ -public interface YxStoreVisitService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreVisit") +public interface YxStoreVisitService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreVisitQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreVisitQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreVisitQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreVisitDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxStoreVisitDTO create(YxStoreVisit resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxStoreVisit resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxUserExtractService.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxUserExtractService.java index 84553db1..0399d902 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxUserExtractService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/YxUserExtractService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.activity.domain.YxUserExtract; -import co.yixiang.modules.activity.service.dto.YxUserExtractDto; +import co.yixiang.modules.activity.service.dto.YxUserExtractDTO; import co.yixiang.modules.activity.service.dto.YxUserExtractQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-14 */ -public interface YxUserExtractService extends BaseService{ +//@CacheConfig(cacheNames = "yxUserExtract") +public interface YxUserExtractService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxUserExtractQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxUserExtractQueryCriteria criteria); + //@Cacheable + List queryAll(YxUserExtractQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxUserExtractDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxUserExtractDTO create(YxUserExtract resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxUserExtract resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainDTO.java new file mode 100644 index 00000000..d6bf749b --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainDTO.java @@ -0,0 +1,113 @@ +package co.yixiang.modules.activity.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +/** +* @author xuwenbo +* @date 2019-12-22 +*/ +@Data +public class YxStoreBargainDTO implements Serializable { + + // 砍价产品ID + private Integer id; + + // 关联产品ID + private Integer productId; + + // 砍价活动名称 + private String title; + + // 砍价活动图片 + private String image; + + // 单位名称 + private String unitName; + + // 库存 + private Integer stock; + + // 销量 + private Integer sales; + + // 砍价产品轮播图 + private String images; + + // 砍价开启时间 + private Integer startTime; + + // 砍价结束时间 + private Integer stopTime; + + // 砍价产品名称 + private String storeName; + + // 砍价金额 + private BigDecimal price; + + // 砍价商品最低价 + private BigDecimal minPrice; + + // 每次购买的砍价产品数量 + private Integer num; + + // 用户每次砍价的最大金额 + private BigDecimal bargainMaxPrice; + + // 用户每次砍价的最小金额 + private BigDecimal bargainMinPrice; + + // 用户每次砍价的次数 + private Integer bargainNum; + + // 砍价状态 0(到砍价时间不自动开启) 1(到砍价时间自动开启时间) + private Integer status; + + // 砍价详情 + private String description; + + // 反多少积分 + private BigDecimal giveIntegral; + + // 砍价活动简介 + private String info; + + // 成本价 + private BigDecimal cost; + + // 排序 + private Integer sort; + + // 是否推荐0不推荐1推荐 + private Integer isHot; + + // 是否删除 0未删除 1删除 + private Integer isDel; + + // 添加时间 + private Integer addTime; + + // 是否包邮 0不包邮 1包邮 + private Integer isPostage; + + // 邮费 + private BigDecimal postage; + + // 砍价规则 + private String rule; + + // 砍价产品浏览量 + private Integer look; + + // 砍价产品分享量 + private Integer share; + + private Date startTimeDate; + + private Date endTimeDate; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainDto.java deleted file mode 100644 index a5a224b8..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainDto.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.activity.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Data -public class YxStoreBargainDto implements Serializable { - - /** 砍价产品ID */ - private Integer id; - - /** 关联产品ID */ - private Integer productId; - - /** 砍价活动名称 */ - private String title; - - /** 砍价活动图片 */ - private String image; - - /** 单位名称 */ - private String unitName; - - /** 库存 */ - private Integer stock; - - /** 销量 */ - private Integer sales; - - /** 砍价产品轮播图 */ - private String images; - - /** 砍价开启时间 */ - private Integer startTime; - - /** 砍价结束时间 */ - private Integer stopTime; - - /** 砍价产品名称 */ - private String storeName; - - /** 砍价金额 */ - private BigDecimal price; - - /** 砍价商品最低价 */ - private BigDecimal minPrice; - - /** 每次购买的砍价产品数量 */ - private Integer num; - - /** 用户每次砍价的最大金额 */ - private BigDecimal bargainMaxPrice; - - /** 用户每次砍价的最小金额 */ - private BigDecimal bargainMinPrice; - - /** 用户每次砍价的次数 */ - private Integer bargainNum; - - /** 砍价状态 0(到砍价时间不自动开启) 1(到砍价时间自动开启时间) */ - private Integer status; - - /** 砍价详情 */ - private String description; - - /** 反多少积分 */ - private BigDecimal giveIntegral; - - /** 砍价活动简介 */ - private String info; - - /** 成本价 */ - private BigDecimal cost; - - /** 排序 */ - private Integer sort; - - /** 是否推荐0不推荐1推荐 */ - private Integer isHot; - - /** 是否删除 0未删除 1删除 */ - private Integer isDel; - - /** 添加时间 */ - private Integer addTime; - - /** 是否包邮 0不包邮 1包邮 */ - private Integer isPostage; - - /** 邮费 */ - private BigDecimal postage; - - /** 砍价规则 */ - private String rule; - - /** 砍价产品浏览量 */ - private Integer look; - - /** 砍价产品分享量 */ - private Integer share; - - private Timestamp endTimeDate; - - private Timestamp startTimeDate; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainQueryCriteria.java index 9e501d1b..3710ced6 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreBargainQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-22 */ @Data public class YxStoreBargainQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationDTO.java similarity index 79% rename from yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationDTO.java index 8eb9d76d..ccf95aa4 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationDTO.java @@ -1,25 +1,18 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; import lombok.Data; -import java.sql.Timestamp; -import java.math.BigDecimal; + import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; + /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ @Data -public class YxStoreCombinationDto implements Serializable { +public class YxStoreCombinationDTO implements Serializable { private Integer id; @@ -114,5 +107,4 @@ public class YxStoreCombinationDto implements Serializable { // 单位名 private String unitName; - -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationQueryCriteria.java index e42109fc..e6495494 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCombinationQueryCriteria.java @@ -1,20 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ @Data public class YxStoreCombinationQueryCriteria{ @@ -25,4 +16,4 @@ public class YxStoreCombinationQueryCriteria{ @Query private Integer isDel; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponDTO.java similarity index 64% rename from yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponDTO.java index 72fc1ed8..2e5769de 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponDTO.java @@ -1,23 +1,17 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; import lombok.Data; -import java.math.BigDecimal; + import java.io.Serializable; +import java.math.BigDecimal; + /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ @Data -public class YxStoreCouponDto implements Serializable { +public class YxStoreCouponDTO implements Serializable { // 优惠券表ID private Integer id; @@ -48,4 +42,4 @@ public class YxStoreCouponDto implements Serializable { // 是否删除 private Integer isDel; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueDTO.java new file mode 100644 index 00000000..796b52b6 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueDTO.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.activity.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** +* @author hupeng +* @date 2019-11-09 +*/ +@Data +public class YxStoreCouponIssueDTO implements Serializable { + + private Integer id; + + // 优惠券ID + private Integer cid; + + private String cname; + + // 优惠券领取开启时间 + private Integer startTime; + + // 优惠券领取结束时间 + private Integer endTime; + + private Date startTimeDate; + + private Date endTimeDate; + + // 优惠券领取数量 + private Integer totalCount; + + // 优惠券剩余领取数量 + private Integer remainCount; + + // 是否无限张数 + private Integer isPermanent; + + // 1 正常 0 未开启 -1 已无效 + private Integer status; + + private Integer isDel; + + // 优惠券添加时间 + private Integer addTime; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueDto.java deleted file mode 100644 index 43eb2ce7..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueDto.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.activity.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Data -public class YxStoreCouponIssueDto implements Serializable { - - private Integer id; - - private String cname; - - /** 优惠券ID */ - private Integer cid; - - /** 优惠券领取开启时间 */ - private Integer startTime; - - /** 优惠券领取结束时间 */ - private Integer endTime; - - /** 优惠券领取数量 */ - private Integer totalCount; - - /** 优惠券剩余领取数量 */ - private Integer remainCount; - - /** 是否无限张数 */ - private Integer isPermanent; - - /** 1 正常 0 未开启 -1 已无效 */ - private Integer status; - - private Integer isDel; - - /** 优惠券添加时间 */ - private Integer addTime; - - private Timestamp endTimeDate; - - private Timestamp startTimeDate; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueQueryCriteria.java index 4e8f25a3..a07dbae9 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueQueryCriteria.java @@ -1,24 +1,14 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ @Data public class YxStoreCouponIssueQueryCriteria{ - + @Query private Integer isDel; - -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserDTO.java new file mode 100644 index 00000000..52b1ffc0 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserDTO.java @@ -0,0 +1,25 @@ +package co.yixiang.modules.activity.service.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** +* @author hupeng +* @date 2019-11-09 +*/ +@Data +public class YxStoreCouponIssueUserDTO implements Serializable { + + private Integer id; + + // 领取优惠券用户ID + private Integer uid; + + // 优惠券前台领取ID + private Integer issueCouponId; + + // 领取时间 + private Integer addTime; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserDto.java deleted file mode 100644 index d1f577b4..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserDto.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.activity.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Data -public class YxStoreCouponIssueUserDto implements Serializable { - - private Integer id; - - /** 领取优惠券用户ID */ - private Integer uid; - - /** 优惠券前台领取ID */ - private Integer issueCouponId; - - /** 领取时间 */ - private Integer addTime; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserQueryCriteria.java index 34fa7f86..577129ca 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponIssueUserQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ @Data public class YxStoreCouponIssueUserQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponQueryCriteria.java index 678b6dff..22207acd 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponQueryCriteria.java @@ -1,24 +1,14 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ @Data public class YxStoreCouponQueryCriteria{ - @Query private Integer isDel; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserDTO.java similarity index 67% rename from yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserDTO.java index 4b1938ff..0721dde0 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserDTO.java @@ -1,23 +1,17 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; import lombok.Data; -import java.math.BigDecimal; + import java.io.Serializable; +import java.math.BigDecimal; + /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-10 */ @Data -public class YxStoreCouponUserDto implements Serializable { +public class YxStoreCouponUserDTO implements Serializable { // 优惠券发放记录id private Integer id; @@ -56,5 +50,4 @@ public class YxStoreCouponUserDto implements Serializable { // 是否有效 private Integer isFail; - -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserQueryCriteria.java index 126035a2..6be50072 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreCouponUserQueryCriteria.java @@ -1,21 +1,12 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** -* @author hupeng -* @date 2020-05-13 -*/ + * @author hupeng + * @date 2019-11-10 + */ @Data public class YxStoreCouponUserQueryCriteria{ diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkDTO.java new file mode 100644 index 00000000..99b0aa04 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkDTO.java @@ -0,0 +1,69 @@ +package co.yixiang.modules.activity.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +/** +* @author hupeng +* @date 2019-11-18 +*/ +@Data +public class YxStorePinkDTO implements Serializable { + + private Integer id; + + // 用户id + private Integer uid; + + // 订单id 生成 + private String orderId; + + // 订单id 数据库 + private Integer orderIdKey; + + private String title; + + private String nickname; + + private String avatar; + + private Integer countPeople; + + // 购买商品个数 + private Integer totalNum; + + // 购买总金额 + private BigDecimal totalPrice; + + // 拼团产品id + private Integer cid; + + // 产品id + private Integer pid; + + // 拼图总人数 + private Integer people; + + // 拼团产品单价 + private BigDecimal price; + + // 开始时间 + private String addTime; + + private String stopTime; + + // 团长id 0为团长 + private Integer kId; + + // 是否发送模板消息0未发送1已发送 + private Integer isTpl; + + // 是否退款 0未退款 1已退款 + private Integer isRefund; + + // 状态1进行中2已完成3未完成 + private Integer status; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkDto.java deleted file mode 100644 index a26d607c..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkDto.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.activity.service.dto; - -import lombok.Data; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxStorePinkDto implements Serializable { - - private Integer id; - - /** 用户id */ - private Integer uid; - - /** 订单id 生成 */ - private String orderId; - - /** 订单id 数据库 */ - private Integer orderIdKey; - - /** 购买商品个数 */ - private Integer totalNum; - - /** 购买总金额 */ - private BigDecimal totalPrice; - - /** 拼团产品id */ - private Integer cid; - - /** 产品id */ - private Integer pid; - - /** 拼图总人数 */ - private Integer people; - - /** 拼团产品单价 */ - private BigDecimal price; - - /** 开始时间 */ - private String addTime; - - private String stopTime; - - /** 团长id 0为团长 */ - private Integer kId; - - /** 是否发送模板消息0未发送1已发送 */ - private Integer isTpl; - - /** 是否退款 0未退款 1已退款 */ - private Integer isRefund; - - /** 状态1进行中2已完成3未完成 */ - private Integer status; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkQueryCriteria.java index 5496e0af..fbc03eb9 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStorePinkQueryCriteria.java @@ -1,23 +1,14 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-18 */ @Data public class YxStorePinkQueryCriteria{ @Query private Integer kId; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillDTO.java similarity index 75% rename from yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillDTO.java index 2509c06d..6292d26c 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillDTO.java @@ -1,26 +1,18 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; import lombok.Data; -import java.sql.Timestamp; -import java.math.BigDecimal; + import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; + /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-14 */ @Data -public class YxStoreSeckillDto implements Serializable { - +public class YxStoreSeckillDTO implements Serializable { // 商品秒杀产品表id private Integer id; @@ -104,4 +96,4 @@ public class YxStoreSeckillDto implements Serializable { private String statusStr; private Integer timeId; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillQueryCriteria.java index 31cf975c..1eca448f 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreSeckillQueryCriteria.java @@ -1,26 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-14 */ @Data public class YxStoreSeckillQueryCriteria{ - // 模糊 @Query(type = Query.Type.INNER_LIKE) private String title; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitDTO.java new file mode 100644 index 00000000..98db3959 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitDTO.java @@ -0,0 +1,40 @@ +package co.yixiang.modules.activity.service.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** +* @author hupeng +* @date 2019-11-18 +*/ +@Data +public class YxStoreVisitDTO implements Serializable { + + private Integer id; + + // 产品ID + private Integer productId; + + // 产品类型 + private String productType; + + // 产品分类ID + private Integer cateId; + + // 产品类型 + private String type; + + // 用户ID + private Integer uid; + + // 访问次数 + private Integer count; + + // 备注描述 + private String content; + + // 添加时间 + private Integer addTime; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitDto.java deleted file mode 100644 index d4118db6..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitDto.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.activity.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Data -public class YxStoreVisitDto implements Serializable { - - private Integer id; - - /** 产品ID */ - private Integer productId; - - /** 产品类型 */ - private String productType; - - /** 产品分类ID */ - private Integer cateId; - - /** 产品类型 */ - private String type; - - /** 用户ID */ - private Integer uid; - - /** 访问次数 */ - private Integer count; - - /** 备注描述 */ - private String content; - - /** 添加时间 */ - private Integer addTime; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitQueryCriteria.java index d4c1474e..1e9cbbca 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxStoreVisitQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ @Data public class YxStoreVisitQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractDto.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractDTO.java similarity index 66% rename from yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractDTO.java index d1325f43..9673fed8 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractDTO.java @@ -1,24 +1,17 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; import lombok.Data; -import java.math.BigDecimal; + import java.io.Serializable; +import java.math.BigDecimal; + /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-14 */ @Data -public class YxUserExtractDto implements Serializable { - +public class YxUserExtractDTO implements Serializable { private Integer id; @@ -59,4 +52,4 @@ public class YxUserExtractDto implements Serializable { // 微信号 private String wechat; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractQueryCriteria.java index 47644ea4..eab781af 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/dto/YxUserExtractQueryCriteria.java @@ -1,26 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-14 */ @Data public class YxUserExtractQueryCriteria{ - // 模糊 @Query(type = Query.Type.INNER_LIKE) private String realName; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java index 37e35e37..52449d23 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreBargainServiceImpl.java @@ -1,114 +1,78 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStoreBargain; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxStoreBargainRepository; import co.yixiang.modules.activity.service.YxStoreBargainService; -import co.yixiang.modules.activity.service.dto.YxStoreBargainDto; +import co.yixiang.modules.activity.service.dto.YxStoreBargainDTO; import co.yixiang.modules.activity.service.dto.YxStoreBargainQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreBargainMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-22 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreBargain") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreBargainServiceImpl extends BaseServiceImpl implements YxStoreBargainService { +public class YxStoreBargainServiceImpl implements YxStoreBargainService { - private final IGenerator generator; + private final YxStoreBargainRepository yxStoreBargainRepository; - @Override - //@Cacheable - public Map queryAll(YxStoreBargainQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreBargainDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxStoreBargainMapper yxStoreBargainMapper; + + public YxStoreBargainServiceImpl(YxStoreBargainRepository yxStoreBargainRepository, YxStoreBargainMapper yxStoreBargainMapper) { + this.yxStoreBargainRepository = yxStoreBargainRepository; + this.yxStoreBargainMapper = yxStoreBargainMapper; } - @Override - //@Cacheable - public List queryAll(YxStoreBargainQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreBargain.class, criteria)); + public Map queryAll(YxStoreBargainQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreBargainRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxStoreBargainMapper::toDto)); } + @Override + public List queryAll(YxStoreBargainQueryCriteria criteria){ + return yxStoreBargainMapper.toDto(yxStoreBargainRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreBargainDto yxStoreBargain : all) { - Map map = new LinkedHashMap<>(); - map.put("关联产品ID", yxStoreBargain.getProductId()); - map.put("砍价活动名称", yxStoreBargain.getTitle()); - map.put("砍价活动图片", yxStoreBargain.getImage()); - map.put("单位名称", yxStoreBargain.getUnitName()); - map.put("库存", yxStoreBargain.getStock()); - map.put("销量", yxStoreBargain.getSales()); - map.put("砍价产品轮播图", yxStoreBargain.getImages()); - map.put("砍价开启时间", yxStoreBargain.getStartTime()); - map.put("砍价结束时间", yxStoreBargain.getStopTime()); - map.put("砍价产品名称", yxStoreBargain.getStoreName()); - map.put("砍价金额", yxStoreBargain.getPrice()); - map.put("砍价商品最低价", yxStoreBargain.getMinPrice()); - map.put("每次购买的砍价产品数量", yxStoreBargain.getNum()); - map.put("用户每次砍价的最大金额", yxStoreBargain.getBargainMaxPrice()); - map.put("用户每次砍价的最小金额", yxStoreBargain.getBargainMinPrice()); - map.put("用户每次砍价的次数", yxStoreBargain.getBargainNum()); - map.put("砍价状态 0(到砍价时间不自动开启) 1(到砍价时间自动开启时间)", yxStoreBargain.getStatus()); - map.put("砍价详情", yxStoreBargain.getDescription()); - map.put("反多少积分", yxStoreBargain.getGiveIntegral()); - map.put("砍价活动简介", yxStoreBargain.getInfo()); - map.put("成本价", yxStoreBargain.getCost()); - map.put("排序", yxStoreBargain.getSort()); - map.put("是否推荐0不推荐1推荐", yxStoreBargain.getIsHot()); - map.put("是否删除 0未删除 1删除", yxStoreBargain.getIsDel()); - map.put("添加时间", yxStoreBargain.getAddTime()); - map.put("是否包邮 0不包邮 1包邮", yxStoreBargain.getIsPostage()); - map.put("邮费", yxStoreBargain.getPostage()); - map.put("砍价规则", yxStoreBargain.getRule()); - map.put("砍价产品浏览量", yxStoreBargain.getLook()); - map.put("砍价产品分享量", yxStoreBargain.getShare()); - map.put(" endTimeDate", yxStoreBargain.getEndTimeDate()); - map.put(" startTimeDate", yxStoreBargain.getStartTimeDate()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxStoreBargainDTO findById(Integer id) { + Optional yxStoreBargain = yxStoreBargainRepository.findById(id); + ValidationUtil.isNull(yxStoreBargain,"YxStoreBargain","id",id); + return yxStoreBargainMapper.toDto(yxStoreBargain.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreBargainDTO create(YxStoreBargain resources) { + return yxStoreBargainMapper.toDto(yxStoreBargainRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreBargain resources) { + Optional optionalYxStoreBargain = yxStoreBargainRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreBargain,"YxStoreBargain","id",resources.getId()); + YxStoreBargain yxStoreBargain = optionalYxStoreBargain.get(); + yxStoreBargain.copy(resources); + yxStoreBargainRepository.save(yxStoreBargain); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreBargainRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java index 2f84d9eb..d6a02023 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCombinationServiceImpl.java @@ -1,140 +1,121 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStoreCombination; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.modules.activity.domain.YxStorePink; -import co.yixiang.modules.activity.domain.YxStoreVisit; -import co.yixiang.modules.activity.service.mapper.YxStorePinkMapper; -import co.yixiang.modules.activity.service.mapper.YxStoreVisitMapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxStoreCombinationRepository; +import co.yixiang.modules.activity.repository.YxStorePinkRepository; +import co.yixiang.modules.activity.repository.YxStoreVisitRepository; import co.yixiang.modules.activity.service.YxStoreCombinationService; -import co.yixiang.modules.activity.service.dto.YxStoreCombinationDto; +import co.yixiang.modules.activity.service.dto.YxStoreCombinationDTO; import co.yixiang.modules.activity.service.dto.YxStoreCombinationQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreCombinationMapper; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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.LinkedHashMap; import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreCombination") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreCombinationServiceImpl extends BaseServiceImpl implements YxStoreCombinationService { +public class YxStoreCombinationServiceImpl implements YxStoreCombinationService { + + private final YxStoreCombinationRepository yxStoreCombinationRepository; + private final YxStorePinkRepository storePinkRepository; + private final YxStoreVisitRepository storeVisitRepository; + + private final YxStoreCombinationMapper yxStoreCombinationMapper; + + public YxStoreCombinationServiceImpl(YxStoreCombinationRepository yxStoreCombinationRepository, YxStorePinkRepository storePinkRepository, + YxStoreVisitRepository storeVisitRepository, YxStoreCombinationMapper yxStoreCombinationMapper) { + this.yxStoreCombinationRepository = yxStoreCombinationRepository; + this.storePinkRepository = storePinkRepository; + this.storeVisitRepository = storeVisitRepository; + this.yxStoreCombinationMapper = yxStoreCombinationMapper; + } - private final IGenerator generator; - private final YxStorePinkMapper yxStorePinkMapper; - private final YxStoreVisitMapper yxStoreVisitMapper; @Override - //@Cacheable - public Map queryAll(YxStoreCombinationQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - - List combinationDTOS = generator.convert(page.getList(),YxStoreCombinationDto.class); - for (YxStoreCombinationDto combinationDTO : combinationDTOS) { + public Map queryAll(YxStoreCombinationQueryCriteria criteria, Pageable pageable){ + criteria.setIsDel(0); + Page page = yxStoreCombinationRepository + .findAll((root, criteriaQuery, criteriaBuilder) + -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + List combinationDTOS = yxStoreCombinationMapper + .toDto(page.getContent()); + for (YxStoreCombinationDTO combinationDTO : combinationDTOS) { //参与人数 - combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new QueryWrapper().eq("cid",combinationDTO.getId()))); + combinationDTO.setCountPeopleAll(storePinkRepository + .countByCid(combinationDTO.getId())); //成团人数 - combinationDTO.setCountPeoplePink(yxStorePinkMapper.selectCount(new QueryWrapper().eq("cid",combinationDTO.getId()).eq("k_id",0))); + combinationDTO.setCountPeoplePink(storePinkRepository.countByCidAndKId(combinationDTO.getId(), + 0)); //获取查看拼团产品人数 - combinationDTO.setCountPeopleBrowse(yxStoreVisitMapper.selectCount(new QueryWrapper().eq("product_id",combinationDTO.getId()) - .eq("product_type","combination"))); + combinationDTO.setCountPeopleBrowse(storeVisitRepository + .countByProductIdAndProductType(combinationDTO.getId(),"combination")); + + //System.out.println(combinationDTO); + } - Map map = new LinkedHashMap<>(2); + Map map = new LinkedHashMap<>(2); map.put("content",combinationDTOS); - map.put("totalElements", page.getTotal()); + map.put("totalElements",page.getTotalElements()); + return map; - } - - - @Override - //@Cacheable - public List queryAll(YxStoreCombinationQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreCombination.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreCombinationDto yxStoreCombination : all) { - Map map = new LinkedHashMap<>(); - map.put("商品id", yxStoreCombination.getProductId()); - map.put("商户id", yxStoreCombination.getMerId()); - map.put("推荐图", yxStoreCombination.getImage()); - map.put("轮播图", yxStoreCombination.getImages()); - map.put("活动标题", yxStoreCombination.getTitle()); - map.put("活动属性", yxStoreCombination.getAttr()); - map.put("参团人数", yxStoreCombination.getPeople()); - map.put("简介", yxStoreCombination.getInfo()); - map.put("价格", yxStoreCombination.getPrice()); - map.put("排序", yxStoreCombination.getSort()); - map.put("销量", yxStoreCombination.getSales()); - map.put("库存", yxStoreCombination.getStock()); - map.put("添加时间", yxStoreCombination.getAddTime()); - map.put("推荐", yxStoreCombination.getIsHost()); - map.put("产品状态", yxStoreCombination.getIsShow()); - map.put(" isDel", yxStoreCombination.getIsDel()); - map.put(" combination", yxStoreCombination.getCombination()); - map.put("商户是否可用1可用0不可用", yxStoreCombination.getMerUse()); - map.put("是否包邮1是0否", yxStoreCombination.getIsPostage()); - map.put("邮费", yxStoreCombination.getPostage()); - map.put("拼团内容", yxStoreCombination.getDescription()); - map.put("拼团开始时间", yxStoreCombination.getStartTime()); - map.put("拼团结束时间", yxStoreCombination.getStopTime()); - map.put("拼团订单有效时间", yxStoreCombination.getEffectiveTime()); - map.put("拼图产品成本", yxStoreCombination.getCost()); - map.put("浏览量", yxStoreCombination.getBrowse()); - map.put("单位名", yxStoreCombination.getUnitName()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + //return PageUtil.toPage(page.map(yxStoreCombinationMapper::toDto)); } @Override - public void onSale(Integer id, int status) { + @Transactional(rollbackFor = Exception.class) + public void onSale(Integer id, Integer status) { if(status == 1){ status = 0; }else{ status = 1; } - YxStoreCombination yxStoreCombination = new YxStoreCombination(); - yxStoreCombination.setIsShow(status); - yxStoreCombination.setId(id); - this.saveOrUpdate(yxStoreCombination); + yxStoreCombinationRepository.updateOnsale(status,id); } -} + + @Override + public List queryAll(YxStoreCombinationQueryCriteria criteria){ + return yxStoreCombinationMapper.toDto(yxStoreCombinationRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public YxStoreCombinationDTO findById(Integer id) { + Optional yxStoreCombination = yxStoreCombinationRepository.findById(id); + ValidationUtil.isNull(yxStoreCombination,"YxStoreCombination","id",id); + return yxStoreCombinationMapper.toDto(yxStoreCombination.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreCombinationDTO create(YxStoreCombination resources) { + return yxStoreCombinationMapper.toDto(yxStoreCombinationRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreCombination resources) { + Optional optionalYxStoreCombination = yxStoreCombinationRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreCombination,"YxStoreCombination","id",resources.getId()); + YxStoreCombination yxStoreCombination = optionalYxStoreCombination.get(); + yxStoreCombination.copy(resources); + yxStoreCombinationRepository.save(yxStoreCombination); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreCombinationRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueServiceImpl.java index a9c7dbb9..fe48674b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueServiceImpl.java @@ -1,94 +1,78 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStoreCouponIssue; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxStoreCouponIssueRepository; import co.yixiang.modules.activity.service.YxStoreCouponIssueService; -import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueDto; +import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueDTO; import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreCouponIssueMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreCouponIssue") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreCouponIssueServiceImpl extends BaseServiceImpl implements YxStoreCouponIssueService { +public class YxStoreCouponIssueServiceImpl implements YxStoreCouponIssueService { - private final IGenerator generator; + private final YxStoreCouponIssueRepository yxStoreCouponIssueRepository; - @Override - //@Cacheable - public Map queryAll(YxStoreCouponIssueQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreCouponIssueDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxStoreCouponIssueMapper yxStoreCouponIssueMapper; + + public YxStoreCouponIssueServiceImpl(YxStoreCouponIssueRepository yxStoreCouponIssueRepository, YxStoreCouponIssueMapper yxStoreCouponIssueMapper) { + this.yxStoreCouponIssueRepository = yxStoreCouponIssueRepository; + this.yxStoreCouponIssueMapper = yxStoreCouponIssueMapper; } - @Override - //@Cacheable - public List queryAll(YxStoreCouponIssueQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreCouponIssue.class, criteria)); + public Map queryAll(YxStoreCouponIssueQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreCouponIssueRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxStoreCouponIssueMapper::toDto)); } + @Override + public List queryAll(YxStoreCouponIssueQueryCriteria criteria){ + return yxStoreCouponIssueMapper.toDto(yxStoreCouponIssueRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreCouponIssueDto yxStoreCouponIssue : all) { - Map map = new LinkedHashMap<>(); - map.put(" cname", yxStoreCouponIssue.getCname()); - map.put("优惠券ID", yxStoreCouponIssue.getCid()); - map.put("优惠券领取开启时间", yxStoreCouponIssue.getStartTime()); - map.put("优惠券领取结束时间", yxStoreCouponIssue.getEndTime()); - map.put("优惠券领取数量", yxStoreCouponIssue.getTotalCount()); - map.put("优惠券剩余领取数量", yxStoreCouponIssue.getRemainCount()); - map.put("是否无限张数", yxStoreCouponIssue.getIsPermanent()); - map.put("1 正常 0 未开启 -1 已无效", yxStoreCouponIssue.getStatus()); - map.put(" isDel", yxStoreCouponIssue.getIsDel()); - map.put("优惠券添加时间", yxStoreCouponIssue.getAddTime()); - map.put(" endTimeDate", yxStoreCouponIssue.getEndTimeDate()); - map.put(" startTimeDate", yxStoreCouponIssue.getStartTimeDate()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxStoreCouponIssueDTO findById(Integer id) { + Optional yxStoreCouponIssue = yxStoreCouponIssueRepository.findById(id); + ValidationUtil.isNull(yxStoreCouponIssue,"YxStoreCouponIssue","id",id); + return yxStoreCouponIssueMapper.toDto(yxStoreCouponIssue.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreCouponIssueDTO create(YxStoreCouponIssue resources) { + return yxStoreCouponIssueMapper.toDto(yxStoreCouponIssueRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreCouponIssue resources) { + Optional optionalYxStoreCouponIssue = yxStoreCouponIssueRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreCouponIssue,"YxStoreCouponIssue","id",resources.getId()); + YxStoreCouponIssue yxStoreCouponIssue = optionalYxStoreCouponIssue.get(); + yxStoreCouponIssue.copy(resources); + yxStoreCouponIssueRepository.save(yxStoreCouponIssue); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreCouponIssueRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueUserServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueUserServiceImpl.java index 4a5664fd..31d52535 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueUserServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueUserServiceImpl.java @@ -1,85 +1,78 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStoreCouponIssueUser; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxStoreCouponIssueUserRepository; import co.yixiang.modules.activity.service.YxStoreCouponIssueUserService; -import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserDto; +import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserDTO; import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreCouponIssueUserMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreCouponIssueUser") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreCouponIssueUserServiceImpl extends BaseServiceImpl implements YxStoreCouponIssueUserService { +public class YxStoreCouponIssueUserServiceImpl implements YxStoreCouponIssueUserService { - private final IGenerator generator; + private final YxStoreCouponIssueUserRepository yxStoreCouponIssueUserRepository; - @Override - //@Cacheable - public Map queryAll(YxStoreCouponIssueUserQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreCouponIssueUserDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxStoreCouponIssueUserMapper yxStoreCouponIssueUserMapper; + + public YxStoreCouponIssueUserServiceImpl(YxStoreCouponIssueUserRepository yxStoreCouponIssueUserRepository, YxStoreCouponIssueUserMapper yxStoreCouponIssueUserMapper) { + this.yxStoreCouponIssueUserRepository = yxStoreCouponIssueUserRepository; + this.yxStoreCouponIssueUserMapper = yxStoreCouponIssueUserMapper; } - @Override - //@Cacheable - public List queryAll(YxStoreCouponIssueUserQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreCouponIssueUser.class, criteria)); + public Map queryAll(YxStoreCouponIssueUserQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreCouponIssueUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxStoreCouponIssueUserMapper::toDto)); } + @Override + public List queryAll(YxStoreCouponIssueUserQueryCriteria criteria){ + return yxStoreCouponIssueUserMapper.toDto(yxStoreCouponIssueUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreCouponIssueUserDto yxStoreCouponIssueUser : all) { - Map map = new LinkedHashMap<>(); - map.put("领取优惠券用户ID", yxStoreCouponIssueUser.getUid()); - map.put("优惠券前台领取ID", yxStoreCouponIssueUser.getIssueCouponId()); - map.put("领取时间", yxStoreCouponIssueUser.getAddTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxStoreCouponIssueUserDTO findById(Integer id) { + Optional yxStoreCouponIssueUser = yxStoreCouponIssueUserRepository.findById(id); + ValidationUtil.isNull(yxStoreCouponIssueUser,"YxStoreCouponIssueUser","id",id); + return yxStoreCouponIssueUserMapper.toDto(yxStoreCouponIssueUser.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreCouponIssueUserDTO create(YxStoreCouponIssueUser resources) { + return yxStoreCouponIssueUserMapper.toDto(yxStoreCouponIssueUserRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreCouponIssueUser resources) { + Optional optionalYxStoreCouponIssueUser = yxStoreCouponIssueUserRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreCouponIssueUser,"YxStoreCouponIssueUser","id",resources.getId()); + YxStoreCouponIssueUser yxStoreCouponIssueUser = optionalYxStoreCouponIssueUser.get(); + yxStoreCouponIssueUser.copy(resources); + yxStoreCouponIssueUserRepository.save(yxStoreCouponIssueUser); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreCouponIssueUserRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponServiceImpl.java index e2bf822b..ff24f206 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponServiceImpl.java @@ -1,91 +1,78 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStoreCoupon; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxStoreCouponRepository; import co.yixiang.modules.activity.service.YxStoreCouponService; -import co.yixiang.modules.activity.service.dto.YxStoreCouponDto; +import co.yixiang.modules.activity.service.dto.YxStoreCouponDTO; import co.yixiang.modules.activity.service.dto.YxStoreCouponQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreCouponMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreCoupon") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreCouponServiceImpl extends BaseServiceImpl implements YxStoreCouponService { +public class YxStoreCouponServiceImpl implements YxStoreCouponService { - private final IGenerator generator; + private final YxStoreCouponRepository yxStoreCouponRepository; - @Override - //@Cacheable - public Map queryAll(YxStoreCouponQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreCouponDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxStoreCouponMapper yxStoreCouponMapper; + + public YxStoreCouponServiceImpl(YxStoreCouponRepository yxStoreCouponRepository, YxStoreCouponMapper yxStoreCouponMapper) { + this.yxStoreCouponRepository = yxStoreCouponRepository; + this.yxStoreCouponMapper = yxStoreCouponMapper; } - @Override - //@Cacheable - public List queryAll(YxStoreCouponQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreCoupon.class, criteria)); + public Map queryAll(YxStoreCouponQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreCouponRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxStoreCouponMapper::toDto)); } + @Override + public List queryAll(YxStoreCouponQueryCriteria criteria){ + return yxStoreCouponMapper.toDto(yxStoreCouponRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreCouponDto yxStoreCoupon : all) { - Map map = new LinkedHashMap<>(); - map.put("优惠券名称", yxStoreCoupon.getTitle()); - map.put("兑换消耗积分值", yxStoreCoupon.getIntegral()); - map.put("兑换的优惠券面值", yxStoreCoupon.getCouponPrice()); - map.put("最低消费多少金额可用优惠券", yxStoreCoupon.getUseMinPrice()); - map.put("优惠券有效期限(单位:天)", yxStoreCoupon.getCouponTime()); - map.put("排序", yxStoreCoupon.getSort()); - map.put("状态(0:关闭,1:开启)", yxStoreCoupon.getStatus()); - map.put("兑换项目添加时间", yxStoreCoupon.getAddTime()); - map.put("是否删除", yxStoreCoupon.getIsDel()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxStoreCouponDTO findById(Integer id) { + Optional yxStoreCoupon = yxStoreCouponRepository.findById(id); + ValidationUtil.isNull(yxStoreCoupon,"YxStoreCoupon","id",id); + return yxStoreCouponMapper.toDto(yxStoreCoupon.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreCouponDTO create(YxStoreCoupon resources) { + return yxStoreCouponMapper.toDto(yxStoreCouponRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreCoupon resources) { + Optional optionalYxStoreCoupon = yxStoreCouponRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreCoupon,"YxStoreCoupon","id",resources.getId()); + YxStoreCoupon yxStoreCoupon = optionalYxStoreCoupon.get(); + yxStoreCoupon.copy(resources); + yxStoreCouponRepository.save(yxStoreCoupon); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreCouponRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java index e328c400..e6f46ab0 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java @@ -1,98 +1,95 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStoreCouponUser; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.modules.shop.domain.YxUser; -import co.yixiang.modules.shop.service.YxUserService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxStoreCouponUserRepository; import co.yixiang.modules.activity.service.YxStoreCouponUserService; -import co.yixiang.modules.activity.service.dto.YxStoreCouponUserDto; +import co.yixiang.modules.activity.service.dto.YxStoreCouponUserDTO; import co.yixiang.modules.activity.service.dto.YxStoreCouponUserQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreCouponUserMapper; +import co.yixiang.modules.shop.service.YxUserService; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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.LinkedHashMap; import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-10 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreCouponUser") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreCouponUserServiceImpl extends BaseServiceImpl implements YxStoreCouponUserService { +public class YxStoreCouponUserServiceImpl implements YxStoreCouponUserService { + + private final YxStoreCouponUserRepository yxStoreCouponUserRepository; + + private final YxStoreCouponUserMapper yxStoreCouponUserMapper; - private final IGenerator generator; private final YxUserService userService; + + public YxStoreCouponUserServiceImpl(YxStoreCouponUserRepository yxStoreCouponUserRepository, YxStoreCouponUserMapper yxStoreCouponUserMapper, YxUserService userService) { + this.yxStoreCouponUserRepository = yxStoreCouponUserRepository; + this.yxStoreCouponUserMapper = yxStoreCouponUserMapper; + this.userService = userService; + } + @Override - //@Cacheable - public Map queryAll(YxStoreCouponUserQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - List storeOrderDTOS = generator.convert(page.getList(),YxStoreCouponUserDto.class); - for (YxStoreCouponUserDto couponUserDTO : storeOrderDTOS) { - couponUserDTO.setNickname(userService.getOne(new QueryWrapper().eq("uid",couponUserDTO.getUid())).getNickname()); + public Map queryAll(YxStoreCouponUserQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreCouponUserRepository. + findAll((root, criteriaQuery, criteriaBuilder) + -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + //List storeOrderDTOS = new ArrayList<>(); + List storeOrderDTOS = yxStoreCouponUserMapper + .toDto(page.getContent()); + for (YxStoreCouponUserDTO couponUserDTO : storeOrderDTOS) { + couponUserDTO.setNickname(userService.findById(couponUserDTO.getUid()).getNickname()); } Map map = new LinkedHashMap<>(2); map.put("content",storeOrderDTOS); - map.put("totalElements", page.getTotal()); + map.put("totalElements",page.getTotalElements()); + return map; + //return PageUtil.toPage(page.map(yxStoreCouponUserMapper::toDto)); } + @Override + public List queryAll(YxStoreCouponUserQueryCriteria criteria){ + return yxStoreCouponUserMapper.toDto(yxStoreCouponUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - //@Cacheable - public List queryAll(YxStoreCouponUserQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreCouponUser.class, criteria)); + public YxStoreCouponUserDTO findById(Integer id) { + Optional yxStoreCouponUser = yxStoreCouponUserRepository.findById(id); + ValidationUtil.isNull(yxStoreCouponUser,"YxStoreCouponUser","id",id); + return yxStoreCouponUserMapper.toDto(yxStoreCouponUser.get()); } + @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreCouponUserDto yxStoreCouponUser : all) { - Map map = new LinkedHashMap<>(); - map.put("兑换的项目id", yxStoreCouponUser.getCid()); - map.put("优惠券所属用户", yxStoreCouponUser.getUid()); - map.put("优惠券名称", yxStoreCouponUser.getCouponTitle()); - map.put("优惠券的面值", yxStoreCouponUser.getCouponPrice()); - map.put("最低消费多少金额可用优惠券", yxStoreCouponUser.getUseMinPrice()); - map.put("优惠券创建时间", yxStoreCouponUser.getAddTime()); - map.put("优惠券结束时间", yxStoreCouponUser.getEndTime()); - map.put("使用时间", yxStoreCouponUser.getUseTime()); - map.put("获取方式", yxStoreCouponUser.getType()); - map.put("状态(0:未使用,1:已使用, 2:已过期)", yxStoreCouponUser.getStatus()); - map.put("是否有效", yxStoreCouponUser.getIsFail()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + @Transactional(rollbackFor = Exception.class) + public YxStoreCouponUserDTO create(YxStoreCouponUser resources) { + return yxStoreCouponUserMapper.toDto(yxStoreCouponUserRepository.save(resources)); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreCouponUser resources) { + Optional optionalYxStoreCouponUser = yxStoreCouponUserRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreCouponUser,"YxStoreCouponUser","id",resources.getId()); + YxStoreCouponUser yxStoreCouponUser = optionalYxStoreCouponUser.get(); + yxStoreCouponUser.copy(resources); + yxStoreCouponUserRepository.save(yxStoreCouponUser); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreCouponUserRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStorePinkServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStorePinkServiceImpl.java index 325788a5..3dd53567 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStorePinkServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStorePinkServiceImpl.java @@ -1,97 +1,116 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStorePink; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxStorePinkRepository; +import co.yixiang.modules.activity.service.YxStoreCombinationService; import co.yixiang.modules.activity.service.YxStorePinkService; -import co.yixiang.modules.activity.service.dto.YxStorePinkDto; +import co.yixiang.modules.activity.service.dto.YxStoreCombinationDTO; +import co.yixiang.modules.activity.service.dto.YxStorePinkDTO; import co.yixiang.modules.activity.service.dto.YxStorePinkQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStorePinkMapper; +import co.yixiang.modules.shop.service.YxUserService; +import co.yixiang.modules.shop.service.dto.YxUserDTO; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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.LinkedHashMap; import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-18 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStorePink") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStorePinkServiceImpl extends BaseServiceImpl implements YxStorePinkService { +public class YxStorePinkServiceImpl implements YxStorePinkService { - private final IGenerator generator; + private final YxStorePinkRepository yxStorePinkRepository; + + private final YxStoreCombinationService combinationService; + private final YxUserService userService; + + private final YxStorePinkMapper yxStorePinkMapper; + + public YxStorePinkServiceImpl(YxStorePinkRepository yxStorePinkRepository, YxStoreCombinationService combinationService, + YxUserService userService, YxStorePinkMapper yxStorePinkMapper) { + this.yxStorePinkRepository = yxStorePinkRepository; + this.combinationService = combinationService; + this.userService = userService; + this.yxStorePinkMapper = yxStorePinkMapper; + } + + /** + * 参与拼团的人 + * @param id id + * @return + */ + @Override + public int countPeople(int id) { + return yxStorePinkRepository.countByKId(id) + 1; + } @Override - //@Cacheable - public Map queryAll(YxStorePinkQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStorePinkDto.class)); - map.put("totalElements", page.getTotal()); + public Map queryAll(YxStorePinkQueryCriteria criteria, Pageable pageable){ + criteria.setKId(0); + Page page = yxStorePinkRepository + .findAll((root, criteriaQuery, criteriaBuilder) + -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + List storePinkDTOS = yxStorePinkMapper.toDto(page.getContent()); + for (YxStorePinkDTO storePinkDTO : storePinkDTOS) { + YxStoreCombinationDTO combinationDTO = combinationService + .findById(storePinkDTO.getCid()); + YxUserDTO userDTO = userService.findById(storePinkDTO.getUid()); + + storePinkDTO.setAvatar(userDTO.getAvatar()); + storePinkDTO.setNickname(userDTO.getNickname()); + storePinkDTO.setTitle(combinationDTO.getTitle()); + storePinkDTO.setCountPeople(countPeople(storePinkDTO.getId())); + } + Map map = new LinkedHashMap<>(2); + map.put("content",storePinkDTOS); + map.put("totalElements",page.getTotalElements()); + return map; } - @Override - //@Cacheable - public List queryAll(YxStorePinkQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStorePink.class, criteria)); + public List queryAll(YxStorePinkQueryCriteria criteria){ + return yxStorePinkMapper.toDto(yxStorePinkRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } + @Override + public YxStorePinkDTO findById(Integer id) { + Optional yxStorePink = yxStorePinkRepository.findById(id); + ValidationUtil.isNull(yxStorePink,"YxStorePink","id",id); + return yxStorePinkMapper.toDto(yxStorePink.get()); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStorePinkDto yxStorePink : all) { - Map map = new LinkedHashMap<>(); - map.put("用户id", yxStorePink.getUid()); - map.put("订单id 生成", yxStorePink.getOrderId()); - map.put("订单id 数据库", yxStorePink.getOrderIdKey()); - map.put("购买商品个数", yxStorePink.getTotalNum()); - map.put("购买总金额", yxStorePink.getTotalPrice()); - map.put("拼团产品id", yxStorePink.getCid()); - map.put("产品id", yxStorePink.getPid()); - map.put("拼图总人数", yxStorePink.getPeople()); - map.put("拼团产品单价", yxStorePink.getPrice()); - map.put("开始时间", yxStorePink.getAddTime()); - map.put(" stopTime", yxStorePink.getStopTime()); - map.put("团长id 0为团长", yxStorePink.getKId()); - map.put("是否发送模板消息0未发送1已发送", yxStorePink.getIsTpl()); - map.put("是否退款 0未退款 1已退款", yxStorePink.getIsRefund()); - map.put("状态1进行中2已完成3未完成", yxStorePink.getStatus()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + @Transactional(rollbackFor = Exception.class) + public YxStorePinkDTO create(YxStorePink resources) { + return yxStorePinkMapper.toDto(yxStorePinkRepository.save(resources)); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStorePink resources) { + Optional optionalYxStorePink = yxStorePinkRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStorePink,"YxStorePink","id",resources.getId()); + YxStorePink yxStorePink = optionalYxStorePink.get(); + yxStorePink.copy(resources); + yxStorePinkRepository.save(yxStorePink); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStorePinkRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java index 77f73a7c..7b2bddc1 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java @@ -1,62 +1,50 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStoreSeckill; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.utils.*; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; +import co.yixiang.modules.activity.repository.YxStoreSeckillRepository; import co.yixiang.modules.activity.service.YxStoreSeckillService; -import co.yixiang.modules.activity.service.dto.YxStoreSeckillDto; +import co.yixiang.modules.activity.service.dto.YxStoreSeckillDTO; import co.yixiang.modules.activity.service.dto.YxStoreSeckillQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreSeckillMapper; +import co.yixiang.utils.OrderUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-14 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreSeckill") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreSeckillServiceImpl extends BaseServiceImpl implements YxStoreSeckillService { +public class YxStoreSeckillServiceImpl implements YxStoreSeckillService { - private final IGenerator generator; + private final YxStoreSeckillRepository yxStoreSeckillRepository; + + private final YxStoreSeckillMapper yxStoreSeckillMapper; + + public YxStoreSeckillServiceImpl(YxStoreSeckillRepository yxStoreSeckillRepository, YxStoreSeckillMapper yxStoreSeckillMapper) { + this.yxStoreSeckillRepository = yxStoreSeckillRepository; + this.yxStoreSeckillMapper = yxStoreSeckillMapper; + } @Override - //@Cacheable - public Map queryAll(YxStoreSeckillQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - List storeSeckillDTOS = generator.convert(page.getList(),YxStoreSeckillDto.class); + public Map queryAll(YxStoreSeckillQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreSeckillRepository.findAll((root, criteriaQuery, criteriaBuilder) -> + QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + List storeSeckillDTOS = yxStoreSeckillMapper + .toDto(page.getContent()); int nowTime = OrderUtil.getSecondTimestampTwo(); - for (YxStoreSeckillDto storeSeckillDTO : storeSeckillDTOS){ + for (YxStoreSeckillDTO storeSeckillDTO : storeSeckillDTOS){ if(storeSeckillDTO.getStatus() > 0){ if(storeSeckillDTO.getStartTime() > nowTime){ storeSeckillDTO.setStatusStr("活动未开始"); @@ -72,52 +60,42 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl map = new LinkedHashMap<>(2); map.put("content",storeSeckillDTOS); - map.put("totalElements", page.getTotal()); + map.put("totalElements",page.getTotalElements()); + return map; } - @Override - //@Cacheable - public List queryAll(YxStoreSeckillQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreSeckill.class, criteria)); + public List queryAll(YxStoreSeckillQueryCriteria criteria){ + return yxStoreSeckillMapper.toDto(yxStoreSeckillRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } + @Override + public YxStoreSeckillDTO findById(Integer id) { + Optional yxStoreSeckill = yxStoreSeckillRepository.findById(id); + ValidationUtil.isNull(yxStoreSeckill,"YxStoreSeckill","id",id); + return yxStoreSeckillMapper.toDto(yxStoreSeckill.get()); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreSeckillDto yxStoreSeckill : all) { - Map map = new LinkedHashMap<>(); - map.put("商品id", yxStoreSeckill.getProductId()); - map.put("推荐图", yxStoreSeckill.getImage()); - map.put("轮播图", yxStoreSeckill.getImages()); - map.put("活动标题", yxStoreSeckill.getTitle()); - map.put("简介", yxStoreSeckill.getInfo()); - map.put("价格", yxStoreSeckill.getPrice()); - map.put("成本", yxStoreSeckill.getCost()); - map.put("原价", yxStoreSeckill.getOtPrice()); - map.put("返多少积分", yxStoreSeckill.getGiveIntegral()); - map.put("排序", yxStoreSeckill.getSort()); - map.put("库存", yxStoreSeckill.getStock()); - map.put("销量", yxStoreSeckill.getSales()); - map.put("单位名", yxStoreSeckill.getUnitName()); - map.put("邮费", yxStoreSeckill.getPostage()); - map.put("内容", yxStoreSeckill.getDescription()); - map.put("开始时间", yxStoreSeckill.getStartTime()); - map.put("结束时间", yxStoreSeckill.getStopTime()); - map.put("添加时间", yxStoreSeckill.getAddTime()); - map.put("产品状态", yxStoreSeckill.getStatus()); - map.put("是否包邮", yxStoreSeckill.getIsPostage()); - map.put("热门推荐", yxStoreSeckill.getIsHot()); - map.put("删除 0未删除1已删除", yxStoreSeckill.getIsDel()); - map.put("最多秒杀几个", yxStoreSeckill.getNum()); - map.put("显示", yxStoreSeckill.getIsShow()); - map.put(" endTimeDate", yxStoreSeckill.getEndTimeDate()); - map.put(" startTimeDate", yxStoreSeckill.getStartTimeDate()); - map.put("时间段id", yxStoreSeckill.getTimeId()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + @Transactional(rollbackFor = Exception.class) + public YxStoreSeckillDTO create(YxStoreSeckill resources) { + return yxStoreSeckillMapper.toDto(yxStoreSeckillRepository.save(resources)); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreSeckill resources) { + Optional optionalYxStoreSeckill = yxStoreSeckillRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreSeckill,"YxStoreSeckill","id",resources.getId()); + YxStoreSeckill yxStoreSeckill = optionalYxStoreSeckill.get(); + yxStoreSeckill.copy(resources); + yxStoreSeckillRepository.save(yxStoreSeckill); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreSeckillRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreVisitServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreVisitServiceImpl.java index f1e61613..04fef21f 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreVisitServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreVisitServiceImpl.java @@ -1,90 +1,78 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxStoreVisit; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxStoreVisitRepository; import co.yixiang.modules.activity.service.YxStoreVisitService; -import co.yixiang.modules.activity.service.dto.YxStoreVisitDto; +import co.yixiang.modules.activity.service.dto.YxStoreVisitDTO; import co.yixiang.modules.activity.service.dto.YxStoreVisitQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreVisitMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreVisit") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreVisitServiceImpl extends BaseServiceImpl implements YxStoreVisitService { +public class YxStoreVisitServiceImpl implements YxStoreVisitService { - private final IGenerator generator; + private final YxStoreVisitRepository yxStoreVisitRepository; - @Override - //@Cacheable - public Map queryAll(YxStoreVisitQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreVisitDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxStoreVisitMapper yxStoreVisitMapper; + + public YxStoreVisitServiceImpl(YxStoreVisitRepository yxStoreVisitRepository, YxStoreVisitMapper yxStoreVisitMapper) { + this.yxStoreVisitRepository = yxStoreVisitRepository; + this.yxStoreVisitMapper = yxStoreVisitMapper; } - @Override - //@Cacheable - public List queryAll(YxStoreVisitQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreVisit.class, criteria)); + public Map queryAll(YxStoreVisitQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreVisitRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxStoreVisitMapper::toDto)); } + @Override + public List queryAll(YxStoreVisitQueryCriteria criteria){ + return yxStoreVisitMapper.toDto(yxStoreVisitRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreVisitDto yxStoreVisit : all) { - Map map = new LinkedHashMap<>(); - map.put("产品ID", yxStoreVisit.getProductId()); - map.put("产品类型", yxStoreVisit.getProductType()); - map.put("产品分类ID", yxStoreVisit.getCateId()); - map.put("产品类型", yxStoreVisit.getType()); - map.put("用户ID", yxStoreVisit.getUid()); - map.put("访问次数", yxStoreVisit.getCount()); - map.put("备注描述", yxStoreVisit.getContent()); - map.put("添加时间", yxStoreVisit.getAddTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxStoreVisitDTO findById(Integer id) { + Optional yxStoreVisit = yxStoreVisitRepository.findById(id); + ValidationUtil.isNull(yxStoreVisit,"YxStoreVisit","id",id); + return yxStoreVisitMapper.toDto(yxStoreVisit.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreVisitDTO create(YxStoreVisit resources) { + return yxStoreVisitMapper.toDto(yxStoreVisitRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreVisit resources) { + Optional optionalYxStoreVisit = yxStoreVisitRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxStoreVisit,"YxStoreVisit","id",resources.getId()); + YxStoreVisit yxStoreVisit = optionalYxStoreVisit.get(); + yxStoreVisit.copy(resources); + yxStoreVisitRepository.save(yxStoreVisit); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxStoreVisitRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxUserExtractServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxUserExtractServiceImpl.java index 5b8b1afa..f703c10b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxUserExtractServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/impl/YxUserExtractServiceImpl.java @@ -1,96 +1,78 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.impl; import co.yixiang.modules.activity.domain.YxUserExtract; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.activity.repository.YxUserExtractRepository; import co.yixiang.modules.activity.service.YxUserExtractService; -import co.yixiang.modules.activity.service.dto.YxUserExtractDto; +import co.yixiang.modules.activity.service.dto.YxUserExtractDTO; import co.yixiang.modules.activity.service.dto.YxUserExtractQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxUserExtractMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-14 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxUserExtract") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxUserExtractServiceImpl extends BaseServiceImpl implements YxUserExtractService { +public class YxUserExtractServiceImpl implements YxUserExtractService { - private final IGenerator generator; + private final YxUserExtractRepository yxUserExtractRepository; - @Override - //@Cacheable - public Map queryAll(YxUserExtractQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxUserExtractDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxUserExtractMapper yxUserExtractMapper; + + public YxUserExtractServiceImpl(YxUserExtractRepository yxUserExtractRepository, YxUserExtractMapper yxUserExtractMapper) { + this.yxUserExtractRepository = yxUserExtractRepository; + this.yxUserExtractMapper = yxUserExtractMapper; } - @Override - //@Cacheable - public List queryAll(YxUserExtractQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxUserExtract.class, criteria)); + public Map queryAll(YxUserExtractQueryCriteria criteria, Pageable pageable){ + Page page = yxUserExtractRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxUserExtractMapper::toDto)); } + @Override + public List queryAll(YxUserExtractQueryCriteria criteria){ + return yxUserExtractMapper.toDto(yxUserExtractRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxUserExtractDto yxUserExtract : all) { - Map map = new LinkedHashMap<>(); - map.put(" uid", yxUserExtract.getUid()); - map.put("名称", yxUserExtract.getRealName()); - map.put("bank = 银行卡 alipay = 支付宝wx=微信", yxUserExtract.getExtractType()); - map.put("银行卡", yxUserExtract.getBankCode()); - map.put("开户地址", yxUserExtract.getBankAddress()); - map.put("支付宝账号", yxUserExtract.getAlipayCode()); - map.put("提现金额", yxUserExtract.getExtractPrice()); - map.put(" mark", yxUserExtract.getMark()); - map.put(" balance", yxUserExtract.getBalance()); - map.put("无效原因", yxUserExtract.getFailMsg()); - map.put(" failTime", yxUserExtract.getFailTime()); - map.put("添加时间", yxUserExtract.getAddTime()); - map.put("-1 未通过 0 审核中 1 已提现", yxUserExtract.getStatus()); - map.put("微信号", yxUserExtract.getWechat()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxUserExtractDTO findById(Integer id) { + Optional yxUserExtract = yxUserExtractRepository.findById(id); + ValidationUtil.isNull(yxUserExtract,"YxUserExtract","id",id); + return yxUserExtractMapper.toDto(yxUserExtract.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxUserExtractDTO create(YxUserExtract resources) { + return yxUserExtractMapper.toDto(yxUserExtractRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxUserExtract resources) { + Optional optionalYxUserExtract = yxUserExtractRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxUserExtract,"YxUserExtract","id",resources.getId()); + YxUserExtract yxUserExtract = optionalYxUserExtract.get(); + yxUserExtract.copy(resources); + yxUserExtractRepository.save(yxUserExtract); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxUserExtractRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreBargainMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreBargainMapper.java index a0c2137e..ebc6baef 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreBargainMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreBargainMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStoreBargain; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStoreBargainDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-22 */ -@Repository -@Mapper -public interface YxStoreBargainMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreBargainMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCombinationMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCombinationMapper.java index 36e83a25..4afab560 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCombinationMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCombinationMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStoreCombination; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStoreCombinationDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ -@Repository -@Mapper -public interface YxStoreCombinationMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreCombinationMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueMapper.java index 369b820e..e0c91649 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStoreCouponIssue; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ -@Repository -@Mapper -public interface YxStoreCouponIssueMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreCouponIssueMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueUserMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueUserMapper.java index 1626fe46..c4864a78 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueUserMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueUserMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStoreCouponIssueUser; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueUserDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ -@Repository -@Mapper -public interface YxStoreCouponIssueUserMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreCouponIssueUserMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponMapper.java index eb3cf4ef..dada61f2 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStoreCoupon; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStoreCouponDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-09 */ -@Repository -@Mapper -public interface YxStoreCouponMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreCouponMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponUserMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponUserMapper.java index 39e165ca..ac217932 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponUserMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponUserMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStoreCouponUser; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStoreCouponUserDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-10 */ -@Repository -@Mapper -public interface YxStoreCouponUserMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreCouponUserMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStorePinkMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStorePinkMapper.java index 80e582db..a01582c6 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStorePinkMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStorePinkMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStorePink; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStorePinkDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-18 */ -@Repository -@Mapper -public interface YxStorePinkMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStorePinkMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreSeckillMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreSeckillMapper.java index ce64f05a..32abe86d 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreSeckillMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreSeckillMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStoreSeckill; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStoreSeckillDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** -* @author hupeng -* @date 2020-05-13 +* @author xuwenbo +* @date 2019-12-14 */ -@Repository -@Mapper -public interface YxStoreSeckillMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreSeckillMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreVisitMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreVisitMapper.java index 46153dce..568a94f9 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreVisitMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreVisitMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxStoreVisit; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxStoreVisitDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-18 */ -@Repository -@Mapper -public interface YxStoreVisitMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxStoreVisitMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxUserExtractMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxUserExtractMapper.java index ee1d4ee2..8d93ddbb 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxUserExtractMapper.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/activity/service/mapper/YxUserExtractMapper.java @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.activity.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.mapper.EntityMapper; import co.yixiang.modules.activity.domain.YxUserExtract; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.activity.service.dto.YxUserExtractDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** * @author hupeng -* @date 2020-05-13 +* @date 2019-11-14 */ -@Repository -@Mapper -public interface YxUserExtractMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxUserExtractMapper extends EntityMapper { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/StoreOrderCartInfo.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/StoreOrderCartInfo.java new file mode 100644 index 00000000..bbb7e7e3 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/domain/YxExpress.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxExpress.java index 8036ec8f..9aa70257 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxExpress.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxExpress.java @@ -1,49 +1,49 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-12 */ - +@Entity @Data -@TableName("yx_express") +@Table(name="yx_express") public class YxExpress implements Serializable { - /** 快递公司id */ - @TableId + // 快递公司id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 快递公司简称 */ + // 快递公司简称 + @Column(name = "code",unique = true,nullable = false) + @NotBlank(message = "快递公司编号不能为空") private String code; - - /** 快递公司全称 */ + // 快递公司全称 + @Column(name = "name",nullable = false) + @NotBlank(message = "快递公司名称不能为空") private String name; - - /** 排序 */ + // 排序 + @Column(name = "sort",nullable = false) + @NotNull(message = "排序必填") private Integer sort; - - /** 是否显示 */ + // 是否显示 + @Column(name = "is_show",insertable = false) private Integer isShow; - public void copy(YxExpress source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxMaterial.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxMaterial.java index 4ff5a55b..7cbc3516 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxMaterial.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxMaterial.java @@ -1,63 +1,62 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; + import lombok.Data; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import javax.validation.constraints.*; import java.sql.Timestamp; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ - +@Entity @Data -@TableName("yx_material") +@Table(name="yx_material") public class YxMaterial implements Serializable { /** PK */ - @TableId + @Id + @Column(name = "id") private String id; - /** 逻辑删除标记(0:显示;1:隐藏) */ - @TableLogic - @TableField(fill=FieldFill.INSERT_UPDATE) - private Boolean delFlag; + /** 逻辑删除标记(0:显示;1:隐藏) */ + @Column(name = "del_flag",nullable = false,insertable = false) + private String delFlag; /** 创建时间 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "create_time",nullable = false) + @CreationTimestamp private Timestamp createTime; + /** 创建者ID */ + @Column(name = "create_id") private String createId; - /** 类型1、图片;2、视频 */ + @Column(name = "type",nullable = false) private String type; - /** 分组ID */ + @Column(name = "group_id") private String groupId; - /** 素材名 */ + @Column(name = "name",nullable = false) + @NotBlank private String name; - /** 素材链接 */ + @Column(name = "url") private String url; - public void copy(YxMaterial source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxMaterialGroup.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxMaterialGroup.java index 0cdb280e..31f68fb2 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxMaterialGroup.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxMaterialGroup.java @@ -1,51 +1,50 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; + import lombok.Data; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import javax.validation.constraints.*; import java.sql.Timestamp; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ - +@Entity @Data -@TableName("yx_material_group") +@Table(name="yx_material_group") public class YxMaterialGroup implements Serializable { /** PK */ - @TableId + @Id + @Column(name = "id") private String id; - /** 逻辑删除标记(0:显示;1:隐藏) */ - @TableLogic - @TableField(fill=FieldFill.INSERT_UPDATE) - private Boolean delFlag; + /** 逻辑删除标记(0:显示;1:隐藏) */ + @Column(name = "del_flag",nullable = false,insertable = false) + private String delFlag; /** 创建时间 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "create_time",nullable = false) + @CreationTimestamp private Timestamp createTime; + /** 创建者ID */ + @Column(name = "create_id") private String createId; - /** 分组名 */ + @Column(name = "name",nullable = false) + @NotBlank private String name; - public void copy(YxMaterialGroup source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreCart.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreCart.java index 6a89076c..b0c5d322 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreCart.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreCart.java @@ -1,81 +1,86 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; + import lombok.Data; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +import javax.validation.constraints.*; import java.io.Serializable; /** -* @author hupeng -* @date 2020-05-12 -*/ - + * @author xwb + * @date 2020-04-02 + */ +@Entity @Data -@TableName("yx_store_cart") +@Table(name="yx_store_cart") public class YxStoreCart implements Serializable { /** 购物车表ID */ - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Long id; - /** 用户ID */ + @Column(name = "uid",nullable = false) + @NotNull private Integer uid; - /** 类型 */ + @Column(name = "type",nullable = false) + @NotBlank private String type; - /** 商品ID */ + @Column(name = "product_id",nullable = false) + @NotNull private Integer productId; - /** 商品属性 */ + @Column(name = "product_attr_unique",nullable = false) + @NotBlank private String productAttrUnique; - /** 商品数量 */ + @Column(name = "cart_num",nullable = false) + @NotNull private Integer cartNum; - /** 添加时间 */ + @Column(name = "add_time",nullable = false) + @NotNull private Integer addTime; - /** 0 = 未购买 1 = 已购买 */ + @Column(name = "is_pay",nullable = false) + @NotNull private Integer isPay; - /** 是否删除 */ + @Column(name = "is_del",nullable = false) + @NotNull private Integer isDel; - /** 是否为立即购买 */ + @Column(name = "is_new",nullable = false) + @NotNull private Integer isNew; - /** 拼团id */ - //@Column(name = "combination_id") + @Column(name = "combination_id") private Integer combinationId; - /** 秒杀产品ID */ + @Column(name = "seckill_id",nullable = false) + @NotNull private Integer seckillId; - /** 砍价id */ + @Column(name = "bargain_id",nullable = false) + @NotNull private Integer bargainId; - public void copy(YxStoreCart source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreCategory.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreCategory.java index 0e6b8a81..5730f8c4 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreCategory.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreCategory.java @@ -1,61 +1,71 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.Where; + +import javax.persistence.*; +import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; +import java.util.Objects; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-03 */ - -@Data -@TableName("yx_store_category") +@Entity +@Getter +@Setter +@Table(name="yx_store_category") +//@Where(clause = "is_del = 0") public class YxStoreCategory implements Serializable { - /** 商品分类表ID */ - @TableId + // 商品分类表ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 父id */ + // 父id + @Column(name = "pid",nullable = false) private Integer pid; - - /** 分类名称 */ + // 分类名称 + @Column(name = "cate_name",nullable = false) + @NotBlank(message = "分类名称不能为空") private String cateName; +// @OneToMany +// @JoinColumn(name = "cate_id") +// private List storeProducts; - /** 排序 */ + // 排序 + @Column(name = "sort",nullable = false) private Integer sort; - - /** 图标 */ + // 图标 + @Column(name = "pic",nullable = false) + //@NotBlank(message = "请上传分类图片") private String pic; - - /** 是否推荐 */ + // 是否推荐 + @Column(name = "is_show",nullable = false) private Integer isShow; - - /** 添加时间 */ + // 添加时间 + @Column(name = "add_time",nullable = false) private Integer addTime; - - /** 删除状态 */ + @Column(name = "is_del",insertable = false) private Integer isDel; - public void copy(YxStoreCategory source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} + + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrder.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrder.java index 81b73573..6d332750 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrder.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrder.java @@ -1,241 +1,237 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-14 */ - +@Entity @Data -@TableName("yx_store_order") +@Table(name="yx_store_order") public class YxStoreOrder implements Serializable { - /** 订单ID */ - @TableId + // 订单ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 订单号 */ + // 订单号 + @Column(name = "order_id",nullable = false) private String orderId; - - /** 额外订单号 */ + // 订单号 + @Column(name = "extend_order_id",nullable = true) private String extendOrderId; - /** 用户id */ + // 用户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 */ + // 购物车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 */ + // 优惠券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:已退款) */ + // 订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款) + @Column(name = "status",nullable = false) private Integer status; - - /** 0 未退款 1 申请中 2 已退款 */ + // 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") + //@NotBlank(message = "请选择快递公司") + private String deliveryName; - /** 快递公司编号 */ + @Column(name = "delivery_sn") private String deliverySn; - /** 快递名称/送货人姓名 */ - private String deliveryName; - - - /** 发货类型 */ + // 发货类型 + @Column(name = "delivery_type") private String deliveryType; - - /** 快递单号/手机号 */ + // 快递单号/手机号 + @Column(name = "delivery_id") + //@NotBlank(message = "快递单号不能为空") 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 */ - @TableField(value = "`unique`") - //@NotBlank + // 唯一id(md5加密)类似id + @Column(name = "`unique`",unique = true,nullable = false) private String unique; - - /** 管理员备注 */ + // 管理员备注 + @Column(name = "remark") private String remark; - - /** 商户ID */ + // 商户ID + @Column(name = "mer_id",nullable = false) private Integer merId; - + @Column(name = "is_mer_check",nullable = false) private Integer isMerCheck; - - /** 拼团产品id0一般产品 */ + // 拼团产品id0一般产品 + @Column(name = "combination_id") private Integer combinationId; - - /** 拼团id 0没有拼团 */ + // 拼团id 0没有拼团 + @Column(name = "pink_id",nullable = false) private Integer pinkId; - - /** 成本价 */ + // 成本价 + @Column(name = "cost",nullable = false) private BigDecimal cost; - - /** 秒杀产品ID */ + // 秒杀产品ID + @Column(name = "seckill_id",nullable = false) private Integer seckillId; - - /** 砍价id */ + // 砍价id + @Column(name = "bargain_id") private Integer bargainId; - - /** 核销码 */ + // 核销码 + @Column(name = "verify_code",nullable = false) private String verifyCode; - - /** 门店id */ + // 门店id + @Column(name = "store_id",nullable = false) private Integer storeId; - - /** 配送方式 1=快递 ,2=门店自提 */ + // 配送方式 1=快递 ,2=门店自提 + @Column(name = "shipping_type",nullable = false) private Integer shippingType; - - /** 支付渠道(0微信公众号1微信小程序) */ + // 支付渠道(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-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderCartInfo.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderCartInfo.java deleted file mode 100644 index feb7d498..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderCartInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ - -@Data -@TableName("yx_store_order_cart_info") -public class YxStoreOrderCartInfo implements Serializable { - - @TableId - private Integer id; - - - /** 订单id */ - private Integer oid; - - - /** 购物车id */ - private Integer cartId; - - - /** 商品ID */ - private Integer productId; - - - /** 购买东西的详细信息 */ - private String cartInfo; - - - /** 唯一id */ - @TableField(value = "`unique`") - private String unique; - - - public void copy(YxStoreOrderCartInfo source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderStatus.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderStatus.java index 724cc7b6..64360b32 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderStatus.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreOrderStatus.java @@ -1,48 +1,43 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-02 */ - +@Entity @Data -@TableName("yx_store_order_status") +@Table(name="yx_store_order_status") public class YxStoreOrderStatus implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 订单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-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProduct.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProduct.java index edf0828b..a3f3de07 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProduct.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProduct.java @@ -1,174 +1,208 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; +import org.hibernate.annotations.NotFound; +import org.hibernate.annotations.NotFoundAction; + +import javax.persistence.*; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-04 */ - +@Entity @Data -@TableName("yx_store_product") +@Table(name="yx_store_product") public class YxStoreProduct implements Serializable { - /** 商品id */ - @TableId + // 商品id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 商户Id(0为总后台管理员创建,不为0的时候是商户后台创建) */ + // 商户Id(0为总后台管理员创建,不为0的时候是商户后台创建) + @Column(name = "mer_id",nullable = false) private Integer merId; - - /** 商品图片 */ + // 商品图片 + @Column(name = "image",nullable = false) + @NotBlank(message = "请上传商品图片") private String image; - - /** 轮播图 */ + // 轮播图 + @Column(name = "slider_image",nullable = false) + @NotBlank(message = "请上传轮播图") private String sliderImage; - - /** 商品名称 */ + // 商品名称 + @Column(name = "store_name",nullable = false) + @NotBlank(message = "请填写商品名称") private String storeName; - - /** 商品简介 */ + // 商品简介 + @Column(name = "store_info",nullable = false) + @NotBlank(message = "请填写商品简介") private String storeInfo; - - /** 关键字 */ + // 关键字 + @Column(name = "keyword",nullable = false) + @NotBlank(message = "请填写关键字") private String keyword; - - /** 产品条码(一维码) */ + // 产品条码(一维码) + @Column(name = "bar_code",nullable = false) private String barCode; + // private Integer cateId; - /** 分类id */ - private String cateId; + @ManyToOne(fetch=FetchType.LAZY,optional = false) + @JoinColumn(name = "cate_id") + @NotFound(action= NotFoundAction.IGNORE) + private YxStoreCategory storeCategory; - - /** 商品价格 */ + // 商品价格 + @Column(name = "price",nullable = false) + @NotNull(message = "价格必填") + @Min(value = 0) private BigDecimal price; - - /** 会员价格 */ + // 会员价格 + @Column(name = "vip_price",insertable = false) + //@NotNull(message = "会员价必填") + //@Min(value = 0) private BigDecimal vipPrice; - - /** 市场价 */ + // 市场价 + @Column(name = "ot_price",nullable = false) + @NotNull(message = "原价必填") + @Min(value = 0) private BigDecimal otPrice; - - /** 邮费 */ + // 邮费 + @Column(name = "postage",nullable = false) + @NotNull(message = "邮费必填") + @Min(value = 0) private BigDecimal postage; - - /** 单位名 */ + // 单位名 + @Column(name = "unit_name",nullable = false) + @NotBlank(message = "请填写单位") private String unitName; - - /** 排序 */ + // 排序 + @Column(name = "sort",nullable = false) + @NotNull(message = "排序必填") + @Min(value = 0) private Integer sort; - - /** 销量 */ + // 销量 + @Column(name = "sales",nullable = false) + @NotNull(message = "销量必填") + @Min(value = 0) private Integer sales; - - /** 库存 */ + // 库存 + @Column(name = "stock",nullable = false) + @NotNull(message = "库存必填") + @Min(value = 0) private Integer stock; - - /** 状态(0:未上架,1:上架) */ + // 状态(0:未上架,1:上架) + @Column(name = "is_show",insertable = false) + //@NotNull(message = "状态必须选择") private Integer isShow; - - /** 是否热卖 */ + // 是否热卖 + @Column(name = "is_hot") + @NotNull(message = "热卖单品必须选择") private Integer isHot; - - /** 是否优惠 */ + // 是否优惠 + @Column(name = "is_benefit") + @NotNull(message = "优惠推荐必须选择") private Integer isBenefit; - - /** 是否精品 */ + // 是否精品 + @Column(name = "is_best",columnDefinition="int default 0") + @NotNull(message = "精品状态必须选择") private Integer isBest; - - /** 是否新品 */ + // 是否新品 + @Column(name = "is_new",columnDefinition="int default 0") + @NotNull(message = "首发新品必须选择") private Integer isNew; - - /** 产品描述 */ + // 产品描述 + @Column(name = "description",nullable = false) + @NotBlank(message = "产品描述") private String description; - - /** 添加时间 */ + // 添加时间 + @Column(name = "add_time",nullable = false) private Integer addTime; - - /** 是否包邮 */ + // 是否包邮 + @Column(name = "is_postage") + @NotNull(message = "包邮状态必须选择") private Integer isPostage; - - /** 是否删除 */ + // 是否删除 + @Column(name = "is_del",insertable = false) private Integer isDel; - - /** 商户是否代理 0不可代理1可代理 */ + // 商户是否代理 0不可代理1可代理 + @Column(name = "mer_use",nullable = false) private Integer merUse; - - /** 获得积分 */ + // 获得积分 + @Column(name = "give_integral") + @NotNull(message = "奖励积分不能为空") + @Min(value = 0) private BigDecimal giveIntegral; - - /** 成本价 */ + // 成本价 + @Column(name = "cost") + @NotNull(message = "成本价不能为空") + @Min(value = 0) private BigDecimal cost; - - /** 秒杀状态 0 未开启 1已开启 */ + // 秒杀状态 0 未开启 1已开启 + @Column(name = "is_seckill",columnDefinition="int default 0") private Integer isSeckill; - - /** 砍价状态 0未开启 1开启 */ + // 砍价状态 0未开启 1开启 + @Column(name = "is_bargain",columnDefinition="int default 0") private Integer isBargain; - - /** 是否优品推荐 */ + // 是否优品推荐 + @Column(name = "is_good",columnDefinition="int default 0") private Integer isGood; - - /** 虚拟销量 */ + // 虚拟销量 + @Column(name = "ficti",columnDefinition="int default 0") private Integer ficti; - - /** 浏览量 */ + // 浏览量 + @Column(name = "browse",columnDefinition="int default 0") private Integer browse; - - /** 产品二维码地址(用户小程序海报) */ + // 产品二维码地址(用户小程序海报) + @Column(name = "code_path",nullable = false) private String codePath; - - /** 淘宝京东1688类型 */ + // 淘宝京东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-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttr.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttr.java index 129e3c87..2aed4b7b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttr.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttr.java @@ -1,44 +1,38 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-13 */ - +@Entity @Data -@TableName("yx_store_product_attr") +@Table(name="yx_store_product_attr") public class YxStoreProductAttr implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - - /** 商品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-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrResult.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrResult.java index a7243c90..6894a688 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrResult.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrResult.java @@ -1,44 +1,39 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-13 */ - +@Entity @Data -@TableName("yx_store_product_attr_result") +@Table(name="yx_store_product_attr_result") public class YxStoreProductAttrResult implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 商品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-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrValue.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrValue.java index a16ca2a2..ab57b819 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrValue.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductAttrValue.java @@ -1,68 +1,60 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + import javax.persistence.*; -import javax.validation.constraints.*; -import java.math.BigDecimal; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-13 */ - +@Entity @Data -@TableName("yx_store_product_attr_value") +@Table(name="yx_store_product_attr_value") public class YxStoreProductAttrValue implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 商品ID */ + // 商品ID + @Column(name = "product_id",nullable = false) private Integer productId; - - /** 商品属性索引值 (attr_value|attr_value[|....]) */ + // 商品属性索引值 (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; - - /** 唯一值 */ - @TableField(value = "`unique`") + // 唯一值 + @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-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductReply.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductReply.java index 03ed6955..a8a4a2b1 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductReply.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxStoreProductReply.java @@ -1,90 +1,92 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-03 */ - +@Entity @Data -@TableName("yx_store_product_reply") +@Table(name="yx_store_product_reply") public class YxStoreProductReply implements Serializable { - /** 评论ID */ - @TableId + // 评论ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; + // 用户ID +// @Column(name = "uid",nullable = false) +// private Integer uid; - /** 用户ID */ - private Integer uid; + @ManyToOne(fetch=FetchType.LAZY,optional = false) + @JoinColumn(name = "uid") + private YxUser user; - - /** 订单ID */ + // 订单ID + @Column(name = "oid",nullable = false) private Integer oid; - - /** 唯一id */ - @TableField(value = "`unique`") + // 唯一id + @Column(name = "`unique`",nullable = false) private String unique; + // 产品id +// @Column(name = "product_id",nullable = false) +// private Integer productId; - /** 产品id */ - private Integer productId; + @ManyToOne(fetch=FetchType.LAZY,optional = false) + @JoinColumn(name = "product_id") + private YxStoreProduct storeProduct; - - /** 某种商品类型(普通商品、秒杀商品) */ + // 某种商品类型(普通商品、秒杀商品) + @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已删除 */ + // 0未删除1已删除 + @Column(name = "is_del",nullable = false) private Integer isDel; - - /** 0未回复1已回复 */ + // 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-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemConfig.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemConfig.java index 5a8f93c5..85139361 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemConfig.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemConfig.java @@ -1,49 +1,45 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-10 */ - +@Entity @Data -@TableName("yx_system_config") +@Table(name="yx_system_config") public class YxSystemConfig implements Serializable { - /** 配置id */ - @TableId + // 配置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-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemGroupData.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemGroupData.java index ccdda7f2..a2905d5b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemGroupData.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemGroupData.java @@ -1,53 +1,48 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-18 */ - +@Entity @Data -@TableName("yx_system_group_data") +@Table(name="yx_system_group_data") public class YxSystemGroupData implements Serializable { - /** 组合数据详情ID */ - @TableId + // 组合数据详情ID + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 对应的数据名称 */ + // 对应的数据名称 + @Column(name = "group_name",nullable = false) private String groupName; - - /** 数据组对应的数据值(json数据) */ + // 数据组对应的数据值(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:关闭;) */ + // 状态(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-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStore.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStore.java index 8e3fef33..a4a9296c 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStore.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStore.java @@ -1,85 +1,102 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; + import lombok.Data; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +import javax.validation.constraints.*; import java.io.Serializable; +import java.util.Date; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-03 */ - +@Entity @Data -@TableName("yx_system_store") +@Table(name="yx_system_store") public class YxSystemStore implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - /** 门店名称 */ + @Column(name = "name",nullable = false) + @NotBlank private String name; - /** 简介 */ + @Column(name = "introduction",nullable = false) + @NotBlank private String introduction; - /** 手机号码 */ + @Column(name = "phone",nullable = false) + @NotBlank private String phone; - /** 省市区 */ + @Column(name = "address",nullable = false) + @NotBlank private String address; - /** 详细地址 */ + @Column(name = "detailed_address",insertable = false) private String detailedAddress; - /** 门店logo */ + @Column(name = "image",nullable = false) + @NotBlank(message = "请上传门店logo") private String image; - /** 纬度 */ + @Column(name = "latitude",nullable = false) + @NotBlank private String latitude; - /** 经度 */ + @Column(name = "longitude",nullable = false) + @NotBlank private String longitude; - /** 核销有效日期 */ + @Column(name = "valid_time",nullable = false) + @NotBlank private String validTime; + @Column(name = "valid_time_start",nullable = false) + private Date validTimeStart; + + @Column(name = "valid_time_end",nullable = false) + private Date validTimeEnd; /** 每日营业开关时间 */ + @Column(name = "day_time",nullable = false) + @NotBlank private String dayTime; + @Column(name = "day_time_start",nullable = false) + private Date dayTimeStart; + + @Column(name = "day_time_end",nullable = false) + private Date dayTimeEnd; /** 添加时间 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "add_time",nullable = false) private Integer addTime; - /** 是否显示 */ + @Column(name = "is_show") + @NotNull private Integer isShow; - /** 是否删除 */ + @Column(name = "is_del",insertable = false) private Integer isDel; - public void copy(YxSystemStore source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStoreStaff.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStoreStaff.java index 46cb4174..ed5ec8d0 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStoreStaff.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStoreStaff.java @@ -1,73 +1,74 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; + import lombok.Data; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +import javax.validation.constraints.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-22 */ - +@Entity @Data -@TableName("yx_system_store_staff") +@Table(name="yx_system_store_staff") public class YxSystemStoreStaff implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - /** 微信用户id */ + @Column(name = "uid",nullable = false) + @NotNull(message = "请选择商城会员") private Integer uid; - /** 店员头像 */ + @Column(name = "avatar",nullable = false) + @NotBlank(message = "请选择商城会员") private String avatar; - /** 门店id */ + @Column(name = "store_id",nullable = false) + @NotNull private Integer storeId; - /** 店员名称 */ + @Column(name = "staff_name",nullable = false) + @NotBlank private String staffName; - /** 手机号码 */ + @Column(name = "phone",nullable = false) + @NotBlank private String phone; - /** 核销开关 */ + @Column(name = "verify_status",nullable = false) + @NotNull private Integer verifyStatus; - /** 状态 */ + @Column(name = "status",insertable = false) private Integer status; - /** 添加时间 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "add_time") private Integer addTime; - /** 微信昵称 */ + @Column(name = "nickname",nullable = false) + @NotBlank private String nickname; - /** 所属门店 */ + @Column(name = "store_name") private String storeName; - public void copy(YxSystemStoreStaff source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemUserLevel.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemUserLevel.java index e3dacea1..1301102b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemUserLevel.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemUserLevel.java @@ -1,90 +1,93 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-04 */ - +@Entity @Data -@TableName("yx_system_user_level") +@Table(name="yx_system_user_level") public class YxSystemUserLevel implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 商户id */ + // 商户id + @Column(name = "mer_id",insertable = false) private Integer merId; - - /** 会员名称 */ + // 会员名称 + @Column(name = "name",nullable = false) + @NotBlank(message = "请填写等级名称") private String name; - - /** 购买金额 */ + // 购买金额 + @Column(name = "money",insertable = false) private BigDecimal money; - - /** 有效时间 */ + // 有效时间 + @Column(name = "valid_date",nullable = false) private Integer validDate; - - /** 是否为永久会员 */ + // 是否为永久会员 + @Column(name = "is_forever",nullable = false) private Integer isForever; - - /** 是否购买,1=购买,0=不购买 */ + // 是否购买,1=购买,0=不购买 + @Column(name = "is_pay",insertable = false) private Integer isPay; - - /** 是否显示 1=显示,0=隐藏 */ + // 是否显示 1=显示,0=隐藏 + @Column(name = "is_show",nullable = false) + @NotNull(message = "请选择显示状态") private Integer isShow; - - /** 会员等级 */ + // 会员等级 + @Column(name = "grade",nullable = false) + @NotNull(message = "等级必填") private Integer grade; - - /** 享受折扣 */ + // 享受折扣 + @Column(name = "discount",nullable = false) + @NotNull(message = "折扣必填") private BigDecimal discount; - /** 会员卡背景 */ + // 会员卡背景 + @Column(name = "image",nullable = false) + @NotBlank(message = "请上传背景") private String image; - - /** 会员图标 */ + // 会员图标 + @Column(name = "icon",nullable = false) + @NotBlank(message = "请上传图标") private String icon; - - /** 说明 */ - @TableField(value = "`explain`") + // 说明 + @Column(name = "`explain`",nullable = false) + @NotBlank(message = "请填写说明") private String explain; - - /** 添加时间 */ - @TableField(fill= FieldFill.INSERT) + // 添加时间 + @Column(name = "add_time",nullable = false) private Integer addTime; - - /** 是否删除.1=删除,0=未删除 */ + // 是否删除.1=删除,0=未删除 + @Column(name = "is_del",insertable = false) private Integer isDel; - public void copy(YxSystemUserLevel source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemUserTask.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemUserTask.java index 056fee06..e01e8839 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemUserTask.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemUserTask.java @@ -1,73 +1,67 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-04 */ - +@Entity @Data -@TableName("yx_system_user_task") +@Table(name="yx_system_user_task") public class YxSystemUserTask implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 任务名称 */ + // 任务名称 + @Column(name = "name",nullable = false) private String name; - - /** 配置原名 */ + // 配置原名 + @Column(name = "real_name",nullable = false) private String realName; - - /** 任务类型 */ + // 任务类型 + @Column(name = "task_type",nullable = false) private String taskType; - - /** 限定数 */ + // 限定数 + @Column(name = "number",nullable = false) private Integer number; - - /** 等级id */ + // 等级id + @Column(name = "level_id",nullable = false) private Integer levelId; - - /** 排序 */ + // 排序 + @Column(name = "sort",nullable = false) private Integer sort; - - /** 是否显示 */ + // 是否显示 + @Column(name = "is_show",nullable = false) private Integer isShow; - - /** 是否务必达成任务,1务必达成,0=满足其一 */ + // 是否务必达成任务,1务必达成,0=满足其一 + @Column(name = "is_must",nullable = false) private Integer isMust; - - /** 任务说明 */ + // 任务说明 + @Column(name = "illustrate",nullable = false) private String illustrate; - - /** 新增时间 */ - @TableField(fill= FieldFill.INSERT) + // 新增时间 + @Column(name = "add_time",nullable = false) private Integer addTime; - public void copy(YxSystemUserTask source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUser.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUser.java index d3437bbe..68886f68 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUser.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUser.java @@ -1,165 +1,153 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-06 */ +@Entity @Data +@Table(name="yx_user") public class YxUser implements Serializable { - /** 用户id */ - @TableId(value = "uid", type = IdType.AUTO) + // 用户id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "uid") private Integer uid; - - /** 用户账户(跟accout一样) */ - private String username; - - - /** 用户账号 */ + // 用户账号 + @Column(name = "account",nullable = false) private String account; - - /** 用户密码(跟pwd) */ - private String password; - - - /** 用户密码 */ + // 用户密码 + @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 */ + // 合伙人id + @Column(name = "partner_id",nullable = false) private Integer partnerId; - - /** 用户分组id */ + // 用户分组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; - - /** 添加时间 */ - @TableField(fill= FieldFill.INSERT) + // 添加时间 + @Column(name = "add_time",nullable = false) private Integer addTime; - - /** 添加ip */ + // 添加ip + @Column(name = "add_ip",nullable = false) private String addIp; - - /** 最后一次登录时间 */ + // 最后一次登录时间 + @Column(name = "last_time",nullable = false) private Integer lastTime; - - /** 最后一次登录ip */ + // 最后一次登录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为禁止 */ + // 1为正常,0为禁止 + @Column(name = "status",nullable = false) private Integer status; - - /** 等级 */ + // 等级 + @Column(name = "level",nullable = false) private Integer level; - - /** 推广元id */ + // 推广元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 */ + // 用户登陆类型,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-shop/src/main/java/co/yixiang/modules/shop/domain/YxUserBill.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUserBill.java index 31ba40bf..b6c79fb6 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUserBill.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUserBill.java @@ -1,79 +1,75 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-06 */ - +@Entity @Data -@TableName("yx_user_bill") +@Table(name="yx_user_bill") public class YxUserBill implements Serializable { - /** 用户账单id */ - @TableId + // 用户账单id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - - /** 用户uid */ + //用户uid + @Column(name = "uid",nullable = false) private Integer uid; - /** 关联id */ + + // 关联id + @Column(name = "link_id",nullable = false) private String linkId; - - /** 0 = 支出 1 = 获得 */ + // 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; - - /** 添加时间 */ - @TableField(fill= FieldFill.INSERT) + // 添加时间 + @Column(name = "add_time",nullable = false) private Integer addTime; - - /** 0 = 带确定 1 = 有效 -1 = 无效 */ + // 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-shop/src/main/java/co/yixiang/modules/shop/domain/YxUserRecharge.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUserRecharge.java index 23f49554..3de16b39 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUserRecharge.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxUserRecharge.java @@ -1,70 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.*; + import lombok.Data; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import javax.persistence.*; +import javax.validation.constraints.*; import java.math.BigDecimal; import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-02 */ - +@Entity @Data -@TableName("yx_user_recharge") +@Table(name="yx_user_recharge") public class YxUserRecharge implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") private Integer id; - /** 充值用户UID */ + @Column(name = "uid") private Integer uid; - /** 订单号 */ + @Column(name = "order_id",unique = true) private String orderId; - /** 充值金额 */ + @Column(name = "price") private BigDecimal price; - /** 充值类型 */ + @Column(name = "recharge_type") private String rechargeType; - /** 是否充值 */ + @Column(name = "paid") private Integer paid; - /** 充值支付时间 */ + @Column(name = "pay_time") private Integer payTime; - /** 充值时间 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "add_time") private Integer addTime; - /** 退款金额 */ + @Column(name = "refund_price") private BigDecimal refundPrice; - /** 昵称 */ + @Column(name = "nickname") private String nickname; - public void copy(YxUserRecharge source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxWechatUser.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxWechatUser.java index f486407c..0be5a22b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxWechatUser.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxWechatUser.java @@ -1,127 +1,121 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.domain; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; + import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; -import java.math.BigDecimal; +import lombok.Data; + +import javax.persistence.*; import java.io.Serializable; +import java.math.BigDecimal; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-13 */ +@Entity @Data +@Table(name="yx_wechat_user") public class YxWechatUser implements Serializable { - /** 微信用户id */ - @TableId + // 微信用户id + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "uid") private Integer uid; - - /** 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段 */ + // 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段 + @Column(name = "unionid") private String unionid; - - /** 用户的标识,对当前公众号唯一 */ + // 用户的标识,对当前公众号唯一 + @Column(name = "openid") private String openid; - - /** 小程序唯一身份ID */ + // 小程序唯一身份ID + @Column(name = "routine_openid") private String routineOpenid; - - /** 用户的昵称 */ + // 用户的昵称 + @Column(name = "nickname",nullable = false) private String nickname; - - /** 用户头像 */ + // 用户头像 + @Column(name = "headimgurl",nullable = false) private String headimgurl; - - /** 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知 */ + // 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知 + @Column(name = "sex",nullable = false) private Integer sex; - - /** 用户所在城市 */ + // 用户所在城市 + @Column(name = "city",nullable = false) private String city; - - /** 用户的语言,简体中文为zh_CN */ + // 用户的语言,简体中文为zh_CN + @Column(name = "language",nullable = false) private String language; - - /** 用户所在省份 */ + // 用户所在省份 + @Column(name = "province",nullable = false) private String province; - - /** 用户所在国家 */ + // 用户所在国家 + @Column(name = "country",nullable = false) private String country; - - /** 公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注 */ + // 公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注 + @Column(name = "remark") private String remark; - - /** 用户所在的分组ID(兼容旧的用户分组接口) */ + // 用户所在的分组ID(兼容旧的用户分组接口) + @Column(name = "groupid") private Integer groupid; - - /** 用户被打上的标签ID列表 */ + // 用户被打上的标签ID列表 + @Column(name = "tagid_list") private String tagidList; - - /** 用户是否订阅该公众号标识 */ + // 用户是否订阅该公众号标识 + @Column(name = "subscribe") private Integer subscribe; - - /** 关注公众号时间 */ + // 关注公众号时间 + @Column(name = "subscribe_time") private Integer subscribeTime; - - /** 添加时间 */ - @TableField(fill= FieldFill.INSERT) + // 添加时间 + @Column(name = "add_time") private Integer addTime; - - /** 一级推荐人 */ + // 一级推荐人 + @Column(name = "stair") private Integer stair; - - /** 二级推荐人 */ + // 二级推荐人 + @Column(name = "second") private Integer second; - - /** 一级推荐人订单 */ + // 一级推荐人订单 + @Column(name = "order_stair") private Integer orderStair; - - /** 二级推荐人订单 */ + // 二级推荐人订单 + @Column(name = "order_second") private Integer orderSecond; - - /** 佣金 */ + // 佣金 + @Column(name = "now_money") private BigDecimal nowMoney; - - /** 小程序用户会话密匙 */ + // 小程序用户会话密匙 + @Column(name = "session_key") private String sessionKey; - - /** 用户类型 */ + // 用户类型 + @Column(name = "user_type") private String userType; - public void copy(YxWechatUser source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxExpressRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxExpressRepository.java new file mode 100644 index 00000000..790ce6f4 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxExpressRepository.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxExpress; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-12-12 +*/ +public interface YxExpressRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * findByCode + * @param code + * @return + */ + YxExpress findByCode(String code); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxMaterialGroupRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxMaterialGroupRepository.java new file mode 100644 index 00000000..63bfae82 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxMaterialGroupRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxMaterialGroup; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2020-01-09 +*/ +public interface YxMaterialGroupRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxMaterialRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxMaterialRepository.java new file mode 100644 index 00000000..aa661856 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxMaterialRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxMaterial; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2020-01-09 +*/ +public interface YxMaterialRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreCartRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreCartRepository.java new file mode 100644 index 00000000..fe154ab1 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreCartRepository.java @@ -0,0 +1,21 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxStoreCart; +import co.yixiang.modules.shop.service.dto.CountDto; +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; + +/** + * @author xwb + * @date 2020-04-02 + */ +public interface YxStoreCartRepository extends JpaRepository, JpaSpecificationExecutor { + + @Query(value ="SELECT t.cate_name as catename from yx_store_cart c " + + "LEFT JOIN yx_store_product p on c.product_id = p.id " + + "LEFT JOIN yx_store_category t on p.cate_id = t.id " + + "WHERE c.is_pay = 1",nativeQuery = true) + List findCateName(); +} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreCategoryRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreCategoryRepository.java new file mode 100644 index 00000000..f68317aa --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreCategoryRepository.java @@ -0,0 +1,23 @@ +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.Modifying; +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); + + @Modifying + @Query("update YxStoreCategory s set s.isDel = 1 where s.id =:id") + void delCategory(Integer id); + + YxStoreCategory findByPid(Integer pid); + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderCartInfoRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderCartInfoRepository.java new file mode 100644 index 00000000..5c4bd8f8 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderRepository.java new file mode 100644 index 00000000..f351a4a0 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderRepository.java @@ -0,0 +1,59 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxStoreOrder; +import co.yixiang.modules.shop.service.dto.ChartDataDTO; +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; + +/** +* @author hupeng +* @date 2019-10-14 +*/ +public interface YxStoreOrderRepository extends JpaRepository, JpaSpecificationExecutor { + + + //今天 //上周 //本月 + int countByPayTimeGreaterThanEqual(int time); + + //昨天 + int countByPayTimeLessThanAndPayTimeGreaterThanEqual(int timeO, int timeT); + + @Query(value = "select IFNULL(sum(pay_price),0) from yx_store_order " + + "where refund_status=0 and is_del=0 and paid=1 and pay_time >= ?1",nativeQuery = true) + double sumPrice(Integer time); + + @Query(value = "select IFNULL(sum(pay_price),0) from yx_store_order " + + "where refund_status=0 and is_del=0 and paid=1",nativeQuery = true) + double sumTotalPrice(); + + @Query(value = "select IFNULL(sum(pay_price),0) from yx_store_order " + + "where refund_status=0 and is_del=0 and paid=1 and pay_time >= ?1 and pay_time < ?2",nativeQuery = true) + double sumTPrice(Integer timeO, Integer timeT); + + @Query(value = "SELECT IFNULL(sum(pay_price),0) as num," + + "FROM_UNIXTIME(add_time, '%m-%d') as time " + + " FROM yx_store_order where refund_status=0 and is_del=0 and paid=1 and pay_time >= ?1" + + " GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " + + " ORDER BY add_time ASC",nativeQuery = true) + List chartList(Integer time); + + @Query(value = "SELECT count(id) as num," + + "FROM_UNIXTIME(add_time, '%m-%d') as time " + + " FROM yx_store_order where refund_status=0 and is_del=0 and paid=1 and pay_time >= ?1" + + " GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " + + " ORDER BY add_time ASC",nativeQuery = true) + List chartListT(Integer time); + + + /** + * findByUnique + * @param unique + * @return + */ + YxStoreOrder findByUnique(String unique); + + List findByOrderIdIn(List ids); +} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderStatusRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreOrderStatusRepository.java new file mode 100644 index 00000000..0b49b039 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrRepository.java new file mode 100644 index 00000000..bf1b5694 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrRepository.java @@ -0,0 +1,19 @@ +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; +import org.springframework.data.jpa.repository.Query; + +/** +* @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-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrResultRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrResultRepository.java new file mode 100644 index 00000000..da334e7b --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrValueRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrValueRepository.java new file mode 100644 index 00000000..d1bfd89f --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductAttrValueRepository.java @@ -0,0 +1,21 @@ +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; +import org.springframework.data.jpa.repository.Query; + +/** +* @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); + + @Query(value = "select sum(stock) from yx_store_product_attr_value " + + "where product_id = ?1",nativeQuery = true) + Integer sumStock(Integer productId); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductReplyRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductReplyRepository.java new file mode 100644 index 00000000..5767dd82 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductRepository.java new file mode 100644 index 00000000..596e027d --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxStoreProductRepository.java @@ -0,0 +1,26 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxStoreCategory; +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; + +import java.util.List; + +/** +* @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); + + List findByStoreCategoryAndIsDel(YxStoreCategory storeCategory,int isDel); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemConfigRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemConfigRepository.java new file mode 100644 index 00000000..fa0ea74f --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemConfigRepository.java @@ -0,0 +1,13 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.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-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemGroupDataRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemGroupDataRepository.java new file mode 100644 index 00000000..86144a06 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemStoreRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemStoreRepository.java new file mode 100644 index 00000000..609bf8dc --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemStoreRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxSystemStore; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2020-03-03 +*/ +public interface YxSystemStoreRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemStoreStaffRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemStoreStaffRepository.java new file mode 100644 index 00000000..6482a3cb --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemStoreStaffRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxSystemStoreStaff; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2020-03-22 +*/ +public interface YxSystemStoreStaffRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemUserLevelRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemUserLevelRepository.java new file mode 100644 index 00000000..d79b81d3 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemUserLevelRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxSystemUserLevel; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-12-04 +*/ +public interface YxSystemUserLevelRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemUserTaskRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemUserTaskRepository.java new file mode 100644 index 00000000..ea128cb2 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxSystemUserTaskRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxSystemUserTask; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-12-04 +*/ +public interface YxSystemUserTaskRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserBillRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserBillRepository.java new file mode 100644 index 00000000..c2cb7850 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserBillRepository.java @@ -0,0 +1,28 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxUserBill; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; + +import java.util.Map; + +/** +* @author hupeng +* @date 2019-11-06 +*/ +public interface YxUserBillRepository extends JpaRepository, JpaSpecificationExecutor { + @Query(nativeQuery = true, + value = "select b.title,b.pm,b.category,b.type,b.number,b.add_time as addTime," + + "u.nickname from yx_user_bill b left join yx_user u on u.uid=b.uid " + + " where if(?1 !='',b.category=?1,1=1) and if(?2 !='',b.type=?2,1=1) " + + "and if(?3 !='',u.nickname LIKE CONCAT('%',?3,'%'),1=1) order by b.id desc", + countQuery = "select count(*) from yx_user_bill b left join yx_user u on u.uid=b.uid" + + " where if(?1 !='',b.category=?1,1=1) and if(?2 !='',b.type=?2,1=1) " + + "and if(?3 !='',u.nickname LIKE CONCAT('%',?3,'%'),1=1)") + Page findAllByPageable(String category, String type, String nickname, + Pageable pageable); + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserRechargeRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserRechargeRepository.java new file mode 100644 index 00000000..f267c33b --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserRechargeRepository.java @@ -0,0 +1,18 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxUserRecharge; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2020-03-02 +*/ +public interface YxUserRechargeRepository extends JpaRepository, JpaSpecificationExecutor { + /** + * 根据 OrderId 查询 + * @param order_id / + * @return / + */ + YxUserRecharge findByOrderId(String order_id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserRepository.java new file mode 100644 index 00000000..fd748747 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxUserRepository.java @@ -0,0 +1,30 @@ +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); + + @Modifying + @Query(value = "update yx_user set brokerage_price = brokerage_price+?1 where uid = ?2",nativeQuery = true) + void incBrokeragePrice(double price, int id); + + + + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxWechatUserRepository.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxWechatUserRepository.java new file mode 100644 index 00000000..48617120 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/repository/YxWechatUserRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.shop.repository; + +import co.yixiang.modules.shop.domain.YxWechatUser; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author hupeng +* @date 2019-12-13 +*/ +public interface YxWechatUserRepository extends JpaRepository, JpaSpecificationExecutor { +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/ExpressController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/ExpressController.java index e336e0da..bf955c37 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/ExpressController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/ExpressController.java @@ -1,14 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxExpress; import co.yixiang.modules.shop.service.YxExpressService; import co.yixiang.modules.shop.service.dto.YxExpressQueryCriteria; @@ -51,7 +45,7 @@ public class ExpressController { @PreAuthorize("@el.check('admin','YXEXPRESS_ALL','YXEXPRESS_CREATE')") public ResponseEntity create(@Validated @RequestBody YxExpress resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - return new ResponseEntity(yxExpressService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxExpressService.create(resources),HttpStatus.CREATED); } @Log("修改快递") @@ -60,7 +54,7 @@ public class ExpressController { @PreAuthorize("@el.check('admin','YXEXPRESS_ALL','YXEXPRESS_EDIT')") public ResponseEntity update(@Validated @RequestBody YxExpress resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxExpressService.saveOrUpdate(resources); + yxExpressService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -70,7 +64,7 @@ public class ExpressController { @PreAuthorize("@el.check('admin','YXEXPRESS_ALL','YXEXPRESS_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxExpressService.removeById(id); + yxExpressService.delete(id); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MaterialController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MaterialController.java index 753c9c57..0187d7ea 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MaterialController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MaterialController.java @@ -1,15 +1,7 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.modules.shop.domain.YxMaterial; import co.yixiang.modules.shop.service.YxMaterialService; import co.yixiang.modules.shop.service.dto.YxMaterialQueryCriteria; @@ -51,14 +43,14 @@ public class MaterialController { @ApiOperation("新增素材管理") public ResponseEntity create(@Validated @RequestBody YxMaterial resources){ resources.setCreateId(SecurityUtils.getUsername()); - return new ResponseEntity<>(yxMaterialService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(yxMaterialService.create(resources),HttpStatus.CREATED); } @PutMapping @Log("修改素材管理") @ApiOperation("修改素材管理") public ResponseEntity update(@Validated @RequestBody YxMaterial resources){ - yxMaterialService.saveOrUpdate(resources); + yxMaterialService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -66,9 +58,9 @@ public class MaterialController { @ApiOperation("删除素材管理") @DeleteMapping(value = "/{id}") public ResponseEntity deleteAll(@PathVariable String id) { - yxMaterialService.removeById(id); + yxMaterialService.deleteById(id); return new ResponseEntity<>(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MaterialGroupController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MaterialGroupController.java index 1df774b6..521c59a7 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MaterialGroupController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MaterialGroupController.java @@ -1,14 +1,6 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.modules.shop.domain.YxMaterialGroup; import co.yixiang.modules.shop.service.YxMaterialGroupService; import co.yixiang.modules.shop.service.dto.YxMaterialGroupQueryCriteria; @@ -48,14 +40,14 @@ public class MaterialGroupController { @Log("新增素材分组") @ApiOperation("新增素材分组") public ResponseEntity create(@Validated @RequestBody YxMaterialGroup resources){ - return new ResponseEntity<>(yxMaterialGroupService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(yxMaterialGroupService.create(resources),HttpStatus.CREATED); } @PutMapping @Log("修改素材分组") @ApiOperation("修改素材分组") public ResponseEntity update(@Validated @RequestBody YxMaterialGroup resources){ - yxMaterialGroupService.saveOrUpdate(resources); + yxMaterialGroupService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -63,7 +55,7 @@ public class MaterialGroupController { @ApiOperation("删除素材分组") @DeleteMapping(value = "/{id}") public ResponseEntity deleteAll(@PathVariable String id) { - yxMaterialGroupService.removeById(id); + yxMaterialGroupService.deleteById(id); return new ResponseEntity<>(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MemberController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MemberController.java index d2a77ace..3bec5abe 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MemberController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/MemberController.java @@ -1,19 +1,13 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; import cn.hutool.core.util.ObjectUtil; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxUser; import co.yixiang.modules.shop.service.YxSystemConfigService; import co.yixiang.modules.shop.service.YxUserService; -import co.yixiang.modules.shop.service.dto.UserMoneyDto; +import co.yixiang.modules.shop.service.dto.UserMoneyDTO; import co.yixiang.modules.shop.service.dto.YxUserQueryCriteria; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -65,7 +59,7 @@ public class MemberController { @PostMapping(value = "/yxUser") @PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_CREATE')") public ResponseEntity create(@Validated @RequestBody YxUser resources){ - return new ResponseEntity(yxUserService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxUserService.create(resources),HttpStatus.CREATED); } @Log("修改用户") @@ -73,7 +67,7 @@ public class MemberController { @PutMapping(value = "/yxUser") @PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_EDIT')") public ResponseEntity update(@Validated @RequestBody YxUser resources){ - yxUserService.saveOrUpdate(resources); + yxUserService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -83,7 +77,7 @@ public class MemberController { @PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_DELETE')") public ResponseEntity delete(@PathVariable Integer uid){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxUserService.removeById(uid); + yxUserService.delete(uid); return new ResponseEntity(HttpStatus.OK); } @@ -100,9 +94,9 @@ public class MemberController { @ApiOperation(value = "修改余额") @PostMapping(value = "/yxUser/money") @PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_EDIT')") - public ResponseEntity updatePrice(@Validated @RequestBody UserMoneyDto param){ + public ResponseEntity updatePrice(@Validated @RequestBody UserMoneyDTO param){ yxUserService.updateMoney(param); return new ResponseEntity(HttpStatus.NO_CONTENT); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java index 920a6f5a..5137f19e 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java @@ -1,19 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; import cn.hutool.core.util.StrUtil; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.exception.BadRequestException; 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.YxStoreCategoryDTO; import co.yixiang.modules.shop.service.dto.YxStoreCategoryQueryCriteria; import co.yixiang.utils.OrderUtil; import io.swagger.annotations.Api; @@ -61,7 +53,7 @@ public class StoreCategoryController { @PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_SELECT')") public ResponseEntity getYxStoreCategorys(YxStoreCategoryQueryCriteria criteria, Pageable pageable){ - List categoryDTOList = yxStoreCategoryService.queryAll(criteria); + List categoryDTOList = yxStoreCategoryService.queryAll(criteria); return new ResponseEntity(yxStoreCategoryService.buildTree(categoryDTOList),HttpStatus.OK); } @@ -76,7 +68,7 @@ public class StoreCategoryController { } resources.setAddTime(OrderUtil.getSecondTimestampTwo()); - return new ResponseEntity(yxStoreCategoryService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxStoreCategoryService.create(resources),HttpStatus.CREATED); } @Log("修改商品分类") @@ -88,7 +80,7 @@ public class StoreCategoryController { if(resources.getPid() > 0 && StrUtil.isBlank(resources.getPic())) { throw new BadRequestException("子分类图片必传"); } - yxStoreCategoryService.saveOrUpdate(resources); + yxStoreCategoryService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -100,8 +92,8 @@ public class StoreCategoryController { //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); String[] ids = id.split(","); for (String newId: ids) { - yxStoreCategoryService.removeById(Integer.valueOf(newId)); + yxStoreCategoryService.delete(Integer.valueOf(newId)); } return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreOrderController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreOrderController.java index 4c8e0e28..e40bbfa0 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreOrderController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreOrderController.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; import cn.hutool.core.util.IdUtil; @@ -13,26 +5,26 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import co.yixiang.annotation.AnonymousAccess; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.constant.ShopConstants; -import co.yixiang.dozer.service.IGenerator; import co.yixiang.enums.OrderInfoEnum; import co.yixiang.exception.BadRequestException; -import co.yixiang.tools.express.ExpressService; -import co.yixiang.tools.express.dao.ExpressInfo; +import co.yixiang.express.ExpressService; +import co.yixiang.express.dao.ExpressInfo; import co.yixiang.modules.activity.service.YxStorePinkService; +import co.yixiang.modules.activity.service.dto.YxStorePinkDTO; import co.yixiang.modules.shop.domain.YxStoreOrder; import co.yixiang.modules.shop.domain.YxStoreOrderStatus; -import co.yixiang.modules.shop.domain.YxWechatUser; import co.yixiang.modules.shop.service.*; import co.yixiang.modules.shop.service.dto.*; import co.yixiang.modules.shop.service.param.ExpressParam; +import co.yixiang.mp.service.WxMpTemplateMessageService; import co.yixiang.mp.service.YxTemplateService; +import co.yixiang.mp.service.YxWechatTemplateService; import co.yixiang.utils.OrderUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -49,7 +41,10 @@ import org.springframework.web.client.RestTemplate; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.text.MessageFormat; import java.text.ParseException; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -67,28 +62,29 @@ public class StoreOrderController { @Value("${yshop.apiUrl}") private String apiUrl; - private final IGenerator generator; + private final YxStoreOrderService yxStoreOrderService; private final YxStoreOrderStatusService yxStoreOrderStatusService; private final YxExpressService yxExpressService; private final YxWechatUserService wechatUserService; private final RedisTemplate redisTemplate; private final YxTemplateService templateService; + private final YxStorePinkService storePinkService; private final ExpressService expressService; - public StoreOrderController(IGenerator generator, YxStoreOrderService yxStoreOrderService, YxStoreOrderStatusService yxStoreOrderStatusService, + public StoreOrderController(YxStoreOrderService yxStoreOrderService, YxStoreOrderStatusService yxStoreOrderStatusService, YxExpressService yxExpressService, YxWechatUserService wechatUserService, RedisTemplate redisTemplate, - YxTemplateService templateService, YxStorePinkService storePinkService, + YxTemplateService templateService,YxStorePinkService storePinkService, ExpressService expressService) { - this.generator = generator; this.yxStoreOrderService = yxStoreOrderService; this.yxStoreOrderStatusService = yxStoreOrderStatusService; this.yxExpressService = yxExpressService; this.wechatUserService = wechatUserService; this.redisTemplate = redisTemplate; this.templateService = templateService; + this.storePinkService = storePinkService; this.expressService = expressService; } @@ -207,8 +203,8 @@ public class StoreOrderController { public ResponseEntity update(@Validated @RequestBody YxStoreOrder resources) { if (StrUtil.isBlank(resources.getDeliveryName())) throw new BadRequestException("请选择快递公司"); if (StrUtil.isBlank(resources.getDeliveryId())) throw new BadRequestException("快递单号不能为空"); - YxExpressDto expressDTO = generator.convert(yxExpressService.getById(Integer.valueOf(resources - .getDeliveryName())),YxExpressDto.class); + YxExpressDTO expressDTO = yxExpressService.findById(Integer.valueOf(resources + .getDeliveryName())); if (ObjectUtil.isNull(expressDTO)) { throw new BadRequestException("请先添加快递公司"); } @@ -226,11 +222,11 @@ public class StoreOrderController { + " 快递单号:" + resources.getDeliveryId()); storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo()); - yxStoreOrderStatusService.save(storeOrderStatus); + yxStoreOrderStatusService.create(storeOrderStatus); //模板消息通知 try { - YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new QueryWrapper().eq("uid",resources.getUid())),YxWechatUserDto.class); + YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid()); if (ObjectUtil.isNotNull(wechatUser)) { //公众号与小程序打通统一公众号模板通知 if (StrUtil.isNotBlank(wechatUser.getOpenid())) { @@ -257,7 +253,7 @@ public class StoreOrderController { @PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')") public ResponseEntity check(@Validated @RequestBody YxStoreOrder resources) { if (StrUtil.isBlank(resources.getVerifyCode())) throw new BadRequestException("核销码不能为空"); - YxStoreOrderDto storeOrderDTO = generator.convert(yxStoreOrderService.getById(resources.getId()),YxStoreOrderDto.class); + YxStoreOrderDTO storeOrderDTO = yxStoreOrderService.findById(resources.getId()); if(!resources.getVerifyCode().equals(storeOrderDTO.getVerifyCode())){ throw new BadRequestException("核销码不对"); } @@ -301,7 +297,7 @@ public class StoreOrderController { //模板消息通知 try { - YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new QueryWrapper().eq("uid",resources.getUid())),YxWechatUserDto.class); + YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid()); if (ObjectUtil.isNotNull(wechatUser)) { //公众号与小程序打通统一公众号模板通知 if (StrUtil.isNotBlank(wechatUser.getOpenid())) { @@ -325,7 +321,7 @@ public class StoreOrderController { @PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_DELETE')") public ResponseEntity delete(@PathVariable Integer id) { //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxStoreOrderService.removeById(id); + yxStoreOrderService.delete(id); return new ResponseEntity(HttpStatus.OK); } @@ -338,7 +334,7 @@ public class StoreOrderController { if (ObjectUtil.isNull(resources.getPayPrice())) throw new BadRequestException("请输入支付金额"); if (resources.getPayPrice().doubleValue() < 0) throw new BadRequestException("金额不能低于0"); - YxStoreOrderDto storeOrder = generator.convert(yxStoreOrderService.getById(resources.getId()),YxStoreOrderDto.class); + YxStoreOrderDTO storeOrder = yxStoreOrderService.findById(resources.getId()); //判断金额是否有变动,生成一个额外订单号去支付 int res = NumberUtil.compare(storeOrder.getPayPrice().doubleValue(), resources.getPayPrice().doubleValue()); @@ -348,7 +344,7 @@ public class StoreOrderController { } - yxStoreOrderService.saveOrUpdate(resources); + yxStoreOrderService.update(resources); YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus(); storeOrderStatus.setOid(resources.getId()); @@ -356,7 +352,7 @@ public class StoreOrderController { storeOrderStatus.setChangeMessage("修改订单价格为:" + resources.getPayPrice()); storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo()); - yxStoreOrderStatusService.save(storeOrderStatus); + yxStoreOrderStatusService.create(storeOrderStatus); return new ResponseEntity(HttpStatus.OK); } @@ -366,7 +362,7 @@ public class StoreOrderController { @PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')") public ResponseEntity editOrderRemark(@RequestBody YxStoreOrder resources) { if (StrUtil.isBlank(resources.getRemark())) throw new BadRequestException("请输入备注"); - yxStoreOrderService.saveOrUpdate(resources); + yxStoreOrderService.update(resources); return new ResponseEntity(HttpStatus.OK); } @@ -393,7 +389,7 @@ public class StoreOrderController { @RequestParam(name = "orderStatus") String orderStatus, @RequestParam(name = "orderType") String orderType, @RequestParam(name = "listContent") String listContent) throws IOException, ParseException { - List list; + List list; if(StringUtils.isEmpty(listContent)){ list = (List)getYxStoreList(criteria, pageable, orderStatus, orderType).get("content"); }else { diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreProductController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreProductController.java index bbd92bf4..5e2e5bc1 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreProductController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreProductController.java @@ -1,17 +1,10 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.constant.ShopConstants; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxStoreProduct; import co.yixiang.modules.shop.service.YxStoreProductService; import co.yixiang.modules.shop.service.dto.YxStoreProductQueryCriteria; @@ -63,7 +56,7 @@ public class StoreProductController { resources.setAddTime(OrderUtil.getSecondTimestampTwo()); if(ObjectUtil.isEmpty(resources.getGiveIntegral())) resources.setGiveIntegral(BigDecimal.ZERO); if(ObjectUtil.isEmpty(resources.getCost())) resources.setCost(BigDecimal.ZERO); - return new ResponseEntity(yxStoreProductService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxStoreProductService.create(resources),HttpStatus.CREATED); } @Log("修改商品") @@ -73,7 +66,7 @@ public class StoreProductController { @PreAuthorize("@el.check('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT')") public ResponseEntity update(@Validated @RequestBody YxStoreProduct resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxStoreProductService.saveOrUpdate(resources); + yxStoreProductService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -84,7 +77,7 @@ public class StoreProductController { @PreAuthorize("@el.check('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxStoreProductService.removeById(id); + yxStoreProductService.delete(id); return new ResponseEntity(HttpStatus.OK); } @@ -143,4 +136,4 @@ public class StoreProductController { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreProductReplyController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreProductReplyController.java index 55f7644b..e767cd85 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreProductReplyController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreProductReplyController.java @@ -1,14 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxStoreProductReply; import co.yixiang.modules.shop.service.YxStoreProductReplyService; import co.yixiang.modules.shop.service.dto.YxStoreProductReplyQueryCriteria; @@ -53,7 +47,7 @@ public class StoreProductReplyController { @PutMapping(value = "/yxStoreProductReply") @PreAuthorize("@el.check('admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_EDIT')") public ResponseEntity update(@Validated @RequestBody YxStoreProductReply resources){ - yxStoreProductReplyService.save(resources); + yxStoreProductReplyService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -66,7 +60,7 @@ public class StoreProductReplyController { YxStoreProductReply reply = new YxStoreProductReply(); reply.setIsDel(1); reply.setId(id); - yxStoreProductReplyService.saveOrUpdate(reply); + yxStoreProductReplyService.update(reply); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemConfigController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemConfigController.java index 99322955..c7ee7854 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemConfigController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemConfigController.java @@ -1,17 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; import cn.hutool.core.util.ObjectUtil; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; import co.yixiang.constant.ShopConstants; import co.yixiang.enums.RedisKeyEnum; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxSystemConfig; import co.yixiang.modules.shop.service.YxSystemConfigService; import co.yixiang.modules.shop.service.dto.YxSystemConfigQueryCriteria; @@ -20,7 +14,6 @@ import co.yixiang.mp.config.WxPayConfiguration; import co.yixiang.utils.RedisUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.cache.annotation.CacheEvict; @@ -63,7 +56,7 @@ public class SystemConfigController { JSONObject jsonObject = JSON.parseObject(jsonStr); jsonObject.forEach( (key,value)->{ - YxSystemConfig yxSystemConfig = yxSystemConfigService.getOne(new QueryWrapper().eq("key",key)); + YxSystemConfig yxSystemConfig = yxSystemConfigService.findByKey(key); YxSystemConfig yxSystemConfigModel = new YxSystemConfig(); yxSystemConfigModel.setMenuName(key); yxSystemConfigModel.setValue(value.toString()); @@ -77,10 +70,10 @@ public class SystemConfigController { } RedisUtil.set(key,value.toString(),0); if(ObjectUtil.isNull(yxSystemConfig)){ - yxSystemConfigService.save(yxSystemConfigModel); + yxSystemConfigService.create(yxSystemConfigModel); }else{ yxSystemConfigModel.setId(yxSystemConfig.getId()); - yxSystemConfigService.saveOrUpdate(yxSystemConfigModel); + yxSystemConfigService.update(yxSystemConfigModel); } } ); diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemGroupDataController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemGroupDataController.java index b2cb1bbf..391c79ed 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemGroupDataController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemGroupDataController.java @@ -1,16 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.constant.ShopConstants; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxSystemGroupData; @@ -21,6 +13,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; @@ -100,7 +93,7 @@ public class SystemGroupDataController { yxSystemGroupData.setSort(jsonObject.getInteger("sort")); yxSystemGroupData.setAddTime(OrderUtil.getSecondTimestampTwo()); - return new ResponseEntity(yxSystemGroupDataService.save(yxSystemGroupData),HttpStatus.CREATED); + return new ResponseEntity(yxSystemGroupDataService.create(yxSystemGroupData),HttpStatus.CREATED); } @Log("修改数据配置") @@ -148,7 +141,7 @@ public class SystemGroupDataController { yxSystemGroupData.setId(Integer.valueOf(jsonObject.get("id").toString())); - yxSystemGroupDataService.saveOrUpdate(yxSystemGroupData); + yxSystemGroupDataService.update(yxSystemGroupData); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -158,7 +151,7 @@ public class SystemGroupDataController { @PreAuthorize("@el.check('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxSystemGroupDataService.removeById(id); + yxSystemGroupDataService.delete(id); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreController.java index 0a91f07c..ac017bb7 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreController.java @@ -1,23 +1,13 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpUtil; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.constant.ShopConstants; -import co.yixiang.dozer.service.IGenerator; import co.yixiang.enums.RedisKeyEnum; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxSystemStore; import co.yixiang.modules.shop.service.YxSystemStoreService; -import co.yixiang.modules.shop.service.dto.YxSystemStoreDto; import co.yixiang.modules.shop.service.dto.YxSystemStoreQueryCriteria; import co.yixiang.utils.OrderUtil; import co.yixiang.utils.RedisUtil; @@ -34,8 +24,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; /** * @author hupeng @@ -47,10 +35,9 @@ import java.util.Arrays; public class SystemStoreController { private final YxSystemStoreService yxSystemStoreService; - private final IGenerator generator; - public SystemStoreController(YxSystemStoreService yxSystemStoreService, IGenerator generator) { + + public SystemStoreController(YxSystemStoreService yxSystemStoreService) { this.yxSystemStoreService = yxSystemStoreService; - this.generator = generator; } @@ -67,7 +54,7 @@ public class SystemStoreController { @GetMapping(value = "/download") @PreAuthorize("@el.check('yxSystemStore:list')") public void download(HttpServletResponse response, YxSystemStoreQueryCriteria criteria) throws IOException { - yxSystemStoreService.download(generator.convert(yxSystemStoreService.queryAll(criteria), YxSystemStoreDto.class), response); + yxSystemStoreService.download(yxSystemStoreService.queryAll(criteria), response); } @GetMapping @@ -99,7 +86,7 @@ public class SystemStoreController { public ResponseEntity create(@Validated @RequestBody YxSystemStore resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); resources.setAddTime(OrderUtil.getSecondTimestampTwo()); - return new ResponseEntity<>(yxSystemStoreService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(yxSystemStoreService.create(resources),HttpStatus.CREATED); } @PutMapping @@ -108,7 +95,7 @@ public class SystemStoreController { @PreAuthorize("@el.check('yxSystemStore:edit')") public ResponseEntity update(@Validated @RequestBody YxSystemStore resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxSystemStoreService.saveOrUpdate(resources); + yxSystemStoreService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -118,7 +105,7 @@ public class SystemStoreController { @DeleteMapping public ResponseEntity deleteAll(@RequestBody Integer[] ids) { //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxSystemStoreService.removeByIds(new ArrayList<>(Arrays.asList(ids))); + yxSystemStoreService.deleteAll(ids); return new ResponseEntity<>(HttpStatus.OK); } } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreStaffController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreStaffController.java index 831d36e6..5a7ab5a5 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreStaffController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreStaffController.java @@ -1,18 +1,10 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.dozer.service.IGenerator; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxSystemStoreStaff; import co.yixiang.modules.shop.service.YxSystemStoreStaffService; -import co.yixiang.modules.shop.service.dto.YxSystemStoreStaffDto; import co.yixiang.modules.shop.service.dto.YxSystemStoreStaffQueryCriteria; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,8 +17,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; /** * @author hupeng @@ -39,11 +29,8 @@ public class SystemStoreStaffController { private final YxSystemStoreStaffService yxSystemStoreStaffService; - private final IGenerator generator; - - public SystemStoreStaffController(YxSystemStoreStaffService yxSystemStoreStaffService, IGenerator generator) { + public SystemStoreStaffController(YxSystemStoreStaffService yxSystemStoreStaffService) { this.yxSystemStoreStaffService = yxSystemStoreStaffService; - this.generator = generator; } @Log("导出数据") @@ -51,7 +38,7 @@ public class SystemStoreStaffController { @GetMapping(value = "/download") @PreAuthorize("@el.check('yxSystemStoreStaff:list')") public void download(HttpServletResponse response, YxSystemStoreStaffQueryCriteria criteria) throws IOException { - yxSystemStoreStaffService.download(generator.convert(yxSystemStoreStaffService.queryAll(criteria), YxSystemStoreStaffDto.class), response); + yxSystemStoreStaffService.download(yxSystemStoreStaffService.queryAll(criteria), response); } @GetMapping @@ -67,7 +54,7 @@ public class SystemStoreStaffController { @ApiOperation("新增门店店员") @PreAuthorize("@el.check('yxSystemStoreStaff:add')") public ResponseEntity create(@Validated @RequestBody YxSystemStoreStaff resources){ - return new ResponseEntity<>(yxSystemStoreStaffService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(yxSystemStoreStaffService.create(resources),HttpStatus.CREATED); } @PutMapping @@ -75,7 +62,7 @@ public class SystemStoreStaffController { @ApiOperation("修改门店店员") @PreAuthorize("@el.check('yxSystemStoreStaff:edit')") public ResponseEntity update(@Validated @RequestBody YxSystemStoreStaff resources){ - yxSystemStoreStaffService.saveOrUpdate(resources); + yxSystemStoreStaffService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -85,7 +72,7 @@ public class SystemStoreStaffController { @DeleteMapping public ResponseEntity deleteAll(@RequestBody Integer[] ids) { //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxSystemStoreStaffService.removeByIds(new ArrayList<>(Arrays.asList(ids))); + yxSystemStoreStaffService.deleteAll(ids); return new ResponseEntity<>(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemUserLevelController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemUserLevelController.java index af4a1dee..e0bd7d35 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemUserLevelController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemUserLevelController.java @@ -1,14 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxSystemUserLevel; import co.yixiang.modules.shop.service.YxSystemUserLevelService; import co.yixiang.modules.shop.service.dto.YxSystemUserLevelQueryCriteria; @@ -52,7 +46,7 @@ public class SystemUserLevelController { public ResponseEntity create(@Validated @RequestBody YxSystemUserLevel resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); resources.setAddTime(OrderUtil.getSecondTimestampTwo()); - return new ResponseEntity(yxSystemUserLevelService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxSystemUserLevelService.create(resources),HttpStatus.CREATED); } @Log("修改") @@ -61,7 +55,7 @@ public class SystemUserLevelController { @PreAuthorize("@el.check('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_EDIT')") public ResponseEntity update(@Validated @RequestBody YxSystemUserLevel resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxSystemUserLevelService.saveOrUpdate(resources); + yxSystemUserLevelService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -71,7 +65,7 @@ public class SystemUserLevelController { @PreAuthorize("@el.check('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxSystemUserLevelService.removeById(id); + yxSystemUserLevelService.delete(id); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemUserTaskController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemUserTaskController.java index 8feb5719..7e7c7d00 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemUserTaskController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemUserTaskController.java @@ -1,19 +1,14 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxSystemUserTask; import co.yixiang.modules.shop.service.YxSystemUserTaskService; import co.yixiang.modules.shop.service.dto.YxSystemUserTaskQueryCriteria; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; @@ -44,7 +39,7 @@ public class SystemUserTaskController { @PreAuthorize("@el.check('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_SELECT')") public ResponseEntity getYxSystemUserTasks(YxSystemUserTaskQueryCriteria criteria, Pageable pageable){ - Sort sort = new Sort(Sort.Direction.ASC, "level_id"); + Sort sort = new Sort(Sort.Direction.ASC, "levelId"); Pageable pageableT = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sort); @@ -57,7 +52,7 @@ public class SystemUserTaskController { @PostMapping(value = "/yxSystemUserTask") @PreAuthorize("@el.check('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_CREATE')") public ResponseEntity create(@Validated @RequestBody YxSystemUserTask resources){ - return new ResponseEntity(yxSystemUserTaskService.save(resources),HttpStatus.CREATED); + return new ResponseEntity(yxSystemUserTaskService.create(resources),HttpStatus.CREATED); } @Log("修改") @@ -66,7 +61,7 @@ public class SystemUserTaskController { @PreAuthorize("@el.check('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_EDIT')") public ResponseEntity update(@Validated @RequestBody YxSystemUserTask resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxSystemUserTaskService.saveOrUpdate(resources); + yxSystemUserTaskService.update(resources); return new ResponseEntity(HttpStatus.NO_CONTENT); } @@ -76,7 +71,7 @@ public class SystemUserTaskController { @PreAuthorize("@el.check('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_DELETE')") public ResponseEntity delete(@PathVariable Integer id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxSystemUserTaskService.removeById(id); + yxSystemUserTaskService.delete(id); return new ResponseEntity(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/UserBillController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/UserBillController.java index 2f141ed6..1ca89264 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/UserBillController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/UserBillController.java @@ -1,14 +1,6 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.modules.shop.service.YxUserBillService; import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria; import io.swagger.annotations.Api; @@ -49,4 +41,4 @@ public class UserBillController { -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/UserRechargeController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/UserRechargeController.java index 7e20817b..1283431d 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/UserRechargeController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/UserRechargeController.java @@ -1,18 +1,10 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.rest; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.dozer.service.IGenerator; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxUserRecharge; import co.yixiang.modules.shop.service.YxUserRechargeService; -import co.yixiang.modules.shop.service.dto.YxUserRechargeDto; import co.yixiang.modules.shop.service.dto.YxUserRechargeQueryCriteria; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,8 +17,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; /** * @author hupeng @@ -38,10 +28,9 @@ import java.util.Arrays; public class UserRechargeController { private final YxUserRechargeService yxUserRechargeService; - private final IGenerator generator; - public UserRechargeController(YxUserRechargeService yxUserRechargeService, IGenerator generator) { + + public UserRechargeController(YxUserRechargeService yxUserRechargeService) { this.yxUserRechargeService = yxUserRechargeService; - this.generator = generator; } @Log("导出数据") @@ -49,7 +38,7 @@ public class UserRechargeController { @GetMapping(value = "/download") @PreAuthorize("@el.check('yxUserRecharge:list')") public void download(HttpServletResponse response, YxUserRechargeQueryCriteria criteria) throws IOException { - yxUserRechargeService.download(generator.convert(yxUserRechargeService.queryAll(criteria), YxUserRechargeDto.class), response); + yxUserRechargeService.download(yxUserRechargeService.queryAll(criteria), response); } @GetMapping @@ -65,7 +54,7 @@ public class UserRechargeController { @ApiOperation("新增充值管理") @PreAuthorize("@el.check('yxUserRecharge:add')") public ResponseEntity create(@Validated @RequestBody YxUserRecharge resources){ - return new ResponseEntity<>(yxUserRechargeService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(yxUserRechargeService.create(resources),HttpStatus.CREATED); } @@ -76,7 +65,7 @@ public class UserRechargeController { @DeleteMapping public ResponseEntity deleteAll(@RequestBody Integer[] ids) { //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - yxUserRechargeService.removeByIds(new ArrayList<>(Arrays.asList(ids))); + yxUserRechargeService.deleteAll(ids); return new ResponseEntity<>(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/YxWechatUserController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/YxWechatUserController.java deleted file mode 100644 index 983241e6..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/YxWechatUserController.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.rest; -import java.util.Arrays; -import co.yixiang.dozer.service.IGenerator; -import lombok.AllArgsConstructor; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.modules.shop.domain.YxWechatUser; -import co.yixiang.modules.shop.service.YxWechatUserService; -import co.yixiang.modules.shop.service.dto.YxWechatUserQueryCriteria; -import co.yixiang.modules.shop.service.dto.YxWechatUserDto; -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.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@AllArgsConstructor -@Api(tags = "微信用户管理") -@RestController -@RequestMapping("/api/yxWechatUser") -public class YxWechatUserController { - - private final YxWechatUserService yxWechatUserService; - private final IGenerator generator; - - - @Log("导出数据") - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('admin','yxWechatUser:list')") - public void download(HttpServletResponse response, YxWechatUserQueryCriteria criteria) throws IOException { - yxWechatUserService.download(generator.convert(yxWechatUserService.queryAll(criteria), YxWechatUserDto.class), response); - } - - @GetMapping - @Log("查询微信用户") - @ApiOperation("查询微信用户") - @PreAuthorize("@el.check('admin','yxWechatUser:list')") - public ResponseEntity getYxWechatUsers(YxWechatUserQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(yxWechatUserService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @Log("新增微信用户") - @ApiOperation("新增微信用户") - @PreAuthorize("@el.check('admin','yxWechatUser:add')") - public ResponseEntity create(@Validated @RequestBody YxWechatUser resources){ - return new ResponseEntity<>(yxWechatUserService.save(resources),HttpStatus.CREATED); - } - - @PutMapping - @Log("修改微信用户") - @ApiOperation("修改微信用户") - @PreAuthorize("@el.check('admin','yxWechatUser:edit')") - public ResponseEntity update(@Validated @RequestBody YxWechatUser resources){ - yxWechatUserService.updateById(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除微信用户") - @ApiOperation("删除微信用户") - @PreAuthorize("@el.check('admin','yxWechatUser:del')") - @DeleteMapping - public ResponseEntity deleteAll(@RequestBody Integer[] ids) { - Arrays.asList(ids).forEach(id->{ - yxWechatUserService.removeById(id); - }); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxExpressService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxExpressService.java index 0e08ccda..8402477d 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxExpressService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxExpressService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxExpress; -import co.yixiang.modules.shop.service.dto.YxExpressDto; +import co.yixiang.modules.shop.service.dto.YxExpressDTO; import co.yixiang.modules.shop.service.dto.YxExpressQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-12 */ -public interface YxExpressService extends BaseService{ +//@CacheConfig(cacheNames = "yxExpress") +public interface YxExpressService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxExpressQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxExpressQueryCriteria criteria); + //@Cacheable + List queryAll(YxExpressQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxExpressDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxExpressDTO create(YxExpress resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxExpress resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxMaterialGroupService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxMaterialGroupService.java index a9b2b034..355e73a7 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxMaterialGroupService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxMaterialGroupService.java @@ -1,13 +1,5 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxMaterialGroup; import co.yixiang.modules.shop.service.dto.YxMaterialGroupDto; import co.yixiang.modules.shop.service.dto.YxMaterialGroupQueryCriteria; @@ -19,11 +11,11 @@ import javax.servlet.http.HttpServletResponse; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ -public interface YxMaterialGroupService extends BaseService{ +public interface YxMaterialGroupService { -/** + /** * 查询数据分页 * @param criteria 条件 * @param pageable 分页参数 @@ -36,13 +28,35 @@ public interface YxMaterialGroupService extends BaseService{ * @param criteria 条件参数 * @return List */ - List queryAll(YxMaterialGroupQueryCriteria criteria); + List queryAll(YxMaterialGroupQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / + * 根据ID查询 + * @param id ID + * @return YxMaterialGroupDto + */ + YxMaterialGroupDto findById(String id); + + /** + * 创建 + * @param resources / + * @return YxMaterialGroupDto */ - void download(List all, HttpServletResponse response) throws IOException; -} + YxMaterialGroupDto create(YxMaterialGroup resources); + + /** + * 编辑 + * @param resources / + */ + void update(YxMaterialGroup resources); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(String[] ids); + + void deleteById(String id); + + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxMaterialService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxMaterialService.java index aa9613f9..15ffbb9f 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxMaterialService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxMaterialService.java @@ -1,13 +1,5 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxMaterial; import co.yixiang.modules.shop.service.dto.YxMaterialDto; import co.yixiang.modules.shop.service.dto.YxMaterialQueryCriteria; @@ -19,11 +11,11 @@ import javax.servlet.http.HttpServletResponse; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ -public interface YxMaterialService extends BaseService{ +public interface YxMaterialService { -/** + /** * 查询数据分页 * @param criteria 条件 * @param pageable 分页参数 @@ -36,13 +28,36 @@ public interface YxMaterialService extends BaseService{ * @param criteria 条件参数 * @return List */ - List queryAll(YxMaterialQueryCriteria criteria); + List queryAll(YxMaterialQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / + * 根据ID查询 + * @param id ID + * @return YxMaterialDto + */ + YxMaterialDto findById(String id); + + /** + * 创建 + * @param resources / + * @return YxMaterialDto */ - void download(List all, HttpServletResponse response) throws IOException; -} + YxMaterialDto create(YxMaterial resources); + + /** + * 编辑 + * @param resources / + */ + void update(YxMaterial resources); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(String[] ids); + + void deleteById(String id); + + + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreCartService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreCartService.java deleted file mode 100644 index 123f0029..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreCartService.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.shop.domain.YxStoreCart; -import co.yixiang.modules.shop.service.dto.CountDto; -import co.yixiang.modules.shop.service.dto.YxStoreCartDto; -import co.yixiang.modules.shop.service.dto.YxStoreCartQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -public interface YxStoreCartService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(YxStoreCartQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(YxStoreCartQueryCriteria criteria); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; - - List findCateName(); -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java index 0f9fff6f..0e87e93e 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreCategoryService.java @@ -1,50 +1,80 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxStoreCategory; -import co.yixiang.modules.shop.service.dto.YxStoreCategoryDto; +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; -import java.io.IOException; + import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-03 */ -public interface YxStoreCategoryService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreCategory") +public interface YxStoreCategoryService { -/** + /** + * 导出数据 + * @param queryAll 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; + + + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreCategoryQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreCategoryQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreCategoryQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxStoreCategoryDTO findById(Integer id); - Object buildTree(List categoryDTOList); -} + YxStoreCategoryDTO findByName(String name); + + /** + * 创建 + * @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-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderCartInfoService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderCartInfoService.java deleted file mode 100644 index 622854c9..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderCartInfoService.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.shop.domain.YxStoreOrderCartInfo; -import co.yixiang.modules.shop.service.dto.YxStoreOrderCartInfoDto; -import co.yixiang.modules.shop.service.dto.YxStoreOrderCartInfoQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -public interface YxStoreOrderCartInfoService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(YxStoreOrderCartInfoQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(YxStoreOrderCartInfoQueryCriteria criteria); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderService.java index 2ab98a3f..cbcf2632 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderService.java @@ -1,69 +1,85 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxStoreOrder; import co.yixiang.modules.shop.service.dto.OrderCountDto; -import co.yixiang.modules.shop.service.dto.OrderTimeDataDto; -import co.yixiang.modules.shop.service.dto.YxStoreOrderDto; +import co.yixiang.modules.shop.service.dto.OrderTimeDataDTO; +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; -import java.io.IOException; +import java.text.ParseException; + import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-14 */ -public interface YxStoreOrderService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreOrder") +public interface YxStoreOrderService { -/** + OrderCountDto getOrderCount(); + + OrderTimeDataDTO getOrderTimeData(); + + Map chartCount(); + + String orderType(int id, int pinkId, int combinationId, int seckillId,int bargainId,int shippingType); + + void refund(YxStoreOrder resources); + + void download(List queryAll, HttpServletResponse response) throws IOException, ParseException; + + + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreOrderQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreOrderQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreOrderQueryCriteria criteria); - - YxStoreOrderDto create(YxStoreOrder resources); - - void update(YxStoreOrder resources); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据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); - Map queryAll(List ids); - - - String orderType(int id,int pinkId, int combinationId,int seckillId, - int bargainId,int shippingType); - - void refund(YxStoreOrder resources); - - OrderCountDto getOrderCount(); - - OrderTimeDataDto getOrderTimeData(); - - Map chartCount(); + Map queryAll(List ids); } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderStatusService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderStatusService.java index ed9d5d75..49ec7711 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderStatusService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreOrderStatusService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxStoreOrderStatus; -import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusDto; +import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusDTO; import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-02 */ -public interface YxStoreOrderStatusService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreOrderStatus") +public interface YxStoreOrderStatusService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreOrderStatusQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreOrderStatusQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreOrderStatusQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据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-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrResultService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrResultService.java deleted file mode 100644 index cc761433..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrResultService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.shop.domain.YxStoreProductAttrResult; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -public interface YxStoreProductAttrResultService extends BaseService{ - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrService.java deleted file mode 100644 index cfa5bac9..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.shop.domain.YxStoreProductAttr; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -public interface YxStoreProductAttrService extends BaseService{ - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrValueService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrValueService.java deleted file mode 100644 index ab9e2681..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductAttrValueService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.shop.domain.YxStoreProductAttrValue; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -public interface YxStoreProductAttrValueService extends BaseService{ - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java index 04cc9bc6..163f23a2 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductReplyService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxStoreProductReply; -import co.yixiang.modules.shop.service.dto.YxStoreProductReplyDto; +import co.yixiang.modules.shop.service.dto.YxStoreProductReplyDTO; import co.yixiang.modules.shop.service.dto.YxStoreProductReplyQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-03 */ -public interface YxStoreProductReplyService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreProductReply") +public interface YxStoreProductReplyService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreProductReplyQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreProductReplyQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreProductReplyQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据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-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java index ce674cc5..1a848429 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxStoreProductService.java @@ -1,63 +1,79 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + 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.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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-04 */ -public interface YxStoreProductService extends BaseService{ +//@CacheConfig(cacheNames = "yxStoreProduct") +public interface YxStoreProductService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxStoreProductQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxStoreProductQueryCriteria criteria); + //@Cacheable + List queryAll(YxStoreProductQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据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, int status); + void onSale(Integer id, Integer status); - List isFormatAttr(Integer id, String jsonStr); + List isFormatAttr(Integer id, String jsonStr); void createProductAttr(Integer id, String jsonStr); - void clearProductAttr(Integer id,boolean isActice); + void setResult(Map map, Integer id); - 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-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemConfigService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemConfigService.java index 3e7a42df..26084cae 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemConfigService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemConfigService.java @@ -1,50 +1,66 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxSystemConfig; -import co.yixiang.modules.shop.service.dto.YxSystemConfigDto; +import co.yixiang.modules.shop.service.dto.YxSystemConfigDTO; import co.yixiang.modules.shop.service.dto.YxSystemConfigQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-10 */ -public interface YxSystemConfigService extends BaseService{ +//@CacheConfig(cacheNames = "yxSystemConfig") +public interface YxSystemConfigService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxSystemConfigQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxSystemConfigQueryCriteria criteria); + //@Cacheable + List queryAll(YxSystemConfigQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxSystemConfigDTO findById(Integer id); - YxSystemConfig findByKey(String store_brokerage_statu); -} + /** + * 创建 + * @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-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java index 581bb9d9..1df46faa 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemGroupDataService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxSystemGroupData; -import co.yixiang.modules.shop.service.dto.YxSystemGroupDataDto; +import co.yixiang.modules.shop.service.dto.YxSystemGroupDataDTO; import co.yixiang.modules.shop.service.dto.YxSystemGroupDataQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-18 */ -public interface YxSystemGroupDataService extends BaseService{ +//@CacheConfig(cacheNames = "yxSystemGroupData") +public interface YxSystemGroupDataService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxSystemGroupDataQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxSystemGroupDataQueryCriteria criteria); + //@Cacheable + List queryAll(YxSystemGroupDataQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据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-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreService.java index b376bdf1..a4a885eb 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreService.java @@ -1,13 +1,5 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxSystemStore; import co.yixiang.modules.shop.service.dto.YxSystemStoreDto; import co.yixiang.modules.shop.service.dto.YxSystemStoreQueryCriteria; @@ -19,11 +11,11 @@ import javax.servlet.http.HttpServletResponse; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-03 */ -public interface YxSystemStoreService extends BaseService{ +public interface YxSystemStoreService { -/** + /** * 查询数据分页 * @param criteria 条件 * @param pageable 分页参数 @@ -36,7 +28,33 @@ public interface YxSystemStoreService extends BaseService{ * @param criteria 条件参数 * @return List */ - List queryAll(YxSystemStoreQueryCriteria criteria); + List queryAll(YxSystemStoreQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id ID + * @return YxSystemStoreDto + */ + YxSystemStoreDto findById(Integer id); + + /** + * 创建 + * @param resources / + * @return YxSystemStoreDto + */ + YxSystemStoreDto create(YxSystemStore resources); + + /** + * 编辑 + * @param resources / + */ + void update(YxSystemStore resources); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Integer[] ids); /** * 导出数据 @@ -45,4 +63,4 @@ public interface YxSystemStoreService extends BaseService{ * @throws IOException / */ void download(List all, HttpServletResponse response) throws IOException; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreStaffService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreStaffService.java index 92899f86..d294afa4 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreStaffService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemStoreStaffService.java @@ -1,13 +1,5 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxSystemStoreStaff; import co.yixiang.modules.shop.service.dto.YxSystemStoreStaffDto; import co.yixiang.modules.shop.service.dto.YxSystemStoreStaffQueryCriteria; @@ -19,11 +11,11 @@ import javax.servlet.http.HttpServletResponse; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-22 */ -public interface YxSystemStoreStaffService extends BaseService{ +public interface YxSystemStoreStaffService { -/** + /** * 查询数据分页 * @param criteria 条件 * @param pageable 分页参数 @@ -36,7 +28,33 @@ public interface YxSystemStoreStaffService extends BaseService */ - List queryAll(YxSystemStoreStaffQueryCriteria criteria); + List queryAll(YxSystemStoreStaffQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id ID + * @return YxSystemStoreStaffDto + */ + YxSystemStoreStaffDto findById(Integer id); + + /** + * 创建 + * @param resources / + * @return YxSystemStoreStaffDto + */ + YxSystemStoreStaffDto create(YxSystemStoreStaff resources); + + /** + * 编辑 + * @param resources / + */ + void update(YxSystemStoreStaff resources); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Integer[] ids); /** * 导出数据 @@ -45,4 +63,4 @@ public interface YxSystemStoreStaffService extends BaseService all, HttpServletResponse response) throws IOException; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemUserLevelService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemUserLevelService.java index 24417927..4fd8de0a 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemUserLevelService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemUserLevelService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxSystemUserLevel; -import co.yixiang.modules.shop.service.dto.YxSystemUserLevelDto; +import co.yixiang.modules.shop.service.dto.YxSystemUserLevelDTO; import co.yixiang.modules.shop.service.dto.YxSystemUserLevelQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-04 */ -public interface YxSystemUserLevelService extends BaseService{ +//@CacheConfig(cacheNames = "yxSystemUserLevel") +public interface YxSystemUserLevelService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxSystemUserLevelQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxSystemUserLevelQueryCriteria criteria); + //@Cacheable + List queryAll(YxSystemUserLevelQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxSystemUserLevelDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxSystemUserLevelDTO create(YxSystemUserLevel resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxSystemUserLevel resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemUserTaskService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemUserTaskService.java index df08ac1f..17af5fe7 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemUserTaskService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxSystemUserTaskService.java @@ -1,48 +1,66 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxSystemUserTask; -import co.yixiang.modules.shop.service.dto.YxSystemUserTaskDto; +import co.yixiang.modules.shop.service.dto.YxSystemUserTaskDTO; import co.yixiang.modules.shop.service.dto.YxSystemUserTaskQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-04 */ -public interface YxSystemUserTaskService extends BaseService{ +//@CacheConfig(cacheNames = "yxSystemUserTask") +public interface YxSystemUserTaskService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxSystemUserTaskQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxSystemUserTaskQueryCriteria criteria); + //@Cacheable + List queryAll(YxSystemUserTaskQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id + * @return + */ + //@Cacheable(key = "#p0") + YxSystemUserTaskDTO findById(Integer id); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxSystemUserTaskDTO create(YxSystemUserTask resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxSystemUserTask resources); + + /** + * 删除 + * @param id + */ + //@CacheEvict(allEntries = true) + void delete(Integer id); + + List> getTaskType(); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserBillService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserBillService.java index 215359b4..eff5574b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserBillService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserBillService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxUserBill; -import co.yixiang.modules.shop.service.dto.YxUserBillDto; +import co.yixiang.modules.shop.service.dto.YxUserBillDTO; import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-06 */ -public interface YxUserBillService extends BaseService{ +//@CacheConfig(cacheNames = "yxUserBill") +public interface YxUserBillService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxUserBillQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxUserBillQueryCriteria criteria); + //@Cacheable + List queryAll(YxUserBillQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据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-shop/src/main/java/co/yixiang/modules/shop/service/YxUserRechargeService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserRechargeService.java index ae088e4f..91551e92 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserRechargeService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserRechargeService.java @@ -1,13 +1,5 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxUserRecharge; import co.yixiang.modules.shop.service.dto.YxUserRechargeDto; import co.yixiang.modules.shop.service.dto.YxUserRechargeQueryCriteria; @@ -19,11 +11,11 @@ import javax.servlet.http.HttpServletResponse; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-02 */ -public interface YxUserRechargeService extends BaseService{ +public interface YxUserRechargeService { -/** + /** * 查询数据分页 * @param criteria 条件 * @param pageable 分页参数 @@ -36,7 +28,29 @@ public interface YxUserRechargeService extends BaseService{ * @param criteria 条件参数 * @return List */ - List queryAll(YxUserRechargeQueryCriteria criteria); + List queryAll(YxUserRechargeQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id ID + * @return YxUserRechargeDto + */ + YxUserRechargeDto findById(Integer id); + + /** + * 创建 + * @param resources / + * @return YxUserRechargeDto + */ + YxUserRechargeDto create(YxUserRecharge resources); + + + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Integer[] ids); /** * 导出数据 @@ -45,4 +59,4 @@ public interface YxUserRechargeService extends BaseService{ * @throws IOException / */ void download(List all, HttpServletResponse response) throws IOException; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserService.java index b5ba786c..06d868da 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxUserService.java @@ -1,55 +1,71 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxUser; -import co.yixiang.modules.shop.service.dto.UserMoneyDto; -import co.yixiang.modules.shop.service.dto.YxUserDto; +import co.yixiang.modules.shop.service.dto.UserMoneyDTO; +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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-06 */ -public interface YxUserService extends BaseService{ +//@CacheConfig(cacheNames = "yxUser") +public interface YxUserService { -/** + void updateMoney(UserMoneyDTO param); + + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxUserQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxUserQueryCriteria criteria); + //@Cacheable + List queryAll(YxUserQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param uid + * @return + */ + //@Cacheable(key = "#p0") + YxUserDTO findById(Integer uid); - void onStatus(Integer id, int status); + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxUserDTO create(YxUser resources); - void updateMoney(UserMoneyDto param); + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxUser resources); - void incBrokeragePrice(double doubleValue, Integer uid); -} + /** + * 删除 + * @param uid + */ + //@CacheEvict(allEntries = true) + void delete(Integer uid); + + void onStatus(Integer uid, Integer status); + + void incBrokeragePrice(double price, int uid); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxWechatUserService.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxWechatUserService.java index ee13f7bc..c21a2293 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxWechatUserService.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/YxWechatUserService.java @@ -1,48 +1,64 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.shop.domain.YxWechatUser; -import co.yixiang.modules.shop.service.dto.YxWechatUserDto; +import co.yixiang.modules.shop.service.dto.YxWechatUserDTO; import co.yixiang.modules.shop.service.dto.YxWechatUserQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; + import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-13 */ -public interface YxWechatUserService extends BaseService{ +//@CacheConfig(cacheNames = "yxWechatUser") +public interface YxWechatUserService { -/** + /** * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map + * @param criteria + * @param pageable + * @return */ + //@Cacheable Map queryAll(YxWechatUserQueryCriteria criteria, Pageable pageable); /** * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List + * @param criteria + * @return */ - List queryAll(YxWechatUserQueryCriteria criteria); + //@Cacheable + List queryAll(YxWechatUserQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param uid + * @return + */ + //@Cacheable(key = "#p0") + YxWechatUserDTO findById(Integer uid); + + /** + * 创建 + * @param resources + * @return + */ + //@CacheEvict(allEntries = true) + YxWechatUserDTO create(YxWechatUser resources); + + /** + * 编辑 + * @param resources + */ + //@CacheEvict(allEntries = true) + void update(YxWechatUser resources); + + /** + * 删除 + * @param uid + */ + //@CacheEvict(allEntries = true) + void delete(Integer uid); +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ChartDataDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ChartDataDTO.java new file mode 100644 index 00000000..51395e76 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ChartDataDTO.java @@ -0,0 +1,14 @@ +package co.yixiang.modules.shop.service.dto; + +/** + * @ClassName ChartDataDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/11/25 + **/ +//@Data +public interface ChartDataDTO{ + + // @Value("#{target.adminCount}") + Double getNum(); + String getTime(); +} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ChartDataDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ChartDataDto.java deleted file mode 100644 index eb8e40e8..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ChartDataDto.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; - -/** - * @ClassName ChartDataDTO - * @Author hupeng <610796224@qq.com> - * @Date 2019/11/25 - **/ -@Data -public class ChartDataDto { - - // @Value("#{target.adminCount}") - private Double num; - private String time; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/CountDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/CountDto.java index 1718c514..a2e8a612 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/CountDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/CountDto.java @@ -1,17 +1,9 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; -@Data -public class CountDto { +//@Data +public interface CountDto { - private String catename; + String getCatename(); } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/DetailDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/DetailDTO.java new file mode 100644 index 00000000..104db19a --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/dto/DetailDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/DetailDto.java deleted file mode 100644 index f589b1af..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/DetailDto.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -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-shop/src/main/java/co/yixiang/modules/shop/service/dto/FromatDetailDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/FromatDetailDTO.java new file mode 100644 index 00000000..80c9a4d8 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/dto/FromatDetailDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/FromatDetailDto.java deleted file mode 100644 index f304a4e7..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/FromatDetailDto.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -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-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderCountDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderCountDto.java index 1ea5ddd2..58ed0c39 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderCountDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderCountDto.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderTimeDataDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderTimeDataDTO.java similarity index 54% rename from yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderTimeDataDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderTimeDataDTO.java index 087ca4ee..599b441d 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderTimeDataDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/OrderTimeDataDTO.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -18,7 +10,7 @@ import java.io.Serializable; * @Date 2019/11/25 **/ @Data -public class OrderTimeDataDto implements Serializable { +public class OrderTimeDataDTO implements Serializable { private Double todayPrice; //今日成交额 private Integer todayCount; //今日订单数 private Double proPrice; //昨日成交额 @@ -29,8 +21,8 @@ public class OrderTimeDataDto implements Serializable { private Integer lastWeekCount;//上周 private Double lastWeekPrice; //上周 - private Integer userCount; - private Integer orderCount; + private Long userCount; + private Long orderCount; private Double priceCount; - private Integer goodsCount; + private Long goodsCount; } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDTO.java similarity index 55% rename from yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDTO.java index 5e51fcba..4323798a 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/ProductFormatDTO.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -19,7 +11,7 @@ import java.util.Map; **/ @Data -public class ProductFormatDto { +public class ProductFormatDTO { private Double price; @@ -34,6 +26,6 @@ public class ProductFormatDto { //private List> detail; private Map detail; private Boolean check; - + } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDTO.java new file mode 100644 index 00000000..8c502675 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDTO.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +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-shop/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDto.java deleted file mode 100644 index fbcac4fe..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/StoreOrderCartInfoDto.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; - -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-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserBillDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserBillDTO.java new file mode 100644 index 00000000..1d038cda --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserBillDTO.java @@ -0,0 +1,18 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +/** + * @ClassName UserBillDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/12/11 + **/ +@Data +public class UserBillDTO { + private Integer pm; + private String gtitle; + private String category; + private String type; + private Double number; + private String nickname; +} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserBillDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserBillDto.java deleted file mode 100644 index 3584bf5c..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserBillDto.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; - -/** - * @ClassName UserBillDTO - * @Author hupeng <610796224@qq.com> - * @Date 2019/12/11 - **/ -@Data -public class UserBillDto { - private Integer pm; - private String gtitle; - private String category; - private String type; - private Double number; - private String nickname; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserMoneyDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserMoneyDTO.java new file mode 100644 index 00000000..e8ca278e --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserMoneyDTO.java @@ -0,0 +1,23 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @ClassName UserMoneyDTO + * @Author hupeng <610796224@qq.com> + * @Date 2019/12/4 + **/ +@Data +public class UserMoneyDTO implements Serializable { + @NotNull(message = "参数缺失") + private Integer uid; + @NotNull(message = "请选择修改余额方式") + private Integer ptype; + @NotNull(message = "金额必填") + @Min(message = "最低金额为0",value = 0) + private Double money; +} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserMoneyDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserMoneyDto.java deleted file mode 100644 index 7df5e261..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/UserMoneyDto.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * @ClassName UserMoneyDTO - * @Author hupeng <610796224@qq.com> - * @Date 2019/12/4 - **/ -@Data -public class UserMoneyDto implements Serializable { - //@NotNull(message = "参数缺失") - private Integer uid; - //@NotNull(message = "请选择修改余额方式") - private Integer ptype; - //@NotNull(message = "金额必填") - @Min(message = "最低金额为0",value = 0) - private Double money; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressDTO.java new file mode 100644 index 00000000..11873f1f --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressDTO.java @@ -0,0 +1,29 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** +* @author hupeng +* @date 2019-12-12 +*/ +@Data +public class YxExpressDTO implements Serializable { + + // 快递公司id + private Integer id; + + // 快递公司简称 + private String code; + + // 快递公司全称 + private String name; + + // 排序 + private Integer sort; + + // 是否显示 + private Integer isShow; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressDto.java deleted file mode 100644 index ae87bab0..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressDto.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxExpressDto implements Serializable { - - /** 快递公司id */ - private Integer id; - - /** 快递公司简称 */ - private String code; - - /** 快递公司全称 */ - private String name; - - /** 排序 */ - private Integer sort; - - /** 是否显示 */ - private Integer isShow; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressQueryCriteria.java index dc626910..8f006374 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxExpressQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-12 */ @Data public class YxExpressQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialDto.java index a60401da..63bcf1d5 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialDto.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -14,7 +6,7 @@ import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ @Data public class YxMaterialDto implements Serializable { @@ -22,16 +14,12 @@ public class YxMaterialDto implements Serializable { /** PK */ private String id; - /** 所属租户 */ - private String userId; - /** 逻辑删除标记(0:显示;1:隐藏) */ + private String delFlag; /** 创建时间 */ private Timestamp createTime; - /** 最后更新时间 */ - private Timestamp updateTime; /** 创建者ID */ private String createId; @@ -47,4 +35,4 @@ public class YxMaterialDto implements Serializable { /** 素材链接 */ private String url; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialGroupDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialGroupDto.java index 5aa38661..288262af 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialGroupDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialGroupDto.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -14,10 +6,11 @@ import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ @Data public class YxMaterialGroupDto implements Serializable { + /** PK */ private String id; @@ -32,4 +25,4 @@ public class YxMaterialGroupDto implements Serializable { /** 分组名 */ private String name; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialGroupQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialGroupQueryCriteria.java index 8caa0236..ba461adb 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialGroupQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialGroupQueryCriteria.java @@ -1,21 +1,13 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; import java.util.List; -import co.yixiang.annotation.Query; + /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ @Data public class YxMaterialGroupQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialQueryCriteria.java index 8fc1a733..d9cebc59 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxMaterialQueryCriteria.java @@ -1,21 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; +import co.yixiang.annotation.Query; import lombok.Data; import java.util.List; -import co.yixiang.annotation.Query; + /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ @Data public class YxMaterialQueryCriteria{ -} + @Query + private String groupId; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCartDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCartDto.java deleted file mode 100644 index 5ec89c76..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCartDto.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxStoreCartDto implements Serializable { - - /** 购物车表ID */ - private Long id; - - /** 用户ID */ - private Integer uid; - - /** 类型 */ - private String type; - - /** 商品ID */ - private Integer productId; - - /** 商品属性 */ - private String productAttrUnique; - - /** 商品数量 */ - private Integer cartNum; - - /** 添加时间 */ - private Integer addTime; - - /** 0 = 未购买 1 = 已购买 */ - private Integer isPay; - - /** 是否删除 */ - private Integer isDel; - - /** 是否为立即购买 */ - private Integer isNew; - - /** 拼团id */ - private Integer combinationId; - - /** 秒杀产品ID */ - private Integer seckillId; - - /** 砍价id */ - private Integer bargainId; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCartQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCartQueryCriteria.java deleted file mode 100644 index 18079a4b..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCartQueryCriteria.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxStoreCartQueryCriteria{ -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryDTO.java new file mode 100644 index 00000000..b1b6ba90 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryDto.java deleted file mode 100644 index c08266a7..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryDto.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -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 2020-05-12 -*/ -@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; - - /** 删除状态 */ - private Integer isDel; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private List children; - - public String getLabel() { - return cateName; - } -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryQueryCriteria.java index f01c06c0..99bf3001 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategoryQueryCriteria.java @@ -1,21 +1,19 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-03 */ @Data public class YxStoreCategoryQueryCriteria{ -} + + // 模糊 + @Query(type = Query.Type.INNER_LIKE) + private String cateName; + + @Query + private Integer isDel = 0; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategorySmallDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategorySmallDTO.java new file mode 100644 index 00000000..d7f1c457 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategorySmallDTO.java @@ -0,0 +1,26 @@ +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 YxStoreCategorySmallDTO implements Serializable { + + // 商品分类表ID + private Integer id; + + + // 分类名称 + private String cateName; + + + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategorySmallDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategorySmallDto.java deleted file mode 100644 index 75bf3ea9..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreCategorySmallDto.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -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 YxStoreCategorySmallDto implements Serializable { - - // 商品分类表ID - private Integer id; - - - // 分类名称 - private String cateName; - - - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderCartInfoDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderCartInfoDto.java deleted file mode 100644 index 13b19590..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderCartInfoDto.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxStoreOrderCartInfoDto implements Serializable { - - private Integer id; - - /** 订单id */ - private Integer oid; - - /** 购物车id */ - private Integer cartId; - - /** 商品ID */ - private Integer productId; - - /** 购买东西的详细信息 */ - private String cartInfo; - - /** 唯一id */ - private String unique; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderCartInfoQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderCartInfoQueryCriteria.java deleted file mode 100644 index e0200ebc..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderCartInfoQueryCriteria.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxStoreOrderCartInfoQueryCriteria{ -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDTO.java similarity index 86% rename from yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDTO.java index cf05b49a..fb23d60d 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderDTO.java @@ -1,24 +1,20 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; +import co.yixiang.modules.shop.domain.YxUser; import lombok.Data; -import java.math.BigDecimal; + import java.io.Serializable; +import java.math.BigDecimal; import java.util.List; + /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-14 */ @Data -public class YxStoreOrderDto implements Serializable { +public class YxStoreOrderDTO implements Serializable { + // 订单ID private Integer id; @@ -33,7 +29,7 @@ public class YxStoreOrderDto implements Serializable { //订单类型 private String pinkName; - private List cartInfoList; + private List cartInfoList; // 订单号 @@ -42,7 +38,7 @@ public class YxStoreOrderDto implements Serializable { // 用户id private Integer uid; - private YxUserDto userDTO; + private YxUserDTO userDTO; // 用户姓名 private String realName; @@ -188,4 +184,4 @@ public class YxStoreOrderDto implements Serializable { private Integer isRemind; private Integer isSystemDel; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderQueryCriteria.java index ab299209..00e02bf4 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderQueryCriteria.java @@ -1,20 +1,13 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; + +import java.util.List; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-14 */ @Data public class YxStoreOrderQueryCriteria{ @@ -71,4 +64,4 @@ public class YxStoreOrderQueryCriteria{ @Query private Integer storeId; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDTO.java new file mode 100644 index 00000000..d6a8f5fa --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDTO.java @@ -0,0 +1,28 @@ +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-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDto.java deleted file mode 100644 index 6fd87040..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusDto.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxStoreOrderStatusDto implements Serializable { - - private Integer id; - - /** 订单id */ - private Integer oid; - - /** 操作类型 */ - private String changeType; - - /** 操作备注 */ - private String changeMessage; - - /** 操作时间 */ - private Integer changeTime; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusQueryCriteria.java index 3142b265..4b0a7326 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreOrderStatusQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-02 */ @Data public class YxStoreOrderStatusQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductAttrQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductAttrQueryCriteria.java deleted file mode 100644 index e4942e48..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductAttrQueryCriteria.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; - -@Data -public class YxStoreProductAttrQueryCriteria { -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductAttrValueQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductAttrValueQueryCriteria.java deleted file mode 100644 index 6b96d836..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductAttrValueQueryCriteria.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; - -@Data -public class YxStoreProductAttrValueQueryCriteria { -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDTO.java new file mode 100644 index 00000000..49270598 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDTO.java @@ -0,0 +1,127 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +/** +* @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 YxStoreCategorySmallDTO storeCategory; + + // 商品价格 + 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-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDto.java deleted file mode 100644 index 628d5459..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductDto.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@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 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; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductQueryCriteria.java index f79dee19..fcacb710 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductQueryCriteria.java @@ -1,21 +1,24 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-12 +* @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-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDTO.java new file mode 100644 index 00000000..30d2c5e5 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDTO.java @@ -0,0 +1,65 @@ +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 YxUserSmallDTO user; + + // 订单ID + private Integer oid; + + // 唯一id + private String unique; + + // 产品id + private Integer productId; + + private YxStoreProductSmallDTO storeProduct; + + + // 某种商品类型(普通商品、秒杀商品) + 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-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDto.java deleted file mode 100644 index 51349bb5..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyDto.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxStoreProductReplyDto implements Serializable { - - /** 评论ID */ - private Integer id; - - /** 用户ID */ - private Integer uid; - - /** 订单ID */ - private Integer oid; - - /** 唯一id */ - private String unique; - - /** 产品id */ - private Integer productId; - - /** 某种商品类型(普通商品、秒杀商品) */ - 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; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyQueryCriteria.java index 8ad4ceb6..24c8aba1 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductReplyQueryCriteria.java @@ -1,23 +1,14 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-03 */ @Data public class YxStoreProductReplyQueryCriteria{ @Query private Integer isDel; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductSmallDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductSmallDTO.java new file mode 100644 index 00000000..d410b200 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductSmallDTO.java @@ -0,0 +1,27 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +/** +* @author hupeng +* @date 2019-10-04 +*/ +@Data +public class YxStoreProductSmallDTO implements Serializable { + + // 商品id + private Integer id; + + // 商品图片 + private String image; + + + // 商品名称 + private String storeName; + + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductSmallDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductSmallDto.java deleted file mode 100644 index 98d11655..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxStoreProductSmallDto.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; - -import java.io.Serializable; -import java.math.BigDecimal; - - -/** -* @author hupeng -* @date 2019-10-04 -*/ -@Data -public class YxStoreProductSmallDto implements Serializable { - - // 商品id - private Integer id; - - // 商品图片 - private String image; - - - // 商品名称 - private String storeName; - - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigDTO.java new file mode 100644 index 00000000..cd3807a5 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigDTO.java @@ -0,0 +1,30 @@ +package co.yixiang.modules.shop.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-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigDto.java deleted file mode 100644 index d227ee09..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigDto.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxSystemConfigDto implements Serializable { - - /** 配置id */ - private Integer id; - - /** 字段名称 */ - private String menuName; - - /** 默认值 */ - private String value; - - /** 排序 */ - private Integer sort; - - /** 是否隐藏 */ - private Integer status; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigQueryCriteria.java index 8769387b..513a30a4 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemConfigQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-10 */ @Data public class YxSystemConfigQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDTO.java similarity index 56% rename from yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDTO.java index cbfd9dd5..73a277c0 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataDTO.java @@ -1,23 +1,17 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; + import java.io.Serializable; import java.util.Map; + /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-18 */ @Data -public class YxSystemGroupDataDto implements Serializable { +public class YxSystemGroupDataDTO implements Serializable { // 组合数据详情ID private Integer id; @@ -38,4 +32,4 @@ public class YxSystemGroupDataDto implements Serializable { // 状态(1:开启;2:关闭;) private Integer status; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataQueryCriteria.java index 0f5e18e1..b433083a 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemGroupDataQueryCriteria.java @@ -1,24 +1,15 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; -import lombok.Data; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-18 */ @Data public class YxSystemGroupDataQueryCriteria{ - // 精确 @Query private String groupName; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreDto.java index 372edcea..e8f2d140 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreDto.java @@ -1,19 +1,14 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; + + import java.io.Serializable; +import java.util.Date; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-03 */ @Data public class YxSystemStoreDto implements Serializable { @@ -58,4 +53,12 @@ public class YxSystemStoreDto implements Serializable { /** 是否删除 */ private Integer isDel; -} + + private Date dayTimeStart; + + private Date dayTimeEnd; + + private Date validTimeStart; + + private Date validTimeEnd; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreQueryCriteria.java index 06d8ad0c..51cf3b4e 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreQueryCriteria.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -14,8 +6,8 @@ import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-03 */ @Data public class YxSystemStoreQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreStaffDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreStaffDto.java index 0d0d834f..3e9bf7ec 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreStaffDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreStaffDto.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -13,7 +5,7 @@ import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-22 */ @Data public class YxSystemStoreStaffDto implements Serializable { @@ -49,4 +41,4 @@ public class YxSystemStoreStaffDto implements Serializable { /** 所属门店 */ private String storeName; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreStaffQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreStaffQueryCriteria.java index d3c2a90f..9b7f2c5e 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreStaffQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemStoreStaffQueryCriteria.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -14,7 +6,7 @@ import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-22 */ @Data public class YxSystemStoreStaffQueryCriteria{ @@ -26,4 +18,4 @@ public class YxSystemStoreStaffQueryCriteria{ /** 模糊 */ @Query(type = Query.Type.INNER_LIKE) private String nickname; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelDTO.java new file mode 100644 index 00000000..884ba7a9 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelDTO.java @@ -0,0 +1,59 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +/** +* @author hupeng +* @date 2019-12-04 +*/ +@Data +public class YxSystemUserLevelDTO implements Serializable { + + private Integer id; + + // 商户id + private Integer merId; + + // 会员名称 + private String name; + + // 购买金额 + private BigDecimal money; + + // 有效时间 + private Integer validDate; + + // 是否为永久会员 + private Integer isForever; + + // 是否购买,1=购买,0=不购买 + private Integer isPay; + + // 是否显示 1=显示,0=隐藏 + private Integer isShow; + + // 会员等级 + private Integer grade; + + // 享受折扣 + private BigDecimal discount; + + // 会员卡背景 + private String image; + + // 会员图标 + private String icon; + + // 说明 + private String explain; + + // 添加时间 + private Integer addTime; + + // 是否删除.1=删除,0=未删除 + private Integer isDel; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelDto.java deleted file mode 100644 index 3d443006..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelDto.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxSystemUserLevelDto implements Serializable { - - private Integer id; - - /** 商户id */ - private Integer merId; - - /** 会员名称 */ - private String name; - - /** 购买金额 */ - private BigDecimal money; - - /** 有效时间 */ - private Integer validDate; - - /** 是否为永久会员 */ - private Integer isForever; - - /** 是否购买,1=购买,0=不购买 */ - private Integer isPay; - - /** 是否显示 1=显示,0=隐藏 */ - private Integer isShow; - - /** 会员等级 */ - private Integer grade; - - /** 享受折扣 */ - private BigDecimal discount; - - /** 会员卡背景 */ - private String image; - - /** 会员图标 */ - private String icon; - - /** 说明 */ - private String explain; - - /** 添加时间 */ - private Integer addTime; - - /** 是否删除.1=删除,0=未删除 */ - private Integer isDel; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelQueryCriteria.java index 7b0c3ce4..9db133b7 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserLevelQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-04 */ @Data public class YxSystemUserLevelQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskDTO.java similarity index 61% rename from yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskDto.java rename to yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskDTO.java index 3fa88f18..3a952284 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskDTO.java @@ -1,22 +1,17 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; + import java.io.Serializable; + /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-04 */ @Data -public class YxSystemUserTaskDto implements Serializable { +public class YxSystemUserTaskDTO implements Serializable { + private Integer id; // 任务名称 @@ -50,4 +45,4 @@ public class YxSystemUserTaskDto implements Serializable { // 新增时间 private Integer addTime; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskQueryCriteria.java index 853320b0..45e42b9b 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxSystemUserTaskQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-04 */ @Data public class YxSystemUserTaskQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDTO.java new file mode 100644 index 00000000..3558e77a --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDTO.java @@ -0,0 +1,51 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +/** +* @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-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDto.java deleted file mode 100644 index 506a83a2..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillDto.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@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; - - private String nickname; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillQueryCriteria.java index c14c8f28..2aead770 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserBillQueryCriteria.java @@ -1,24 +1,14 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-06 */ @Data public class YxUserBillQueryCriteria{ private String nickname; private String category; private String type; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDTO.java new file mode 100644 index 00000000..8bfb9b59 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDTO.java @@ -0,0 +1,111 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +/** +* @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-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDto.java deleted file mode 100644 index 0a807d8d..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserDto.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxUserDto implements Serializable { - - /** 用户id */ - private Integer uid; - - /** 用户账户(跟accout一样) */ - private String username; - - /** 用户账号 */ - private String account; - - /** 用户密码(跟pwd) */ - private String password; - - /** 用户密码 */ - 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; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserQueryCriteria.java index d970e6b3..5d7411f4 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserQueryCriteria.java @@ -1,20 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; -import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import lombok.Data; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-06 */ @Data public class YxUserQueryCriteria{ @@ -32,4 +23,4 @@ public class YxUserQueryCriteria{ @Query private String userType; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserRechargeDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserRechargeDto.java index 2a153b1b..18f63fb9 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserRechargeDto.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserRechargeDto.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -14,7 +6,7 @@ import java.io.Serializable; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-02 */ @Data public class YxUserRechargeDto implements Serializable { @@ -47,4 +39,4 @@ public class YxUserRechargeDto implements Serializable { /** 昵称 */ private String nickname; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserRechargeQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserRechargeQueryCriteria.java index 0df144eb..77479182 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserRechargeQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserRechargeQueryCriteria.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; @@ -14,7 +6,7 @@ import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-02 */ @Data public class YxUserRechargeQueryCriteria{ @@ -22,4 +14,4 @@ public class YxUserRechargeQueryCriteria{ /** 模糊 */ @Query(type = Query.Type.INNER_LIKE) private String nickname; -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserSmallDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserSmallDTO.java new file mode 100644 index 00000000..2d9629a0 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserSmallDTO.java @@ -0,0 +1,29 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +/** +* @author hupeng +* @date 2019-10-06 +*/ +@Data +public class YxUserSmallDTO implements Serializable { + + // 用户id + private Integer uid; + + // 用户昵称 + private String nickname; + + // 用户头像 + private String avatar; + + // 手机号码 + private String phone; + + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserSmallDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserSmallDto.java deleted file mode 100644 index f2d31e94..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxUserSmallDto.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; - -import java.io.Serializable; -import java.math.BigDecimal; - - -/** -* @author hupeng -* @date 2019-10-06 -*/ -@Data -public class YxUserSmallDto implements Serializable { - - // 用户id - private Integer uid; - - // 用户昵称 - private String nickname; - - // 用户头像 - private String avatar; - - // 手机号码 - private String phone; - - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserDTO.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserDTO.java new file mode 100644 index 00000000..5d8b860b --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserDTO.java @@ -0,0 +1,87 @@ +package co.yixiang.modules.shop.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +/** +* @author hupeng +* @date 2019-12-13 +*/ +@Data +public class YxWechatUserDTO implements Serializable { + + // 微信用户id + private Integer uid; + + // 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段 + private String unionid; + + // 用户的标识,对当前公众号唯一 + private String openid; + + // 小程序唯一身份ID + private String routineOpenid; + + // 用户的昵称 + private String nickname; + + // 用户头像 + private String headimgurl; + + // 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知 + private Integer sex; + + // 用户所在城市 + private String city; + + // 用户的语言,简体中文为zh_CN + private String language; + + // 用户所在省份 + private String province; + + // 用户所在国家 + private String country; + + // 公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注 + private String remark; + + // 用户所在的分组ID(兼容旧的用户分组接口) + private Integer groupid; + + // 用户被打上的标签ID列表 + private String tagidList; + + // 用户是否订阅该公众号标识 + private Integer subscribe; + + // 关注公众号时间 + private Integer subscribeTime; + + // 添加时间 + private Integer addTime; + + // 一级推荐人 + private Integer stair; + + // 二级推荐人 + private Integer second; + + // 一级推荐人订单 + private Integer orderStair; + + // 二级推荐人订单 + private Integer orderSecond; + + // 佣金 + private BigDecimal nowMoney; + + // 小程序用户会话密匙 + private String sessionKey; + + // 用户类型 + private String userType; +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserDto.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserDto.java deleted file mode 100644 index bd8bb9ed..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserDto.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.dto; - -import lombok.Data; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Data -public class YxWechatUserDto implements Serializable { - - /** 微信用户id */ - private Integer uid; - - /** 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段 */ - private String unionid; - - /** 用户的标识,对当前公众号唯一 */ - private String openid; - - /** 小程序唯一身份ID */ - private String routineOpenid; - - /** 用户的昵称 */ - private String nickname; - - /** 用户头像 */ - private String headimgurl; - - /** 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知 */ - private Integer sex; - - /** 用户所在城市 */ - private String city; - - /** 用户的语言,简体中文为zh_CN */ - private String language; - - /** 用户所在省份 */ - private String province; - - /** 用户所在国家 */ - private String country; - - /** 公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注 */ - private String remark; - - /** 用户所在的分组ID(兼容旧的用户分组接口) */ - private Integer groupid; - - /** 用户被打上的标签ID列表 */ - private String tagidList; - - /** 用户是否订阅该公众号标识 */ - private Integer subscribe; - - /** 关注公众号时间 */ - private Integer subscribeTime; - - /** 添加时间 */ - private Integer addTime; - - /** 一级推荐人 */ - private Integer stair; - - /** 二级推荐人 */ - private Integer second; - - /** 一级推荐人订单 */ - private Integer orderStair; - - /** 二级推荐人订单 */ - private Integer orderSecond; - - /** 佣金 */ - private BigDecimal nowMoney; - - /** 小程序用户会话密匙 */ - private String sessionKey; - - /** 用户类型 */ - private String userType; -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserQueryCriteria.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserQueryCriteria.java index f818d2f5..b097a514 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserQueryCriteria.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/dto/YxWechatUserQueryCriteria.java @@ -1,21 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.dto; import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-13 */ @Data public class YxWechatUserQueryCriteria{ -} +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxExpressServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxExpressServiceImpl.java index 322b3089..a45d9e46 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxExpressServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxExpressServiceImpl.java @@ -1,82 +1,87 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; +import co.yixiang.exception.EntityExistException; import co.yixiang.modules.shop.domain.YxExpress; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.shop.repository.YxExpressRepository; import co.yixiang.modules.shop.service.YxExpressService; -import co.yixiang.modules.shop.service.dto.YxExpressDto; +import co.yixiang.modules.shop.service.dto.YxExpressDTO; import co.yixiang.modules.shop.service.dto.YxExpressQueryCriteria; -import co.yixiang.modules.shop.service.mapper.ExpressMapper; +import co.yixiang.modules.shop.service.mapper.YxExpressMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.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.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-12 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxExpress") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxExpressServiceImpl extends BaseServiceImpl implements YxExpressService { +public class YxExpressServiceImpl implements YxExpressService { - private final IGenerator generator; + private final YxExpressRepository yxExpressRepository; - @Override - //@Cacheable - public Map queryAll(YxExpressQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxExpressDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxExpressMapper yxExpressMapper; + + public YxExpressServiceImpl(YxExpressRepository yxExpressRepository, YxExpressMapper yxExpressMapper) { + this.yxExpressRepository = yxExpressRepository; + this.yxExpressMapper = yxExpressMapper; } - @Override - //@Cacheable - public List queryAll(YxExpressQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxExpress.class, criteria)); + public Map queryAll(YxExpressQueryCriteria criteria, Pageable pageable){ + Page page = yxExpressRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxExpressMapper::toDto)); } + @Override + public List queryAll(YxExpressQueryCriteria criteria){ + return yxExpressMapper.toDto(yxExpressRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxExpressDto yxExpress : all) { - Map map = new LinkedHashMap<>(); - map.put("快递公司简称", yxExpress.getCode()); - map.put("快递公司全称", yxExpress.getName()); - map.put("排序", yxExpress.getSort()); - map.put("是否显示", yxExpress.getIsShow()); - list.add(map); + public YxExpressDTO findById(Integer id) { + Optional yxExpress = yxExpressRepository.findById(id); + ValidationUtil.isNull(yxExpress,"YxExpress","id",id); + return yxExpressMapper.toDto(yxExpress.get()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxExpressDTO create(YxExpress resources) { + if(yxExpressRepository.findByCode(resources.getCode()) != null){ + throw new EntityExistException(YxExpress.class,"code",resources.getCode()); } - FileUtil.downloadExcel(list, response); + return yxExpressMapper.toDto(yxExpressRepository.save(resources)); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxExpress resources) { + Optional optionalYxExpress = yxExpressRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxExpress,"YxExpress","id",resources.getId()); + YxExpress yxExpress = optionalYxExpress.get(); + YxExpress yxExpress1 = null; + yxExpress1 = yxExpressRepository.findByCode(resources.getCode()); + if(yxExpress1 != null && !yxExpress1.getId().equals(yxExpress.getId())){ + throw new EntityExistException(YxExpress.class,"code",resources.getCode()); + } + yxExpress.copy(resources); + yxExpressRepository.save(yxExpress); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxExpressRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialGroupServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialGroupServiceImpl.java index a2da6c1c..d646fed3 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialGroupServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialGroupServiceImpl.java @@ -1,82 +1,96 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxMaterialGroup; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.shop.repository.YxMaterialGroupRepository; import co.yixiang.modules.shop.service.YxMaterialGroupService; import co.yixiang.modules.shop.service.dto.YxMaterialGroupDto; import co.yixiang.modules.shop.service.dto.YxMaterialGroupQueryCriteria; -import co.yixiang.modules.shop.service.mapper.MaterialGroupMapper; +import co.yixiang.modules.shop.service.mapper.YxMaterialGroupMapper; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import cn.hutool.core.util.IdUtil; // 默认不使用缓存 //import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; - import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; + /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ @Service -@AllArgsConstructor //@CacheConfig(cacheNames = "yxMaterialGroup") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxMaterialGroupServiceImpl extends BaseServiceImpl implements YxMaterialGroupService { +public class YxMaterialGroupServiceImpl implements YxMaterialGroupService { - private final IGenerator generator; + private final YxMaterialGroupRepository yxMaterialGroupRepository; + + private final YxMaterialGroupMapper yxMaterialGroupMapper; + + public YxMaterialGroupServiceImpl(YxMaterialGroupRepository yxMaterialGroupRepository, YxMaterialGroupMapper yxMaterialGroupMapper) { + this.yxMaterialGroupRepository = yxMaterialGroupRepository; + this.yxMaterialGroupMapper = yxMaterialGroupMapper; + } @Override //@Cacheable - public Map queryAll(YxMaterialGroupQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxMaterialGroupDto.class)); - map.put("totalElements", page.getTotal()); - return map; + public Map queryAll(YxMaterialGroupQueryCriteria criteria, Pageable pageable){ + Page page = yxMaterialGroupRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxMaterialGroupMapper::toDto)); } - @Override //@Cacheable - public List queryAll(YxMaterialGroupQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxMaterialGroup.class, criteria)); + public List queryAll(YxMaterialGroupQueryCriteria criteria){ + return yxMaterialGroupMapper.toDto(yxMaterialGroupRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } + @Override + //@Cacheable(key = "#p0") + public YxMaterialGroupDto findById(String id) { + YxMaterialGroup yxMaterialGroup = yxMaterialGroupRepository.findById(id).orElseGet(YxMaterialGroup::new); + ValidationUtil.isNull(yxMaterialGroup.getId(),"YxMaterialGroup","id",id); + return yxMaterialGroupMapper.toDto(yxMaterialGroup); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxMaterialGroupDto yxMaterialGroup : all) { - Map map = new LinkedHashMap<>(); - map.put("逻辑删除标记(0:显示;1:隐藏)", yxMaterialGroup.getDelFlag()); - map.put("创建时间", yxMaterialGroup.getCreateTime()); - map.put("创建者ID", yxMaterialGroup.getCreateId()); - map.put("分组名", yxMaterialGroup.getName()); - list.add(map); + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public YxMaterialGroupDto create(YxMaterialGroup resources) { + resources.setId(IdUtil.simpleUUID()); + return yxMaterialGroupMapper.toDto(yxMaterialGroupRepository.save(resources)); + } + + @Override + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(YxMaterialGroup resources) { + YxMaterialGroup yxMaterialGroup = yxMaterialGroupRepository.findById(resources.getId()).orElseGet(YxMaterialGroup::new); + ValidationUtil.isNull( yxMaterialGroup.getId(),"YxMaterialGroup","id",resources.getId()); + yxMaterialGroup.copy(resources); + yxMaterialGroupRepository.save(yxMaterialGroup); + } + + @Override + //@CacheEvict(allEntries = true) + public void deleteAll(String[] ids) { + for (String id : ids) { + yxMaterialGroupRepository.deleteById(id); } - FileUtil.downloadExcel(list, response); } -} + + @Override + public void deleteById(String id) { + yxMaterialGroupRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialServiceImpl.java index 44c80a8b..da60d443 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxMaterialServiceImpl.java @@ -1,86 +1,95 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxMaterial; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.shop.repository.YxMaterialRepository; import co.yixiang.modules.shop.service.YxMaterialService; import co.yixiang.modules.shop.service.dto.YxMaterialDto; import co.yixiang.modules.shop.service.dto.YxMaterialQueryCriteria; -import co.yixiang.modules.shop.service.mapper.MaterialMapper; +import co.yixiang.modules.shop.service.mapper.YxMaterialMapper; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import cn.hutool.core.util.IdUtil; // 默认不使用缓存 //import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; - import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-01-09 */ @Service -@AllArgsConstructor //@CacheConfig(cacheNames = "yxMaterial") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxMaterialServiceImpl extends BaseServiceImpl implements YxMaterialService { +public class YxMaterialServiceImpl implements YxMaterialService { - private final IGenerator generator; + private final YxMaterialRepository yxMaterialRepository; + + private final YxMaterialMapper yxMaterialMapper; + + public YxMaterialServiceImpl(YxMaterialRepository yxMaterialRepository, YxMaterialMapper yxMaterialMapper) { + this.yxMaterialRepository = yxMaterialRepository; + this.yxMaterialMapper = yxMaterialMapper; + } @Override //@Cacheable - public Map queryAll(YxMaterialQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxMaterialDto.class)); - map.put("totalElements", page.getTotal()); - return map; + public Map queryAll(YxMaterialQueryCriteria criteria, Pageable pageable){ + Page page = yxMaterialRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxMaterialMapper::toDto)); } - @Override //@Cacheable - public List queryAll(YxMaterialQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxMaterial.class, criteria)); + public List queryAll(YxMaterialQueryCriteria criteria){ + return yxMaterialMapper.toDto(yxMaterialRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } + @Override + //@Cacheable(key = "#p0") + public YxMaterialDto findById(String id) { + YxMaterial yxMaterial = yxMaterialRepository.findById(id).orElseGet(YxMaterial::new); + ValidationUtil.isNull(yxMaterial.getId(),"YxMaterial","id",id); + return yxMaterialMapper.toDto(yxMaterial); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxMaterialDto yxMaterial : all) { - Map map = new LinkedHashMap<>(); - map.put("所属租户", yxMaterial.getUserId()); - map.put("创建时间", yxMaterial.getCreateTime()); - map.put("最后更新时间", yxMaterial.getUpdateTime()); - map.put("创建者ID", yxMaterial.getCreateId()); - map.put("类型1、图片;2、视频", yxMaterial.getType()); - map.put("分组ID", yxMaterial.getGroupId()); - map.put("素材名", yxMaterial.getName()); - map.put("素材链接", yxMaterial.getUrl()); - list.add(map); + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public YxMaterialDto create(YxMaterial resources) { + resources.setId(IdUtil.simpleUUID()); + return yxMaterialMapper.toDto(yxMaterialRepository.save(resources)); + } + + @Override + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(YxMaterial resources) { + YxMaterial yxMaterial = yxMaterialRepository.findById(resources.getId()).orElseGet(YxMaterial::new); + ValidationUtil.isNull( yxMaterial.getId(),"YxMaterial","id",resources.getId()); + yxMaterial.copy(resources); + yxMaterialRepository.save(yxMaterial); + } + + @Override + //@CacheEvict(allEntries = true) + public void deleteAll(String[] ids) { + for (String id : ids) { + yxMaterialRepository.deleteById(id); } - FileUtil.downloadExcel(list, response); } -} + + @Override + public void deleteById(String id) { + yxMaterialRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCartServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCartServiceImpl.java deleted file mode 100644 index cccc6b54..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCartServiceImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.impl; - -import co.yixiang.modules.shop.domain.YxStoreCart; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.modules.shop.service.dto.CountDto; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; -import co.yixiang.modules.shop.service.YxStoreCartService; -import co.yixiang.modules.shop.service.dto.YxStoreCartDto; -import co.yixiang.modules.shop.service.dto.YxStoreCartQueryCriteria; -import co.yixiang.modules.shop.service.mapper.StoreCartMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//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.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreCart") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreCartServiceImpl extends BaseServiceImpl implements YxStoreCartService { - - private final IGenerator generator; - - private final StoreCartMapper storeCartMapper; - @Override - //@Cacheable - public Map queryAll(YxStoreCartQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreCartDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } - - - @Override - //@Cacheable - public List queryAll(YxStoreCartQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreCart.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreCartDto yxStoreCart : all) { - Map map = new LinkedHashMap<>(); - map.put("用户ID", yxStoreCart.getUid()); - map.put("类型", yxStoreCart.getType()); - map.put("商品ID", yxStoreCart.getProductId()); - map.put("商品属性", yxStoreCart.getProductAttrUnique()); - map.put("商品数量", yxStoreCart.getCartNum()); - map.put("添加时间", yxStoreCart.getAddTime()); - map.put("0 = 未购买 1 = 已购买", yxStoreCart.getIsPay()); - map.put("是否删除", yxStoreCart.getIsDel()); - map.put("是否为立即购买", yxStoreCart.getIsNew()); - map.put("拼团id", yxStoreCart.getCombinationId()); - map.put("秒杀产品ID", yxStoreCart.getSeckillId()); - map.put("砍价id", yxStoreCart.getBargainId()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public List findCateName() { - return storeCartMapper.findCateName(); - } -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java index 8f7ef2ad..13b34b60 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreCategoryServiceImpl.java @@ -1,107 +1,144 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; +import cn.hutool.core.util.ObjectUtil; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxStoreCategory; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.shop.domain.YxStoreProduct; +import co.yixiang.modules.shop.repository.YxStoreCategoryRepository; +import co.yixiang.modules.shop.repository.YxStoreProductRepository; import co.yixiang.modules.shop.service.YxStoreCategoryService; -import co.yixiang.modules.shop.service.dto.YxStoreCategoryDto; +import co.yixiang.modules.shop.service.dto.YxStoreCategoryDTO; import co.yixiang.modules.shop.service.dto.YxStoreCategoryQueryCriteria; -import co.yixiang.modules.shop.service.mapper.StoreCategoryMapper; +import co.yixiang.modules.shop.service.mapper.YxStoreCategoryMapper; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Pageable; import org.springframework.util.CollectionUtils; -import java.util.*; -import java.io.IOException; -import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-03 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreCategory") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreCategoryServiceImpl extends BaseServiceImpl implements YxStoreCategoryService { +public class YxStoreCategoryServiceImpl implements YxStoreCategoryService { - private final IGenerator generator; + private final YxStoreCategoryRepository yxStoreCategoryRepository; + private final YxStoreProductRepository yxStoreProductRepository; - @Override - //@Cacheable - public Map queryAll(YxStoreCategoryQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", page.getList()); - map.put("totalElements", page.getTotal()); - return map; + private final YxStoreCategoryMapper yxStoreCategoryMapper; + + public YxStoreCategoryServiceImpl(YxStoreCategoryRepository yxStoreCategoryRepository, + YxStoreProductRepository yxStoreProductRepository, + YxStoreCategoryMapper yxStoreCategoryMapper) { + this.yxStoreCategoryRepository = yxStoreCategoryRepository; + this.yxStoreProductRepository = yxStoreProductRepository; + this.yxStoreCategoryMapper = yxStoreCategoryMapper; } - @Override - //@Cacheable - public List queryAll(YxStoreCategoryQueryCriteria criteria){ - return generator.convert(baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreCategory.class, criteria)),YxStoreCategoryDto.class); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { + public void download(List queryAll, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); - for (YxStoreCategoryDto yxStoreCategory : all) { + for (YxStoreCategoryDTO storeCategoryDTO : queryAll) { Map map = new LinkedHashMap<>(); - map.put("父id", yxStoreCategory.getPid()); - map.put("分类名称", yxStoreCategory.getCateName()); - map.put("排序", yxStoreCategory.getSort()); - map.put("图标", yxStoreCategory.getPic()); - map.put("是否推荐", yxStoreCategory.getIsShow()); - map.put("添加时间", yxStoreCategory.getAddTime()); - map.put("删除状态", yxStoreCategory.getIsDel()); + map.put("分类名称", storeCategoryDTO.getCateName()); + map.put("分类状态", storeCategoryDTO.getIsShow() == 1 ? "启用" : "停用"); list.add(map); } FileUtil.downloadExcel(list, response); } @Override - public Object buildTree(List categoryDTOS) { - Set trees = new LinkedHashSet<>(); - Set cates= new LinkedHashSet<>(); - List deptNames = categoryDTOS.stream().map(YxStoreCategoryDto::getCateName) + 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 + public YxStoreCategoryDTO findByName(String name) { + return null; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public YxStoreCategoryDTO create(YxStoreCategory resources) { + if(ObjectUtil.isNull(resources.getPid())) resources.setPid(0); + if(ObjectUtil.isNull(resources.getSort())) resources.setSort(1); + return yxStoreCategoryMapper.toDto(yxStoreCategoryRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxStoreCategory resources) { + if(resources.getId().equals(resources.getPid())){ + throw new BadRequestException("自己不能选择自己哦"); + } + 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) { + YxStoreCategory storeCategory = yxStoreCategoryRepository.findByPid(id); + + if(storeCategory != null) throw new BadRequestException("请先删除子类"); + YxStoreCategory category = new YxStoreCategory(); + category.setId(id); + List storeProduct = yxStoreProductRepository.findByStoreCategoryAndIsDel(category,0); + + if(!storeProduct.isEmpty()) throw new BadRequestException("此分类下有商品,不能删除"); + + yxStoreCategoryRepository.delCategory(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()); - YxStoreCategoryDto categoryDTO = new YxStoreCategoryDto(); + YxStoreCategoryDTO categoryDTO = new YxStoreCategoryDTO(); Boolean isChild; - List categories = this.list(); - for (YxStoreCategoryDto deptDTO : categoryDTOS) { + List categories = yxStoreCategoryRepository.findAll(); + for (YxStoreCategoryDTO deptDTO : categoryDTOS) { isChild = false; if ("0".equals(deptDTO.getPid().toString())) { trees.add(deptDTO); } - for (YxStoreCategoryDto it : categoryDTOS) { + for (YxStoreCategoryDTO it : categoryDTOS) { if (it.getPid().equals(deptDTO.getId())) { isChild = true; if (deptDTO.getChildren() == null) { - deptDTO.setChildren(new ArrayList()); + deptDTO.setChildren(new ArrayList()); } deptDTO.getChildren().add(it); } @@ -129,5 +166,6 @@ public class YxStoreCategoryServiceImpl extends BaseServiceImpl implements YxStoreOrderCartInfoService { - - private final IGenerator generator; - - @Override - //@Cacheable - public Map queryAll(YxStoreOrderCartInfoQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreOrderCartInfoDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } - - - @Override - //@Cacheable - public List queryAll(YxStoreOrderCartInfoQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreOrderCartInfo.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreOrderCartInfoDto yxStoreOrderCartInfo : all) { - Map map = new LinkedHashMap<>(); - map.put("订单id", yxStoreOrderCartInfo.getOid()); - map.put("购物车id", yxStoreOrderCartInfo.getCartId()); - map.put("商品ID", yxStoreOrderCartInfo.getProductId()); - map.put("购买东西的详细信息", yxStoreOrderCartInfo.getCartInfo()); - map.put("唯一id", yxStoreOrderCartInfo.getUnique()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderServiceImpl.java index d4363159..4cb1bece 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderServiceImpl.java @@ -1,82 +1,91 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import co.yixiang.enums.OrderInfoEnum; import co.yixiang.exception.BadRequestException; import co.yixiang.exception.EntityExistException; import co.yixiang.modules.activity.domain.YxStorePink; -import co.yixiang.modules.activity.service.YxStorePinkService; -import co.yixiang.modules.shop.domain.*; -import co.yixiang.common.service.impl.BaseServiceImpl; +import co.yixiang.modules.activity.repository.YxStorePinkRepository; +import co.yixiang.modules.shop.domain.StoreOrderCartInfo; +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.*; import co.yixiang.modules.shop.service.*; import co.yixiang.modules.shop.service.dto.*; -import co.yixiang.modules.shop.service.mapper.StoreProductMapper; -import co.yixiang.modules.shop.service.mapper.UserMapper; +import co.yixiang.modules.shop.service.mapper.YxStoreOrderMapper; import co.yixiang.mp.service.YxMiniPayService; import co.yixiang.mp.service.YxPayService; -import co.yixiang.utils.*; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.OrderUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.binarywang.wxpay.exception.WxPayException; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.modules.shop.service.mapper.StoreOrderMapper; import lombok.extern.slf4j.Slf4j; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Pageable; -import java.math.BigDecimal; -import java.util.*; -import java.io.IOException; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.*; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-14 */ @Slf4j @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreOrder") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreOrderServiceImpl extends BaseServiceImpl implements YxStoreOrderService { +public class YxStoreOrderServiceImpl implements YxStoreOrderService { + + private final YxStoreOrderRepository yxStoreOrderRepository; + private final YxStoreOrderCartInfoRepository yxStoreOrderCartInfoRepository; + private final YxUserRepository userRepository; + private final YxStorePinkRepository storePinkRepository; + private final YxStoreProductRepository storeProductRepository; + private final YxStoreCartRepository yxStoreCartRepository; + + private final YxStoreOrderMapper yxStoreOrderMapper; - private final IGenerator generator; - private YxUserService userService; - private UserMapper userMapper; - private YxStorePinkService storePinkService; - private YxStoreOrderCartInfoService storeOrderCartInfoService; private final YxUserBillService yxUserBillService; private final YxStoreOrderStatusService yxStoreOrderStatusService; + private final YxUserService userService; private final YxPayService payService; private final YxMiniPayService miniPayService; private final YxSystemStoreService systemStoreService; - private final YxStoreCartService storeCartService; - private final StoreOrderMapper yxStoreOrderMapper; - private final StoreProductMapper yxStoreProductMapper; + + public YxStoreOrderServiceImpl(YxStoreOrderRepository yxStoreOrderRepository, YxStoreOrderCartInfoRepository yxStoreOrderCartInfoRepository, YxUserRepository userRepository, + YxStorePinkRepository storePinkRepository, YxStoreOrderMapper yxStoreOrderMapper, YxUserBillService yxUserBillService, + YxStoreOrderStatusService yxStoreOrderStatusService, YxSystemStoreService systemStoreService,YxStoreCartRepository yxStoreCartRepository, + YxUserService userService, YxPayService payService, YxMiniPayService miniPayService,YxStoreProductRepository storeProductRepository) { + this.yxStoreOrderRepository = yxStoreOrderRepository; + this.yxStoreOrderCartInfoRepository = yxStoreOrderCartInfoRepository; + this.userRepository = userRepository; + this.storePinkRepository = storePinkRepository; + this.yxStoreOrderMapper = yxStoreOrderMapper; + this.yxUserBillService = yxUserBillService; + this.yxStoreOrderStatusService = yxStoreOrderStatusService; + this.userService = userService; + this.payService = payService; + this.miniPayService = miniPayService; + this.systemStoreService = systemStoreService; + this.storeProductRepository = storeProductRepository; + this.yxStoreCartRepository = yxStoreCartRepository; + } @Override public OrderCountDto getOrderCount() { //获取所有订单转态为已支付的 - List nameList = storeCartService.findCateName(); + List nameList = yxStoreCartRepository.findCateName(); System.out.println("nameList:"+nameList); Map childrenMap = new HashMap<>(); nameList.forEach(i ->{ @@ -105,32 +114,32 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl())); - orderTimeDataDTO.setOrderCount(yxStoreOrderMapper.selectCount(new QueryWrapper())); - orderTimeDataDTO.setPriceCount(yxStoreOrderMapper.sumTotalPrice()); - orderTimeDataDTO.setGoodsCount(yxStoreProductMapper.selectCount(new QueryWrapper())); + orderTimeDataDTO.setUserCount(userRepository.count()); + orderTimeDataDTO.setOrderCount(yxStoreOrderRepository.count()); + orderTimeDataDTO.setPriceCount(yxStoreOrderRepository.sumTotalPrice()); + orderTimeDataDTO.setGoodsCount(storeProductRepository.count()); return orderTimeDataDTO; } @@ -141,248 +150,79 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl queryAll(YxStoreOrderQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - List storeOrderDTOS = new ArrayList<>(); - for (YxStoreOrder yxStoreOrder : page.getList()) { - orderList(storeOrderDTOS, yxStoreOrder); - - } - Map map = new LinkedHashMap<>(2); - map.put("content", storeOrderDTOS); - map.put("totalElements", page.getTotal()); - return map; - } - - /** - * 代码提取 - * @param storeOrderDTOS - * @param yxStoreOrder - */ - private void orderList(List storeOrderDTOS, YxStoreOrder yxStoreOrder) { - YxStoreOrderDto yxStoreOrderDto = generator.convert(yxStoreOrder, YxStoreOrderDto.class); - Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(), - yxStoreOrder.getRefundStatus()); - - if(yxStoreOrder.getStoreId() > 0) { - String storeName = systemStoreService.getById(yxStoreOrder.getStoreId()).getName(); - yxStoreOrderDto.setStoreName(storeName); - } - - //订单状态 - 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); - - yxStoreOrderDto.setPinkName(orderType(yxStoreOrder.getId() - ,yxStoreOrder.getPinkId(),yxStoreOrder.getCombinationId() - ,yxStoreOrder.getSeckillId(),yxStoreOrder.getBargainId(), - yxStoreOrder.getShippingType())); - - List cartInfos = storeOrderCartInfoService.list( - new QueryWrapper().eq("oid",yxStoreOrder.getId())); - List cartInfoDTOS = new ArrayList<>(); - for (YxStoreOrderCartInfo cartInfo : cartInfos) { - StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto(); - cartInfoDTO.setCartInfoMap(JSON.parseObject(cartInfo.getCartInfo())); - - cartInfoDTOS.add(cartInfoDTO); - } - yxStoreOrderDto.setCartInfoList(cartInfoDTOS); - yxStoreOrderDto.setUserDTO(generator.convert(userService.getById(yxStoreOrder.getUid()), YxUserDto.class)); - if(yxStoreOrderDto.getUserDTO()==null){ - yxStoreOrderDto.setUserDTO(new YxUserDto()); - } - storeOrderDTOS.add(yxStoreOrderDto); - } - - - @Override - //@Cacheable - public List queryAll(YxStoreOrderQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreOrder.class, criteria)); - } @Override @Transactional(rollbackFor = Exception.class) - public YxStoreOrderDto create(YxStoreOrder resources) { - if(this.getOne(new QueryWrapper().eq("unique",resources.getUnique())) != null){ - throw new EntityExistException(YxStoreOrder.class,"unique",resources.getUnique()); + public void refund(YxStoreOrder resources) { + if(resources.getPayPrice().doubleValue() < 0){ + throw new BadRequestException("请输入退款金额"); } - this.save(resources); - return generator.convert(resources,YxStoreOrderDto.class); - } - @Override - @Transactional(rollbackFor = Exception.class) - public void update(YxStoreOrder resources) { - YxStoreOrder yxStoreOrder = this.getById(resources.getId()); - YxStoreOrder yxStoreOrder1 = this.getOne(new QueryWrapper().eq("unique",resources.getUnique())); - if(yxStoreOrder1 != null && !yxStoreOrder1.getId().equals(yxStoreOrder.getId())){ - throw new EntityExistException(YxStoreOrder.class,"unique",resources.getUnique()); - } - yxStoreOrder.copy(resources); - this.saveOrUpdate(yxStoreOrder); - } + if(resources.getPayType().equals("yue")){ + //修改状态 + 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); - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreOrderDto yxStoreOrder : all) { - Map map = new LinkedHashMap<>(); - map.put("订单号", yxStoreOrder.getOrderId()); - map.put("用户id", yxStoreOrder.getUid()); - map.put("用户姓名", yxStoreOrder.getRealName()); - map.put("用户电话", yxStoreOrder.getUserPhone()); - map.put("详细地址", yxStoreOrder.getUserAddress()); - map.put("购物车id", yxStoreOrder.getCartId()); - map.put("运费金额", yxStoreOrder.getFreightPrice()); - map.put("订单商品总数", yxStoreOrder.getTotalNum()); - map.put("订单总价", yxStoreOrder.getTotalPrice()); - map.put("邮费", yxStoreOrder.getTotalPostage()); - map.put("实际支付金额", yxStoreOrder.getPayPrice()); - map.put("支付邮费", yxStoreOrder.getPayPostage()); - map.put("抵扣金额", yxStoreOrder.getDeductionPrice()); - map.put("优惠券id", yxStoreOrder.getCouponId()); - map.put("优惠券金额", yxStoreOrder.getCouponPrice()); - map.put("支付状态", yxStoreOrder.getPaid()); - map.put("支付时间", yxStoreOrder.getPayTime()); - map.put("支付方式", yxStoreOrder.getPayType()); - map.put("创建时间", yxStoreOrder.getAddTime()); - map.put("订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:待评价;-1:已退款)", yxStoreOrder.getStatus()); - map.put("0 未退款 1 申请中 2 已退款", yxStoreOrder.getRefundStatus()); - map.put("退款图片", yxStoreOrder.getRefundReasonWapImg()); - map.put("退款用户说明", yxStoreOrder.getRefundReasonWapExplain()); - map.put("退款时间", yxStoreOrder.getRefundReasonTime()); - map.put("前台退款原因", yxStoreOrder.getRefundReasonWap()); - map.put("不退款的理由", yxStoreOrder.getRefundReason()); - map.put("退款金额", yxStoreOrder.getRefundPrice()); - map.put("快递公司编号", yxStoreOrder.getDeliverySn()); - map.put("快递名称/送货人姓名", yxStoreOrder.getDeliveryName()); - map.put("发货类型", yxStoreOrder.getDeliveryType()); - map.put("快递单号/手机号", yxStoreOrder.getDeliveryId()); - map.put("消费赚取积分", yxStoreOrder.getGainIntegral()); - map.put("使用积分", yxStoreOrder.getUseIntegral()); - map.put("给用户退了多少积分", yxStoreOrder.getBackIntegral()); - map.put("备注", yxStoreOrder.getMark()); - map.put("是否删除", yxStoreOrder.getIsDel()); - map.put("唯一id(md5加密)类似id", yxStoreOrder.getUnique()); - map.put("管理员备注", yxStoreOrder.getRemark()); - map.put("商户ID", yxStoreOrder.getMerId()); - map.put(" isMerCheck", yxStoreOrder.getIsMerCheck()); - map.put("拼团产品id0一般产品", yxStoreOrder.getCombinationId()); - map.put("拼团id 0没有拼团", yxStoreOrder.getPinkId()); - map.put("成本价", yxStoreOrder.getCost()); - map.put("秒杀产品ID", yxStoreOrder.getSeckillId()); - map.put("砍价id", yxStoreOrder.getBargainId()); - map.put("核销码", yxStoreOrder.getVerifyCode()); - map.put("门店id", yxStoreOrder.getStoreId()); - map.put("配送方式 1=快递 ,2=门店自提", yxStoreOrder.getShippingType()); - map.put("支付渠道(0微信公众号1微信小程序)", yxStoreOrder.getIsChannel()); - map.put(" isRemind", yxStoreOrder.getIsRemind()); - map.put(" isSystemDel", yxStoreOrder.getIsSystemDel()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } + YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus(); + storeOrderStatus.setOid(resources.getId()); + storeOrderStatus.setChangeType("refund_price"); + storeOrderStatus.setChangeMessage("退款给用户:"+resources.getPayPrice() +"元"); + storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo()); - @Override - public Map queryAll(List ids) { - List yxStoreOrders = this.list(new QueryWrapper().in("order_id",ids)); - List storeOrderDTOS = new ArrayList<>(); - for (YxStoreOrder yxStoreOrder :yxStoreOrders) { - YxStoreOrderDto yxStoreOrderDto = generator.convert(yxStoreOrder,YxStoreOrderDto.class); + yxStoreOrderStatusService.create(storeOrderStatus); + }else{ + BigDecimal bigDecimal = new BigDecimal("100"); + try { + if(OrderInfoEnum.PAY_CHANNEL_1.getValue().equals(resources.getIsChannel())){ + miniPayService.refundOrder(resources.getOrderId(), + bigDecimal.multiply(resources.getPayPrice()).intValue()); + }else{ + payService.refundOrder(resources.getOrderId(), + bigDecimal.multiply(resources.getPayPrice()).intValue()); + } - Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(), - yxStoreOrder.getRefundStatus()); - - if(yxStoreOrder.getStoreId() > 0) { - String storeName = systemStoreService.getById(yxStoreOrder.getStoreId()).getName(); - yxStoreOrderDto.setStoreName(storeName); + } catch (WxPayException e) { + log.info("refund-error:{}",e.getMessage()); } - //订单状态 - 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); - - yxStoreOrderDto.setPinkName(orderType(yxStoreOrder.getId() - ,yxStoreOrder.getPinkId(),yxStoreOrder.getCombinationId() - ,yxStoreOrder.getSeckillId(),yxStoreOrder.getBargainId(), - yxStoreOrder.getShippingType())); - - List cartInfos = storeOrderCartInfoService.list(new QueryWrapper().eq("oid",yxStoreOrder.getId())); - List cartInfoDTOS = new ArrayList<>(); - for (YxStoreOrderCartInfo cartInfo : cartInfos) { - StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto(); - cartInfoDTO.setCartInfoMap(JSON.parseObject(cartInfo.getCartInfo())); - - cartInfoDTOS.add(cartInfoDTO); - } - yxStoreOrderDto.setCartInfoList(cartInfoDTOS); - yxStoreOrderDto.setUserDTO(generator.convert(userService.getOne(new QueryWrapper().eq("uid",yxStoreOrder.getUid())), YxUserDto.class)); - - storeOrderDTOS.add(yxStoreOrderDto); - } - Map map = new LinkedHashMap<>(2); - map.put("content",storeOrderDTOS); - return map; } - @Override public String orderType(int id,int pinkId, int combinationId,int seckillId, int bargainId,int shippingType) { String str = "[普通订单]"; if(pinkId > 0 || combinationId > 0){ - YxStorePink storePink = storePinkService.getOne(new QueryWrapper(). - eq("order_id_key",id)); + YxStorePink storePink = storePinkRepository.findByOrderIdKey(id); if(ObjectUtil.isNull(storePink)) { str = "[拼团订单]"; }else{ @@ -412,62 +252,221 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl queryAll(YxStoreOrderQueryCriteria criteria, Pageable pageable){ - if(resources.getPayType().equals("yue")){ - //修改状态 - resources.setRefundStatus(2); - resources.setRefundPrice(resources.getPayPrice()); - this.save(resources); - - //退款到余额 - YxUserDto userDTO = generator.convert(userService.getOne(new QueryWrapper().eq("uid",resources.getUid())),YxUserDto.class); - userMapper.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.save(userBill); + 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); - YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus(); - storeOrderStatus.setOid(resources.getId()); - storeOrderStatus.setChangeType("refund_price"); - storeOrderStatus.setChangeMessage("退款给用户:"+resources.getPayPrice() +"元"); - storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo()); + Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(), + yxStoreOrder.getRefundStatus()); - yxStoreOrderStatusService.save(storeOrderStatus); - }else{ - BigDecimal bigDecimal = new BigDecimal("100"); - try { - if(OrderInfoEnum.PAY_CHANNEL_1.getValue().equals(resources.getIsChannel())){ - miniPayService.refundOrder(resources.getOrderId(), - bigDecimal.multiply(resources.getPayPrice()).intValue()); - }else{ - payService.refundOrder(resources.getOrderId(), - bigDecimal.multiply(resources.getPayPrice()).intValue()); - } - - } catch (WxPayException e) { - log.info("refund-error:{}",e.getMessage()); + if(yxStoreOrder.getStoreId() > 0) { + String storeName = systemStoreService.findById(yxStoreOrder.getStoreId()).getName(); + yxStoreOrderDTO.setStoreName(storeName); } + //订单状态 + 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); + + yxStoreOrderDTO.setPinkName(orderType(yxStoreOrder.getId() + ,yxStoreOrder.getPinkId(),yxStoreOrder.getCombinationId() + ,yxStoreOrder.getSeckillId(),yxStoreOrder.getBargainId(), + yxStoreOrder.getShippingType())); + + 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); + yxStoreOrderDTO.setUserDTO(userService.findById(yxStoreOrder.getUid())); + + storeOrderDTOS.add(yxStoreOrderDTO); + } + + Map map = new LinkedHashMap<>(2); + map.put("content",storeOrderDTOS); + map.put("totalElements",page.getTotalElements()); + + return map; + } + @Override + public Map queryAll(List ids){ + List yxStoreOrders = yxStoreOrderRepository.findByOrderIdIn(ids); + List storeOrderDTOS = new ArrayList<>(); + for (YxStoreOrder yxStoreOrder :yxStoreOrders) { + YxStoreOrderDTO yxStoreOrderDTO = yxStoreOrderMapper.toDto(yxStoreOrder); + + + Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(), + yxStoreOrder.getRefundStatus()); + + if(yxStoreOrder.getStoreId() > 0) { + String storeName = systemStoreService.findById(yxStoreOrder.getStoreId()).getName(); + yxStoreOrderDTO.setStoreName(storeName); + } + + //订单状态 + 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); + + yxStoreOrderDTO.setPinkName(orderType(yxStoreOrder.getId() + ,yxStoreOrder.getPinkId(),yxStoreOrder.getCombinationId() + ,yxStoreOrder.getSeckillId(),yxStoreOrder.getBargainId(), + yxStoreOrder.getShippingType())); + + 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); + yxStoreOrderDTO.setUserDTO(userService.findById(yxStoreOrder.getUid())); + + storeOrderDTOS.add(yxStoreOrderDTO); + + } + + Map map = new LinkedHashMap<>(2); + map.put("content",storeOrderDTOS); + + 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); + } + + + @Override + public void download(List queryAll, HttpServletResponse response) throws IOException, ParseException { + List> list = new ArrayList<>(); + + for (YxStoreOrderDTO storeOrderDTO : queryAll) { + List storeList = new ArrayList(); + storeList = storeOrderDTO.getCartInfoList(); + if(storeList != null){ + for(StoreOrderCartInfoDTO storeOrderCartInfoDTO : storeList){ + Map map = new LinkedHashMap<>(); + map.put("订单号", storeOrderDTO.getOrderId()); + map.put("下单时间", OrderUtil.stampToDate(storeOrderDTO.getAddTime()+"")); + map.put("订单状态", storeOrderDTO.getStatusName()); + map.put("支付状态", storeOrderDTO.getPayTypeName()); + map.put("配送费用", storeOrderDTO.getFreightPrice()); + map.put("实际支付", storeOrderDTO.getPayPrice()); + + map.put("客户编号", storeOrderDTO.getUserDTO().getAccount()); + map.put("客户名称", storeOrderDTO.getUserDTO().getNickname()); + map.put("客户类型", storeOrderDTO.getUserDTO().getUserType()); + map.put("客户手机号码", storeOrderDTO.getUserDTO().getPhone()); + map.put("是否为推广员", storeOrderDTO.getUserDTO().getIsPromoter()); + + map.put("收货人", storeOrderDTO.getRealName()); + map.put("联系电话", storeOrderDTO.getUserPhone()); + map.put("收货地址", storeOrderDTO.getUserAddress()); + + Map proInfo = ((Map)storeOrderCartInfoDTO.getCartInfoMap().get("productInfo")); + map.put("商品编号", proInfo.get("id")); + map.put("商品名称", proInfo.get("store_name")); + map.put("商品规格", proInfo.get("unit_name")); + map.put("商品库存", proInfo.get("stock")); + map.put("单价", proInfo.get("price")); + map.put("订购数量", storeOrderDTO.getTotalNum()); + map.put("小计", storeOrderDTO.getTotalPrice()); + map.put("订单备注", storeOrderDTO.getMark()); + + list.add(map); + } + } + } + FileUtil.downloadExcel(list, response); } } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderStatusServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderStatusServiceImpl.java index d62716be..9b548931 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderStatusServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreOrderStatusServiceImpl.java @@ -1,82 +1,78 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxStoreOrderStatus; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +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.YxStoreOrderStatusDTO; import co.yixiang.modules.shop.service.dto.YxStoreOrderStatusQueryCriteria; -import co.yixiang.modules.shop.service.mapper.StoreOrderStatusMapper; +import co.yixiang.modules.shop.service.mapper.YxStoreOrderStatusMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.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.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-02 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreOrderStatus") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreOrderStatusServiceImpl extends BaseServiceImpl implements YxStoreOrderStatusService { +public class YxStoreOrderStatusServiceImpl implements YxStoreOrderStatusService { - private final IGenerator generator; + private final YxStoreOrderStatusRepository yxStoreOrderStatusRepository; - @Override - //@Cacheable - public Map queryAll(YxStoreOrderStatusQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreOrderStatusDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxStoreOrderStatusMapper yxStoreOrderStatusMapper; + + public YxStoreOrderStatusServiceImpl(YxStoreOrderStatusRepository yxStoreOrderStatusRepository, YxStoreOrderStatusMapper yxStoreOrderStatusMapper) { + this.yxStoreOrderStatusRepository = yxStoreOrderStatusRepository; + this.yxStoreOrderStatusMapper = yxStoreOrderStatusMapper; } - @Override - //@Cacheable - public List queryAll(YxStoreOrderStatusQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreOrderStatus.class, criteria)); + 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 void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreOrderStatusDto yxStoreOrderStatus : all) { - Map map = new LinkedHashMap<>(); - map.put("订单id", yxStoreOrderStatus.getOid()); - map.put("操作类型", yxStoreOrderStatus.getChangeType()); - map.put("操作备注", yxStoreOrderStatus.getChangeMessage()); - map.put("操作时间", yxStoreOrderStatus.getChangeTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + 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-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrResultServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrResultServiceImpl.java deleted file mode 100644 index 272b427c..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrResultServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.impl; - -import co.yixiang.modules.shop.domain.YxStoreProductAttrResult; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.modules.shop.service.YxStoreProductAttrResultService; -import co.yixiang.modules.shop.service.mapper.StoreProductAttrResultMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//import org.springframework.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; - - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreProductAttrResult") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreProductAttrResultServiceImpl extends BaseServiceImpl implements YxStoreProductAttrResultService { - - - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrServiceImpl.java deleted file mode 100644 index ddbb52f5..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrServiceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.impl; - -import co.yixiang.modules.shop.domain.YxStoreProductAttr; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.modules.shop.service.YxStoreProductAttrService; -import co.yixiang.modules.shop.service.mapper.StoreProductAttrMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//import org.springframework.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; - - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreProductAttr") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreProductAttrServiceImpl extends BaseServiceImpl implements YxStoreProductAttrService { - - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrValueServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrValueServiceImpl.java deleted file mode 100644 index 1d0771e0..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductAttrValueServiceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.impl; - -import co.yixiang.modules.shop.domain.YxStoreProductAttrValue; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.modules.shop.service.YxStoreProductAttrValueService; -import co.yixiang.modules.shop.service.mapper.StoreProductAttrValueMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//import org.springframework.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; - - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreProductAttrValue") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreProductAttrValueServiceImpl extends BaseServiceImpl implements YxStoreProductAttrValueService { - - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java index 80e97b96..35410213 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductReplyServiceImpl.java @@ -1,92 +1,82 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxStoreProductReply; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +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.YxStoreProductService; +import co.yixiang.modules.shop.service.YxUserService; +import co.yixiang.modules.shop.service.dto.YxStoreProductReplyDTO; import co.yixiang.modules.shop.service.dto.YxStoreProductReplyQueryCriteria; -import co.yixiang.modules.shop.service.mapper.StoreProductReplyMapper; +import co.yixiang.modules.shop.service.mapper.YxStoreProductReplyMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.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.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.*; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-03 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreProductReply") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreProductReplyServiceImpl extends BaseServiceImpl implements YxStoreProductReplyService { +public class YxStoreProductReplyServiceImpl implements YxStoreProductReplyService { - private final IGenerator generator; + private final YxStoreProductReplyRepository yxStoreProductReplyRepository; + + private final YxStoreProductReplyMapper yxStoreProductReplyMapper; + + + + public YxStoreProductReplyServiceImpl(YxStoreProductReplyRepository yxStoreProductReplyRepository, + YxStoreProductReplyMapper yxStoreProductReplyMapper) { + this.yxStoreProductReplyRepository = yxStoreProductReplyRepository; + this.yxStoreProductReplyMapper = yxStoreProductReplyMapper; - @Override - //@Cacheable - public Map queryAll(YxStoreProductReplyQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreProductReplyDto.class)); - map.put("totalElements", page.getTotal()); - return map; } - @Override - //@Cacheable - public List queryAll(YxStoreProductReplyQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreProductReply.class, criteria)); + public Map queryAll(YxStoreProductReplyQueryCriteria criteria, Pageable pageable){ + Page page = yxStoreProductReplyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxStoreProductReplyMapper::toDto)); } + @Override + public List queryAll(YxStoreProductReplyQueryCriteria criteria){ + return yxStoreProductReplyMapper.toDto(yxStoreProductReplyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreProductReplyDto yxStoreProductReply : all) { - Map map = new LinkedHashMap<>(); - map.put("用户ID", yxStoreProductReply.getUid()); - map.put("订单ID", yxStoreProductReply.getOid()); - map.put("唯一id", yxStoreProductReply.getUnique()); - map.put("产品id", yxStoreProductReply.getProductId()); - map.put("某种商品类型(普通商品、秒杀商品)", yxStoreProductReply.getReplyType()); - map.put("商品分数", yxStoreProductReply.getProductScore()); - map.put("服务分数", yxStoreProductReply.getServiceScore()); - map.put("评论内容", yxStoreProductReply.getComment()); - map.put("评论图片", yxStoreProductReply.getPics()); - map.put("评论时间", yxStoreProductReply.getAddTime()); - map.put("管理员回复内容", yxStoreProductReply.getMerchantReplyContent()); - map.put("管理员回复时间", yxStoreProductReply.getMerchantReplyTime()); - map.put("0未删除1已删除", yxStoreProductReply.getIsDel()); - map.put("0未回复1已回复", yxStoreProductReply.getIsReply()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + 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-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java index 088a8e36..ec11ebf0 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxStoreProductServiceImpl.java @@ -1,159 +1,148 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import co.yixiang.constant.ShopConstants; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxStoreProduct; -import co.yixiang.common.service.impl.BaseServiceImpl; 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.service.YxStoreProductAttrResultService; -import co.yixiang.modules.shop.service.YxStoreProductAttrService; -import co.yixiang.modules.shop.service.YxStoreProductAttrValueService; +import co.yixiang.modules.shop.repository.*; +import co.yixiang.modules.shop.service.YxStoreProductService; import co.yixiang.modules.shop.service.dto.*; -import co.yixiang.utils.*; +import co.yixiang.modules.shop.service.mapper.YxStoreProductMapper; +import co.yixiang.utils.OrderUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.modules.shop.service.YxStoreProductService; -import co.yixiang.modules.shop.service.mapper.StoreProductMapper; +import org.springframework.cache.annotation.CacheEvict; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Pageable; import java.math.BigDecimal; import java.util.*; -import java.io.IOException; import java.util.stream.Collectors; -import javax.servlet.http.HttpServletResponse; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-04 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxStoreProduct") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxStoreProductServiceImpl extends BaseServiceImpl implements YxStoreProductService { +public class YxStoreProductServiceImpl implements YxStoreProductService { - private final IGenerator generator; + private final YxStoreProductRepository yxStoreProductRepository; + private final YxStoreProductAttrRepository yxStoreProductAttrRepository; + private final YxStoreProductAttrValueRepository yxStoreProductAttrValueRepository; + private final YxStoreProductAttrResultRepository yxStoreProductAttrResultRepository; - private final StoreProductMapper storeProductMapper; + private final YxStoreProductMapper yxStoreProductMapper; - private final YxStoreProductAttrService yxStoreProductAttrService; + public YxStoreProductServiceImpl(YxStoreProductRepository yxStoreProductRepository, + YxStoreProductAttrRepository yxStoreProductAttrRepository, YxStoreProductAttrValueRepository yxStoreProductAttrValueRepository, + YxStoreProductAttrResultRepository yxStoreProductAttrResultRepository, YxStoreProductMapper yxStoreProductMapper) { + this.yxStoreProductRepository = yxStoreProductRepository; + this.yxStoreProductAttrRepository = yxStoreProductAttrRepository; + this.yxStoreProductAttrValueRepository = yxStoreProductAttrValueRepository; + this.yxStoreProductAttrResultRepository = yxStoreProductAttrResultRepository; + this.yxStoreProductMapper = yxStoreProductMapper; + } - private final YxStoreProductAttrValueService yxStoreProductAttrValueService; - - private final YxStoreProductAttrResultService yxStoreProductAttrResultService; @Override - //@Cacheable - public Map queryAll(YxStoreProductQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxStoreProductDto.class)); - map.put("totalElements", page.getTotal()); + 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()) { + + YxStoreProductDTO yxStoreProductDTO = yxStoreProductMapper.toDto(product); + + //规格属性库存 + Integer newStock = yxStoreProductAttrValueRepository.sumStock(product.getId()); + if(newStock != null) yxStoreProductDTO.setStock(newStock); + + storeProductDTOS.add(yxStoreProductDTO); + } + Map map = new LinkedHashMap<>(2); + map.put("content",storeProductDTOS); + map.put("totalElements",page.getTotalElements()); return map; } - - @Override - //@Cacheable - public List queryAll(YxStoreProductQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreProduct.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxStoreProductDto yxStoreProduct : all) { - Map map = new LinkedHashMap<>(); - map.put("商户Id(0为总后台管理员创建,不为0的时候是商户后台创建)", yxStoreProduct.getMerId()); - map.put("商品图片", yxStoreProduct.getImage()); - map.put("轮播图", yxStoreProduct.getSliderImage()); - map.put("商品名称", yxStoreProduct.getStoreName()); - map.put("商品简介", yxStoreProduct.getStoreInfo()); - map.put("关键字", yxStoreProduct.getKeyword()); - map.put("产品条码(一维码)", yxStoreProduct.getBarCode()); - map.put("分类id", yxStoreProduct.getCateId()); - map.put("商品价格", yxStoreProduct.getPrice()); - map.put("会员价格", yxStoreProduct.getVipPrice()); - map.put("市场价", yxStoreProduct.getOtPrice()); - map.put("邮费", yxStoreProduct.getPostage()); - map.put("单位名", yxStoreProduct.getUnitName()); - map.put("排序", yxStoreProduct.getSort()); - map.put("销量", yxStoreProduct.getSales()); - map.put("库存", yxStoreProduct.getStock()); - map.put("状态(0:未上架,1:上架)", yxStoreProduct.getIsShow()); - map.put("是否热卖", yxStoreProduct.getIsHot()); - map.put("是否优惠", yxStoreProduct.getIsBenefit()); - map.put("是否精品", yxStoreProduct.getIsBest()); - map.put("是否新品", yxStoreProduct.getIsNew()); - map.put("产品描述", yxStoreProduct.getDescription()); - map.put("添加时间", yxStoreProduct.getAddTime()); - map.put("是否包邮", yxStoreProduct.getIsPostage()); - map.put("是否删除", yxStoreProduct.getIsDel()); - map.put("商户是否代理 0不可代理1可代理", yxStoreProduct.getMerUse()); - map.put("获得积分", yxStoreProduct.getGiveIntegral()); - map.put("成本价", yxStoreProduct.getCost()); - map.put("秒杀状态 0 未开启 1已开启", yxStoreProduct.getIsSeckill()); - map.put("砍价状态 0未开启 1开启", yxStoreProduct.getIsBargain()); - map.put("是否优品推荐", yxStoreProduct.getIsGood()); - map.put("虚拟销量", yxStoreProduct.getFicti()); - map.put("浏览量", yxStoreProduct.getBrowse()); - map.put("产品二维码地址(用户小程序海报)", yxStoreProduct.getCodePath()); - map.put("淘宝京东1688类型", yxStoreProduct.getSoureLink()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + 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) { - storeProductMapper.updateDel(0,id); - storeProductMapper.updateOnsale(0,id); + yxStoreProductRepository.updateDel(0,id); + yxStoreProductRepository.updateOnsale(0,id); } @Override - public void onSale(Integer id, int status) { + @Transactional(rollbackFor = Exception.class) + public void onSale(Integer id, Integer status) { if(status == 1){ status = 0; }else{ status = 1; } - storeProductMapper.updateOnsale(status,id); + yxStoreProductRepository.updateOnsale(status,id); } @Override - public List isFormatAttr(Integer id, String jsonStr) { + @Transactional(rollbackFor = Exception.class) + public List isFormatAttr(Integer id, String jsonStr) { if(ObjectUtil.isNull(id)) throw new BadRequestException("产品不存在"); - YxStoreProductDto yxStoreProductDTO = generator.convert(this.getById(id),YxStoreProductDto.class); - DetailDto detailDTO = attrFormat(jsonStr); - List newList = new ArrayList<>(); + 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 productFormatDTO = new ProductFormatDTO(); + productFormatDTO.setDetail(map.get("detail")); productFormatDTO.setCost(yxStoreProductDTO.getCost().doubleValue()); productFormatDTO.setPrice(yxStoreProductDTO.getPrice().doubleValue()); @@ -161,7 +150,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl attrList = JSON.parseArray( + List attrList = JSON.parseArray( jsonObject.get("items").toString(), - FromatDetailDto.class); - List valueList = JSON.parseArray( + FromatDetailDTO.class); + List valueList = JSON.parseArray( jsonObject.get("attrs").toString(), - ProductFormatDto.class); + ProductFormatDTO.class); List attrGroup = new ArrayList<>(); - for (FromatDetailDto fromatDetailDTO : attrList) { + for (FromatDetailDTO fromatDetailDTO : attrList) { YxStoreProductAttr yxStoreProductAttr = new YxStoreProductAttr(); yxStoreProductAttr.setProductId(id); yxStoreProductAttr.setAttrName(fromatDetailDTO.getValue()); @@ -190,7 +182,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl valueGroup = new ArrayList<>(); - for (ProductFormatDto productFormatDTO : valueList) { + for (ProductFormatDTO productFormatDTO : valueList) { YxStoreProductAttrValue yxStoreProductAttrValue = new YxStoreProductAttrValue(); yxStoreProductAttrValue.setProductId(id); //productFormatDTO.getDetail().values().stream().collect(Collectors.toList()); @@ -217,10 +209,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl map = new LinkedHashMap<>(); map.put("attr",jsonObject.get("items")); @@ -228,7 +220,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl map,Integer id) { @@ -237,17 +231,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl().eq("product_id",id)); + yxStoreProductAttrResultRepository.deleteByProductId(id); - yxStoreProductAttrResultService.save(yxStoreProductAttrResult); - } - - @Override - public String getStoreProductAttrResult(Integer id) { - YxStoreProductAttrResult yxStoreProductAttrResult = yxStoreProductAttrResultService - .getOne(new QueryWrapper().eq("product_id",id)); - if(ObjectUtil.isNull(yxStoreProductAttrResult)) return ""; - return yxStoreProductAttrResult.getResult(); + yxStoreProductAttrResultRepository.save(yxStoreProductAttrResult); } @Override @@ -255,24 +241,37 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl().eq("product_id",id)); - yxStoreProductAttrValueService.remove(new QueryWrapper().eq("product_id",id)); + yxStoreProductAttrRepository.deleteByProductId(id); + yxStoreProductAttrValueRepository.deleteByProductId(id); if(isActice){ - yxStoreProductAttrResultService.remove(new QueryWrapper().eq("product_id",id)); + 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){ + 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 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(); @@ -287,9 +286,14 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl>> 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("_")); @@ -299,12 +303,19 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl dataArr = new ArrayList<>(); - for (FromatDetailDto fromatDetailDTO : fromatDetailDTOList) { + for (FromatDetailDTO fromatDetailDTO : fromatDetailDTOList) { for (String str : fromatDetailDTO.getDetail()) { Map> map2 = new LinkedHashMap<>(); @@ -326,12 +337,18 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl implements YxSystemConfigService { +public class YxSystemConfigServiceImpl implements YxSystemConfigService { - private final IGenerator generator; + private final YxSystemConfigRepository yxSystemConfigRepository; - @Override - //@Cacheable - public Map queryAll(YxSystemConfigQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxSystemConfigDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } + private final YxSystemConfigMapper yxSystemConfigMapper; - - @Override - //@Cacheable - public List queryAll(YxSystemConfigQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxSystemConfig.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxSystemConfigDto yxSystemConfig : all) { - Map map = new LinkedHashMap<>(); - map.put("字段名称", yxSystemConfig.getMenuName()); - map.put("默认值", yxSystemConfig.getValue()); - map.put("排序", yxSystemConfig.getSort()); - map.put("是否隐藏", yxSystemConfig.getStatus()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxSystemConfigServiceImpl(YxSystemConfigRepository yxSystemConfigRepository, YxSystemConfigMapper yxSystemConfigMapper) { + this.yxSystemConfigRepository = yxSystemConfigRepository; + this.yxSystemConfigMapper = yxSystemConfigMapper; } @Override - public YxSystemConfig findByKey(String key) { - return this.getOne(new QueryWrapper().eq("menu_name",key)); + 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-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java index eb7af7ad..3e711981 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemGroupDataServiceImpl.java @@ -1,91 +1,93 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxSystemGroupData; -import co.yixiang.common.service.impl.BaseServiceImpl; -import com.alibaba.fastjson.JSON; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +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.YxSystemGroupDataDTO; import co.yixiang.modules.shop.service.dto.YxSystemGroupDataQueryCriteria; -import co.yixiang.modules.shop.service.mapper.SystemGroupDataMapper; +import co.yixiang.modules.shop.service.mapper.YxSystemGroupDataMapper; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import com.alibaba.fastjson.JSON; +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.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.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.*; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-10-18 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxSystemGroupData") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxSystemGroupDataServiceImpl extends BaseServiceImpl implements YxSystemGroupDataService { +public class YxSystemGroupDataServiceImpl implements YxSystemGroupDataService { - private final IGenerator generator; + private final YxSystemGroupDataRepository yxSystemGroupDataRepository; + + private final YxSystemGroupDataMapper yxSystemGroupDataMapper; + + public YxSystemGroupDataServiceImpl(YxSystemGroupDataRepository yxSystemGroupDataRepository, YxSystemGroupDataMapper yxSystemGroupDataMapper) { + this.yxSystemGroupDataRepository = yxSystemGroupDataRepository; + this.yxSystemGroupDataMapper = yxSystemGroupDataMapper; + } @Override - //@Cacheable - public Map queryAll(YxSystemGroupDataQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - List systemGroupDataDTOS = new ArrayList<>(); - for (YxSystemGroupData systemGroupData : page.getList()) { + 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 = generator.convert(systemGroupData,YxSystemGroupDataDto.class); + 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.getTotal()); + map.put("totalElements",page.getTotalElements()); return map; } - @Override - //@Cacheable - public List queryAll(YxSystemGroupDataQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxSystemGroupData.class, criteria)); + 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 - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxSystemGroupDataDto yxSystemGroupData : all) { - Map map = new LinkedHashMap<>(); - map.put("对应的数据名称", yxSystemGroupData.getGroupName()); - map.put("数据组对应的数据值(json数据)", yxSystemGroupData.getValue()); - map.put("添加数据时间", yxSystemGroupData.getAddTime()); - map.put("数据排序", yxSystemGroupData.getSort()); - map.put("状态(1:开启;2:关闭;)", yxSystemGroupData.getStatus()); - list.add(map); + @Transactional(rollbackFor = Exception.class) + public YxSystemGroupDataDTO create(YxSystemGroupData resources) { + if(resources.getStatus() == null){ + resources.setStatus(1); } - FileUtil.downloadExcel(list, response); + 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); } } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java index c7821d2a..84cbfe31 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemStoreServiceImpl.java @@ -1,24 +1,13 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxSystemStore; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; +import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.FileUtil; +import co.yixiang.modules.shop.repository.YxSystemStoreRepository; import co.yixiang.modules.shop.service.YxSystemStoreService; import co.yixiang.modules.shop.service.dto.YxSystemStoreDto; import co.yixiang.modules.shop.service.dto.YxSystemStoreQueryCriteria; -import co.yixiang.modules.shop.service.mapper.SystemStoreMapper; +import co.yixiang.modules.shop.service.mapper.YxSystemStoreMapper; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -26,8 +15,10 @@ import org.springframework.transaction.annotation.Transactional; //import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.Cacheable; +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; import java.io.IOException; @@ -37,34 +28,67 @@ import java.util.LinkedHashMap; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-03 */ @Service -@AllArgsConstructor //@CacheConfig(cacheNames = "yxSystemStore") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxSystemStoreServiceImpl extends BaseServiceImpl implements YxSystemStoreService { +public class YxSystemStoreServiceImpl implements YxSystemStoreService { - private final IGenerator generator; + private final YxSystemStoreRepository yxSystemStoreRepository; + + private final YxSystemStoreMapper yxSystemStoreMapper; + + public YxSystemStoreServiceImpl(YxSystemStoreRepository yxSystemStoreRepository, YxSystemStoreMapper yxSystemStoreMapper) { + this.yxSystemStoreRepository = yxSystemStoreRepository; + this.yxSystemStoreMapper = yxSystemStoreMapper; + } @Override //@Cacheable - public Map queryAll(YxSystemStoreQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxSystemStoreDto.class)); - map.put("totalElements", page.getTotal()); - return map; + public Map queryAll(YxSystemStoreQueryCriteria criteria, Pageable pageable){ + Page page = yxSystemStoreRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxSystemStoreMapper::toDto)); } - @Override //@Cacheable - public List queryAll(YxSystemStoreQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxSystemStore.class, criteria)); + public List queryAll(YxSystemStoreQueryCriteria criteria){ + return yxSystemStoreMapper.toDto(yxSystemStoreRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } + @Override + //@Cacheable(key = "#p0") + public YxSystemStoreDto findById(Integer id) { + YxSystemStore yxSystemStore = yxSystemStoreRepository.findById(id).orElseGet(YxSystemStore::new); + ValidationUtil.isNull(yxSystemStore.getId(),"YxSystemStore","id",id); + return yxSystemStoreMapper.toDto(yxSystemStore); + } + + @Override + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public YxSystemStoreDto create(YxSystemStore resources) { + return yxSystemStoreMapper.toDto(yxSystemStoreRepository.save(resources)); + } + + @Override + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(YxSystemStore resources) { + YxSystemStore yxSystemStore = yxSystemStoreRepository.findById(resources.getId()).orElseGet(YxSystemStore::new); + ValidationUtil.isNull( yxSystemStore.getId(),"YxSystemStore","id",resources.getId()); + yxSystemStore.copy(resources); + yxSystemStoreRepository.save(yxSystemStore); + } + + @Override + //@CacheEvict(allEntries = true) + public void deleteAll(Integer[] ids) { + for (Integer id : ids) { + yxSystemStoreRepository.deleteById(id); + } + } @Override public void download(List all, HttpServletResponse response) throws IOException { @@ -88,4 +112,4 @@ public class YxSystemStoreServiceImpl extends BaseServiceImpl implements YxSystemStoreStaffService { +public class YxSystemStoreStaffServiceImpl implements YxSystemStoreStaffService { - private final IGenerator generator; + private final YxSystemStoreStaffRepository yxSystemStoreStaffRepository; + + private final YxSystemStoreStaffMapper yxSystemStoreStaffMapper; + + private final YxSystemStoreService systemStoreService; + + public YxSystemStoreStaffServiceImpl(YxSystemStoreStaffRepository yxSystemStoreStaffRepository, + YxSystemStoreStaffMapper yxSystemStoreStaffMapper, + YxSystemStoreService systemStoreService) { + this.yxSystemStoreStaffRepository = yxSystemStoreStaffRepository; + this.yxSystemStoreStaffMapper = yxSystemStoreStaffMapper; + this.systemStoreService = systemStoreService; + } @Override //@Cacheable - public Map queryAll(YxSystemStoreStaffQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxSystemStoreStaffDto.class)); - map.put("totalElements", page.getTotal()); - return map; + public Map queryAll(YxSystemStoreStaffQueryCriteria criteria, Pageable pageable){ + Page page = yxSystemStoreStaffRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxSystemStoreStaffMapper::toDto)); } - @Override //@Cacheable - public List queryAll(YxSystemStoreStaffQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxSystemStoreStaff.class, criteria)); + public List queryAll(YxSystemStoreStaffQueryCriteria criteria){ + return yxSystemStoreStaffMapper.toDto(yxSystemStoreStaffRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } + @Override + //@Cacheable(key = "#p0") + public YxSystemStoreStaffDto findById(Integer id) { + YxSystemStoreStaff yxSystemStoreStaff = yxSystemStoreStaffRepository.findById(id).orElseGet(YxSystemStoreStaff::new); + ValidationUtil.isNull(yxSystemStoreStaff.getId(),"YxSystemStoreStaff","id",id); + return yxSystemStoreStaffMapper.toDto(yxSystemStoreStaff); + } + + @Override + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public YxSystemStoreStaffDto create(YxSystemStoreStaff resources) { + YxSystemStoreDto systemStoreDto = systemStoreService.findById(resources.getStoreId()); + resources.setStoreName(systemStoreDto.getName()); + resources.setAddTime(OrderUtil.getSecondTimestampTwo()); + return yxSystemStoreStaffMapper.toDto(yxSystemStoreStaffRepository.save(resources)); + } + + @Override + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(YxSystemStoreStaff resources) { + YxSystemStoreDto systemStoreDto = systemStoreService.findById(resources.getStoreId()); + resources.setStoreName(systemStoreDto.getName()); + YxSystemStoreStaff yxSystemStoreStaff = yxSystemStoreStaffRepository.findById(resources.getId()).orElseGet(YxSystemStoreStaff::new); + ValidationUtil.isNull( yxSystemStoreStaff.getId(),"YxSystemStoreStaff","id",resources.getId()); + yxSystemStoreStaff.copy(resources); + yxSystemStoreStaffRepository.save(yxSystemStoreStaff); + } + + @Override + //@CacheEvict(allEntries = true) + public void deleteAll(Integer[] ids) { + for (Integer id : ids) { + yxSystemStoreStaffRepository.deleteById(id); + } + } @Override public void download(List all, HttpServletResponse response) throws IOException { @@ -85,4 +119,4 @@ public class YxSystemStoreStaffServiceImpl extends BaseServiceImpl implements YxSystemUserLevelService { +public class YxSystemUserLevelServiceImpl implements YxSystemUserLevelService { - private final IGenerator generator; + private final YxSystemUserLevelRepository yxSystemUserLevelRepository; - @Override - //@Cacheable - public Map queryAll(YxSystemUserLevelQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxSystemUserLevelDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxSystemUserLevelMapper yxSystemUserLevelMapper; + + public YxSystemUserLevelServiceImpl(YxSystemUserLevelRepository yxSystemUserLevelRepository, YxSystemUserLevelMapper yxSystemUserLevelMapper) { + this.yxSystemUserLevelRepository = yxSystemUserLevelRepository; + this.yxSystemUserLevelMapper = yxSystemUserLevelMapper; } - @Override - //@Cacheable - public List queryAll(YxSystemUserLevelQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxSystemUserLevel.class, criteria)); + public Map queryAll(YxSystemUserLevelQueryCriteria criteria, Pageable pageable){ + Page page = yxSystemUserLevelRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxSystemUserLevelMapper::toDto)); } + @Override + public List queryAll(YxSystemUserLevelQueryCriteria criteria){ + return yxSystemUserLevelMapper.toDto(yxSystemUserLevelRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxSystemUserLevelDto yxSystemUserLevel : all) { - Map map = new LinkedHashMap<>(); - map.put("商户id", yxSystemUserLevel.getMerId()); - map.put("会员名称", yxSystemUserLevel.getName()); - map.put("购买金额", yxSystemUserLevel.getMoney()); - map.put("有效时间", yxSystemUserLevel.getValidDate()); - map.put("是否为永久会员", yxSystemUserLevel.getIsForever()); - map.put("是否购买,1=购买,0=不购买", yxSystemUserLevel.getIsPay()); - map.put("是否显示 1=显示,0=隐藏", yxSystemUserLevel.getIsShow()); - map.put("会员等级", yxSystemUserLevel.getGrade()); - map.put("享受折扣", yxSystemUserLevel.getDiscount()); - map.put("会员卡背景", yxSystemUserLevel.getImage()); - map.put("会员图标", yxSystemUserLevel.getIcon()); - map.put("说明", yxSystemUserLevel.getExplain()); - map.put("添加时间", yxSystemUserLevel.getAddTime()); - map.put("是否删除.1=删除,0=未删除", yxSystemUserLevel.getIsDel()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxSystemUserLevelDTO findById(Integer id) { + Optional yxSystemUserLevel = yxSystemUserLevelRepository.findById(id); + ValidationUtil.isNull(yxSystemUserLevel,"YxSystemUserLevel","id",id); + return yxSystemUserLevelMapper.toDto(yxSystemUserLevel.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxSystemUserLevelDTO create(YxSystemUserLevel resources) { + return yxSystemUserLevelMapper.toDto(yxSystemUserLevelRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxSystemUserLevel resources) { + Optional optionalYxSystemUserLevel = yxSystemUserLevelRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxSystemUserLevel,"YxSystemUserLevel","id",resources.getId()); + YxSystemUserLevel yxSystemUserLevel = optionalYxSystemUserLevel.get(); + yxSystemUserLevel.copy(resources); + yxSystemUserLevelRepository.save(yxSystemUserLevel); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxSystemUserLevelRepository.deleteById(id); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemUserTaskServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemUserTaskServiceImpl.java index 4bca7ed5..ec3ddaaa 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemUserTaskServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxSystemUserTaskServiceImpl.java @@ -1,93 +1,115 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxSystemUserTask; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.shop.repository.YxSystemUserTaskRepository; +import co.yixiang.modules.shop.service.YxSystemUserLevelService; import co.yixiang.modules.shop.service.YxSystemUserTaskService; -import co.yixiang.modules.shop.service.dto.YxSystemUserTaskDto; +import co.yixiang.modules.shop.service.dto.YxSystemUserTaskDTO; import co.yixiang.modules.shop.service.dto.YxSystemUserTaskQueryCriteria; -import co.yixiang.modules.shop.service.mapper.SystemUserTaskMapper; +import co.yixiang.modules.shop.service.mapper.YxSystemUserTaskMapper; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Pageable; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-04 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxSystemUserTask") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxSystemUserTaskServiceImpl extends BaseServiceImpl implements YxSystemUserTaskService { +public class YxSystemUserTaskServiceImpl implements YxSystemUserTaskService { - private final IGenerator generator; + private final YxSystemUserTaskRepository yxSystemUserTaskRepository; + + private final YxSystemUserTaskMapper yxSystemUserTaskMapper; + + private final YxSystemUserLevelService systemUserLevelService; + + public YxSystemUserTaskServiceImpl(YxSystemUserTaskRepository yxSystemUserTaskRepository, YxSystemUserTaskMapper yxSystemUserTaskMapper, YxSystemUserLevelService systemUserLevelService) { + this.yxSystemUserTaskRepository = yxSystemUserTaskRepository; + this.yxSystemUserTaskMapper = yxSystemUserTaskMapper; + this.systemUserLevelService = systemUserLevelService; + } @Override - //@Cacheable - public Map queryAll(YxSystemUserTaskQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - List systemUserTaskDTOS = generator.convert(page.getList(),YxSystemUserTaskDto.class); - for (YxSystemUserTaskDto systemUserTaskDTO : systemUserTaskDTOS) { - systemUserTaskDTO.setLevalName(this - .getById(systemUserTaskDTO.getLevelId()).getName()); + public Map queryAll(YxSystemUserTaskQueryCriteria criteria, Pageable pageable){ + + Page page = yxSystemUserTaskRepository + .findAll((root, criteriaQuery, criteriaBuilder) + -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + + List systemUserTaskDTOS = yxSystemUserTaskMapper + .toDto(page.getContent()); + for (YxSystemUserTaskDTO systemUserTaskDTO : systemUserTaskDTOS) { + systemUserTaskDTO.setLevalName(systemUserLevelService + .findById(systemUserTaskDTO.getLevelId()).getName()); } - Map map = new LinkedHashMap<>(2); - map.put("content", systemUserTaskDTOS); - map.put("totalElements", page.getTotal()); + + Map map = new LinkedHashMap<>(2); + map.put("content",systemUserTaskDTOS); + map.put("totalElements",page.getTotalElements()); + return map; - } + } @Override - //@Cacheable - public List queryAll(YxSystemUserTaskQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxSystemUserTask.class, criteria)); + public List queryAll(YxSystemUserTaskQueryCriteria criteria){ + return yxSystemUserTaskMapper.toDto(yxSystemUserTaskRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxSystemUserTaskDto yxSystemUserTask : all) { - Map map = new LinkedHashMap<>(); - map.put("任务名称", yxSystemUserTask.getName()); - map.put("配置原名", yxSystemUserTask.getRealName()); - map.put("任务类型", yxSystemUserTask.getTaskType()); - map.put("限定数", yxSystemUserTask.getNumber()); - map.put("等级id", yxSystemUserTask.getLevelId()); - map.put("排序", yxSystemUserTask.getSort()); - map.put("是否显示", yxSystemUserTask.getIsShow()); - map.put("是否务必达成任务,1务必达成,0=满足其一", yxSystemUserTask.getIsMust()); - map.put("任务说明", yxSystemUserTask.getIllustrate()); - map.put("新增时间", yxSystemUserTask.getAddTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxSystemUserTaskDTO findById(Integer id) { + Optional yxSystemUserTask = yxSystemUserTaskRepository.findById(id); + ValidationUtil.isNull(yxSystemUserTask,"YxSystemUserTask","id",id); + return yxSystemUserTaskMapper.toDto(yxSystemUserTask.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxSystemUserTaskDTO create(YxSystemUserTask resources) { + return yxSystemUserTaskMapper.toDto(yxSystemUserTaskRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxSystemUserTask resources) { + Optional optionalYxSystemUserTask = yxSystemUserTaskRepository.findById(resources.getId()); + ValidationUtil.isNull( optionalYxSystemUserTask,"YxSystemUserTask","id",resources.getId()); + YxSystemUserTask yxSystemUserTask = optionalYxSystemUserTask.get(); + yxSystemUserTask.copy(resources); + yxSystemUserTaskRepository.save(yxSystemUserTask); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer id) { + yxSystemUserTaskRepository.deleteById(id); + } + + /** + * 任务类型 + * @return + */ + @Override + public List> getTaskType() { + List> list = null; + Map map = new LinkedHashMap<>(); + map.put("type","SatisfactionIntegral"); + map.put("type","SatisfactionIntegral"); + map.put("type","SatisfactionIntegral"); + map.put("type","SatisfactionIntegral"); + map.put("type","SatisfactionIntegral"); + map.put("type","SatisfactionIntegral"); + return null; + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxUserBillServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxUserBillServiceImpl.java index ede043c5..994d8f4c 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxUserBillServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxUserBillServiceImpl.java @@ -1,91 +1,82 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxUserBill; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +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.YxUserBillDTO; import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria; -import co.yixiang.modules.shop.service.mapper.UserBillMapper; -import org.apache.xmlbeans.impl.xb.xmlconfig.Qnametargetlist; +import co.yixiang.modules.shop.service.mapper.YxUserBillMapper; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Pageable; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-11-06 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxUserBill") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxUserBillServiceImpl extends BaseServiceImpl implements YxUserBillService { +public class YxUserBillServiceImpl implements YxUserBillService { - private final IGenerator generator; + private final YxUserBillRepository yxUserBillRepository; + + private final YxUserBillMapper yxUserBillMapper; + + public YxUserBillServiceImpl(YxUserBillRepository yxUserBillRepository, YxUserBillMapper yxUserBillMapper) { + this.yxUserBillRepository = yxUserBillRepository; + this.yxUserBillMapper = yxUserBillMapper; + } @Override - //@Cacheable - public Map queryAll(YxUserBillQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", page.getList()); - map.put("totalElements", page.getTotal()); + public Map queryAll(YxUserBillQueryCriteria criteria, Pageable pageable){ + Page page = yxUserBillRepository.findAllByPageable(criteria.getCategory() + ,criteria.getType(),criteria.getNickname(),pageable); + Map map = new LinkedHashMap<>(2); + map.put("content",page.getContent()); + map.put("totalElements",page.getTotalElements()); return map; } - @Override - //@Cacheable - public List queryAll(YxUserBillQueryCriteria criteria){ - - return baseMapper.findAllByQueryCriteria(criteria.getCategory(),criteria.getType(),criteria.getNickname()); + 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 - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxUserBillDto yxUserBill : all) { - Map map = new LinkedHashMap<>(); - map.put("用户uid", yxUserBill.getUid()); - map.put("关联id", yxUserBill.getLinkId()); - map.put("0 = 支出 1 = 获得", yxUserBill.getPm()); - map.put("账单标题", yxUserBill.getTitle()); - map.put("明细种类", yxUserBill.getCategory()); - map.put("明细类型", yxUserBill.getType()); - map.put("明细数字", yxUserBill.getNumber()); - map.put("剩余", yxUserBill.getBalance()); - map.put("备注", yxUserBill.getMark()); - map.put("添加时间", yxUserBill.getAddTime()); - map.put("0 = 带确定 1 = 有效 -1 = 无效", yxUserBill.getStatus()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + @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-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxUserRechargeServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxUserRechargeServiceImpl.java index 0451d12d..8a50b417 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxUserRechargeServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxUserRechargeServiceImpl.java @@ -1,33 +1,25 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxUserRecharge; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; +import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.FileUtil; +import co.yixiang.modules.shop.repository.YxUserRechargeRepository; import co.yixiang.modules.shop.service.YxUserRechargeService; import co.yixiang.modules.shop.service.dto.YxUserRechargeDto; import co.yixiang.modules.shop.service.dto.YxUserRechargeQueryCriteria; -import co.yixiang.modules.shop.service.mapper.UserRechargeMapper; +import co.yixiang.modules.shop.service.mapper.YxUserRechargeMapper; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import co.yixiang.exception.EntityExistException; // 默认不使用缓存 //import org.springframework.cache.annotation.CacheConfig; //import org.springframework.cache.annotation.CacheEvict; //import org.springframework.cache.annotation.Cacheable; +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; import java.io.IOException; @@ -37,35 +29,62 @@ import java.util.LinkedHashMap; /** * @author hupeng -* @date 2020-05-12 +* @date 2020-03-02 */ @Service -@AllArgsConstructor //@CacheConfig(cacheNames = "yxUserRecharge") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxUserRechargeServiceImpl extends BaseServiceImpl implements YxUserRechargeService { +public class YxUserRechargeServiceImpl implements YxUserRechargeService { - private final IGenerator generator; + private final YxUserRechargeRepository yxUserRechargeRepository; + + private final YxUserRechargeMapper yxUserRechargeMapper; + + public YxUserRechargeServiceImpl(YxUserRechargeRepository yxUserRechargeRepository, YxUserRechargeMapper yxUserRechargeMapper) { + this.yxUserRechargeRepository = yxUserRechargeRepository; + this.yxUserRechargeMapper = yxUserRechargeMapper; + } @Override //@Cacheable - public Map queryAll(YxUserRechargeQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxUserRechargeDto.class)); - map.put("totalElements", page.getTotal()); - return map; + public Map queryAll(YxUserRechargeQueryCriteria criteria, Pageable pageable){ + Page page = yxUserRechargeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxUserRechargeMapper::toDto)); + } + + @Override + //@Cacheable + public List queryAll(YxUserRechargeQueryCriteria criteria){ + return yxUserRechargeMapper.toDto(yxUserRechargeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + //@Cacheable(key = "#p0") + public YxUserRechargeDto findById(Integer id) { + YxUserRecharge yxUserRecharge = yxUserRechargeRepository.findById(id).orElseGet(YxUserRecharge::new); + ValidationUtil.isNull(yxUserRecharge.getId(),"YxUserRecharge","id",id); + return yxUserRechargeMapper.toDto(yxUserRecharge); + } + + @Override + //@CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public YxUserRechargeDto create(YxUserRecharge resources) { + if(yxUserRechargeRepository.findByOrderId(resources.getOrderId()) != null){ + throw new EntityExistException(YxUserRecharge.class,"order_id",resources.getOrderId()); + } + return yxUserRechargeMapper.toDto(yxUserRechargeRepository.save(resources)); } @Override - //@Cacheable - public List queryAll(YxUserRechargeQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxUserRecharge.class, criteria)); + //@CacheEvict(allEntries = true) + public void deleteAll(Integer[] ids) { + for (Integer id : ids) { + yxUserRechargeRepository.deleteById(id); + } } - @Override public void download(List all, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); @@ -84,4 +103,4 @@ public class YxUserRechargeServiceImpl extends BaseServiceImpl implements YxUserService { +public class YxUserServiceImpl implements YxUserService { - private final IGenerator generator; + private final YxUserRepository yxUserRepository; - private final UserMapper yxUserMapper; + private final YxUserMapper yxUserMapper; - @Override - //@Cacheable - public Map queryAll(YxUserQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxUserDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } + private final YxUserBillService yxUserBillService; - - @Override - //@Cacheable - public List queryAll(YxUserQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxUser.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxUserDto yxUser : all) { - Map map = new LinkedHashMap<>(); - map.put("用户账户(跟accout一样)", yxUser.getUsername()); - map.put("用户账号", yxUser.getAccount()); - map.put("用户密码(跟pwd)", yxUser.getPassword()); - map.put("用户密码", yxUser.getPwd()); - map.put("真实姓名", yxUser.getRealName()); - map.put("生日", yxUser.getBirthday()); - map.put("身份证号码", yxUser.getCardId()); - map.put("用户备注", yxUser.getMark()); - map.put("合伙人id", yxUser.getPartnerId()); - map.put("用户分组id", yxUser.getGroupId()); - map.put("用户昵称", yxUser.getNickname()); - map.put("用户头像", yxUser.getAvatar()); - map.put("手机号码", yxUser.getPhone()); - map.put("添加时间", yxUser.getAddTime()); - map.put("添加ip", yxUser.getAddIp()); - map.put("最后一次登录时间", yxUser.getLastTime()); - map.put("最后一次登录ip", yxUser.getLastIp()); - map.put("用户余额", yxUser.getNowMoney()); - map.put("佣金金额", yxUser.getBrokeragePrice()); - map.put("用户剩余积分", yxUser.getIntegral()); - map.put("连续签到天数", yxUser.getSignNum()); - map.put("1为正常,0为禁止", yxUser.getStatus()); - map.put("等级", yxUser.getLevel()); - map.put("推广元id", yxUser.getSpreadUid()); - map.put("推广员关联时间", yxUser.getSpreadTime()); - map.put("用户类型", yxUser.getUserType()); - map.put("是否为推广员", yxUser.getIsPromoter()); - map.put("用户购买次数", yxUser.getPayCount()); - map.put("下级人数", yxUser.getSpreadCount()); - map.put("清理会员时间", yxUser.getCleanTime()); - map.put("详细地址", yxUser.getAddres()); - map.put("管理员编号 ", yxUser.getAdminid()); - map.put("用户登陆类型,h5,wechat,routine", yxUser.getLoginType()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxUserServiceImpl(YxUserRepository yxUserRepository, YxUserMapper yxUserMapper, YxUserBillService yxUserBillService) { + this.yxUserRepository = yxUserRepository; + this.yxUserMapper = yxUserMapper; + this.yxUserBillService = yxUserBillService; } @Override @Transactional(rollbackFor = Exception.class) - public void onStatus(Integer uid, int status) { + public void updateMoney(UserMoneyDTO param) { + YxUserDTO userDTO = findById(param.getUid()); + Double newMoney = 0d; + String mark = ""; + String type = "system_add"; + Integer pm = 1; + String title = "系统增加余额"; + if(param.getPtype() == 1){ + mark = "系统增加了"+param.getMoney()+"余额"; + newMoney = NumberUtil.add(userDTO.getNowMoney(),param.getMoney()).doubleValue(); + }else{ + title = "系统减少余额"; + mark = "系统扣除了"+param.getMoney()+"余额"; + type = "system_sub"; + pm = 0; + newMoney = NumberUtil.sub(userDTO.getNowMoney(),param.getMoney()).doubleValue(); + if(newMoney < 0) newMoney = 0d; + + } + YxUser user = new YxUser(); + user.setUid(userDTO.getUid()); + user.setNowMoney(BigDecimal.valueOf(newMoney)); + update(user); + + YxUserBill userBill = new YxUserBill(); + userBill.setUid(userDTO.getUid()); + userBill.setLinkId("0"); + userBill.setPm(pm); + userBill.setTitle(title); + userBill.setCategory("now_money"); + userBill.setType(type); + userBill.setNumber(BigDecimal.valueOf(param.getMoney())); + userBill.setBalance(BigDecimal.valueOf(newMoney)); + userBill.setMark(mark); + userBill.setAddTime(OrderUtil.getSecondTimestampTwo()); + userBill.setStatus(1); + yxUserBillService.create(userBill); + } + + @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); + if(yxUser.isPresent()){ + return yxUserMapper.toDto(yxUser.get()); + } + return new YxUserDTO(); + } + + @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; } - yxUserMapper.updateOnstatus(status,uid); + yxUserRepository.updateOnstatus(status,uid); } @Override @Transactional(rollbackFor = Exception.class) - public void updateMoney(UserMoneyDto param) { - //todo 修改用余额 - } - - @Override - public void incBrokeragePrice(double price, Integer uid) { - yxUserMapper.incBrokeragePrice(price,uid); + public void incBrokeragePrice(double price, int uid) { + yxUserRepository.incBrokeragePrice(price,uid); } } diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxWechatUserServiceImpl.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxWechatUserServiceImpl.java index e3a65916..68fdda5f 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxWechatUserServiceImpl.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/impl/YxWechatUserServiceImpl.java @@ -1,101 +1,78 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.impl; import co.yixiang.modules.shop.domain.YxWechatUser; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.shop.repository.YxWechatUserRepository; import co.yixiang.modules.shop.service.YxWechatUserService; -import co.yixiang.modules.shop.service.dto.YxWechatUserDto; +import co.yixiang.modules.shop.service.dto.YxWechatUserDTO; import co.yixiang.modules.shop.service.dto.YxWechatUserQueryCriteria; -import co.yixiang.modules.shop.service.mapper.WechatUserMapper; +import co.yixiang.modules.shop.service.mapper.YxWechatUserMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.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.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.util.Optional; /** * @author hupeng -* @date 2020-05-12 +* @date 2019-12-13 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "yxWechatUser") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class YxWechatUserServiceImpl extends BaseServiceImpl implements YxWechatUserService { +public class YxWechatUserServiceImpl implements YxWechatUserService { - private final IGenerator generator; + private final YxWechatUserRepository yxWechatUserRepository; - @Override - //@Cacheable - public Map queryAll(YxWechatUserQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), YxWechatUserDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final YxWechatUserMapper yxWechatUserMapper; + + public YxWechatUserServiceImpl(YxWechatUserRepository yxWechatUserRepository, YxWechatUserMapper yxWechatUserMapper) { + this.yxWechatUserRepository = yxWechatUserRepository; + this.yxWechatUserMapper = yxWechatUserMapper; } - @Override - //@Cacheable - public List queryAll(YxWechatUserQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(YxWechatUser.class, criteria)); + public Map queryAll(YxWechatUserQueryCriteria criteria, Pageable pageable){ + Page page = yxWechatUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(yxWechatUserMapper::toDto)); } + @Override + public List queryAll(YxWechatUserQueryCriteria criteria){ + return yxWechatUserMapper.toDto(yxWechatUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (YxWechatUserDto yxWechatUser : all) { - Map map = new LinkedHashMap<>(); - map.put("只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段", yxWechatUser.getUnionid()); - map.put("用户的标识,对当前公众号唯一", yxWechatUser.getOpenid()); - map.put("小程序唯一身份ID", yxWechatUser.getRoutineOpenid()); - map.put("用户的昵称", yxWechatUser.getNickname()); - map.put("用户头像", yxWechatUser.getHeadimgurl()); - map.put("用户的性别,值为1时是男性,值为2时是女性,值为0时是未知", yxWechatUser.getSex()); - map.put("用户所在城市", yxWechatUser.getCity()); - map.put("用户的语言,简体中文为zh_CN", yxWechatUser.getLanguage()); - map.put("用户所在省份", yxWechatUser.getProvince()); - map.put("用户所在国家", yxWechatUser.getCountry()); - map.put("公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注", yxWechatUser.getRemark()); - map.put("用户所在的分组ID(兼容旧的用户分组接口)", yxWechatUser.getGroupid()); - map.put("用户被打上的标签ID列表", yxWechatUser.getTagidList()); - map.put("用户是否订阅该公众号标识", yxWechatUser.getSubscribe()); - map.put("关注公众号时间", yxWechatUser.getSubscribeTime()); - map.put("添加时间", yxWechatUser.getAddTime()); - map.put("一级推荐人", yxWechatUser.getStair()); - map.put("二级推荐人", yxWechatUser.getSecond()); - map.put("一级推荐人订单", yxWechatUser.getOrderStair()); - map.put("二级推荐人订单", yxWechatUser.getOrderSecond()); - map.put("佣金", yxWechatUser.getNowMoney()); - map.put("小程序用户会话密匙", yxWechatUser.getSessionKey()); - map.put("用户类型", yxWechatUser.getUserType()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + public YxWechatUserDTO findById(Integer uid) { + Optional yxWechatUser = yxWechatUserRepository.findById(uid); + ValidationUtil.isNull(yxWechatUser,"YxWechatUser","uid",uid); + return yxWechatUserMapper.toDto(yxWechatUser.get()); } -} + + @Override + @Transactional(rollbackFor = Exception.class) + public YxWechatUserDTO create(YxWechatUser resources) { + return yxWechatUserMapper.toDto(yxWechatUserRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(YxWechatUser resources) { + Optional optionalYxWechatUser = yxWechatUserRepository.findById(resources.getUid()); + ValidationUtil.isNull( optionalYxWechatUser,"YxWechatUser","id",resources.getUid()); + YxWechatUser yxWechatUser = optionalYxWechatUser.get(); + yxWechatUser.copy(resources); + yxWechatUserRepository.save(yxWechatUser); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Integer uid) { + yxWechatUserRepository.deleteById(uid); + } +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/ExpressMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/ExpressMapper.java deleted file mode 100644 index eff79dd2..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/ExpressMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxExpress; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface ExpressMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialGroupMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialGroupMapper.java deleted file mode 100644 index 784314b9..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialGroupMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxMaterialGroup; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface MaterialGroupMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialMapper.java deleted file mode 100644 index e5274594..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/MaterialMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxMaterial; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface MaterialMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreCartMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreCartMapper.java deleted file mode 100644 index 9f1f4e50..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreCartMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreCart; -import co.yixiang.modules.shop.service.dto.CountDto; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; -import org.springframework.data.jpa.repository.Query; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreCartMapper extends CoreMapper { - @Select("SELECT t.cate_name as catename from yx_store_cart c " + - "LEFT JOIN yx_store_product p on c.product_id = p.id " + - "LEFT JOIN yx_store_category t on p.cate_id = t.id " + - "WHERE c.is_pay = 1") - List findCateName(); -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreCategoryMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreCategoryMapper.java deleted file mode 100644 index 0f6f3560..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreCategoryMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreCategory; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreCategoryMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderCartInfoMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderCartInfoMapper.java deleted file mode 100644 index ed6874a0..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderCartInfoMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreOrderCartInfo; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreOrderCartInfoMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderMapper.java deleted file mode 100644 index b56b6591..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderMapper.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreOrder; -import co.yixiang.modules.shop.service.dto.ChartDataDto; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreOrderMapper extends CoreMapper { - - @Select("SELECT COUNT(*) FROM yx_store_order WHERE pay_time >= ${today}") - Integer countByPayTimeGreaterThanEqual(@Param("today")int today); - @Select("SELECT COUNT(*) FROM yx_store_order WHERE pay_time < ${today} and pay_time >= ${yesterday}") - Integer countByPayTimeLessThanAndPayTimeGreaterThanEqual(@Param("today")int today, @Param("yesterday")int yesterday); - @Select( "select IFNULL(sum(pay_price),0) from yx_store_order " + - "where refund_status=0 and is_del=0 and paid=1") - Double sumTotalPrice(); - - @Select("SELECT IFNULL(sum(pay_price),0) as num," + - "FROM_UNIXTIME(add_time, '%m-%d') as time " + - " FROM yx_store_order where refund_status=0 and is_del=0 and paid=1 and pay_time >= ${time}" + - " GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " + - " ORDER BY add_time ASC") - List chartList(@Param("time") int time); - @Select("SELECT count(id) as num," + - "FROM_UNIXTIME(add_time, '%m-%d') as time " + - " FROM yx_store_order where refund_status=0 and is_del=0 and paid=1 and pay_time >= ${time}" + - " GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " + - " ORDER BY add_time ASC") - List chartListT(@Param("time")int time); -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderStatusMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderStatusMapper.java deleted file mode 100644 index 31f232cf..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreOrderStatusMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreOrderStatus; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreOrderStatusMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrMapper.java deleted file mode 100644 index f3193877..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreProductAttr; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreProductAttrMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrResultMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrResultMapper.java deleted file mode 100644 index b3c08b62..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrResultMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreProductAttrResult; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreProductAttrResultMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrValueMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrValueMapper.java deleted file mode 100644 index 48b2b4bf..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductAttrValueMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreProductAttrValue; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreProductAttrValueMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductMapper.java deleted file mode 100644 index 71a1e7ef..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreProduct; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.annotations.Update; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreProductMapper extends CoreMapper { - - @Update("update yx_store_product set is_show = #{i} where id = #{id}") - void updateDel(@Param("i")int i,@Param("id") Integer id); - @Update("update yx_store_product set is_del = #{i} where id = #{id}") - void updateOnsale(@Param("i")int i, @Param("id")Integer id); -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductReplyMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductReplyMapper.java deleted file mode 100644 index 67d1dd61..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/StoreProductReplyMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxStoreProductReply; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface StoreProductReplyMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemConfigMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemConfigMapper.java deleted file mode 100644 index e2908f1a..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemConfigMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxSystemConfig; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface SystemConfigMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemGroupDataMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemGroupDataMapper.java deleted file mode 100644 index 7f4cbfc2..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemGroupDataMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxSystemGroupData; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface SystemGroupDataMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemStoreMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemStoreMapper.java deleted file mode 100644 index f40cbdb9..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemStoreMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxSystemStore; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface SystemStoreMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemStoreStaffMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemStoreStaffMapper.java deleted file mode 100644 index b0850d5a..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemStoreStaffMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxSystemStoreStaff; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface SystemStoreStaffMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemUserLevelMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemUserLevelMapper.java deleted file mode 100644 index 4ac62591..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemUserLevelMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxSystemUserLevel; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface SystemUserLevelMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemUserTaskMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemUserTaskMapper.java deleted file mode 100644 index 683d8f14..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/SystemUserTaskMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxSystemUserTask; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface SystemUserTaskMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserBillMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserBillMapper.java deleted file mode 100644 index ee8bbb14..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserBillMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxUserBill; -import co.yixiang.modules.shop.service.dto.YxUserBillDto; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.ResultType; -import org.apache.ibatis.annotations.Select; -import org.springframework.security.core.parameters.P; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface UserBillMapper extends CoreMapper { - - @Select(" ") - List findAllByQueryCriteria(@Param("category") String category, @Param("type") String type, @Param("nickname") String nickname); -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserMapper.java deleted file mode 100644 index d6cf6552..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxUser; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Update; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface UserMapper extends CoreMapper { - - @Update( "update yx_user set status = #{status} where uid = #{id}") - void updateOnstatus(@Param("status") int status, @Param("id") int id); - - @Update( "update yx_user set now_money = now_money + ${money} where uid = #{id}") - void updateMoney(@Param("money") double money, @Param("id")int id); - - @Update("update yx_user set brokerage_price = brokerage_price+ ${price} where uid = #{id}") - void incBrokeragePrice(@Param("price")double price,@Param("id") int id); - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserRechargeMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserRechargeMapper.java deleted file mode 100644 index 3b6399f4..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/UserRechargeMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxUserRecharge; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface UserRechargeMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/WechatUserMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/WechatUserMapper.java deleted file mode 100644 index 73866007..00000000 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/WechatUserMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.shop.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.shop.domain.YxWechatUser; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-12 -*/ -@Repository -@Mapper -public interface WechatUserMapper extends CoreMapper { - -} diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxExpressMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxExpressMapper.java new file mode 100644 index 00000000..13bb1c8b --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxExpressMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxExpress; +import co.yixiang.modules.shop.service.dto.YxExpressDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-12-12 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxExpressMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialGroupMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialGroupMapper.java new file mode 100644 index 00000000..7c193c62 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialGroupMapper.java @@ -0,0 +1,17 @@ +package co.yixiang.modules.shop.service.mapper; + + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.shop.domain.YxMaterialGroup; +import co.yixiang.modules.shop.service.dto.YxMaterialGroupDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2020-01-09 +*/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxMaterialGroupMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialMapper.java new file mode 100644 index 00000000..f91d1e88 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxMaterialMapper.java @@ -0,0 +1,17 @@ +package co.yixiang.modules.shop.service.mapper; + + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.shop.domain.YxMaterial; +import co.yixiang.modules.shop.service.dto.YxMaterialDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2020-01-09 +*/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxMaterialMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreCategoryMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreCategoryMapper.java new file mode 100644 index 00000000..16598d5e --- /dev/null +++ b/yshop-shop/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.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxStoreCategory; +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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderMapper.java new file mode 100644 index 00000000..a81b6bd8 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderStatusMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreOrderStatusMapper.java new file mode 100644 index 00000000..17ffa234 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductMapper.java new file mode 100644 index 00000000..35a2709e --- /dev/null +++ b/yshop-shop/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.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxStoreProduct; +import co.yixiang.modules.shop.service.dto.YxStoreProductDTO; +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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductReplyMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxStoreProductReplyMapper.java new file mode 100644 index 00000000..dd07d295 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemConfigMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemConfigMapper.java new file mode 100644 index 00000000..4ccd302f --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemConfigMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxSystemConfig; +import co.yixiang.modules.shop.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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemGroupDataMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemGroupDataMapper.java new file mode 100644 index 00000000..ba1a8112 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemStoreMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemStoreMapper.java new file mode 100644 index 00000000..b8d2d837 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemStoreMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.shop.domain.YxSystemStore; +import co.yixiang.modules.shop.service.dto.YxSystemStoreDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2020-03-03 +*/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxSystemStoreMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemStoreStaffMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemStoreStaffMapper.java new file mode 100644 index 00000000..205d5249 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemStoreStaffMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.shop.domain.YxSystemStoreStaff; +import co.yixiang.modules.shop.service.dto.YxSystemStoreStaffDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2020-03-22 +*/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxSystemStoreStaffMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemUserLevelMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemUserLevelMapper.java new file mode 100644 index 00000000..11432b16 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemUserLevelMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxSystemUserLevel; +import co.yixiang.modules.shop.service.dto.YxSystemUserLevelDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-12-04 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxSystemUserLevelMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemUserTaskMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemUserTaskMapper.java new file mode 100644 index 00000000..74d4ec32 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxSystemUserTaskMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxSystemUserTask; +import co.yixiang.modules.shop.service.dto.YxSystemUserTaskDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-12-04 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxSystemUserTaskMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserBillMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserBillMapper.java new file mode 100644 index 00000000..8eedb2b5 --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserMapper.java new file mode 100644 index 00000000..474a605b --- /dev/null +++ b/yshop-shop/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-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserRechargeMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserRechargeMapper.java new file mode 100644 index 00000000..6ab8ae4f --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxUserRechargeMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.shop.domain.YxUserRecharge; +import co.yixiang.modules.shop.service.dto.YxUserRechargeDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2020-03-02 +*/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxUserRechargeMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxWechatUserMapper.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxWechatUserMapper.java new file mode 100644 index 00000000..d294c4a7 --- /dev/null +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/mapper/YxWechatUserMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.shop.service.mapper; + +import co.yixiang.mapper.EntityMapper; +import co.yixiang.modules.shop.domain.YxWechatUser; +import co.yixiang.modules.shop.service.dto.YxWechatUserDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author hupeng +* @date 2019-12-13 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface YxWechatUserMapper extends EntityMapper { + +} \ No newline at end of file diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/param/ExpressParam.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/param/ExpressParam.java index a1db4620..9aceb031 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/service/param/ExpressParam.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/service/param/ExpressParam.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.shop.service.param; import lombok.Data; @@ -19,7 +11,7 @@ import java.io.Serializable; **/ @Data public class ExpressParam implements Serializable { - ////@NotBlank() + //@NotBlank() private String orderCode; private String shipperCode; private String logisticCode; diff --git a/yshop-system/pom.xml b/yshop-system/pom.xml index 9aacbc86..f28dc126 100644 --- a/yshop-system/pom.xml +++ b/yshop-system/pom.xml @@ -5,7 +5,7 @@ yshop co.yixiang - 2.2 + 2.1 4.0.0 @@ -21,7 +21,7 @@ co.yixiang yshop-generator - 2.2 + 2.1 co.yixiang @@ -29,20 +29,18 @@ + + co.yixiang yshop-shop - 2.2 - - - co.yixiang - yshop-mproot - 2.2 + 2.1 + co.yixiang yshop-mp - 2.2 + 2.1 co.yixiang diff --git a/yshop-system/src/main/java/co/yixiang/AppRun.java b/yshop-system/src/main/java/co/yixiang/AppRun.java index 62d42248..5330a719 100644 --- a/yshop-system/src/main/java/co/yixiang/AppRun.java +++ b/yshop-system/src/main/java/co/yixiang/AppRun.java @@ -1,16 +1,7 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang; -import co.yixiang.modules.activity.service.YxStoreCouponUserService; + import co.yixiang.annotation.AnonymousAccess; 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.boot.web.embedded.tomcat.TomcatServletWebServerFactory; @@ -22,14 +13,13 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** - * @author hupeng + * @author Zheng Jie * @date 2018/11/15 9:20:19 */ @EnableAsync @RestController @SpringBootApplication @EnableTransactionManagement -@MapperScan(basePackages = "co.yixiang.*.mapper") public class AppRun { public static void main(String[] args) { diff --git a/yshop-system/src/main/java/co/yixiang/config/ConfigurerAdapter.java b/yshop-system/src/main/java/co/yixiang/config/ConfigurerAdapter.java index cf83b3d6..456a903d 100644 --- a/yshop-system/src/main/java/co/yixiang/config/ConfigurerAdapter.java +++ b/yshop-system/src/main/java/co/yixiang/config/ConfigurerAdapter.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config; import org.springframework.beans.factory.annotation.Value; @@ -21,7 +13,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * WebMvcConfigurer * - * @author hupeng + * @author Zheng Jie * @date 2018-11-30 */ @Configuration diff --git a/yshop-system/src/main/java/co/yixiang/config/DataScope.java b/yshop-system/src/main/java/co/yixiang/config/DataScope.java index c2f06939..3eb65d8e 100644 --- a/yshop-system/src/main/java/co/yixiang/config/DataScope.java +++ b/yshop-system/src/main/java/co/yixiang/config/DataScope.java @@ -1,16 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config; 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.RoleSmallDTO; +import co.yixiang.modules.system.service.dto.UserDTO; import co.yixiang.utils.SecurityUtils; import co.yixiang.modules.system.domain.Dept; import co.yixiang.modules.system.service.DeptService; @@ -23,7 +15,7 @@ import java.util.Set; /** * 数据权限配置 - * @author hupeng + * @author Zheng Jie * @date 2019-4-1 */ @Component @@ -45,15 +37,15 @@ public class DataScope { public Set getDeptIds() { - UserDto user = userService.findByName(SecurityUtils.getUsername()); + UserDTO user = userService.findByName(SecurityUtils.getUsername()); // 用于存储部门id Set deptIds = new HashSet<>(); // 查询用户角色 - List roleSet = roleService.findByUsersId(user.getId()); + List roleSet = roleService.findByUsersId(user.getId()); - for (RoleSmallDto role : roleSet) { + for (RoleSmallDTO role : roleSet) { if (scopeType[0].equals(role.getDataScope())) { return new HashSet<>() ; diff --git a/yshop-system/src/main/java/co/yixiang/config/WebSocketConfig.java b/yshop-system/src/main/java/co/yixiang/config/WebSocketConfig.java index fcfb7198..321171f9 100644 --- a/yshop-system/src/main/java/co/yixiang/config/WebSocketConfig.java +++ b/yshop-system/src/main/java/co/yixiang/config/WebSocketConfig.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config; import org.springframework.context.annotation.Bean; diff --git a/yshop-system/src/main/java/co/yixiang/config/thread/AsyncTaskExecutePool.java b/yshop-system/src/main/java/co/yixiang/config/thread/AsyncTaskExecutePool.java index cc89da3b..291447b8 100644 --- a/yshop-system/src/main/java/co/yixiang/config/thread/AsyncTaskExecutePool.java +++ b/yshop-system/src/main/java/co/yixiang/config/thread/AsyncTaskExecutePool.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config.thread; import lombok.extern.slf4j.Slf4j; diff --git a/yshop-system/src/main/java/co/yixiang/config/thread/AsyncTaskProperties.java b/yshop-system/src/main/java/co/yixiang/config/thread/AsyncTaskProperties.java index 06a3a468..1f3a29f6 100644 --- a/yshop-system/src/main/java/co/yixiang/config/thread/AsyncTaskProperties.java +++ b/yshop-system/src/main/java/co/yixiang/config/thread/AsyncTaskProperties.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config.thread; import lombok.Data; diff --git a/yshop-system/src/main/java/co/yixiang/config/thread/TheadFactoryName.java b/yshop-system/src/main/java/co/yixiang/config/thread/TheadFactoryName.java index 6ac91b22..69d26da3 100644 --- a/yshop-system/src/main/java/co/yixiang/config/thread/TheadFactoryName.java +++ b/yshop-system/src/main/java/co/yixiang/config/thread/TheadFactoryName.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config.thread; import org.springframework.stereotype.Component; @@ -15,7 +7,7 @@ import java.util.concurrent.atomic.AtomicInteger; /** * 自定义线程名称 - * @author hupeng + * @author Zheng Jie * @date 2019年10月31日17:49:55 */ @Component diff --git a/yshop-system/src/main/java/co/yixiang/config/thread/ThreadPoolExecutorUtil.java b/yshop-system/src/main/java/co/yixiang/config/thread/ThreadPoolExecutorUtil.java index d9e1c14c..13fe761c 100644 --- a/yshop-system/src/main/java/co/yixiang/config/thread/ThreadPoolExecutorUtil.java +++ b/yshop-system/src/main/java/co/yixiang/config/thread/ThreadPoolExecutorUtil.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.config.thread; import co.yixiang.utils.SpringContextHolder; @@ -16,7 +8,7 @@ import java.util.concurrent.TimeUnit; /** * 用于获取自定义线程池 - * @author hupeng + * @author Zheng Jie * @date 2019年10月31日18:16:47 */ public class ThreadPoolExecutorUtil { diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/App.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/App.java new file mode 100644 index 00000000..887e0216 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/App.java @@ -0,0 +1,76 @@ +package co.yixiang.modules.mnt.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Timestamp; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Entity +@Data +@Table(name="mnt_app") +public class App implements Serializable { + + /** + * 应用编号 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + /** + * 应用名称 + */ + @Column(name = "name") + private String name; + + /** + * 端口 + */ + @Column(name = "port") + private int port; + + /** + * 上传目录 + */ + @Column(name = "upload_path") + private String uploadPath; + + /** + * 部署目录 + */ + @Column(name = "deploy_path") + private String deployPath; + + /** + * 备份目录 + */ + @Column(name = "backup_path") + private String backupPath; + + /** + * 启动脚本 + */ + @Column(name = "start_script") + private String startScript; + + /** + * 部署脚本 + */ + @Column(name = "deploy_script") + private String deployScript; + + @CreationTimestamp + private Timestamp createTime; + + public void copy(App source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/Database.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/Database.java new file mode 100644 index 00000000..40fb7566 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/Database.java @@ -0,0 +1,58 @@ +package co.yixiang.modules.mnt.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Timestamp; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Entity +@Data +@Table(name="mnt_database") +public class Database implements Serializable { + + /** + * id + */ + @Id + @Column(name = "id") + private String id; + + /** + * 数据库名称 + */ + @Column(name = "name",nullable = false) + private String name; + + /** + * 数据库连接地址 + */ + @Column(name = "jdbc_url",nullable = false) + private String jdbcUrl; + + /** + * 数据库密码 + */ + @Column(name = "pwd",nullable = false) + private String pwd; + + /** + * 用户名 + */ + @Column(name = "user_name",nullable = false) + private String userName; + + @CreationTimestamp + private Timestamp createTime; + + public void copy(Database source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/Deploy.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/Deploy.java new file mode 100644 index 00000000..c1dda681 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/Deploy.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.mnt.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Entity +@Data +@Table(name="mnt_deploy") +public class Deploy implements Serializable { + + /** + * 部署编号 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + /** + * 应用编号 + */ + @ManyToOne + @JoinColumn(name = "app_id") + private App app; + + /** + * 服务器 + */ + @ManyToMany + @JoinTable(name = "mnt_deploy_server", joinColumns = {@JoinColumn(name = "deploy_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "server_id",referencedColumnName = "id")}) + private Set deploys; + + @CreationTimestamp + private Timestamp createTime; + + public void copy(Deploy source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/DeployHistory.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/DeployHistory.java new file mode 100644 index 00000000..da7cdc0c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/DeployHistory.java @@ -0,0 +1,62 @@ +package co.yixiang.modules.mnt.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Timestamp; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Entity +@Data +@Table(name="mnt_deploy_history") +public class DeployHistory implements Serializable { + + /** + * 编号 + */ + @Id + @Column(name = "id") + private String id; + + /** + * 应用名称 + */ + @Column(name = "app_name",nullable = false) + private String appName; + + /** + * 部署IP + */ + @Column(name = "ip",nullable = false) + private String ip; + + /** + * 部署时间 + */ + @Column(name = "deploy_date") + @CreationTimestamp + private Timestamp deployDate; + + /** + * 部署人员 + */ + @Column(name = "deploy_user",nullable = false) + private String deployUser; + + /** + * 部署编号 + */ + @Column(name = "deploy_id",nullable = false) + private Long deployId; + + public void copy(DeployHistory source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/ServerDeploy.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/ServerDeploy.java new file mode 100644 index 00000000..6c3e46d4 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/domain/ServerDeploy.java @@ -0,0 +1,41 @@ +package co.yixiang.modules.mnt.domain; + +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Timestamp; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Entity +@Data +@Table(name="mnt_server") +public class ServerDeploy implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String name; + + private String ip; + + private Integer port; + + private String account; + + private String password; + + @CreationTimestamp + private Timestamp createTime; + + public void copy(ServerDeploy source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/AppRepository.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/AppRepository.java new file mode 100644 index 00000000..1de47046 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/AppRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.mnt.repository; + +import co.yixiang.modules.mnt.domain.App; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +public interface AppRepository extends JpaRepository, JpaSpecificationExecutor { +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DatabaseRepository.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DatabaseRepository.java new file mode 100644 index 00000000..28be2b2c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DatabaseRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.mnt.repository; + +import co.yixiang.modules.mnt.domain.Database; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +public interface DatabaseRepository extends JpaRepository, JpaSpecificationExecutor { +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DeployHistoryRepository.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DeployHistoryRepository.java new file mode 100644 index 00000000..bdffa1c8 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DeployHistoryRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.mnt.repository; + +import co.yixiang.modules.mnt.domain.DeployHistory; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +public interface DeployHistoryRepository extends JpaRepository, JpaSpecificationExecutor { +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DeployRepository.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DeployRepository.java new file mode 100644 index 00000000..694bf884 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/DeployRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.mnt.repository; + +import co.yixiang.modules.mnt.domain.Deploy; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +public interface DeployRepository extends JpaRepository, JpaSpecificationExecutor { +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/ServerDeployRepository.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/ServerDeployRepository.java new file mode 100644 index 00000000..44eb846e --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/repository/ServerDeployRepository.java @@ -0,0 +1,19 @@ +package co.yixiang.modules.mnt.repository; + +import co.yixiang.modules.mnt.domain.ServerDeploy; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +public interface ServerDeployRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * 根据IP查询 + * @param ip / + * @return / + */ + ServerDeploy findByIp(String ip); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/AppController.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/AppController.java new file mode 100644 index 00000000..ebcc40f9 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/AppController.java @@ -0,0 +1,75 @@ +package co.yixiang.modules.mnt.rest; + +import co.yixiang.aop.log.Log; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import co.yixiang.modules.mnt.domain.App; +import co.yixiang.modules.mnt.service.AppService; +import co.yixiang.modules.mnt.service.dto.AppQueryCriteria; +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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Api(tags = "应用管理") +@RestController +@RequestMapping("/api/app") +public class AppController { + + private final AppService appService; + + public AppController(AppService appService){ + this.appService = appService; + } + + @Log("导出应用数据") + @ApiOperation("导出应用数据") + @GetMapping(value = "/download") + @PreAuthorize("@el.check('admin','app:list')") + public void download(HttpServletResponse response, AppQueryCriteria criteria) throws IOException { + appService.download(appService.queryAll(criteria), response); + } + + @Log("查询应用") + @ApiOperation(value = "查询应用") + @GetMapping + @PreAuthorize("@el.check('admin','app:list')") + public ResponseEntity getApps(AppQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity<>(appService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("新增应用") + @ApiOperation(value = "新增应用") + @PostMapping + @PreAuthorize("@el.check('admin','app:add')") + public ResponseEntity create(@Validated @RequestBody App resources){ + return new ResponseEntity<>(appService.create(resources),HttpStatus.CREATED); + } + + @Log("修改应用") + @ApiOperation(value = "修改应用") + @PutMapping + @PreAuthorize("@el.check('admin','app:edit')") + public ResponseEntity update(@Validated @RequestBody App resources){ + appService.update(resources); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除应用") + @ApiOperation(value = "删除应用") + @DeleteMapping + @PreAuthorize("@el.check('admin','app:del')") + public ResponseEntity delete(@RequestBody Set ids){ + appService.delete(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DatabaseController.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DatabaseController.java new file mode 100644 index 00000000..dc6c21f7 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DatabaseController.java @@ -0,0 +1,112 @@ +package co.yixiang.modules.mnt.rest; + +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; +import co.yixiang.utils.FileUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import co.yixiang.modules.mnt.domain.Database; +import co.yixiang.modules.mnt.service.DatabaseService; +import co.yixiang.modules.mnt.service.dto.DatabaseDto; +import co.yixiang.modules.mnt.service.dto.DatabaseQueryCriteria; +import co.yixiang.modules.mnt.util.SqlUtils; +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 org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Api(tags = "数据库管理") +@RestController +@RequestMapping("/api/database") +public class DatabaseController { + + private String fileSavePath = System.getProperty("java.io.tmpdir"); + + private final DatabaseService databaseService; + + public DatabaseController(DatabaseService databaseService) { + this.databaseService = databaseService; + } + + @Log("导出数据库数据") + @ApiOperation("导出数据库数据") + @GetMapping(value = "/download") + @PreAuthorize("@el.check('admin','database:list')") + public void download(HttpServletResponse response, DatabaseQueryCriteria criteria) throws IOException { + databaseService.download(databaseService.queryAll(criteria), response); + } + + @Log("查询数据库") + @ApiOperation(value = "查询数据库") + @GetMapping + @PreAuthorize("@el.check('admin','database:list')") + public ResponseEntity getDatabases(DatabaseQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity<>(databaseService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("新增数据库") + @ApiOperation(value = "新增数据库") + @PostMapping + @PreAuthorize("@el.check('admin','database:add')") + public ResponseEntity create(@Validated @RequestBody Database resources){ + return new ResponseEntity<>(databaseService.create(resources),HttpStatus.CREATED); + } + + @Log("修改数据库") + @ApiOperation(value = "修改数据库") + @PutMapping + @PreAuthorize("@el.check('admin','database:edit')") + public ResponseEntity update(@Validated @RequestBody Database resources){ + databaseService.update(resources); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除数据库") + @ApiOperation(value = "删除数据库") + @DeleteMapping + @PreAuthorize("@el.check('admin','database:del')") + public ResponseEntity delete(@RequestBody Set ids){ + databaseService.delete(ids); + return new ResponseEntity<>(HttpStatus.OK); + } + + @Log("测试数据库链接") + @ApiOperation(value = "测试数据库链接") + @PostMapping("/testConnect") + @PreAuthorize("@el.check('admin','database:testConnect')") + public ResponseEntity testConnect(@Validated @RequestBody Database resources){ + return new ResponseEntity<>(databaseService.testConnection(resources),HttpStatus.CREATED); + } + + @Log("执行SQL脚本") + @ApiOperation(value = "执行SQL脚本") + @PostMapping(value = "/upload") + @PreAuthorize("@el.check('admin','database:add')") + public ResponseEntity upload(@RequestBody MultipartFile file, HttpServletRequest request)throws Exception{ + String id = request.getParameter("id"); + DatabaseDto database = databaseService.findById(id); + String fileName; + if(database != null){ + fileName = file.getOriginalFilename(); + File executeFile = new File(fileSavePath+fileName); + FileUtil.del(executeFile); + file.transferTo(executeFile); + String result = SqlUtils.executeFile(database.getJdbcUrl(), database.getUserName(), database.getPwd(), executeFile); + return new ResponseEntity<>(result,HttpStatus.OK); + }else{ + throw new BadRequestException("Database not exist"); + } + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DeployController.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DeployController.java new file mode 100644 index 00000000..5ca8cc66 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DeployController.java @@ -0,0 +1,141 @@ +package co.yixiang.modules.mnt.rest; + +import co.yixiang.aop.log.Log; +import co.yixiang.utils.FileUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import co.yixiang.modules.mnt.domain.Deploy; +import co.yixiang.modules.mnt.domain.DeployHistory; +import co.yixiang.modules.mnt.service.DeployService; +import co.yixiang.modules.mnt.service.dto.DeployQueryCriteria; +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 org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Api(tags = "部署管理") +@RestController +@RequestMapping("/api/deploy") +public class DeployController { + + private String fileSavePath = System.getProperty("java.io.tmpdir"); + + private final DeployService deployService; + + public DeployController(DeployService deployService) { + this.deployService = deployService; + } + + @Log("导出部署数据") + @ApiOperation("导出部署数据") + @GetMapping(value = "/download") + @PreAuthorize("@el.check('admin','database:list')") + public void download(HttpServletResponse response, DeployQueryCriteria criteria) throws IOException { + deployService.download(deployService.queryAll(criteria), response); + } + + @Log("查询部署") + @ApiOperation(value = "查询部署") + @GetMapping + @PreAuthorize("@el.check('admin','deploy:list')") + public ResponseEntity getDeploys(DeployQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity<>(deployService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("新增部署") + @ApiOperation(value = "新增部署") + @PostMapping + @PreAuthorize("@el.check('admin','deploy:add')") + public ResponseEntity create(@Validated @RequestBody Deploy resources){ + return new ResponseEntity<>(deployService.create(resources),HttpStatus.CREATED); + } + + @Log("修改部署") + @ApiOperation(value = "修改部署") + @PutMapping + @PreAuthorize("@el.check('admin','deploy:edit')") + public ResponseEntity update(@Validated @RequestBody Deploy resources){ + deployService.update(resources); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除部署") + @ApiOperation(value = "删除部署") + @DeleteMapping + @PreAuthorize("@el.check('admin','deploy:del')") + public ResponseEntity delete(@RequestBody Set ids){ + deployService.delete(ids); + return new ResponseEntity<>(HttpStatus.OK); + } + + @Log("上传文件部署") + @ApiOperation(value = "上传文件部署") + @PostMapping(value = "/upload") + @PreAuthorize("@el.check('admin','deploy:edit')") + public ResponseEntity upload(@RequestBody MultipartFile file, HttpServletRequest request)throws Exception{ + Long id = Long.valueOf(request.getParameter("id")); + String fileName = ""; + if(file != null){ + fileName = file.getOriginalFilename(); + File deployFile = new File(fileSavePath+fileName); + FileUtil.del(deployFile); + file.transferTo(deployFile); + //文件下一步要根据文件名字来 + deployService.deploy(fileSavePath+fileName ,id); + }else{ + System.out.println("没有找到相对应的文件"); + } + System.out.println("文件上传的原名称为:"+ Objects.requireNonNull(file).getOriginalFilename()); + Map map = new HashMap<>(2); + map.put("errno",0); + map.put("id",fileName); + return new ResponseEntity<>(map,HttpStatus.OK); + } + @Log("系统还原") + @ApiOperation(value = "系统还原") + @PostMapping(value = "/serverReduction") + @PreAuthorize("@el.check('admin','deploy:edit')") + public ResponseEntity serverReduction(@Validated @RequestBody DeployHistory resources){ + String result = deployService.serverReduction(resources); + return new ResponseEntity<>(result,HttpStatus.OK); + } + @Log("服务运行状态") + @ApiOperation(value = "服务运行状态") + @PostMapping(value = "/serverStatus") + @PreAuthorize("@el.check('admin','deploy:edit')") + public ResponseEntity serverStatus(@Validated @RequestBody Deploy resources){ + String result = deployService.serverStatus(resources); + return new ResponseEntity<>(result,HttpStatus.OK); + } + @Log("启动服务") + @ApiOperation(value = "启动服务") + @PostMapping(value = "/startServer") + @PreAuthorize("@el.check('admin','deploy:edit')") + public ResponseEntity startServer(@Validated @RequestBody Deploy resources){ + String result = deployService.startServer(resources); + return new ResponseEntity<>(result,HttpStatus.OK); + } + @Log("停止服务") + @ApiOperation(value = "停止服务") + @PostMapping(value = "/stopServer") + @PreAuthorize("@el.check('admin','deploy:edit')") + public ResponseEntity stopServer(@Validated @RequestBody Deploy resources){ + String result = deployService.stopServer(resources); + return new ResponseEntity<>(result,HttpStatus.OK); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DeployHistoryController.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DeployHistoryController.java new file mode 100644 index 00000000..55562159 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/DeployHistoryController.java @@ -0,0 +1,56 @@ +package co.yixiang.modules.mnt.rest; + +import co.yixiang.aop.log.Log; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import co.yixiang.modules.mnt.service.DeployHistoryService; +import co.yixiang.modules.mnt.service.dto.DeployHistoryQueryCriteria; +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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Api(tags = "部署历史管理") +@RestController +@RequestMapping("/api/deployHistory") +public class DeployHistoryController { + + private final DeployHistoryService deployhistoryService; + + public DeployHistoryController(DeployHistoryService deployhistoryService) { + this.deployhistoryService = deployhistoryService; + } + + @Log("导出部署历史数据") + @ApiOperation("导出部署历史数据") + @GetMapping(value = "/download") + @PreAuthorize("@el.check('admin','deployHistory:list')") + public void download(HttpServletResponse response, DeployHistoryQueryCriteria criteria) throws IOException { + deployhistoryService.download(deployhistoryService.queryAll(criteria), response); + } + + @Log("查询部署历史") + @ApiOperation(value = "查询部署历史") + @GetMapping + @PreAuthorize("@el.check('admin','deployHistory:list')") + public ResponseEntity getDeployHistorys(DeployHistoryQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity<>(deployhistoryService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("删除DeployHistory") + @ApiOperation(value = "删除部署历史") + @DeleteMapping + @PreAuthorize("@el.check('admin','deployHistory:del')") + public ResponseEntity delete(@RequestBody Set ids){ + deployhistoryService.delete(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/ServerDeployController.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/ServerDeployController.java new file mode 100644 index 00000000..95160253 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/rest/ServerDeployController.java @@ -0,0 +1,83 @@ +package co.yixiang.modules.mnt.rest; + +import co.yixiang.aop.log.Log; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import co.yixiang.modules.mnt.domain.ServerDeploy; +import co.yixiang.modules.mnt.service.ServerDeployService; +import co.yixiang.modules.mnt.service.dto.ServerDeployQueryCriteria; +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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Api(tags = "服务器管理") +@RestController +@RequestMapping("/api/serverDeploy") +public class ServerDeployController { + + private final ServerDeployService serverDeployService; + + public ServerDeployController(ServerDeployService serverDeployService) { + this.serverDeployService = serverDeployService; + } + + @Log("导出服务器数据") + @ApiOperation("导出服务器数据") + @GetMapping(value = "/download") + @PreAuthorize("@el.check('admin','serverDeploy:list')") + public void download(HttpServletResponse response, ServerDeployQueryCriteria criteria) throws IOException { + serverDeployService.download(serverDeployService.queryAll(criteria), response); + } + + @Log("查询服务器") + @ApiOperation(value = "查询服务器") + @GetMapping + @PreAuthorize("@el.check('admin','serverDeploy:list')") + public ResponseEntity getServers(ServerDeployQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity<>(serverDeployService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @Log("新增服务器") + @ApiOperation(value = "新增服务器") + @PostMapping + @PreAuthorize("@el.check('admin','serverDeploy:add')") + public ResponseEntity create(@Validated @RequestBody ServerDeploy resources){ + return new ResponseEntity<>(serverDeployService.create(resources),HttpStatus.CREATED); + } + + @Log("修改服务器") + @ApiOperation(value = "修改服务器") + @PutMapping + @PreAuthorize("@el.check('admin','serverDeploy:edit')") + public ResponseEntity update(@Validated @RequestBody ServerDeploy resources){ + serverDeployService.update(resources); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除服务器") + @ApiOperation(value = "删除Server") + @DeleteMapping + @PreAuthorize("@el.check('admin','serverDeploy:del')") + public ResponseEntity delete(@RequestBody Set ids){ + serverDeployService.delete(ids); + return new ResponseEntity<>(HttpStatus.OK); + } + + @Log("测试连接服务器") + @ApiOperation(value = "测试连接服务器") + @PostMapping("/testConnect") + @PreAuthorize("@el.check('admin','serverDeploy:add')") + public ResponseEntity testConnect(@Validated @RequestBody ServerDeploy resources){ + return new ResponseEntity<>(serverDeployService.testConnect(resources),HttpStatus.CREATED); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/AppService.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/AppService.java new file mode 100644 index 00000000..adf4089d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/AppService.java @@ -0,0 +1,67 @@ +package co.yixiang.modules.mnt.service; + +import co.yixiang.modules.mnt.domain.App; +import co.yixiang.modules.mnt.service.dto.AppDto; +import co.yixiang.modules.mnt.service.dto.AppQueryCriteria; +import org.springframework.data.domain.Pageable; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +public interface AppService { + + /** + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ + Object queryAll(AppQueryCriteria criteria, Pageable pageable); + + /** + * 查询全部数据 + * @param criteria 条件 + * @return / + */ + List queryAll(AppQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id / + * @return / + */ + AppDto findById(Long id); + + /** + * 创建 + * @param resources / + * @return / + */ + AppDto create(App resources); + + /** + * 编辑 + * @param resources / + */ + void update(App resources); + + /** + * 删除 + * @param ids / + */ + void delete(Set ids); + + /** + * 导出数据 + * @param queryAll / + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DatabaseService.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DatabaseService.java new file mode 100644 index 00000000..366b6bd9 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DatabaseService.java @@ -0,0 +1,74 @@ +package co.yixiang.modules.mnt.service; + +import co.yixiang.modules.mnt.domain.Database; +import co.yixiang.modules.mnt.service.dto.DatabaseDto; +import co.yixiang.modules.mnt.service.dto.DatabaseQueryCriteria; +import org.springframework.data.domain.Pageable; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +/** + * @author ZhangHouYing + * @date 2019-08-24 + */ +public interface DatabaseService { + + /** + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ + Object queryAll(DatabaseQueryCriteria criteria, Pageable pageable); + + /** + * 查询全部 + * @param criteria 条件 + * @return / + */ + List queryAll(DatabaseQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id / + * @return / + */ + DatabaseDto findById(String id); + + /** + * 创建 + * @param resources / + * @return / + */ + DatabaseDto create(Database resources); + + /** + * 编辑 + * @param resources / + */ + void update(Database resources); + + /** + * 删除 + * @param ids / + */ + void delete(Set ids); + + /** + * 测试连接数据库 + * @param resources / + * @return / + */ + boolean testConnection(Database resources); + + /** + * 导出数据 + * @param queryAll / + * @param response / + * @throws IOException e + */ + void download(List queryAll, HttpServletResponse response) throws IOException; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DeployHistoryService.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DeployHistoryService.java new file mode 100644 index 00000000..e3fa09f4 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DeployHistoryService.java @@ -0,0 +1,60 @@ +package co.yixiang.modules.mnt.service; + +import co.yixiang.modules.mnt.domain.DeployHistory; +import co.yixiang.modules.mnt.service.dto.DeployHistoryDto; +import co.yixiang.modules.mnt.service.dto.DeployHistoryQueryCriteria; +import org.springframework.data.domain.Pageable; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +/** + * @author zhanghouying + */ +public interface DeployHistoryService { + + /** + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ + Object queryAll(DeployHistoryQueryCriteria criteria, Pageable pageable); + + /** + * 查询全部 + * @param criteria 条件 + * @return / + */ + List queryAll(DeployHistoryQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id / + * @return / + */ + DeployHistoryDto findById(String id); + + /** + * 创建 + * @param resources / + * @return / + */ + DeployHistoryDto create(DeployHistory resources); + + /** + * 删除 + * @param ids / + */ + void delete(Set ids); + + /** + * 导出数据 + * @param queryAll / + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DeployService.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DeployService.java new file mode 100644 index 00000000..df34d0d6 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/DeployService.java @@ -0,0 +1,102 @@ +package co.yixiang.modules.mnt.service; + +import co.yixiang.modules.mnt.domain.Deploy; +import co.yixiang.modules.mnt.domain.DeployHistory; +import co.yixiang.modules.mnt.service.dto.DeployDto; +import co.yixiang.modules.mnt.service.dto.DeployQueryCriteria; +import org.springframework.data.domain.Pageable; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +public interface DeployService { + + /** + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ + Object queryAll(DeployQueryCriteria criteria, Pageable pageable); + + /** + * 查询全部数据 + * @param criteria 条件 + * @return / + */ + List queryAll(DeployQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id / + * @return / + */ + DeployDto findById(Long id); + + /** + * 创建 + * @param resources / + * @return / + */ + DeployDto create(Deploy resources); + + + /** + * 编辑 + * @param resources / + */ + void update(Deploy resources); + + /** + * 删除 + * @param ids / + */ + void delete(Set ids); + + /** + * 部署文件到服务器 + * @param fileSavePath 文件路径 + * @param appId 应用ID + */ + void deploy(String fileSavePath, Long appId); + + /** + * 查询部署状态 + * @param resources / + * @return / + */ + String serverStatus(Deploy resources); + /** + * 启动服务 + * @param resources / + * @return / + */ + String startServer(Deploy resources); + /** + * 停止服务 + * @param resources / + * @return / + */ + String stopServer(Deploy resources); + + /** + * 停止服务 + * @param resources / + * @return / + */ + String serverReduction(DeployHistory resources); + + /** + * 导出数据 + * @param queryAll / + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/ServerDeployService.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/ServerDeployService.java new file mode 100644 index 00000000..4d336bae --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/ServerDeployService.java @@ -0,0 +1,81 @@ +package co.yixiang.modules.mnt.service; + +import co.yixiang.modules.mnt.domain.ServerDeploy; +import co.yixiang.modules.mnt.service.dto.ServerDeployDto; +import co.yixiang.modules.mnt.service.dto.ServerDeployQueryCriteria; +import org.springframework.data.domain.Pageable; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +public interface ServerDeployService { + + /** + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ + Object queryAll(ServerDeployQueryCriteria criteria, Pageable pageable); + + /** + * 查询全部数据 + * @param criteria 条件 + * @return / + */ + List queryAll(ServerDeployQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id / + * @return / + */ + ServerDeployDto findById(Long id); + + /** + * 创建 + * @param resources / + * @return / + */ + ServerDeployDto create(ServerDeploy resources); + + /** + * 编辑 + * @param resources / + */ + void update(ServerDeploy resources); + + /** + * 删除 + * @param ids / + */ + void delete(Set ids); + + /** + * 根据IP查询 + * @param ip / + * @return / + */ + ServerDeployDto findByIp(String ip); + + /** + * 测试登录服务器 + * @param resources / + * @return / + */ + Boolean testConnect(ServerDeploy resources); + + /** + * 导出数据 + * @param queryAll / + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/AppDto.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/AppDto.java new file mode 100644 index 00000000..109e3403 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/AppDto.java @@ -0,0 +1,58 @@ +package co.yixiang.modules.mnt.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.sql.Timestamp; + + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class AppDto implements Serializable { + + /** + * 应用编号 + */ + private Long id; + + /** + * 应用名称 + */ + private String name; + + /** + * 端口 + */ + private Integer port; + + /** + * 上传目录 + */ + private String uploadPath; + + /** + * 部署目录 + */ + private String deployPath; + + /** + * 备份目录 + */ + private String backupPath; + + /** + * 启动脚本 + */ + private String startScript; + + /** + * 部署脚本 + */ + private String deployScript; + + private Timestamp createTime; + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/AppQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/AppQueryCriteria.java new file mode 100644 index 00000000..235583fe --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/AppQueryCriteria.java @@ -0,0 +1,24 @@ +package co.yixiang.modules.mnt.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +import java.sql.Timestamp; +import java.util.List; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class AppQueryCriteria{ + + /** + * 模糊 + */ + @Query(type = Query.Type.INNER_LIKE) + private String name; + + @Query(type = Query.Type.BETWEEN) + private List createTime; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DatabaseDto.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DatabaseDto.java new file mode 100644 index 00000000..2d8a9df1 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DatabaseDto.java @@ -0,0 +1,41 @@ +package co.yixiang.modules.mnt.service.dto; + +import lombok.Data; +import java.io.Serializable; +import java.sql.Timestamp; + + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class DatabaseDto implements Serializable { + + /** + * id + */ + private String id; + + /** + * 数据库名称 + */ + private String name; + + /** + * 数据库连接地址 + */ + private String jdbcUrl; + + /** + * 数据库密码 + */ + private String pwd; + + /** + * 用户名 + */ + private String userName; + + private Timestamp createTime; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DatabaseQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DatabaseQueryCriteria.java new file mode 100644 index 00000000..0099914d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DatabaseQueryCriteria.java @@ -0,0 +1,30 @@ +package co.yixiang.modules.mnt.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +import java.sql.Timestamp; +import java.util.List; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class DatabaseQueryCriteria{ + + /** + * 模糊 + */ + @Query(type = Query.Type.INNER_LIKE) + private String name; + + /** + * 精确 + */ + @Query + private String jdbcUrl; + + @Query(type = Query.Type.BETWEEN) + private List createTime; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployDto.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployDto.java new file mode 100644 index 00000000..9a799079 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployDto.java @@ -0,0 +1,45 @@ +package co.yixiang.modules.mnt.service.dto; + +import cn.hutool.core.collection.CollectionUtil; +import lombok.Data; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Set; +import java.util.stream.Collectors; + + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class DeployDto implements Serializable { + + /** + * 部署编号 + */ + private String id; + + private AppDto app; + + /** + * 服务器 + */ + private Set deploys; + + private String servers; + + /** + * 服务状态 + */ + private String status; + + private Timestamp createTime; + + public String getServers() { + if(CollectionUtil.isNotEmpty(deploys)){ + return deploys.stream().map(ServerDeployDto::getName).collect(Collectors.joining(",")); + } + return servers; + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployHistoryDto.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployHistoryDto.java new file mode 100644 index 00000000..5b6e1fe5 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployHistoryDto.java @@ -0,0 +1,44 @@ +package co.yixiang.modules.mnt.service.dto; + +import lombok.Data; +import java.io.Serializable; +import java.sql.Timestamp; + + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class DeployHistoryDto implements Serializable { + + /** + * 编号 + */ + private String id; + + /** + * 应用名称 + */ + private String appName; + + /** + * 部署IP + */ + private String ip; + + /** + * 部署时间 + */ + private Timestamp deployDate; + + /** + * 部署人员 + */ + private String deployUser; + + /** + * 部署编号 + */ + private Long deployId; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployHistoryQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployHistoryQueryCriteria.java new file mode 100644 index 00000000..808f36df --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployHistoryQueryCriteria.java @@ -0,0 +1,27 @@ +package co.yixiang.modules.mnt.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +import java.sql.Timestamp; +import java.util.List; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class DeployHistoryQueryCriteria{ + + /** + * 精确 + */ + @Query(blurry = "appName,ip,deployUser") + private String blurry; + + @Query + private Long deployId; + + @Query(type = Query.Type.BETWEEN) + private List deployDate; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployQueryCriteria.java new file mode 100644 index 00000000..2651cdae --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/DeployQueryCriteria.java @@ -0,0 +1,25 @@ +package co.yixiang.modules.mnt.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +import java.sql.Timestamp; +import java.util.List; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class DeployQueryCriteria{ + + /** + * 模糊 + */ + @Query(type = Query.Type.INNER_LIKE, propName = "name", joinName = "app") + private String appName; + + @Query(type = Query.Type.BETWEEN) + private List createTime; + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/ServerDeployDto.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/ServerDeployDto.java new file mode 100644 index 00000000..b09b9a10 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/ServerDeployDto.java @@ -0,0 +1,28 @@ +package co.yixiang.modules.mnt.service.dto; + +import lombok.Data; +import java.io.Serializable; +import java.sql.Timestamp; + + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class ServerDeployDto implements Serializable { + + private Long id; + + private String name; + + private String ip; + + private Integer port; + + private String account; + + private String password; + + private Timestamp createTime; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/ServerDeployQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/ServerDeployQueryCriteria.java new file mode 100644 index 00000000..5bfc2f9d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/dto/ServerDeployQueryCriteria.java @@ -0,0 +1,24 @@ +package co.yixiang.modules.mnt.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +import java.sql.Timestamp; +import java.util.List; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Data +public class ServerDeployQueryCriteria{ + + /** + * 模糊 + */ + @Query(blurry = "name,ip,account") + private String blurry; + + @Query(type = Query.Type.BETWEEN) + private List createTime; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/AppServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/AppServiceImpl.java new file mode 100644 index 00000000..495ff824 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/AppServiceImpl.java @@ -0,0 +1,114 @@ +package co.yixiang.modules.mnt.service.impl; + +import co.yixiang.exception.BadRequestException; +import co.yixiang.modules.mnt.domain.App; +import co.yixiang.modules.mnt.service.AppService; +import co.yixiang.modules.mnt.service.dto.AppDto; +import co.yixiang.modules.mnt.service.dto.AppQueryCriteria; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.mnt.repository.AppRepository; +import co.yixiang.modules.mnt.service.mapper.AppMapper; +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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class AppServiceImpl implements AppService { + + private AppRepository appRepository; + + private AppMapper appMapper; + + public AppServiceImpl(AppRepository appRepository, AppMapper appMapper) { + this.appMapper = appMapper; + this.appRepository = appRepository; + } + + @Override + public Object queryAll(AppQueryCriteria criteria, Pageable pageable){ + Page page = appRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(appMapper::toDto)); + } + + @Override + public List queryAll(AppQueryCriteria criteria){ + return appMapper.toDto(appRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public AppDto findById(Long id) { + App app = appRepository.findById(id).orElseGet(App::new); + ValidationUtil.isNull(app.getId(),"App","id",id); + return appMapper.toDto(app); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public AppDto create(App resources) { + verification(resources); + return appMapper.toDto(appRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(App resources) { + verification(resources); + App app = appRepository.findById(resources.getId()).orElseGet(App::new); + ValidationUtil.isNull(app.getId(),"App","id",resources.getId()); + app.copy(resources); + appRepository.save(app); + } + + private void verification(App resources){ + String opt = "/opt"; + String home = "/home"; + if (!(resources.getUploadPath().startsWith(opt) || resources.getUploadPath().startsWith(home))) { + throw new BadRequestException("文件只能上传在opt目录或者home目录 "); + } + if (!(resources.getDeployPath().startsWith(opt) || resources.getDeployPath().startsWith(home))) { + throw new BadRequestException("文件只能部署在opt目录或者home目录 "); + } + if (!(resources.getBackupPath().startsWith(opt) || resources.getBackupPath().startsWith(home))) { + throw new BadRequestException("文件只能备份在opt目录或者home目录 "); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (Long id : ids) { + appRepository.deleteById(id); + } + } + + @Override + public void download(List queryAll, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (AppDto appDto : queryAll) { + Map map = new LinkedHashMap<>(); + map.put("应用名称", appDto.getName()); + map.put("端口", appDto.getPort()); + map.put("上传目录", appDto.getUploadPath()); + map.put("部署目录", appDto.getDeployPath()); + map.put("备份目录", appDto.getBackupPath()); + map.put("启动脚本", appDto.getStartScript()); + map.put("部署脚本", appDto.getDeployScript()); + map.put("创建日期", appDto.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DatabaseServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DatabaseServiceImpl.java new file mode 100644 index 00000000..839c88dd --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DatabaseServiceImpl.java @@ -0,0 +1,109 @@ +package co.yixiang.modules.mnt.service.impl; + +import cn.hutool.core.util.IdUtil; +import co.yixiang.modules.mnt.domain.Database; +import co.yixiang.modules.mnt.service.DatabaseService; +import co.yixiang.modules.mnt.service.dto.DatabaseDto; +import co.yixiang.modules.mnt.service.dto.DatabaseQueryCriteria; +import co.yixiang.modules.mnt.util.SqlUtils; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.modules.mnt.repository.DatabaseRepository; +import co.yixiang.modules.mnt.service.mapper.DatabaseMapper; +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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Service +@Slf4j +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class DatabaseServiceImpl implements DatabaseService { + + private DatabaseRepository databaseRepository; + + private DatabaseMapper databaseMapper; + + public DatabaseServiceImpl(DatabaseRepository databaseRepository,DatabaseMapper databaseMapper){ + this.databaseMapper = databaseMapper; + this.databaseRepository = databaseRepository; + } + + @Override + public Object queryAll(DatabaseQueryCriteria criteria, Pageable pageable){ + Page page = databaseRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(databaseMapper::toDto)); + } + + @Override + public List queryAll(DatabaseQueryCriteria criteria){ + return databaseMapper.toDto(databaseRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public DatabaseDto findById(String id) { + Database database = databaseRepository.findById(id).orElseGet(Database::new); + ValidationUtil.isNull(database.getId(),"Database","id",id); + return databaseMapper.toDto(database); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DatabaseDto create(Database resources) { + resources.setId(IdUtil.simpleUUID()); + return databaseMapper.toDto(databaseRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Database resources) { + Database database = databaseRepository.findById(resources.getId()).orElseGet(Database::new); + ValidationUtil.isNull(database.getId(),"Database","id",resources.getId()); + database.copy(resources); + databaseRepository.save(database); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (String id : ids) { + databaseRepository.deleteById(id); + } + } + + @Override + public boolean testConnection(Database resources) { + try { + return SqlUtils.testConnection(resources.getJdbcUrl(), resources.getUserName(), resources.getPwd()); + } catch (Exception e) { + log.error(e.getMessage()); + return false; + } + } + + @Override + public void download(List queryAll, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (DatabaseDto databaseDto : queryAll) { + Map map = new LinkedHashMap<>(); + map.put("数据库名称", databaseDto.getName()); + map.put("数据库连接地址", databaseDto.getJdbcUrl()); + map.put("用户名", databaseDto.getUserName()); + map.put("创建日期", databaseDto.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DeployHistoryServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DeployHistoryServiceImpl.java new file mode 100644 index 00000000..d196c3a5 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DeployHistoryServiceImpl.java @@ -0,0 +1,88 @@ +package co.yixiang.modules.mnt.service.impl; + +import cn.hutool.core.util.IdUtil; +import co.yixiang.modules.mnt.domain.DeployHistory; +import co.yixiang.modules.mnt.service.DeployHistoryService; +import co.yixiang.modules.mnt.service.dto.DeployHistoryDto; +import co.yixiang.modules.mnt.service.dto.DeployHistoryQueryCriteria; +import co.yixiang.modules.mnt.service.mapper.DeployHistoryMapper; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.mnt.repository.DeployHistoryRepository; +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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class DeployHistoryServiceImpl implements DeployHistoryService { + + private final DeployHistoryRepository deployhistoryRepository; + + private final DeployHistoryMapper deployhistoryMapper; + + public DeployHistoryServiceImpl(DeployHistoryRepository deployhistoryRepository, DeployHistoryMapper deployhistoryMapper) { + this.deployhistoryRepository = deployhistoryRepository; + this.deployhistoryMapper = deployhistoryMapper; + } + + @Override + public Object queryAll(DeployHistoryQueryCriteria criteria, Pageable pageable){ + Page page = deployhistoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(deployhistoryMapper::toDto)); + } + + @Override + public List queryAll(DeployHistoryQueryCriteria criteria){ + return deployhistoryMapper.toDto(deployhistoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public DeployHistoryDto findById(String id) { + DeployHistory deployhistory = deployhistoryRepository.findById(id).orElseGet(DeployHistory::new); + ValidationUtil.isNull(deployhistory.getId(),"DeployHistory","id",id); + return deployhistoryMapper.toDto(deployhistory); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DeployHistoryDto create(DeployHistory resources) { + resources.setId(IdUtil.simpleUUID()); + return deployhistoryMapper.toDto(deployhistoryRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (String id : ids) { + deployhistoryRepository.deleteById(id); + } + } + + @Override + public void download(List queryAll, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (DeployHistoryDto deployHistoryDto : queryAll) { + Map map = new LinkedHashMap<>(); + map.put("部署编号", deployHistoryDto.getDeployId()); + map.put("应用名称", deployHistoryDto.getAppName()); + map.put("部署IP", deployHistoryDto.getIp()); + map.put("部署时间", deployHistoryDto.getDeployDate()); + map.put("部署人员", deployHistoryDto.getDeployUser()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DeployServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DeployServiceImpl.java new file mode 100644 index 00000000..3d0bb510 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/DeployServiceImpl.java @@ -0,0 +1,435 @@ +package co.yixiang.modules.mnt.service.impl; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import co.yixiang.exception.BadRequestException; +import co.yixiang.modules.mnt.domain.App; +import co.yixiang.modules.mnt.domain.Deploy; +import co.yixiang.modules.mnt.domain.DeployHistory; +import co.yixiang.modules.mnt.domain.ServerDeploy; +import co.yixiang.modules.mnt.service.DeployHistoryService; +import co.yixiang.modules.mnt.service.DeployService; +import co.yixiang.modules.mnt.service.ServerDeployService; +import co.yixiang.modules.mnt.service.dto.AppDto; +import co.yixiang.modules.mnt.service.dto.DeployDto; +import co.yixiang.modules.mnt.service.dto.DeployQueryCriteria; +import co.yixiang.modules.mnt.service.dto.ServerDeployDto; +import co.yixiang.modules.mnt.util.ExecuteShellUtil; +import co.yixiang.modules.mnt.util.ScpClientUtil; +import co.yixiang.utils.*; +import lombok.extern.slf4j.Slf4j; +import co.yixiang.modules.mnt.repository.DeployRepository; +import co.yixiang.modules.mnt.service.mapper.DeployMapper; +import co.yixiang.modules.mnt.websocket.MsgType; +import co.yixiang.modules.mnt.websocket.SocketMsg; +import co.yixiang.modules.mnt.websocket.WebSocketServer; +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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; + +/** + * @author zhanghouying + * @date 2019-08-24 + */ +@Slf4j +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class DeployServiceImpl implements DeployService { + + private final String FILE_SEPARATOR = "/"; + + private final DeployRepository deployRepository; + + private final DeployMapper deployMapper; + + private final ServerDeployService serverDeployService; + + private final DeployHistoryService deployHistoryService; + + // 循环次数 + private final Integer count = 30; + + public DeployServiceImpl(DeployRepository deployRepository, DeployMapper deployMapper, ServerDeployService serverDeployService, DeployHistoryService deployHistoryService) { + this.deployRepository = deployRepository; + this.deployMapper = deployMapper; + this.serverDeployService = serverDeployService; + this.deployHistoryService = deployHistoryService; + } + + + @Override + public Object queryAll(DeployQueryCriteria criteria, Pageable pageable) { + Page page = deployRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable); + return PageUtil.toPage(page.map(deployMapper::toDto)); + } + + @Override + public List queryAll(DeployQueryCriteria criteria) { + return deployMapper.toDto(deployRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder))); + } + + @Override + public DeployDto findById(Long id) { + Deploy deploy = deployRepository.findById(id).orElseGet(Deploy::new); + ValidationUtil.isNull(deploy.getId(), "Deploy", "id", id); + return deployMapper.toDto(deploy); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DeployDto create(Deploy resources) { + return deployMapper.toDto(deployRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Deploy resources) { + Deploy deploy = deployRepository.findById(resources.getId()).orElseGet(Deploy::new); + ValidationUtil.isNull(deploy.getId(), "Deploy", "id", resources.getId()); + deploy.copy(resources); + deployRepository.save(deploy); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (Long id : ids) { + deployRepository.deleteById(id); + } + } + + @Override + public void deploy(String fileSavePath, Long id) { + deployApp(fileSavePath, id); + } + + /** + * @param fileSavePath 本机路径 + * @param id ID + */ + private void deployApp(String fileSavePath, Long id) { + + DeployDto deploy = findById(id); + if (deploy == null) { + sendMsg("部署信息不存在", MsgType.ERROR); + throw new BadRequestException("部署信息不存在"); + } + AppDto app = deploy.getApp(); + if (app == null) { + sendMsg("包对应应用信息不存在", MsgType.ERROR); + throw new BadRequestException("包对应应用信息不存在"); + } + int port = app.getPort(); + //这个是服务器部署路径 + String uploadPath = app.getUploadPath(); + StringBuilder sb = new StringBuilder(); + String msg; + Set deploys = deploy.getDeploys(); + for (ServerDeployDto deployDTO : deploys) { + String ip = deployDTO.getIp(); + ExecuteShellUtil executeShellUtil = getExecuteShellUtil(ip); + //判断是否第一次部署 + boolean flag = checkFile(executeShellUtil, app); + //第一步要确认服务器上有这个目录 + executeShellUtil.execute("mkdir -p " + app.getUploadPath()); + executeShellUtil.execute("mkdir -p " + app.getBackupPath()); + executeShellUtil.execute("mkdir -p " + app.getDeployPath()); + //上传文件 + msg = String.format("登陆到服务器:%s", ip); + ScpClientUtil scpClientUtil = getScpClientUtil(ip); + log.info(msg); + sendMsg(msg, MsgType.INFO); + msg = String.format("上传文件到服务器:%s
目录:%s下,请稍等...", ip, uploadPath); + sendMsg(msg, MsgType.INFO); + scpClientUtil.putFile(fileSavePath, uploadPath); + if (flag) { + sendMsg("停止原来应用", MsgType.INFO); + //停止应用 + stopApp(port, executeShellUtil); + sendMsg("备份原来应用", MsgType.INFO); + //备份应用 + backupApp(executeShellUtil, ip, app.getDeployPath(), app.getName(), app.getBackupPath(), id); + } + sendMsg("部署应用", MsgType.INFO); + //部署文件,并启动应用 + String deployScript = app.getDeployScript(); + executeShellUtil.execute(deployScript); + sleep(3); + sendMsg("应用部署中,请耐心等待部署结果,或者稍后手动查看部署状态", MsgType.INFO); + int i = 0; + boolean result = false; + // 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败 + while (i++ < count){ + result = checkIsRunningStatus(port, executeShellUtil); + if(result){ + break; + } + // 休眠6秒 + sleep(6); + } + sb.append("服务器:").append(deployDTO.getName()).append("
应用:").append(app.getName()); + sendResultMsg(result, sb); + executeShellUtil.close(); + } + } + + private void sleep(int second) { + try { + Thread.sleep(second * 1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + private void backupApp(ExecuteShellUtil executeShellUtil, String ip, String fileSavePath, String appName, String backupPath, Long id) { + String deployDate = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN); + StringBuilder sb = new StringBuilder(); + String endsWith = "\\"; + if (!backupPath.endsWith(FILE_SEPARATOR)&&!backupPath.endsWith(endsWith)) { + backupPath += FILE_SEPARATOR; + } + backupPath += appName + FILE_SEPARATOR + deployDate + "\n"; + sb.append("mkdir -p ").append(backupPath); + sb.append("mv -f ").append(fileSavePath); + if (!fileSavePath.endsWith(FILE_SEPARATOR)) { + sb.append(FILE_SEPARATOR); + } + sb.append(appName).append(" ").append(backupPath); + log.info("备份应用脚本:" + sb.toString()); + executeShellUtil.execute(sb.toString()); + //还原信息入库 + DeployHistory deployHistory = new DeployHistory(); + deployHistory.setAppName(appName); + deployHistory.setDeployUser(SecurityUtils.getUsername()); + deployHistory.setIp(ip); + deployHistory.setDeployId(id); + deployHistoryService.create(deployHistory); + } + + /** + * 停App + * + * @param port 端口 + * @param executeShellUtil / + */ + private void stopApp(int port, ExecuteShellUtil executeShellUtil) { + //发送停止命令 + executeShellUtil.execute(String.format("lsof -i :%d|grep -v \"PID\"|awk '{print \"kill -9\",$2}'|sh", port)); + + } + + /** + * 指定端口程序是否在运行 + * + * @param port 端口 + * @param executeShellUtil / + * @return true 正在运行 false 已经停止 + */ + private boolean checkIsRunningStatus(int port, ExecuteShellUtil executeShellUtil) { + String result = executeShellUtil.executeForResult(String.format("fuser -n tcp %d", port)); + return result.indexOf("/tcp:")>0; + } + + private void sendMsg(String msg, MsgType msgType) { + try { + WebSocketServer.sendInfo(new SocketMsg(msg, msgType), "deploy"); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public String serverStatus(Deploy resources) { + Set serverDeploys = resources.getDeploys(); + App app = resources.getApp(); + for (ServerDeploy serverDeploy : serverDeploys) { + StringBuilder sb = new StringBuilder(); + ExecuteShellUtil executeShellUtil = getExecuteShellUtil(serverDeploy.getIp()); + sb.append("服务器:").append(serverDeploy.getName()).append("
应用:").append(app.getName()); + boolean result = checkIsRunningStatus(app.getPort(), executeShellUtil); + if (result) { + sb.append("
正在运行"); + sendMsg(sb.toString(), MsgType.INFO); + } else { + sb.append("
已停止!"); + sendMsg(sb.toString(), MsgType.ERROR); + } + log.info(sb.toString()); + executeShellUtil.close(); + } + return "执行完毕"; + } + + private boolean checkFile(ExecuteShellUtil executeShellUtil, AppDto appDTO) { + String result = executeShellUtil.executeForResult("find " + appDTO.getDeployPath() + " -name " + appDTO.getName()); + return result.indexOf(appDTO.getName())>0; + } + + /** + * 启动服务 + * @param resources / + * @return / + */ + @Override + public String startServer(Deploy resources) { + Set deploys = resources.getDeploys(); + App app = resources.getApp(); + for (ServerDeploy deploy : deploys) { + StringBuilder sb = new StringBuilder(); + ExecuteShellUtil executeShellUtil = getExecuteShellUtil(deploy.getIp()); + //为了防止重复启动,这里先停止应用 + stopApp(app.getPort(), executeShellUtil); + sb.append("服务器:").append(deploy.getName()).append("
应用:").append(app.getName()); + sendMsg("下发启动命令", MsgType.INFO); + executeShellUtil.execute(app.getStartScript()); + sleep(3); + sendMsg("应用启动中,请耐心等待启动结果,或者稍后手动查看运行状态", MsgType.INFO); + int i = 0; + boolean result = false; + // 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败 + while (i++ < count){ + result = checkIsRunningStatus(app.getPort(), executeShellUtil); + if(result){ + break; + } + // 休眠6秒 + sleep(6); + } + sendResultMsg(result, sb); + log.info(sb.toString()); + executeShellUtil.close(); + } + return "执行完毕"; + } + + /** + * 停止服务 + * @param resources / + * @return / + */ + @Override + public String stopServer(Deploy resources) { + Set deploys = resources.getDeploys(); + App app = resources.getApp(); + for (ServerDeploy deploy : deploys) { + StringBuilder sb = new StringBuilder(); + ExecuteShellUtil executeShellUtil = getExecuteShellUtil(deploy.getIp()); + sb.append("服务器:").append(deploy.getName()).append("
应用:").append(app.getName()); + sendMsg("下发停止命令", MsgType.INFO); + //停止应用 + stopApp(app.getPort(), executeShellUtil); + sleep(1); + boolean result = checkIsRunningStatus(app.getPort(), executeShellUtil); + if (result) { + sb.append("
关闭失败!"); + sendMsg(sb.toString(), MsgType.ERROR); + } else { + sb.append("
关闭成功!"); + sendMsg(sb.toString(), MsgType.INFO); + } + log.info(sb.toString()); + executeShellUtil.close(); + } + return "执行完毕"; + } + + @Override + public String serverReduction(DeployHistory resources) { + Long deployId = resources.getDeployId(); + Deploy deployInfo = deployRepository.findById(deployId).orElseGet(Deploy::new); + String deployDate = DateUtil.format(resources.getDeployDate(), DatePattern.PURE_DATETIME_PATTERN); + App app = deployInfo.getApp(); + if (app == null) { + sendMsg("应用信息不存在:" + resources.getAppName(), MsgType.ERROR); + throw new BadRequestException("应用信息不存在:" + resources.getAppName()); + } + String backupPath = app.getBackupPath(); + if (!backupPath.endsWith(FILE_SEPARATOR)) { + backupPath += FILE_SEPARATOR; + } + backupPath += resources.getAppName() + FILE_SEPARATOR + deployDate; + //这个是服务器部署路径 + String deployPath = app.getDeployPath(); + String ip = resources.getIp(); + ExecuteShellUtil executeShellUtil = getExecuteShellUtil(ip); + String msg; + + msg = String.format("登陆到服务器:%s", ip); + log.info(msg); + sendMsg(msg, MsgType.INFO); + sendMsg("停止原来应用", MsgType.INFO); + //停止应用 + stopApp(app.getPort(), executeShellUtil); + //删除原来应用 + sendMsg("删除应用", MsgType.INFO); + executeShellUtil.execute("rm -rf " + deployPath + FILE_SEPARATOR + resources.getAppName()); + //还原应用 + sendMsg("还原应用", MsgType.INFO); + executeShellUtil.execute("cp -r " + backupPath + "/. " + deployPath); + sendMsg("启动应用", MsgType.INFO); + executeShellUtil.execute(app.getStartScript()); + sendMsg("应用启动中,请耐心等待启动结果,或者稍后手动查看启动状态", MsgType.INFO); + int i = 0; + boolean result = false; + // 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败 + while (i++ < count){ + result = checkIsRunningStatus(app.getPort(), executeShellUtil); + if(result){ + break; + } + // 休眠6秒 + sleep(6); + } + StringBuilder sb = new StringBuilder(); + sb.append("服务器:").append(ip).append("
应用:").append(resources.getAppName()); + sendResultMsg(result, sb); + executeShellUtil.close(); + return ""; + } + + private ExecuteShellUtil getExecuteShellUtil(String ip) { + ServerDeployDto serverDeployDTO = serverDeployService.findByIp(ip); + if (serverDeployDTO == null) { + sendMsg("IP对应服务器信息不存在:" + ip, MsgType.ERROR); + throw new BadRequestException("IP对应服务器信息不存在:" + ip); + } + return new ExecuteShellUtil(ip, serverDeployDTO.getAccount(), serverDeployDTO.getPassword(),serverDeployDTO.getPort()); + } + + private ScpClientUtil getScpClientUtil(String ip) { + ServerDeployDto serverDeployDTO = serverDeployService.findByIp(ip); + if (serverDeployDTO == null) { + sendMsg("IP对应服务器信息不存在:" + ip, MsgType.ERROR); + throw new BadRequestException("IP对应服务器信息不存在:" + ip); + } + return ScpClientUtil.getInstance(ip, serverDeployDTO.getPort(), serverDeployDTO.getAccount(), serverDeployDTO.getPassword()); + } + + private void sendResultMsg(boolean result, StringBuilder sb) { + if (result) { + sb.append("
启动成功!"); + sendMsg(sb.toString(), MsgType.INFO); + } else { + sb.append("
启动失败!"); + sendMsg(sb.toString(), MsgType.ERROR); + } + } + + @Override + public void download(List queryAll, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (DeployDto deployDto : queryAll) { + Map map = new LinkedHashMap<>(); + map.put("应用名称", deployDto.getApp().getName()); + map.put("服务器", deployDto.getServers()); + map.put("部署日期", deployDto.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/ServerDeployServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/ServerDeployServiceImpl.java new file mode 100644 index 00000000..834a7409 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/impl/ServerDeployServiceImpl.java @@ -0,0 +1,116 @@ +package co.yixiang.modules.mnt.service.impl; + +import co.yixiang.modules.mnt.domain.ServerDeploy; +import co.yixiang.modules.mnt.service.ServerDeployService; +import co.yixiang.modules.mnt.service.dto.ServerDeployDto; +import co.yixiang.modules.mnt.service.dto.ServerDeployQueryCriteria; +import co.yixiang.modules.mnt.util.ExecuteShellUtil; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.mnt.repository.ServerDeployRepository; +import co.yixiang.modules.mnt.service.mapper.ServerDeployMapper; +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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class ServerDeployServiceImpl implements ServerDeployService { + + private ServerDeployRepository serverDeployRepository; + + private ServerDeployMapper serverDeployMapper; + + public ServerDeployServiceImpl(ServerDeployRepository serverDeployRepository,ServerDeployMapper serverDeployMapper){ + this.serverDeployRepository = serverDeployRepository; + this.serverDeployMapper = serverDeployMapper; + } + + @Override + public Object queryAll(ServerDeployQueryCriteria criteria, Pageable pageable){ + Page page = serverDeployRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(serverDeployMapper::toDto)); + } + + @Override + public List queryAll(ServerDeployQueryCriteria criteria){ + return serverDeployMapper.toDto(serverDeployRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public ServerDeployDto findById(Long id) { + ServerDeploy server = serverDeployRepository.findById(id).orElseGet(ServerDeploy::new); + ValidationUtil.isNull(server.getId(),"ServerDeploy","id",id); + return serverDeployMapper.toDto(server); + } + + @Override + public ServerDeployDto findByIp(String ip) { + ServerDeploy deploy = serverDeployRepository.findByIp(ip); + return serverDeployMapper.toDto(deploy); + } + + @Override + public Boolean testConnect(ServerDeploy resources) { + ExecuteShellUtil executeShellUtil = null; + try { + executeShellUtil = new ExecuteShellUtil(resources.getIp(), resources.getAccount(), resources.getPassword(),resources.getPort()); + return executeShellUtil.execute("ls")==0; + } catch (Exception e) { + return false; + }finally { + if (executeShellUtil != null) { + executeShellUtil.close(); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public ServerDeployDto create(ServerDeploy resources) { + return serverDeployMapper.toDto(serverDeployRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ServerDeploy resources) { + ServerDeploy serverDeploy = serverDeployRepository.findById(resources.getId()).orElseGet(ServerDeploy::new); + ValidationUtil.isNull( serverDeploy.getId(),"ServerDeploy","id",resources.getId()); + serverDeploy.copy(resources); + serverDeployRepository.save(serverDeploy); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (Long id : ids) { + serverDeployRepository.deleteById(id); + } + } + + @Override + public void download(List queryAll, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (ServerDeployDto deployDto : queryAll) { + Map map = new LinkedHashMap<>(); + map.put("服务器名称", deployDto.getName()); + map.put("服务器IP", deployDto.getIp()); + map.put("端口", deployDto.getPort()); + map.put("账号", deployDto.getAccount()); + map.put("创建日期", deployDto.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/AppMapper.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/AppMapper.java new file mode 100644 index 00000000..85db9d4a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/AppMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.mnt.service.mapper; + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.mnt.domain.App; +import co.yixiang.modules.mnt.service.dto.AppDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface AppMapper extends BaseMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DatabaseMapper.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DatabaseMapper.java new file mode 100644 index 00000000..50947a35 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DatabaseMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.mnt.service.mapper; + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.mnt.domain.Database; +import co.yixiang.modules.mnt.service.dto.DatabaseDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DatabaseMapper extends BaseMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DeployHistoryMapper.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DeployHistoryMapper.java new file mode 100644 index 00000000..ce5752e1 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DeployHistoryMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.mnt.service.mapper; + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.mnt.domain.DeployHistory; +import co.yixiang.modules.mnt.service.dto.DeployHistoryDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DeployHistoryMapper extends BaseMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DeployMapper.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DeployMapper.java new file mode 100644 index 00000000..a67856aa --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/DeployMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.mnt.service.mapper; + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.mnt.domain.Deploy; +import co.yixiang.modules.mnt.service.dto.DeployDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Mapper(componentModel = "spring",uses = {AppMapper.class, ServerDeployMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DeployMapper extends BaseMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/ServerDeployMapper.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/ServerDeployMapper.java new file mode 100644 index 00000000..4cf5981c --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/service/mapper/ServerDeployMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.mnt.service.mapper; + +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.mnt.domain.ServerDeploy; +import co.yixiang.modules.mnt.service.dto.ServerDeployDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author zhanghouying +* @date 2019-08-24 +*/ +@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface ServerDeployMapper extends BaseMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/util/DataTypeEnum.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/DataTypeEnum.java new file mode 100644 index 00000000..2e7fcf80 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/DataTypeEnum.java @@ -0,0 +1,140 @@ +/* + * << + * Davinci + * == + * Copyright (C) 2016 - 2019 EDP + * == + * 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. + * >> + * + */ + +package co.yixiang.modules.mnt.util; +import lombok.extern.slf4j.Slf4j; + +/** + * @author / + */ +@Slf4j +@SuppressWarnings({"unchecked","all"}) +public enum DataTypeEnum { + + /** mysql */ + MYSQL("mysql", "mysql", "com.mysql.jdbc.Driver", "`", "`", "'", "'"), + + /** oracle */ + ORACLE("oracle", "oracle", "oracle.jdbc.driver.OracleDriver", "\"", "\"", "\"", "\""), + + /** sql server */ + SQLSERVER("sqlserver", "sqlserver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "\"", "\"", "\"", "\""), + + /** h2 */ + H2("h2", "h2", "org.h2.Driver", "`", "`", "\"", "\""), + + /** phoenix */ + PHOENIX("phoenix", "hbase phoenix", "org.apache.phoenix.jdbc.PhoenixDriver", "", "", "\"", "\""), + + /** mongo */ + MONGODB("mongo", "mongodb", "mongodb.jdbc.MongoDriver", "`", "`", "\"", "\""), + + /** sql4es */ + ELASTICSEARCH("sql4es", "elasticsearch", "nl.anchormen.sql4es.jdbc.ESDriver", "", "", "'", "'"), + + /** presto */ + PRESTO("presto", "presto", "com.facebook.presto.jdbc.PrestoDriver", "", "", "\"", "\""), + + /** moonbox */ + MOONBOX("moonbox", "moonbox", "moonbox.jdbc.MbDriver", "`", "`", "`", "`"), + + /** cassandra */ + CASSANDRA("cassandra", "cassandra", "com.github.adejanovski.cassandra.jdbc.CassandraDriver", "", "", "'", "'"), + + /** click house */ + CLICKHOUSE("clickhouse", "clickhouse", "ru.yandex.clickhouse.ClickHouseDriver", "", "", "\"", "\""), + + /** kylin */ + KYLIN("kylin", "kylin", "org.apache.kylin.jdbc.Driver", "\"", "\"", "\"", "\""), + + /** vertica */ + VERTICA("vertica", "vertica", "com.vertica.jdbc.Driver", "", "", "'", "'"), + + /** sap */ + HANA("sap", "sap hana", "com.sap.db.jdbc.Driver", "", "", "'", "'"), + + /** impala */ + IMPALA("impala", "impala", "com.cloudera.impala.jdbc41.Driver", "", "", "'", "'"); + + private String feature; + private String desc; + private String driver; + private String keywordPrefix; + private String keywordSuffix; + private String aliasPrefix; + private String aliasSuffix; + + private static final String JDBC_URL_PREFIX = "jdbc:"; + + DataTypeEnum(String feature, String desc, String driver, String keywordPrefix, String keywordSuffix, String aliasPrefix, String aliasSuffix) { + this.feature = feature; + this.desc = desc; + this.driver = driver; + this.keywordPrefix = keywordPrefix; + this.keywordSuffix = keywordSuffix; + this.aliasPrefix = aliasPrefix; + this.aliasSuffix = aliasSuffix; + } + + public static DataTypeEnum urlOf(String jdbcUrl) { + String url = jdbcUrl.toLowerCase().trim(); + for (DataTypeEnum dataTypeEnum : values()) { + if (url.startsWith(JDBC_URL_PREFIX + dataTypeEnum.feature)) { + try { + Class aClass = Class.forName(dataTypeEnum.getDriver()); + if (null == aClass) { + throw new RuntimeException("Unable to get driver instance for jdbcUrl: " + jdbcUrl); + } + } catch (ClassNotFoundException e) { + throw new RuntimeException("Unable to get driver instance: " + jdbcUrl); + } + return dataTypeEnum; + } + } + return null; + } + + public String getFeature() { + return feature; + } + + public String getDesc() { + return desc; + } + + public String getDriver() { + return driver; + } + + public String getKeywordPrefix() { + return keywordPrefix; + } + + public String getKeywordSuffix() { + return keywordSuffix; + } + + public String getAliasPrefix() { + return aliasPrefix; + } + + public String getAliasSuffix() { + return aliasSuffix; + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ExecuteShellUtil.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ExecuteShellUtil.java new file mode 100644 index 00000000..4fe3c016 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ExecuteShellUtil.java @@ -0,0 +1,86 @@ +package co.yixiang.modules.mnt.util; + +import cn.hutool.core.io.IoUtil; +import com.jcraft.jsch.ChannelShell; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.Session; +import lombok.extern.slf4j.Slf4j; + +import java.io.*; +import java.util.Vector; + +/** + * 执行shell命令 + * + * @author: ZhangHouYing + * @date: 2019/8/10 + */ +@Slf4j +public class ExecuteShellUtil { + + private Vector stdout; + + Session session; + + public ExecuteShellUtil(final String ipAddress, final String username, final String password,int port) { + try { + JSch jsch = new JSch(); + session = jsch.getSession(username, ipAddress, port); + session.setPassword(password); + session.setConfig("StrictHostKeyChecking", "no"); + session.connect(3000); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + public int execute(final String command) { + int returnCode = 0; + ChannelShell channel = null; + PrintWriter printWriter = null; + BufferedReader input = null; + stdout = new Vector(); + try { + channel = (ChannelShell) session.openChannel("shell"); + channel.connect(); + input = new BufferedReader(new InputStreamReader(channel.getInputStream())); + printWriter = new PrintWriter(channel.getOutputStream()); + printWriter.println(command); + printWriter.println("exit"); + printWriter.flush(); + log.info("The remote command is: "); + String line; + while ((line = input.readLine()) != null) { + stdout.add(line); + System.out.println(line); + } + } catch (Exception e) { + e.printStackTrace(); + return -1; + }finally { + IoUtil.close(printWriter); + IoUtil.close(input); + if (channel != null) { + channel.disconnect(); + } + } + return returnCode; + } + + public void close(){ + if (session != null) { + session.disconnect(); + } + } + + public String executeForResult(String command) { + execute(command); + StringBuilder sb = new StringBuilder(); + for (String str : stdout) { + sb.append(str); + } + return sb.toString(); + } + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ScpClientUtil.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ScpClientUtil.java new file mode 100644 index 00000000..0e52b123 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ScpClientUtil.java @@ -0,0 +1,88 @@ +package co.yixiang.modules.mnt.util; + +import ch.ethz.ssh2.Connection; +import ch.ethz.ssh2.SCPClient; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * 远程执行linux命令 + * @author: ZhangHouYing + * @date: 2019-08-10 10:06 + */ +public class ScpClientUtil { + + static private ScpClientUtil instance; + + static synchronized public ScpClientUtil getInstance(String ip, int port, String username, String passward) { + if (instance == null) { + instance = new ScpClientUtil(ip, port, username, passward); + } + return instance; + } + + public ScpClientUtil(String ip, int port, String username, String passward) { + this.ip = ip; + this.port = port; + this.username = username; + this.password = passward; + } + + public void getFile(String remoteFile, String localTargetDirectory) { + Connection conn = new Connection(ip, port); + try { + conn.connect(); + boolean isAuthenticated = conn.authenticateWithPassword(username, password); + if (!isAuthenticated) { + System.err.println("authentication failed"); + } + SCPClient client = new SCPClient(conn); + client.get(remoteFile, localTargetDirectory); + } catch (IOException ex) { + Logger.getLogger(SCPClient.class.getName()).log(Level.SEVERE, null, ex); + }finally{ + conn.close(); + } + } + + public void putFile(String localFile, String remoteTargetDirectory) { + putFile(localFile, null, remoteTargetDirectory); + } + + public void putFile(String localFile, String remoteFileName, String remoteTargetDirectory) { + putFile(localFile, remoteFileName, remoteTargetDirectory,null); + } + + public void putFile(String localFile, String remoteFileName, String remoteTargetDirectory, String mode) { + Connection conn = new Connection(ip, port); + try { + conn.connect(); + boolean isAuthenticated = conn.authenticateWithPassword(username, password); + if (!isAuthenticated) { + System.err.println("authentication failed"); + } + SCPClient client = new SCPClient(conn); + if ((mode == null) || (mode.length() == 0)) { + mode = "0600"; + } + if (remoteFileName == null) { + client.put(localFile, remoteTargetDirectory); + } else { + client.put(localFile, remoteFileName, remoteTargetDirectory, mode); + } + } catch (IOException ex) { + Logger.getLogger(ScpClientUtil.class.getName()).log(Level.SEVERE, null, ex); + }finally{ + conn.close(); + } + } + + private String ip; + private int port; + private String username; + private String password; + + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/util/SqlUtils.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/SqlUtils.java new file mode 100644 index 00000000..b4fbe274 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/SqlUtils.java @@ -0,0 +1,215 @@ +package co.yixiang.modules.mnt.util; + +import cn.hutool.crypto.SecureUtil; +import com.alibaba.druid.pool.DruidDataSource; +import com.alibaba.druid.util.StringUtils; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import javax.sql.DataSource; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.sql.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author / + */ +@Slf4j +public class SqlUtils { + + public static final String COLON = ":"; + + private static volatile Map map = new HashMap<>(); + + private static String getKey(String jdbcUrl, String username, String password) { + StringBuilder sb = new StringBuilder(); + if (!StringUtils.isEmpty(username)) { + sb.append(username); + } + if (!StringUtils.isEmpty(password)) { + sb.append(COLON).append(password); + } + sb.append(COLON).append(jdbcUrl.trim()); + + return SecureUtil.md5(sb.toString()); + } + + /** + * 获取数据源 + * + * @param jdbcUrl / + * @param userName / + * @param password / + * @return DataSource + */ + private static DataSource getDataSource(String jdbcUrl, String userName, String password) { + String key = getKey(jdbcUrl, userName, password); + if (!map.containsKey(key) || null == map.get(key)) { + DruidDataSource druidDataSource = new DruidDataSource(); + + String className; + try { + className = DriverManager.getDriver(jdbcUrl.trim()).getClass().getName(); + } catch (SQLException e) { + throw new RuntimeException("Get class name error: =" + jdbcUrl); + } + if (StringUtils.isEmpty(className)) { + DataTypeEnum dataTypeEnum = DataTypeEnum.urlOf(jdbcUrl); + if (null == dataTypeEnum) { + throw new RuntimeException("Not supported data type: jdbcUrl=" + jdbcUrl); + } + druidDataSource.setDriverClassName(dataTypeEnum.getDriver()); + } else { + druidDataSource.setDriverClassName(className); + } + + + druidDataSource.setUrl(jdbcUrl); + druidDataSource.setUsername(userName); + druidDataSource.setPassword(password); + // 配置获取连接等待超时的时间 + druidDataSource.setMaxWait(3000); + // 配置初始化大小、最小、最大 + druidDataSource.setInitialSize(1); + druidDataSource.setMinIdle(1); + druidDataSource.setMaxActive(1); + + // 配置间隔多久才进行一次检测需要关闭的空闲连接,单位是毫秒 + druidDataSource.setTimeBetweenEvictionRunsMillis(50000); + // 配置一旦重试多次失败后等待多久再继续重试连接,单位是毫秒 + druidDataSource.setTimeBetweenConnectErrorMillis(18000); + // 配置一个连接在池中最小生存的时间,单位是毫秒 + druidDataSource.setMinEvictableIdleTimeMillis(300000); + // 这个特性能解决 MySQL 服务器8小时关闭连接的问题 + druidDataSource.setMaxEvictableIdleTimeMillis(25200000); + + try { + druidDataSource.init(); + } catch (SQLException e) { + log.error("Exception during pool initialization", e); + throw new RuntimeException(e.getMessage()); + } + map.put(key, druidDataSource); + } + return map.get(key); + } + + private static Connection getConnection(String jdbcUrl, String userName, String password) { + DataSource dataSource = getDataSource(jdbcUrl, userName, password); + Connection connection = null; + try { + connection = dataSource.getConnection(); + } catch (Exception ignored) {} + try { + int timeOut = 5; + if (null == connection || connection.isClosed() || !connection.isValid(timeOut)) { + log.info("connection is closed or invalid, retry get connection!"); + connection = dataSource.getConnection(); + } + } catch (Exception e) { + log.error("create connection error, jdbcUrl: {}", jdbcUrl); + throw new RuntimeException("create connection error, jdbcUrl: " + jdbcUrl); + } + return connection; + } + + private static void releaseConnection(Connection connection) { + if (null != connection) { + try { + connection.close(); + } catch (Exception e) { + e.printStackTrace(); + log.error("connection close error:" + e.getMessage()); + } + } + } + + + public static void closeResult(ResultSet rs) { + if (rs != null) { + try { + rs.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public static boolean testConnection(String jdbcUrl, String userName, String password) { + Connection connection = null; + try { + connection = getConnection(jdbcUrl, userName, password); + if (null != connection) { + return true; + } + } catch (Exception e) { + log.info("Get connection failed:" + e.getMessage()); + } finally { + releaseConnection(connection); + } + return false; + } + + public static String executeFile(String jdbcUrl, String userName, String password, File sqlFile) { + Connection connection = getConnection(jdbcUrl, userName, password); + try { + batchExecute(connection, readSqlList(sqlFile)); + } catch (Exception e) { + log.error("sql脚本执行发生异常:{}",e.getMessage()); + return e.getMessage(); + }finally { + releaseConnection(connection); + } + return "success"; + } + + + /** + * 批量执行sql + * @param connection / + * @param sqlList / + */ + public static void batchExecute(Connection connection, List sqlList) throws SQLException { + Statement st = connection.createStatement(); + for (String sql : sqlList) { + if (sql.endsWith(";")) { + sql = sql.substring(0, sql.length() - 1); + } + st.addBatch(sql); + } + st.executeBatch(); + } + + /** + * 将文件中的sql语句以;为单位读取到列表中 + * @param sqlFile / + * @return / + * @throws Exception e + */ + private static List readSqlList(File sqlFile) throws Exception { + List sqlList = Lists.newArrayList(); + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = new BufferedReader(new InputStreamReader( + new FileInputStream(sqlFile), StandardCharsets.UTF_8))) { + String tmp; + while ((tmp = reader.readLine()) != null) { + log.info("line:{}", tmp); + if (tmp.endsWith(";")) { + sb.append(tmp); + sqlList.add(sb.toString()); + sb.delete(0, sb.length()); + } else { + sb.append(tmp); + } + } + if (!"".endsWith(sb.toString().trim())) { + sqlList.add(sb.toString()); + } + } + + return sqlList; + } + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ZipUtils.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ZipUtils.java new file mode 100644 index 00000000..a56e83a2 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/util/ZipUtils.java @@ -0,0 +1,132 @@ +package co.yixiang.modules.mnt.util; + +import java.io.*; +import java.util.Enumeration; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; + +/** + * @author: ZhangHouYing + * @date: 2019-08-10 13:34 + */ +public class ZipUtils { + /** + * 解压文件 + * + * @param zipFilePath 解压文件路径 + * @param outputFolder 输出解压文件路径 + */ + public static void unZipIt(String zipFilePath, String outputFolder) { + byte[] buffer = new byte[1024]; + + File folder = new File(outputFolder); + if (!folder.exists()) { + folder.mkdir(); + } + try { + //get the zip file content + ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFilePath)); + ZipEntry ze = zis.getNextEntry(); + while (ze != null) { + String fileName = ze.getName(); + File newFile = new File(outputFolder + File.separator + fileName); + System.out.println("file unzip : " + newFile.getAbsoluteFile()); + //大部分网络上的源码,这里没有判断子目录 + if (ze.isDirectory()) { + newFile.mkdirs(); + } else { + new File(newFile.getParent()).mkdirs(); + FileOutputStream fos = new FileOutputStream(newFile); + int len; + while ((len = zis.read(buffer)) != -1) { + fos.write(buffer, 0, len); + } + fos.close(); + } + ze = zis.getNextEntry(); + } + zis.closeEntry(); + zis.close(); + System.out.println("Done"); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void unzip(File source, String out) throws IOException { + try (ZipInputStream zis = new ZipInputStream(new FileInputStream(source))) { + + ZipEntry entry = zis.getNextEntry(); + + while (entry != null) { + + File file = new File(out, entry.getName()); + + if (entry.isDirectory()) { + file.mkdirs(); + } else { + File parent = file.getParentFile(); + + if (!parent.exists()) { + parent.mkdirs(); + } + + try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file))) { + + byte[] buffer = new byte[Math.toIntExact(entry.getSize())]; + + int location; + + while ((location = zis.read(buffer)) != -1) { + bos.write(buffer, 0, location); + } + } + } + entry = zis.getNextEntry(); + } + } + } + + /** + * 把所有文件都直接解压到指定目录(忽略子文件夹) + * + * @param zipFile + * @param folderPath + * @throws ZipException + * @throws IOException + */ + public static void upZipFile(File zipFile, String folderPath) throws ZipException, IOException { + File desDir = new File(folderPath); + if (!desDir.exists()) { + desDir.mkdirs(); + } + ZipFile zf = new ZipFile(zipFile); + for (Enumeration entries = zf.entries(); entries.hasMoreElements(); ) { + ZipEntry entry = ((ZipEntry) entries.nextElement()); + InputStream in = zf.getInputStream(entry); + String str = folderPath; + File desFile = new File(str, java.net.URLEncoder.encode(entry.getName(), "UTF-8")); + + if (!desFile.exists()) { + File fileParentDir = desFile.getParentFile(); + if (!fileParentDir.exists()) { + fileParentDir.mkdirs(); + } + } + + OutputStream out = new FileOutputStream(desFile); + byte[] buffer = new byte[1024 * 1024]; + int realLength = in.read(buffer); + while (realLength != -1) { + out.write(buffer, 0, realLength); + realLength = in.read(buffer); + } + + out.close(); + in.close(); + + } + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/MsgType.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/MsgType.java new file mode 100644 index 00000000..3f598c43 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/MsgType.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.mnt.websocket; + +/** + * @author: ZhangHouYing + * @date: 2019-08-10 9:56 + */ +public enum MsgType { + /** 连接 */ + CONNECT, + /** 关闭 */ + CLOSE, + /** 信息 */ + INFO, + /** 错误 */ + ERROR +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/SocketMsg.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/SocketMsg.java new file mode 100644 index 00000000..a6ab2427 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/SocketMsg.java @@ -0,0 +1,18 @@ +package co.yixiang.modules.mnt.websocket; + +import lombok.Data; + +/** + * @author: ZhangHouYing + * @date: 2019-08-10 9:55 + */ +@Data +public class SocketMsg { + private String msg; + private MsgType msgType; + + public SocketMsg(String msg, MsgType msgType) { + this.msg = msg; + this.msgType = msgType; + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/WebSocketServer.java b/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/WebSocketServer.java new file mode 100644 index 00000000..5bb0279e --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/mnt/websocket/WebSocketServer.java @@ -0,0 +1,124 @@ +package co.yixiang.modules.mnt.websocket; + +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.websocket.*; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; +import java.util.Objects; +import java.util.concurrent.CopyOnWriteArraySet; +/** + * @author: ZhangHouYing + * @date: 2019-08-10 15:46 + */ +@ServerEndpoint("/webSocket/{sid}") +@Slf4j +@Component +public class WebSocketServer { + + /** + * concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。 + */ + private static CopyOnWriteArraySet webSocketSet = new CopyOnWriteArraySet(); + + /** + * 与某个客户端的连接会话,需要通过它来给客户端发送数据 + */ + private Session session; + + /** + * 接收sid + */ + private String sid=""; + /** + * 连接建立成功调用的方法 + * */ + @OnOpen + public void onOpen(Session session,@PathParam("sid") String sid) { + this.session = session; + //如果存在就先删除一个,防止重复推送消息 + for (WebSocketServer webSocket:webSocketSet) { + if (webSocket.sid.equals(sid)) { + webSocketSet.remove(webSocket); + } + } + webSocketSet.add(this); + this.sid=sid; + } + + /** + * 连接关闭调用的方法 + */ + @OnClose + public void onClose() { + webSocketSet.remove(this); + } + + /** + * 收到客户端消息后调用的方法 + * @param message 客户端发送过来的消息*/ + @OnMessage + public void onMessage(String message, Session session) { + log.info("收到来"+sid+"的信息:"+message); + //群发消息 + for (WebSocketServer item : webSocketSet) { + try { + item.sendMessage(message); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + @OnError + public void onError(Session session, Throwable error) { + log.error("发生错误"); + error.printStackTrace(); + } + /** + * 实现服务器主动推送 + */ + private void sendMessage(String message) throws IOException { + this.session.getBasicRemote().sendText(message); + } + + + /** + * 群发自定义消息 + * */ + public static void sendInfo(SocketMsg socketMsg,@PathParam("sid") String sid) throws IOException { + String message = JSONObject.toJSONString(socketMsg); + log.info("推送消息到"+sid+",推送内容:"+message); + for (WebSocketServer item : webSocketSet) { + try { + //这里可以设定只推送给这个sid的,为null则全部推送 + if(sid==null) { + item.sendMessage(message); + }else if(item.sid.equals(sid)){ + item.sendMessage(message); + } + } catch (IOException ignored) { } + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebSocketServer that = (WebSocketServer) o; + return Objects.equals(session, that.session) && + Objects.equals(sid, that.sid); + } + + @Override + public int hashCode() { + return Objects.hash(session, sid); + } +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/Server.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/Server.java new file mode 100644 index 00000000..33556060 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/domain/Server.java @@ -0,0 +1,107 @@ +package co.yixiang.modules.monitor.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 Zhang houying +* @date 2019-11-03 +*/ +@Entity +@Data +@Table(name="monitor_server") +public class Server implements Serializable { + + /** + * 编号 + */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Integer id; + + /** + * 名称 + */ + @Column(name = "name") + private String name; + + /** + * IP地址 + */ + @Column(name = "address",nullable = false) + private String address; + + /** + * 访问端口 + */ + @Column(name = "port") + private Integer port; + + /** + * 状态 + */ + @Column(name = "state") + private String state; + + /** + * CPU使用率 + */ + @Column(name = "cpu_rate") + private Double cpuRate; + + /** + * CPU内核数 + */ + @Column(name = "cpu_core") + private Integer cpuCore; + + /** + * 内存总数 + */ + @Column(name = "mem_total") + private Double memTotal; + + /** + * 内存使用量 + */ + @Column(name = "mem_used") + private Double memUsed; + + /** + * 磁盘总量 + */ + @Column(name = "disk_total") + private Double diskTotal; + + /** + * 磁盘使用量 + */ + @Column(name = "disk_used") + private Double diskUsed; + + /** + * 交换区总量 + */ + @Column(name = "swap_total") + private Double swapTotal; + + /** + * 交换区使用量 + */ + @Column(name = "swap_used") + private Double swapUsed; + + /** + * 排序 + */ + @Column(name = "sort") + private Integer sort; + + public void copy(Server source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } +} 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 index 467d8aa5..e7b5e6f8 100644 --- 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 @@ -1,10 +1,9 @@ package co.yixiang.modules.monitor.domain; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; import java.io.Serializable; import java.sql.Timestamp; @@ -14,21 +13,28 @@ import java.sql.Timestamp; * @author Zheng Jie * @date 2018-12-13 */ +@Entity @Data -@TableName( "visits") +@Table(name = "visits") public class Visits implements Serializable { - @TableId + @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; - @TableField(fill = FieldFill.INSERT) + @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/repository/ServerRepository.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/repository/ServerRepository.java new file mode 100644 index 00000000..70ff5649 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/repository/ServerRepository.java @@ -0,0 +1,12 @@ +package co.yixiang.modules.monitor.repository; + +import co.yixiang.modules.monitor.domain.Server; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @author Zhang houying +* @date 2019-11-03 +*/ +public interface ServerRepository extends JpaRepository, JpaSpecificationExecutor { +} 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..8112d23d --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/repository/VisitsRepository.java @@ -0,0 +1,31 @@ +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 + */ + Visits findByDate(String date); + + /** + * 获得一个时间段的记录 + * @param date1 日期1 + * @param date2 日期2 + * @return List + */ + @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 index d81a0386..2cd4b23b 100644 --- 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 @@ -1,13 +1,12 @@ package co.yixiang.modules.monitor.rest; -import co.yixiang.annotation.AnonymousAccess; -import co.yixiang.annotation.Limit; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import co.yixiang.annotation.AnonymousAccess; +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; /** 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 index 862bd22d..65fe9bf7 100644 --- 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 @@ -1,8 +1,11 @@ package co.yixiang.modules.monitor.rest; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.modules.monitor.domain.vo.RedisVo; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.monitor.service.RedisService; +import co.yixiang.aop.log.Log; +import co.yixiang.modules.monitor.domain.vo.RedisVo; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/ServerController.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/ServerController.java new file mode 100644 index 00000000..763d4ab5 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/rest/ServerController.java @@ -0,0 +1,71 @@ +package co.yixiang.modules.monitor.rest; + +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; +import co.yixiang.modules.monitor.domain.Server; +import co.yixiang.modules.monitor.service.ServerService; +import co.yixiang.modules.monitor.service.dto.ServerQueryCriteria; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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 java.util.Set; + +/** +* @author Zhang houying +* @date 2019-11-03 +*/ +@Api(tags = "服务监控管理") +@RestController +@RequestMapping("/api/server") +public class ServerController { + + private final ServerService serverService; + + public ServerController(ServerService serverService) { + this.serverService = serverService; + } + + @GetMapping + @Log("查询服务监控") + @ApiOperation("查询服务监控") + @PreAuthorize("@el.check('admin','server:list')") + public ResponseEntity getServers(ServerQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity<>(serverService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @PostMapping + @Log("新增服务监控") + @ApiOperation("新增服务监控") + @PreAuthorize("@el.check('admin','server:add')") + public ResponseEntity create(@Validated @RequestBody Server resources){ + //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); + return new ResponseEntity<>(serverService.create(resources),HttpStatus.CREATED); + } + + @PutMapping + @Log("修改服务监控") + @ApiOperation("修改服务监控") + @PreAuthorize("@el.check('admin','server:edit')") + public ResponseEntity update(@Validated @RequestBody Server resources){ + //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); + serverService.update(resources); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @DeleteMapping + @Log("删除服务监控") + @ApiOperation("删除服务监控") + @PreAuthorize("@el.check('admin','server:del')") + public ResponseEntity delete(@RequestBody Set ids){ + //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); + serverService.delete(ids); + 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 index 6ce3a612..b0e3f05a 100644 --- 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 @@ -1,9 +1,9 @@ package co.yixiang.modules.monitor.rest; -import co.yixiang.modules.monitor.service.VisitsService; -import co.yixiang.utils.RequestHolder; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import co.yixiang.modules.monitor.service.VisitsService; +import co.yixiang.utils.RequestHolder; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/ServerService.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/ServerService.java new file mode 100644 index 00000000..f44d69e3 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/ServerService.java @@ -0,0 +1,59 @@ +package co.yixiang.modules.monitor.service; + +import co.yixiang.modules.monitor.domain.Server; +import co.yixiang.modules.monitor.service.dto.ServerDTO; +import co.yixiang.modules.monitor.service.dto.ServerQueryCriteria; +import org.springframework.data.domain.Pageable; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** +* @author Zhang houying +* @date 2019-11-03 +*/ +public interface ServerService { + + /** + * 查询数据分页 + * @param criteria 条件参数 + * @param pageable 分页参数 + * @return Map + */ + Map queryAll(ServerQueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria 条件参数 + * @return List + */ + List queryAll(ServerQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id ID + * @return ServerDTO + */ + ServerDTO findById(Integer id); + + /** + * 创建服务监控 + * @param resources / + * @return / + */ + ServerDTO create(Server resources); + + /** + * 编辑服务监控 + * @param resources / + */ + void update(Server resources); + + /** + * 删除 + * @param id / + */ + void delete(Set id); + +} 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 index 74ebb415..635bd4e5 100644 --- 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 @@ -1,16 +1,13 @@ package co.yixiang.modules.monitor.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.monitor.domain.Visits; import org.springframework.scheduling.annotation.Async; - import javax.servlet.http.HttpServletRequest; /** * @author Zheng Jie * @date 2018-12-13 */ -public interface VisitsService extends BaseService { +public interface VisitsService { /** * 提供给定时任务,每天0点执行 diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/dto/ServerDTO.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/dto/ServerDTO.java new file mode 100644 index 00000000..e9c99b5a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/dto/ServerDTO.java @@ -0,0 +1,49 @@ +package co.yixiang.modules.monitor.service.dto; + +import lombok.Data; +import java.io.Serializable; + + +/** +* @author Zhang houying +* @date 2019-11-03 +*/ +@Data +public class ServerDTO implements Serializable { + + private Integer id; + + private String name; + + private String address; + + private Integer port; + + private String state; + + /** CPU使用率 */ + private Float cpuRate; + + /** CPU内核数 */ + private Integer cpuCore; + + /** 内存总数 */ + private Float memTotal; + + /** 内存使用量 */ + private Float memUsed; + + /** 磁盘总量 */ + private Float diskTotal; + + /** 磁盘使用量 */ + private Float diskUsed; + + /** 交换区总量 */ + private Float swapTotal; + + /** 交换区使用量 */ + private Float swapUsed; + + private Integer sort; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/dto/ServerQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/dto/ServerQueryCriteria.java new file mode 100644 index 00000000..5a1c1399 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/dto/ServerQueryCriteria.java @@ -0,0 +1,15 @@ +package co.yixiang.modules.monitor.service.dto; + +import lombok.Data; +import co.yixiang.annotation.Query; + +/** +* @author Zhang houying +* @date 2019-11-03 +*/ +@Data +public class ServerQueryCriteria{ + + @Query(blurry = "name,address") + private String blurry; +} \ No newline at end of file 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 index 8d654fe9..5c98ec37 100644 --- 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 @@ -1,8 +1,8 @@ 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 co.yixiang.utils.PageUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Page; @@ -11,7 +11,6 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.redis.connection.DataType; 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; diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/ServerServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/ServerServiceImpl.java new file mode 100644 index 00000000..1afbca65 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/impl/ServerServiceImpl.java @@ -0,0 +1,101 @@ +package co.yixiang.modules.monitor.service.impl; + +import cn.hutool.http.HttpUtil; +import co.yixiang.modules.monitor.domain.Server; +import co.yixiang.modules.monitor.service.ServerService; +import com.alibaba.fastjson.JSONObject; +import co.yixiang.modules.monitor.repository.ServerRepository; +import co.yixiang.modules.monitor.service.dto.ServerDTO; +import co.yixiang.modules.monitor.service.dto.ServerQueryCriteria; +import co.yixiang.modules.monitor.service.mapper.ServerMapper; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +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.List; +import java.util.Map; +import java.util.Set; + +/** +* @author Zhang houying +* @date 2019-11-03 +*/ +@Service +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class ServerServiceImpl implements ServerService { + + private final ServerRepository serverRepository; + + private final ServerMapper serverMapper; + + public ServerServiceImpl(ServerRepository serverRepository, ServerMapper serverMapper) { + this.serverRepository = serverRepository; + this.serverMapper = serverMapper; + } + + @Override + public Map queryAll(ServerQueryCriteria criteria, Pageable pageable){ + Page page = serverRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + page.forEach(server -> { + try { + server.setState("1"); + String url = String.format("http://%s:%d/api/serverMonitor",server.getAddress(),server.getPort()); + String res = HttpUtil.get(url,1000); + JSONObject obj = JSONObject.parseObject(res); + server.setCpuRate(obj.getDouble("cpuRate")); + server.setCpuCore(obj.getInteger("cpuCore")); + server.setMemTotal(obj.getDouble("memTotal")); + server.setMemUsed(obj.getDouble("memUsed")); + server.setDiskTotal(obj.getDouble("diskTotal")); + server.setDiskUsed(obj.getDouble("diskUsed")); + server.setSwapTotal(obj.getDouble("swapTotal")); + server.setSwapUsed(obj.getDouble("swapUsed")); + } catch (Exception e) { + server.setState("0"); + e.printStackTrace(); + } + }); + + return PageUtil.toPage(page.map(serverMapper::toDto)); + } + + @Override + public List queryAll(ServerQueryCriteria criteria){ + return serverMapper.toDto(serverRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + public ServerDTO findById(Integer id) { + Server server = serverRepository.findById(id).orElseGet(Server::new); + ValidationUtil.isNull(server.getId(),"Server","id",id); + return serverMapper.toDto(server); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public ServerDTO create(Server resources) { + return serverMapper.toDto(serverRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Server resources) { + Server server = serverRepository.findById(resources.getId()).orElseGet(Server::new); + ValidationUtil.isNull( server.getId(),"Server","id",resources.getId()); + server.copy(resources); + serverRepository.save(server); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (Integer id : ids) { + serverRepository.deleteById(id); + } + } + +} 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 index ec213473..96dd5fff 100644 --- 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 @@ -1,76 +1,69 @@ package co.yixiang.modules.monitor.service.impl; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.logging.service.mapper.LogMapper; import co.yixiang.modules.monitor.domain.Visits; -import co.yixiang.modules.monitor.service.VisitsService; -import co.yixiang.modules.monitor.service.mapper.VisitsMapper; -import co.yixiang.utils.StringUtils; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import lombok.extern.slf4j.Slf4j; +import co.yixiang.modules.monitor.repository.VisitsRepository; +import co.yixiang.modules.monitor.service.VisitsService; +import co.yixiang.repository.LogRepository; +import co.yixiang.utils.StringUtils; 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 hupeng + * @author Zheng Jie * @date 2018-12-13 */ @Slf4j @Service @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class VisitsServiceImpl extends BaseServiceImpl implements VisitsService { +public class VisitsServiceImpl implements VisitsService { + private final VisitsRepository visitsRepository; - private final LogMapper logMapper; + private final LogRepository logRepository; - private final VisitsMapper visitsMapper; - - public VisitsServiceImpl(LogMapper logMapper, VisitsMapper visitsMapper) { - this.logMapper = logMapper; - this.visitsMapper = visitsMapper; + public VisitsServiceImpl(VisitsRepository visitsRepository, LogRepository logRepository) { + this.visitsRepository = visitsRepository; + this.logRepository = logRepository; } - @Override public void save() { LocalDate localDate = LocalDate.now(); - Visits visits = this.getOne(new QueryWrapper().lambda() - .eq(Visits::getDate,localDate.toString())); + 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()); - this.save(visits); + visitsRepository.save(visits); } } @Override public void count(HttpServletRequest request) { LocalDate localDate = LocalDate.now(); - Visits visits = this.getOne(new QueryWrapper().lambda() - .eq(Visits::getDate,localDate.toString())); + Visits visits = visitsRepository.findByDate(localDate.toString()); visits.setPvCounts(visits.getPvCounts()+1); - long ipCounts = logMapper.findIp(localDate.toString(), localDate.plusDays(1).toString()); + long ipCounts = logRepository.findIp(localDate.toString(), localDate.plusDays(1).toString()); visits.setIpCounts(ipCounts); - this.save(visits); + visitsRepository.save(visits); } @Override public Object get() { Map map = new HashMap<>(4); LocalDate localDate = LocalDate.now(); - Visits visits = this.getOne(new QueryWrapper().lambda() - .eq(Visits::getDate,localDate.toString())); - List list = visitsMapper.findAllVisits(localDate.minusDays(6).toString(),localDate.plusDays(1).toString()); + 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) { @@ -87,11 +80,11 @@ public class VisitsServiceImpl extends BaseServiceImpl imp @Override public Object getChartData() { Map map = new HashMap<>(3); -// 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())); + 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/monitor/service/mapper/ServerMapper.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/mapper/ServerMapper.java new file mode 100644 index 00000000..63fe5047 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/mapper/ServerMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.monitor.service.mapper; + +import co.yixiang.modules.monitor.domain.Server; +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.monitor.service.dto.ServerDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zhang houying +* @date 2019-11-03 +*/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface ServerMapper extends BaseMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/mapper/VisitsMapper.java b/yshop-system/src/main/java/co/yixiang/modules/monitor/service/mapper/VisitsMapper.java deleted file mode 100644 index 9d8e304e..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/monitor/service/mapper/VisitsMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package co.yixiang.modules.monitor.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.monitor.domain.Visits; -import co.yixiang.modules.system.domain.Dept; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -@Mapper -public interface VisitsMapper extends CoreMapper { - @Select("select * FROM visits where create_time between #{time1} and #{time2}") - List findAllVisits(@Param("time1") String time1, @Param("time2")String time2); -} 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 index 018dda24..7da2d9f3 100644 --- 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 @@ -1,16 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.config; -import co.yixiang.modules.quartz.domain.QuartzJob; -import co.yixiang.modules.quartz.service.QuartzJobService; import co.yixiang.modules.quartz.utils.QuartzManage; +import co.yixiang.modules.quartz.domain.QuartzJob; +import co.yixiang.modules.quartz.repository.QuartzJobRepository; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.stereotype.Component; @@ -18,18 +10,18 @@ import org.springframework.stereotype.Component; import java.util.List; /** - * @author hupeng + * @author Zheng Jie * @date 2019-01-07 */ @Component public class JobRunner implements ApplicationRunner { - private final QuartzJobService quartzJobService; + private final QuartzJobRepository quartzJobRepository; private final QuartzManage quartzManage; - public JobRunner(QuartzJobService quartzJobService, QuartzManage quartzManage) { - this.quartzJobService = quartzJobService; + public JobRunner(QuartzJobRepository quartzJobRepository, QuartzManage quartzManage) { + this.quartzJobRepository = quartzJobRepository; this.quartzManage = quartzManage; } @@ -40,7 +32,7 @@ public class JobRunner implements ApplicationRunner { @Override public void run(ApplicationArguments applicationArguments){ System.out.println("--------------------注入定时任务---------------------"); - List quartzJobs = quartzJobService.findByIsPauseIsFalse(); + List quartzJobs = quartzJobRepository.findByIsPauseIsFalse(); quartzJobs.forEach(quartzManage::addJob); 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 index 41413851..4f0a1920 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.config; import org.quartz.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 index 710754f4..bbfd64bb 100644 --- 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 @@ -1,71 +1,66 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.domain; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; + +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; /** -* @author hupeng -* @date 2020-05-13 -*/ - -@Data -@TableName("quartz_job") -public class QuartzJob implements Serializable { + * @author Zheng Jie + * @date 2019-01-07 + */ +@Getter +@Setter +@Entity +@Table(name = "quartz_job") +public class QuartzJob implements Serializable { public static final String JOB_KEY = "JOB_KEY"; - /** 定时任务ID */ - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @NotNull(groups = {Update.class}) private Long id; - - /** Spring Bean名称 */ - private String beanName; - - - /** cron 表达式 */ - private String cronExpression; - - - /** 状态:1暂停、0启用 */ - private Boolean isPause; - - - /** 任务名称 */ + /** 定时器名称 */ + @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; - - /** 创建日期 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "create_time") + @CreationTimestamp private Timestamp createTime; - public void copy(QuartzJob source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} + 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 index 273d4c88..91b36cbf 100644 --- 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 @@ -1,74 +1,58 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.domain; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; + import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; import java.io.Serializable; +import java.sql.Timestamp; /** -* @author hupeng -* @date 2020-05-13 -*/ - + * @author Zheng Jie + * @date 2019-01-07 + */ +@Entity @Data -@TableName("quartz_log") +@Table(name = "quartz_log") public class QuartzLog implements Serializable { - /** 任务日志ID */ - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - - /** 任务名称 */ - private String baenName; - - - /** 创建时间 */ - @TableField(fill= FieldFill.INSERT) - private Timestamp createTime; - - - /** cron表达式 */ - private String cronExpression; - - - /** 异常详细 */ - private String exceptionDetail; - - - /** 状态 */ - private Boolean isSuccess; - - /** 任务名称 */ + @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; - - public void copy(QuartzLog source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } + /** 创建日期 */ + @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..39b8eacd --- /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 + */ + 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..44ac0588 --- /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 index 5002dc58..69e47862 100644 --- 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 @@ -1,24 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.rest; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.dozer.service.IGenerator; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.quartz.domain.QuartzJob; import co.yixiang.modules.quartz.service.QuartzJobService; -import co.yixiang.modules.quartz.service.QuartzLogService; -import co.yixiang.modules.quartz.service.dto.QuartzJobDto; -import co.yixiang.modules.quartz.service.dto.QuartzJobQueryCriteria; -import co.yixiang.modules.quartz.service.dto.QuartzLogDto; -import co.yixiang.modules.quartz.service.dto.QuartzLogQueryCriteria; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import co.yixiang.modules.quartz.service.dto.JobQueryCriteria; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -31,11 +18,10 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; +import java.util.Set; /** - * @author hupeng + * @author Zheng Jie * @date 2019-01-07 */ @Slf4j @@ -47,22 +33,16 @@ public class QuartzJobController { private static final String ENTITY_NAME = "quartzJob"; private final QuartzJobService quartzJobService; - private final IGenerator generator; - private final QuartzLogService quartzLogService; - - - public QuartzJobController(QuartzJobService quartzJobService, IGenerator generator, QuartzLogService quartzLogService) { + public QuartzJobController(QuartzJobService quartzJobService) { this.quartzJobService = quartzJobService; - this.generator = generator; - this.quartzLogService = quartzLogService; } @Log("查询定时任务") @ApiOperation("查询定时任务") @GetMapping @PreAuthorize("@el.check('admin','timing:list')") - public ResponseEntity getJobs(QuartzJobQueryCriteria criteria, Pageable pageable){ + public ResponseEntity getJobs(JobQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(quartzJobService.queryAll(criteria,pageable), HttpStatus.OK); } @@ -70,23 +50,23 @@ public class QuartzJobController { @ApiOperation("导出任务数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('admin','timing:list')") - public void download(HttpServletResponse response, QuartzJobQueryCriteria criteria) throws IOException { - quartzJobService.download(generator.convert(quartzJobService.queryAll(criteria),QuartzJobDto.class), response); + public void download(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { + quartzJobService.download(quartzJobService.queryAll(criteria), response); } @Log("导出日志数据") @ApiOperation("导出日志数据") @GetMapping(value = "/logs/download") @PreAuthorize("@el.check('admin','timing:list')") - public void downloadLog(HttpServletResponse response, QuartzLogQueryCriteria criteria) throws IOException { - quartzLogService.download(generator.convert(quartzLogService.queryAll(criteria), QuartzLogDto.class), response); + public void downloadLog(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { + quartzJobService.downloadLog(quartzJobService.queryAllLog(criteria), response); } @ApiOperation("查询任务执行日志") @GetMapping(value = "/logs") @PreAuthorize("@el.check('admin','timing:list')") - public ResponseEntity getJobLogs(QuartzLogQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(quartzLogService.queryAll(criteria,pageable), HttpStatus.OK); + public ResponseEntity getJobLogs(JobQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity<>(quartzJobService.queryAllLog(criteria,pageable), HttpStatus.OK); } @Log("新增定时任务") @@ -98,16 +78,16 @@ public class QuartzJobController { if (resources.getId() != null) { throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); } - return new ResponseEntity<>(quartzJobService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(quartzJobService.create(resources),HttpStatus.CREATED); } @Log("修改定时任务") @ApiOperation("修改定时任务") @PutMapping @PreAuthorize("@el.check('admin','timing:edit')") - public ResponseEntity update(@Validated @RequestBody QuartzJob resources){ + public ResponseEntity update(@Validated(QuartzJob.Update.class) @RequestBody QuartzJob resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - quartzJobService.saveOrUpdate(resources); + quartzJobService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -117,7 +97,7 @@ public class QuartzJobController { @PreAuthorize("@el.check('admin','timing:edit')") public ResponseEntity updateIsPause(@PathVariable Long id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - quartzJobService.updateIsPause(quartzJobService.getOne(new QueryWrapper().eq("uid",id))); + quartzJobService.updateIsPause(quartzJobService.findById(id)); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -127,7 +107,7 @@ public class QuartzJobController { @PreAuthorize("@el.check('admin','timing:edit')") public ResponseEntity execution(@PathVariable Long id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - quartzJobService.execution(quartzJobService.getOne(new QueryWrapper().eq("id",id))); + quartzJobService.execution(quartzJobService.findById(id)); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -135,9 +115,9 @@ public class QuartzJobController { @ApiOperation("删除定时任务") @DeleteMapping @PreAuthorize("@el.check('admin','timing:del')") - public ResponseEntity delete(@RequestBody Integer[] ids){ + public ResponseEntity delete(@RequestBody Set ids){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - quartzJobService.removeByIds(new ArrayList<>(Arrays.asList(ids))); + quartzJobService.delete(ids); 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 index 2951d1b7..29ed4bba 100644 --- 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 @@ -1,51 +1,76 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.quartz.domain.QuartzJob; -import co.yixiang.modules.quartz.service.dto.QuartzJobDto; -import co.yixiang.modules.quartz.service.dto.QuartzJobQueryCriteria; +import co.yixiang.modules.quartz.domain.QuartzLog; +import co.yixiang.modules.quartz.service.dto.JobQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; + import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; /** -* @author hupeng -* @date 2020-05-13 -*/ -public interface QuartzJobService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(QuartzJobQueryCriteria criteria, Pageable pageable); + * @author Zheng Jie + * @date 2019-01-07 + */ +public interface QuartzJobService { /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(QuartzJobQueryCriteria criteria); + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ + Object queryAll(JobQueryCriteria criteria, Pageable pageable); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 查询全部 + * @param criteria 条件 + * @return / + */ + List queryAll(JobQueryCriteria criteria); + /** + * 分页查询日志 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ + Object queryAllLog(JobQueryCriteria criteria, Pageable pageable); + + /** + * 查询全部 + * @param criteria 条件 + * @return / + */ + List queryAllLog(JobQueryCriteria criteria); + + /** + * 创建 + * @param resources / + * @return / + */ + QuartzJob create(QuartzJob resources); + + /** + * 编辑 + * @param resources / + */ + void update(QuartzJob resources); + + /** + * 删除任务 + * @param ids / + */ + void delete(Set ids); + + /** + * 根据ID查询 + * @param id ID + * @return / + */ + QuartzJob findById(Long id); /** * 更改定时任务状态 @@ -60,8 +85,18 @@ public interface QuartzJobService extends BaseService{ void execution(QuartzJob quartzJob); /** - * 查询启用的任务 - * @return List + * 导出定时任务 + * @param queryAll 待导出的数据 + * @param response / + * @throws IOException / */ - List findByIsPauseIsFalse(); + void download(List queryAll, HttpServletResponse response) throws IOException; + + /** + * 导出定时任务日志 + * @param queryAllLog 待导出的数据 + * @param response / + * @throws IOException / + */ + void downloadLog(List queryAllLog, HttpServletResponse response) throws IOException; } diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/QuartzLogService.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/QuartzLogService.java deleted file mode 100644 index bb283d5a..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/QuartzLogService.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.quartz.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.quartz.domain.QuartzLog; -import co.yixiang.modules.quartz.service.dto.QuartzLogDto; -import co.yixiang.modules.quartz.service.dto.QuartzLogQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -public interface QuartzLogService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(QuartzLogQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(QuartzLogQueryCriteria criteria); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} 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..5783d48b --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/JobQueryCriteria.java @@ -0,0 +1,24 @@ +package co.yixiang.modules.quartz.service.dto; + +import co.yixiang.annotation.Query; +import lombok.Data; + +import java.sql.Timestamp; +import java.util.List; + +/** + * @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; + + @Query(type = Query.Type.BETWEEN) + private List createTime; +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzJobDto.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzJobDto.java deleted file mode 100644 index 68f8beab..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzJobDto.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.quartz.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Data -public class QuartzJobDto implements Serializable { - - /** 定时任务ID */ - private Long id; - - /** Bean名称 */ - private String beanName; - - /** cron 表达式 */ - private String cronExpression; - - /** 状态:1暂停、0启用 */ - private Boolean isPause; - - /** 任务名称 */ - private String jobName; - - /** 方法名称 */ - private String methodName; - - /** 参数 */ - private String params; - - /** 备注 */ - private String remark; - - /** 创建日期 */ - private Timestamp createTime; - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzJobQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzJobQueryCriteria.java deleted file mode 100644 index ea91a25b..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzJobQueryCriteria.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.quartz.service.dto; - -import lombok.Data; - -import java.sql.Timestamp; -import java.util.List; -import co.yixiang.annotation.Query; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Data -public class QuartzJobQueryCriteria{ - - @Query(type = Query.Type.INNER_LIKE) - private String jobName; - - @Query - private Boolean isSuccess; - - @Query - private Boolean isPause; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzLogDto.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzLogDto.java deleted file mode 100644 index 86658dbb..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzLogDto.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.quartz.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Data -public class QuartzLogDto implements Serializable { - - /** 定时任务名称 */ - private String baenName; - - /** Bean名称 */ - private Timestamp createTime; - - /** cron表达式 */ - private String cronExpression; - - /** 异常详细 */ - private String exceptionDetail; - - /** 状态 */ - private Boolean isSuccess; - - /** 任务名称 */ - private String jobName; - - /** 方法名称 */ - private String methodName; - - /** 参数 */ - private String params; - - /** 耗时(毫秒) */ - private Long time; -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzLogQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzLogQueryCriteria.java deleted file mode 100644 index 53b8a8f2..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/dto/QuartzLogQueryCriteria.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.quartz.service.dto; - -import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Data -public class QuartzLogQueryCriteria{ -} 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 index 4003e865..adf5a7f5 100644 --- 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 @@ -1,113 +1,108 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.service.impl; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.quartz.domain.QuartzJob; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.modules.quartz.utils.QuartzManage; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.quartz.domain.QuartzLog; import co.yixiang.modules.quartz.service.QuartzJobService; -import co.yixiang.modules.quartz.service.dto.QuartzJobDto; -import co.yixiang.modules.quartz.service.dto.QuartzJobQueryCriteria; -import co.yixiang.modules.quartz.service.mapper.QuartzJobMapper; +import co.yixiang.modules.quartz.service.dto.JobQueryCriteria; +import co.yixiang.modules.quartz.utils.QuartzManage; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.quartz.repository.QuartzJobRepository; +import co.yixiang.modules.quartz.repository.QuartzLogRepository; +import org.quartz.CronExpression; +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.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//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.Map; -import java.io.IOException; + import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.io.IOException; +import java.util.*; /** -* @author hupeng -* @date 2020-05-13 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "quartzJob") + * @author Zheng Jie + * @date 2019-01-07 + */ +@Service(value = "quartzJobService") +@CacheConfig(cacheNames = "quartzJob") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class QuartzJobServiceImpl extends BaseServiceImpl implements QuartzJobService { +public class QuartzJobServiceImpl implements QuartzJobService { + + private final QuartzJobRepository quartzJobRepository; + + private final QuartzLogRepository quartzLogRepository; - private final IGenerator generator; private final QuartzManage quartzManage; - @Override - //@Cacheable - public Map queryAll(QuartzJobQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), QuartzJobDto.class)); - map.put("totalElements", page.getTotal()); - return map; + public QuartzJobServiceImpl(QuartzJobRepository quartzJobRepository, QuartzLogRepository quartzLogRepository, QuartzManage quartzManage) { + this.quartzJobRepository = quartzJobRepository; + this.quartzLogRepository = quartzLogRepository; + this.quartzManage = quartzManage; } - @Override - //@Cacheable - public List queryAll(QuartzJobQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(QuartzJob.class, criteria)); + @Cacheable + 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 void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (QuartzJobDto quartzJob : all) { - Map map = new LinkedHashMap<>(); - map.put("Spring Bean名称", quartzJob.getBeanName()); - map.put("cron 表达式", quartzJob.getCronExpression()); - map.put("状态:1暂停、0启用", quartzJob.getIsPause()); - map.put("任务名称", quartzJob.getJobName()); - map.put("方法名称", quartzJob.getMethodName()); - map.put("参数", quartzJob.getParams()); - map.put("备注", quartzJob.getRemark()); - map.put("创建日期", quartzJob.getCreateTime()); - map.put("Spring Bean名称", quartzJob.getBeanName()); - map.put("cron 表达式", quartzJob.getCronExpression()); - map.put("状态:1暂停、0启用", quartzJob.getIsPause()); - map.put("任务名称", quartzJob.getJobName()); - map.put("方法名称", quartzJob.getMethodName()); - map.put("参数", quartzJob.getParams()); - map.put("备注", quartzJob.getRemark()); - map.put("创建日期", quartzJob.getCreateTime()); - map.put("Spring Bean名称", quartzJob.getBeanName()); - map.put("cron 表达式", quartzJob.getCronExpression()); - map.put("状态:1暂停、0启用", quartzJob.getIsPause()); - map.put("任务名称", quartzJob.getJobName()); - map.put("方法名称", quartzJob.getMethodName()); - map.put("参数", quartzJob.getParams()); - map.put("备注", quartzJob.getRemark()); - map.put("创建日期", quartzJob.getCreateTime()); - list.add(map); + public List queryAll(JobQueryCriteria criteria) { + return quartzJobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); + } + + @Override + public List queryAllLog(JobQueryCriteria criteria) { + return quartzLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); + } + + @Override + @Cacheable(key = "#p0") + public QuartzJob findById(Long id) { + QuartzJob quartzJob = quartzJobRepository.findById(id).orElseGet(QuartzJob::new); + ValidationUtil.isNull(quartzJob.getId(),"QuartzJob","id",id); + return quartzJob; + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public QuartzJob create(QuartzJob resources) { + if (!CronExpression.isValidExpression(resources.getCronExpression())){ + throw new BadRequestException("cron表达式格式错误"); } - FileUtil.downloadExcel(list, response); + resources = quartzJobRepository.save(resources); + quartzManage.addJob(resources); + return resources; } - /** - * 更改定时任务状态 - * - * @param quartzJob / - */ @Override + @CacheEvict(allEntries = true) + @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 + @CacheEvict(allEntries = true) public void updateIsPause(QuartzJob quartzJob) { if(quartzJob.getId().equals(1L)){ throw new BadRequestException("该任务不可操作"); @@ -119,14 +114,9 @@ public class QuartzJobServiceImpl extends BaseServiceImpl findByIsPauseIsFalse() { - QuartzJobQueryCriteria criteria = new QuartzJobQueryCriteria(); - criteria.setIsPause(false); - return baseMapper.selectList(QueryHelpPlus.getPredicate(QuartzJob.class, criteria)); + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (Long id : ids) { + if(id.equals(1L)){ + throw new BadRequestException("更新访客记录不可删除,你可以在后台代码中取消该限制"); + } + QuartzJob quartzJob = findById(id); + quartzManage.deleteJob(quartzJob); + quartzJobRepository.delete(quartzJob); + } + } + + @Override + public void download(List quartzJobs, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (QuartzJob quartzJob : quartzJobs) { + Map map = new LinkedHashMap<>(); + map.put("任务名称", quartzJob.getJobName()); + map.put("Bean名称", quartzJob.getBeanName()); + map.put("执行方法", quartzJob.getMethodName()); + map.put("参数", quartzJob.getParams()); + map.put("表达式", quartzJob.getCronExpression()); + map.put("状态", quartzJob.getIsPause() ? "暂停中" : "运行中"); + map.put("描述", quartzJob.getRemark()); + map.put("创建日期", quartzJob.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } + + @Override + public void downloadLog(List queryAllLog, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (QuartzLog quartzLog : queryAllLog) { + Map map = new LinkedHashMap<>(); + map.put("任务名称", quartzLog.getJobName()); + map.put("Bean名称", quartzLog.getBeanName()); + map.put("执行方法", quartzLog.getMethodName()); + map.put("参数", quartzLog.getParams()); + map.put("表达式", quartzLog.getCronExpression()); + map.put("异常详情", quartzLog.getExceptionDetail()); + map.put("耗时/毫秒", quartzLog.getTime()); + map.put("状态", quartzLog.getIsSuccess() ? "成功" : "失败"); + map.put("创建日期", quartzLog.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); } } diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/impl/QuartzLogServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/impl/QuartzLogServiceImpl.java deleted file mode 100644 index 6c64cb00..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/impl/QuartzLogServiceImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.quartz.service.impl; - -import co.yixiang.modules.quartz.domain.QuartzLog; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; -import co.yixiang.modules.quartz.service.QuartzLogService; -import co.yixiang.modules.quartz.service.dto.QuartzLogDto; -import co.yixiang.modules.quartz.service.dto.QuartzLogQueryCriteria; -import co.yixiang.modules.quartz.service.mapper.QuartzLogMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//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.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "quartzLog") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class QuartzLogServiceImpl extends BaseServiceImpl implements QuartzLogService { - - private final IGenerator generator; - - @Override - //@Cacheable - public Map queryAll(QuartzLogQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), QuartzLogDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } - - - @Override - //@Cacheable - public List queryAll(QuartzLogQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(QuartzLog.class, criteria)); - } - - /** - * 导出数据 - * - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (QuartzLogDto quartzLog : all) { - Map map = new LinkedHashMap<>(); - map.put(" baenName", quartzLog.getBaenName()); - map.put(" createTime", quartzLog.getCreateTime()); - map.put(" cronExpression", quartzLog.getCronExpression()); - map.put(" exceptionDetail", quartzLog.getExceptionDetail()); - map.put(" isSuccess", quartzLog.getIsSuccess()); - map.put(" jobName", quartzLog.getJobName()); - map.put(" methodName", quartzLog.getMethodName()); - map.put(" params", quartzLog.getParams()); - map.put(" time", quartzLog.getTime()); - map.put("任务名称", quartzLog.getBaenName()); - map.put("Bean名称 ", quartzLog.getCreateTime()); - map.put("cron表达式", quartzLog.getCronExpression()); - map.put("异常详细 ", quartzLog.getExceptionDetail()); - map.put("状态", quartzLog.getIsSuccess()); - map.put("任务名称", quartzLog.getJobName()); - map.put("方法名称", quartzLog.getMethodName()); - map.put("参数", quartzLog.getParams()); - map.put("耗时(毫秒)", quartzLog.getTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/mapper/QuartzJobMapper.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/mapper/QuartzJobMapper.java deleted file mode 100644 index ca4e8dc0..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/mapper/QuartzJobMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.quartz.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.quartz.domain.QuartzJob; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Repository -@Mapper -public interface QuartzJobMapper extends CoreMapper { - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/mapper/QuartzLogMapper.java b/yshop-system/src/main/java/co/yixiang/modules/quartz/service/mapper/QuartzLogMapper.java deleted file mode 100644 index 69aafd9e..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/quartz/service/mapper/QuartzLogMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.quartz.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.quartz.domain.QuartzLog; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-13 -*/ -@Repository -@Mapper -public interface QuartzLogMapper extends CoreMapper { - -} 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 index 61eec4d8..3c485440 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.task; import lombok.extern.slf4j.Slf4j; @@ -13,7 +5,7 @@ import org.springframework.stereotype.Component; /** * 测试用 - * @author hupeng + * @author Zheng Jie * @date 2019-01-08 */ @Slf4j 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..52a3a424 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/quartz/task/VisitsTask.java @@ -0,0 +1,22 @@ +package co.yixiang.modules.quartz.task; + +import co.yixiang.modules.monitor.service.VisitsService; +import org.springframework.stereotype.Component; + +/** + * @author Zheng Jie + * @date 2018-12-25 + */ +@Component +public class VisitsTask { + + private final VisitsService visitsService; + + public VisitsTask(VisitsService visitsService) { + this.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 index dbf89833..37949f35 100644 --- 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 @@ -1,19 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.utils; import co.yixiang.config.thread.ThreadPoolExecutorUtil; -import co.yixiang.modules.quartz.domain.QuartzJob; -import co.yixiang.modules.quartz.service.QuartzLogService; import co.yixiang.utils.SpringContextHolder; import co.yixiang.utils.ThrowableUtil; +import co.yixiang.modules.quartz.domain.QuartzJob; import co.yixiang.modules.quartz.domain.QuartzLog; +import co.yixiang.modules.quartz.repository.QuartzLogRepository; import co.yixiang.modules.quartz.service.QuartzJobService; import org.quartz.JobExecutionContext; import org.slf4j.Logger; @@ -40,12 +32,12 @@ public class ExecutionJob extends QuartzJobBean { protected void executeInternal(JobExecutionContext context) { QuartzJob quartzJob = (QuartzJob) context.getMergedJobDataMap().get(QuartzJob.JOB_KEY); // 获取spring bean - QuartzLogService quartzLogService = SpringContextHolder.getBean(QuartzLogService.class); + QuartzLogRepository quartzLogRepository = SpringContextHolder.getBean(QuartzLogRepository.class); QuartzJobService quartzJobService = SpringContextHolder.getBean(QuartzJobService.class); QuartzLog log = new QuartzLog(); log.setJobName(quartzJob.getJobName()); - log.setBaenName(quartzJob.getBeanName()); + log.setBeanName(quartzJob.getBeanName()); log.setMethodName(quartzJob.getMethodName()); log.setParams(quartzJob.getParams()); long startTime = System.currentTimeMillis(); @@ -73,7 +65,7 @@ public class ExecutionJob extends QuartzJobBean { //更新状态 quartzJobService.updateIsPause(quartzJob); } finally { - quartzLogService.save(log); + 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 index 995fc20a..43b692b4 100644 --- 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 @@ -1,16 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.utils; import co.yixiang.exception.BadRequestException; -import co.yixiang.modules.quartz.domain.QuartzJob; import lombok.extern.slf4j.Slf4j; +import co.yixiang.modules.quartz.domain.QuartzJob; import org.quartz.*; import org.quartz.impl.triggers.CronTriggerImpl; import org.springframework.stereotype.Component; @@ -19,7 +11,7 @@ import java.util.Date; import static org.quartz.TriggerBuilder.newTrigger; /** - * @author hupeng + * @author Zheng Jie * @date 2019-01-07 */ @Slf4j 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 index b18ffcba..5afd752c 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.quartz.utils; import co.yixiang.utils.SpringContextHolder; 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 index c7b1007e..74fcb6bb 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.config; import co.yixiang.annotation.AnonymousAccess; @@ -36,7 +28,7 @@ import java.util.Map; import java.util.Set; /** - * @author hupeng + * @author Zheng Jie */ @Configuration @EnableWebSecurity @@ -117,9 +109,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/swagger-resources/**").permitAll() .antMatchers("/webjars/**").permitAll() .antMatchers("/*/api-docs").permitAll() - .antMatchers("/v2/api-docs-ext").permitAll() - //.antMatchers("/api/wxmp/**").permitAll() - // 文件 .antMatchers("/avatar/**").permitAll() .antMatchers("/file/**").permitAll() diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/config/SecurityProperties.java b/yshop-system/src/main/java/co/yixiang/modules/security/config/SecurityProperties.java index 36ed4eed..0b34cf8f 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/config/SecurityProperties.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/config/SecurityProperties.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.config; import lombok.Data; @@ -15,7 +7,7 @@ import org.springframework.stereotype.Component; /** * Jwt参数配置 - * @author hupeng + * @author Zheng Jie * @date 2019年11月28日 */ @Data diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/rest/AuthController.java b/yshop-system/src/main/java/co/yixiang/modules/security/rest/AuthController.java index 3de5a415..5be70ee0 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/rest/AuthController.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/rest/AuthController.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.rest; import cn.hutool.core.util.IdUtil; @@ -16,7 +8,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import co.yixiang.annotation.AnonymousAccess; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.security.config.SecurityProperties; import co.yixiang.modules.security.security.TokenProvider; @@ -42,7 +34,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-23 * 授权、根据token获取用户详细信息 */ @@ -130,12 +122,7 @@ public class AuthController { // 几位数运算,默认是两位 captcha.setLen(2); // 获取运算的结果 - String result =""; - try { - result = new Double(Double.parseDouble(captcha.text())).intValue()+""; - }catch (Exception e){ - result = captcha.text(); - } + String result = captcha.text(); String uuid = properties.getCodeKey() + IdUtil.simpleUUID(); // 保存 redisUtils.set(uuid, result, expiration, TimeUnit.MINUTES); diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/rest/OnlineController.java b/yshop-system/src/main/java/co/yixiang/modules/security/rest/OnlineController.java index 24dfdca5..9a227c6c 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/rest/OnlineController.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/rest/OnlineController.java @@ -1,14 +1,8 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; +import co.yixiang.exception.BadRequestException; import co.yixiang.modules.security.service.OnlineUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -23,7 +17,7 @@ import java.io.IOException; import java.util.Set; /** - * @author hupeng + * @author Zheng Jie */ @RestController @RequestMapping("/auth/online") diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAccessDeniedHandler.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAccessDeniedHandler.java index 380d13d4..619d93d4 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAccessDeniedHandler.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/JwtAccessDeniedHandler.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.security; import org.springframework.security.access.AccessDeniedException; @@ -17,7 +9,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** - * @author hupeng + * @author Zheng Jie */ @Component public class JwtAccessDeniedHandler implements AccessDeniedHandler { 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 index 67c73e85..3ec24972 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.security; import org.springframework.security.core.AuthenticationException; @@ -17,7 +9,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** - * @author hupeng + * @author Zheng Jie */ @Component public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenConfigurer.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenConfigurer.java index 559e3b2c..cb493db9 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenConfigurer.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenConfigurer.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.security; import org.springframework.security.config.annotation.SecurityConfigurerAdapter; diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenFilter.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenFilter.java index bfb9d786..2e5d3200 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenFilter.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenFilter.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.security; import co.yixiang.modules.security.config.SecurityProperties; diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenProvider.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenProvider.java index 54eeae66..9cfe3ab0 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenProvider.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/TokenProvider.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.security; import io.jsonwebtoken.*; diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/AuthUser.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/AuthUser.java index 36a014e2..904c02fd 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/AuthUser.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/AuthUser.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.security.vo; import lombok.Getter; @@ -14,7 +6,7 @@ import lombok.Setter; import javax.validation.constraints.NotBlank; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-30 */ @Getter diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/JwtUser.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/JwtUser.java index 180f9f79..5d0a2a2b 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/JwtUser.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/JwtUser.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.security.vo; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -19,7 +11,7 @@ import java.util.Date; import java.util.stream.Collectors; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-23 */ @Getter diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/OnlineUser.java b/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/OnlineUser.java index 3dbb6e61..977c4184 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/OnlineUser.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/security/vo/OnlineUser.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.security.vo; import lombok.AllArgsConstructor; @@ -15,7 +7,7 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * @author hupeng + * @author Zheng Jie */ @Data @AllArgsConstructor diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/service/OnlineUserService.java b/yshop-system/src/main/java/co/yixiang/modules/security/service/OnlineUserService.java index 5434e1dd..a2b40037 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/service/OnlineUserService.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/service/OnlineUserService.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.service; import co.yixiang.modules.security.config.SecurityProperties; @@ -22,7 +14,7 @@ import java.io.IOException; import java.util.*; /** - * @author hupeng + * @author Zheng Jie * @Date 2019年10月26日21:56:27 */ @Service diff --git a/yshop-system/src/main/java/co/yixiang/modules/security/service/UserDetailsServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/security/service/UserDetailsServiceImpl.java index ba153a79..77c69762 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/security/service/UserDetailsServiceImpl.java +++ b/yshop-system/src/main/java/co/yixiang/modules/security/service/UserDetailsServiceImpl.java @@ -1,20 +1,12 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.security.service; 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.DeptSmallDTO; +import co.yixiang.modules.system.service.dto.JobSmallDTO; +import co.yixiang.modules.system.service.dto.UserDTO; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.security.security.vo.JwtUser; import co.yixiang.modules.system.service.RoleService; -import co.yixiang.modules.system.service.dto.UserDto; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.stereotype.Service; @@ -23,7 +15,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Optional; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-22 */ @Service("userDetailsService") @@ -41,7 +33,7 @@ public class UserDetailsServiceImpl implements UserDetailsService { @Override public UserDetails loadUserByUsername(String username){ - UserDto user = userService.findByName(username); + UserDTO user = userService.findByName(username); if (user == null) { throw new BadRequestException("账号不存在"); } else { @@ -52,7 +44,7 @@ public class UserDetailsServiceImpl implements UserDetailsService { } } - private UserDetails createJwtUser(UserDto user) { + private UserDetails createJwtUser(UserDTO user) { return new JwtUser( user.getId(), user.getUsername(), @@ -62,8 +54,8 @@ public class UserDetailsServiceImpl implements UserDetailsService { user.getAvatar(), user.getEmail(), user.getPhone(), - Optional.ofNullable(user.getDept()).map(DeptSmallDto::getName).orElse(null), - Optional.ofNullable(user.getJob()).map(JobSmallDto::getName).orElse(null), + Optional.ofNullable(user.getDept()).map(DeptSmallDTO::getName).orElse(null), + Optional.ofNullable(user.getJob()).map(JobSmallDTO::getName).orElse(null), roleService.mapToGrantedAuthorities(user), user.getEnabled(), user.getCreateTime(), 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 index a844ad8e..5563aece 100644 --- 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 @@ -1,53 +1,69 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; + +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 hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-25 */ -@Data -@TableName("dept") +@Entity +@Getter +@Setter +@Table(name="dept") public class Dept implements Serializable { - /** ID */ - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + @NotNull(groups = Update.class) private Long id; - - /** 名称 */ + @Column(name = "name",nullable = false) + @NotBlank private String name; - - /** 上级部门 */ - private Long pid; - - - /** 状态 */ + @NotNull private Boolean enabled; + @Column(name = "pid",nullable = false) + @NotNull + private Long pid; - /** 创建日期 */ - @TableField(fill= FieldFill.INSERT) + @JsonIgnore + @ManyToMany(mappedBy = "depts") + private Set roles; + + @Column(name = "create_time") + @CreationTimestamp private Timestamp createTime; + public @interface Update {} - public void copy(Dept source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dept dept = (Dept) o; + return Objects.equals(id, dept.id) && + Objects.equals(name, dept.name); } -} + + @Override + public int hashCode() { + return Objects.hash(id, name); + } +} \ 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 index f6b4a23c..00484616 100644 --- 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 @@ -1,49 +1,44 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; + +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.List; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ -@Data -@TableName("dict") +@Entity +@Getter +@Setter +@Table(name="dict") public class Dict implements Serializable { - /** 字典ID */ - @TableId + @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; - - /** 创建日期 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "create_time") + @CreationTimestamp private Timestamp createTime; + @OneToMany(mappedBy = "dict",cascade={CascadeType.PERSIST,CascadeType.REMOVE}) + private List dictDetails; - public void copy(Dict source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} + 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 index 0b1af75f..6ad235a7 100644 --- 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 @@ -1,57 +1,48 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; + +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.sql.Timestamp; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ -@Data -@TableName("dict_detail") +@Entity +@Getter +@Setter +@Table(name="dict_detail") public class DictDetail implements Serializable { - /** 字典详细 */ - @TableId + @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; - /** 排序 */ - private String sort; + @Column(name = "sort") + private String sort = "999"; + @ManyToOne(fetch=FetchType.LAZY) + @JoinColumn(name = "dict_id") + private Dict dict; - /** 字典id */ - private Long dictId; - - - /** 创建日期 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "create_time") + @CreationTimestamp private Timestamp createTime; - - public void copy(DictDetail source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} + 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 index edc20c62..ed854f03 100644 --- 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 @@ -1,58 +1,51 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; + +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.sql.Timestamp; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-29 */ -@Data -@TableName("job") +@Entity +@Getter +@Setter +@Table(name="job") public class Job implements Serializable { - /** 岗位ID */ - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + @NotNull(groups = Update.class) private Long id; - /** 岗位名称 */ + @Column(name = "name",nullable = false) + @NotBlank private String name; - - /** 岗位状态 */ - private Boolean enabled; - - @TableField(exist = false) - private Dept dept; - - /** 岗位排序 */ + @Column(unique = true) + @NotNull private Long sort; + @Column(name = "enabled",nullable = false) + @NotNull + private Boolean enabled; - /** 部门ID */ - private Long deptId; + @OneToOne + @JoinColumn(name = "dept_id") + private Dept dept; - - /** 创建日期 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "create_time") + @CreationTimestamp private Timestamp createTime; - - public void copy(Job source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} + 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 index 784f9953..2a9421e2 100644 --- 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 @@ -1,92 +1,94 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.validation.constraints.*; -import java.sql.Timestamp; + +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 hupeng -* @date 2020-05-14 -*/ -@Data -@TableName("menu") + * @author Zheng Jie + * @date 2018-12-17 + */ +@Entity +@Getter +@Setter +@Table(name = "menu") public class Menu implements Serializable { - /** ID */ - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @NotNull(groups = {Update.class}) private Long id; - - /** 是否外链 */ - private Boolean iFrame; - - - /** 菜单名称 */ + @NotBlank private String name; + @Column(unique = true) + private Long sort = 999L; - /** 组件 */ - private String component; - - - /** 上级菜单ID */ - @NotNull - private Long pid; - - - /** 排序 */ - @NotNull - private Long sort; - - - /** 图标 */ - private String icon; - - - /** 链接地址 */ + @Column(name = "path") private String path; - - /** 缓存 */ - private Boolean cache; - - - /** 是否隐藏 */ - private Boolean hidden; - - - /** 组件名称 */ - private String componentName; - - - /** 创建日期 */ - @TableField(fill= FieldFill.INSERT) - private Timestamp createTime; - - - /** 权限 */ - private String permission; - + private String component; /** 类型,目录、菜单、按钮 */ + @Column(name = "type") private Integer type; + /** 权限 */ + @Column(name = "permission") + private String permission; - public void copy(Menu source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + @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; + + @Column(name = "create_time") + @CreationTimestamp + 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/Role.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/Role.java index 1d63e760..44cf4844 100644 --- 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 @@ -1,68 +1,84 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.validation.constraints.*; -import java.sql.Timestamp; + +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 hupeng -* @date 2020-05-14 -*/ -@Data -@TableName("role") + * 角色 + * @author Zheng Jie + * @date 2018-11-22 + */ +@Entity +@Table(name = "role") +@Getter +@Setter public class Role implements Serializable { - /** ID */ - @TableId + @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; - - /** 数据权限 */ - private String dataScope; - - - /** 角色级别 */ - private Integer level; - - @TableField(exist = false) - private Set menus; - - @TableField(exist = false) - private Set depts; - - /** 创建日期 */ - @TableField(fill= FieldFill.INSERT) - private Timestamp createTime; - - - /** 功能权限 */ + /** 权限 */ + @Column(name = "permission") private String permission; + @JsonIgnore + @ManyToMany(mappedBy = "roles") + private Set users; - public void copy(Role source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + @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; + + @Column(name = "create_time") + @CreationTimestamp + 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; + } + Role role = (Role) o; + return Objects.equals(id, role.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); } } diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/RolesDepts.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/RolesDepts.java deleted file mode 100644 index 7b5ba95f..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/domain/RolesDepts.java +++ /dev/null @@ -1,34 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.domain; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Data -@TableName("roles_depts") -public class RolesDepts implements Serializable { - - /** 角色ID */ - private Long roleId; - - /** 部门ID */ - private Long deptId; - - - public void copy(RolesDepts source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/RolesMenus.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/RolesMenus.java deleted file mode 100644 index 2afce733..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/domain/RolesMenus.java +++ /dev/null @@ -1,34 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.domain; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Data -@TableName("roles_menus") -public class RolesMenus implements Serializable { - - /** 菜单ID */ - private Long menuId; - - - /** 角色ID */ - private Long roleId; - - public void copy(RolesMenus source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} 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 index 3cdf69a4..bb95c1df 100644 --- 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 @@ -1,102 +1,96 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; +import javax.persistence.*; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; +import java.util.Objects; import java.util.Set; /** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -@TableName("user") + * @author Zheng Jie + * @date 2018-11-22 + */ +@Entity +@Getter +@Setter +@Table(name="user") public class User implements Serializable { - /** 系统用户ID */ - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @NotNull(groups = Update.class) private Long id; - - /** 头像 */ - private Long avatarId; - - - /** 邮箱 */ - private String email; - - - /** 状态:1启用、0禁用 */ - private Boolean enabled; - - /** 用户头像 */ - @TableField(exist = false) - private UserAvatar userAvatar; - - /** 用户角色 */ - @TableField(exist = false) - private Set roles; - - /** 用户职位*/ - @TableField(exist = false) - private Job job; - - /** 用户部门*/ - @TableField(exist = false) - private Dept dept; - - /** 密码 */ - private String password; - - - /** 用户名 */ + @NotBlank + @Column(unique = true) private String username; - - /** 部门名称 */ - private Long deptId; - - - /** 手机号码 */ - private String phone; - - - /** 岗位名称 */ - private Long jobId; - - - /** 创建日期 */ - @TableField(fill= FieldFill.INSERT) - private Timestamp createTime; - - - /** 最后修改密码的日期 */ - private Timestamp lastPasswordResetTime; - - - /** 昵称 */ + /** 用户昵称 */ + @NotBlank private String nickName; - /** 性别 */ private String sex; + @OneToOne + @JoinColumn(name = "avatar_id") + private UserAvatar userAvatar; - public void copy(User source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + @NotBlank + @Email + private String email; + + @NotBlank + private String phone; + + @NotNull + private Boolean enabled; + + private String password; + + @Column(name = "create_time") + @CreationTimestamp + 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; + + public @interface Update {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username); } -} + + @Override + public int hashCode() { + return Objects.hash(id, username); + } +} \ 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 index 7b249364..114f57f7 100644 --- 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 @@ -1,49 +1,38 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.domain; + import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.sql.Timestamp; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; + +import javax.persistence.*; import java.io.Serializable; +import java.sql.Timestamp; /** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -@TableName("user_avatar") + * @author Zheng Jie + * @date 2019年9月7日 16:16:59 + */ +@Entity +@Getter +@Setter +@NoArgsConstructor +@Table(name = "user_avatar") public class UserAvatar implements Serializable { - @TableId + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - - /** 真实文件名 */ private String realName; - - /** 路径 */ private String path; - - /** 大小 */ private String size; - - /** 创建时间 */ - @TableField(fill= FieldFill.INSERT) + @Column(name = "create_time") + @CreationTimestamp private Timestamp createTime; public UserAvatar(UserAvatar userAvatar,String realName, String path, String size) { @@ -52,9 +41,4 @@ public class UserAvatar implements Serializable { this.path = path; this.size = size; } - - - public void copy(UserAvatar source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } } diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/domain/UsersRoles.java b/yshop-system/src/main/java/co/yixiang/modules/system/domain/UsersRoles.java deleted file mode 100644 index 1924cc95..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/domain/UsersRoles.java +++ /dev/null @@ -1,34 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.domain; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Data -@TableName("users_roles") -public class UsersRoles implements Serializable { - - /** 用户ID */ - private Long userId; - - - /** 角色ID */ - private Long roleId; - - public void copy(UsersRoles source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} 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 index 7a4b438f..71027856 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.domain.vo; import lombok.AllArgsConstructor; @@ -13,7 +5,7 @@ import lombok.Data; import java.io.Serializable; /** - * @author hupeng + * @author Zheng Jie * @date 2018-12-20 */ @Data 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 index 4086b9a8..95031514 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.domain.vo; import com.fasterxml.jackson.annotation.JsonInclude; @@ -16,7 +8,7 @@ import java.util.List; /** * 构建前端路由时用到 - * @author hupeng + * @author Zheng Jie * @date 2018-12-20 */ @Data 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 index 58494389..035caac4 100644 --- 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 @@ -1,18 +1,10 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.domain.vo; import lombok.Data; /** * 修改密码的 Vo 类 - * @author hupeng + * @author Zheng Jie * @date 2019年7月11日13:59:49 */ @Data 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..c6c07c0b --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/DeptRepository.java @@ -0,0 +1,38 @@ +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 +*/ +@SuppressWarnings("all") +public interface DeptRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * 根据 PID 查询 + * @param id pid + * @return / + */ + List findByPid(Long id); + + /** + * 根据ID查询名称 + * @param id ID + * @return / + */ + @Query(value = "select name from dept where id = ?1",nativeQuery = true) + String findNameById(Long id); + + /** + * 根据角色ID 查询 + * @param id 角色ID + * @return / + */ + 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..299ad6bf --- /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..c9e9eae6 --- /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..976a1c7c --- /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..25b394d5 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/MenuRepository.java @@ -0,0 +1,45 @@ +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; +import java.util.Set; + +/** + * @author Zheng Jie + * @date 2018-12-17 + */ +@SuppressWarnings("all") +public interface MenuRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * 根据菜单名称查询 + * @param name 菜单名称 + * @return / + */ + Menu findByName(String name); + + /** + * 根据组件名称查询 + * @param name 组件名称 + * @return / + */ + Menu findByComponentName(String name); + + /** + * 根据菜单的 PID 查询 + * @param pid / + * @return / + */ + List findByPid(long pid); + + /** + * 根据角色ID与菜单类型查询菜单 + * @param roleIds roleIDs + * @param type 类型 + * @return / + */ + LinkedHashSet findByRoles_IdInAndTypeNotOrderBySortAsc(Set roleIds, int type); +} 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..a108c735 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/RoleRepository.java @@ -0,0 +1,45 @@ +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 + */ +@SuppressWarnings("all") +public interface RoleRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * 根据名称查询 + * @param name / + * @return / + */ + Role findByName(String name); + + /** + * 根据用户ID查询 + * @param id 用户ID + * @return + */ + Set findByUsers_Id(Long id); + + /** + * 解绑角色菜单 + * @param id 菜单ID + */ + @Modifying + @Query(value = "delete from roles_menus where menu_id = ?1",nativeQuery = true) + void untiedMenu(Long id); + + /** + * 根据角色权限查询 + * @param permission / + * @return / + */ + Role findByPermission(String permission); +} 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..bf3e177e --- /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..060f738a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/repository/UserRepository.java @@ -0,0 +1,48 @@ +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 { + + /** + * 根据用户名查询 + * @param username 用户名 + * @return / + */ + User findByUsername(String username); + + /** + * 根据邮箱查询 + * @param email 邮箱 + * @return / + */ + User findByEmail(String email); + + /** + * 修改密码 + * @param username 用户名 + * @param pass 密码 + * @param lastPasswordResetTime / + */ + @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 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 index 845f7e38..5cf55187 100644 --- 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 @@ -1,25 +1,15 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.rest; import cn.hutool.core.collection.CollectionUtil; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; import co.yixiang.config.DataScope; -import co.yixiang.dozer.service.IGenerator; 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.modules.system.service.dto.DeptDTO; import co.yixiang.modules.system.service.dto.DeptQueryCriteria; import co.yixiang.utils.ThrowableUtil; -import co.yixiang.utils.ValidationUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.http.HttpStatus; @@ -35,7 +25,7 @@ import java.util.List; import java.util.Set; /** -* @author hupeng +* @author Zheng Jie * @date 2019-03-25 */ @RestController @@ -47,14 +37,11 @@ public class DeptController { private final DataScope dataScope; - private final IGenerator generator; - private static final String ENTITY_NAME = "dept"; - public DeptController(DeptService deptService, DataScope dataScope, IGenerator generator) { + public DeptController(DeptService deptService, DataScope dataScope) { this.deptService = deptService; this.dataScope = dataScope; - this.generator = generator; } @Log("导出部门数据") @@ -62,7 +49,7 @@ public class DeptController { @GetMapping(value = "/download") @PreAuthorize("@el.check('admin','dept:list')") public void download(HttpServletResponse response, DeptQueryCriteria criteria) throws IOException { - deptService.download(generator.convert(deptService.queryAll(criteria), DeptDto.class), response); + deptService.download(deptService.queryAll(criteria), response); } @Log("查询部门") @@ -72,7 +59,7 @@ public class DeptController { public ResponseEntity getDepts(DeptQueryCriteria criteria){ // 数据权限 criteria.setIds(dataScope.getDeptIds()); - List deptDtos = generator.convert(deptService.queryAll(criteria),DeptDto.class); + List deptDtos = deptService.queryAll(criteria); return new ResponseEntity<>(deptService.buildTree(deptDtos),HttpStatus.OK); } @@ -84,22 +71,15 @@ public class DeptController { if (resources.getId() != null) { throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); } - return new ResponseEntity<>(deptService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(deptService.create(resources),HttpStatus.CREATED); } @Log("修改部门") @ApiOperation("修改部门") @PutMapping @PreAuthorize("@el.check('admin','dept:edit')") - public ResponseEntity update(@Validated @RequestBody Dept resources){ - if(resources.getId().equals(resources.getPid())) { - throw new BadRequestException("上级不能为自己"); - } - Dept dept = deptService.getOne(new QueryWrapper().lambda() - .eq(Dept::getId,resources.getId())); - ValidationUtil.isNull( dept.getId(),"Dept","id",resources.getId()); - resources.setId(dept.getId()); - deptService.saveOrUpdate(resources); + public ResponseEntity update(@Validated(Dept.Update.class) @RequestBody Dept resources){ + deptService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -109,19 +89,19 @@ public class DeptController { @PreAuthorize("@el.check('admin','dept:del')") public ResponseEntity delete(@RequestBody Set ids){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - Set deptDtos = new HashSet<>(); + Set deptDtos = new HashSet<>(); for (Long id : ids) { List deptList = deptService.findByPid(id); - deptDtos.add(generator.convert(deptService.getOne(new QueryWrapper().eq("id",id)),DeptDto.class)); + deptDtos.add(deptService.findById(id)); if(CollectionUtil.isNotEmpty(deptList)){ deptDtos = deptService.getDeleteDepts(deptList, deptDtos); } } try { - deptService.removeByIds(deptDtos); + deptService.delete(deptDtos); }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 index e75ad351..b5d8a5ed 100644 --- 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 @@ -1,18 +1,10 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.rest; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.dozer.service.IGenerator; + +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; import co.yixiang.exception.BadRequestException; 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 io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -27,7 +19,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** -* @author hupeng +* @author Zheng Jie * @date 2019-04-10 */ @Api(tags = "系统:字典管理") @@ -36,13 +28,11 @@ import java.io.IOException; public class DictController { private final DictService dictService; - private final IGenerator generator; private static final String ENTITY_NAME = "dict"; - public DictController(DictService dictService, IGenerator generator) { + public DictController(DictService dictService) { this.dictService = dictService; - this.generator = generator; } @Log("导出字典数据") @@ -50,7 +40,7 @@ public class DictController { @GetMapping(value = "/download") @PreAuthorize("@el.check('admin','dict:list')") public void download(HttpServletResponse response, DictQueryCriteria criteria) throws IOException { - dictService.download(generator.convert(dictService.queryAll(criteria), DictDto.class), response); + dictService.download(dictService.queryAll(criteria), response); } @Log("查询字典") @@ -77,16 +67,16 @@ public class DictController { if (resources.getId() != null) { throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); } - return new ResponseEntity<>(dictService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(dictService.create(resources),HttpStatus.CREATED); } @Log("修改字典") @ApiOperation("修改字典") @PutMapping @PreAuthorize("@el.check('admin','dict:edit')") - public ResponseEntity update(@Validated @RequestBody Dict resources){ + public ResponseEntity update(@Validated(Dict.Update.class) @RequestBody Dict resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - dictService.saveOrUpdate(resources); + dictService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -96,7 +86,7 @@ public class DictController { @PreAuthorize("@el.check('admin','dict:del')") public ResponseEntity delete(@PathVariable Long id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - dictService.removeById(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 index e8ea2b01..60b82bb7 100644 --- 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 @@ -1,14 +1,7 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.system.domain.DictDetail; import co.yixiang.modules.system.service.DictDetailService; @@ -28,7 +21,7 @@ import java.util.HashMap; import java.util.Map; /** -* @author hupeng +* @author Zheng Jie * @date 2019-04-10 */ @RestController @@ -37,6 +30,7 @@ import java.util.Map; public class DictDetailController { private final DictDetailService dictDetailService; + private static final String ENTITY_NAME = "dictDetail"; public DictDetailController(DictDetailService dictDetailService) { @@ -73,16 +67,16 @@ public class DictDetailController { if (resources.getId() != null) { throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); } - return new ResponseEntity<>(dictDetailService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(dictDetailService.create(resources),HttpStatus.CREATED); } @Log("修改字典详情") @ApiOperation("修改字典详情") @PutMapping @PreAuthorize("@el.check('admin','dict:edit')") - public ResponseEntity update(@Validated @RequestBody DictDetail resources){ + public ResponseEntity update(@Validated(DictDetail.Update.class) @RequestBody DictDetail resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - dictDetailService.saveOrUpdate(resources); + dictDetailService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -92,7 +86,7 @@ public class DictDetailController { @PreAuthorize("@el.check('admin','dict:del')") public ResponseEntity delete(@PathVariable Long id){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - dictDetailService.removeById(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 index cf4cc5cb..a13a4a17 100644 --- 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 @@ -1,20 +1,11 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.rest; -import co.yixiang.logging.aop.log.Log; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; import co.yixiang.config.DataScope; -import co.yixiang.dozer.service.IGenerator; import co.yixiang.exception.BadRequestException; 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.ThrowableUtil; import io.swagger.annotations.Api; @@ -31,7 +22,7 @@ import java.io.IOException; import java.util.Set; /** -* @author hupeng +* @author Zheng Jie * @date 2019-03-29 */ @Api(tags = "系统:岗位管理") @@ -43,14 +34,11 @@ public class JobController { private final DataScope dataScope; - private final IGenerator generator; - private static final String ENTITY_NAME = "job"; - public JobController(JobService jobService, DataScope dataScope, IGenerator generator) { + public JobController(JobService jobService, DataScope dataScope) { this.jobService = jobService; this.dataScope = dataScope; - this.generator = generator; } @Log("导出岗位数据") @@ -58,7 +46,7 @@ public class JobController { @GetMapping(value = "/download") @PreAuthorize("@el.check('admin','job:list')") public void download(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { - jobService.download(generator.convert(jobService.queryAll(criteria), JobDto.class), response); + jobService.download(jobService.queryAll(criteria), response); } @Log("查询岗位") @@ -79,16 +67,16 @@ public class JobController { if (resources.getId() != null) { throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); } - return new ResponseEntity<>(jobService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(jobService.create(resources),HttpStatus.CREATED); } @Log("修改岗位") @ApiOperation("修改岗位") @PutMapping @PreAuthorize("@el.check('admin','job:edit')") - public ResponseEntity update(@Validated @RequestBody Job resources){ + public ResponseEntity update(@Validated(Job.Update.class) @RequestBody Job resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - jobService.saveOrUpdate(resources); + jobService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -99,10 +87,10 @@ public class JobController { public ResponseEntity delete(@RequestBody Set ids){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); try { - jobService.removeByIds(ids); + jobService.delete(ids); }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 index 1d1d277f..df3d6809 100644 --- 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 @@ -1,28 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.rest; -import co.yixiang.exception.EntityExistException; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.dozer.service.IGenerator; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; import co.yixiang.exception.BadRequestException; -import co.yixiang.modules.shop.domain.YxSystemConfig; 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.MenuDTO; import co.yixiang.modules.system.service.dto.MenuQueryCriteria; -import co.yixiang.modules.system.service.dto.UserDto; +import co.yixiang.modules.system.service.dto.UserDTO; import co.yixiang.utils.SecurityUtils; -import co.yixiang.utils.StringUtils; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.http.HttpStatus; @@ -38,7 +26,7 @@ import java.util.List; import java.util.Set; /** - * @author hupeng + * @author Zheng Jie * @date 2018-12-03 */ @Api(tags = "系统:菜单管理") @@ -53,15 +41,12 @@ public class MenuController { private final RoleService roleService; - private final IGenerator generator; - private static final String ENTITY_NAME = "menu"; - public MenuController(MenuService menuService, UserService userService, RoleService roleService, IGenerator generator) { + public MenuController(MenuService menuService, UserService userService, RoleService roleService) { this.menuService = menuService; this.userService = userService; this.roleService = roleService; - this.generator = generator; } @Log("导出菜单数据") @@ -70,15 +55,15 @@ public class MenuController { @PreAuthorize("@el.check('menu:list')") public void download(HttpServletResponse response, MenuQueryCriteria criteria) throws IOException { //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - menuService.download(generator.convert(menuService.queryAll(criteria),MenuDto.class), response); + menuService.download(menuService.queryAll(criteria), response); } @ApiOperation("获取前端所需菜单") @GetMapping(value = "/build") public ResponseEntity buildMenus(){ - UserDto user = userService.findByName(SecurityUtils.getUsername()); - List menuDtoList = menuService.findByRoles(roleService.findByUsersId(user.getId())); - List menuDtos = (List) menuService.buildTree(menuDtoList).get("content"); + UserDTO user = userService.findByName(SecurityUtils.getUsername()); + List menuDtoList = menuService.findByRoles(roleService.findByUsersId(user.getId())); + List menuDtos = (List) menuService.buildTree(menuDtoList).get("content"); return new ResponseEntity<>(menuService.buildMenus(menuDtos),HttpStatus.OK); } @@ -94,7 +79,7 @@ public class MenuController { @GetMapping @PreAuthorize("@el.check('menu:list')") public ResponseEntity getMenus(MenuQueryCriteria criteria){ - List menuDtoList = generator.convert(menuService.queryAll(criteria),MenuDto.class); + List menuDtoList = menuService.queryAll(criteria); return new ResponseEntity<>(menuService.buildTree(menuDtoList),HttpStatus.OK); } @@ -107,30 +92,14 @@ public class MenuController { if (resources.getId() != null) { throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); } - Menu menu = menuService.getOne(new QueryWrapper().eq("name",resources.getName())); - if(menu != null){ - throw new EntityExistException(Menu.class,"name",resources.getName()); - } - if(StringUtils.isNotBlank(resources.getComponentName())){ - menu = menuService.getOne(new QueryWrapper().eq("componentName",resources.getComponentName())); - if(menu != null){ - throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); - } - } - if(resources.getIFrame()){ - String http = "http://", https = "https://"; - if (!(resources.getPath().toLowerCase().startsWith(http)||resources.getPath().toLowerCase().startsWith(https))) { - throw new BadRequestException("外链必须以http://或者https://开头"); - } - } - return new ResponseEntity<>(menuService.save(resources),HttpStatus.CREATED); + return new ResponseEntity<>(menuService.create(resources),HttpStatus.CREATED); } @Log("修改菜单") @ApiOperation("修改菜单") @PutMapping @PreAuthorize("@el.check('menu:edit')") - public ResponseEntity update(@Validated @RequestBody Menu resources){ + public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Menu resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); menuService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); @@ -145,7 +114,7 @@ public class MenuController { Set menuSet = new HashSet<>(); for (Long id : ids) { List menuList = menuService.findByPid(id); - menuSet.add(menuService.getOne(new QueryWrapper().eq("pid",id))); + menuSet.add(menuService.findOne(id)); menuSet = menuService.getDeleteMenus(menuList, menuSet); } menuService.delete(menuSet); 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 index b345a4c9..d2e70082 100644 --- 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 @@ -1,24 +1,16 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.rest; import cn.hutool.core.lang.Dict; -import co.yixiang.logging.aop.log.Log; -import co.yixiang.dozer.service.IGenerator; +import cn.hutool.core.util.StrUtil; +import co.yixiang.aop.log.Log; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.system.domain.Role; import co.yixiang.modules.system.service.RoleService; import co.yixiang.modules.system.service.UserService; -import co.yixiang.modules.system.service.dto.RoleDto; +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.dto.UserDto; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import co.yixiang.modules.system.service.dto.UserDTO; import co.yixiang.utils.SecurityUtils; import co.yixiang.utils.ThrowableUtil; import io.swagger.annotations.Api; @@ -40,7 +32,7 @@ import java.util.Set; import java.util.stream.Collectors; /** - * @author hupeng + * @author Zheng Jie * @date 2018-12-03 */ @Api(tags = "系统:角色管理") @@ -50,14 +42,12 @@ public class RoleController { private final RoleService roleService; private final UserService userService; - private final IGenerator generator; private static final String ENTITY_NAME = "role"; - public RoleController(RoleService roleService, UserService userService, IGenerator generator) { + public RoleController(RoleService roleService, UserService userService) { this.roleService = roleService; this.userService = userService; - this.generator = generator; } @ApiOperation("获取单个role") @@ -72,14 +62,14 @@ public class RoleController { @GetMapping(value = "/download") @PreAuthorize("@el.check('role:list')") public void download(HttpServletResponse response, RoleQueryCriteria criteria) throws IOException { - roleService.download(generator.convert(roleService.queryAll(criteria),RoleDto.class), response); + roleService.download(roleService.queryAll(criteria), response); } @ApiOperation("返回全部的角色") @GetMapping(value = "/all") @PreAuthorize("@el.check('roles:list','user:add','user:edit')") - public ResponseEntity getAll(RoleQueryCriteria criteria ,@PageableDefault(value = 2000, sort = {"level"}, direction = Sort.Direction.ASC) Pageable pageable){ - return new ResponseEntity<>(roleService.queryAlls(criteria,pageable),HttpStatus.OK); + public ResponseEntity getAll(@PageableDefault(value = 2000, sort = {"level"}, direction = Sort.Direction.ASC) Pageable pageable){ + return new ResponseEntity<>(roleService.queryAll(pageable),HttpStatus.OK); } @Log("查询角色") @@ -113,7 +103,7 @@ public class RoleController { @ApiOperation("修改角色") @PutMapping @PreAuthorize("@el.check('roles:edit')") - public ResponseEntity update(@Validated @RequestBody Role resources){ + public ResponseEntity update(@Validated(Role.Update.class) @RequestBody Role resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); getLevels(resources.getLevel()); roleService.update(resources); @@ -126,7 +116,7 @@ public class RoleController { @PreAuthorize("@el.check('roles:edit')") public ResponseEntity updateMenu(@RequestBody Role resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - RoleDto role = roleService.findById(resources.getId()); + RoleDTO role = roleService.findById(resources.getId()); getLevels(role.getLevel()); roleService.updateMenu(resources,role); return new ResponseEntity<>(HttpStatus.NO_CONTENT); @@ -139,11 +129,11 @@ public class RoleController { public ResponseEntity delete(@RequestBody Set ids){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); for (Long id : ids) { - RoleDto role = roleService.findById(id); + RoleDTO role = roleService.findById(id); getLevels(role.getLevel()); } try { - roleService.removeByIds(ids); + roleService.delete(ids); } catch (Throwable e){ ThrowableUtil.throwForeignKeyException(e, "所选角色存在用户关联,请取消关联后再试"); } @@ -155,8 +145,8 @@ public class RoleController { * @return / */ private int getLevels(Integer level){ - UserDto user = userService.findByName(SecurityUtils.getUsername()); - List levels = roleService.findByUsersId(user.getId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList()); + UserDTO user = userService.findByName(SecurityUtils.getUsername()); + List levels = roleService.findByUsersId(user.getId()).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList()); int min = Collections.min(levels); if(level != null){ if(level < min){ diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/rest/SysUserController.java b/yshop-system/src/main/java/co/yixiang/modules/system/rest/UserController.java similarity index 82% rename from yshop-system/src/main/java/co/yixiang/modules/system/rest/SysUserController.java rename to yshop-system/src/main/java/co/yixiang/modules/system/rest/UserController.java index 51197158..c24d1c5d 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/system/rest/SysUserController.java +++ b/yshop-system/src/main/java/co/yixiang/modules/system/rest/UserController.java @@ -1,29 +1,21 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.rest; +import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.asymmetric.KeyType; import cn.hutool.crypto.asymmetric.RSA; -import co.yixiang.logging.aop.log.Log; +import co.yixiang.aop.log.Log; import co.yixiang.config.DataScope; -import co.yixiang.dozer.service.IGenerator; -import co.yixiang.modules.system.service.dto.UserDto; -import co.yixiang.tools.domain.VerificationCode; +import co.yixiang.domain.VerificationCode; import co.yixiang.exception.BadRequestException; 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.UserService; -import co.yixiang.modules.system.service.dto.RoleSmallDto; +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.tools.service.VerificationCodeService; +import co.yixiang.service.VerificationCodeService; import co.yixiang.utils.PageUtil; import co.yixiang.utils.SecurityUtils; import co.yixiang.utils.YshopConstant; @@ -49,13 +41,13 @@ import java.util.Set; import java.util.stream.Collectors; /** - * @author hupeng + * @author Zheng Jie * @date 2018-11-23 */ @Api(tags = "系统:用户管理") @RestController @RequestMapping("/api/users") -public class SysUserController { +public class UserController { @Value("${rsa.private_key}") private String privateKey; @@ -65,16 +57,14 @@ public class SysUserController { private final DeptService deptService; private final RoleService roleService; private final VerificationCodeService verificationCodeService; - private final IGenerator generator; - public SysUserController(PasswordEncoder passwordEncoder, UserService userService, DataScope dataScope, DeptService deptService, RoleService roleService, VerificationCodeService verificationCodeService, IGenerator generator) { + public UserController(PasswordEncoder passwordEncoder, UserService userService, DataScope dataScope, DeptService deptService, RoleService roleService, VerificationCodeService verificationCodeService) { this.passwordEncoder = passwordEncoder; this.userService = userService; this.dataScope = dataScope; this.deptService = deptService; this.roleService = roleService; this.verificationCodeService = verificationCodeService; - this.generator = generator; } @Log("导出用户数据") @@ -82,7 +72,7 @@ public class SysUserController { @GetMapping(value = "/download") @PreAuthorize("@el.check('admin','user:list')") public void download(HttpServletResponse response, UserQueryCriteria criteria) throws IOException { - userService.download(generator.convert(userService.queryAll(criteria), UserDto.class), response); + userService.download(userService.queryAll(criteria), response); } @Log("查询用户") @@ -135,7 +125,7 @@ public class SysUserController { @ApiOperation("修改用户") @PutMapping @PreAuthorize("@el.check('admin','user:edit')") - public ResponseEntity update(@Validated @RequestBody User resources){ + public ResponseEntity update(@Validated(User.Update.class) @RequestBody User resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); checkLevel(resources); userService.update(resources); @@ -145,13 +135,13 @@ public class SysUserController { @Log("修改用户:个人中心") @ApiOperation("修改用户:个人中心") @PutMapping(value = "center") - public ResponseEntity center(@Validated @RequestBody User resources){ + public ResponseEntity center(@Validated(User.Update.class) @RequestBody User resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - UserDto userDto = userService.findByName(SecurityUtils.getUsername()); + UserDTO userDto = userService.findByName(SecurityUtils.getUsername()); if(!resources.getId().equals(userDto.getId())){ throw new BadRequestException("不能修改他人资料"); } - userService.saveOrUpdate(resources); + userService.updateCenter(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -161,15 +151,15 @@ public class SysUserController { @PreAuthorize("@el.check('admin','user:del')") public ResponseEntity delete(@RequestBody Set ids){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - UserDto user = userService.findByName(SecurityUtils.getUsername()); + UserDTO user = userService.findByName(SecurityUtils.getUsername()); for (Long id : ids) { - Integer currentLevel = Collections.min(roleService.findByUsersId(user.getId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList())); - Integer optLevel = Collections.min(roleService.findByUsersId(id).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList())); + Integer currentLevel = Collections.min(roleService.findByUsersId(user.getId()).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList())); + Integer optLevel = Collections.min(roleService.findByUsersId(id).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList())); if (currentLevel > optLevel) { throw new BadRequestException("角色权限不足,不能删除:" + userService.findByName(SecurityUtils.getUsername()).getUsername()); } } - userService.removeByIds(ids); + userService.delete(ids); return new ResponseEntity<>(HttpStatus.OK); } @@ -181,7 +171,7 @@ public class SysUserController { RSA rsa = new RSA(privateKey, null); String oldPass = new String(rsa.decrypt(passVo.getOldPass(), KeyType.PrivateKey)); String newPass = new String(rsa.decrypt(passVo.getNewPass(), KeyType.PrivateKey)); - UserDto user = userService.findByName(SecurityUtils.getUsername()); + UserDTO user = userService.findByName(SecurityUtils.getUsername()); if(!passwordEncoder.matches(oldPass, user.getPassword())){ throw new BadRequestException("修改失败,旧密码错误"); } @@ -208,7 +198,7 @@ public class SysUserController { // 密码解密 RSA rsa = new RSA(privateKey, null); String password = new String(rsa.decrypt(user.getPassword(), KeyType.PrivateKey)); - UserDto userDto = userService.findByName(SecurityUtils.getUsername()); + UserDTO userDto = userService.findByName(SecurityUtils.getUsername()); if(!passwordEncoder.matches(password, userDto.getPassword())){ throw new BadRequestException("密码错误"); } @@ -223,8 +213,8 @@ public class SysUserController { * @param resources / */ private void checkLevel(User resources) { - UserDto user = userService.findByName(SecurityUtils.getUsername()); - Integer currentLevel = Collections.min(roleService.findByUsersId(user.getId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList())); + UserDTO user = userService.findByName(SecurityUtils.getUsername()); + Integer currentLevel = Collections.min(roleService.findByUsersId(user.getId()).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 index e518586c..f255f82e 100644 --- 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 @@ -1,51 +1,60 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.system.domain.Dept; -import co.yixiang.modules.system.service.dto.DeptDto; +import co.yixiang.modules.system.service.dto.DeptDTO; import co.yixiang.modules.system.service.dto.DeptQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import java.util.Set; + import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-25 */ -public interface DeptService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(DeptQueryCriteria criteria, Pageable pageable); +public interface DeptService { /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(DeptQueryCriteria criteria); + * 查询所有数据 + * @param criteria 条件 + * @return / + */ + List queryAll(DeptQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 根据ID查询 + * @param id / + * @return / + */ + DeptDTO findById(Long id); + + /** + * 创建 + * @param resources / + * @return / + */ + DeptDTO create(Dept resources); + + /** + * 编辑 + * @param resources / + */ + void update(Dept resources); + + /** + * 删除 + * @param deptDtos / + * + */ + void delete(Set deptDtos); + + /** + * 构建树形数据 + * @param deptDtos 原始数据 + * @return / + */ + Object buildTree(List deptDtos); /** * 根据PID查询 @@ -55,11 +64,19 @@ public interface DeptService extends BaseService{ List findByPid(long pid); /** - * 构建树形数据 - * @param deptDtos 原始数据 + * 根据角色ID查询 + * @param id / * @return / */ - Object buildTree(List deptDtos); + Set findByRoleIds(Long id); + + /** + * 导出数据 + * @param queryAll 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; /** * 获取待删除的部门 @@ -67,12 +84,5 @@ public interface DeptService extends BaseService{ * @param deptDtos / * @return / */ - Set getDeleteDepts(List deptList, Set deptDtos); - - /** - * 根据角色ID查询 - * @param id / - * @return / - */ - Set findByRoleIds(Long id); -} + Set getDeleteDepts(List deptList, Set deptDtos); +} \ 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 index b321b947..5c90b934 100644 --- 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 @@ -1,48 +1,48 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.system.domain.DictDetail; -import co.yixiang.modules.system.service.dto.DictDetailDto; +import co.yixiang.modules.system.service.dto.DictDetailDTO; import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria; import org.springframework.data.domain.Pageable; import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ -public interface DictDetailService extends BaseService{ +public interface DictDetailService { -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ + /** + * 根据ID查询 + * @param id / + * @return / + */ + DictDetailDTO findById(Long id); + + /** + * 创建 + * @param resources / + * @return / + */ + DictDetailDTO create(DictDetail resources); + + /** + * 编辑 + * @param resources / + */ + void update(DictDetail resources); + + /** + * 删除 + * @param id / + */ + void delete(Long id); + + /** + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ Map queryAll(DictDetailQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(DictDetailQueryCriteria criteria); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} +} \ 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 index c8ea206a..2bdb6ae5 100644 --- 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 @@ -1,48 +1,67 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.system.domain.Dict; -import co.yixiang.modules.system.service.dto.DictDto; +import co.yixiang.modules.system.service.dto.DictDTO; import co.yixiang.modules.system.service.dto.DictQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; + import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ -public interface DictService extends BaseService{ +public interface DictService { -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ + /** + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ Map queryAll(DictQueryCriteria criteria, Pageable pageable); /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(DictQueryCriteria criteria); + * 查询全部数据 + * @param dict / + * @return / + */ + List queryAll(DictQueryCriteria dict); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 根据ID查询 + * @param id / + * @return / + */ + DictDTO findById(Long id); + + /** + * 创建 + * @param resources / + * @return / + */ + DictDTO create(Dict resources); + + /** + * 编辑 + * @param resources / + */ + void update(Dict resources); + + /** + * 删除 + * @param id / + */ + void delete(Long id); + + /** + * 导出数据 + * @param queryAll 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; +} \ 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 index 5f3f351d..81184008 100644 --- 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 @@ -1,48 +1,68 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.system.domain.Job; -import co.yixiang.modules.system.service.dto.JobDto; +import co.yixiang.modules.system.service.dto.JobDTO; import co.yixiang.modules.system.service.dto.JobQueryCriteria; import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; + import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-29 */ -public interface JobService extends BaseService{ +public interface JobService { -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ + /** + * 根据ID查询 + * @param id / + * @return / + */ + JobDTO findById(Long id); + + /** + * 创建 + * @param resources / + * @return / + */ + JobDTO create(Job resources); + + /** + * 编辑 + * @param resources / + */ + void update(Job resources); + + /** + * 删除 + * @param ids / + */ + void delete(Set ids); + + /** + * 分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / + */ Map queryAll(JobQueryCriteria criteria, Pageable pageable); /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(JobQueryCriteria criteria); + * 查询全部数据 + * @param criteria / + * @return / + */ + List queryAll(JobQueryCriteria criteria); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} + * 导出数据 + * @param queryAll 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; +} \ 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 index e7ec977b..0855fff2 100644 --- 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 @@ -1,75 +1,48 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; + +import co.yixiang.modules.system.service.dto.MenuDTO; import co.yixiang.modules.system.domain.Menu; -import co.yixiang.modules.system.domain.vo.MenuVo; -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 org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import java.util.Set; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; + import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; /** -* @author hupeng -* @date 2020-05-14 -*/ -public interface MenuService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(MenuQueryCriteria criteria, Pageable pageable); + * @author Zheng Jie + * @date 2018-12-17 + */ +public interface MenuService { /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(MenuQueryCriteria criteria); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; - - /** - * 构建菜单树 - * @param menuDtos 原始数据 + * 查询全部数据 + * @param criteria 条件 * @return / */ - Map buildTree(List menuDtos); + List queryAll(MenuQueryCriteria criteria); /** - * 构建菜单树 - * @param menuDtos / + * 根据ID查询 + * @param id / * @return / */ - List buildMenus(List menuDtos); + MenuDTO findById(long id); /** - * 获取菜单树 - * @param menus / + * 创建 + * @param resources / * @return / */ - Object getMenuTree(List menus); + MenuDTO create(Menu resources); + /** + * 编辑 + * @param resources / + */ + void update(Menu resources); /** * 获取待删除的菜单 @@ -79,6 +52,13 @@ public interface MenuService extends BaseService{ */ Set getDeleteMenus(List menuList, Set menuSet); + /** + * 获取菜单树 + * @param menus / + * @return / + */ + Object getMenuTree(List menus); + /** * 根据pid查询 * @param pid / @@ -86,12 +66,33 @@ public interface MenuService extends BaseService{ */ List findByPid(long pid); + /** + * 构建菜单树 + * @param menuDtos 原始数据 + * @return / + */ + Map buildTree(List menuDtos); + /** * 根据角色查询 * @param roles / * @return / */ - List findByRoles(List roles); + List findByRoles(List roles); + + /** + * 构建菜单树 + * @param menuDtos / + * @return / + */ + Object buildMenus(List menuDtos); + + /** + * 根据ID查询 + * @param id / + * @return / + */ + Menu findOne(Long id); /** * 删除 @@ -100,8 +101,10 @@ public interface MenuService extends BaseService{ void delete(Set menuSet); /** - * 编辑 - * @param resources / + * 导出 + * @param queryAll 待导出的数据 + * @param response / + * @throws IOException / */ - void update(Menu resources); + void download(List queryAll, HttpServletResponse response) throws IOException; } 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 index 40d9e81a..97ba6901 100644 --- 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 @@ -1,71 +1,57 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; + import co.yixiang.modules.system.domain.Role; -import co.yixiang.modules.system.service.dto.RoleDto; +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.dto.UserDto; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import co.yixiang.modules.system.service.dto.UserDTO; import org.springframework.data.domain.Pageable; import org.springframework.security.core.GrantedAuthority; -import java.util.Collection; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import java.util.Set; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Collection; +import java.util.List; +import java.util.Set; /** -* @author hupeng -* @date 2020-05-14 -*/ -public interface RoleService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(RoleQueryCriteria criteria, Pageable pageable); - + * @author Zheng Jie + * @date 2018-12-03 + */ +public interface RoleService { /** - * 查询数据分页 - * @param pageable 分页参数 - * @return Map + * 根据ID查询 + * @param id / + * @return / */ - Object queryAlls(RoleQueryCriteria criteria, Pageable pageable); + RoleDTO findById(long id); /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(RoleQueryCriteria criteria); + * 创建 + * @param resources / + * @return / + */ + RoleDTO create(Role resources); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 编辑 + * @param resources / + */ + void update(Role resources); + + /** + * 删除 + * @param ids / + */ + void delete(Set ids); /** * 根据用户ID查询 * @param id 用户ID * @return / */ - List findByUsersId(Long id); + List findByUsersId(Long id); /** * 根据角色查询角色级别 @@ -74,37 +60,53 @@ public interface RoleService extends BaseService{ */ Integer findByRoles(Set roles); - /** - * 根据ID查询 - * @param id / - * @return / - */ - RoleDto findById(long id); - /** * 修改绑定的菜单 * @param resources / - * @param roleDto / + * @param roleDTO / */ - void updateMenu(Role resources, RoleDto roleDto); + void updateMenu(Role resources, RoleDTO roleDTO); /** - * 创建 - * @param resources / + * 解绑菜单 + * @param id / + */ + void untiedMenu(Long id); + + /** + * 不带条件分页查询 + * @param pageable 分页参数 * @return / */ - RoleDto create(Role resources); + Object queryAll(Pageable pageable); /** - * 编辑 - * @param resources / + * 待条件分页查询 + * @param criteria 条件 + * @param pageable 分页参数 + * @return / */ - void update(Role resources); + Object queryAll(RoleQueryCriteria criteria, Pageable pageable); + + /** + * 查询全部 + * @param criteria 条件 + * @return / + */ + List queryAll(RoleQueryCriteria criteria); + + /** + * 导出数据 + * @param queryAll 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; /** * 获取用户权限信息 * @param user 用户信息 * @return 权限信息 */ - Collection mapToGrantedAuthorities(UserDto user); + Collection mapToGrantedAuthorities(UserDTO user); } diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/RolesDeptsService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/RolesDeptsService.java deleted file mode 100644 index 870becb9..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/RolesDeptsService.java +++ /dev/null @@ -1,19 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.system.domain.RolesDepts; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -public interface RolesDeptsService extends BaseService{ - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/RolesMenusService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/RolesMenusService.java deleted file mode 100644 index ae2255a8..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/RolesMenusService.java +++ /dev/null @@ -1,19 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.system.domain.RolesMenus; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -public interface RolesMenusService extends BaseService{ - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/UserAvatarService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/UserAvatarService.java deleted file mode 100644 index b8151886..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/UserAvatarService.java +++ /dev/null @@ -1,50 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.system.domain.UserAvatar; -import co.yixiang.modules.system.service.dto.UserAvatarDto; -import co.yixiang.modules.system.service.dto.UserAvatarQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -public interface UserAvatarService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(UserAvatarQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(UserAvatarQueryCriteria criteria); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; - - UserAvatar saveFile(UserAvatar userAvatar); -} 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 index eff85e40..cb39a51e 100644 --- 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 @@ -1,59 +1,53 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; + +import co.yixiang.modules.system.service.dto.UserDTO; 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.data.domain.Pageable; import org.springframework.web.multipart.MultipartFile; - -import java.util.Map; -import java.util.List; -import java.io.IOException; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.Set; /** -* @author hupeng -* @date 2020-05-14 -*/ -public interface UserService extends BaseService{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(UserQueryCriteria criteria, Pageable pageable); + * @author Zheng Jie + * @date 2018-11-23 + */ +public interface UserService { /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(UserQueryCriteria criteria); + * 根据ID查询 + * @param id ID + * @return / + */ + UserDTO findById(long id); /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; + * 新增用户 + * @param resources / + * @return / + */ + UserDTO create(User resources); + + /** + * 编辑用户 + * @param resources / + */ + void update(User resources); + + /** + * 删除用户 + * @param ids / + */ + void delete(Set ids); /** * 根据用户名查询 * @param userName / * @return / */ - UserDto findByName(String userName); + UserDTO findByName(String userName); /** * 修改密码 @@ -64,9 +58,9 @@ public interface UserService extends BaseService{ /** * 修改头像 - * @param multipartFile 文件 + * @param file 文件 */ - void updateAvatar(MultipartFile multipartFile); + void updateAvatar(MultipartFile file); /** * 修改邮箱 @@ -76,16 +70,31 @@ public interface UserService extends BaseService{ void updateEmail(String username, String email); /** - * 新增用户 - * @param resources / + * 查询全部 + * @param criteria 条件 + * @param pageable 分页参数 * @return / */ - boolean create(User resources); + Object queryAll(UserQueryCriteria criteria, Pageable pageable); /** - * 编辑用户 + * 查询全部不分页 + * @param criteria 条件 + * @return / + */ + List queryAll(UserQueryCriteria criteria); + + /** + * 导出数据 + * @param queryAll 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List queryAll, HttpServletResponse response) throws IOException; + + /** + * 用户自助修改资料 * @param resources / */ - void update(User resources); - + void updateCenter(User resources); } diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/UsersRolesService.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/UsersRolesService.java deleted file mode 100644 index 1cd4c938..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/UsersRolesService.java +++ /dev/null @@ -1,19 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service; -import co.yixiang.common.service.BaseService; -import co.yixiang.modules.system.domain.UsersRoles; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -public interface UsersRolesService extends BaseService{ - -} 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..9d14bbf0 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptDTO.java @@ -0,0 +1,35 @@ +package co.yixiang.modules.system.service.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.List; + +/** +* @author Zheng Jie +* @date 2019-03-25 +*/ +@Data +public class DeptDTO implements Serializable { + + 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/DeptDto.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptDto.java deleted file mode 100644 index a933b18a..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptDto.java +++ /dev/null @@ -1,43 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; -import java.util.List; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -public class DeptDto implements Serializable { - - /** ID */ - private Long id; - - /** 名称 */ - private String name; - - /** 上级部门 */ - private Long pid; - - /** 状态 */ - private Boolean enabled; - - private List children; - - /** 创建日期 */ - private Timestamp createTime; - - public String getLabel() { - return name; - } -} 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 index 179848df..cd86bf46 100644 --- 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 @@ -1,24 +1,15 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.dto; import lombok.Data; +import co.yixiang.annotation.Query; import java.sql.Timestamp; import java.util.List; import java.util.Set; -import co.yixiang.annotation.Query; - /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-25 */ @Data public class DeptQueryCriteria{ @@ -37,4 +28,4 @@ public class DeptQueryCriteria{ @Query(type = Query.Type.BETWEEN) private List createTime; -} +} \ 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..0e85cedf --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptSmallDTO.java @@ -0,0 +1,16 @@ +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 { + + 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/DeptSmallDto.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptSmallDto.java deleted file mode 100644 index 611f0d0a..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DeptSmallDto.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2019-6-10 16:32:18 -*/ -@Data -public class DeptSmallDto implements Serializable { - - private Long id; - - private String name; -} 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..4eb90d24 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDTO.java @@ -0,0 +1,27 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.List; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Getter +@Setter +public class DictDTO implements Serializable { + + private Long id; + + private String name; + + private String remark; + + private List dictDetails; + + private Timestamp createTime; +} 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..8f045bac --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDetailDTO.java @@ -0,0 +1,28 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.sql.Timestamp; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Getter +@Setter +public class DictDetailDTO implements Serializable { + + private Long id; + + private String label; + + private String value; + + private String sort; + + private DictSmallDto dict; + + private Timestamp createTime; +} \ No newline at end of file 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 deleted file mode 100644 index ae886f44..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDetailDto.java +++ /dev/null @@ -1,39 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -public class DictDetailDto implements Serializable { - - /** 字典详细 */ - private Long id; - - /** 字典标签 */ - private String label; - - /** 字典值 */ - private String value; - - /** 排序 */ - private String sort; - - /** 字典id */ - private Long dictId; - - /** 创建日期 */ - private Timestamp createTime; -} 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 index c0997da4..3e69d8c0 100644 --- 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 @@ -1,25 +1,18 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.dto; import lombok.Data; import co.yixiang.annotation.Query; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ @Data -public class DictDetailQueryCriteria{ +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/DictDto.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDto.java deleted file mode 100644 index 2fd26ff9..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictDto.java +++ /dev/null @@ -1,36 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; -import java.util.List; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -public class DictDto implements Serializable { - - /** 字典ID */ - private Long id; - - /** 字典名称 */ - private String name; - - private List dictDetails; - - /** 描述 */ - private String remark; - - /** 创建日期 */ - private Timestamp createTime; -} 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 index f63b1544..7ea9a09b 100644 --- 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 @@ -1,23 +1,14 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.dto; import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; /** -* @author hupeng -* @date 2020-05-14 -*/ + * @author Zheng Jie + * 公共查询类 + */ @Data -public class DictQueryCriteria{ +public class DictQueryCriteria { @Query(blurry = "name,remark") private String blurry; diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictSmallDto.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictSmallDto.java index 606cbdce..8e1da98d 100644 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictSmallDto.java +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/DictSmallDto.java @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.service.dto; import lombok.Getter; @@ -13,7 +5,7 @@ import lombok.Setter; import java.io.Serializable; /** -* @author hupeng +* @author Zheng Jie * @date 2019-04-10 */ @Getter 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..ea584a99 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobDTO.java @@ -0,0 +1,37 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.io.Serializable; +import java.sql.Timestamp; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@Getter +@Setter +@NoArgsConstructor +public class JobDTO implements Serializable { + + 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/JobDto.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobDto.java deleted file mode 100644 index 2529d1e6..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobDto.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -public class JobDto implements Serializable { - - 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; -// } -} 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 index af3fc40f..b285f265 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.service.dto; import lombok.Data; @@ -16,7 +8,7 @@ import java.util.List; import java.util.Set; /** -* @author hupeng +* @author Zheng Jie * @date 2019-6-4 14:49:34 */ @Data @@ -37,4 +29,4 @@ public class JobQueryCriteria { @Query(type = Query.Type.BETWEEN) private List createTime; -} +} \ 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..cbba2103 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobSmallDTO.java @@ -0,0 +1,18 @@ +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 { + + 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/JobSmallDto.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobSmallDto.java deleted file mode 100644 index f24f4215..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/JobSmallDto.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import lombok.NoArgsConstructor; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2019-6-10 16:32:18 -*/ -@Data -@NoArgsConstructor -public class JobSmallDto implements Serializable { - - private Long id; - - private String name; -} 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 similarity index 54% rename from yshop-system/src/main/java/co/yixiang/modules/system/service/dto/MenuDto.java rename to yshop-system/src/main/java/co/yixiang/modules/system/service/dto/MenuDTO.java index 18b61f76..a4eee314 100644 --- 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 @@ -1,24 +1,16 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.dto; import lombok.Data; -import java.sql.Timestamp; import java.io.Serializable; +import java.sql.Timestamp; import java.util.List; /** -* @author hupeng -* @date 2020-05-14 -*/ + * @author Zheng Jie + * @date 2018-12-17 + */ @Data -public class MenuDto implements Serializable { +public class MenuDTO implements Serializable { private Long id; @@ -46,7 +38,7 @@ public class MenuDto implements Serializable { private String icon; - private List children; + 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 index 10e268bb..d48b2e8c 100644 --- 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 @@ -1,21 +1,21 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.dto; import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import java.sql.Timestamp; +import java.util.List; + /** -* @author hupeng -* @date 2020-05-14 -*/ + * @author Zheng Jie + * 公共查询类 + */ @Data -public class MenuQueryCriteria{ +public class MenuQueryCriteria { + + @Query(blurry = "name,path,component") + private String blurry; + + @Query(type = Query.Type.BETWEEN) + private List createTime; } 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 similarity index 52% rename from yshop-system/src/main/java/co/yixiang/modules/system/service/dto/PermissionDto.java rename to yshop-system/src/main/java/co/yixiang/modules/system/service/dto/PermissionDTO.java index 2afa8802..eef9a973 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.service.dto; import lombok.Data; @@ -15,11 +7,11 @@ import java.sql.Timestamp; import java.util.List; /** - * @author hupeng + * @author Zheng Jie * @date 2018-12-03 */ @Data -public class PermissionDto implements Serializable{ +public class PermissionDTO implements Serializable{ private Long id; @@ -31,7 +23,7 @@ public class PermissionDto implements Serializable{ private Timestamp createTime; - private List children; + private List children; @Override public String toString() { 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 index 2723fc79..a88b319f 100644 --- 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 @@ -1,11 +1,3 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ package co.yixiang.modules.system.service.dto; import co.yixiang.annotation.Query; 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..2e67e351 --- /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 String permission; + + private Set menus; + + private Set depts; + + private Timestamp createTime; +} 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 deleted file mode 100644 index 7c6f5b42..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleDto.java +++ /dev/null @@ -1,46 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.dto; - -import co.yixiang.modules.system.domain.Menu; -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; -import java.util.Set; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -public class RoleDto implements Serializable { - - /** ID */ - private Long id; - - /** 名称 */ - private String name; - - /** 备注 */ - private String remark; - - /** 数据权限 */ - private String dataScope; - - /** 角色级别 */ - private Integer level; - - private Set menus; - - /** 创建日期 */ - private Timestamp createTime; - - /** 功能权限 */ - private String permission; -} 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 index 8569c8e6..a34815cc 100644 --- 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 @@ -1,21 +1,21 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.dto; import lombok.Data; -import java.util.List; import co.yixiang.annotation.Query; +import java.sql.Timestamp; +import java.util.List; + /** -* @author hupeng -* @date 2020-05-14 -*/ + * @author Zheng Jie + * 公共查询类 + */ @Data -public class RoleQueryCriteria{ +public class RoleQueryCriteria { + + @Query(blurry = "name,remark") + private String blurry; + + @Query(type = Query.Type.BETWEEN) + private List createTime; } 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..cf52b7dc --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleSmallDTO.java @@ -0,0 +1,20 @@ +package co.yixiang.modules.system.service.dto; + +import lombok.Data; +import java.io.Serializable; + +/** + * @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/RoleSmallDto.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleSmallDto.java deleted file mode 100644 index ee09ccd4..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/RoleSmallDto.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (C) 2018-2020 - * All rights reserved, Designed By www.yixiang.co - * 注意: - * 本软件为www.yixiang.co开发研制,未经购买不得使用 - * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) - * 一经发现盗用、分享等行为,将追究法律责任,后果自负 - */ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** - * @author hupeng - * @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/UserAvatarDto.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserAvatarDto.java deleted file mode 100644 index 56afc6ce..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserAvatarDto.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.io.Serializable; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -public class UserAvatarDto implements Serializable { - - private Long id; - - /** 真实文件名 */ - private String realName; - - /** 路径 */ - private String path; - - /** 大小 */ - private String size; - - /** 创建时间 */ - private Timestamp createTime; -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserAvatarQueryCriteria.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserAvatarQueryCriteria.java deleted file mode 100644 index 34d825e1..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserAvatarQueryCriteria.java +++ /dev/null @@ -1,21 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.dto; - -import lombok.Data; -import java.util.List; -import co.yixiang.annotation.Query; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Data -public class UserAvatarQueryCriteria{ -} 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 similarity index 55% rename from yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserDto.java rename to yshop-system/src/main/java/co/yixiang/modules/system/service/dto/UserDTO.java index 2c0f3b98..74925cf5 100644 --- 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 @@ -1,28 +1,19 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.dto; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import java.sql.Timestamp; import java.io.Serializable; +import java.sql.Timestamp; import java.util.Date; import java.util.Set; /** -* @author hupeng -* @date 2020-05-14 -*/ + * @author Zheng Jie + * @date 2018-11-23 + */ @Data -public class UserDto implements Serializable { - +public class UserDTO implements Serializable { @ApiModelProperty(hidden = true) private Long id; @@ -44,15 +35,15 @@ public class UserDto implements Serializable { @JsonIgnore private String password; - private Timestamp lastPasswordResetTime; + private Date lastPasswordResetTime; @ApiModelProperty(hidden = true) - private Set roles; + private Set roles; @ApiModelProperty(hidden = true) - private JobSmallDto job; + private JobSmallDTO job; - private DeptSmallDto dept; + 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 index 98d6082c..94763cf3 100644 --- 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 @@ -1,27 +1,18 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.dto; import lombok.Data; - +import co.yixiang.annotation.Query; +import java.io.Serializable; import java.sql.Timestamp; import java.util.List; import java.util.Set; -import co.yixiang.annotation.Query; - /** -* @author hupeng -* @date 2020-05-14 -*/ + * @author Zheng Jie + * @date 2018-11-23 + */ @Data -public class UserQueryCriteria{ +public class UserQueryCriteria implements Serializable { @Query private Long id; 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 index 5d57c084..20eea935 100644 --- 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 @@ -1,142 +1,97 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.impl; -import co.yixiang.modules.system.domain.Dept; -import co.yixiang.common.service.impl.BaseServiceImpl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; -import co.yixiang.modules.system.service.DeptService; -import co.yixiang.modules.system.service.dto.DeptDto; +import co.yixiang.modules.system.service.dto.DeptDTO; import co.yixiang.modules.system.service.dto.DeptQueryCriteria; import co.yixiang.modules.system.service.mapper.DeptMapper; +import co.yixiang.exception.BadRequestException; +import co.yixiang.modules.system.domain.Dept; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.repository.DeptRepository; +import co.yixiang.modules.system.service.DeptService; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//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.util.CollectionUtils; - -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.io.IOException; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.Set; +import java.io.IOException; +import java.util.*; import java.util.stream.Collectors; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-25 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "dept") +@CacheConfig(cacheNames = "dept") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class DeptServiceImpl extends BaseServiceImpl implements DeptService { +public class DeptServiceImpl implements DeptService { - private final IGenerator generator; + private final DeptRepository deptRepository; private final DeptMapper deptMapper; - @Override - //@Cacheable - public Map queryAll(DeptQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), DeptDto.class)); - map.put("totalElements", page.getTotal()); - return map; + public DeptServiceImpl(DeptRepository deptRepository, DeptMapper deptMapper) { + this.deptRepository = deptRepository; + this.deptMapper = deptMapper; } - @Override - //@Cacheable - public List queryAll(DeptQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(Dept.class, criteria)); + @Cacheable + public List queryAll(DeptQueryCriteria criteria) { + return deptMapper.toDto(deptRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (DeptDto dept : all) { - Map map = new LinkedHashMap<>(); - map.put("名称", dept.getName()); - map.put("上级部门", dept.getPid()); - map.put("状态", dept.getEnabled()); - map.put("创建日期", dept.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + @Cacheable(key = "#p0") + public DeptDTO findById(Long id) { + Dept dept = deptRepository.findById(id).orElseGet(Dept::new); + ValidationUtil.isNull(dept.getId(),"Dept","id",id); + return deptMapper.toDto(dept); } - /** - * 根据PID查询 - * - * @param pid / - * @return / - */ @Override -// @Cacheable(key = "#p0") + @Cacheable public List findByPid(long pid) { - DeptQueryCriteria criteria = new DeptQueryCriteria(); - criteria.setPid(pid); - return baseMapper.selectList(QueryHelpPlus.getPredicate(Dept.class, criteria)); + return deptRepository.findByPid(pid); } - /** - * 构建树形数据 - * - * @param deptDtos 原始数据 - * @return / - */ @Override - public Object buildTree(List deptDtos) { - Set trees = new LinkedHashSet<>(); - Set depts= new LinkedHashSet<>(); - List deptNames = deptDtos.stream().map(DeptDto::getName).collect(Collectors.toList()); + public Set findByRoleIds(Long id) { + return deptRepository.findByRoles_Id(id); + } + + @Override + @Cacheable + 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; - DeptQueryCriteria criteria = new DeptQueryCriteria(); - List deptList = this.queryAll(criteria); - for (DeptDto deptDto : deptDtos) { + List deptList = deptRepository.findAll(); + for (DeptDTO deptDTO : deptDtos) { isChild = false; - if ("0".equals(deptDto.getPid().toString())) { - trees.add(deptDto); + if ("0".equals(deptDTO.getPid().toString())) { + trees.add(deptDTO); } - for (DeptDto it : deptDtos) { - if (it.getPid().equals(deptDto.getId())) { + for (DeptDTO it : deptDtos) { + if (it.getPid().equals(deptDTO.getId())) { isChild = true; - if (deptDto.getChildren() == null) { - deptDto.setChildren(new ArrayList<>()); + if (deptDTO.getChildren() == null) { + deptDTO.setChildren(new ArrayList<>()); } - deptDto.getChildren().add(it); + deptDTO.getChildren().add(it); } } if(isChild) { - depts.add(deptDto); + depts.add(deptDTO); for (Dept dept : deptList) { - if(dept.getId() == deptDto.getPid() && !deptNames.contains(dept.getName())){ - depts.add(deptDto); + if(dept.getId() == deptDTO.getPid() && !deptNames.contains(dept.getName())){ + depts.add(deptDTO); } } } @@ -154,34 +109,57 @@ public class DeptServiceImpl extends BaseServiceImpl implement return map; } - /** - * 获取待删除的部门 - * - * @param deptList / - * @param deptDtos / - * @return / - */ @Override - public Set getDeleteDepts(List deptList, Set deptDtos) { + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public DeptDTO create(Dept resources) { + return deptMapper.toDto(deptRepository.save(resources)); + } - for (Dept dept : deptList) { - deptDtos.add((DeptDto)generator.convert(deptList,DeptDto.class)); - List depts = Collections.singletonList(this.getOne(new QueryWrapper().eq("id", dept.getId()))); + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(Dept resources) { + if(resources.getId().equals(resources.getPid())) { + throw new BadRequestException("上级不能为自己"); + } + Dept dept = deptRepository.findById(resources.getId()).orElseGet(Dept::new); + ValidationUtil.isNull( dept.getId(),"Dept","id",resources.getId()); + resources.setId(dept.getId()); + deptRepository.save(resources); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void delete(Set deptDtos) { + for (DeptDTO deptDto : deptDtos) { + deptRepository.deleteById(deptDto.getId()); + } + } + + @Override + public void download(List deptDtos, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (DeptDTO deptDTO : deptDtos) { + Map map = new LinkedHashMap<>(); + map.put("部门名称", deptDTO.getName()); + map.put("部门状态", deptDTO.getEnabled() ? "启用" : "停用"); + map.put("创建日期", deptDTO.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } + + @Override + public Set getDeleteDepts(List menuList, Set deptDtos) { + for (Dept dept : menuList) { + deptDtos.add(deptMapper.toDto(dept)); + List depts = deptRepository.findByPid(dept.getId()); if(depts!=null && depts.size()!=0){ getDeleteDepts(depts, deptDtos); } } return deptDtos; } - - /** - * 根据角色ID查询 - * - * @param id / - * @return / - */ - @Override - public Set findByRoleIds(Long id) { - return deptMapper.findDeptByRoleId(id); - } } 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 index 2c776433..27c7abf1 100644 --- 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 @@ -1,88 +1,79 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.impl; import co.yixiang.modules.system.domain.DictDetail; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.system.repository.DictDetailRepository; import co.yixiang.modules.system.service.DictDetailService; -import co.yixiang.modules.system.service.dto.DictDetailDto; +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 org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "dictDetail") +@CacheConfig(cacheNames = "dictDetail") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class DictDetailServiceImpl extends BaseServiceImpl implements DictDetailService { +public class DictDetailServiceImpl implements DictDetailService { - private final IGenerator generator; + private final DictDetailRepository dictDetailRepository; - @Override - //@Cacheable - public Map queryAll(DictDetailQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), DictDetailDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final DictDetailMapper dictDetailMapper; + + public DictDetailServiceImpl(DictDetailRepository dictDetailRepository, DictDetailMapper dictDetailMapper) { + this.dictDetailRepository = dictDetailRepository; + this.dictDetailMapper = dictDetailMapper; } - @Override - //@Cacheable - public List queryAll(DictDetailQueryCriteria criteria){ - List list = baseMapper.selectDictDetailList(criteria.getLabel(),criteria.getDictName()); - return list; + @Cacheable + 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 + @Cacheable(key = "#p0") + public DictDetailDTO findById(Long id) { + DictDetail dictDetail = dictDetailRepository.findById(id).orElseGet(DictDetail::new); + ValidationUtil.isNull(dictDetail.getId(),"DictDetail","id",id); + return dictDetailMapper.toDto(dictDetail); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (DictDetailDto dictDetail : all) { - Map map = new LinkedHashMap<>(); - map.put("字典标签", dictDetail.getLabel()); - map.put("字典值", dictDetail.getValue()); - map.put("排序", dictDetail.getSort()); - map.put("字典id", dictDetail.getDictId()); - map.put("创建日期", dictDetail.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public DictDetailDTO create(DictDetail resources) { + return dictDetailMapper.toDto(dictDetailRepository.save(resources)); } -} + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(DictDetail resources) { + DictDetail dictDetail = dictDetailRepository.findById(resources.getId()).orElseGet(DictDetail::new); + ValidationUtil.isNull( dictDetail.getId(),"DictDetail","id",resources.getId()); + resources.setId(dictDetail.getId()); + dictDetailRepository.save(resources); + } + + @Override + @CacheEvict(allEntries = true) + @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 index 8629f75a..1081da67 100644 --- 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 @@ -1,85 +1,120 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.impl; +import cn.hutool.core.collection.CollectionUtil; import co.yixiang.modules.system.domain.Dict; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; +import co.yixiang.modules.system.repository.DictRepository; import co.yixiang.modules.system.service.DictService; -import co.yixiang.modules.system.service.dto.DictDto; +import co.yixiang.modules.system.service.dto.DictDTO; +import co.yixiang.modules.system.service.dto.DictDetailDTO; import co.yixiang.modules.system.service.dto.DictQueryCriteria; import co.yixiang.modules.system.service.mapper.DictMapper; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; + import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "dict") +@CacheConfig(cacheNames = "dict") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class DictServiceImpl extends BaseServiceImpl implements DictService { +public class DictServiceImpl implements DictService { - private final IGenerator generator; + private final DictRepository dictRepository; - @Override - //@Cacheable - public Map queryAll(DictQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), DictDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final DictMapper dictMapper; + + public DictServiceImpl(DictRepository dictRepository, DictMapper dictMapper) { + this.dictRepository = dictRepository; + this.dictMapper = dictMapper; } - @Override - //@Cacheable - public List queryAll(DictQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(Dict.class, criteria)); + @Cacheable + public Map 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 List queryAll(DictQueryCriteria dict) { + List list = dictRepository.findAll((root, query, cb) -> QueryHelp.getPredicate(root, dict, cb)); + return dictMapper.toDto(list); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { + @Cacheable(key = "#p0") + public DictDTO findById(Long id) { + Dict dict = dictRepository.findById(id).orElseGet(Dict::new); + ValidationUtil.isNull(dict.getId(),"Dict","id",id); + return dictMapper.toDto(dict); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public DictDTO create(Dict resources) { + return dictMapper.toDto(dictRepository.save(resources)); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(Dict resources) { + Dict dict = dictRepository.findById(resources.getId()).orElseGet(Dict::new); + ValidationUtil.isNull( dict.getId(),"Dict","id",resources.getId()); + resources.setId(dict.getId()); + dictRepository.save(resources); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + dictRepository.deleteById(id); + } + + @Override + public void download(List dictDtos, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); - for (DictDto dict : all) { - Map map = new LinkedHashMap<>(); - map.put("字典名称", dict.getName()); - map.put("描述", dict.getRemark()); - map.put("创建日期", dict.getCreateTime()); - list.add(map); + for (DictDTO dictDTO : dictDtos) { + if(CollectionUtil.isNotEmpty(dictDTO.getDictDetails())){ + for (DictDetailDTO dictDetail : dictDTO.getDictDetails()) { + Map map = new LinkedHashMap<>(); + map.put("字典名称", dictDTO.getName()); + map.put("字典描述", dictDTO.getRemark()); + map.put("字典标签", dictDetail.getLabel()); + map.put("字典值", dictDetail.getValue()); + map.put("创建日期", dictDetail.getCreateTime()); + list.add(map); + } + } else { + Map map = new LinkedHashMap<>(); + map.put("字典名称", dictDTO.getName()); + map.put("字典描述", dictDTO.getRemark()); + map.put("字典标签", null); + map.put("字典值", null); + map.put("创建日期", dictDTO.getCreateTime()); + list.add(map); + } } FileUtil.downloadExcel(list, response); } -} +} \ 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 index db045803..b860939a 100644 --- 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 @@ -1,107 +1,113 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.impl; -import co.yixiang.modules.system.domain.Job; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.modules.system.service.DeptService; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; -import co.yixiang.modules.system.service.JobService; -import co.yixiang.modules.system.service.dto.JobDto; +import co.yixiang.modules.system.service.dto.JobDTO; import co.yixiang.modules.system.service.dto.JobQueryCriteria; +import co.yixiang.modules.system.domain.Job; +import co.yixiang.modules.system.repository.DeptRepository; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.PageUtil; +import co.yixiang.utils.QueryHelp; +import co.yixiang.utils.ValidationUtil; +import co.yixiang.modules.system.repository.JobRepository; +import co.yixiang.modules.system.service.JobService; import co.yixiang.modules.system.service.mapper.JobMapper; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; + import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; +import java.io.IOException; +import java.util.*; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-29 */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "job") +@CacheConfig(cacheNames = "job") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class JobServiceImpl extends BaseServiceImpl implements JobService { +public class JobServiceImpl implements JobService { - private final IGenerator generator; + private final JobRepository jobRepository; - private final DeptService deptService; + private final JobMapper jobMapper; - @Override - //@Cacheable - public Map queryAll(JobQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), JobDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final DeptRepository deptRepository; + + public JobServiceImpl(JobRepository jobRepository, JobMapper jobMapper, DeptRepository deptRepository) { + this.jobRepository = jobRepository; + this.jobMapper = jobMapper; + this.deptRepository = deptRepository; } - @Override - //@Cacheable - public List queryAll(JobQueryCriteria criteria){ - List jobList = baseMapper.selectList(QueryHelpPlus.getPredicate(Job.class, criteria)); - List jobScopeList = new ArrayList<>(); - if(criteria.getDeptIds().size()==0){ - for (Job job : jobList) { - job.setDept(deptService.getById(job.getDeptId())); - jobScopeList.add(job); - } - }else { - //断权限范围 - for (Long deptId : criteria.getDeptIds()) { - for (Job job : jobList) { - if(deptId ==job.getDeptId()){ - job.setDept(deptService.getById(job.getDeptId())); - jobScopeList.add(job); - } - } - } + @Cacheable + public Map 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 jobScopeList; + return PageUtil.toPage(jobs,page.getTotalElements()); } + @Override + @Cacheable + public List queryAll(JobQueryCriteria criteria) { + List list = jobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); + return jobMapper.toDto(list); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { + @Cacheable(key = "#p0") + public JobDTO findById(Long id) { + Job job = jobRepository.findById(id).orElseGet(Job::new); + ValidationUtil.isNull(job.getId(),"Job","id",id); + return jobMapper.toDto(job); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public JobDTO create(Job resources) { + return jobMapper.toDto(jobRepository.save(resources)); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(Job resources) { + Job job = jobRepository.findById(resources.getId()).orElseGet(Job::new); + ValidationUtil.isNull( job.getId(),"Job","id",resources.getId()); + resources.setId(job.getId()); + jobRepository.save(resources); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (Long id : ids) { + jobRepository.deleteById(id); + } + } + + @Override + public void download(List jobDtos, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); - for (JobDto job : all) { + for (JobDTO jobDTO : jobDtos) { Map map = new LinkedHashMap<>(); - map.put("岗位名称", job.getName()); - map.put("岗位状态", job.getEnabled()); - map.put("岗位排序", job.getSort()); - map.put("创建日期", job.getCreateTime()); + map.put("岗位名称", jobDTO.getName()); + map.put("所属部门", jobDTO.getDept().getName()); + map.put("岗位状态", jobDTO.getEnabled() ? "启用" : "停用"); + map.put("创建日期", jobDTO.getCreateTime()); list.add(map); } FileUtil.downloadExcel(list, response); } -} +} \ 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 index 9d6572be..90b002b5 100644 --- 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 @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.impl; import cn.hutool.core.util.ObjectUtil; @@ -13,202 +5,163 @@ 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.common.service.impl.BaseServiceImpl; import co.yixiang.modules.system.domain.vo.MenuMetaVo; import co.yixiang.modules.system.domain.vo.MenuVo; -import co.yixiang.modules.system.service.dto.RoleSmallDto; -import co.yixiang.modules.system.service.mapper.RoleMapper; +import co.yixiang.modules.system.repository.MenuRepository; +import co.yixiang.modules.system.service.MenuService; +import co.yixiang.modules.system.service.RoleService; +import co.yixiang.modules.system.service.dto.*; +import co.yixiang.modules.system.service.mapper.MenuMapper; +import co.yixiang.utils.FileUtil; +import co.yixiang.utils.QueryHelp; import co.yixiang.utils.StringUtils; import co.yixiang.utils.ValidationUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; -import co.yixiang.modules.system.service.MenuService; -import co.yixiang.modules.system.service.dto.MenuDto; -import co.yixiang.modules.system.service.dto.MenuQueryCriteria; -import co.yixiang.modules.system.service.mapper.MenuMapper; +import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//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.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.io.IOException; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.Set; +import java.io.IOException; +import java.util.*; import java.util.stream.Collectors; /** -* @author hupeng -* @date 2020-05-14 -*/ + * @author Zheng Jie + */ @Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "menu") +@CacheConfig(cacheNames = "menu") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class MenuServiceImpl extends BaseServiceImpl implements MenuService { +public class MenuServiceImpl implements MenuService { + + private final MenuRepository menuRepository; - private final IGenerator generator; private final MenuMapper menuMapper; - private final RoleMapper roleMapper; - @Override - //@Cacheable - public Map queryAll(MenuQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), MenuDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final RoleService roleService; + + public MenuServiceImpl(MenuRepository menuRepository, MenuMapper menuMapper, RoleService roleService) { + this.menuRepository = menuRepository; + this.menuMapper = menuMapper; + this.roleService = roleService; } - @Override - //@Cacheable - public List queryAll(MenuQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(Menu.class, criteria)); + @Cacheable + public List queryAll(MenuQueryCriteria criteria){ +// Sort sort = new Sort(Sort.Direction.DESC,"id"); + return menuMapper.toDto(menuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } + @Override + @Cacheable(key = "#p0") + public MenuDTO findById(long id) { + Menu menu = menuRepository.findById(id).orElseGet(Menu::new); + ValidationUtil.isNull(menu.getId(),"Menu","id",id); + return menuMapper.toDto(menu); + } @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (MenuDto menu : all) { - Map map = new LinkedHashMap<>(); - map.put("是否外链", menu.getIFrame()); - map.put("菜单名称", menu.getName()); - map.put("组件", menu.getComponent()); - map.put("上级菜单ID", menu.getPid()); - map.put("排序", menu.getSort()); - map.put("图标", menu.getIcon()); - map.put("链接地址", menu.getPath()); - map.put("缓存", menu.getCache()); - map.put("是否隐藏", menu.getHidden()); - map.put("组件名称", menu.getComponentName()); - map.put("创建日期", menu.getCreateTime()); - map.put("权限", menu.getPermission()); - map.put("类型", menu.getType()); - list.add(map); + public List findByRoles(List roles) { + Set roleIds = roles.stream().map(RoleSmallDTO::getId).collect(Collectors.toSet()); + LinkedHashSet menus = menuRepository.findByRoles_IdInAndTypeNotOrderBySortAsc(roleIds, 2); + return menus.stream().map(menuMapper::toDto).collect(Collectors.toList()); + } + + @Override + @CacheEvict(allEntries = true) + public MenuDTO create(Menu resources) { + if(menuRepository.findByName(resources.getName()) != null){ + throw new EntityExistException(Menu.class,"name",resources.getName()); } - FileUtil.downloadExcel(list, response); - } - - /** - * 构建菜单树 - * - * @param menuDtos 原始数据 - * @return / - */ - @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()); - } + if(StringUtils.isNotBlank(resources.getComponentName())){ + if(menuRepository.findByComponentName(resources.getComponentName()) != null){ + throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); } } - Map map = new HashMap<>(2); - if(trees.size() == 0){ - trees = menuDtos.stream().filter(s -> !ids.contains(s.getId())).collect(Collectors.toList()); + if(resources.getIFrame()){ + String http = "http://", https = "https://"; + if (!(resources.getPath().toLowerCase().startsWith(http)||resources.getPath().toLowerCase().startsWith(https))) { + throw new BadRequestException("外链必须以http://或者https://开头"); + } } - map.put("content",trees); - map.put("totalElements", menuDtos.size()); - return map; + return menuMapper.toDto(menuRepository.save(resources)); } - /** - * 构建菜单树 - * - * @param menuDtos / - * @return / - */ @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; + @CacheEvict(allEntries = true) + public void update(Menu resources) { + if(resources.getId().equals(resources.getPid())) { + throw new BadRequestException("上级不能为自己"); + } + Menu menu = menuRepository.findById(resources.getId()).orElseGet(Menu::new); + ValidationUtil.isNull(menu.getId(),"Permission","id",resources.getId()); + + if(resources.getIFrame()){ + String http = "http://", https = "https://"; + if (!(resources.getPath().toLowerCase().startsWith(http)||resources.getPath().toLowerCase().startsWith(https))) { + throw new BadRequestException("外链必须以http://或者https://开头"); + } + } + 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()); + menu.setPermission(resources.getPermission()); + menu.setType(resources.getType()); + menuRepository.save(menu); } - /** - * 获取菜单树 - * - * @param menus / - * @return / - */ @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 + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void delete(Set menuSet) { + for (Menu menu : menuSet) { + roleService.untiedMenu(menu.getId()); + menuRepository.deleteById(menu.getId()); + } + } + + @Override + @Cacheable(key = "'tree'") public Object getMenuTree(List menus) { List> list = new LinkedList<>(); menus.forEach(menu -> { if (menu!=null){ - List menuList = menuMapper.findByPid(menu.getId()); + List menuList = menuRepository.findByPid(menu.getId()); Map map = new HashMap<>(16); map.put("id",menu.getId()); map.put("label",menu.getName()); @@ -222,111 +175,110 @@ public class MenuServiceImpl extends BaseServiceImpl implement return list; } - /** - * 获取待删除的菜单 - * - * @param menuList / - * @param menuSet / - * @return / - */ - @Override - public Set getDeleteMenus(List menuList, Set menuSet) { - // 递归找出待删除的菜单 - for (Menu menu1 : menuList) { - menuSet.add(menu1); - List menus = menuMapper.findByPid(menu1.getId()); - if(menus!=null && menus.size()!=0){ - getDeleteMenus(menus, menuSet); - } - } - return menuSet; - } - - /** - * 根据pid查询 - * - * @param pid / - * @return / - */ @Override + @Cacheable(key = "'pid:'+#p0") public List findByPid(long pid) { - return menuMapper.findByPid(pid); + return menuRepository.findByPid(pid); } - /** - * 根据角色查询 - * - * @param roles / - * @return / - */ @Override - public List findByRoles(List roles) { - List roleIds = roles.stream().map(i ->{ - Long role = i.getId(); - return role; - }).collect(Collectors.toList()); - List list = menuMapper.selectListByRoles(roleIds); - - return generator.convert(list,MenuDto.class); - } - - /** - * 删除 - * - * @param menuSet / - */ - @Override - public void delete(Set menuSet) { - for (Menu menu : menuSet) { - roleMapper.untiedMenu(menu.getId()); - this.removeById(menu.getId()); - } - } - - /** - * 编辑 - * - * @param resources / - */ - @Override - public void update(Menu resources) { - if(resources.getId().equals(resources.getPid())) { - throw new BadRequestException("上级不能为自己"); - } - Menu menu = this.getById(resources.getId()); - ValidationUtil.isNull(menu.getId(),"Permission","id",resources.getId()); - - if(resources.getIFrame()){ - String http = "http://", https = "https://"; - if (!(resources.getPath().toLowerCase().startsWith(http)||resources.getPath().toLowerCase().startsWith(https))) { - throw new BadRequestException("外链必须以http://或者https://开头"); + 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()); + } } } - Menu menu1 = this.getOne(new QueryWrapper().eq("name",resources.getName())); - - if(menu1 != null && !menu1.getId().equals(menu.getId())){ - throw new EntityExistException(Menu.class,"name",resources.getName()); + Map map = new HashMap<>(2); + if(trees.size() == 0){ + trees = menuDtos.stream().filter(s -> !ids.contains(s.getId())).collect(Collectors.toList()); } + map.put("content",trees); + map.put("totalElements", menuDtos.size()); + return map; + } - if(StringUtils.isNotBlank(resources.getComponentName())){ - menu1 = this.getOne(new QueryWrapper().eq("componentName",resources.getComponentName())); - if(menu1 != null && !menu1.getId().equals(menu.getId())){ - throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); + @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); } } - menu.setId(resources.getId()); - 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()); - menu.setPermission(resources.getPermission()); - menu.setType(resources.getType()); - this.saveOrUpdate(menu); + ); + return list; + } + + @Override + public Menu findOne(Long id) { + Menu menu = menuRepository.findById(id).orElseGet(Menu::new); + ValidationUtil.isNull(menu.getId(),"Menu","id",id); + return menu; + } + + @Override + public void download(List menuDtos, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (MenuDTO menuDTO : menuDtos) { + Map map = new LinkedHashMap<>(); + map.put("菜单名称", menuDTO.getName()); + map.put("菜单类型", menuDTO.getType() == 0 ? "目录" : menuDTO.getType() == 1 ? "菜单" : "按钮"); + map.put("权限标识", menuDTO.getPermission()); + map.put("外链菜单", menuDTO.getIFrame() ? "是" : "否"); + map.put("菜单可见", menuDTO.getHidden() ? "否" : "是"); + map.put("是否缓存", menuDTO.getCache() ? "是" : "否"); + map.put("创建日期", menuDTO.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); } } 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 index 7fa7d952..ed51d4ae 100644 --- 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 @@ -1,266 +1,161 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.impl; +import co.yixiang.modules.system.service.dto.RoleDTO; +import co.yixiang.modules.system.service.dto.RoleSmallDTO; +import co.yixiang.modules.system.service.dto.UserDTO; +import co.yixiang.modules.system.domain.Menu; +import co.yixiang.modules.system.domain.Role; import co.yixiang.exception.EntityExistException; -import co.yixiang.modules.system.domain.*; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.modules.system.service.*; -import co.yixiang.modules.system.service.dto.RoleSmallDto; -import co.yixiang.modules.system.service.dto.UserDto; -import co.yixiang.modules.system.service.mapper.DeptMapper; -import co.yixiang.modules.system.service.mapper.MenuMapper; -import co.yixiang.utils.StringUtils; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.api.R; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; -import co.yixiang.modules.system.service.dto.RoleDto; +import co.yixiang.modules.system.repository.RoleRepository; +import co.yixiang.modules.system.service.RoleService; import co.yixiang.modules.system.service.dto.RoleQueryCriteria; import co.yixiang.modules.system.service.mapper.RoleMapper; +import co.yixiang.modules.system.service.mapper.RoleSmallMapper; +import co.yixiang.utils.*; + import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//import org.springframework.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.io.IOException; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.Set; +import java.io.IOException; +import java.util.*; import java.util.stream.Collectors; /** -* @author hupeng -* @date 2020-05-14 -*/ + * @author Zheng Jie + * @date 2018-12-03 + */ @Service -@AllArgsConstructor +@CacheConfig(cacheNames = "role") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class RoleServiceImpl extends BaseServiceImpl implements RoleService { +public class RoleServiceImpl implements RoleService { + + private final RoleRepository roleRepository; - private final IGenerator generator; private final RoleMapper roleMapper; - private final MenuMapper menuMapper; - private final DeptMapper deptMapper; - private final RolesMenusService rolesMenusService; - private final RolesDeptsService rolesDeptsService; - @Override - public Map queryAll(RoleQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), RoleDto.class)); - map.put("totalElements", page.getTotal()); - return map; + private final RoleSmallMapper roleSmallMapper; + + public RoleServiceImpl(RoleRepository roleRepository, RoleMapper roleMapper, RoleSmallMapper roleSmallMapper) { + this.roleRepository = roleRepository; + this.roleMapper = roleMapper; + this.roleSmallMapper = roleSmallMapper; } - /** - * 查询数据分页 - * - * @param pageable 分页参数 - * @return Object - */ @Override - public Object queryAlls(RoleQueryCriteria criteria,Pageable pageable) { - List roleList = baseMapper.selectList(QueryHelpPlus.getPredicate(Role.class, criteria)); - return roleList; + @Cacheable + public Object queryAll(Pageable pageable) { + return roleMapper.toDto(roleRepository.findAll(pageable).getContent()); } - @Override - public List queryAll(RoleQueryCriteria criteria){ - List roleList = baseMapper.selectList(QueryHelpPlus.getPredicate(Role.class, criteria)); - for (Role role : roleList) { - role.setMenus(menuMapper.findMenuByRoleId(role.getId())); - role.setDepts(deptMapper.findDeptByRoleId(role.getId())); - } - return roleList; + @Cacheable + public List queryAll(RoleQueryCriteria criteria) { + return roleMapper.toDto(roleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); } - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (RoleDto role : all) { - Map map = new LinkedHashMap<>(); - map.put("名称", role.getName()); - map.put("备注", role.getRemark()); - map.put("数据权限", role.getDataScope()); - map.put("角色级别", role.getLevel()); - map.put("创建日期", role.getCreateTime()); - map.put("功能权限", role.getPermission()); - list.add(map); - } - FileUtil.downloadExcel(list, response); + @Cacheable + 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)); } - /** - * 根据用户ID查询 - * - * @param id 用户ID - * @return / - */ -// @Cacheable(key = "'findByUsers_Id:' + #p0") @Override - public List findByUsersId(Long id) { - List roles = roleMapper.selectListByUserId(id); - return generator.convert(roles,RoleSmallDto.class); + @Cacheable(key = "#p0") + public RoleDTO findById(long id) { + Role role = roleRepository.findById(id).orElseGet(Role::new); + ValidationUtil.isNull(role.getId(),"Role","id",id); + return roleMapper.toDto(role); } - /** - * 根据角色查询角色级别 - * - * @param roles / - * @return / - */ @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())); - } - - /** - * 根据ID查询 - * - * @param id / - * @return / - */ - @Override - public RoleDto findById(long id) { - Role role = this.getById(id); - role.setMenus(menuMapper.findMenuByRoleId(role.getId())); - role.setDepts(deptMapper.findDeptByRoleId(role.getId())); - return generator.convert(role, RoleDto.class); - } - - /** - * 修改绑定的菜单 - * - * @param resources / - * @param roleDto / - */ - @Override -// @CacheEvict(allEntries = true) - public void updateMenu(Role resources, RoleDto roleDto) { - if(resources.getMenus().size()>0){ - List rolesMenusList = resources.getMenus().stream().map(i ->{ - RolesMenus rolesMenus = new RolesMenus(); - rolesMenus.setRoleId(resources.getId()); - rolesMenus.setMenuId(i.getId()); - return rolesMenus; - }).collect(Collectors.toList()); - rolesMenusService.remove(new LambdaQueryWrapper().eq(RolesMenus::getRoleId,resources.getId())); - rolesMenusService.saveBatch(rolesMenusList); - } - } - - - @Override -// @CacheEvict(allEntries = true) + @CacheEvict(allEntries = true) @Transactional(rollbackFor = Exception.class) - public RoleDto create(Role resources) { - if(this.getOne(new QueryWrapper().lambda().eq(Role::getName,resources.getName())) != null){ + public RoleDTO create(Role resources) { + if(roleRepository.findByName(resources.getName()) != null){ throw new EntityExistException(Role.class,"username",resources.getName()); } - - if(this.getOne(new QueryWrapper().lambda().eq(Role::getName,resources.getName())) != null){ - throw new EntityExistException(Role.class,"username",resources.getName()); - } - this.save(resources); - if(resources.getDepts().size()>0){ - List rolesDeptsList = resources.getDepts().stream().map(i ->{ - RolesDepts rolesDepts = new RolesDepts(); - rolesDepts.setRoleId(resources.getId()); - rolesDepts.setDeptId(i.getId()); - return rolesDepts; - }).collect(Collectors.toList()); - rolesDeptsService.saveBatch(rolesDeptsList); - } - return generator.convert(resources,RoleDto.class); + return roleMapper.toDto(roleRepository.save(resources)); } @Override -// @CacheEvict(allEntries = true) + @CacheEvict(allEntries = true) @Transactional(rollbackFor = Exception.class) public void update(Role resources) { - Role role = this.getById(resources.getId()); + Role role = roleRepository.findById(resources.getId()).orElseGet(Role::new); + ValidationUtil.isNull(role.getId(),"Role","id",resources.getId()); - Role role1 = this.getOne(new QueryWrapper().lambda().eq(Role::getName,resources.getName())); + Role role1 = roleRepository.findByName(resources.getName()); if(role1 != null && !role1.getId().equals(role.getId())){ throw new EntityExistException(Role.class,"username",resources.getName()); } - role1 = this.getOne(new QueryWrapper().lambda().eq(Role::getPermission,resources.getPermission())); + role1 = roleRepository.findByPermission(resources.getPermission()); if(role1 != null && !role1.getId().equals(role.getId())){ throw new EntityExistException(Role.class,"permission",resources.getPermission()); } role.setName(resources.getName()); role.setRemark(resources.getRemark()); role.setDataScope(resources.getDataScope()); - if(resources.getDepts().size()>0){ - List rolesDeptsList = resources.getDepts().stream().map(i ->{ - RolesDepts rolesDepts = new RolesDepts(); - rolesDepts.setRoleId(resources.getId()); - rolesDepts.setDeptId(i.getId()); - return rolesDepts; - }).collect(Collectors.toList()); - rolesDeptsService.remove(new LambdaQueryWrapper().eq(RolesDepts::getRoleId,resources.getId())); - rolesDeptsService.saveBatch(rolesDeptsList); - } + role.setDepts(resources.getDepts()); role.setLevel(resources.getLevel()); role.setPermission(resources.getPermission()); - this.saveOrUpdate(role); + roleRepository.save(role); } - /** - * 获取用户权限信息 - * - * @param user 用户信息 - * @return 权限信息 - */ + @Override -// @Cacheable(key = "'loadPermissionByUser:' + #p0.username") - public Collection mapToGrantedAuthorities(UserDto user) { - Set roles = roleMapper.findByUsers_Id(user.getId()); - for (Role role : roles) { - Set menuSet = menuMapper.findMenuByRoleId(role.getId()); - role.setMenus(menuSet); - Set deptSet = deptMapper.findDeptByRoleId(role.getId()); - role.setDepts(deptSet); + @CacheEvict(allEntries = true) + public void updateMenu(Role resources, RoleDTO roleDTO) { + Role role = roleMapper.toEntity(roleDTO); + role.setMenus(resources.getMenus()); + roleRepository.save(role); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void untiedMenu(Long id) { + roleRepository.untiedMenu(id); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (Long id : ids) { + roleRepository.deleteById(id); } + } + + @Override + @Cacheable(key = "'findByUsers_Id:' + #p0") + public List findByUsersId(Long id) { + return roleSmallMapper.toDto(new ArrayList<>(roleRepository.findByUsers_Id(id))); + } + + @Override + @Cacheable + 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())); + } + + @Override + @Cacheable(key = "'loadPermissionByUser:' + #p0.username") + public Collection mapToGrantedAuthorities(UserDTO user) { + Set roles = roleRepository.findByUsers_Id(user.getId()); Set permissions = roles.stream().filter(role -> StringUtils.isNotBlank(role.getPermission())).map(Role::getPermission).collect(Collectors.toSet()); permissions.addAll( roles.stream().flatMap(role -> role.getMenus().stream()) @@ -271,4 +166,18 @@ public class RoleServiceImpl extends BaseServiceImpl implement .collect(Collectors.toList()); } + @Override + public void download(List roles, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (RoleDTO role : roles) { + Map map = new LinkedHashMap<>(); + map.put("角色名称", role.getName()); + map.put("默认权限", role.getPermission()); + map.put("角色级别", role.getLevel()); + map.put("描述", role.getRemark()); + map.put("创建日期", role.getCreateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } } diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RolesDeptsServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RolesDeptsServiceImpl.java deleted file mode 100644 index ef311391..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RolesDeptsServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.impl; - -import co.yixiang.modules.system.domain.RolesDepts; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.modules.system.service.RolesDeptsService; -import co.yixiang.modules.system.service.mapper.RolesDeptsMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "rolesDepts") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class RolesDeptsServiceImpl extends BaseServiceImpl implements RolesDeptsService { - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RolesMenusServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RolesMenusServiceImpl.java deleted file mode 100644 index 5004612b..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/RolesMenusServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.impl; - -import co.yixiang.modules.system.domain.RolesMenus; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.modules.system.service.RolesMenusService; -import co.yixiang.modules.system.service.mapper.RolesMenusMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "rolesMenus") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class RolesMenusServiceImpl extends BaseServiceImpl implements RolesMenusService { - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/SysUserServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/SysUserServiceImpl.java deleted file mode 100644 index 41127e8a..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/SysUserServiceImpl.java +++ /dev/null @@ -1,274 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.impl; - -import co.yixiang.exception.EntityExistException; -import co.yixiang.modules.system.domain.Role; -import co.yixiang.modules.system.domain.User; -import co.yixiang.common.service.impl.BaseServiceImpl; -import co.yixiang.modules.system.domain.UserAvatar; -import co.yixiang.modules.system.domain.UsersRoles; -import co.yixiang.modules.system.service.*; -import co.yixiang.modules.system.service.mapper.RoleMapper; -import co.yixiang.utils.RedisUtils; -import co.yixiang.utils.SecurityUtils; -import co.yixiang.utils.StringUtils; -import co.yixiang.utils.ValidationUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.FileUtil; -import co.yixiang.modules.system.service.dto.UserDto; -import co.yixiang.modules.system.service.dto.UserQueryCriteria; -import co.yixiang.modules.system.service.mapper.SysUserMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//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 java.io.File; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.Set; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Service -//@AllArgsConstructor -//@CacheConfig(cacheNames = "user") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class SysUserServiceImpl extends BaseServiceImpl implements UserService { - - @Value("${file.avatar}") - private String avatar; - - private final IGenerator generator; - private final SysUserMapper userMapper; - private final UserAvatarService userAvatarService; - private final JobService jobService; - private final DeptService deptService; - private final RoleMapper roleMapper; - private final RedisUtils redisUtils; - private final UsersRolesService usersRolesService; - - public SysUserServiceImpl(IGenerator generator, SysUserMapper userMapper, UserAvatarService userAvatarService, JobService jobService, DeptService deptService, RoleService roleService, RoleMapper roleMapper, RedisUtils redisUtils, UsersRolesService usersRolesService) { - this.generator = generator; - this.userMapper = userMapper; - this.userAvatarService = userAvatarService; - this.jobService = jobService; - this.deptService = deptService; - this.roleMapper = roleMapper; - this.redisUtils = redisUtils; - this.usersRolesService = usersRolesService; - } - - @Override - //@Cacheable - public Map queryAll(UserQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), UserDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } - - - @Override - //@Cacheable - public List queryAll(UserQueryCriteria criteria){ - List userList = baseMapper.selectList(QueryHelpPlus.getPredicate(User.class, criteria)); - for (User user : userList) { - user.setJob(jobService.getById(user.getJobId())); - user.setDept(deptService.getById(user.getDeptId())); - user.setRoles(roleMapper.findByUsers_Id(user.getId())); - } - return userList; - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (UserDto user : all) { - Map map = new LinkedHashMap<>(); - map.put("邮箱", user.getEmail()); - map.put("状态:1启用、0禁用", user.getEnabled()); - map.put("密码", user.getPassword()); - map.put("用户名", user.getUsername()); - map.put("部门名称", user.getDeptId()); - map.put("手机号码", user.getPhone()); - map.put("创建日期", user.getCreateTime()); - map.put("最后修改密码的日期", user.getLastPasswordResetTime()); - map.put("昵称", user.getNickName()); - map.put("性别", user.getSex()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - /** - * 根据用户名查询 - * - * @param userName / - * @return / - */ - @Override - public UserDto findByName(String userName) { - User user = this.getOne(new QueryWrapper().lambda() - .eq(User::getUsername,userName)); - //用户所属岗位 - user.setJob(jobService.getById(user.getJobId())); - //用户所属部门 - user.setDept(deptService.getById(user.getDeptId())); - return generator.convert(user,UserDto.class); - } - - /** - * 修改密码 - * - * @param username 用户名 - * @param encryptPassword 密码 - */ - @Override - public void updatePass(String username, String encryptPassword) { - userMapper.updatePass(encryptPassword,new Date(),username); - } - - /** - * 修改头像 - * - * @param multipartFile 文件 - */ - @Override - public void updateAvatar(MultipartFile multipartFile) { - User user = this.getOne(new QueryWrapper().eq("username",SecurityUtils.getUsername())); - UserAvatar userAvatar = user.getUserAvatar(); - String oldPath = ""; - if(userAvatar != null){ - oldPath = userAvatar.getPath(); - } - File file = FileUtil.upload(multipartFile, avatar); - assert file != null; - UserAvatar saveUserAvatar = new UserAvatar(userAvatar,file.getName(), file.getPath(), FileUtil.getSize(multipartFile.getSize())); - userAvatarService.save(saveUserAvatar); - user.setUserAvatar(saveUserAvatar); - this.save(user); - if(StringUtils.isNotBlank(oldPath)){ - FileUtil.del(oldPath); - } - } - - /** - * 修改邮箱 - * - * @param username 用户名 - * @param email 邮箱 - */ - @Override - public void updateEmail(String username, String email) { - userMapper.updateEmail(email, username); - } - - /** - * 新增用户 - * - * @param resources / - * @return / - */ - @Override - //@CacheEvict(allEntries = true) - @Transactional(rollbackFor = Exception.class) - public boolean create(User resources) { - User userName = this.getOne(new QueryWrapper().lambda() - .eq(User::getUsername,resources.getUsername())); - if(userName != null){ - throw new EntityExistException(User.class,"username",resources.getUsername()); - } - User userEmail = this.getOne(new QueryWrapper().lambda() - .eq(User::getEmail,resources.getEmail())); - if(userEmail != null){ - throw new EntityExistException(User.class,"email",resources.getEmail()); - } - resources.setDeptId(resources.getDept().getId()); - resources.setJobId(resources.getJob().getId()); - boolean result = this.save(resources); - UsersRoles usersRoles = new UsersRoles(); - usersRoles.setUserId(resources.getId()); - Set set = resources.getRoles(); - for (Role roleIds : set ) { - usersRoles.setRoleId(roleIds.getId()); - } - if (result) { - usersRolesService.save(usersRoles); - } - return result; - } - - /** - * 编辑用户 - * - * @param resources / - */ - @Override - //@CacheEvict(allEntries = true) - @Transactional(rollbackFor = Exception.class) - public void update(User resources) { - User user = this.getOne(new QueryWrapper().lambda() - .eq(User::getId,resources.getId())); - ValidationUtil.isNull(user.getId(),"User","id",resources.getId()); - User user1 = this.getOne(new QueryWrapper().lambda() - .eq(User::getUsername,resources.getUsername())); - User user2 = this.getOne(new QueryWrapper().lambda() - .eq(User::getEmail,resources.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(); - redisUtils.del(key); - key = "role::findByUsers_Id:" + user.getId(); - redisUtils.del(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()); - user.setNickName(resources.getNickName()); - user.setSex(resources.getSex()); - this.saveOrUpdate(user); - } - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UserAvatarServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UserAvatarServiceImpl.java deleted file mode 100644 index 51aefcdd..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UserAvatarServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.impl; - -import co.yixiang.modules.system.domain.UserAvatar; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; -import co.yixiang.modules.system.service.UserAvatarService; -import co.yixiang.modules.system.service.dto.UserAvatarDto; -import co.yixiang.modules.system.service.dto.UserAvatarQueryCriteria; -import co.yixiang.modules.system.service.mapper.UserAvatarMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -// 默认不使用缓存 -//import org.springframework.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "userAvatar") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class UserAvatarServiceImpl extends BaseServiceImpl implements UserAvatarService { - - private final IGenerator generator; - - @Override - //@Cacheable - public Map queryAll(UserAvatarQueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), UserAvatarDto.class)); - map.put("totalElements", page.getTotal()); - return map; - } - - - @Override - //@Cacheable - public List queryAll(UserAvatarQueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(UserAvatar.class, criteria)); - } - - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (UserAvatarDto userAvatar : all) { - Map map = new LinkedHashMap<>(); - map.put("真实文件名", userAvatar.getRealName()); - map.put("路径", userAvatar.getPath()); - map.put("大小", userAvatar.getSize()); - map.put("创建时间", userAvatar.getCreateTime()); - map.put("真实文件名", userAvatar.getRealName()); - map.put("路径", userAvatar.getPath()); - map.put("大小", userAvatar.getSize()); - map.put("创建时间", userAvatar.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public UserAvatar saveFile(UserAvatar userAvatar) { - //todo - return null; - } -} 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..d75fb13a --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UserServiceImpl.java @@ -0,0 +1,218 @@ +package co.yixiang.modules.system.service.impl; + +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.modules.system.domain.User; +import co.yixiang.exception.EntityExistException; +import co.yixiang.exception.EntityNotFoundException; +import co.yixiang.modules.system.domain.UserAvatar; +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.Value; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +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 +@CacheConfig(cacheNames = "user") +@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) +public class UserServiceImpl implements UserService { + + private final UserRepository userRepository; + private final UserMapper userMapper; + private final RedisUtils redisUtils; + private final UserAvatarRepository userAvatarRepository; + + @Value("${file.avatar}") + private String avatar; + + public UserServiceImpl(UserRepository userRepository, UserMapper userMapper, RedisUtils redisUtils, UserAvatarRepository userAvatarRepository) { + this.userRepository = userRepository; + this.userMapper = userMapper; + this.redisUtils = redisUtils; + this.userAvatarRepository = userAvatarRepository; + } + + @Override + @Cacheable + 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 + @Cacheable + public List queryAll(UserQueryCriteria criteria) { + List users = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); + return userMapper.toDto(users); + } + + @Override + @Cacheable(key = "#p0") + public UserDTO findById(long id) { + User user = userRepository.findById(id).orElseGet(User::new); + ValidationUtil.isNull(user.getId(),"User","id",id); + return userMapper.toDto(user); + } + + @Override + @CacheEvict(allEntries = true) + @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()); + } + return userMapper.toDto(userRepository.save(resources)); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void update(User resources) { + User user = userRepository.findById(resources.getId()).orElseGet(User::new); + ValidationUtil.isNull(user.getId(),"User","id",resources.getId()); + 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(); + redisUtils.del(key); + key = "role::findByUsers_Id:" + user.getId(); + redisUtils.del(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()); + user.setNickName(resources.getNickName()); + user.setSex(resources.getSex()); + userRepository.save(user); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void updateCenter(User resources) { + User user = userRepository.findById(resources.getId()).orElseGet(User::new); + user.setNickName(resources.getNickName()); + user.setPhone(resources.getPhone()); + user.setSex(resources.getSex()); + userRepository.save(user); + } + + @Override + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void delete(Set ids) { + for (Long id : ids) { + userRepository.deleteById(id); + } + } + + @Override + @Cacheable(key = "'loadUserByUsername:'+#p0") + public UserDTO findByName(String userName) { + User user; + 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 + @CacheEvict(allEntries = true) + @Transactional(rollbackFor = Exception.class) + public void updatePass(String username, String pass) { + userRepository.updatePass(username,pass,new Date()); + } + + @Override + @CacheEvict(allEntries = true) + @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); + assert file != null; + 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 + @CacheEvict(allEntries = true) + @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/impl/UsersRolesServiceImpl.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UsersRolesServiceImpl.java deleted file mode 100644 index f45f108d..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/impl/UsersRolesServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.impl; - -import co.yixiang.modules.system.domain.UsersRoles; -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.modules.system.service.UsersRolesService; -import co.yixiang.modules.system.service.mapper.UsersRolesMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "usersRoles") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class UsersRolesServiceImpl extends BaseServiceImpl implements UsersRolesService { - -} 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 index 9c42db33..d94d99a2 100644 --- 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 @@ -1,34 +1,16 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.modules.system.service.dto.DeptDTO; +import co.yixiang.base.BaseMapper; import co.yixiang.modules.system.domain.Dept; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.springframework.security.core.parameters.P; -import org.springframework.stereotype.Repository; - -import java.util.Set; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-25 */ -@Repository -@Mapper -public interface DeptMapper extends CoreMapper { +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DeptMapper extends BaseMapper { - @Select("select m.* from dept m LEFT JOIN roles_depts t on m.id= t.dept_id LEFT JOIN role r on r.id = t.role_id where r.id = ${roleId}") - Set findDeptByRoleId(@Param("roleId") Long roleId); - - @Select("select * from dept m LEFT JOIN roles_depts t on m.id= t.dept_id LEFT JOIN role r on r.id = t.role_id where r.id = #{roleId}") - Set findDeptByRoleIds(@Param("roleIds") Set roleId); -} +} \ 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..cb154414 --- /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.base.BaseMapper; +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",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DeptSmallMapper extends BaseMapper { + +} \ 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 index 7a776f43..c6bb6526 100644 --- 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 @@ -1,31 +1,16 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.base.BaseMapper; import co.yixiang.modules.system.domain.DictDetail; -import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.springframework.stereotype.Repository; - -import java.util.List; +import co.yixiang.modules.system.service.dto.DictDetailDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ -@Repository -@Mapper -public interface DictDetailMapper extends CoreMapper { +@Mapper(componentModel = "spring", uses = {DictSmallMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DictDetailMapper extends BaseMapper { - @Select("") - List selectDictDetailList(@Param("label") String label,@Param("dictName") String dictName); -} +} \ 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 index 1ddb63aa..3dc6ae6c 100644 --- 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 @@ -1,24 +1,16 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.modules.system.service.dto.DictDTO; +import co.yixiang.base.BaseMapper; import co.yixiang.modules.system.domain.Dict; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-04-10 */ -@Repository -@Mapper -public interface DictMapper extends CoreMapper { +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DictMapper extends BaseMapper { -} +} \ No newline at end of file diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictSmallMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictSmallMapper.java new file mode 100644 index 00000000..9976a7a5 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/DictSmallMapper.java @@ -0,0 +1,16 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.modules.system.service.dto.DictSmallDto; +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.system.domain.Dict; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-04-10 +*/ +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DictSmallMapper extends BaseMapper { + +} \ 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 index d38780b0..47ce84b0 100644 --- 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 @@ -1,24 +1,25 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.base.BaseMapper; import co.yixiang.modules.system.domain.Job; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; +import co.yixiang.modules.system.service.dto.JobDTO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.ReportingPolicy; /** -* @author hupeng -* @date 2020-05-14 +* @author Zheng Jie +* @date 2019-03-29 */ -@Repository -@Mapper -public interface JobMapper extends CoreMapper { +@Mapper(componentModel = "spring",uses = {DeptMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface JobMapper extends BaseMapper { -} + /** + * 转Dto + * @param job 原始数据 + * @param deptSuperiorName / + * @return / + */ + @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..22fc89f7 --- /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.modules.system.service.dto.JobSmallDTO; +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.system.domain.Job; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @author Zheng Jie +* @date 2019-03-29 +*/ +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface JobSmallMapper extends BaseMapper { + +} \ 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 index abef3bd0..76ad0084 100644 --- 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 @@ -1,42 +1,16 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.base.BaseMapper; import co.yixiang.modules.system.domain.Menu; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; +import co.yixiang.modules.system.service.dto.MenuDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** -* @author hupeng -* @date 2020-05-14 -*/ -@Repository -@Mapper -public interface MenuMapper extends CoreMapper { + * @author Zheng Jie + * @date 2018-12-17 + */ +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface MenuMapper extends BaseMapper { - - /** - * 根据菜单的 PID 查询 - * @param pid / - * @return / - */ - @Select("SELECT * from menu m where m.pid = #{pid} ") - List findByPid(@Param("pid") long pid); - - @Select("select m.* from menu m LEFT JOIN roles_menus t on m.id= t.menu_id LEFT JOIN role r on r.id = t.role_id where r.id = #{roleId}") - Set findMenuByRoleId(@Param("roleId") Long roleId); - @Select("") - List selectListByRoles(@Param("roleIds") List roleIds); } 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 index 4ab6486c..e2b9c3f8 100644 --- 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 @@ -1,57 +1,16 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package co.yixiang.modules.system.service.mapper; -import co.yixiang.common.mapper.CoreMapper; +import co.yixiang.base.BaseMapper; import co.yixiang.modules.system.domain.Role; -import org.apache.ibatis.annotations.Delete; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; +import co.yixiang.modules.system.service.dto.RoleDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; /** -* @author hupeng -* @date 2020-05-14 -*/ -@Repository -@Mapper -public interface RoleMapper extends CoreMapper { - - /** - * 根据用户ID查询 - * @param id 用户ID - * @return - */ - @Select( "SELECT r.id,r.create_time,r.data_scope,r.`level`,r.`name`,r.permission,r.remark " + - "FROM role r LEFT OUTER JOIN users_roles u1 ON r.id = u1.role_id " + - "LEFT OUTER JOIN user u2 ON u1.user_id = u2.id "+ - "WHERE u2.id = #{id}") - Set findByUsers_Id(@Param("id") Long id); - - /** - * 解绑角色菜单 - * @param id 菜单ID - */ - @Delete("delete from roles_menus where menu_id = #{id}") - void untiedMenu(@Param("id") Long id); - - /** - * 根据用户ID查询 - * - * @param id 用户ID - * @return - */ - @Select("select m.* from role m LEFT JOIN users_roles t on m.id= t.role_id LEFT JOIN `user` r on r.id = t.user_id where r.id = #{id}") - List selectListByUserId(@Param("id") Long id); + * @author Zheng Jie + * @date 2018-11-23 + */ +@Mapper(componentModel = "spring", uses = {MenuMapper.class, DeptMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface RoleMapper extends BaseMapper { } 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..6894769a --- /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.modules.system.service.dto.RoleSmallDTO; +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.system.domain.Role; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Zheng Jie + * @date 2019-5-23 + */ +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface RoleSmallMapper extends BaseMapper { + +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RolesDeptsMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RolesDeptsMapper.java deleted file mode 100644 index 11050caf..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RolesDeptsMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.system.domain.RolesDepts; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Repository -@Mapper -public interface RolesDeptsMapper extends CoreMapper { - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RolesMenusMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RolesMenusMapper.java deleted file mode 100644 index 5559cf88..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/RolesMenusMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.system.domain.RolesMenus; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Repository -@Mapper -public interface RolesMenusMapper extends CoreMapper { - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/SysUserMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/SysUserMapper.java deleted file mode 100644 index b61f2aa0..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/SysUserMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.system.domain.User; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Update; -import org.springframework.stereotype.Repository; - -import java.util.Date; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Repository -@Mapper -public interface SysUserMapper extends CoreMapper { - - /** - * 修改密码 - * @param username 用户名 - * @param password 密码 - * @param lastPasswordResetTime / - */ - @Update("update `user` set password = password+${password} , last_password_reset_time = lastPasswordResetTime+${lastPasswordResetTime} where username = #{username}") - void updatePass( @Param("password") String password,@Param("lastPasswordResetTime") Date lastPasswordResetTime, @Param("username") String username); - - /** - * 修改邮箱 - * @param username 用户名 - * @param email 邮箱 - */ - @Update("update `user` set email = email+ ${email} where username = #{username}") - void updateEmail(@Param("email") String email, @Param("username") String username); - -} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UserAvatarMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UserAvatarMapper.java deleted file mode 100644 index 5f2c5215..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UserAvatarMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.system.domain.UserAvatar; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-14 -*/ -@Repository -@Mapper -public interface UserAvatarMapper extends CoreMapper { - -} 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..23715cb6 --- /dev/null +++ b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UserMapper.java @@ -0,0 +1,25 @@ +package co.yixiang.modules.system.service.mapper; + +import co.yixiang.modules.system.service.dto.UserDTO; +import co.yixiang.base.BaseMapper; +import co.yixiang.modules.system.domain.User; +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 BaseMapper { + + /** + * 转换 + * @param user 原始数据 + * @return / + */ + @Override + @Mapping(source = "user.userAvatar.realName",target = "avatar") + UserDTO toDto(User user); +} diff --git a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UsersRolesMapper.java b/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UsersRolesMapper.java deleted file mode 100644 index 6cc25339..00000000 --- a/yshop-system/src/main/java/co/yixiang/modules/system/service/mapper/UsersRolesMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package co.yixiang.modules.system.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import co.yixiang.modules.system.domain.UsersRoles; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author hupeng -* @date 2020-05-16 -*/ -@Repository -@Mapper -public interface UsersRolesMapper extends CoreMapper { - -} diff --git a/yshop-system/src/main/resources/config/application-dev.yml b/yshop-system/src/main/resources/config/application-dev.yml index ff44b968..655187ac 100644 --- a/yshop-system/src/main/resources/config/application-dev.yml +++ b/yshop-system/src/main/resources/config/application-dev.yml @@ -1,14 +1,12 @@ #配置数据源 spring: - application: - name: yshop-system 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&zeroDateTimeBehavior=convertToNull + url: jdbc:log4jdbc:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false username: root - password: 123456 + password: root # 初始化配置 initial-size: 3 @@ -51,7 +49,7 @@ spring: database: 0 host: 127.0.0.1 port: 6379 - password: + password: root #连接超时时间 timeout: 5000 @@ -79,24 +77,14 @@ generator: swagger: enabled: true title: yshop商城管理后台API - serverUrl: - version: 2.1 + serverUrl: http://localhost:8000 + version: 2.0 # 文件存储路径 file: - path: D:\upload\file\ - avatar: D:\upload\avatar\ + path: D:\yshop\file\ + avatar: D:\yshop\avatar\ # 文件大小 /M maxSize: 100 avatarMaxSize: 5 - localUrl: - -mybatis-plus: - check-config-location: true - configuration: - map-underscore-to-camel-case: true - global-config: - db-config: - id-type: auto - logic-delete-value: 1 - logic-not-delete-value: 0 + localUrl: http://localhost:8000 diff --git a/yshop-system/src/main/resources/config/application-prod.yml b/yshop-system/src/main/resources/config/application-prod.yml index a97916fb..73bf43b3 100644 --- a/yshop-system/src/main/resources/config/application-prod.yml +++ b/yshop-system/src/main/resources/config/application-prod.yml @@ -1,14 +1,12 @@ #配置数据源 spring: - application: - name: yshop-system datasource: druid: type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://localhost:3366/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false - username: root - password: root + url: jdbc:log4jdbc:mysql://localhost:3306/yshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false + username: yshop + password: # 初始化配置 initial-size: 3 @@ -49,7 +47,7 @@ spring: database: 0 host: 127.0.0.1 port: 6379 - password: root + password: #连接超时时间 timeout: 5000 @@ -82,29 +80,14 @@ generator: swagger: enabled: true title: yshop商城管理后台API - serverUrl: http://127.0.0.1:8000 + serverUrl: http://localhost:8000 version: 2.1 # 文件存储路径 file: - path: D:\upload\file\ - avatar: D:\upload\avatar\ + path: /home/yshop/file/ + avatar: /home/yshop/avatar/ # 文件大小 /M maxSize: 100 avatarMaxSize: 5 - localUrl: https://cdn.jidanguo10.com -mybatis-plus: - check-config-location: true - configuration: - map-underscore-to-camel-case: true - global-config: - db-config: - id-type: id_worker - logic-delete-value: 1 - logic-not-delete-value: 0 - mapper-locations: classpath*:mapper/**/*Mapper.xml - -yshop: - hApi: https://127.0.0.1:8000 - wechatCode: http://127.0.0.1:8000/upload/qrcode_for_gh_2ac8f422a79f_258.jpg - miniAppID: + localUrl: \ 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 index 56b5fe41..51d0b688 100644 --- a/yshop-system/src/main/resources/config/application.yml +++ b/yshop-system/src/main/resources/config/application.yml @@ -13,6 +13,12 @@ spring: repositories: enabled: false + #配置 Jpa + jpa: + properties: + hibernate: + dialect: org.hibernate.dialect.MySQL5InnoDBDialect + open-in-view: true task: pool: @@ -52,12 +58,4 @@ yshop: enable: true appId: 1607734 appKey: 81f43a2e-f504-45c4-9b54-2637d59f8190 - apiUrl: https://zapi.jidanguo10.com/api - - -# PageHelper分页插件 -pagehelper: - helperDialect: mysql - reasonable: true - supportMethodsArguments: true - params: count=countSql + apiUrl: http://127.0.0.1:8009/api \ No newline at end of file diff --git a/yshop-system/src/main/resources/logback.xml b/yshop-system/src/main/resources/logback.xml index ba3e1ee2..f8639eb5 100644 --- a/yshop-system/src/main/resources/logback.xml +++ b/yshop-system/src/main/resources/logback.xml @@ -3,7 +3,7 @@ yshop - + @@ -12,60 +12,9 @@ - - - ${log.path}/debug.log - - ${log.path}/%d{yyyy-MM}/debug.%d{yyyy-MM-dd}.%i.log.gz - 50MB - 30 - - - %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n - UTF-8 - - - - - - ${log.path}/error.log - - ${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz - 50MB - 30 - - - %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n - UTF-8 - - - ERROR - - - - - - ${log.path}/info.log - - ${log.path}/%d{yyyy-MM}/info.%d{yyyy-MM-dd}.%i.log.gz - 50MB - 30 - - - %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n - UTF-8 - - - INFO - - - - - - @@ -93,4 +42,4 @@ - + \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/Controller.ftl b/yshop-system/src/main/resources/template/generator/admin/Controller.ftl index 1b0ca785..28fbdb82 100644 --- a/yshop-system/src/main/resources/template/generator/admin/Controller.ftl +++ b/yshop-system/src/main/resources/template/generator/admin/Controller.ftl @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package ${package}.rest; import co.yixiang.aop.log.Log; @@ -78,4 +70,4 @@ public class ${className}Controller { ${changeClassName}Service.deleteAll(ids); return new ResponseEntity<>(HttpStatus.OK); } -} +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/ControllerP.ftl b/yshop-system/src/main/resources/template/generator/admin/ControllerP.ftl deleted file mode 100644 index ef11f71b..00000000 --- a/yshop-system/src/main/resources/template/generator/admin/ControllerP.ftl +++ /dev/null @@ -1,85 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package ${package}.rest; -import java.util.Arrays; -import co.yixiang.dozer.service.IGenerator; -import lombok.AllArgsConstructor; -import co.yixiang.logging.aop.log.Log; -import ${package}.domain.${className}; -import ${package}.service.${className}Service; -import ${package}.service.dto.${className}QueryCriteria; -import ${package}.service.dto.${className}Dto; -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.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author ${author} -* @date ${date} -*/ -@AllArgsConstructor -@Api(tags = "${apiAlias}管理") -@RestController -@RequestMapping("/api/${changeClassName}") -public class ${className}Controller { - - private final ${className}Service ${changeClassName}Service; - private final IGenerator generator; - - - @Log("导出数据") - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('admin','${changeClassName}:list')") - public void download(HttpServletResponse response, ${className}QueryCriteria criteria) throws IOException { - ${changeClassName}Service.download(generator.convert(${changeClassName}Service.queryAll(criteria), ${className}Dto.class), response); - } - - @GetMapping - @Log("查询${apiAlias}") - @ApiOperation("查询${apiAlias}") - @PreAuthorize("@el.check('admin','${changeClassName}:list')") - public ResponseEntity get${className}s(${className}QueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(${changeClassName}Service.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @Log("新增${apiAlias}") - @ApiOperation("新增${apiAlias}") - @PreAuthorize("@el.check('admin','${changeClassName}:add')") - public ResponseEntity create(@Validated @RequestBody ${className} resources){ - return new ResponseEntity<>(${changeClassName}Service.save(resources),HttpStatus.CREATED); - } - - @PutMapping - @Log("修改${apiAlias}") - @ApiOperation("修改${apiAlias}") - @PreAuthorize("@el.check('admin','${changeClassName}:edit')") - public ResponseEntity update(@Validated @RequestBody ${className} resources){ - ${changeClassName}Service.updateById(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除${apiAlias}") - @ApiOperation("删除${apiAlias}") - @PreAuthorize("@el.check('admin','${changeClassName}:del')") - @DeleteMapping - public ResponseEntity deleteAll(@RequestBody ${pkColumnType}[] ids) { - Arrays.asList(ids).forEach(id->{ - ${changeClassName}Service.removeById(id); - }); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/yshop-system/src/main/resources/template/generator/admin/Dto.ftl b/yshop-system/src/main/resources/template/generator/admin/Dto.ftl index de74ea19..dc478f5e 100644 --- a/yshop-system/src/main/resources/template/generator/admin/Dto.ftl +++ b/yshop-system/src/main/resources/template/generator/admin/Dto.ftl @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package ${package}.service.dto; import lombok.Data; @@ -42,4 +34,4 @@ public class ${className}Dto implements Serializable { private ${column.columnType} ${column.changeColumnName}; -} +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/DtoP.ftl b/yshop-system/src/main/resources/template/generator/admin/DtoP.ftl deleted file mode 100644 index 0473058e..00000000 --- a/yshop-system/src/main/resources/template/generator/admin/DtoP.ftl +++ /dev/null @@ -1,47 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -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.remark != ''> - /** ${column.remark} */ - - <#if column.columnKey = 'PRI'> - <#if !auto && pkColumnType = 'Long'> - /** 防止精度丢失 */ - @JsonSerialize(using= ToStringSerializer.class) - - - <#if column.changeColumnName != 'delFlag'> - private ${column.columnType} ${column.changeColumnName}; - - - -} diff --git a/yshop-system/src/main/resources/template/generator/admin/Entity.ftl b/yshop-system/src/main/resources/template/generator/admin/Entity.ftl index 743e6255..34d18934 100644 --- a/yshop-system/src/main/resources/template/generator/admin/Entity.ftl +++ b/yshop-system/src/main/resources/template/generator/admin/Entity.ftl @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package ${package}.domain; import lombok.Data; @@ -70,4 +62,4 @@ public class ${className} implements Serializable { 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/EntityP.ftl b/yshop-system/src/main/resources/template/generator/admin/EntityP.ftl deleted file mode 100644 index 41d7ddd1..00000000 --- a/yshop-system/src/main/resources/template/generator/admin/EntityP.ftl +++ /dev/null @@ -1,78 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package ${package}.domain; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import com.baomidou.mybatisplus.annotation.TableName; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -<#if isNotNullColumns??> -import javax.validation.constraints.*; - -<#if hasDateAnnotation> - -<#if hasTimestamp> -import java.sql.Timestamp; - -<#if hasBigDecimal> -import java.math.BigDecimal; - -import java.io.Serializable; - -/** -* @author ${author} -* @date ${date} -*/ -@Data -@TableName("${tableName}") -public class ${className} implements Serializable { -<#if columns??> - <#list columns as column> - - <#if column.remark != ''> - /** ${column.remark} */ - - <#if column.columnKey = 'PRI'> - @TableId - - <#if column.istNotNull && column.columnKey != 'PRI'> - <#if column.columnType = 'String'> - @NotBlank - <#else> - @NotNull - - - <#if column.dateAnnotation??> - <#if column.dateAnnotation = 'CreationTimestamp'> - @CreationTimestamp - <#else> - @UpdateTimestamp - - - <#if column.changeColumnName = 'updateTime'|| column.changeColumnName = 'updateDate'> - @TableField(fill= FieldFill.INSERT_UPDATE) - - <#if column.changeColumnName = 'createTime' || column.changeColumnName = 'createDate'> - @TableField(fill= FieldFill.INSERT) - - <#if column.changeColumnName = 'delFlag'> - @TableLogic - @TableField(fill=FieldFill.INSERT_UPDATE) - private Boolean ${column.changeColumnName}; - <#else> - private ${column.columnType} ${column.changeColumnName}; - - - - - - public void copy(${className} source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/yshop-system/src/main/resources/template/generator/admin/Mapper.ftl b/yshop-system/src/main/resources/template/generator/admin/Mapper.ftl index 17b2418c..bf4538a9 100644 --- a/yshop-system/src/main/resources/template/generator/admin/Mapper.ftl +++ b/yshop-system/src/main/resources/template/generator/admin/Mapper.ftl @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package ${package}.service.mapper; import co.yixiang.base.BaseMapper; @@ -21,4 +13,4 @@ import org.mapstruct.ReportingPolicy; @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) public interface ${className}Mapper extends BaseMapper<${className}Dto, ${className}> { -} +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/MapperP.ftl b/yshop-system/src/main/resources/template/generator/admin/MapperP.ftl deleted file mode 100644 index 29d24c4e..00000000 --- a/yshop-system/src/main/resources/template/generator/admin/MapperP.ftl +++ /dev/null @@ -1,24 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package ${package}.service.mapper; - -import co.yixiang.common.mapper.CoreMapper; -import ${package}.domain.${className}; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -/** -* @author ${author} -* @date ${date} -*/ -@Repository -@Mapper -public interface ${className}Mapper extends CoreMapper<${className}> { - -} diff --git a/yshop-system/src/main/resources/template/generator/admin/QueryCriteria.ftl b/yshop-system/src/main/resources/template/generator/admin/QueryCriteria.ftl index 1206846e..20d5f854 100644 --- a/yshop-system/src/main/resources/template/generator/admin/QueryCriteria.ftl +++ b/yshop-system/src/main/resources/template/generator/admin/QueryCriteria.ftl @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package ${package}.service.dto; import lombok.Data; @@ -70,4 +62,4 @@ public class ${className}QueryCriteria{ private List<${column.columnType}> createTime; -} +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/QueryCriteriaP.ftl b/yshop-system/src/main/resources/template/generator/admin/QueryCriteriaP.ftl deleted file mode 100644 index 1206846e..00000000 --- a/yshop-system/src/main/resources/template/generator/admin/QueryCriteriaP.ftl +++ /dev/null @@ -1,73 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package ${package}.service.dto; - -import lombok.Data; -<#if queryHasTimestamp> -import java.sql.Timestamp; - -<#if queryHasBigDecimal> -import java.math.BigDecimal; - -<#if betweens??> -import java.util.List; - -<#if queryColumns??> -import co.yixiang.annotation.Query; - - -/** -* @author ${author} -* @date ${date} -*/ -@Data -public class ${className}QueryCriteria{ -<#if queryColumns??> - <#list queryColumns as column> - -<#if column.queryType = '='> - /** 精确 */ - @Query - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = 'Like'> - /** 模糊 */ - @Query(type = Query.Type.INNER_LIKE) - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = '!='> - /** 不等于 */ - @Query(type = Query.Type.NOT_EQUAL) - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = 'NotNull'> - /** 不为空 */ - @Query(type = Query.Type.NOT_NULL) - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = '>='> - /** 大于等于 */ - @Query(type = Query.Type.GREATER_THAN) - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = '<='> - /** 小于等于 */ - @Query(type = Query.Type.LESS_THAN) - private ${column.columnType} ${column.changeColumnName}; - - - -<#if betweens??> - <#list betweens as column> - /** BETWEEN */ - @Query(type = Query.Type.BETWEEN) - private List<${column.columnType}> createTime; - - -} diff --git a/yshop-system/src/main/resources/template/generator/admin/Repository.ftl b/yshop-system/src/main/resources/template/generator/admin/Repository.ftl index bd33fc8f..e1b7f28f 100644 --- a/yshop-system/src/main/resources/template/generator/admin/Repository.ftl +++ b/yshop-system/src/main/resources/template/generator/admin/Repository.ftl @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package ${package}.repository; import ${package}.domain.${className}; @@ -29,4 +21,4 @@ public interface ${className}Repository extends JpaRepository<${className}, ${pk -} +} \ 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 index d2288339..4ba4a0e7 100644 --- a/yshop-system/src/main/resources/template/generator/admin/Service.ftl +++ b/yshop-system/src/main/resources/template/generator/admin/Service.ftl @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package ${package}.service; import ${package}.domain.${className}; @@ -71,4 +63,4 @@ public interface ${className}Service { * @throws IOException / */ void download(List<${className}Dto> all, HttpServletResponse response) throws IOException; -} +} \ 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 index eddabeee..c8982f4c 100644 --- a/yshop-system/src/main/resources/template/generator/admin/ServiceImpl.ftl +++ b/yshop-system/src/main/resources/template/generator/admin/ServiceImpl.ftl @@ -1,11 +1,3 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ package ${package}.service.impl; import ${package}.domain.${className}; @@ -95,10 +87,10 @@ public class ${className}ServiceImpl implements ${className}Service { public ${className}Dto create(${className} resources) { <#if !auto && pkColumnType = 'Long'> Snowflake snowflake = IdUtil.createSnowflake(1, 1); - resources.set${pkCapitalColName}(snowflake.nextId()); + resources.set${pkCapitalColName}(snowflake.nextId()); <#if !auto && pkColumnType = 'String'> - resources.set${pkCapitalColName}(IdUtil.simpleUUID()); + resources.set${pkCapitalColName}(IdUtil.simpleUUID()); <#if columns??> <#list columns as column> @@ -161,4 +153,4 @@ public class ${className}ServiceImpl implements ${className}Service { } FileUtil.downloadExcel(list, response); } -} +} \ No newline at end of file diff --git a/yshop-system/src/main/resources/template/generator/admin/ServiceImplP.ftl b/yshop-system/src/main/resources/template/generator/admin/ServiceImplP.ftl deleted file mode 100644 index 541473c8..00000000 --- a/yshop-system/src/main/resources/template/generator/admin/ServiceImplP.ftl +++ /dev/null @@ -1,107 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package ${package}.service.impl; - -import ${package}.domain.${className}; -<#if columns??> - <#list columns as column> - <#if column.columnKey = 'UNI'> - <#if column_index = 1> -import co.yixiang.exception.EntityExistException; - - - - -import co.yixiang.common.service.impl.BaseServiceImpl; -import lombok.AllArgsConstructor; -import co.yixiang.dozer.service.IGenerator; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import co.yixiang.common.utils.QueryHelpPlus; -import co.yixiang.utils.ValidationUtil; -import co.yixiang.utils.FileUtil; -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.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; -<#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.cache.annotation.CacheConfig; -//import org.springframework.cache.annotation.CacheEvict; -//import org.springframework.cache.annotation.Cacheable; -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; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; - -/** -* @author ${author} -* @date ${date} -*/ -@Service -@AllArgsConstructor -//@CacheConfig(cacheNames = "${changeClassName}") -@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) -public class ${className}ServiceImpl extends BaseServiceImpl<${className}Mapper, ${className}> implements ${className}Service { - - private final IGenerator generator; - - @Override - //@Cacheable - public Map queryAll(${className}QueryCriteria criteria, Pageable pageable) { - getPage(pageable); - PageInfo<${className}> page = new PageInfo<>(queryAll(criteria)); - Map map = new LinkedHashMap<>(2); - map.put("content", generator.convert(page.getList(), ${className}Dto.class)); - map.put("totalElements", page.getTotal()); - return map; - } - - - @Override - //@Cacheable - public List<${className}> queryAll(${className}QueryCriteria criteria){ - return baseMapper.selectList(QueryHelpPlus.getPredicate(${className}.class, criteria)); - } - - - @Override - public void download(List<${className}Dto> all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (${className}Dto ${changeClassName} : all) { - Map map = new LinkedHashMap<>(); - <#list columns as column> - <#if column.columnKey != 'PRI'> - <#if column.remark != ''> - map.put("${column.remark}", ${changeClassName}.get${column.capitalColumnName}()); - <#else> - map.put(" ${column.changeColumnName}", ${changeClassName}.get${column.capitalColumnName}()); - - - - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/yshop-system/src/main/resources/template/generator/admin/ServiceP.ftl b/yshop-system/src/main/resources/template/generator/admin/ServiceP.ftl deleted file mode 100644 index 24c5c81c..00000000 --- a/yshop-system/src/main/resources/template/generator/admin/ServiceP.ftl +++ /dev/null @@ -1,48 +0,0 @@ -/** -* Copyright (C) 2018-2020 -* All rights reserved, Designed By www.yixiang.co -* 注意: -* 本软件为www.yixiang.co开发研制,未经购买不得使用 -* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) -* 一经发现盗用、分享等行为,将追究法律责任,后果自负 -*/ -package ${package}.service; -import co.yixiang.common.service.BaseService; -import ${package}.domain.${className}; -import ${package}.service.dto.${className}Dto; -import ${package}.service.dto.${className}QueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @author ${author} -* @date ${date} -*/ -public interface ${className}Service extends BaseService<${className}>{ - -/** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(${className}QueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List<${className}Dto> - */ - List<${className}> queryAll(${className}QueryCriteria criteria); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List<${className}Dto> all, HttpServletResponse response) throws IOException; -} diff --git a/yshop-system/src/main/resources/template/generator/front/index.ftl b/yshop-system/src/main/resources/template/generator/front/index.ftl index 8295620b..1d7f98d4 100644 --- a/yshop-system/src/main/resources/template/generator/front/index.ftl +++ b/yshop-system/src/main/resources/template/generator/front/index.ftl @@ -61,15 +61,6 @@ <#else> 未设置字典,请手动设置 Select - <#elseif column.formType = 'Imges'> - <#else> @@ -87,33 +78,25 @@ <#if columns??> - <#list columns as column> - <#if column.columnShow> - <#if column.dictName??> + <#list columns as column> + <#if column.columnShow> + <#if column.dictName??> - <#elseif column.formType = 'Imges'> - - - - <#elseif column.columnType != 'Timestamp'> + <#elseif column.columnType != 'Timestamp'> - <#else> + <#else> - - - + + +