From 94b4954c37d65ba99fd3505096b7675abf259907 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 22 Oct 2024 15:36:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BA=97=E9=93=BA=E9=85=8D=E7=BD=AE=20?= =?UTF-8?q?=E5=BA=97=E9=93=BA=E8=A3=85=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - LICENSE | 191 -------- README.en.md | 36 -- eladmin-generator/pom.xml | 39 -- .../cn/ysk/cashier/domain/ColumnInfo.java | 83 ---- .../java/cn/ysk/cashier/domain/GenConfig.java | 64 --- .../cn/ysk/cashier/domain/vo/TableInfo.java | 34 -- .../repository/ColumnInfoRepository.java | 20 - .../repository/GenConfigRepository.java | 19 - .../ysk/cashier/rest/GenConfigController.java | 37 -- .../ysk/cashier/rest/GeneratorController.java | 93 ---- .../ysk/cashier/service/GenConfigService.java | 26 -- .../ysk/cashier/service/GeneratorService.java | 82 ---- .../service/impl/GenConfigServiceImpl.java | 52 --- .../service/impl/GeneratorServiceImpl.java | 192 --------- .../java/cn/ysk/cashier/utils/ColUtil.java | 40 -- .../java/cn/ysk/cashier/utils/GenUtil.java | 408 ------------------ .../shop/TbMerchantCouponController.java | 92 ---- .../ysk/cashier/dto/shop/TbShopInfoDto.java | 3 + .../cashier/mybatis/entity/TbShopExtend.java | 6 + .../service/impl/TbShopExtendServiceImpl.java | 5 +- .../cn/ysk/cashier/pojo/shop/TbShopInfo.java | 8 + pom.xml | 1 - 23 files changed, 21 insertions(+), 1511 deletions(-) delete mode 100644 LICENSE delete mode 100644 README.en.md delete mode 100644 eladmin-generator/pom.xml delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/domain/ColumnInfo.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/domain/GenConfig.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/domain/vo/TableInfo.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/repository/ColumnInfoRepository.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/repository/GenConfigRepository.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/rest/GenConfigController.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/rest/GeneratorController.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/service/GenConfigService.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/service/GeneratorService.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/service/impl/GenConfigServiceImpl.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/service/impl/GeneratorServiceImpl.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/utils/ColUtil.java delete mode 100644 eladmin-generator/src/main/java/cn/ysk/cashier/utils/GenUtil.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbMerchantCouponController.java diff --git a/.gitignore b/.gitignore index b8080da1..085c5046 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,5 @@ */target/* */*.iml /.gradle/ -/application.pid *.log logs/* \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index ca38718f..00000000 --- a/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -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 2019-2020 Zheng Jie - - 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.en.md b/README.en.md deleted file mode 100644 index 23dc80d7..00000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# cashierAdmin - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/eladmin-generator/pom.xml b/eladmin-generator/pom.xml deleted file mode 100644 index 9a3b4636..00000000 --- a/eladmin-generator/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - eladmin - cn.ysk.cashier - 2.6 - - 4.0.0 - - eladmin-generator - 代码生成模块 - - - 1.10 - - - - - cn.ysk.cashier - eladmin-common - 2.6 - - - - - org.springframework.boot - spring-boot-starter-freemarker - - - - - commons-configuration - commons-configuration - ${configuration.version} - - - \ No newline at end of file diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/domain/ColumnInfo.java b/eladmin-generator/src/main/java/cn/ysk/cashier/domain/ColumnInfo.java deleted file mode 100644 index 26e06feb..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/domain/ColumnInfo.java +++ /dev/null @@ -1,83 +0,0 @@ - -package cn.ysk.cashier.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import cn.ysk.cashier.utils.GenUtil; -import javax.persistence.*; -import java.io.Serializable; - -/** - * 列的数据信息 - * @author Zheng Jie - * @date 2019-01-02 - */ -@Getter -@Setter -@Entity -@NoArgsConstructor -@Table(name = "code_column_config") -public class ColumnInfo implements Serializable { - - @Id - @Column(name = "column_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @ApiModelProperty(value = "表名") - private String tableName; - - @ApiModelProperty(value = "数据库字段名称") - private String columnName; - - @ApiModelProperty(value = "数据库字段类型") - private String columnType; - - @ApiModelProperty(value = "数据库字段键类型") - private String keyType; - - @ApiModelProperty(value = "字段额外的参数") - private String extra; - - @ApiModelProperty(value = "数据库字段描述") - private String remark; - - @ApiModelProperty(value = "是否必填") - private Boolean notNull; - - @ApiModelProperty(value = "是否在列表显示") - private Boolean listShow; - - @ApiModelProperty(value = "是否表单显示") - private Boolean formShow; - - @ApiModelProperty(value = "表单类型") - private String formType; - - @ApiModelProperty(value = "查询 1:模糊 2:精确") - private String queryType; - - @ApiModelProperty(value = "字典名称") - private String dictName; - - @ApiModelProperty(value = "日期注解") - private String dateAnnotation; - - 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; - this.keyType = keyType; - this.extra = extra; - this.notNull = notNull; - if(GenUtil.PK.equalsIgnoreCase(keyType) && GenUtil.EXTRA.equalsIgnoreCase(extra)){ - this.notNull = false; - } - this.remark = remark; - this.listShow = true; - this.formShow = true; - } -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/domain/GenConfig.java b/eladmin-generator/src/main/java/cn/ysk/cashier/domain/GenConfig.java deleted file mode 100644 index e8188454..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/domain/GenConfig.java +++ /dev/null @@ -1,64 +0,0 @@ - -package cn.ysk.cashier.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * 代码生成配置 - * @author Zheng Jie - * @date 2019-01-03 - */ -@Getter -@Setter -@Entity -@NoArgsConstructor -@Table(name = "code_gen_config") -public class GenConfig implements Serializable { - - public GenConfig(String tableName) { - this.tableName = tableName; - } - - @Id - @Column(name = "config_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @NotBlank - @ApiModelProperty(value = "表名") - private String tableName; - - @ApiModelProperty(value = "接口名称") - private String apiAlias; - - @NotBlank - @ApiModelProperty(value = "包路径") - private String pack; - - @NotBlank - @ApiModelProperty(value = "模块名") - private String moduleName; - - @NotBlank - @ApiModelProperty(value = "前端文件路径") - private String path; - - @ApiModelProperty(value = "前端文件路径") - private String apiPath; - - @ApiModelProperty(value = "作者") - private String author; - - @ApiModelProperty(value = "表前缀") - private String prefix; - - @ApiModelProperty(value = "是否覆盖") - private Boolean cover = false; -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/domain/vo/TableInfo.java b/eladmin-generator/src/main/java/cn/ysk/cashier/domain/vo/TableInfo.java deleted file mode 100644 index 1144ff4c..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/domain/vo/TableInfo.java +++ /dev/null @@ -1,34 +0,0 @@ - -package cn.ysk.cashier.domain.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 表的数据信息 - * @author Zheng Jie - * @date 2019-01-02 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class TableInfo { - - /** 表名称 */ - private Object tableName; - - /** 创建日期 */ - private Object createTime; - - /** 数据库引擎 */ - private Object engine; - - /** 编码集 */ - private Object coding; - - /** 备注 */ - private Object remark; - - -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/repository/ColumnInfoRepository.java b/eladmin-generator/src/main/java/cn/ysk/cashier/repository/ColumnInfoRepository.java deleted file mode 100644 index faa0e05c..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/repository/ColumnInfoRepository.java +++ /dev/null @@ -1,20 +0,0 @@ - -package cn.ysk.cashier.repository; - -import cn.ysk.cashier.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/eladmin-generator/src/main/java/cn/ysk/cashier/repository/GenConfigRepository.java b/eladmin-generator/src/main/java/cn/ysk/cashier/repository/GenConfigRepository.java deleted file mode 100644 index e84a5ba6..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/repository/GenConfigRepository.java +++ /dev/null @@ -1,19 +0,0 @@ - -package cn.ysk.cashier.repository; - -import cn.ysk.cashier.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/eladmin-generator/src/main/java/cn/ysk/cashier/rest/GenConfigController.java b/eladmin-generator/src/main/java/cn/ysk/cashier/rest/GenConfigController.java deleted file mode 100644 index 4655820c..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/rest/GenConfigController.java +++ /dev/null @@ -1,37 +0,0 @@ - -package cn.ysk.cashier.rest; - -import cn.ysk.cashier.domain.GenConfig; -import cn.ysk.cashier.service.GenConfigService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -/** - * @author Zheng Jie - * @date 2019-01-14 - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/genConfig") -@Api(tags = "系统:代码生成器配置管理") -public class GenConfigController { - - private final GenConfigService genConfigService; - - @ApiOperation("查询") - @GetMapping(value = "/{tableName}") - public ResponseEntity queryGenConfig(@PathVariable String tableName){ - return new ResponseEntity<>(genConfigService.find(tableName), HttpStatus.OK); - } - - @PutMapping - @ApiOperation("修改") - public ResponseEntity updateGenConfig(@Validated @RequestBody GenConfig genConfig){ - return new ResponseEntity<>(genConfigService.update(genConfig.getTableName(), genConfig),HttpStatus.OK); - } -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/rest/GeneratorController.java b/eladmin-generator/src/main/java/cn/ysk/cashier/rest/GeneratorController.java deleted file mode 100644 index 02becca5..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/rest/GeneratorController.java +++ /dev/null @@ -1,93 +0,0 @@ - -package cn.ysk.cashier.rest; - -import cn.ysk.cashier.domain.ColumnInfo; -import cn.ysk.cashier.exception.BadRequestException; -import cn.ysk.cashier.service.GenConfigService; -import cn.ysk.cashier.service.GeneratorService; -import cn.ysk.cashier.utils.PageUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-01-02 - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/generator") -@Api(tags = "系统:代码生成管理") -public class GeneratorController { - - private final GeneratorService generatorService; - private final GenConfigService genConfigService; - - @Value("${generator.enabled}") - private Boolean generatorEnabled; - - @ApiOperation("查询数据库数据") - @GetMapping(value = "/tables/all") - public ResponseEntity queryAllTables(){ - return new ResponseEntity<>(generatorService.getTables(), HttpStatus.OK); - } - - @ApiOperation("查询数据库数据") - @GetMapping(value = "/tables") - public ResponseEntity queryTables(@RequestParam(defaultValue = "") String name, - @RequestParam(defaultValue = "0")Integer page, - @RequestParam(defaultValue = "10")Integer size){ - int[] startEnd = PageUtil.transToStartEnd(page, size); - return new ResponseEntity<>(generatorService.getTables(name,startEnd), HttpStatus.OK); - } - - @ApiOperation("查询字段数据") - @GetMapping(value = "/columns") - public ResponseEntity queryColumns(@RequestParam String tableName){ - List columnInfos = generatorService.getColumns(tableName); - return new ResponseEntity<>(PageUtil.toPage(columnInfos,columnInfos.size()), HttpStatus.OK); - } - - @ApiOperation("保存字段数据") - @PutMapping - public ResponseEntity saveColumn(@RequestBody List columnInfos){ - generatorService.save(columnInfos); - return new ResponseEntity<>(HttpStatus.OK); - } - - @ApiOperation("同步字段数据") - @PostMapping(value = "sync") - public ResponseEntity syncColumn(@RequestBody List tables){ - for (String table : tables) { - generatorService.sync(generatorService.getColumns(table), generatorService.query(table)); - } - return new ResponseEntity<>(HttpStatus.OK); - } - - @ApiOperation("生成代码") - @PostMapping(value = "/{tableName}/{type}") - public ResponseEntity generatorCode(@PathVariable String tableName, @PathVariable Integer type, HttpServletRequest request, HttpServletResponse response){ - if(!generatorEnabled && type == 0){ - throw new BadRequestException("此环境不允许生成代码,请选择预览或者下载查看!"); - } - switch (type){ - // 生成代码 - case 0: generatorService.generator(genConfigService.find(tableName), generatorService.getColumns(tableName)); - break; - // 预览 - case 1: return generatorService.preview(genConfigService.find(tableName), generatorService.getColumns(tableName)); - // 打包 - case 2: generatorService.download(genConfigService.find(tableName), generatorService.getColumns(tableName), request, response); - break; - default: throw new BadRequestException("没有这个选项"); - } - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/service/GenConfigService.java b/eladmin-generator/src/main/java/cn/ysk/cashier/service/GenConfigService.java deleted file mode 100644 index 131c78af..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/service/GenConfigService.java +++ /dev/null @@ -1,26 +0,0 @@ - -package cn.ysk.cashier.service; - -import cn.ysk.cashier.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/eladmin-generator/src/main/java/cn/ysk/cashier/service/GeneratorService.java b/eladmin-generator/src/main/java/cn/ysk/cashier/service/GeneratorService.java deleted file mode 100644 index d582c0da..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/service/GeneratorService.java +++ /dev/null @@ -1,82 +0,0 @@ - -package cn.ysk.cashier.service; - -import cn.ysk.cashier.domain.GenConfig; -import cn.ysk.cashier.domain.ColumnInfo; -import org.springframework.http.ResponseEntity; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-01-02 - */ -public interface GeneratorService { - - /** - * 查询数据库元数据 - * @param name 表名 - * @param startEnd 分页参数 - * @return / - */ - Object getTables(String name, int[] startEnd); - - /** - * 得到数据表的元数据 - * @param name 表名 - * @return / - */ - List getColumns(String name); - - /** - * 同步表数据 - * @param columnInfos / - * @param columnInfoList / - */ - void sync(List columnInfos, List columnInfoList); - - /** - * 保持数据 - * @param columnInfos / - */ - void save(List columnInfos); - - /** - * 获取所有table - * @return / - */ - Object getTables(); - - /** - * 代码生成 - * @param genConfig 配置信息 - * @param columns 字段信息 - */ - void generator(GenConfig genConfig, List columns); - - /** - * 预览 - * @param genConfig 配置信息 - * @param columns 字段信息 - * @return / - */ - ResponseEntity preview(GenConfig genConfig, List columns); - - /** - * 打包下载 - * @param genConfig 配置信息 - * @param columns 字段信息 - * @param request / - * @param response / - */ - void download(GenConfig genConfig, List columns, HttpServletRequest request, HttpServletResponse response); - - /** - * 查询数据库的表字段数据数据 - * @param table / - * @return / - */ - List query(String table); -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/service/impl/GenConfigServiceImpl.java b/eladmin-generator/src/main/java/cn/ysk/cashier/service/impl/GenConfigServiceImpl.java deleted file mode 100644 index 39be53f5..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/service/impl/GenConfigServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ - -package cn.ysk.cashier.service.impl; - -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.domain.GenConfig; -import cn.ysk.cashier.repository.GenConfigRepository; -import cn.ysk.cashier.service.GenConfigService; -import org.springframework.stereotype.Service; -import java.io.File; - -/** - * @author Zheng Jie - * @date 2019-01-14 - */ -@Service -@RequiredArgsConstructor -public class GenConfigServiceImpl implements GenConfigService { - - private final GenConfigRepository genConfigRepository; - - @Override - public GenConfig find(String tableName) { - GenConfig genConfig = genConfigRepository.findByTableName(tableName); - if(genConfig == null){ - return new GenConfig(tableName); - } - return genConfig; - } - - @Override - public GenConfig update(String tableName, GenConfig genConfig) { - String separator = File.separator; - String[] paths; - String symbol = "\\"; - if (symbol.equals(separator)) { - paths = genConfig.getPath().split("\\\\"); - } else { - paths = genConfig.getPath().split(File.separator); - } - StringBuilder api = new StringBuilder(); - for (String path : paths) { - api.append(path); - api.append(separator); - if ("src".equals(path)) { - api.append("api"); - break; - } - } - genConfig.setApiPath(api.toString()); - return genConfigRepository.save(genConfig); - } -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/service/impl/GeneratorServiceImpl.java b/eladmin-generator/src/main/java/cn/ysk/cashier/service/impl/GeneratorServiceImpl.java deleted file mode 100644 index 0547c4d7..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/service/impl/GeneratorServiceImpl.java +++ /dev/null @@ -1,192 +0,0 @@ - -package cn.ysk.cashier.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.ZipUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.domain.GenConfig; -import cn.ysk.cashier.domain.ColumnInfo; -import cn.ysk.cashier.domain.vo.TableInfo; -import cn.ysk.cashier.exception.BadRequestException; -import cn.ysk.cashier.repository.ColumnInfoRepository; -import cn.ysk.cashier.service.GeneratorService; -import cn.ysk.cashier.utils.FileUtil; -import cn.ysk.cashier.utils.GenUtil; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.utils.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - * @date 2019-01-02 - */ -@Service -@RequiredArgsConstructor -public class GeneratorServiceImpl implements GeneratorService { - private static final Logger log = LoggerFactory.getLogger(GeneratorServiceImpl.class); - @PersistenceContext - private EntityManager em; - - private final ColumnInfoRepository columnInfoRepository; - - private final String CONFIG_MESSAGE = "请先配置生成器"; - @Override - public Object getTables() { - // 使用预编译防止sql注入 - String sql = "select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables " + - "where table_schema = (select database()) " + - "order by create_time desc"; - Query query = em.createNativeQuery(sql); - return query.getResultList(); - } - - @Override - public Object getTables(String name, int[] startEnd) { - // 使用预编译防止sql注入 - String sql = "select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables " + - "where table_schema = (select database()) " + - "and table_name like :table order by create_time desc"; - Query query = em.createNativeQuery(sql); - query.setFirstResult(startEnd[0]); - query.setMaxResults(startEnd[1] - startEnd[0]); - query.setParameter("table", StringUtils.isNotBlank(name) ? ("%" + name + "%") : "%%"); - List result = query.getResultList(); - List tableInfos = new ArrayList<>(); - for (Object obj : result) { - Object[] arr = (Object[]) obj; - tableInfos.add(new TableInfo(arr[0], arr[1], arr[2], arr[3], ObjectUtil.isNotEmpty(arr[4]) ? arr[4] : "-")); - } - String countSql = "select count(1) from information_schema.tables " + - "where table_schema = (select database()) and table_name like :table"; - Query queryCount = em.createNativeQuery(countSql); - queryCount.setParameter("table", StringUtils.isNotBlank(name) ? ("%" + name + "%") : "%%"); - Object totalElements = queryCount.getSingleResult(); - return PageUtil.toPage(tableInfos, totalElements); - } - - @Override - public List getColumns(String tableName) { - List columnInfos = columnInfoRepository.findByTableNameOrderByIdAsc(tableName); - if (CollectionUtil.isNotEmpty(columnInfos)) { - return columnInfos; - } else { - columnInfos = query(tableName); - return columnInfoRepository.saveAll(columnInfos); - } - } - - @Override - 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<>(); - for (Object obj : result) { - Object[] arr = (Object[]) obj; - columnInfos.add( - new ColumnInfo( - tableName, - arr[0].toString(), - "NO".equals(arr[1]), - arr[2].toString(), - ObjectUtil.isNotNull(arr[3]) ? arr[3].toString() : null, - ObjectUtil.isNotNull(arr[4]) ? arr[4].toString() : null, - ObjectUtil.isNotNull(arr[5]) ? arr[5].toString() : null) - ); - } - return columnInfos; - } - - @Override - public void sync(List columnInfos, List columnInfoList) { - // 第一种情况,数据库类字段改变或者新增字段 - for (ColumnInfo columnInfo : columnInfoList) { - // 根据字段名称查找 - List columns = columnInfos.stream().filter(c -> c.getColumnName().equals(columnInfo.getColumnName())).collect(Collectors.toList()); - // 如果能找到,就修改部分可能被字段 - if (CollectionUtil.isNotEmpty(columns)) { - 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()); - } - columnInfoRepository.save(column); - } else { - // 如果找不到,则保存新字段信息 - columnInfoRepository.save(columnInfo); - } - } - // 第二种情况,数据库字段删除了 - for (ColumnInfo columnInfo : columnInfos) { - // 根据字段名称查找 - List columns = columnInfoList.stream().filter(c -> c.getColumnName().equals(columnInfo.getColumnName())).collect(Collectors.toList()); - // 如果找不到,就代表字段被删除了,则需要删除该字段 - if (CollectionUtil.isEmpty(columns)) { - columnInfoRepository.delete(columnInfo); - } - } - } - - @Override - public void save(List columnInfos) { - columnInfoRepository.saveAll(columnInfos); - } - - @Override - public void generator(GenConfig genConfig, List columns) { - if (genConfig.getId() == null) { - throw new BadRequestException(CONFIG_MESSAGE); - } - try { - GenUtil.generatorCode(columns, genConfig); - } catch (IOException e) { - log.error(e.getMessage(), e); - throw new BadRequestException("生成失败,请手动处理已生成的文件"); - } - } - - @Override - public ResponseEntity preview(GenConfig genConfig, List columns) { - if (genConfig.getId() == null) { - throw new BadRequestException(CONFIG_MESSAGE); - } - List> genList = GenUtil.preview(columns, genConfig); - return new ResponseEntity<>(genList, HttpStatus.OK); - } - - @Override - public void download(GenConfig genConfig, List columns, HttpServletRequest request, HttpServletResponse response) { - if (genConfig.getId() == null) { - throw new BadRequestException(CONFIG_MESSAGE); - } - try { - File file = new File(GenUtil.download(columns, genConfig)); - String zipPath = file.getPath() + ".zip"; - ZipUtil.zip(file.getPath(), zipPath); - FileUtil.downloadFile(request, response, new File(zipPath), true); - } catch (IOException e) { - throw new BadRequestException("打包失败"); - } - } -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/utils/ColUtil.java b/eladmin-generator/src/main/java/cn/ysk/cashier/utils/ColUtil.java deleted file mode 100644 index 9683bdd7..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/utils/ColUtil.java +++ /dev/null @@ -1,40 +0,0 @@ - -package cn.ysk.cashier.utils; - -import org.apache.commons.configuration.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * sql字段转java - * - * @author Zheng Jie - * @date 2019-01-03 - */ -public class ColUtil { - private static final Logger log = LoggerFactory.getLogger(ColUtil.class); - - /** - * 转换mysql数据类型为java数据类型 - * - * @param type 数据库字段类型 - * @return String - */ - static String cloToJava(String type) { - Configuration config = getConfig(); - assert config != null; - return config.getString(type, "unknowType"); - } - - /** - * 获取配置信息 - */ - public static PropertiesConfiguration getConfig() { - try { - return new PropertiesConfiguration("generator.properties"); - } catch (ConfigurationException e) { - log.error(e.getMessage(), e); - } - return null; - } -} diff --git a/eladmin-generator/src/main/java/cn/ysk/cashier/utils/GenUtil.java b/eladmin-generator/src/main/java/cn/ysk/cashier/utils/GenUtil.java deleted file mode 100644 index 703a1f89..00000000 --- a/eladmin-generator/src/main/java/cn/ysk/cashier/utils/GenUtil.java +++ /dev/null @@ -1,408 +0,0 @@ - -package cn.ysk.cashier.utils; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.extra.template.*; -import cn.ysk.cashier.domain.ColumnInfo; -import cn.ysk.cashier.domain.GenConfig; -import lombok.extern.slf4j.Slf4j; -import org.springframework.util.ObjectUtils; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; -import java.time.LocalDate; -import java.util.*; - -import static cn.ysk.cashier.utils.FileUtil.SYS_TEM_DIR; - -/** - * 代码生成 - * - * @author Zheng Jie - * @date 2019-01-02 - */ -@Slf4j -@SuppressWarnings({"unchecked", "all"}) -public class GenUtil { - - private static final String TIMESTAMP = "Timestamp"; - - private static final String BIGDECIMAL = "BigDecimal"; - - public static final String PK = "PRI"; - - public static final String EXTRA = "auto_increment"; - - /** - * 获取后端代码模板名称 - * - * @return List - */ - private static List getAdminTemplateNames() { - List templateNames = new ArrayList<>(); - templateNames.add("Entity"); - templateNames.add("Dto"); - templateNames.add("Mapper"); - templateNames.add("Controller"); - templateNames.add("QueryCriteria"); - templateNames.add("Service"); - templateNames.add("ServiceImpl"); - templateNames.add("Repository"); - return templateNames; - } - - /** - * 获取前端代码模板名称 - * - * @return List - */ - private static List getFrontTemplateNames() { - List templateNames = new ArrayList<>(); - templateNames.add("index"); - templateNames.add("api"); - return templateNames; - } - - public static List> preview(List columns, GenConfig genConfig) { - Map genMap = getGenMap(columns, genConfig); - List> genList = new ArrayList<>(); - // 获取后端模版 - List templates = getAdminTemplateNames(); - TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); - for (String templateName : templates) { - Map map = new HashMap<>(1); - Template template = engine.getTemplate("generator/admin/" + templateName + ".ftl"); - map.put("content", template.render(genMap)); - map.put("name", templateName); - genList.add(map); - } - // 获取前端模版 - templates = getFrontTemplateNames(); - for (String templateName : templates) { - Map map = new HashMap<>(1); - Template template = engine.getTemplate("generator/front/" + templateName + ".ftl"); - map.put(templateName, template.render(genMap)); - map.put("content", template.render(genMap)); - map.put("name", templateName); - genList.add(map); - } - return genList; - } - - public static String download(List columns, GenConfig genConfig) throws IOException { - // 拼接的路径:/tmpeladmin-gen-temp/,这个路径在Linux下需要root用户才有权限创建,非root用户会权限错误而失败,更改为: /tmp/eladmin-gen-temp/ - // String tempPath =SYS_TEM_DIR + "eladmin-gen-temp" + File.separator + genConfig.getTableName() + File.separator; - String tempPath = SYS_TEM_DIR + "eladmin-gen-temp" + File.separator + genConfig.getTableName() + File.separator; - Map genMap = getGenMap(columns, genConfig); - TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); - // 生成后端代码 - List templates = getAdminTemplateNames(); - for (String templateName : templates) { - Template template = engine.getTemplate("generator/admin/" + templateName + ".ftl"); - String filePath = getAdminFilePath(templateName, genConfig, genMap.get("className").toString(), tempPath + "eladmin" + File.separator); - assert filePath != null; - File file = new File(filePath); - // 如果非覆盖生成 - if (!genConfig.getCover() && FileUtil.exist(file)) { - continue; - } - // 生成代码 - genFile(file, template, genMap); - } - // 生成前端代码 - templates = getFrontTemplateNames(); - for (String templateName : templates) { - Template template = engine.getTemplate("generator/front/" + templateName + ".ftl"); - String path = tempPath + "eladmin-web" + File.separator; - String apiPath = path + "src" + File.separator + "api" + File.separator; - String srcPath = path + "src" + File.separator + "views" + File.separator + genMap.get("changeClassName").toString() + File.separator; - String filePath = getFrontFilePath(templateName, apiPath, srcPath, genMap.get("changeClassName").toString()); - assert filePath != null; - File file = new File(filePath); - // 如果非覆盖生成 - if (!genConfig.getCover() && FileUtil.exist(file)) { - continue; - } - // 生成代码 - genFile(file, template, genMap); - } - return tempPath; - } - - 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)); - // 生成后端代码 - List templates = getAdminTemplateNames(); - for (String templateName : templates) { - Template template = engine.getTemplate("generator/admin/" + templateName + ".ftl"); - String rootPath = System.getProperty("user.dir"); - String filePath = getAdminFilePath(templateName, genConfig, genMap.get("className").toString(), rootPath); - - assert filePath != null; - File file = new File(filePath); - - // 如果非覆盖生成 - if (!genConfig.getCover() && FileUtil.exist(file)) { - continue; - } - // 生成代码 - genFile(file, template, genMap); - } - - // 生成前端代码 - templates = getFrontTemplateNames(); - for (String templateName : templates) { - Template template = engine.getTemplate("generator/front/" + templateName + ".ftl"); - String filePath = getFrontFilePath(templateName, genConfig.getApiPath(), genConfig.getPath(), genMap.get("changeClassName").toString()); - - assert filePath != null; - File file = new File(filePath); - - // 如果非覆盖生成 - if (!genConfig.getCover() && FileUtil.exist(file)) { - continue; - } - // 生成代码 - genFile(file, template, genMap); - } - } - - // 获取模版数据 - private static Map getGenMap(List columnInfos, GenConfig genConfig) { - // 存储模版字段数据 - Map genMap = new HashMap<>(16); - // 接口别名 - genMap.put("apiAlias", genConfig.getApiAlias()); - // 包名称 - genMap.put("package", genConfig.getPack()); - // 模块名称 - genMap.put("moduleName", genConfig.getModuleName()); - // 作者 - genMap.put("author", genConfig.getAuthor()); - // 创建日期 - genMap.put("date", LocalDate.now().toString()); - // 表名 - genMap.put("tableName", genConfig.getTableName()); - // 大写开头的类名 - String className = StringUtils.toCapitalizeCamelCase(genConfig.getTableName()); - // 小写开头的类名 - String changeClassName = StringUtils.toCamelCase(genConfig.getTableName()); - // 判断是否去除表前缀 - if (StringUtils.isNotEmpty(genConfig.getPrefix())) { - className = StringUtils.toCapitalizeCamelCase(StrUtil.removePrefix(genConfig.getTableName(), genConfig.getPrefix())); - changeClassName = StringUtils.toCamelCase(StrUtil.removePrefix(genConfig.getTableName(), genConfig.getPrefix())); - changeClassName = StringUtils.uncapitalize(changeClassName); - } - // 保存类名 - genMap.put("className", className); - // 保存小写开头的类名 - genMap.put("changeClassName", changeClassName); - // 存在 Timestamp 字段 - genMap.put("hasTimestamp", false); - // 查询类中存在 Timestamp 字段 - genMap.put("queryHasTimestamp", false); - // 存在 BigDecimal 字段 - genMap.put("hasBigDecimal", false); - // 查询类中存在 BigDecimal 字段 - genMap.put("queryHasBigDecimal", false); - // 是否需要创建查询 - genMap.put("hasQuery", false); - // 自增主键 - genMap.put("auto", false); - // 存在字典 - genMap.put("hasDict", false); - // 存在日期注解 - genMap.put("hasDateAnnotation", false); - // 保存字段信息 - List> columns = new ArrayList<>(); - // 保存查询字段的信息 - List> queryColumns = new ArrayList<>(); - // 存储字典信息 - List dicts = new ArrayList<>(); - // 存储 between 信息 - List> betweens = new ArrayList<>(); - // 存储不为空的字段信息 - List> isNotNullColumns = new ArrayList<>(); - - for (ColumnInfo column : columnInfos) { - Map listMap = new HashMap<>(16); - // 字段描述 - listMap.put("remark", column.getRemark()); - // 字段类型 - listMap.put("columnKey", column.getKeyType()); - // 主键类型 - String colType = ColUtil.cloToJava(column.getColumnType()); - // 小写开头的字段名 - String changeColumnName = StringUtils.toCamelCase(column.getColumnName()); - // 大写开头的字段名 - String capitalColumnName = StringUtils.toCapitalizeCamelCase(column.getColumnName()); - if (PK.equals(column.getKeyType())) { - // 存储主键类型 - genMap.put("pkColumnType", colType); - // 存储小写开头的字段名 - genMap.put("pkChangeColName", changeColumnName); - // 存储大写开头的字段名 - genMap.put("pkCapitalColName", capitalColumnName); - } - // 是否存在 Timestamp 类型的字段 - if (TIMESTAMP.equals(colType)) { - genMap.put("hasTimestamp", true); - } - // 是否存在 BigDecimal 类型的字段 - if (BIGDECIMAL.equals(colType)) { - genMap.put("hasBigDecimal", true); - } - // 主键是否自增 - if (EXTRA.equals(column.getExtra())) { - genMap.put("auto", true); - } - // 主键存在字典 - if (StringUtils.isNotBlank(column.getDictName())) { - genMap.put("hasDict", true); - if(!dicts.contains(column.getDictName())) - dicts.add(column.getDictName()); - } - - // 存储字段类型 - listMap.put("columnType", colType); - // 存储字原始段名称 - listMap.put("columnName", column.getColumnName()); - // 不为空 - listMap.put("istNotNull", column.getNotNull()); - // 字段列表显示 - listMap.put("columnShow", column.getListShow()); - // 表单显示 - listMap.put("formShow", column.getFormShow()); - // 表单组件类型 - listMap.put("formType", StringUtils.isNotBlank(column.getFormType()) ? column.getFormType() : "Input"); - // 小写开头的字段名称 - listMap.put("changeColumnName", changeColumnName); - //大写开头的字段名称 - listMap.put("capitalColumnName", capitalColumnName); - // 字典名称 - listMap.put("dictName", column.getDictName()); - // 日期注解 - listMap.put("dateAnnotation", column.getDateAnnotation()); - if (StringUtils.isNotBlank(column.getDateAnnotation())) { - genMap.put("hasDateAnnotation", true); - } - // 添加非空字段信息 - if (column.getNotNull()) { - isNotNullColumns.add(listMap); - } - // 判断是否有查询,如有则把查询的字段set进columnQuery - if (!StringUtils.isBlank(column.getQueryType())) { - // 查询类型 - listMap.put("queryType", column.getQueryType()); - // 是否存在查询 - genMap.put("hasQuery", true); - if (TIMESTAMP.equals(colType)) { - // 查询中存储 Timestamp 类型 - genMap.put("queryHasTimestamp", true); - } - if (BIGDECIMAL.equals(colType)) { - // 查询中存储 BigDecimal 类型 - genMap.put("queryHasBigDecimal", true); - } - if ("between".equalsIgnoreCase(column.getQueryType())) { - betweens.add(listMap); - } else { - // 添加到查询列表中 - queryColumns.add(listMap); - } - } - // 添加到字段列表中 - columns.add(listMap); - } - // 保存字段列表 - genMap.put("columns", columns); - // 保存查询列表 - genMap.put("queryColumns", queryColumns); - // 保存字段列表 - genMap.put("dicts", dicts); - // 保存查询列表 - genMap.put("betweens", betweens); - // 保存非空字段信息 - genMap.put("isNotNullColumns", isNotNullColumns); - return genMap; - } - - /** - * 定义后端文件路径以及名称 - */ - private static String getAdminFilePath(String templateName, GenConfig genConfig, String className, String rootPath) { - String projectPath = rootPath + File.separator + genConfig.getModuleName(); - String packagePath = projectPath + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator; - if (!ObjectUtils.isEmpty(genConfig.getPack())) { - packagePath += genConfig.getPack().replace(".", File.separator) + File.separator; - } - - if ("Entity".equals(templateName)) { - return packagePath + "domain" + File.separator + className + ".java"; - } - - if ("Controller".equals(templateName)) { - return packagePath + "rest" + File.separator + className + "Controller.java"; - } - - if ("Service".equals(templateName)) { - return packagePath + "service" + File.separator + className + "Service.java"; - } - - if ("ServiceImpl".equals(templateName)) { - return packagePath + "service" + File.separator + "impl" + File.separator + className + "ServiceImpl.java"; - } - - if ("Dto".equals(templateName)) { - return packagePath + "service" + File.separator + "dto" + File.separator + className + "Dto.java"; - } - - if ("QueryCriteria".equals(templateName)) { - return packagePath + "service" + File.separator + "dto" + File.separator + className + "QueryCriteria.java"; - } - - if ("Mapper".equals(templateName)) { - return packagePath + "service" + File.separator + "mapstruct" + File.separator + className + "Mapper.java"; - } - - if ("Repository".equals(templateName)) { - return packagePath + "repository" + File.separator + className + "Repository.java"; - } - - return null; - } - - /** - * 定义前端文件路径以及名称 - */ - private static String getFrontFilePath(String templateName, String apiPath, String path, String apiName) { - - if ("api".equals(templateName)) { - return apiPath + File.separator + apiName + ".js"; - } - - if ("index".equals(templateName)) { - return path + File.separator + "index.vue"; - } - - return null; - } - - private static void genFile(File file, Template template, Map map) throws IOException { - // 生成目标文件 - Writer writer = null; - try { - FileUtil.touch(file); - writer = new FileWriter(file); - template.render(map, writer); - } catch (TemplateException | IOException e) { - throw new RuntimeException(e); - } finally { - assert writer != null; - writer.close(); - } - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbMerchantCouponController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbMerchantCouponController.java deleted file mode 100644 index 00d93cfd..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbMerchantCouponController.java +++ /dev/null @@ -1,92 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller.shop; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.dto.shop.TbMerchantCouponDto; -import cn.ysk.cashier.pojo.shop.TbMerchantCoupon; -import cn.ysk.cashier.pojo.shop.TbPurchaseNotice; -import cn.ysk.cashier.repository.shop.TbPurchaseNoticeRepository; -import cn.ysk.cashier.service.shop.TbMerchantCouponService; -import cn.ysk.cashier.dto.shop.TbMerchantCouponQueryCriteria; -import cn.ysk.cashier.service.shop.TbPurchaseNoticeService; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import io.swagger.annotations.*; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-03-20 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "/shop/coupon管理") -@RequestMapping("/api/tbMerchantCoupon") -public class TbMerchantCouponController { - - private final TbMerchantCouponService tbMerchantCouponService; - private final TbPurchaseNoticeRepository noticeRepository; - - @ApiOperation("导出数据") - public void exportTbMerchantCoupon(HttpServletResponse response, TbMerchantCouponQueryCriteria criteria) throws IOException { - tbMerchantCouponService.download(tbMerchantCouponService.queryAll(criteria), response); - } - - @GetMapping - public ResponseEntity queryTbMerchantCoupon(TbMerchantCouponQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(tbMerchantCouponService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @GetMapping("/{id}") - @ApiOperation("查询优惠卷") - public ResponseEntity queryTbMerchantCouponById(@PathVariable("id")Integer id){ - Map result=new HashMap<>(); - TbMerchantCouponDto coupon = tbMerchantCouponService.findById(id); - result.put("coupon",coupon); - TbPurchaseNotice notice = noticeRepository.findByCouponId(id); - result.put("notice",notice); - return new ResponseEntity<>(result,HttpStatus.OK); - } - - @PostMapping - @Log("新增商家优惠卷:#resources.title") - public ResponseEntity createTbMerchantCoupon(@Validated @RequestBody TbMerchantCoupon resources){ - return new ResponseEntity<>(tbMerchantCouponService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @Log("修改商家优惠卷:#resources.title") - public ResponseEntity updateTbMerchantCoupon(@Validated @RequestBody TbMerchantCoupon resources){ - tbMerchantCouponService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @Log("删除商家优惠卷:#ids") - public ResponseEntity deleteTbMerchantCoupon(@RequestBody Integer[] ids) { - tbMerchantCouponService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopInfoDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopInfoDto.java index a2b667d8..534f40af 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopInfoDto.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopInfoDto.java @@ -199,4 +199,7 @@ public class TbShopInfoDto implements Serializable { //程序码(零点八零首页) private String smallQrcode; private String paymentQrcode; + + private Integer isMemberPrice; + private String consumeColony; } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbShopExtend.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbShopExtend.java index 365b94f5..62c6014b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbShopExtend.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbShopExtend.java @@ -150,6 +150,12 @@ public class TbShopExtend extends Model { this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png"; this.title = "商品列表"; break; + case "ticket_logo": + this.name = "小票logo图"; + this.detail="建议尺寸: 417*139"; + this.value = "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20241022/eeee8e85c66947e5bcaebf687381b5d6.png"; + this.title = "小票logo"; + break; } } this.type="img"; diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopExtendServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopExtendServiceImpl.java index cf85c458..a24244bd 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopExtendServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopExtendServiceImpl.java @@ -86,7 +86,7 @@ public class TbShopExtendServiceImpl extends ServiceImpl checkAndInitialize(Page ipage, Integer shopId) { List newRecords = new ArrayList<>(); - List requiredAutokeys = Arrays.asList("index_bg", "my_bg", "member_bg", "shopinfo_bg"); + List requiredAutokeys = Arrays.asList("index_bg", "my_bg", "member_bg", "shopinfo_bg","ticket_logo"); if (ipage == null || ipage.getRecords() == null || ipage.getRecords().isEmpty()) { // ipage 为空,直接创建包含四种类型数据的新 Page 对象 @@ -114,6 +114,9 @@ public class TbShopExtendServiceImpl extends ServiceImpl existingAutokeys = shopExtends.stream() diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopInfo.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopInfo.java index 3cb60517..5720d7bd 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopInfo.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopInfo.java @@ -260,6 +260,14 @@ public class TbShopInfo implements Serializable { @ApiModelProperty(value = "是否允许用户自定义金额") private String isMemberReturn; + @Column(name = "is_member_price") + @ApiModelProperty(value = "是否启用会员价 0否1是") + private Integer isMemberPrice; + + @Column(name = "consume_colony") + @ApiModelProperty(value = "积分群体 all-所有 vip-仅针对会员") + private String consumeColony; + @Column(name = "is_table_fee") @ApiModelProperty(value = "是否免除桌位费 0否1是") private Integer isTableFee; diff --git a/pom.xml b/pom.xml index 4e5d59af..e6bab1cf 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,6 @@ eladmin-logging eladmin-system eladmin-tools - eladmin-generator ELADMIN 后台管理 From 824985a6ad87a32b5ab47b89f5cd9a4e5d51e9b4 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Thu, 24 Oct 2024 15:28:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A4=9A=E4=BD=99=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=88=A0=E9=99=A4=20=E6=B4=BB=E5=8A=A8=E9=87=8D=E5=86=99=20?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E9=87=8D=E5=86=99=20=E5=BA=97?= =?UTF-8?q?=E9=93=BA=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .../controller/BotButtonConfigController.java | 82 --- .../controller/BotConfigController.java | 82 --- .../cashier/controller/BotUserController.java | 82 --- .../controller/BotUserFlowController.java | 82 --- .../TbRenewalsPayLogController.java | 82 --- .../controller/TbShopCouponController.java | 78 +++ .../controller/shop/ShopPayApiController.java | 4 - .../shop/TbReceiptSalesController.java | 91 ---- .../shop/TbShopCashSpreadController.java | 95 ---- .../shop/TbShopCurrencyController.java | 83 ---- .../dto/TbActivateProductQueryCriteria.java | 2 +- .../dto/TbShopCouponQueryCriteria.java | 17 + .../cashier/mapper/BotButtonConfigMapper.java | 32 -- .../ysk/cashier/mapper/BotConfigMapper.java | 32 -- .../ysk/cashier/mapper/BotUserFlowMapper.java | 32 -- .../cn/ysk/cashier/mapper/BotUserMapper.java | 32 -- .../mapper/TbRenewalsPayLogMapper.java | 32 -- .../mapper/shop/TbMerchantCouponMapper.java | 32 -- .../mapper/shop/TbReceiptSalesMapper.java | 32 -- .../mapper/shop/TbShopCashSpreadMapper.java | 32 -- .../mapper/shop/TbShopCurrencyMapper.java | 32 -- .../ysk/cashier/mybatis/entity/Activate.java | 31 -- .../cashier/mybatis/entity/TbActivate.java | 117 +++-- .../mybatis/entity/TbActivateInRecord.java | 68 ++- .../mybatis/entity/TbActivateOutRecord.java | 63 ++- .../mybatis/entity/TbActivateProduct.java | 83 ---- .../mybatis/entity/TbCouponProduct.java | 40 ++ .../cashier/mybatis/entity/TbShopCoupon.java | 253 ++++++++++ .../cashier/mybatis/entity/TbUserStorage.java | 33 -- .../mybatis/mapper/ActivateMapper.java | 9 - ...Mapper.java => TbCouponProductMapper.java} | 4 +- .../mybatis/mapper/TbShopCouponMapper.java | 15 + .../mybatis/mapper/TbUserStorageMapper.java | 9 - .../mybatis/rest/StorageController.java | 26 +- .../cashier/mybatis/service/ShopService.java | 30 -- .../mybatis/service/TbActivateService.java | 4 + ...rvice.java => TbCouponProductService.java} | 5 +- .../mybatis/service/TbShopCouponService.java | 31 ++ .../mybatis/service/impl/ShopServiceImpl.java | 186 ------- .../impl/TbActivateProductServiceImpl.java | 27 - .../service/impl/TbActivateServiceImpl.java | 31 +- .../impl/TbCouponProductServiceImpl.java | 19 + .../service/impl/TbShopCouponServiceImpl.java | 130 +++++ .../cashier/mybatis/vo/ActivateProsVo.java | 17 - .../cashier/mybatis/vo/TbShopCouponVo.java | 14 + .../cn/ysk/cashier/pojo/BotButtonConfig.java | 53 -- .../java/cn/ysk/cashier/pojo/BotConfig.java | 57 --- .../java/cn/ysk/cashier/pojo/BotUser.java | 123 ----- .../java/cn/ysk/cashier/pojo/BotUserFlow.java | 75 --- .../cn/ysk/cashier/pojo/TbRenewalsPayLog.java | 100 ---- .../cashier/pojo/shop/TbMerchantCoupon.java | 467 ------------------ .../ysk/cashier/pojo/shop/TbReceiptSales.java | 120 ----- .../cashier/pojo/shop/TbShopCashSpread.java | 72 --- .../ysk/cashier/pojo/shop/TbShopCurrency.java | 130 ----- .../repository/BotButtonConfigRepository.java | 28 -- .../repository/BotConfigRepository.java | 28 -- .../repository/BotUserFlowRepository.java | 28 -- .../cashier/repository/BotUserRepository.java | 28 -- .../TbRenewalsPayLogRepository.java | 28 -- .../shop/TbMerchantCouponRepository.java | 28 -- .../shop/TbReceiptSalesRepository.java | 28 -- .../shop/TbShopCashSpreadRepository.java | 43 -- .../shop/TbShopCurrencyRepository.java | 33 -- .../service/BotButtonConfigService.java | 83 ---- .../ysk/cashier/service/BotConfigService.java | 68 --- .../cashier/service/BotUserFlowService.java | 83 ---- .../ysk/cashier/service/BotUserService.java | 83 ---- .../service/TbRenewalsPayLogService.java | 83 ---- .../impl/BotButtonConfigServiceImpl.java | 105 ---- .../service/impl/BotConfigServiceImpl.java | 106 ---- .../service/impl/BotUserFlowServiceImpl.java | 110 ----- .../service/impl/BotUserServiceImpl.java | 122 ----- .../impl/TbRenewalsPayLogServiceImpl.java | 116 ----- .../impl/order/TbOrderInfoServiceImpl.java | 4 - .../productimpl/TbProductServiceImpl.java | 6 +- .../shopimpl/TbMerchantCouponServiceImpl.java | 180 ------- .../shopimpl/TbReceiptSalesServiceImpl.java | 122 ----- .../shopimpl/TbShopCashSpreadServiceImpl.java | 115 ----- .../shopimpl/TbShopCurrencyServiceImpl.java | 130 ----- .../service/shop/TbMerchantCouponService.java | 83 ---- .../service/shop/TbReceiptSalesService.java | 83 ---- .../service/shop/TbShopCashSpreadService.java | 84 ---- .../service/shop/TbShopCurrencyService.java | 90 ---- .../cashier/system/rest/ParamsController.java | 5 - .../resources/mapper/TbActivateMapper.xml | 23 - 86 files changed, 846 insertions(+), 4821 deletions(-) delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/BotButtonConfigController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/BotConfigController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/BotUserController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/BotUserFlowController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/TbRenewalsPayLogController.java create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/TbShopCouponController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbReceiptSalesController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopCashSpreadController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopCurrencyController.java create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/dto/TbShopCouponQueryCriteria.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotButtonConfigMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotConfigMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotUserFlowMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotUserMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/TbRenewalsPayLogMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbMerchantCouponMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbReceiptSalesMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbShopCashSpreadMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbShopCurrencyMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/Activate.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateProduct.java create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbCouponProduct.java create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbShopCoupon.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbUserStorage.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/ActivateMapper.java rename eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/{TbActivateProductMapper.java => TbCouponProductMapper.java} (61%) create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopCouponMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbUserStorageMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/ShopService.java rename eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/{TbActivateProductService.java => TbCouponProductService.java} (62%) create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbShopCouponService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/ShopServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbActivateProductServiceImpl.java create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbCouponProductServiceImpl.java create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopCouponServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/vo/ActivateProsVo.java create mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/mybatis/vo/TbShopCouponVo.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotButtonConfig.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotConfig.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotUser.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotUserFlow.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/TbRenewalsPayLog.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbMerchantCoupon.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbReceiptSales.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopCashSpread.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopCurrency.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/BotButtonConfigRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/BotConfigRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/BotUserFlowRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/BotUserRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/TbRenewalsPayLogRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbMerchantCouponRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbReceiptSalesRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopCashSpreadRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopCurrencyRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/BotButtonConfigService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/BotConfigService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/BotUserFlowService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/BotUserService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/TbRenewalsPayLogService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotButtonConfigServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotConfigServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotUserFlowServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotUserServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbRenewalsPayLogServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbMerchantCouponServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbReceiptSalesServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopCashSpreadServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopCurrencyServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbMerchantCouponService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbReceiptSalesService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopCashSpreadService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopCurrencyService.java delete mode 100644 eladmin-system/src/main/resources/mapper/TbActivateMapper.xml diff --git a/.gitignore b/.gitignore index 085c5046..b8080da1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ */target/* */*.iml /.gradle/ +/application.pid *.log logs/* \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotButtonConfigController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotButtonConfigController.java deleted file mode 100644 index 0d0fb7ce..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotButtonConfigController.java +++ /dev/null @@ -1,82 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.pojo.BotButtonConfig; -import cn.ysk.cashier.service.BotButtonConfigService; -import cn.ysk.cashier.dto.BotButtonConfigQueryCriteria; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -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; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-31 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "buttonConfig管理") -@RequestMapping("/api/botButtonConfig") -public class BotButtonConfigController { - - private final BotButtonConfigService botButtonConfigService; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('botButtonConfig:list')") - public void exportBotButtonConfig(HttpServletResponse response, BotButtonConfigQueryCriteria criteria) throws IOException { - botButtonConfigService.download(botButtonConfigService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询buttonConfig") - @PreAuthorize("@el.check('botButtonConfig:list')") - public ResponseEntity queryBotButtonConfig(BotButtonConfigQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(botButtonConfigService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @ApiOperation("新增buttonConfig") - @PreAuthorize("@el.check('botButtonConfig:add')") - public ResponseEntity createBotButtonConfig(@Validated @RequestBody BotButtonConfig resources){ - return new ResponseEntity<>(botButtonConfigService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @ApiOperation("修改buttonConfig") - @PreAuthorize("@el.check('botButtonConfig:edit')") - public ResponseEntity updateBotButtonConfig(@Validated @RequestBody BotButtonConfig resources){ - botButtonConfigService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @ApiOperation("删除buttonConfig") - @PreAuthorize("@el.check('botButtonConfig:del')") - public ResponseEntity deleteBotButtonConfig(@RequestBody Integer[] ids) { - botButtonConfigService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotConfigController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotConfigController.java deleted file mode 100644 index f7fc86ce..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotConfigController.java +++ /dev/null @@ -1,82 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.pojo.BotConfig; -import cn.ysk.cashier.service.BotConfigService; -import cn.ysk.cashier.dto.BotConfigQueryCriteria; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -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; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-31 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "botConfig管理") -@RequestMapping("/api/botConfig") -public class BotConfigController { - - private final BotConfigService botConfigService; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('botConfig:list')") - public void exportBotConfig(HttpServletResponse response, BotConfigQueryCriteria criteria) throws IOException { - botConfigService.download(botConfigService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询botConfig") - @PreAuthorize("@el.check('botConfig:list')") - public ResponseEntity queryBotConfig(BotConfigQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(botConfigService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @ApiOperation("新增botConfig") - @PreAuthorize("@el.check('botConfig:add')") - public ResponseEntity createBotConfig(@Validated @RequestBody BotConfig resources){ - return new ResponseEntity<>(botConfigService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @ApiOperation("修改botConfig") - @PreAuthorize("@el.check('botConfig:edit')") - public ResponseEntity updateBotConfig(@Validated @RequestBody BotConfig resources){ - botConfigService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @ApiOperation("删除botConfig") - @PreAuthorize("@el.check('botConfig:del')") - public ResponseEntity deleteBotConfig(@RequestBody Integer[] ids) { - botConfigService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotUserController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotUserController.java deleted file mode 100644 index 40d1d5cc..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotUserController.java +++ /dev/null @@ -1,82 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.pojo.BotUser; -import cn.ysk.cashier.service.BotUserService; -import cn.ysk.cashier.dto.BotUserQueryCriteria; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -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; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-30 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "BotUserController管理") -@RequestMapping("/api/botUser") -public class BotUserController { - - private final BotUserService botUserService; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('botUser:list')") - public void exportBotUser(HttpServletResponse response, BotUserQueryCriteria criteria) throws IOException { - botUserService.download(botUserService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询BotUserController") - @PreAuthorize("@el.check('botUser:list')") - public ResponseEntity queryBotUser(BotUserQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(botUserService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @ApiOperation("新增BotUserController") - @PreAuthorize("@el.check('botUser:add')") - public ResponseEntity createBotUser(@Validated @RequestBody BotUser resources){ - return new ResponseEntity<>(botUserService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @ApiOperation("修改BotUserController") - @PreAuthorize("@el.check('botUser:edit')") - public ResponseEntity updateBotUser(@Validated @RequestBody BotUser resources){ - botUserService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @ApiOperation("删除BotUserController") - @PreAuthorize("@el.check('botUser:del')") - public ResponseEntity deleteBotUser(@RequestBody Integer[] ids) { - botUserService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotUserFlowController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotUserFlowController.java deleted file mode 100644 index e41c7998..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/BotUserFlowController.java +++ /dev/null @@ -1,82 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.pojo.BotUserFlow; -import cn.ysk.cashier.service.BotUserFlowService; -import cn.ysk.cashier.dto.BotUserFlowQueryCriteria; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -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; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-30 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "accountFlow管理") -@RequestMapping("/api/botUserFlow") -public class BotUserFlowController { - - private final BotUserFlowService botUserFlowService; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('botUserFlow:list')") - public void exportBotUserFlow(HttpServletResponse response, BotUserFlowQueryCriteria criteria) throws IOException { - botUserFlowService.download(botUserFlowService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询accountFlow") - @PreAuthorize("@el.check('botUserFlow:list')") - public ResponseEntity queryBotUserFlow(BotUserFlowQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(botUserFlowService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @ApiOperation("新增accountFlow") - @PreAuthorize("@el.check('botUserFlow:add')") - public ResponseEntity createBotUserFlow(@Validated @RequestBody BotUserFlow resources){ - return new ResponseEntity<>(botUserFlowService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @ApiOperation("修改accountFlow") - @PreAuthorize("@el.check('botUserFlow:edit')") - public ResponseEntity updateBotUserFlow(@Validated @RequestBody BotUserFlow resources){ - botUserFlowService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @ApiOperation("删除accountFlow") - @PreAuthorize("@el.check('botUserFlow:del')") - public ResponseEntity deleteBotUserFlow(@RequestBody Integer[] ids) { - botUserFlowService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/TbRenewalsPayLogController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/TbRenewalsPayLogController.java deleted file mode 100644 index 7821f3ec..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/TbRenewalsPayLogController.java +++ /dev/null @@ -1,82 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.pojo.TbRenewalsPayLog; -import cn.ysk.cashier.service.TbRenewalsPayLogService; -import cn.ysk.cashier.dto.TbRenewalsPayLogQueryCriteria; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -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; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2023-11-07 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "/shop/renewals管理") -@RequestMapping("/api/tbRenewalsPayLog") -public class TbRenewalsPayLogController { - - private final TbRenewalsPayLogService tbRenewalsPayLogService; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('tbRenewalsPayLog:list')") - public void exportTbRenewalsPayLog(HttpServletResponse response, TbRenewalsPayLogQueryCriteria criteria) throws IOException { - tbRenewalsPayLogService.download(tbRenewalsPayLogService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询/shop/renewals") - @PreAuthorize("@el.check('tbRenewalsPayLog:list')") - public ResponseEntity queryTbRenewalsPayLog(TbRenewalsPayLogQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(tbRenewalsPayLogService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @ApiOperation("新增/shop/renewals") - @PreAuthorize("@el.check('tbRenewalsPayLog:add')") - public ResponseEntity createTbRenewalsPayLog(@Validated @RequestBody TbRenewalsPayLog resources){ - return new ResponseEntity<>(tbRenewalsPayLogService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @ApiOperation("修改/shop/renewals") - @PreAuthorize("@el.check('tbRenewalsPayLog:edit')") - public ResponseEntity updateTbRenewalsPayLog(@Validated @RequestBody TbRenewalsPayLog resources){ - tbRenewalsPayLogService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @ApiOperation("删除/shop/renewals") - @PreAuthorize("@el.check('tbRenewalsPayLog:del')") - public ResponseEntity deleteTbRenewalsPayLog(@RequestBody Integer[] ids) { - tbRenewalsPayLogService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/TbShopCouponController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/TbShopCouponController.java new file mode 100644 index 00000000..2ab2bf99 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/TbShopCouponController.java @@ -0,0 +1,78 @@ +package cn.ysk.cashier.controller; + +import cn.ysk.cashier.exception.BadRequestException; +import cn.ysk.cashier.mybatis.entity.TbShopCoupon; +import cn.ysk.cashier.mybatis.service.TbShopCouponService; +import cn.ysk.cashier.mybatis.vo.TbShopCouponVo; +import cn.ysk.cashier.utils.SecurityUtils; +import io.swagger.annotations.Api; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.ApiOperation; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import cn.ysk.cashier.dto.TbShopCouponQueryCriteria; + +import javax.annotation.Resource; + +/** + * 优惠券(TbShopCoupon)表控制层 + * + * @author ww + * @since 2024-10-22 15:43:24 + */ +@Api(tags = "优惠券管理") +@RestController +@RequestMapping("/api/tbShopCoupon") +public class TbShopCouponController { + /** + * 服务对象 + */ + @Resource + private TbShopCouponService tbShopCouponService; + + @GetMapping + @ApiOperation("分页查询") + public ResponseEntity selectAll(TbShopCouponQueryCriteria criteria) { + return new ResponseEntity<>(tbShopCouponService.queryAll(criteria), HttpStatus.OK); + } + + @GetMapping("{id}") + @ApiOperation("通过Id查询详情") + public TbShopCoupon selectOne(@PathVariable Integer id) { + return tbShopCouponService.findById(id); + } + + @GetMapping("/product/{couponId}") + @ApiOperation("查询赠送的商品") + public ResponseEntity queryActivatePros(@PathVariable("couponId") Integer couponId){ + return new ResponseEntity<>(tbShopCouponService.findActivatePros(couponId),HttpStatus.OK); + } + + @PostMapping + @ApiOperation("新增") + public ResponseEntity insert(@RequestBody TbShopCouponVo tbShopCoupon) { + if (tbShopCoupon.getType().equals(2) && CollectionUtils.isEmpty(tbShopCoupon.getProducts())) { + throw new BadRequestException("赠送商品不可为空"); + } + tbShopCoupon.setEditor(SecurityUtils.getCurrentUserNickName()); + return new ResponseEntity<>(tbShopCouponService.update(tbShopCoupon), HttpStatus.CREATED); + } + + @PutMapping + @ApiOperation("通过id修改") + public ResponseEntity update(@RequestBody TbShopCouponVo tbShopCoupon) { + if (tbShopCoupon.getType().equals(2) && CollectionUtils.isEmpty(tbShopCoupon.getProducts())) + throw new BadRequestException("赠送商品不可为空"); + tbShopCouponService.update(tbShopCoupon); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @DeleteMapping + @ApiOperation("删除") + public ResponseEntity delete(@RequestParam("id") Integer id) { + tbShopCouponService.delete(id); + return new ResponseEntity<>(HttpStatus.OK); + } +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/ShopPayApiController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/ShopPayApiController.java index 409d34ea..205169ac 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/ShopPayApiController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/ShopPayApiController.java @@ -38,10 +38,6 @@ public class ShopPayApiController { @GetMapping("getOrderPayUrl") @ApiOperation("获取店铺订单支付URL") - @ApiImplicitParams({ - @ApiImplicitParam(name = "orderId", value = "订单id", paramType = "query", required = true, dataType = "String"), - @ApiImplicitParam(name = "shopId", value = "店铺id", paramType = "query", required = true, dataType = "String"), - }) public ResponseEntity url(@RequestParam Map params) { MapProxy mapProxy = MapProxy.create(params); String shopId = mapProxy.getStr("shopId"); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbReceiptSalesController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbReceiptSalesController.java deleted file mode 100644 index 9681be81..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbReceiptSalesController.java +++ /dev/null @@ -1,91 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller.shop; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.pojo.shop.TbReceiptSales; -import cn.ysk.cashier.dto.shop.TbReceiptSalesQueryCriteria; -import cn.ysk.cashier.service.shop.TbReceiptSalesService; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -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; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-08 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "/shop/receiptSales管理") -@RequestMapping("/api/tbReceiptSales") -public class TbReceiptSalesController { - - private final TbReceiptSalesService tbReceiptSalesService; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('tbReceiptSales:list')") - public void exportTbReceiptSales(HttpServletResponse response, TbReceiptSalesQueryCriteria criteria) throws IOException { - tbReceiptSalesService.download(tbReceiptSalesService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询/shop/receiptSales") - @PreAuthorize("@el.check('tbReceiptSales:list')") - public ResponseEntity queryTbReceiptSales(TbReceiptSalesQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(tbReceiptSalesService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @GetMapping("/{shopId}") - @ApiOperation("查询/shop/receiptSales") - @PreAuthorize("@el.check('tbReceiptSales:info')") - public Object queryTbReceiptSalesInfo(@PathVariable("shopId")Integer shopId){ - - return tbReceiptSalesService.findById(shopId); - } - - - @PostMapping - @ApiOperation("新增/shop/receiptSales") - @PreAuthorize("@el.check('tbReceiptSales:add')") - public ResponseEntity createTbReceiptSales(@Validated @RequestBody TbReceiptSales resources){ - return new ResponseEntity<>(tbReceiptSalesService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @ApiOperation("修改/shop/receiptSales") - @PreAuthorize("@el.check('tbReceiptSales:edit')") - public ResponseEntity updateTbReceiptSales(@Validated @RequestBody TbReceiptSales resources){ - tbReceiptSalesService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @ApiOperation("删除/shop/receiptSales") - @PreAuthorize("@el.check('tbReceiptSales:del')") - public ResponseEntity deleteTbReceiptSales(@RequestBody Integer[] ids) { - tbReceiptSalesService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopCashSpreadController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopCashSpreadController.java deleted file mode 100644 index 5fa647ef..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopCashSpreadController.java +++ /dev/null @@ -1,95 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller.shop; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.pojo.shop.TbShopCashSpread; -import cn.ysk.cashier.service.shop.TbShopCashSpreadService; -import cn.ysk.cashier.dto.shop.TbShopCashSpreadQueryCriteria; -import cn.ysk.cashier.utils.StringUtils; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -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; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-05 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "/shop/spread管理") -@RequestMapping("/api/tbShopCashSpread") -public class TbShopCashSpreadController { - - private final TbShopCashSpreadService tbShopCashSpreadService; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('tbShopCashSpread:list')") - public void exportTbShopCashSpread(HttpServletResponse response, TbShopCashSpreadQueryCriteria criteria) throws IOException { - tbShopCashSpreadService.download(tbShopCashSpreadService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询/shop/spread") - @PreAuthorize("@el.check('tbShopCashSpread:list')") - public ResponseEntity queryTbShopCashSpread(TbShopCashSpreadQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(tbShopCashSpreadService.queryAll(criteria,pageable),HttpStatus.OK); - } - @GetMapping("/{shopId}") - @ApiOperation("查询/shop/spread/info") - @PreAuthorize("@el.check('tbShopCashSpread:info')") - public Object queryTbShopCashSpreadInfo(@PathVariable("shopId") Integer shopId){ - TbShopCashSpread byShopId = tbShopCashSpreadService.findByShopId(shopId); - String screenConfig = byShopId.getScreenConfig(); - return StringUtils.stringChangeMap(screenConfig); - } - @PostMapping - @ApiOperation("新增/shop/spread") - @PreAuthorize("@el.check('tbShopCashSpread:add')") - public ResponseEntity createTbShopCashSpread(@Validated @RequestBody TbShopCashSpread resources){ - return new ResponseEntity<>(tbShopCashSpreadService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @ApiOperation("修改/shop/spread") - @PreAuthorize("@el.check('tbShopCashSpread:edit')") - public ResponseEntity updateTbShopCashSpread(@Validated @RequestBody TbShopCashSpread resources){ - Integer update = tbShopCashSpreadService.update(resources); - if (update>0){ - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - - } - return new ResponseEntity<>(HttpStatus.BAD_REQUEST); - - } - - @DeleteMapping - @ApiOperation("删除/shop/spread") - @PreAuthorize("@el.check('tbShopCashSpread:del')") - public ResponseEntity deleteTbShopCashSpread(@RequestBody String[] ids) { - tbShopCashSpreadService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopCurrencyController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopCurrencyController.java deleted file mode 100644 index 83a579e5..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopCurrencyController.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.controller.shop; - -import cn.ysk.cashier.pojo.shop.TbShopCurrency; -import cn.ysk.cashier.service.shop.TbShopCurrencyService; -import cn.ysk.cashier.dto.shop.TbShopCurrencyQueryCriteria; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -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; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-05 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "/shop/currency管理") -@RequestMapping("/api/tbShopCurrency") -public class TbShopCurrencyController { - - private final TbShopCurrencyService tbShopCurrencyService; - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('tbShopCurrency:list')") - public void exportTbShopCurrency(HttpServletResponse response, TbShopCurrencyQueryCriteria criteria) throws IOException { - tbShopCurrencyService.download(tbShopCurrencyService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询/shop/currency") - public ResponseEntity queryTbShopCurrency(TbShopCurrencyQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(tbShopCurrencyService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @GetMapping("/{shopId}") - @ApiOperation("查询/shop/currency/info") - public Object queryTbShopCurrencyInfo(@PathVariable("shopId") String shopId){ - return tbShopCurrencyService.findByShopId(shopId); - } - - @PostMapping - @ApiOperation("新增/shop/currency") - public ResponseEntity createTbShopCurrency(@Validated @RequestBody TbShopCurrency resources){ - return new ResponseEntity<>(tbShopCurrencyService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @ApiOperation("修改/shop/currency") - public ResponseEntity updateTbShopCurrency(@Validated @RequestBody TbShopCurrency resources){ - tbShopCurrencyService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @ApiOperation("删除/shop/currency") - public ResponseEntity deleteTbShopCurrency(@RequestBody Integer[] ids) { - tbShopCurrencyService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/TbActivateProductQueryCriteria.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/TbActivateProductQueryCriteria.java index b6f4b3a3..30e6ea53 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/TbActivateProductQueryCriteria.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/TbActivateProductQueryCriteria.java @@ -5,7 +5,7 @@ import java.util.Date; import lombok.Data; /** - * 活动赠送商品表(TbActivateProduct)表查询类 + * 活动赠送商品表(TbCouponProduct)表查询类 * * @author ww * @since 2024-08-20 11:27:40 diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/TbShopCouponQueryCriteria.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/TbShopCouponQueryCriteria.java new file mode 100644 index 00000000..3f5de2e0 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/TbShopCouponQueryCriteria.java @@ -0,0 +1,17 @@ +package cn.ysk.cashier.dto; + +import lombok.Data; + +/** + * 优惠券(TbShopCoupon)表查询类 + * + * @author ww + * @since 2024-10-22 15:43:25 + */ +@Data +public class TbShopCouponQueryCriteria { + private Integer shopId; + private long page; + private long size; +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotButtonConfigMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotButtonConfigMapper.java deleted file mode 100644 index 73775b83..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotButtonConfigMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.BotButtonConfig; -import cn.ysk.cashier.dto.BotButtonConfigDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-31 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface BotButtonConfigMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotConfigMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotConfigMapper.java deleted file mode 100644 index c7ec730b..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotConfigMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.BotConfig; -import cn.ysk.cashier.dto.BotConfigDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-31 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface BotConfigMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotUserFlowMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotUserFlowMapper.java deleted file mode 100644 index bd547896..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotUserFlowMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.BotUserFlow; -import cn.ysk.cashier.dto.BotUserFlowDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-30 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface BotUserFlowMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotUserMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotUserMapper.java deleted file mode 100644 index 40cbe449..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/BotUserMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.BotUser; -import cn.ysk.cashier.dto.BotUserDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-30 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface BotUserMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/TbRenewalsPayLogMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/TbRenewalsPayLogMapper.java deleted file mode 100644 index 63945c57..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/TbRenewalsPayLogMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.TbRenewalsPayLog; -import cn.ysk.cashier.dto.TbRenewalsPayLogDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2023-11-07 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface TbRenewalsPayLogMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbMerchantCouponMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbMerchantCouponMapper.java deleted file mode 100644 index 34b786c9..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbMerchantCouponMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper.shop; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.shop.TbMerchantCoupon; -import cn.ysk.cashier.dto.shop.TbMerchantCouponDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-03-20 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface TbMerchantCouponMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbReceiptSalesMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbReceiptSalesMapper.java deleted file mode 100644 index febd2c34..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbReceiptSalesMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper.shop; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.shop.TbReceiptSales; -import cn.ysk.cashier.dto.shop.TbReceiptSalesDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-08 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface TbReceiptSalesMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbShopCashSpreadMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbShopCashSpreadMapper.java deleted file mode 100644 index aabf892a..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbShopCashSpreadMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper.shop; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.shop.TbShopCashSpread; -import cn.ysk.cashier.dto.shop.TbShopCashSpreadDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-05 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface TbShopCashSpreadMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbShopCurrencyMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbShopCurrencyMapper.java deleted file mode 100644 index 6ad1878c..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mapper/shop/TbShopCurrencyMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.mapper.shop; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.pojo.shop.TbShopCurrency; -import cn.ysk.cashier.dto.shop.TbShopCurrencyDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-05 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface TbShopCurrencyMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/Activate.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/Activate.java deleted file mode 100644 index 214a96ee..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/Activate.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ysk.cashier.mybatis.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.util.List; - -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("tb_activate") -public class Activate extends Model { - private static final long serialVersionUID = 1L; - @TableId(type = IdType.AUTO) - private Integer id; - private Integer shopId; - private Integer minNum; - private Integer maxNum; - private BigDecimal handselNum; - private String handselType; - private String isDel; - //是否赠送商品 0否 1是 - private Integer isGiftPro; - @TableField(exist = false) - private List products; -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivate.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivate.java index 68a4c144..efb93be9 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivate.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivate.java @@ -1,44 +1,103 @@ package cn.ysk.cashier.mybatis.entity; -import lombok.Getter; -import lombok.Setter; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.extension.activerecord.Model; -import javax.persistence.*; -import javax.validation.constraints.Size; -import java.math.BigDecimal; +@SuppressWarnings("serial") +public class TbActivate extends Model { -@Getter -@Setter -@Entity -@Table(name = "tb_activate") -public class TbActivate { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", nullable = false) private Integer id; - @Column(name = "shop_id") private Integer shopId; + //充值金额 + private Integer amount; + //赠送金额 + private Integer giftAmount; + //是否使用优惠卷 0否 1是 + private Integer isUseCoupon; + //优惠卷id + private Integer couponId; + //优惠卷数量 + private Integer num; - @Column(name = "min_num") - private Integer minNum; + @TableField(fill = FieldFill.INSERT) + private Date createTime; + @TableField(fill = FieldFill.UPDATE) + private Date updateTime; - @Column(name = "max_num") - private Integer maxNum; - @Column(name = "handsel_num", precision = 10, scale = 2) - private BigDecimal handselNum; + public Integer getId() { + return id; + } - @Size(max = 20) - @Column(name = "handsel_type", length = 20) - private String handselType; + public void setId(Integer id) { + this.id = id; + } - @Size(max = 20) - @Column(name = "is_del", length = 20) - private String isDel; + public Integer getShopId() { + return shopId; + } - @Size(max = 255) - @Column(name = "is_user") - private String isUser; + public void setShopId(Integer shopId) { + this.shopId = shopId; + } + public Integer getAmount() { + return amount; + } + + public void setAmount(Integer amount) { + this.amount = amount; + } + + public Integer getGiftAmount() { + return giftAmount; + } + + public void setGiftAmount(Integer giftAmount) { + this.giftAmount = giftAmount; + } + + public Integer getIsUseCoupon() { + return isUseCoupon; + } + + public void setIsUseCoupon(Integer isUseCoupon) { + this.isUseCoupon = isUseCoupon; + } + + public Integer getCouponId() { + return couponId; + } + + public void setCouponId(Integer couponId) { + this.couponId = couponId; + } + + public Integer getNum() { + return num; + } + + public void setNum(Integer num) { + this.num = num; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } } + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateInRecord.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateInRecord.java index 06e25bcc..d688ef29 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateInRecord.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateInRecord.java @@ -2,15 +2,17 @@ package cn.ysk.cashier.mybatis.entity; import java.util.Date; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.extension.activerecord.Model; import java.io.Serializable; /** - * 活动商品赠送表(TbActivateInRecord)表实体类 + * 活动商品赠送记录表(TbActivateInRecord)表实体类 * * @author ww - * @since 2024-08-22 14:50:16 + * @since 2024-10-23 09:49:59 */ @SuppressWarnings("serial") public class TbActivateInRecord extends Model { @@ -18,8 +20,18 @@ public class TbActivateInRecord extends Model { private Integer id; //会员id private Integer vipUserId; + //卷Id (校验是否可用) + private Integer couponId; + //卷描述 满10减2/商品卷 + private String name; + //1-满减 2-商品 + private Integer type; //商品id private Integer proId; + //满多少金额 + private Integer fullAmount; + //减多少金额 + private Integer discountAmount; //赠送数量 private Integer num; //未使用数量 @@ -32,9 +44,11 @@ public class TbActivateInRecord extends Model { private Integer sourceFlowId; private Date createTime; - + @TableField(fill = FieldFill.UPDATE) private Date updateTime; + private String couponJson; + public Integer getId() { return id; @@ -52,6 +66,30 @@ public class TbActivateInRecord extends Model { this.vipUserId = vipUserId; } + public Integer getCouponId() { + return couponId; + } + + public void setCouponId(Integer couponId) { + this.couponId = couponId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + public Integer getProId() { return proId; } @@ -60,6 +98,22 @@ public class TbActivateInRecord extends Model { this.proId = proId; } + public Integer getFullAmount() { + return fullAmount; + } + + public void setFullAmount(Integer fullAmount) { + this.fullAmount = fullAmount; + } + + public Integer getDiscountAmount() { + return discountAmount; + } + + public void setDiscountAmount(Integer discountAmount) { + this.discountAmount = discountAmount; + } + public Integer getNum() { return num; } @@ -115,5 +169,13 @@ public class TbActivateInRecord extends Model { public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } + + public String getCouponJson() { + return couponJson; + } + + public void setCouponJson(String couponJson) { + this.couponJson = couponJson; + } } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateOutRecord.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateOutRecord.java index fc57add8..f050b14a 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateOutRecord.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateOutRecord.java @@ -2,6 +2,8 @@ package cn.ysk.cashier.mybatis.entity; import java.util.Date; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.extension.activerecord.Model; import java.io.Serializable; @@ -10,27 +12,32 @@ import java.io.Serializable; * 活动赠送商品使用记录表(TbActivateOutRecord)表实体类 * * @author ww - * @since 2024-08-22 14:53:52 + * @since 2024-10-23 09:50:40 */ @SuppressWarnings("serial") public class TbActivateOutRecord extends Model { private Integer id; - //商品赠送Id + + private Integer shopId; + //订单id + private String orderId; + //商品赠送Id tb_activate_in_record的id private Integer giveId; - //商品id - private Integer proId; - //未使用数量 + //会员id + private Integer vipUserId; + //1-满减 2-商品 + private Integer type; + //使用数量 private Integer useNum; //退单量 private Integer refNum; - //订单id - private String orderId; //新建: create, 完成: closed, 取消:cancel, private String status; + @TableField(fill = FieldFill.INSERT) private Date createTime; - + @TableField(fill = FieldFill.UPDATE) private Date updateTime; @@ -42,6 +49,22 @@ public class TbActivateOutRecord extends Model { this.id = id; } + public Integer getShopId() { + return shopId; + } + + public void setShopId(Integer shopId) { + this.shopId = shopId; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + public Integer getGiveId() { return giveId; } @@ -50,12 +73,20 @@ public class TbActivateOutRecord extends Model { this.giveId = giveId; } - public Integer getProId() { - return proId; + public Integer getVipUserId() { + return vipUserId; } - public void setProId(Integer proId) { - this.proId = proId; + public void setVipUserId(Integer vipUserId) { + this.vipUserId = vipUserId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; } public Integer getUseNum() { @@ -74,14 +105,6 @@ public class TbActivateOutRecord extends Model { this.refNum = refNum; } - public String getOrderId() { - return orderId; - } - - public void setOrderId(String orderId) { - this.orderId = orderId; - } - public String getStatus() { return status; } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateProduct.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateProduct.java deleted file mode 100644 index 952423a4..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbActivateProduct.java +++ /dev/null @@ -1,83 +0,0 @@ -package cn.ysk.cashier.mybatis.entity; - -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.extension.activerecord.Model; - -import java.io.Serializable; - -/** - * 活动赠送商品表(TbActivateProduct)表实体类 - * - * @author ww - * @since 2024-08-20 11:27:40 - */ -@SuppressWarnings("serial") -public class TbActivateProduct extends Model { - - private Integer id; - //活动Id - private Integer activateId; - //商品id - private Integer productId; - //数量 - private Integer num; - - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @TableField(fill = FieldFill.UPDATE) - private Date updateTime; - - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getActivateId() { - return activateId; - } - - public void setActivateId(Integer activateId) { - this.activateId = activateId; - } - - public Integer getProductId() { - return productId; - } - - public void setProductId(Integer productId) { - this.productId = productId; - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } -} - diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbCouponProduct.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbCouponProduct.java new file mode 100644 index 00000000..9a3273f3 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbCouponProduct.java @@ -0,0 +1,40 @@ +package cn.ysk.cashier.mybatis.entity; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import lombok.Data; + +import java.io.Serializable; + +/** + * 活动赠送商品表(TbActivateProduct)表实体类 + * + * @author ww + * @since 2024-08-20 11:27:40 + */ +@Data +@SuppressWarnings("serial") +public class TbCouponProduct extends Model { + private Integer id; + //活动Id + private Integer couponId; + //商品id + private Integer productId; + //数量 + private Integer num; + @TableField(exist = false) + private String name; + @TableField(exist = false) + private String coverImg; + + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + @TableField(fill = FieldFill.UPDATE) + private Date updateTime; + +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbShopCoupon.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbShopCoupon.java new file mode 100644 index 00000000..06ba5ee3 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbShopCoupon.java @@ -0,0 +1,253 @@ +package cn.ysk.cashier.mybatis.entity; + +import java.time.LocalTime; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.extension.activerecord.Model; + +import java.io.Serializable; + +/** + * 优惠券(TbShopCoupon)表实体类 + * + * @author ww + * @since 2024-10-24 13:54:34 + */ +@SuppressWarnings("serial") +public class TbShopCoupon extends Model { + //自增 + private Integer id; + + private String shopId; + //名称(无意义) + private String title; + //1-满减 2-商品 + private Integer type; + //满多少金额 + private Integer fullAmount; + //减多少金额 + private Integer discountAmount; + //描述 + private String description; + //发放数量 + private Integer number; + //剩余数量 + private Integer leftNumber; + //有效期类型,可选值为 fixed(固定时间)/custom(自定义时间) + private String validityType; + //有效天数 + private Integer validDays; + //隔多少天生效 + private Integer daysToTakeEffect; + //有效开始时间 + private Date validStartTime; + //有效结束时间 + private Date validEndTime; + //周 数组["周一","周二"] + private String userDays; + //all-全时段 custom-指定时段 + private String useTimeType; + //可用开始时间 + private LocalTime useStartTime; + //可用结束时间 + private LocalTime useEndTime; + //已使用数量 + private Integer useNumber; + //发放人 + private String editor; + //状态0-关闭 1 正常 + private Integer status; + + @TableField(fill = FieldFill.INSERT) + private Date createTime; + @TableField(fill = FieldFill.UPDATE) + private Date updateTime; + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getFullAmount() { + return fullAmount; + } + + public void setFullAmount(Integer fullAmount) { + this.fullAmount = fullAmount; + } + + public Integer getDiscountAmount() { + return discountAmount; + } + + public void setDiscountAmount(Integer discountAmount) { + this.discountAmount = discountAmount; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public Integer getLeftNumber() { + return leftNumber; + } + + public void setLeftNumber(Integer leftNumber) { + this.leftNumber = leftNumber; + } + + public String getValidityType() { + return validityType; + } + + public void setValidityType(String validityType) { + this.validityType = validityType; + } + + public Integer getValidDays() { + return validDays; + } + + public void setValidDays(Integer validDays) { + this.validDays = validDays; + } + + public Integer getDaysToTakeEffect() { + return daysToTakeEffect; + } + + public void setDaysToTakeEffect(Integer daysToTakeEffect) { + this.daysToTakeEffect = daysToTakeEffect; + } + + public Date getValidStartTime() { + return validStartTime; + } + + public void setValidStartTime(Date validStartTime) { + this.validStartTime = validStartTime; + } + + public Date getValidEndTime() { + return validEndTime; + } + + public void setValidEndTime(Date validEndTime) { + this.validEndTime = validEndTime; + } + + public String getUserDays() { + return userDays; + } + + public void setUserDays(String userDays) { + this.userDays = userDays; + } + + public String getUseTimeType() { + return useTimeType; + } + + public void setUseTimeType(String useTimeType) { + this.useTimeType = useTimeType; + } + + public LocalTime getUseStartTime() { + return useStartTime; + } + + public void setUseStartTime(LocalTime useStartTime) { + this.useStartTime = useStartTime; + } + + public LocalTime getUseEndTime() { + return useEndTime; + } + + public void setUseEndTime(LocalTime useEndTime) { + this.useEndTime = useEndTime; + } + + public Integer getUseNumber() { + return useNumber; + } + + public void setUseNumber(Integer useNumber) { + this.useNumber = useNumber; + } + + public String getEditor() { + return editor; + } + + public void setEditor(String editor) { + this.editor = editor; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbUserStorage.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbUserStorage.java deleted file mode 100644 index 1fc09db8..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbUserStorage.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.ysk.cashier.mybatis.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("tb_user_storage") -public class TbUserStorage extends Model { - private static final long serialVersionUID = 1L; - @TableId(type = IdType.ASSIGN_UUID) - private String id; // 记录ID - private Integer userId; // 用户ID - private String shopId; // 用户ID - private Integer productId; - private Integer num; - private Integer outNum; - private Integer inNum; - private Date createTime; - private String account; - private String unit; - private String productName; - private Integer skuId; - private String skuName; - private String imgUrl; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/ActivateMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/ActivateMapper.java deleted file mode 100644 index cadddeab..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/ActivateMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package cn.ysk.cashier.mybatis.mapper; - -import cn.ysk.cashier.mybatis.entity.Activate; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -public interface ActivateMapper extends BaseMapper { - - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbActivateProductMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCouponProductMapper.java similarity index 61% rename from eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbActivateProductMapper.java rename to eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCouponProductMapper.java index 71e3d676..7e900b4b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbActivateProductMapper.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCouponProductMapper.java @@ -1,6 +1,6 @@ package cn.ysk.cashier.mybatis.mapper; -import cn.ysk.cashier.mybatis.entity.TbActivateProduct; +import cn.ysk.cashier.mybatis.entity.TbCouponProduct; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author ww * @since 2024-08-20 11:27:40 */ -public interface TbActivateProductMapper extends BaseMapper { +public interface TbCouponProductMapper extends BaseMapper { } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopCouponMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopCouponMapper.java new file mode 100644 index 00000000..b56eae0d --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopCouponMapper.java @@ -0,0 +1,15 @@ +package cn.ysk.cashier.mybatis.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import cn.ysk.cashier.mybatis.entity.TbShopCoupon; + +/** + * 优惠券(TbShopCoupon)表数据库访问层 + * + * @author ww + * @since 2024-10-22 15:43:25 + */ +public interface TbShopCouponMapper extends BaseMapper { + +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbUserStorageMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbUserStorageMapper.java deleted file mode 100644 index 2e175574..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbUserStorageMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package cn.ysk.cashier.mybatis.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import cn.ysk.cashier.mybatis.entity.TbUserStorage; - -public interface TbUserStorageMapper extends BaseMapper { - - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/rest/StorageController.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/rest/StorageController.java index 09d2d775..ee640996 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/rest/StorageController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/rest/StorageController.java @@ -2,14 +2,12 @@ package cn.ysk.cashier.mybatis.rest; import cn.ysk.cashier.annotation.Log; import cn.ysk.cashier.exception.BadRequestException; -import cn.ysk.cashier.mybatis.entity.Activate; -import cn.ysk.cashier.mybatis.service.ShopService; +import cn.ysk.cashier.mybatis.entity.TbActivate; +import cn.ysk.cashier.mybatis.service.TbActivateService; import cn.ysk.cashier.service.WxService; import cn.ysk.cashier.utils.CacheKey; import cn.ysk.cashier.utils.RedisUtils; -import cn.ysk.cashier.utils.SecurityUtils; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; @@ -25,31 +23,23 @@ import java.util.Map; @Api(tags = "/shop/storage") @RequestMapping("/shop/storage") public class StorageController { - private final ShopService shopService; + + private final TbActivateService tbActivateService; private final RedisUtils redisUtils; private final WxService wxService; @GetMapping("/findActivate") public ResponseEntity findActivate(@RequestParam String shopId){ - String userName = SecurityUtils.getCurrentUsername(); - return new ResponseEntity<>(shopService.findActivate(shopId), HttpStatus.OK); + return new ResponseEntity<>(tbActivateService.findActivate(shopId), HttpStatus.OK); } @Log("修改活动数据") - @PostMapping("/modityActivate") - public ResponseEntity modityActivate(@RequestBody Activate activate){ - if (activate.getIsGiftPro() != null && activate.getIsGiftPro() == 1 && CollectionUtils.isEmpty(activate.getProducts())) - throw new BadRequestException("赠送商品不可为空"); - String userName = SecurityUtils.getCurrentUsername(); - shopService.modityActivate(activate); + @PostMapping("/upActivate") + public ResponseEntity upActivate(@RequestBody TbActivate activate){ + tbActivateService.modifyActivate(activate); return new ResponseEntity<>(HttpStatus.OK); } - @GetMapping("/activate/{activateId}") - @ApiOperation("查询活动赠送商品") - public ResponseEntity queryActivatePros(@PathVariable("activateId") Integer activateId){ - return new ResponseEntity<>(shopService.findActivatePros(activateId),HttpStatus.OK); - } /** * @param params diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/ShopService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/ShopService.java deleted file mode 100644 index a0588b83..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/ShopService.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.ysk.cashier.mybatis.service; - -import cn.ysk.cashier.mybatis.entity.Activate; -import cn.ysk.cashier.mybatis.entity.StorageVo; -import cn.ysk.cashier.mybatis.vo.ActivateProsVo; -import cn.ysk.cashier.pojo.product.TbProduct; -import org.springframework.data.domain.Pageable; - -import java.util.List; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author admin -* @date 2023-10-30 -**/ -public interface ShopService { - Object findStorage(Integer shopId, String account, Pageable pageable); - - void outStorage(Integer id, String userName, Integer num); - - - void inStorage(StorageVo storageVo, String userName); - - Object findActivate(String shopId); - - void modityActivate(Activate activate); - - List findActivatePros(Integer activate); -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbActivateService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbActivateService.java index 0ef72d70..1cbca06b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbActivateService.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbActivateService.java @@ -10,4 +10,8 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface TbActivateService extends IService { + + Object findActivate(String shopId); + + void modifyActivate(TbActivate activate); } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbActivateProductService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbCouponProductService.java similarity index 62% rename from eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbActivateProductService.java rename to eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbCouponProductService.java index 14781817..caecd8a9 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbActivateProductService.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbCouponProductService.java @@ -1,6 +1,6 @@ package cn.ysk.cashier.mybatis.service; -import cn.ysk.cashier.mybatis.entity.TbActivateProduct; +import cn.ysk.cashier.mybatis.entity.TbCouponProduct; import com.baomidou.mybatisplus.extension.service.IService; @@ -10,7 +10,8 @@ import com.baomidou.mybatisplus.extension.service.IService; * @author ww * @since 2024-08-20 11:27:40 */ -public interface TbActivateProductService extends IService { +public interface TbCouponProductService extends IService { + } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbShopCouponService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbShopCouponService.java new file mode 100644 index 00000000..fb793a27 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbShopCouponService.java @@ -0,0 +1,31 @@ +package cn.ysk.cashier.mybatis.service; + +import cn.ysk.cashier.mybatis.entity.TbCouponProduct; +import cn.ysk.cashier.mybatis.vo.TbShopCouponVo; +import com.baomidou.mybatisplus.extension.service.IService; +import cn.ysk.cashier.mybatis.entity.TbShopCoupon; +import cn.ysk.cashier.dto.TbShopCouponQueryCriteria; + +import java.util.List; +import java.util.Map; + +/** + * 优惠券(TbShopCoupon)表服务接口 + * + * @author ww + * @since 2024-10-22 15:43:25 + */ +public interface TbShopCouponService extends IService { + + Map queryAll(TbShopCouponQueryCriteria criteria); + + + TbShopCoupon findById (Integer id); + + + boolean update(TbShopCouponVo param); + boolean delete(Integer id); + + List findActivatePros(Integer couponId); +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/ShopServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/ShopServiceImpl.java deleted file mode 100644 index d39b2c62..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/ShopServiceImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -package cn.ysk.cashier.mybatis.service.impl; - -import cn.ysk.cashier.mybatis.entity.Activate; -import cn.ysk.cashier.mybatis.entity.TbActivateProduct; -import cn.ysk.cashier.mybatis.mapper.*; -import cn.ysk.cashier.mybatis.service.TbActivateProductService; -import cn.ysk.cashier.mybatis.vo.ActivateProsVo; -import cn.ysk.cashier.pojo.product.TbProduct; -import cn.ysk.cashier.pojo.product.TbProductSku; -import cn.ysk.cashier.pojo.shop.TbMerchantAccount; -import cn.ysk.cashier.repository.product.TbProductRepository; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import cn.ysk.cashier.exception.NewBadRequestException; -import cn.ysk.cashier.mybatis.entity.StorageVo; -import cn.ysk.cashier.mybatis.entity.TbUserStorage; -import cn.ysk.cashier.mybatis.service.ShopService; -import cn.ysk.cashier.utils.*; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.annotation.Resource; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author admin - * @website https://eladmin.vip - * @description 服务实现 - * @date 2023-10-30 - **/ -@Service -public class ShopServiceImpl implements ShopService { - - @Autowired - private TbUserStorageMapper userStorageMapper; - @Autowired - private TbMerchantAccountMapper tbMerchantAccountMapper; - @Autowired - private TbProducSkutMapper producSkutMapper; - @Autowired - private ActivateMapper activateMapper; - @Autowired - private TbProductRepository tbProductRepository; - @Resource - private TbActivateProductService actProductService; - @Override - public Object findStorage(Integer shopId, String account, Pageable pageable) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("shop_id", shopId); - if (StringUtils.isNotEmpty(account)) { - queryWrapper.eq("account", account); - } - IPage iPage = userStorageMapper.selectPage(new Page<>(pageable.getPageNumber(), pageable.getPageSize()), queryWrapper); - return PageUtil.toPage(iPage.getRecords(), iPage.getTotal()); - } - - @Override - public void outStorage(Integer id, String userName, Integer num) { - if (Objects.isNull(num) || num < 0) { - throw new NewBadRequestException("请输入出库数量"); - } - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("account", userName); - TbMerchantAccount merchantAccount = tbMerchantAccountMapper.selectOne(wrapper); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("id", id); - queryWrapper.eq("shop_id", merchantAccount.getShopId()); - TbUserStorage userStorage = userStorageMapper.selectOne(queryWrapper); - if (Objects.isNull(userStorage)) { - throw new NewBadRequestException("存储商品在该店铺不存在"); - } - if (userStorage.getNum() < num) { - throw new NewBadRequestException("库存不足"); - } - userStorage.setNum(userStorage.getNum() - num); - userStorage.setOutNum(userStorage.getOutNum() + num); - userStorageMapper.updateById(userStorage); - } - - @Override - public void inStorage(StorageVo storageVo, String userName) { - if (Objects.isNull(storageVo.getNum()) || storageVo.getNum() < 0) { - throw new NewBadRequestException("请输入出库数量"); - } - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("account", userName); - TbMerchantAccount merchantAccount = tbMerchantAccountMapper.selectOne(wrapper); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("product_name", storageVo.getProductName()); - queryWrapper.eq("account", storageVo.getAccount()); - queryWrapper.eq("shop_id", merchantAccount.getShopId()); - TbUserStorage userStorage = userStorageMapper.selectOne(queryWrapper); - if (Objects.nonNull(userStorage)) { - userStorage.setNum(userStorage.getNum() + storageVo.getNum()); - userStorage.setInNum(userStorage.getInNum() + storageVo.getNum()); - userStorageMapper.updateById(userStorage); - }else { - userStorage = new TbUserStorage(); - userStorage.setAccount(storageVo.getAccount()); - userStorage.setCreateTime(new Date()); - userStorage.setShopId(merchantAccount.getShopId()); - userStorage.setNum(storageVo.getNum()); - userStorage.setOutNum(0); - userStorage.setInNum(storageVo.getNum()); - userStorage.setImgUrl(storageVo.getImg()); - userStorage.setProductName(storageVo.getImg()); - userStorage.setUnit(storageVo.getUnit()); - userStorageMapper.insert(userStorage); - } - } - - @Override - public Object findActivate(String shopId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("shop_id",shopId); - queryWrapper.orderByDesc("id"); - List list = activateMapper.selectList(queryWrapper); - return list; - } - - @Override - public void modityActivate(Activate activate) { - if (Objects.nonNull(activate.getId()) && activate.getId() > 0){ - activate.setHandselType("GD"); - activate.setMaxNum(activate.getMinNum()); - activateMapper.updateById(activate); - }else { - activate.setHandselType("GD"); - activate.setMaxNum(activate.getMinNum()); - activateMapper.insert(activate); - } - if(!CollectionUtils.isEmpty(activate.getProducts())){ - List collect = new ArrayList<>(); - for (TbActivateProduct product : activate.getProducts()) { - product.setActivateId(activate.getId()); - if (product.getId() != null) collect.add(product.getId()); - } - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("activate_id",activate.getId()); - List actProducts = actProductService.list(queryWrapper); - for (TbActivateProduct actProduct : actProducts) { - if (!collect.contains(actProduct.getId())) { - actProductService.removeById(actProduct.getId()); - } - } - actProductService.saveOrUpdateBatch(activate.getProducts()); - }else { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(TbActivateProduct::getActivateId, activate.getId()); // 条件:年龄等于30 - actProductService.remove(queryWrapper); - } - } - - @Override - public List findActivatePros(Integer activateId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("activate_id", activateId); - List actProducts = actProductService.list(queryWrapper); - if (!CollectionUtils.isEmpty(actProducts)) { - Map map = actProducts.stream().collect( - Collectors.toMap( - TbActivateProduct::getProductId, - TbActivateProduct::getNum, - (existing, replacement) -> existing)); - if (!CollectionUtils.isEmpty(map)) { - List products = tbProductRepository.findByIds(new ArrayList<>(map.keySet())); - List results= new ArrayList<>(); - for (TbProduct product : products) { - ActivateProsVo pro =new ActivateProsVo(product.getId(),product.getName(),product.getCoverImg()); - pro.setNum(map.get(pro.getId())); - results.add(pro); - } - return results; - } - } - return new ArrayList<>(); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbActivateProductServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbActivateProductServiceImpl.java deleted file mode 100644 index ec780b6c..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbActivateProductServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.ysk.cashier.mybatis.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import cn.ysk.cashier.mybatis.mapper.TbActivateProductMapper; -import cn.ysk.cashier.mybatis.entity.TbActivateProduct; -import cn.ysk.cashier.mybatis.service.TbActivateProductService; -import org.springframework.stereotype.Service; -import org.apache.commons.lang3.StringUtils; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import cn.ysk.cashier.dto.TbActivateProductQueryCriteria; -import org.springframework.beans.factory.annotation.Autowired; -import cn.ysk.cashier.utils.PageUtil; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -import java.util.Map; - -/** - * 活动赠送商品表(TbActivateProduct)表服务实现类 - * - * @author ww - * @since 2024-08-20 11:27:40 - */ -@Service("tbActivateProductService") -public class TbActivateProductServiceImpl extends ServiceImpl implements TbActivateProductService { - -} - diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbActivateServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbActivateServiceImpl.java index afd2b452..d910fd55 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbActivateServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbActivateServiceImpl.java @@ -1,10 +1,18 @@ package cn.ysk.cashier.mybatis.service.impl; import cn.ysk.cashier.mybatis.entity.TbActivate; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import cn.ysk.cashier.mybatis.service.TbActivateService; import cn.ysk.cashier.mybatis.mapper.TbActivateMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; /** * @author Administrator @@ -12,9 +20,28 @@ import org.springframework.stereotype.Service; * @createDate 2024-09-03 14:08:30 */ @Service -public class TbActivateServiceImpl extends ServiceImpl - implements TbActivateService{ +public class TbActivateServiceImpl extends ServiceImpl implements TbActivateService{ + @Autowired + private TbActivateMapper activateMapper; + + @Override + public Object findActivate(String shopId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("shop_id",shopId); + queryWrapper.orderByDesc("id"); + List list = activateMapper.selectList(queryWrapper); + return list; + } + + @Override + public void modifyActivate(TbActivate activate) { + if (Objects.nonNull(activate.getId()) && activate.getId() > 0){ + activateMapper.updateById(activate); + }else { + activateMapper.insert(activate); + } + } } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbCouponProductServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbCouponProductServiceImpl.java new file mode 100644 index 00000000..fcf2a09d --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbCouponProductServiceImpl.java @@ -0,0 +1,19 @@ +package cn.ysk.cashier.mybatis.service.impl; + +import cn.ysk.cashier.mybatis.entity.TbCouponProduct; +import cn.ysk.cashier.mybatis.mapper.TbCouponProductMapper; +import cn.ysk.cashier.mybatis.service.TbCouponProductService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * 活动赠送商品表(TbActivateProduct)表服务实现类 + * + * @author ww + * @since 2024-08-20 11:27:40 + */ +@Service("tbCouponProductService") +public class TbCouponProductServiceImpl extends ServiceImpl implements TbCouponProductService { + +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopCouponServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopCouponServiceImpl.java new file mode 100644 index 00000000..4e466b3f --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopCouponServiceImpl.java @@ -0,0 +1,130 @@ +package cn.ysk.cashier.mybatis.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import cn.hutool.core.collection.CollectionUtil; +import cn.ysk.cashier.dto.TbShopCouponQueryCriteria; +import cn.ysk.cashier.mybatis.entity.TbCouponProduct; +import cn.ysk.cashier.mybatis.entity.TbShopCoupon; +import cn.ysk.cashier.mybatis.mapper.TbShopCouponMapper; +import cn.ysk.cashier.mybatis.service.TbCouponProductService; +import cn.ysk.cashier.mybatis.service.TbShopCouponService; +import cn.ysk.cashier.mybatis.vo.TbShopCouponVo; +import cn.ysk.cashier.pojo.product.TbProduct; +import cn.ysk.cashier.repository.product.TbProductRepository; +import cn.ysk.cashier.utils.PageUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 优惠券(TbShopCoupon)表服务实现类 + * + * @author ww + * @since 2024-10-22 15:43:25 + */ +@Service("tbShopCouponService") +public class TbShopCouponServiceImpl extends ServiceImpl implements TbShopCouponService { + + @Autowired + private TbShopCouponMapper tbShopCouponmapper; + @Autowired + private TbCouponProductService couProductService; + @Autowired + private TbProductRepository tbProductRepository; + + @Override + public Map queryAll(TbShopCouponQueryCriteria criteria) { + Page page = new Page<>(criteria.getPage(), criteria.getSize()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("shop_id", criteria.getShopId()); +// if (StringUtils.isNotBlank(criteria.getName())) { +// wrapper.and(w -> w.like("name", criteria.getName()) +// .or() +// .like("singer", criteria.getName()) +// .or() +// .like("origin_singer", criteria.getName())); +// } + wrapper.orderByDesc("create_time"); + Page ipage = tbShopCouponmapper.selectPage(page, wrapper); + return PageUtil.toPage(ipage.getRecords(), ipage.getTotal()); + } + + @Override + public TbShopCouponVo findById(Integer id) { + TbShopCouponVo tbShopCouponVo = new TbShopCouponVo(); + TbShopCoupon tbShopCoupon = tbShopCouponmapper.selectById(id); + BeanUtil.copyProperties(tbShopCoupon,tbShopCouponVo, CopyOptions.create().setIgnoreNullValue(true)); + if(tbShopCoupon.getType()==2){ + List activatePros = findActivatePros(id); + tbShopCouponVo.setProducts(activatePros); + } + return tbShopCouponVo; + } + + + @Override + public boolean update(TbShopCouponVo param) { + if (param.getId() == null) { + tbShopCouponmapper.insert(param); + } else { + tbShopCouponmapper.updateById(param); + } + if (CollectionUtil.isNotEmpty(param.getProducts())) { + List collect = new ArrayList<>(); + for (TbCouponProduct product : param.getProducts()) { + product.setCouponId(param.getId()); + if (product.getId() != null) collect.add(product.getId()); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("coupon_id", param.getId()); + List actProducts = couProductService.list(queryWrapper); + for (TbCouponProduct actProduct : actProducts) { + if (!collect.contains(actProduct.getId())) { + couProductService.removeById(actProduct.getId()); + } + } + couProductService.saveOrUpdateBatch(param.getProducts()); + } else { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(TbCouponProduct::getCouponId, param.getId()); + couProductService.remove(queryWrapper); + } + return true; + } + + @Override + public boolean delete(Integer id) { + tbShopCouponmapper.deleteById(id); + couProductService.remove(new LambdaQueryWrapper().eq(TbCouponProduct::getCouponId, id)); + return true; + } + + + public List findActivatePros(Integer couponId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("coupon_id", couponId); + List actProducts = couProductService.list(queryWrapper); + if (!CollectionUtils.isEmpty(actProducts)) { + for (TbCouponProduct actProduct : actProducts) { + TbProduct product = tbProductRepository.findById(actProduct.getProductId()).orElse(null); + if (product != null) { + actProduct.setName(product.getName()); + actProduct.setCoverImg(product.getCoverImg()); + } + } + return actProducts; + } + return new ArrayList<>(); + } +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/vo/ActivateProsVo.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/vo/ActivateProsVo.java deleted file mode 100644 index 2292ce20..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/vo/ActivateProsVo.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.ysk.cashier.mybatis.vo; - -import lombok.Data; - -@Data -public class ActivateProsVo { - private Integer id; - private String name; - private String coverImg; - private Integer num; - - public ActivateProsVo(Integer id, String name, String coverImg) { - this.id = id; - this.name = name; - this.coverImg = coverImg; - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/vo/TbShopCouponVo.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/vo/TbShopCouponVo.java new file mode 100644 index 00000000..f5eb8c80 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/vo/TbShopCouponVo.java @@ -0,0 +1,14 @@ +package cn.ysk.cashier.mybatis.vo; + +import cn.ysk.cashier.mybatis.entity.TbCouponProduct; +import cn.ysk.cashier.mybatis.entity.TbShopCoupon; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class TbShopCouponVo extends TbShopCoupon { + + private List products = new ArrayList<>(); +} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotButtonConfig.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotButtonConfig.java deleted file mode 100644 index 80314174..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotButtonConfig.java +++ /dev/null @@ -1,53 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.pojo; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -import java.io.Serializable; - -/** -* @website https://eladmin.vip -* @description / -* @author admin -* @date 2023-10-31 -**/ -@Entity -@Data -@Table(name="bot_button_config") -public class BotButtonConfig implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "`id`") - @ApiModelProperty(value = "id") - private Integer id; - - @Column(name = "`button_name`") - @ApiModelProperty(value = "按钮名称") - private String buttonName; - - @Column(name = "`button_value`") - @ApiModelProperty(value = "按钮值") - private String buttonValue; - - public void copy(BotButtonConfig source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotConfig.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotConfig.java deleted file mode 100644 index c1cebb1b..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotConfig.java +++ /dev/null @@ -1,57 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.pojo; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -import java.io.Serializable; - -/** -* @website https://eladmin.vip -* @description / -* @author admin -* @date 2023-10-31 -**/ -@Entity -@Data -@Table(name="bot_config") -public class BotConfig implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "`id`") - @ApiModelProperty(value = "id") - private Integer id; - - @Column(name = "`config_key`") - @ApiModelProperty(value = "元素键值") - private String configKey; - - @Column(name = "`config_value`") - @ApiModelProperty(value = "元素值") - private String configValue; - - @Column(name = "`remark`") - @ApiModelProperty(value = "描述") - private String remark; - - public void copy(BotConfig source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotUser.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotUser.java deleted file mode 100644 index 0b6b799d..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotUser.java +++ /dev/null @@ -1,123 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.pojo; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -import java.sql.Timestamp; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @website https://eladmin.vip -* @description / -* @author admin -* @date 2023-10-30 -**/ -@Entity -@Data -@Table(name="bot_user") -public class BotUser implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "`id`") - @ApiModelProperty(value = "id") - private Integer id; - - @Column(name = "`father_id`") - @ApiModelProperty(value = "fatherId") - private Integer fatherId; - - @Column(name = "`father_telegram_id`") - @ApiModelProperty(value = "父级电报号") - private String fatherTelegramId; - - @Column(name = "`user_telegram_id`") - @ApiModelProperty(value = "电报号") - private String userTelegramId; - - @Column(name = "`user_name`") - @ApiModelProperty(value = "用户名称") - private String userName; - - @Column(name = "`group_telegram_id`") - @ApiModelProperty(value = "组电报号") - private String groupTelegramId; - - @Column(name = "`user_code`") - @ApiModelProperty(value = "用户代码") - private String userCode; - - @Column(name = "`user_pay_pass`") - @ApiModelProperty(value = "userPayPass") - private String userPayPass; - - @Column(name = "`bomb_status`") - @ApiModelProperty(value = "bombStatus") - private String bombStatus; - - @Column(name = "`bot_status`") - @ApiModelProperty(value = "用户状态") - private String botStatus; - - @Column(name = "`usdt_recharge_total`") - @ApiModelProperty(value = "总充值") - private BigDecimal usdtRechargeTotal; - - @Column(name = "`usdt_withdraw_total`") - @ApiModelProperty(value = "总提现") - private BigDecimal usdtWithdrawTotal; - - @Column(name = "`balance`") - @ApiModelProperty(value = "总资金") - private BigDecimal balance; - - @Column(name = "`freeze_balance`") - @ApiModelProperty(value = "冻结资金") - private BigDecimal freezeBalance; - - @Column(name = "`version`") - @ApiModelProperty(value = "版本号") - private Integer version; - - @Column(name = "`create_time`") - @ApiModelProperty(value = "创建时间") - private Timestamp createTime; - - @Column(name = "`update_time`") - @ApiModelProperty(value = "更新时间") - private Timestamp updateTime; - - @Column(name = "`user_language`") - @ApiModelProperty(value = "语言") - private String userLanguage; - - @Column(name = "`chip_balance`") - @ApiModelProperty(value = "质押资金") - private BigDecimal chipBalance; - - @Column(name = "`father_bind_time`") - @ApiModelProperty(value = "绑定时间") - private Timestamp fatherBindTime; - - public void copy(BotUser source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotUserFlow.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotUserFlow.java deleted file mode 100644 index 729eb26b..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/BotUserFlow.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.pojo; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -import java.sql.Timestamp; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @website https://eladmin.vip -* @description / -* @author admin -* @date 2023-10-30 -**/ -@Entity -@Data -@Table(name="bot_user_flow") -public class BotUserFlow implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "`id`") - @ApiModelProperty(value = "id") - private Integer id; - - @Column(name = "`user_telegram_id`") - @ApiModelProperty(value = "电报号") - private String userTelegramId; - - @Column(name = "`user_name`") - @ApiModelProperty(value = "用户名称") - private String userName; - - @Column(name = "`biz_code`") - @ApiModelProperty(value = "业务代码") - private String bizCode; - - @Column(name = "`amount`") - @ApiModelProperty(value = "变动金额") - private BigDecimal amount; - - @Column(name = "`old_balance`") - @ApiModelProperty(value = "变动前金额") - private BigDecimal oldBalance; - - @Column(name = "`new_balance`") - @ApiModelProperty(value = "变动后金额") - private BigDecimal newBalance; - - @Column(name = "`create_time`") - @ApiModelProperty(value = "创建时间") - private Timestamp createTime; - - public void copy(BotUserFlow source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/TbRenewalsPayLog.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/TbRenewalsPayLog.java deleted file mode 100644 index 14823320..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/TbRenewalsPayLog.java +++ /dev/null @@ -1,100 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.pojo; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -import javax.validation.constraints.*; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @website https://eladmin.vip -* @description / -* @author lyf -* @date 2023-11-07 -**/ -@Entity -@Data -@Table(name="tb_renewals_pay_log") -public class TbRenewalsPayLog implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "`id`") - @ApiModelProperty(value = "id") - private Integer id; - - @Column(name = "`pay_type`") - @ApiModelProperty(value = "支付方式") - private String payType; - - @Column(name = "`shop_id`") - @ApiModelProperty(value = "店铺Id") - private String shopId; - - @Column(name = "`order_id`") - @ApiModelProperty(value = "订单Id") - private String orderId; - - @Column(name = "`open_id`") - @ApiModelProperty(value = "openId") - private String openId; - - @Column(name = "`user_id`") - @ApiModelProperty(value = "用户Id") - private String userId; - - @Column(name = "`transaction_id`") - @ApiModelProperty(value = "交易单号(第三方交易单号)") - private String transactionId; - - @Column(name = "`amount`",nullable = false) - @NotNull - @ApiModelProperty(value = "金额") - private BigDecimal amount; - - @Column(name = "`status`") - @ApiModelProperty(value = "状态 ") - private Integer status; - - @Column(name = "`remark`") - @ApiModelProperty(value = "备注") - private String remark; - - @Column(name = "`attach`") - @ApiModelProperty(value = "用户自定义参数") - private String attach; - - @Column(name = "`expired_at`") - @ApiModelProperty(value = "到期时间") - private Long expiredAt; - - @Column(name = "`created_at`") - @ApiModelProperty(value = "创建时间") - private Long createdAt; - - @Column(name = "`updated_at`") - @ApiModelProperty(value = "updatedAt") - private Long updatedAt; - - public void copy(TbRenewalsPayLog source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbMerchantCoupon.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbMerchantCoupon.java deleted file mode 100644 index 4c01b1d9..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbMerchantCoupon.java +++ /dev/null @@ -1,467 +0,0 @@ - -package cn.ysk.cashier.pojo.shop; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; - -import javax.persistence.*; -import javax.validation.constraints.*; -import java.math.BigDecimal; -import java.io.Serializable; -import java.sql.Timestamp; - -/** - * @author lyf - * @website https://eladmin.vip - * @description / - * @date 2024-03-20 - **/ -@Entity -@Table(name = "tb_merchant_coupon") -public class TbMerchantCoupon implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "`id`") - @ApiModelProperty(value = "自增") - private Integer id; - - @Column(name = "`status`") - @ApiModelProperty(value = "状态0-关闭 1 正常") - private Integer status; - - @Column(name = "`title`") - @ApiModelProperty(value = " 优惠券名称") - private String title; - - @Column(name = "`template_id`", nullable = false) - @NotBlank - @ApiModelProperty(value = "templateId") - private String templateId = "0"; - - @Column(name = "`shop_id`") - @ApiModelProperty(value = "shopId") - private String shopId; - - @Column(name = "`shop_snap`") - @ApiModelProperty(value = "shopSnap") - private String shopSnap; - - @Column(name = "`from_time`") - @ApiModelProperty(value = "开始时间") - private Timestamp fromTime; - - @Column(name = "`to_time`") - @ApiModelProperty(value = "到期时间") - private Timestamp toTime; - - @Column(name = "`limit_number`") - @ApiModelProperty(value = "限领数量") - private Integer limitNumber; - - @Column(name = "`number`") - @ApiModelProperty(value = "发放数量") - private Integer number; - - @Column(name = "`use_number`") - @ApiModelProperty(value = "已核销数量") - private Integer useNumber; - - @Column(name = "`left_number`", nullable = false) - @ApiModelProperty(value = "剩余数量") - private Integer leftNumber; - - @Column(name = "`amount`") - @ApiModelProperty(value = "优惠金额") - private BigDecimal amount; - - @Column(name = "`limit_amount`") - @ApiModelProperty(value = "订单满赠金额") - private BigDecimal limitAmount; - - @Column(name = "`is_show`") - @ApiModelProperty(value = "是否显示0-不显示 1显示") - private Integer isShow; - - @Column(name = "`pic`") - @ApiModelProperty(value = "图标") - private String pic; - - @Column(name = "`type`") - @ApiModelProperty(value = "0-满减 1-折扣") - private Integer type; - - @Column(name = "`ratio`") - @ApiModelProperty(value = "折扣 ,一位小数") - private Float ratio; - - @Column(name = "`max_ratio_amount`") - @ApiModelProperty(value = "最大折扣金额") - private BigDecimal maxRatioAmount; - - @Column(name = "`track`") - @ApiModelProperty(value = "优惠券途径,首充|分销") - private String track; - - @Column(name = "`class_type`") - @ApiModelProperty(value = "品类product 商品券 ---cateogry 品类券common -通用券") - @NotNull - private String classType; - - @Column(name = "`effect_type`") - @ApiModelProperty(value = "有效期类型:0-toTime有效 1-effectDays有效") - @NotNull - private Integer effectType; - - @Column(name = "`effect_days`") - @ApiModelProperty(value = "领取之日有效天数") - private Integer effectDays; - - @Column(name = "`relation_ids`") - @ApiModelProperty(value = "关联商品Id") - private String relationIds; - - @Column(name = "`relation_list`") - @ApiModelProperty(value = "relationList") - private String relationList; - - @Column(name = "`editor`") - @ApiModelProperty(value = "发放人") - private String editor; - - @Column(name = "`note`") - @ApiModelProperty(value = "说明") - private String note; - - @Column(name = "`created_at`", nullable = false) - @NotNull - @ApiModelProperty(value = "createdAt") - private Long createdAt; - - @Column(name = "`updated_at`", nullable = false) - @NotNull - @ApiModelProperty(value = "updatedAt") - private Long updatedAt; - - @Column(name = "`furnish_meal`") - @ApiModelProperty(value = "支持堂食") - private Integer furnishMeal; - - @Column(name = "`furnish_express`") - @ApiModelProperty(value = "支持配送") - private Integer furnishExpress; - - @Column(name = "`furnish_draw`") - @ApiModelProperty(value = "支持自提") - private Integer furnishDraw; - - @Column(name = "`furnish_vir`") - @ApiModelProperty(value = "支持虚拟") - private Integer furnishVir; - - @Column(name = "`disable_distribute`") - @ApiModelProperty(value = "disableDistribute") - private Integer disableDistribute; - - @Column(name = "`merchant_id`") - @ApiModelProperty(value = "商户Id") - private String merchantId; - - @Column(name = "`category_id`") - @ApiModelProperty(value = "分类id") - private String categoryId; - - public void copy(TbMerchantCoupon source) { - BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true)); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getTemplateId() { - return templateId; - } - - public void setTemplateId(String templateId) { - this.templateId = templateId; - } - - public String getShopId() { - return shopId; - } - - public void setShopId(String shopId) { - this.shopId = shopId; - } - - public String getShopSnap() { - return shopSnap; - } - - public void setShopSnap(String shopSnap) { - this.shopSnap = shopSnap; - } - - public Timestamp getFromTime() { - return fromTime; - } - - public void setFromTime(Timestamp fromTime) { - this.fromTime = fromTime; - } - - public Timestamp getToTime() { - return toTime; - } - - public void setToTime(Timestamp toTime) { - this.toTime = toTime; - } - - public Integer getLimitNumber() { - return limitNumber; - } - - public void setLimitNumber(Integer limitNumber) { - this.limitNumber = limitNumber; - } - - public Integer getNumber() { - return number; - } - - public void setNumber(Integer number) { - this.number = number; - } - - public Integer getUseNumber() { - return useNumber; - } - - public void setUseNumber(Integer useNumber) { - this.useNumber = useNumber; - } - - public Integer getLeftNumber() { - return leftNumber; - } - - public void setLeftNumber(Integer leftNumber) { - this.leftNumber = leftNumber; - } - - public BigDecimal getAmount() { - return amount; - } - - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - - public BigDecimal getLimitAmount() { - return limitAmount; - } - - public void setLimitAmount(BigDecimal limitAmount) { - this.limitAmount = limitAmount; - } - - public Integer getIsShow() { - return isShow; - } - - public void setIsShow(Integer isShow) { - this.isShow = isShow; - } - - public String getPic() { - return pic; - } - - public void setPic(String pic) { - this.pic = pic; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public Float getRatio() { - return ratio; - } - - public void setRatio(Float ratio) { - this.ratio = ratio; - } - - public BigDecimal getMaxRatioAmount() { - return maxRatioAmount; - } - - public void setMaxRatioAmount(BigDecimal maxRatioAmount) { - this.maxRatioAmount = maxRatioAmount; - } - - public String getTrack() { - return track; - } - - public void setTrack(String track) { - this.track = track; - } - - public String getClassType() { - return classType; - } - - public void setClassType(String classType) { - this.classType = classType; - } - - public Integer getEffectType() { - return effectType; - } - - public void setEffectType(Integer effectType) { - this.effectType = effectType; - } - - public Integer getEffectDays() { - return effectDays; - } - - public void setEffectDays(Integer effectDays) { - this.effectDays = effectDays; - } - - public String getRelationIds() { - return relationIds; - } - - public void setRelationIds(String relationIds) { - this.relationIds = relationIds; - } - - public String getRelationList() { - return relationList; - } - - public void setRelationList(String relationList) { - this.relationList = relationList; - } - - public String getEditor() { - return editor; - } - - public void setEditor(String editor) { - this.editor = editor; - } - - public String getNote() { - return note; - } - - public void setNote(String note) { - this.note = note; - } - - public Long getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Long createdAt) { - this.createdAt = createdAt; - } - - public Long getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(Long updatedAt) { - this.updatedAt = updatedAt; - } - - public Integer getFurnishMeal() { - return furnishMeal; - } - - public void setFurnishMeal(Integer furnishMeal) { - this.furnishMeal = furnishMeal; - } - - public Integer getFurnishExpress() { - return furnishExpress; - } - - public void setFurnishExpress(Integer furnishExpress) { - this.furnishExpress = furnishExpress; - } - - public Integer getFurnishDraw() { - return furnishDraw; - } - - public void setFurnishDraw(Integer furnishDraw) { - this.furnishDraw = furnishDraw; - } - - public Integer getFurnishVir() { - return furnishVir; - } - - public void setFurnishVir(Integer furnishVir) { - this.furnishVir = furnishVir; - } - - public Integer getDisableDistribute() { - return disableDistribute; - } - - public void setDisableDistribute(Integer disableDistribute) { - this.disableDistribute = disableDistribute; - } - - public String getMerchantId() { - return merchantId; - } - - public void setMerchantId(String merchantId) { - this.merchantId = merchantId; - } - - public String getCategoryId() { - return categoryId; - } - - public void setCategoryId(String categoryId) { - this.categoryId = categoryId; - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbReceiptSales.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbReceiptSales.java deleted file mode 100644 index 9469bda7..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbReceiptSales.java +++ /dev/null @@ -1,120 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.pojo.shop; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -import java.io.Serializable; - -/** -* @website https://eladmin.vip -* @description / -* @author lyf -* @date 2024-01-08 -**/ -@Entity -@Data -@Table(name="tb_receipt_sales") -public class TbReceiptSales implements Serializable { - - @Id - @Column(name = "`id`") - @ApiModelProperty(value = "shopId") - private Integer id; - - @Column(name = "`title`") - @ApiModelProperty(value = "标题") - private String title=""; - - @Column(name = "`logo`") - @ApiModelProperty(value = "是否显示公司Logo") - private String logo=""; - - @Column(name = "`show_contact_info`") - @ApiModelProperty(value = "打印联系电话等信息") - private Integer showContactInfo=0; - - @Column(name = "`show_member`") - @ApiModelProperty(value = "打印会员开关 0?1") - private Integer showMember=0; - - @Column(name = "`show_member_code`") - @ApiModelProperty(value = "打印会员编号开关") - private Integer showMemberCode=0; - - @Column(name = "`show_member_score`") - @ApiModelProperty(value = "打印会员积分") - private Integer showMemberScore=0; - - @Column(name = "`show_member_wallet`") - @ApiModelProperty(value = "打印会员余额开关 0?1") - private Integer showMemberWallet=0; - - @Column(name = "`footer_remark`") - @ApiModelProperty(value = "店铺Id") - private String footerRemark=""; - - @Column(name = "`show_cash_charge`") - @ApiModelProperty(value = "打印找零") - private Integer showCashCharge=0; - - @Column(name = "`show_serial_no`") - @ApiModelProperty(value = "流水号") - private Integer showSerialNo=0; - - @Column(name = "`big_serial_no`") - @ApiModelProperty(value = "用大号字打印流水号 在showSerialNo可用前提下") - private Integer bigSerialNo; - - @Column(name = "`header_text`") - @ApiModelProperty(value = "头部文字") - private String headerText; - - @Column(name = "`header_text_align`") - @ApiModelProperty(value = "文字 对齐方式") - private String headerTextAlign; - - @Column(name = "`footer_text`") - @ApiModelProperty(value = "尾部文字") - private String footerText=""; - - @Column(name = "`footer_text_align`") - @ApiModelProperty(value = "文字 对齐方式") - private String footerTextAlign; - - @Column(name = "`footer_image`") - @ApiModelProperty(value = "尾部图像") - private String footerImage=""; - - @Column(name = "`pre_print`") - @ApiModelProperty(value = "预打印,YES开启 NO不开启") - private String prePrint; - - @Column(name = "`created_at`") - @ApiModelProperty(value = "createdAt") - private Long createdAt; - - @Column(name = "`updated_at`") - @ApiModelProperty(value = "updatedAt") - private Long updatedAt; - - public void copy(TbReceiptSales source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopCashSpread.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopCashSpread.java deleted file mode 100644 index 0dac0c58..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopCashSpread.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.pojo.shop; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -import java.io.Serializable; - -/** -* @website https://eladmin.vip -* @description / -* @author lyf -* @date 2024-01-05 -**/ -@Entity -@Data -@Table(name="tb_shop_cash_spread") -public class TbShopCashSpread implements Serializable { - - @Id - @Column(name = "`id`") - @ApiModelProperty(value = "shopId") - private Integer id; - - @Column(name = "`sale_receipt`") - @ApiModelProperty(value = "登陆密码") - private String saleReceipt; - - @Column(name = "`triplicate_receipt`") - @ApiModelProperty(value = "状态") - private String triplicateReceipt; - - @Column(name = "`screen_config`") - @ApiModelProperty(value = "到期提醒时间") - private String screenConfig; - - @Column(name = "`tag_config`") - @ApiModelProperty(value = "tagConfig") - private String tagConfig; - - @Column(name = "`scale_config`") - @ApiModelProperty(value = "scaleConfig") - private String scaleConfig; - - @Column(name = "`created_at`") - @ApiModelProperty(value = "createdAt") - private Long createdAt; - - @Column(name = "`updated_at`") - @ApiModelProperty(value = "updatedAt") - private Long updatedAt; - - public void copy(TbShopCashSpread source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopCurrency.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopCurrency.java deleted file mode 100644 index 35e9a5a1..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopCurrency.java +++ /dev/null @@ -1,130 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.pojo.shop; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @website https://eladmin.vip -* @description / -* @author lyf -* @date 2024-01-05 -**/ -@Entity -@Data -@Table(name="tb_shop_currency") -public class TbShopCurrency implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "`id`") - @ApiModelProperty(value = "自增id") - private Integer id; - - @Column(name = "`shop_id`") - @ApiModelProperty(value = "店铺Id") - private String shopId; - - @Column(name = "`prepare_amount`") - @ApiModelProperty(value = "备用金") - private BigDecimal prepareAmount; - - @Column(name = "`currency`") - @ApiModelProperty(value = "货币单位 ¥,$") - private String currency; - - @Column(name = "`decimals_digits`") - @ApiModelProperty(value = "小数位,0,1,2,无,元,角,分") - private Integer decimalsDigits; - - @Column(name = "`discount_round`") - @ApiModelProperty(value = "无,四舍五入,五舍六入none,round4up5,round5up6,round12up34") - private String discountRound; - - @Column(name = "`merchant_id`") - @ApiModelProperty(value = "商户Id") - private String merchantId; - - @Column(name = "`small_change`") - @ApiModelProperty(value = "订单抹零 -1无,0元 1角2分 0.5=0.5元") - private Integer smallChange; - - @Column(name = "`enable_custom_discount`") - @ApiModelProperty(value = "使折扣生效") - private Integer enableCustomDiscount; - - @Column(name = "`max_discount`") - @ApiModelProperty(value = "最大抹零金额(100)") - private BigDecimal maxDiscount; - - @Column(name = "`max_percent`") - @ApiModelProperty(value = "最大折扣百分比,,优先级高于max_discount") - private Double maxPercent; - - @Column(name = "`discount_configs`") - @ApiModelProperty(value = "折扣显示详情") - private String discountConfigs; - - @Column(name = "`biz_duration`") - @ApiModelProperty(value = "营业时间(弃用)") - private String bizDuration; - - @Column(name = "`allow_web_pay`") - @ApiModelProperty(value = "允许网络支付") - private Integer allowWebPay; - - @Column(name = "`is_auto_to_zero`") - @ApiModelProperty(value = "自动抹零,开启时,系统自动抹零") - private Integer isAutoToZero; - - @Column(name = "`is_include_tax_price`") - @ApiModelProperty(value = "商品含税") - private Integer isIncludeTaxPrice; - - @Column(name = "`service_charge`") - @ApiModelProperty(value = "服务费配置(小费)") - private String serviceCharge; - - @Column(name = "`tax_number`") - @ApiModelProperty(value = "税号") - private String taxNumber; - - @Column(name = "`created_at`") - @ApiModelProperty(value = "createdAt") - private Long createdAt; - - @Column(name = "`updated_at`") - @ApiModelProperty(value = "updatedAt") - private Long updatedAt; - - @Column(name = "`auto_lock_screen`") - @ApiModelProperty(value = "自动锁屏") - private Integer autoLockScreen; - - @Column(name = "`voice_notification`") - @ApiModelProperty(value = "语音通知") - private Integer voiceNotification; - - public void copy(TbShopCurrency source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotButtonConfigRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotButtonConfigRepository.java deleted file mode 100644 index 6f95aff4..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotButtonConfigRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository; - -import cn.ysk.cashier.pojo.BotButtonConfig; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-31 -**/ -public interface BotButtonConfigRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotConfigRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotConfigRepository.java deleted file mode 100644 index ec9eb050..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotConfigRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository; - -import cn.ysk.cashier.pojo.BotConfig; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-31 -**/ -public interface BotConfigRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotUserFlowRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotUserFlowRepository.java deleted file mode 100644 index 5e156606..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotUserFlowRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository; - -import cn.ysk.cashier.pojo.BotUserFlow; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-30 -**/ -public interface BotUserFlowRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotUserRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotUserRepository.java deleted file mode 100644 index 170dad0f..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/BotUserRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository; - -import cn.ysk.cashier.pojo.BotUser; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2023-10-30 -**/ -public interface BotUserRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/TbRenewalsPayLogRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/TbRenewalsPayLogRepository.java deleted file mode 100644 index 7f85f4da..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/TbRenewalsPayLogRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository; - -import cn.ysk.cashier.pojo.TbRenewalsPayLog; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2023-11-07 -**/ -public interface TbRenewalsPayLogRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbMerchantCouponRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbMerchantCouponRepository.java deleted file mode 100644 index 5afb22c3..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbMerchantCouponRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository.shop; - -import cn.ysk.cashier.pojo.shop.TbMerchantCoupon; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-03-20 -**/ -public interface TbMerchantCouponRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbReceiptSalesRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbReceiptSalesRepository.java deleted file mode 100644 index 492f7815..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbReceiptSalesRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository.shop; - -import cn.ysk.cashier.pojo.shop.TbReceiptSales; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-08 -**/ -public interface TbReceiptSalesRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopCashSpreadRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopCashSpreadRepository.java deleted file mode 100644 index e65fccdb..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopCashSpreadRepository.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository.shop; - -import cn.ysk.cashier.pojo.shop.TbShopCashSpread; -import org.apache.ibatis.annotations.Param; -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 javax.transaction.Transactional; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-05 -**/ -public interface TbShopCashSpreadRepository extends JpaRepository, JpaSpecificationExecutor { - @Query("select spread from TbShopCashSpread spread where spread.id = :shopId") - TbShopCashSpread findByShopId(@Param("shopId")Integer shopId); - - @Modifying - @Transactional - @Query("update TbShopCashSpread spread set spread.screenConfig = :screenConfig, spread.updatedAt = :updatedTime where spread.id = :shopId") - Integer updateConfig(@Param("shopId")Integer shopId, @Param("screenConfig")String screenConfig, - @Param("updatedTime")Long updatedTime); - - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopCurrencyRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopCurrencyRepository.java deleted file mode 100644 index 8da567d0..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopCurrencyRepository.java +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.repository.shop; - -import cn.ysk.cashier.pojo.shop.TbShopCurrency; -import org.apache.ibatis.annotations.Param; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Query; - -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-01-05 -**/ -public interface TbShopCurrencyRepository extends JpaRepository, JpaSpecificationExecutor { - - @Query("SELECT currency from TbShopCurrency currency where currency.shopId = :shopId") - TbShopCurrency findByShopId(@Param("shopId")String shopId); -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/BotButtonConfigService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/BotButtonConfigService.java deleted file mode 100644 index 991da2b8..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/BotButtonConfigService.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service; - -import cn.ysk.cashier.pojo.BotButtonConfig; -import cn.ysk.cashier.dto.BotButtonConfigDto; -import cn.ysk.cashier.dto.BotButtonConfigQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author admin -* @date 2023-10-31 -**/ -public interface BotButtonConfigService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(BotButtonConfigQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(BotButtonConfigQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return BotButtonConfigDto - */ - BotButtonConfigDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return BotButtonConfigDto - */ - BotButtonConfigDto create(BotButtonConfig resources); - - /** - * 编辑 - * @param resources / - */ - void update(BotButtonConfig resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/BotConfigService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/BotConfigService.java deleted file mode 100644 index 02c20cf6..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/BotConfigService.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.ysk.cashier.service; - -import cn.ysk.cashier.pojo.BotConfig; -import cn.ysk.cashier.dto.BotConfigDto; -import cn.ysk.cashier.dto.BotConfigQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author admin -* @date 2023-10-31 -**/ -public interface BotConfigService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(BotConfigQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(BotConfigQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return BotConfigDto - */ - BotConfigDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return BotConfigDto - */ - BotConfigDto create(BotConfig resources); - - /** - * 编辑 - * @param resources / - */ - void update(BotConfig resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/BotUserFlowService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/BotUserFlowService.java deleted file mode 100644 index 9d5c70d5..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/BotUserFlowService.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service; - -import cn.ysk.cashier.pojo.BotUserFlow; -import cn.ysk.cashier.dto.BotUserFlowDto; -import cn.ysk.cashier.dto.BotUserFlowQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author admin -* @date 2023-10-30 -**/ -public interface BotUserFlowService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(BotUserFlowQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(BotUserFlowQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return BotUserFlowDto - */ - BotUserFlowDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return BotUserFlowDto - */ - BotUserFlowDto create(BotUserFlow resources); - - /** - * 编辑 - * @param resources / - */ - void update(BotUserFlow resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/BotUserService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/BotUserService.java deleted file mode 100644 index af565bad..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/BotUserService.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service; - -import cn.ysk.cashier.pojo.BotUser; -import cn.ysk.cashier.dto.BotUserDto; -import cn.ysk.cashier.dto.BotUserQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author admin -* @date 2023-10-30 -**/ -public interface BotUserService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(BotUserQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(BotUserQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return BotUserDto - */ - BotUserDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return BotUserDto - */ - BotUserDto create(BotUser resources); - - /** - * 编辑 - * @param resources / - */ - void update(BotUser resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/TbRenewalsPayLogService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/TbRenewalsPayLogService.java deleted file mode 100644 index 68ed47f6..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/TbRenewalsPayLogService.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service; - -import cn.ysk.cashier.pojo.TbRenewalsPayLog; -import cn.ysk.cashier.dto.TbRenewalsPayLogDto; -import cn.ysk.cashier.dto.TbRenewalsPayLogQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author lyf -* @date 2023-11-07 -**/ -public interface TbRenewalsPayLogService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(TbRenewalsPayLogQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(TbRenewalsPayLogQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return TbRenewalsPayLogDto - */ - TbRenewalsPayLogDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return TbRenewalsPayLogDto - */ - TbRenewalsPayLogDto create(TbRenewalsPayLog resources); - - /** - * 编辑 - * @param resources / - */ - void update(TbRenewalsPayLog resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotButtonConfigServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotButtonConfigServiceImpl.java deleted file mode 100644 index 26fbb9ed..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotButtonConfigServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl; - -import cn.ysk.cashier.pojo.BotButtonConfig; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.repository.BotButtonConfigRepository; -import cn.ysk.cashier.service.BotButtonConfigService; -import cn.ysk.cashier.dto.BotButtonConfigDto; -import cn.ysk.cashier.dto.BotButtonConfigQueryCriteria; -import cn.ysk.cashier.mapper.BotButtonConfigMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.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; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author admin -* @date 2023-10-31 -**/ -@Service -@RequiredArgsConstructor -public class BotButtonConfigServiceImpl implements BotButtonConfigService { - - private final BotButtonConfigRepository botButtonConfigRepository; - private final BotButtonConfigMapper botButtonConfigMapper; - - @Override - public Map queryAll(BotButtonConfigQueryCriteria criteria, Pageable pageable){ - Page page = botButtonConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(botButtonConfigMapper::toDto)); - } - - @Override - public List queryAll(BotButtonConfigQueryCriteria criteria){ - return botButtonConfigMapper.toDto(botButtonConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public BotButtonConfigDto findById(Integer id) { - BotButtonConfig botButtonConfig = botButtonConfigRepository.findById(id).orElseGet(BotButtonConfig::new); - ValidationUtil.isNull(botButtonConfig.getId(),"BotButtonConfig","id",id); - return botButtonConfigMapper.toDto(botButtonConfig); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public BotButtonConfigDto create(BotButtonConfig resources) { - return botButtonConfigMapper.toDto(botButtonConfigRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(BotButtonConfig resources) { - BotButtonConfig botButtonConfig = botButtonConfigRepository.findById(resources.getId()).orElseGet(BotButtonConfig::new); - ValidationUtil.isNull( botButtonConfig.getId(),"BotButtonConfig","id",resources.getId()); - botButtonConfig.copy(resources); - botButtonConfigRepository.save(botButtonConfig); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - botButtonConfigRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (BotButtonConfigDto botButtonConfig : all) { - Map map = new LinkedHashMap<>(); - map.put("按钮名称", botButtonConfig.getButtonName()); - map.put("按钮值", botButtonConfig.getButtonValue()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotConfigServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotConfigServiceImpl.java deleted file mode 100644 index cbae7949..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotConfigServiceImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl; - -import cn.ysk.cashier.pojo.BotConfig; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.repository.BotConfigRepository; -import cn.ysk.cashier.service.BotConfigService; -import cn.ysk.cashier.dto.BotConfigDto; -import cn.ysk.cashier.dto.BotConfigQueryCriteria; -import cn.ysk.cashier.mapper.BotConfigMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.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; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author admin -* @date 2023-10-31 -**/ -@Service -@RequiredArgsConstructor -public class BotConfigServiceImpl implements BotConfigService { - - private final BotConfigRepository botConfigRepository; - private final BotConfigMapper botConfigMapper; - - @Override - public Map queryAll(BotConfigQueryCriteria criteria, Pageable pageable){ - Page page = botConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(botConfigMapper::toDto)); - } - - @Override - public List queryAll(BotConfigQueryCriteria criteria){ - return botConfigMapper.toDto(botConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public BotConfigDto findById(Integer id) { - BotConfig botConfig = botConfigRepository.findById(id).orElseGet(BotConfig::new); - ValidationUtil.isNull(botConfig.getId(),"BotConfig","id",id); - return botConfigMapper.toDto(botConfig); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public BotConfigDto create(BotConfig resources) { - return botConfigMapper.toDto(botConfigRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(BotConfig resources) { - BotConfig botConfig = botConfigRepository.findById(resources.getId()).orElseGet(BotConfig::new); - ValidationUtil.isNull( botConfig.getId(),"BotConfig","id",resources.getId()); - botConfig.copy(resources); - botConfigRepository.save(botConfig); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - botConfigRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (BotConfigDto botConfig : all) { - Map map = new LinkedHashMap<>(); - map.put("元素键值", botConfig.getConfigKey()); - map.put("元素值", botConfig.getConfigValue()); - map.put("描述", botConfig.getRemark()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotUserFlowServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotUserFlowServiceImpl.java deleted file mode 100644 index e59a548d..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotUserFlowServiceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl; - -import cn.ysk.cashier.pojo.BotUserFlow; -import cn.ysk.cashier.repository.BotUserFlowRepository; -import cn.ysk.cashier.service.BotUserFlowService; -import cn.ysk.cashier.dto.BotUserFlowDto; -import cn.ysk.cashier.dto.BotUserFlowQueryCriteria; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.mapper.BotUserFlowMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.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; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author admin -* @date 2023-10-30 -**/ -@Service -@RequiredArgsConstructor -public class BotUserFlowServiceImpl implements BotUserFlowService { - - private final BotUserFlowRepository botUserFlowRepository; - private final BotUserFlowMapper botUserFlowMapper; - - @Override - public Map queryAll(BotUserFlowQueryCriteria criteria, Pageable pageable){ - Page page = botUserFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(botUserFlowMapper::toDto)); - } - - @Override - public List queryAll(BotUserFlowQueryCriteria criteria){ - return botUserFlowMapper.toDto(botUserFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public BotUserFlowDto findById(Integer id) { - BotUserFlow botUserFlow = botUserFlowRepository.findById(id).orElseGet(BotUserFlow::new); - ValidationUtil.isNull(botUserFlow.getId(),"BotUserFlow","id",id); - return botUserFlowMapper.toDto(botUserFlow); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public BotUserFlowDto create(BotUserFlow resources) { - return botUserFlowMapper.toDto(botUserFlowRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(BotUserFlow resources) { - BotUserFlow botUserFlow = botUserFlowRepository.findById(resources.getId()).orElseGet(BotUserFlow::new); - ValidationUtil.isNull( botUserFlow.getId(),"BotUserFlow","id",resources.getId()); - botUserFlow.copy(resources); - botUserFlowRepository.save(botUserFlow); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - botUserFlowRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (BotUserFlowDto botUserFlow : all) { - Map map = new LinkedHashMap<>(); - map.put("电报号", botUserFlow.getUserTelegramId()); - map.put("用户名称", botUserFlow.getUserName()); - map.put("业务代码", botUserFlow.getBizCode()); - map.put("变动金额", botUserFlow.getAmount()); - map.put("变动前金额", botUserFlow.getOldBalance()); - map.put("变动后金额", botUserFlow.getNewBalance()); - map.put("创建时间", botUserFlow.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotUserServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotUserServiceImpl.java deleted file mode 100644 index b442eb48..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/BotUserServiceImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl; - -import cn.ysk.cashier.pojo.BotUser; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.repository.BotUserRepository; -import cn.ysk.cashier.service.BotUserService; -import cn.ysk.cashier.dto.BotUserDto; -import cn.ysk.cashier.dto.BotUserQueryCriteria; -import cn.ysk.cashier.mapper.BotUserMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.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; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author admin -* @date 2023-10-30 -**/ -@Service -@RequiredArgsConstructor -public class BotUserServiceImpl implements BotUserService { - - private final BotUserRepository botUserRepository; - private final BotUserMapper botUserMapper; - - @Override - public Map queryAll(BotUserQueryCriteria criteria, Pageable pageable){ - Page page = botUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(botUserMapper::toDto)); - } - - @Override - public List queryAll(BotUserQueryCriteria criteria){ - return botUserMapper.toDto(botUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public BotUserDto findById(Integer id) { - BotUser botUser = botUserRepository.findById(id).orElseGet(BotUser::new); - ValidationUtil.isNull(botUser.getId(),"BotUser","id",id); - return botUserMapper.toDto(botUser); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public BotUserDto create(BotUser resources) { - return botUserMapper.toDto(botUserRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(BotUser resources) { - BotUser botUser = botUserRepository.findById(resources.getId()).orElseGet(BotUser::new); - ValidationUtil.isNull( botUser.getId(),"BotUser","id",resources.getId()); - botUser.copy(resources); - botUserRepository.save(botUser); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - botUserRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (BotUserDto botUser : all) { - Map map = new LinkedHashMap<>(); - map.put(" fatherId", botUser.getFatherId()); - map.put("父级电报号", botUser.getFatherTelegramId()); - map.put("电报号", botUser.getUserTelegramId()); - map.put("用户名称", botUser.getUserName()); - map.put("组电报号", botUser.getGroupTelegramId()); - map.put("用户代码", botUser.getUserCode()); - map.put(" userPayPass", botUser.getUserPayPass()); - map.put(" bombStatus", botUser.getBombStatus()); - map.put("用户状态", botUser.getBotStatus()); - map.put("总充值", botUser.getUsdtRechargeTotal()); - map.put("总提现", botUser.getUsdtWithdrawTotal()); - map.put("总资金", botUser.getBalance()); - map.put("冻结资金", botUser.getFreezeBalance()); - map.put("版本号", botUser.getVersion()); - map.put("创建时间", botUser.getCreateTime()); - map.put("更新时间", botUser.getUpdateTime()); - map.put("语言", botUser.getUserLanguage()); - map.put("质押资金", botUser.getChipBalance()); - map.put("绑定时间", botUser.getFatherBindTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbRenewalsPayLogServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbRenewalsPayLogServiceImpl.java deleted file mode 100644 index 7ecdd84f..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbRenewalsPayLogServiceImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl; - -import cn.ysk.cashier.pojo.TbRenewalsPayLog; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.repository.TbRenewalsPayLogRepository; -import cn.ysk.cashier.service.TbRenewalsPayLogService; -import cn.ysk.cashier.dto.TbRenewalsPayLogDto; -import cn.ysk.cashier.dto.TbRenewalsPayLogQueryCriteria; -import cn.ysk.cashier.mapper.TbRenewalsPayLogMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.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; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author lyf -* @date 2023-11-07 -**/ -@Service -@RequiredArgsConstructor -public class TbRenewalsPayLogServiceImpl implements TbRenewalsPayLogService { - - private final TbRenewalsPayLogRepository tbRenewalsPayLogRepository; - private final TbRenewalsPayLogMapper tbRenewalsPayLogMapper; - - @Override - public Map queryAll(TbRenewalsPayLogQueryCriteria criteria, Pageable pageable){ - Page page = tbRenewalsPayLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(tbRenewalsPayLogMapper::toDto)); - } - - @Override - public List queryAll(TbRenewalsPayLogQueryCriteria criteria){ - return tbRenewalsPayLogMapper.toDto(tbRenewalsPayLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public TbRenewalsPayLogDto findById(Integer id) { - TbRenewalsPayLog tbRenewalsPayLog = tbRenewalsPayLogRepository.findById(id).orElseGet(TbRenewalsPayLog::new); - ValidationUtil.isNull(tbRenewalsPayLog.getId(),"TbRenewalsPayLog","id",id); - return tbRenewalsPayLogMapper.toDto(tbRenewalsPayLog); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public TbRenewalsPayLogDto create(TbRenewalsPayLog resources) { - return tbRenewalsPayLogMapper.toDto(tbRenewalsPayLogRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(TbRenewalsPayLog resources) { - TbRenewalsPayLog tbRenewalsPayLog = tbRenewalsPayLogRepository.findById(resources.getId()).orElseGet(TbRenewalsPayLog::new); - ValidationUtil.isNull( tbRenewalsPayLog.getId(),"TbRenewalsPayLog","id",resources.getId()); - tbRenewalsPayLog.copy(resources); - tbRenewalsPayLogRepository.save(tbRenewalsPayLog); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - tbRenewalsPayLogRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (TbRenewalsPayLogDto tbRenewalsPayLog : all) { - Map map = new LinkedHashMap<>(); - map.put("支付方式", tbRenewalsPayLog.getPayType()); - map.put("店铺Id", tbRenewalsPayLog.getShopId()); - map.put("订单Id", tbRenewalsPayLog.getOrderId()); - map.put(" openId", tbRenewalsPayLog.getOpenId()); - map.put("用户Id", tbRenewalsPayLog.getUserId()); - map.put("交易单号(第三方交易单号)", tbRenewalsPayLog.getTransactionId()); - map.put("金额", tbRenewalsPayLog.getAmount()); - map.put("状态 ", tbRenewalsPayLog.getStatus()); - map.put("备注", tbRenewalsPayLog.getRemark()); - map.put("用户自定义参数", tbRenewalsPayLog.getAttach()); - map.put("到期时间", tbRenewalsPayLog.getExpiredAt()); - map.put("创建时间", tbRenewalsPayLog.getCreatedAt()); - map.put(" updatedAt", tbRenewalsPayLog.getUpdatedAt()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbOrderInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbOrderInfoServiceImpl.java index b116cd5b..eeae7adf 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbOrderInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbOrderInfoServiceImpl.java @@ -417,16 +417,12 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService { outRecordService.update(lambdaUpdateWrapper); List details = tbOrderDetailRepository.searchDetailByOrderId(tbOrderInfo.getId()); - Set keys = new HashSet<>(); for (TbOrderDetail detail : details) { detail.setStatus("cancelled"); // 返还库存 productService.returnStockByPro(detail.getProductId(), detail.getProductSkuId(), detail.getNum()); tbOrderDetailRepository.save(detail); - keys.add(CacheKey.PRODUCT_SKU + detail.getShopId() + ":" + detail.getId()); } - String[] keysArray = keys.toArray(new String[keys.size()]); - redisUtils.del(keysArray); } @Override diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java index 46fdf887..10bb2257 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java @@ -251,7 +251,11 @@ public class TbProductServiceImpl implements TbProductService { if ("sku".equals(product.getTypeEnum())){ if(tbProductSkus.size() > 1){ BigDecimal maxPrice = tbProductSkus.stream().map(TbProductSku::getSalePrice).max(BigDecimal::compareTo).get(); - productNewVo.setLowPrice("¥" +productNewVo.getLowPrice() + "~¥" + maxPrice); + if (maxPrice.compareTo(new BigDecimal(productNewVo.getLowPrice())) == 0) { + productNewVo.setLowPrice("¥" +productNewVo.getLowPrice()); + }else { + productNewVo.setLowPrice("¥" +productNewVo.getLowPrice() + "~¥" + maxPrice); + } }else { productNewVo.setLowPrice("¥" +productNewVo.getLowPrice()); } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbMerchantCouponServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbMerchantCouponServiceImpl.java deleted file mode 100644 index 889d8ca9..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbMerchantCouponServiceImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl.shopimpl; - -import cn.hutool.core.bean.BeanUtil; -import cn.ysk.cashier.exception.BadRequestException; -import cn.ysk.cashier.pojo.product.TbProduct; -import cn.ysk.cashier.pojo.shop.TbMerchantCoupon; -import cn.ysk.cashier.repository.product.TbProductRepository; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import cn.ysk.cashier.vo.CouponVO; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.repository.shop.TbMerchantCouponRepository; -import cn.ysk.cashier.service.shop.TbMerchantCouponService; -import cn.ysk.cashier.dto.shop.TbMerchantCouponDto; -import cn.ysk.cashier.dto.shop.TbMerchantCouponQueryCriteria; -import cn.ysk.cashier.mapper.shop.TbMerchantCouponMapper; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.utils.QueryHelp; - -import java.sql.Timestamp; -import java.time.Instant; -import java.util.*; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author lyf -* @date 2024-03-20 -**/ -@Service -@RequiredArgsConstructor -public class TbMerchantCouponServiceImpl implements TbMerchantCouponService { - - private final TbMerchantCouponRepository tbMerchantCouponRepository; - private final TbMerchantCouponMapper tbMerchantCouponMapper; - private final TbProductRepository tbProductRepository; - - @Override - public Map queryAll(TbMerchantCouponQueryCriteria criteria, Pageable pageable){ - Page page = tbMerchantCouponRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - List objects = new ArrayList<>(); - for (TbMerchantCoupon o :page.getContent()) { - CouponVO couponVO = new CouponVO(); - BeanUtils.copyProperties(o,couponVO); - if (!o.getRelationIds().isEmpty()) { - List integers = new ArrayList<>(); - integers.add(Integer.valueOf(o.getRelationIds())); - List byIds = tbProductRepository.findByIds(integers); - couponVO.setName(byIds.get(0).getName()); - couponVO.setCoverImg(byIds.get(0).getCoverImg()); - } - objects.add(couponVO); - } - HashMap couponvoMap = new HashMap<>(); - couponvoMap.put("content", objects); - couponvoMap.put("totalElements", page.getTotalElements()); - return couponvoMap; -// return PageUtil.toPage(page.map(tbMerchantCouponMapper::toDto)); - } - @Override - public List queryAll(TbMerchantCouponQueryCriteria criteria){ - return tbMerchantCouponMapper.toDto(tbMerchantCouponRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public TbMerchantCouponDto findById(Integer id) { - TbMerchantCoupon tbMerchantCoupon = tbMerchantCouponRepository.findById(id).orElseGet(TbMerchantCoupon::new); - ValidationUtil.isNull(tbMerchantCoupon.getId(),"TbMerchantCoupon","id",id); - return tbMerchantCouponMapper.toDto(tbMerchantCoupon); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public TbMerchantCoupon create(TbMerchantCoupon resources) { - resources.setCreatedAt(Instant.now().toEpochMilli()); - resources.setUpdatedAt(Instant.now().toEpochMilli()); - if (resources.getEffectType() == 1){ - if (resources.getToTime() == null && resources.getFromTime() == null){ - throw new BadRequestException("开始时间结束时间为空"); - } - }else { - resources.setToTime(null); - resources.setFromTime(null); - } - - if ("product".equals(resources.getClassType())){ - if (resources.getRelationIds() == null){ - throw new BadRequestException("商品不能为空"); - } - } - if (resources.getNumber() == 0){ - resources.setLeftNumber(0); - }else { - resources.setLeftNumber(resources.getNumber()); - } - return tbMerchantCouponRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(TbMerchantCoupon resources) { - TbMerchantCoupon tbMerchantCoupon = tbMerchantCouponRepository.findById(resources.getId()).orElseGet(TbMerchantCoupon::new); - ValidationUtil.isNull( tbMerchantCoupon.getId(),"TbMerchantCoupon","id",resources.getId()); - tbMerchantCoupon.copy(resources); - tbMerchantCouponRepository.save(tbMerchantCoupon); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - tbMerchantCouponRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (TbMerchantCouponDto tbMerchantCoupon : all) { - Map map = new LinkedHashMap<>(); - map.put("状态0-关闭 1 正常", tbMerchantCoupon.getStatus()); - map.put(" 优惠券名称", tbMerchantCoupon.getTitle()); - map.put(" templateId", tbMerchantCoupon.getTemplateId()); - map.put(" shopId", tbMerchantCoupon.getShopId()); - map.put(" shopSnap", tbMerchantCoupon.getShopSnap()); - map.put("开始时间", tbMerchantCoupon.getFromTime()); - map.put("到期时间", tbMerchantCoupon.getToTime()); - map.put("限领数量", tbMerchantCoupon.getLimitNumber()); - map.put("发放数量", tbMerchantCoupon.getNumber()); - map.put("剩余数量", tbMerchantCoupon.getLeftNumber()); - map.put("优惠金额", tbMerchantCoupon.getAmount()); - map.put("订单满赠金额", tbMerchantCoupon.getLimitAmount()); - map.put("是否显示0-不显示 1显示", tbMerchantCoupon.getIsShow()); - map.put("图标", tbMerchantCoupon.getPic()); - map.put("0-满减 1-折扣", tbMerchantCoupon.getType()); - map.put("折扣 ,一位小数", tbMerchantCoupon.getRatio()); - map.put("最大折扣金额", tbMerchantCoupon.getMaxRatioAmount()); - map.put("优惠券途径,首充|分销", tbMerchantCoupon.getTrack()); - map.put("品类product 商品券 ---cateogry 品类券common -通 用券", tbMerchantCoupon.getClassType()); - map.put("有效期类型:0-toTime有效 1-effectDays有效", tbMerchantCoupon.getEffectType()); - map.put("领取之日有效天数", tbMerchantCoupon.getEffectDays()); - map.put("关联商品Id", tbMerchantCoupon.getRelationIds()); - map.put(" relationList", tbMerchantCoupon.getRelationList()); - map.put("发放人", tbMerchantCoupon.getEditor()); - map.put("说明", tbMerchantCoupon.getNote()); - map.put(" createdAt", tbMerchantCoupon.getCreatedAt()); - map.put(" updatedAt", tbMerchantCoupon.getUpdatedAt()); - map.put("支持堂食", tbMerchantCoupon.getFurnishMeal()); - map.put("支持配送", tbMerchantCoupon.getFurnishExpress()); - map.put("支持自提", tbMerchantCoupon.getFurnishDraw()); - map.put("支持虚拟", tbMerchantCoupon.getFurnishVir()); - map.put(" disableDistribute", tbMerchantCoupon.getDisableDistribute()); - map.put("商户Id", tbMerchantCoupon.getMerchantId()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbReceiptSalesServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbReceiptSalesServiceImpl.java deleted file mode 100644 index a6b3889c..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbReceiptSalesServiceImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl.shopimpl; - -import cn.ysk.cashier.pojo.shop.TbReceiptSales; -import cn.ysk.cashier.mapper.shop.TbReceiptSalesMapper; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.repository.shop.TbReceiptSalesRepository; -import cn.ysk.cashier.service.shop.TbReceiptSalesService; -import cn.ysk.cashier.dto.shop.TbReceiptSalesDto; -import cn.ysk.cashier.dto.shop.TbReceiptSalesQueryCriteria; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.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; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author lyf -* @date 2024-01-08 -**/ -@Service -@RequiredArgsConstructor -public class TbReceiptSalesServiceImpl implements TbReceiptSalesService { - - private final TbReceiptSalesRepository tbReceiptSalesRepository; - private final TbReceiptSalesMapper tbReceiptSalesMapper; - - @Override - public Map queryAll(TbReceiptSalesQueryCriteria criteria, Pageable pageable){ - Page page = tbReceiptSalesRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(tbReceiptSalesMapper::toDto)); - } - - @Override - public List queryAll(TbReceiptSalesQueryCriteria criteria){ - return tbReceiptSalesMapper.toDto(tbReceiptSalesRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public TbReceiptSalesDto findById(Integer id) { - TbReceiptSales tbReceiptSales = tbReceiptSalesRepository.findById(id).orElseGet(TbReceiptSales::new); - - return tbReceiptSalesMapper.toDto(tbReceiptSales); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public TbReceiptSalesDto create(TbReceiptSales resources) { - return tbReceiptSalesMapper.toDto(tbReceiptSalesRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(TbReceiptSales resources) { - TbReceiptSales tbReceiptSales = tbReceiptSalesRepository.findById(resources.getId()).orElseGet(TbReceiptSales::new); - ValidationUtil.isNull( tbReceiptSales.getId(),"TbReceiptSales","id",resources.getId()); - tbReceiptSales.copy(resources); - tbReceiptSalesRepository.save(tbReceiptSales); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - tbReceiptSalesRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (TbReceiptSalesDto tbReceiptSales : all) { - Map map = new LinkedHashMap<>(); - map.put("标题", tbReceiptSales.getTitle()); - map.put("是否显示公司Logo", tbReceiptSales.getLogo()); - map.put("打印联系电话等信息", tbReceiptSales.getShowContactInfo()); - map.put("打印会员开关 0?1", tbReceiptSales.getShowMember()); - map.put("打印会员编号开关", tbReceiptSales.getShowMemberCode()); - map.put("打印会员积分", tbReceiptSales.getShowMemberScore()); - map.put("打印会员余额开关 0?1", tbReceiptSales.getShowMemberWallet()); - map.put("店铺Id", tbReceiptSales.getFooterRemark()); - map.put("打印找零", tbReceiptSales.getShowCashCharge()); - map.put("流水号", tbReceiptSales.getShowSerialNo()); - map.put("用大号字打印流水号 在showSerialNo可用前提下", tbReceiptSales.getBigSerialNo()); - map.put("头部文字", tbReceiptSales.getHeaderText()); - map.put("文字 对齐方式", tbReceiptSales.getHeaderTextAlign()); - map.put("尾部文字", tbReceiptSales.getFooterText()); - map.put("文字 对齐方式", tbReceiptSales.getFooterTextAlign()); - map.put("尾部图像", tbReceiptSales.getFooterImage()); - map.put("预打印,YES开启 NO不开启", tbReceiptSales.getPrePrint()); - map.put(" createdAt", tbReceiptSales.getCreatedAt()); - map.put(" updatedAt", tbReceiptSales.getUpdatedAt()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopCashSpreadServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopCashSpreadServiceImpl.java deleted file mode 100644 index ed790ae3..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopCashSpreadServiceImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl.shopimpl; - -import cn.ysk.cashier.pojo.shop.TbShopCashSpread; -import cn.ysk.cashier.service.shop.TbShopCashSpreadService; -import cn.ysk.cashier.dto.shop.TbShopCashSpreadDto; -import cn.ysk.cashier.mapper.shop.TbShopCashSpreadMapper; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.repository.shop.TbShopCashSpreadRepository; -import cn.ysk.cashier.dto.shop.TbShopCashSpreadQueryCriteria; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.utils.QueryHelp; - -import java.time.Instant; -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; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author lyf -* @date 2024-01-05 -**/ -@Service -@RequiredArgsConstructor -public class TbShopCashSpreadServiceImpl implements TbShopCashSpreadService { - - private final TbShopCashSpreadRepository tbShopCashSpreadRepository; - private final TbShopCashSpreadMapper tbShopCashSpreadMapper; - - @Override - public Map queryAll(TbShopCashSpreadQueryCriteria criteria, Pageable pageable){ - Page page = tbShopCashSpreadRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(tbShopCashSpreadMapper::toDto)); - } - - @Override - public List queryAll(TbShopCashSpreadQueryCriteria criteria){ - return tbShopCashSpreadMapper.toDto(tbShopCashSpreadRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public TbShopCashSpreadDto findById(String id) { - TbShopCashSpread tbShopCashSpread = tbShopCashSpreadRepository.findById(id).orElseGet(TbShopCashSpread::new); - ValidationUtil.isNull(tbShopCashSpread.getId(),"TbShopCashSpread","id",id); - return tbShopCashSpreadMapper.toDto(tbShopCashSpread); - } - - @Override - public TbShopCashSpread findByShopId(Integer id) { - TbShopCashSpread byShopId = tbShopCashSpreadRepository.findByShopId(id); - return byShopId; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public TbShopCashSpreadDto create(TbShopCashSpread resources) { - return tbShopCashSpreadMapper.toDto(tbShopCashSpreadRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Integer update(TbShopCashSpread resources) { - return tbShopCashSpreadRepository.updateConfig(resources.getId(), resources.getScreenConfig().trim(), Instant.now().toEpochMilli()); - } - - @Override - public void deleteAll(String[] ids) { - for (String id : ids) { - tbShopCashSpreadRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (TbShopCashSpreadDto tbShopCashSpread : all) { - Map map = new LinkedHashMap<>(); - map.put("登陆密码", tbShopCashSpread.getSaleReceipt()); - map.put("状态", tbShopCashSpread.getTriplicateReceipt()); - map.put("到期提醒时间", tbShopCashSpread.getScreenConfig()); - map.put(" tagConfig", tbShopCashSpread.getTagConfig()); - map.put(" scaleConfig", tbShopCashSpread.getScaleConfig()); - map.put(" createdAt", tbShopCashSpread.getCreatedAt()); - map.put(" updatedAt", tbShopCashSpread.getUpdatedAt()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopCurrencyServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopCurrencyServiceImpl.java deleted file mode 100644 index 936412ee..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopCurrencyServiceImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.impl.shopimpl; - -import cn.ysk.cashier.pojo.shop.TbShopCurrency; -import cn.ysk.cashier.utils.ValidationUtil; -import cn.ysk.cashier.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import cn.ysk.cashier.repository.shop.TbShopCurrencyRepository; -import cn.ysk.cashier.service.shop.TbShopCurrencyService; -import cn.ysk.cashier.dto.shop.TbShopCurrencyDto; -import cn.ysk.cashier.dto.shop.TbShopCurrencyQueryCriteria; -import cn.ysk.cashier.mapper.shop.TbShopCurrencyMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import cn.ysk.cashier.utils.PageUtil; -import cn.ysk.cashier.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; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author lyf -* @date 2024-01-05 -**/ -@Service -@RequiredArgsConstructor -public class TbShopCurrencyServiceImpl implements TbShopCurrencyService { - - private final TbShopCurrencyRepository tbShopCurrencyRepository; - private final TbShopCurrencyMapper tbShopCurrencyMapper; - - @Override - public Map queryAll(TbShopCurrencyQueryCriteria criteria, Pageable pageable){ - Page page = tbShopCurrencyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(tbShopCurrencyMapper::toDto)); - } - - @Override - public List queryAll(TbShopCurrencyQueryCriteria criteria){ - return tbShopCurrencyMapper.toDto(tbShopCurrencyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public TbShopCurrencyDto findById(Integer id) { - TbShopCurrency tbShopCurrency = tbShopCurrencyRepository.findById(id).orElseGet(TbShopCurrency::new); - ValidationUtil.isNull(tbShopCurrency.getId(),"TbShopCurrency","id",id); - return tbShopCurrencyMapper.toDto(tbShopCurrency); - } - - @Override - public TbShopCurrency findByShopId(String id) { - TbShopCurrency byShopId = tbShopCurrencyRepository.findByShopId(id); - return byShopId; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public TbShopCurrencyDto create(TbShopCurrency resources) { - return tbShopCurrencyMapper.toDto(tbShopCurrencyRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(TbShopCurrency resources) { - TbShopCurrency tbShopCurrency = tbShopCurrencyRepository.findById(resources.getId()).orElseGet(TbShopCurrency::new); - ValidationUtil.isNull( tbShopCurrency.getId(),"TbShopCurrency","id",resources.getId()); - tbShopCurrency.copy(resources); - tbShopCurrencyRepository.save(tbShopCurrency); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - tbShopCurrencyRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (TbShopCurrencyDto tbShopCurrency : all) { - Map map = new LinkedHashMap<>(); - map.put("店铺Id", tbShopCurrency.getShopId()); - map.put("备用金", tbShopCurrency.getPrepareAmount()); - map.put("货币单位 ¥,$", tbShopCurrency.getCurrency()); - map.put("小数位,0,1,2,无,元,角,分", tbShopCurrency.getDecimalsDigits()); - map.put("无,四舍五入,五舍六入none,round4up5,round5up6,round12up34", tbShopCurrency.getDiscountRound()); - map.put("商户Id", tbShopCurrency.getMerchantId()); - map.put("订单抹零 -1无,0元 1角2分 0.5=0.5元", tbShopCurrency.getSmallChange()); - map.put("使折扣生效", tbShopCurrency.getEnableCustomDiscount()); - map.put("最大抹零金额(100)", tbShopCurrency.getMaxDiscount()); - map.put("最大折扣百分比,,优先级高于max_discount", tbShopCurrency.getMaxPercent()); - map.put("折扣显示详情", tbShopCurrency.getDiscountConfigs()); - map.put("营业时间(弃用)", tbShopCurrency.getBizDuration()); - map.put("允许网络支付", tbShopCurrency.getAllowWebPay()); - map.put("自动抹零,开启时,系统自动抹零", tbShopCurrency.getIsAutoToZero()); - map.put("商品含税", tbShopCurrency.getIsIncludeTaxPrice()); - map.put("服务费配置(小费)", tbShopCurrency.getServiceCharge()); - map.put("税号", tbShopCurrency.getTaxNumber()); - map.put(" createdAt", tbShopCurrency.getCreatedAt()); - map.put(" updatedAt", tbShopCurrency.getUpdatedAt()); - map.put("自动锁屏", tbShopCurrency.getAutoLockScreen()); - map.put("语音通知", tbShopCurrency.getVoiceNotification()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbMerchantCouponService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbMerchantCouponService.java deleted file mode 100644 index 8450783d..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbMerchantCouponService.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.shop; - -import cn.ysk.cashier.pojo.shop.TbMerchantCoupon; -import cn.ysk.cashier.dto.shop.TbMerchantCouponDto; -import cn.ysk.cashier.dto.shop.TbMerchantCouponQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author lyf -* @date 2024-03-20 -**/ -public interface TbMerchantCouponService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(TbMerchantCouponQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(TbMerchantCouponQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return TbMerchantCouponDto - */ - TbMerchantCouponDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return TbMerchantCouponDto - */ - TbMerchantCoupon create(TbMerchantCoupon resources); - - /** - * 编辑 - * @param resources / - */ - void update(TbMerchantCoupon resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbReceiptSalesService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbReceiptSalesService.java deleted file mode 100644 index 304e84b3..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbReceiptSalesService.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.shop; - -import cn.ysk.cashier.pojo.shop.TbReceiptSales; -import cn.ysk.cashier.dto.shop.TbReceiptSalesDto; -import cn.ysk.cashier.dto.shop.TbReceiptSalesQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author lyf -* @date 2024-01-08 -**/ -public interface TbReceiptSalesService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(TbReceiptSalesQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(TbReceiptSalesQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return TbReceiptSalesDto - */ - TbReceiptSalesDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return TbReceiptSalesDto - */ - TbReceiptSalesDto create(TbReceiptSales resources); - - /** - * 编辑 - * @param resources / - */ - void update(TbReceiptSales resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopCashSpreadService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopCashSpreadService.java deleted file mode 100644 index 97dfc581..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopCashSpreadService.java +++ /dev/null @@ -1,84 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.shop; - -import cn.ysk.cashier.pojo.shop.TbShopCashSpread; -import cn.ysk.cashier.dto.shop.TbShopCashSpreadDto; -import cn.ysk.cashier.dto.shop.TbShopCashSpreadQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author lyf -* @date 2024-01-05 -**/ -public interface TbShopCashSpreadService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(TbShopCashSpreadQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(TbShopCashSpreadQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return TbShopCashSpreadDto - */ - TbShopCashSpreadDto findById(String id); - TbShopCashSpread findByShopId(Integer id); - - /** - * 创建 - * @param resources / - * @return TbShopCashSpreadDto - */ - TbShopCashSpreadDto create(TbShopCashSpread resources); - - /** - * 编辑 - * @param resources / - */ - Integer update(TbShopCashSpread resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(String[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopCurrencyService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopCurrencyService.java deleted file mode 100644 index 3ffad699..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopCurrencyService.java +++ /dev/null @@ -1,90 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 cn.ysk.cashier.service.shop; - -import cn.ysk.cashier.pojo.shop.TbShopCurrency; -import cn.ysk.cashier.dto.shop.TbShopCurrencyDto; -import cn.ysk.cashier.dto.shop.TbShopCurrencyQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务接口 -* @author lyf -* @date 2024-01-05 -**/ -public interface TbShopCurrencyService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(TbShopCurrencyQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(TbShopCurrencyQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return TbShopCurrencyDto - */ - TbShopCurrencyDto findById(Integer id); - - /** - * 根据ID查询 - * @param id ID - * @return TbShopCurrencyDto - */ - TbShopCurrency findByShopId(String id); - - /** - * 创建 - * @param resources / - * @return TbShopCurrencyDto - */ - TbShopCurrencyDto create(TbShopCurrency resources); - - /** - * 编辑 - * @param resources / - */ - void update(TbShopCurrency resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/system/rest/ParamsController.java b/eladmin-system/src/main/java/cn/ysk/cashier/system/rest/ParamsController.java index 19eeadee..420c0a7f 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/system/rest/ParamsController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/system/rest/ParamsController.java @@ -36,11 +36,6 @@ public class ParamsController { @GetMapping("page") @ApiOperation("分页") - @ApiImplicitParams({ - @ApiImplicitParam(name = "page", value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , - @ApiImplicitParam(name = "size", value = "每页显示记录数", paramType = "query",required = true, dataType="int") , - @ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String") - }) public ResponseEntity page(@ApiIgnore @RequestParam Map params){ Map page = paramsService.page(params); return ResponseEntity.ok().body(page); diff --git a/eladmin-system/src/main/resources/mapper/TbActivateMapper.xml b/eladmin-system/src/main/resources/mapper/TbActivateMapper.xml deleted file mode 100644 index 77ad900a..00000000 --- a/eladmin-system/src/main/resources/mapper/TbActivateMapper.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - id,shop_id,min_num, - max_num,handsel_num,handsel_type, - is_del,is_user - -