Merge branch 'test' into dev
This commit is contained in:
commit
68cb508b4e
191
LICENSE
191
LICENSE
|
|
@ -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.
|
||||
36
README.en.md
36
README.en.md
|
|
@ -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/)
|
||||
|
|
@ -88,6 +88,18 @@ public class JSONUtil {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static <T> List<T> parseJSONStrTList(String jsonStr, Class<T> clazz) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
// 将JSON字符串转换为List<T>
|
||||
return objectMapper.readValue(jsonStr, objectMapper.getTypeFactory().constructCollectionType(List.class, clazz));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list 某集合
|
||||
* @param clazz 要转成的实体
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>eladmin</artifactId>
|
||||
<groupId>cn.ysk.cashier</groupId>
|
||||
<version>2.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>eladmin-generator</artifactId>
|
||||
<name>代码生成模块</name>
|
||||
|
||||
<properties>
|
||||
<configuration.version>1.10</configuration.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.ysk.cashier</groupId>
|
||||
<artifactId>eladmin-common</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
|
||||
<!--模板引擎-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-configuration/commons-configuration -->
|
||||
<dependency>
|
||||
<groupId>commons-configuration</groupId>
|
||||
<artifactId>commons-configuration</artifactId>
|
||||
<version>${configuration.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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<ColumnInfo,Long> {
|
||||
|
||||
/**
|
||||
* 查询表信息
|
||||
* @param tableName 表格名
|
||||
* @return 表信息
|
||||
*/
|
||||
List<ColumnInfo> findByTableNameOrderByIdAsc(String tableName);
|
||||
}
|
||||
|
|
@ -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<GenConfig,Long> {
|
||||
|
||||
/**
|
||||
* 查询表配置
|
||||
* @param tableName 表名
|
||||
* @return /
|
||||
*/
|
||||
GenConfig findByTableName(String tableName);
|
||||
}
|
||||
|
|
@ -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<Object> queryGenConfig(@PathVariable String tableName){
|
||||
return new ResponseEntity<>(genConfigService.find(tableName), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
public ResponseEntity<Object> updateGenConfig(@Validated @RequestBody GenConfig genConfig){
|
||||
return new ResponseEntity<>(genConfigService.update(genConfig.getTableName(), genConfig),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object> queryAllTables(){
|
||||
return new ResponseEntity<>(generatorService.getTables(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("查询数据库数据")
|
||||
@GetMapping(value = "/tables")
|
||||
public ResponseEntity<Object> 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<Object> queryColumns(@RequestParam String tableName){
|
||||
List<ColumnInfo> columnInfos = generatorService.getColumns(tableName);
|
||||
return new ResponseEntity<>(PageUtil.toPage(columnInfos,columnInfos.size()), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("保存字段数据")
|
||||
@PutMapping
|
||||
public ResponseEntity<HttpStatus> saveColumn(@RequestBody List<ColumnInfo> columnInfos){
|
||||
generatorService.save(columnInfos);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("同步字段数据")
|
||||
@PostMapping(value = "sync")
|
||||
public ResponseEntity<HttpStatus> syncColumn(@RequestBody List<String> 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<Object> 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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<ColumnInfo> getColumns(String name);
|
||||
|
||||
/**
|
||||
* 同步表数据
|
||||
* @param columnInfos /
|
||||
* @param columnInfoList /
|
||||
*/
|
||||
void sync(List<ColumnInfo> columnInfos, List<ColumnInfo> columnInfoList);
|
||||
|
||||
/**
|
||||
* 保持数据
|
||||
* @param columnInfos /
|
||||
*/
|
||||
void save(List<ColumnInfo> columnInfos);
|
||||
|
||||
/**
|
||||
* 获取所有table
|
||||
* @return /
|
||||
*/
|
||||
Object getTables();
|
||||
|
||||
/**
|
||||
* 代码生成
|
||||
* @param genConfig 配置信息
|
||||
* @param columns 字段信息
|
||||
*/
|
||||
void generator(GenConfig genConfig, List<ColumnInfo> columns);
|
||||
|
||||
/**
|
||||
* 预览
|
||||
* @param genConfig 配置信息
|
||||
* @param columns 字段信息
|
||||
* @return /
|
||||
*/
|
||||
ResponseEntity<Object> preview(GenConfig genConfig, List<ColumnInfo> columns);
|
||||
|
||||
/**
|
||||
* 打包下载
|
||||
* @param genConfig 配置信息
|
||||
* @param columns 字段信息
|
||||
* @param request /
|
||||
* @param response /
|
||||
*/
|
||||
void download(GenConfig genConfig, List<ColumnInfo> columns, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 查询数据库的表字段数据数据
|
||||
* @param table /
|
||||
* @return /
|
||||
*/
|
||||
List<ColumnInfo> query(String table);
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<TableInfo> 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<ColumnInfo> getColumns(String tableName) {
|
||||
List<ColumnInfo> columnInfos = columnInfoRepository.findByTableNameOrderByIdAsc(tableName);
|
||||
if (CollectionUtil.isNotEmpty(columnInfos)) {
|
||||
return columnInfos;
|
||||
} else {
|
||||
columnInfos = query(tableName);
|
||||
return columnInfoRepository.saveAll(columnInfos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ColumnInfo> 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<ColumnInfo> 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<ColumnInfo> columnInfos, List<ColumnInfo> columnInfoList) {
|
||||
// 第一种情况,数据库类字段改变或者新增字段
|
||||
for (ColumnInfo columnInfo : columnInfoList) {
|
||||
// 根据字段名称查找
|
||||
List<ColumnInfo> 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<ColumnInfo> 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<ColumnInfo> columnInfos) {
|
||||
columnInfoRepository.saveAll(columnInfos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generator(GenConfig genConfig, List<ColumnInfo> 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<Object> preview(GenConfig genConfig, List<ColumnInfo> columns) {
|
||||
if (genConfig.getId() == null) {
|
||||
throw new BadRequestException(CONFIG_MESSAGE);
|
||||
}
|
||||
List<Map<String, Object>> genList = GenUtil.preview(columns, genConfig);
|
||||
return new ResponseEntity<>(genList, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(GenConfig genConfig, List<ColumnInfo> 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("打包失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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<String> getAdminTemplateNames() {
|
||||
List<String> 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<String> getFrontTemplateNames() {
|
||||
List<String> templateNames = new ArrayList<>();
|
||||
templateNames.add("index");
|
||||
templateNames.add("api");
|
||||
return templateNames;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> preview(List<ColumnInfo> columns, GenConfig genConfig) {
|
||||
Map<String, Object> genMap = getGenMap(columns, genConfig);
|
||||
List<Map<String, Object>> genList = new ArrayList<>();
|
||||
// 获取后端模版
|
||||
List<String> templates = getAdminTemplateNames();
|
||||
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
|
||||
for (String templateName : templates) {
|
||||
Map<String, Object> 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<String, Object> 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<ColumnInfo> 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<String, Object> genMap = getGenMap(columns, genConfig);
|
||||
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
|
||||
// 生成后端代码
|
||||
List<String> 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<ColumnInfo> columnInfos, GenConfig genConfig) throws IOException {
|
||||
Map<String, Object> genMap = getGenMap(columnInfos, genConfig);
|
||||
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
|
||||
// 生成后端代码
|
||||
List<String> 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<String, Object> getGenMap(List<ColumnInfo> columnInfos, GenConfig genConfig) {
|
||||
// 存储模版字段数据
|
||||
Map<String, Object> 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<Map<String, Object>> columns = new ArrayList<>();
|
||||
// 保存查询字段的信息
|
||||
List<Map<String, Object>> queryColumns = new ArrayList<>();
|
||||
// 存储字典信息
|
||||
List<String> dicts = new ArrayList<>();
|
||||
// 存储 between 信息
|
||||
List<Map<String, Object>> betweens = new ArrayList<>();
|
||||
// 存储不为空的字段信息
|
||||
List<Map<String, Object>> isNotNullColumns = new ArrayList<>();
|
||||
|
||||
for (ColumnInfo column : columnInfos) {
|
||||
Map<String, Object> 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<String, Object> 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -106,11 +106,13 @@
|
|||
<version>6.1.4</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.4</version>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.baomidou</groupId>-->
|
||||
|
|
@ -120,12 +122,12 @@
|
|||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>3.5.3.1</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.3.1</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
|
||||
<!-- zxing生成二维码 -->
|
||||
|
|
@ -165,9 +167,15 @@
|
|||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>pro</id>
|
||||
<id>pre</id>
|
||||
<properties>
|
||||
<env>pro</env>
|
||||
<env>pre</env>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
<properties>
|
||||
<env>prod</env>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
|
|
|||
|
|
@ -2,26 +2,43 @@ package cn.ysk.cashier.cons;
|
|||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public interface TableConstant {
|
||||
|
||||
String CART_SEAT_ID = "-999";
|
||||
|
||||
class OrderInfo {
|
||||
class ShopTable {
|
||||
@Getter
|
||||
public enum State {
|
||||
IDLE("idle"), CLOSED("closed"), PAYING("paying"), PENDING("pending"), USING("using"), CLEANING("cleaning");
|
||||
private final String value;
|
||||
|
||||
State(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class CashierCart {
|
||||
public static final String ID = "-999";
|
||||
|
||||
@Getter
|
||||
public enum Status {
|
||||
REFUNDING("refunding"), REFUND("refund"), CLOSED("closed"), CREATE("create"),
|
||||
UNPAID("unpaid"), PAYING("paying"), RETURN("return");
|
||||
UNPAID("unpaid"), PAYING("paying"), RETURN("return"), CANCEL("cancel");
|
||||
private final String value;
|
||||
|
||||
Status(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public boolean equalsVals(String value) {
|
||||
return this.value.equals(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public enum UseType {
|
||||
TAKEOUT("takeout"),
|
||||
NONE_TABLE("dine-in"),
|
||||
DINE_IN_AFTER("dine-in-after"),
|
||||
DINE_IN_BEFORE("dine-in-before");
|
||||
private final String value;
|
||||
|
|
@ -35,4 +52,137 @@ public interface TableConstant {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
class OrderInfo {
|
||||
@Getter
|
||||
public enum Status {
|
||||
REFUNDING("refunding"), REFUND("refund"), CLOSED("closed"), CREATE("create"),
|
||||
UNPAID("unpaid"), PAYING("paying"), RETURN("return"), FINAL("final");
|
||||
private final String value;
|
||||
|
||||
Status(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean equalsVals(String value) {
|
||||
return this.value.equals(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Getter
|
||||
public enum UseType {
|
||||
TAKEOUT("takeout"),
|
||||
DINE_IN_AFTER("dine-in-after"),
|
||||
DINE_IN_BEFORE("dine-in-before"), NONE_TABLE("dine-in");
|
||||
private final String value;
|
||||
|
||||
UseType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean equalsVals(String value) {
|
||||
return this.value.equals(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class FreeDineRecord {
|
||||
@Getter
|
||||
public enum State {
|
||||
WAIT_PAY(0),
|
||||
SUCCESS_PAY(1),
|
||||
FAIL_PAY(2);
|
||||
private final Integer value;
|
||||
|
||||
State(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public enum UseType {
|
||||
TAKEOUT("takeout"),
|
||||
DINE_IN_AFTER("dine-in-after"),
|
||||
DINE_IN_BEFORE("dine-in-before");
|
||||
private final String value;
|
||||
|
||||
UseType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean equalsVals(String value) {
|
||||
return this.value.equals(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ShopInfo {
|
||||
@Getter
|
||||
public enum EatModel {
|
||||
TAKEOUT("takeout"),
|
||||
DINE_IN("dine-in");
|
||||
private final String value;
|
||||
|
||||
EatModel(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean equalsVals(String value) {
|
||||
return this.value.equals(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MemberIn {
|
||||
@Getter
|
||||
public enum Type {
|
||||
NORMAL(0),
|
||||
FREE_DINE(1);
|
||||
private final Integer value;
|
||||
|
||||
Type(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean equalsVals(Integer value) {
|
||||
return Objects.equals(this.value, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ActivateOutRecord {
|
||||
@Getter
|
||||
public enum Type {
|
||||
// 满减
|
||||
FULL_REDUCTION(1),
|
||||
// 商品
|
||||
PRODUCT(2);
|
||||
private final Integer value;
|
||||
|
||||
Type(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean equalsVals(Integer value) {
|
||||
return Objects.equals(this.value, value);
|
||||
}
|
||||
}
|
||||
@Getter
|
||||
public enum Status {
|
||||
CREATE("create"),
|
||||
CANCEL("cancel"),
|
||||
// 商品
|
||||
CLOSED("closed");
|
||||
private final String value;
|
||||
|
||||
Status(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean equalsVals(String value) {
|
||||
return this.value.equals(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ public class TbConsInfo implements Serializable {
|
|||
@ApiModelProperty(value = "单位换算")
|
||||
private BigDecimal conUnitTwoConvert;
|
||||
|
||||
@Column(name = "`default_unit`")
|
||||
@ApiModelProperty(value = "默认入库单位")
|
||||
private String defaultUnit;
|
||||
|
||||
@Column(name = "`laster_in_stock`")
|
||||
@ApiModelProperty(value = "最近一次入库量")
|
||||
private BigDecimal lasterInStock;
|
||||
|
|
@ -102,9 +106,6 @@ public class TbConsInfo implements Serializable {
|
|||
@ApiModelProperty(value = "是否检测库存")
|
||||
private String isCheck;
|
||||
|
||||
@Transient
|
||||
private List<Map<Integer, Object>> product;
|
||||
|
||||
public void copy(TbConsInfo source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,10 @@ public class TbConsInfoV2 implements Serializable {
|
|||
@ApiModelProperty(value = "单位换算")
|
||||
private BigDecimal conUnitTwoConvert;
|
||||
|
||||
@Column(name = "`default_unit`")
|
||||
@ApiModelProperty(value = "默认入库单位")
|
||||
private String defaultUnit;
|
||||
|
||||
|
||||
@Column(name = "`laster_in_stock`")
|
||||
@ApiModelProperty(value = "最近一次入库量")
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public class TbConsInfoDto implements Serializable {
|
|||
private String conUnitTwo;
|
||||
|
||||
private BigDecimal conUnitTwoConvert;
|
||||
private String defaultUnit;
|
||||
|
||||
/** 最近一次入库量 */
|
||||
private BigDecimal lasterInStock;
|
||||
|
|
@ -71,5 +72,4 @@ public class TbConsInfoDto implements Serializable {
|
|||
|
||||
private String isCheck;
|
||||
|
||||
private List<Map<Integer, Object>> product;
|
||||
}
|
||||
|
|
@ -114,6 +114,8 @@ public class TbConsInfoFlowServiceImpl implements TbConsInfoFlowService {
|
|||
criteria.setBizCode(Arrays.asList("stockIn","cancelCart","init","stockIn","checkStockIn","stockOtherIn","cancelCart","createCart","stockout","checkStockOut","frmLoss"));
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
criteria.setBizCode(Arrays.asList("stockIn","cancelCart","init","stockIn","checkStockIn","stockOtherIn","cancelCart","createCart","stockout","checkStockOut","frmLoss"));
|
||||
}
|
||||
Sort sort = Sort.by(Sort.Direction.DESC, "id");
|
||||
Pageable pageable = PageRequest.of(criteria.getPage(), criteria.getSize(), sort);
|
||||
|
|
|
|||
|
|
@ -231,10 +231,20 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
}
|
||||
BigDecimal changeStock = conInfos.getStockNumber();
|
||||
//副单位的实际修改值
|
||||
if (StringUtils.isNotBlank(conInfos.getUnit()) && conInfos.getUnit().equals(info.getConUnitTwo())) {
|
||||
if (StringUtils.isNotBlank(conInfos.getUnit())) {
|
||||
info.setDefaultUnit(conInfos.getUnit());
|
||||
if (conInfos.getUnit().equals(info.getConUnitTwo())) {
|
||||
changeStock = conInfos.getStockNumber().multiply(info.getConUnitTwoConvert()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
} else if (StringUtils.isNotBlank(info.getConUnitTwo())
|
||||
&& StringUtils.isNotBlank(info.getDefaultUnit())
|
||||
&& info.getConUnitTwo().equals(info.getDefaultUnit())) {
|
||||
info.setDefaultUnit(info.getConUnitTwo());
|
||||
changeStock = conInfos.getStockNumber().multiply(info.getConUnitTwoConvert()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
|
||||
|
||||
|
||||
TbConsSuppFlow suppFlow = new TbConsSuppFlow();
|
||||
|
||||
TbConsInfoFlow flow = new TbConsInfoFlow();
|
||||
|
|
|
|||
|
|
@ -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<Object> queryBotButtonConfig(BotButtonConfigQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botButtonConfigService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增buttonConfig")
|
||||
@PreAuthorize("@el.check('botButtonConfig:add')")
|
||||
public ResponseEntity<Object> createBotButtonConfig(@Validated @RequestBody BotButtonConfig resources){
|
||||
return new ResponseEntity<>(botButtonConfigService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改buttonConfig")
|
||||
@PreAuthorize("@el.check('botButtonConfig:edit')")
|
||||
public ResponseEntity<Object> updateBotButtonConfig(@Validated @RequestBody BotButtonConfig resources){
|
||||
botButtonConfigService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除buttonConfig")
|
||||
@PreAuthorize("@el.check('botButtonConfig:del')")
|
||||
public ResponseEntity<Object> deleteBotButtonConfig(@RequestBody Integer[] ids) {
|
||||
botButtonConfigService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object> queryBotConfig(BotConfigQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botConfigService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增botConfig")
|
||||
@PreAuthorize("@el.check('botConfig:add')")
|
||||
public ResponseEntity<Object> createBotConfig(@Validated @RequestBody BotConfig resources){
|
||||
return new ResponseEntity<>(botConfigService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改botConfig")
|
||||
@PreAuthorize("@el.check('botConfig:edit')")
|
||||
public ResponseEntity<Object> updateBotConfig(@Validated @RequestBody BotConfig resources){
|
||||
botConfigService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除botConfig")
|
||||
@PreAuthorize("@el.check('botConfig:del')")
|
||||
public ResponseEntity<Object> deleteBotConfig(@RequestBody Integer[] ids) {
|
||||
botConfigService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object> queryBotUser(BotUserQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botUserService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增BotUserController")
|
||||
@PreAuthorize("@el.check('botUser:add')")
|
||||
public ResponseEntity<Object> createBotUser(@Validated @RequestBody BotUser resources){
|
||||
return new ResponseEntity<>(botUserService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改BotUserController")
|
||||
@PreAuthorize("@el.check('botUser:edit')")
|
||||
public ResponseEntity<Object> updateBotUser(@Validated @RequestBody BotUser resources){
|
||||
botUserService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除BotUserController")
|
||||
@PreAuthorize("@el.check('botUser:del')")
|
||||
public ResponseEntity<Object> deleteBotUser(@RequestBody Integer[] ids) {
|
||||
botUserService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object> queryBotUserFlow(BotUserFlowQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botUserFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增accountFlow")
|
||||
@PreAuthorize("@el.check('botUserFlow:add')")
|
||||
public ResponseEntity<Object> createBotUserFlow(@Validated @RequestBody BotUserFlow resources){
|
||||
return new ResponseEntity<>(botUserFlowService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改accountFlow")
|
||||
@PreAuthorize("@el.check('botUserFlow:edit')")
|
||||
public ResponseEntity<Object> updateBotUserFlow(@Validated @RequestBody BotUserFlow resources){
|
||||
botUserFlowService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除accountFlow")
|
||||
@PreAuthorize("@el.check('botUserFlow:del')")
|
||||
public ResponseEntity<Object> deleteBotUserFlow(@RequestBody Integer[] ids) {
|
||||
botUserFlowService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object> 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<Object> createTbRenewalsPayLog(@Validated @RequestBody TbRenewalsPayLog resources){
|
||||
return new ResponseEntity<>(tbRenewalsPayLogService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/shop/renewals")
|
||||
@PreAuthorize("@el.check('tbRenewalsPayLog:edit')")
|
||||
public ResponseEntity<Object> 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<Object> deleteTbRenewalsPayLog(@RequestBody Integer[] ids) {
|
||||
tbRenewalsPayLogService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.dto.QueryReceiveDto;
|
||||
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.validation.annotation.Validated;
|
||||
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<Object> 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<Object> queryActivatePros(@PathVariable("couponId") Integer couponId){
|
||||
return new ResponseEntity<>(tbShopCouponService.findActivatePros(couponId),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增")
|
||||
public ResponseEntity<Object> 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<Object> 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<Object> delete(@RequestBody Integer[] ids) {
|
||||
tbShopCouponService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/queryReceive")
|
||||
@ApiOperation("领取详情")
|
||||
public ResponseEntity<Object> queryReceive(@Validated @RequestBody QueryReceiveDto param) {
|
||||
return new ResponseEntity<>(tbShopCouponService.queryReceive(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping("receive")
|
||||
@ApiOperation("删除用户的券")
|
||||
public ResponseEntity<Object> deleteReceive(@RequestBody Integer[] ids) {
|
||||
tbShopCouponService.deleteReceive(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("activateByOrderId")
|
||||
@ApiOperation("根据订单id获取可用优惠券信息")
|
||||
public ResponseEntity<Object> activateByOrderIds(@RequestParam Integer shopId, @RequestParam Integer orderId, @RequestParam(required = false) Integer memberId) {
|
||||
return ResponseEntity.ok(tbShopCouponService.getActivateByOrderIds(shopId, orderId, memberId));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package cn.ysk.cashier.controller;
|
||||
|
||||
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
|
||||
import cn.ysk.cashier.dto.TbShopShareRecordQueryCriteria;
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopShare;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopShareRecordService;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopShareService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 店铺分享(TbShopShare)表控制层
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-11-06 15:47:37
|
||||
*/
|
||||
@Api(tags = "分享")
|
||||
@RestController
|
||||
@RequestMapping("tbShopShare")
|
||||
public class TbShopShareController {
|
||||
|
||||
@Resource
|
||||
private TbShopShareService tbShopShareService;
|
||||
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private TbShopShareRecordService tbShopShareRecordService;
|
||||
|
||||
@PostMapping("byShare")
|
||||
@AnonymousPostMapping
|
||||
@ApiOperation("分页查询")
|
||||
public ResponseEntity<Object> selectAllByShare(@RequestBody TbShopShareRecordQueryCriteria criteria) {
|
||||
return new ResponseEntity<>(tbShopShareRecordService.selectAllByShare(criteria), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("byShopId")
|
||||
@ApiOperation("通过shopId查询详情")
|
||||
public ResponseEntity<?> getByShopId(@RequestParam Integer shopId) {
|
||||
return ResponseEntity.ok(tbShopShareService.getByShopId(shopId));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增")
|
||||
public ResponseEntity<Object> insert(@RequestBody TbShopShare tbShopShare) {
|
||||
return new ResponseEntity<>(tbShopShareService.save(tbShopShare), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("通过id修改")
|
||||
public ResponseEntity<Object> update(@RequestBody TbShopShare tbShopShare) {
|
||||
tbShopShareService.updateById(tbShopShare);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity<Object> delete(@RequestBody Integer[] ids) {
|
||||
tbShopShareService.removeByIds(Arrays.asList(ids));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package cn.ysk.cashier.controller.points;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import cn.ysk.cashier.dto.points.OrderDeductionPointsDTO;
|
||||
import cn.ysk.cashier.mybatis.entity.TbMemberPoints;
|
||||
import cn.ysk.cashier.mybatis.service.TbMemberPointsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 会员积分
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/points/member-points")
|
||||
@Api(tags = "会员积分")
|
||||
public class TbMemberPointsController {
|
||||
|
||||
@Resource
|
||||
private TbMemberPointsService tbMemberPointsService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
public ResponseEntity page(@RequestParam Map<String, Object> params) {
|
||||
Map<String, Object> page = tbMemberPointsService.page(params);
|
||||
return ResponseEntity.ok().body(page);
|
||||
}
|
||||
|
||||
@GetMapping("{memberId}")
|
||||
@ApiOperation("获取会员积分等信息")
|
||||
public ResponseEntity getMemberPoints(@PathVariable("memberId") Long memberId) {
|
||||
TbMemberPoints memberPoints = tbMemberPointsService.getMemberPoints(memberId);
|
||||
return ResponseEntity.ok().body(memberPoints);
|
||||
}
|
||||
|
||||
@GetMapping("calc-usable-points")
|
||||
@ApiOperation("获取订单可用积分及抵扣金额")
|
||||
public ResponseEntity getMemberUsablePoints(@RequestParam Long memberId, @RequestParam BigDecimal orderAmount) {
|
||||
OrderDeductionPointsDTO usablePoints = tbMemberPointsService.getMemberUsablePoints(memberId, orderAmount);
|
||||
return ResponseEntity.ok().body(usablePoints);
|
||||
}
|
||||
|
||||
@GetMapping("calc-used-points")
|
||||
@ApiOperation("根据抵扣金额计算所需积分")
|
||||
public ResponseEntity calcUsedPoints(@RequestParam Long memberId, @RequestParam BigDecimal orderAmount, @RequestParam BigDecimal deductionAmount) {
|
||||
int points = tbMemberPointsService.calcUsedPoints(memberId, orderAmount, deductionAmount);
|
||||
return ResponseEntity.ok().body(points);
|
||||
}
|
||||
|
||||
@GetMapping("calc-deduction-amount")
|
||||
@ApiOperation("根据积分计算可抵扣金额")
|
||||
public ResponseEntity calcDeductionAmount(@RequestParam Long memberId, @RequestParam BigDecimal orderAmount, @RequestParam Integer points) {
|
||||
BigDecimal deductionAmount = tbMemberPointsService.calcDeductionAmount(memberId, orderAmount, points);
|
||||
return ResponseEntity.ok().body(deductionAmount);
|
||||
}
|
||||
|
||||
@PostMapping("payed-deduct-points")
|
||||
@ApiOperation("支付完成扣减积分(支付成功回调中使用)")
|
||||
public ResponseEntity deductPoints(@RequestBody Map<String, Object> params) {
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
Long memberId = proxy.getLong("memberId");
|
||||
Integer points = proxy.getInt("points");
|
||||
String content = proxy.getStr("content");
|
||||
Long orderId = proxy.getLong("orderId");
|
||||
boolean ret = tbMemberPointsService.deductPoints(memberId, points, content, orderId);
|
||||
return ResponseEntity.ok().body(ret);
|
||||
}
|
||||
|
||||
@PostMapping("consume-award-points")
|
||||
@ApiOperation("消费赠送积分(支付成功回调中使用)")
|
||||
public ResponseEntity consumeAwardPoints(@RequestBody Map<String, Object> params) {
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
Long memberId = proxy.getLong("memberId");
|
||||
Long orderId = proxy.getLong("orderId");
|
||||
tbMemberPointsService.consumeAwardPoints(memberId, orderId);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package cn.ysk.cashier.controller.points;
|
||||
|
||||
import cn.ysk.cashier.mybatis.service.TbMemberPointsLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 会员积分变动记录
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/points/member-points-log")
|
||||
@Api(tags = "会员积分变动记录")
|
||||
public class TbMemberPointsLogController {
|
||||
|
||||
@Resource
|
||||
private TbMemberPointsLogService tbMemberPointsLogService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
public ResponseEntity page(@RequestParam Map<String, Object> params) {
|
||||
Map<String, Object> page = tbMemberPointsLogService.page(params);
|
||||
return ResponseEntity.ok().body(page);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package cn.ysk.cashier.controller.points;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbPointsBasicSetting;
|
||||
import cn.ysk.cashier.mybatis.service.TbPointsBasicSettingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* 积分基本设置
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/points/basic-setting")
|
||||
@Api(tags = "积分基本设置")
|
||||
public class TbPointsBasicSettingController {
|
||||
|
||||
@Resource
|
||||
private TbPointsBasicSettingService tbPointsBasicSettingService;
|
||||
|
||||
@GetMapping("{shopId}")
|
||||
@ApiOperation("信息")
|
||||
public ResponseEntity get(@PathVariable("shopId") Long shopId) {
|
||||
TbPointsBasicSetting data = tbPointsBasicSettingService.getByShopId(shopId);
|
||||
return ResponseEntity.ok().body(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
public ResponseEntity save(@RequestBody TbPointsBasicSetting entity) {
|
||||
tbPointsBasicSettingService.save(entity);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package cn.ysk.cashier.controller.points;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbPointsExchangeRecord;
|
||||
import cn.ysk.cashier.mybatis.service.TbPointsExchangeRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 积分兑换记录
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/points/exchange-record")
|
||||
@Api(tags = "积分兑换记录")
|
||||
public class TbPointsExchangeRecordController {
|
||||
|
||||
@Resource
|
||||
private TbPointsExchangeRecordService tbPointsExchangeRecordService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
public ResponseEntity page(@RequestParam Map<String, Object> params) {
|
||||
Map<String, Object> data = tbPointsExchangeRecordService.page(params);
|
||||
return ResponseEntity.ok().body(data);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
public ResponseEntity get(@PathVariable("id") Long id) {
|
||||
TbPointsExchangeRecord data = tbPointsExchangeRecordService.get(id);
|
||||
return ResponseEntity.ok().body(data);
|
||||
}
|
||||
|
||||
@PostMapping("checkout")
|
||||
@ApiOperation("核销")
|
||||
public ResponseEntity checkout(@RequestBody TbPointsExchangeRecord record) {
|
||||
tbPointsExchangeRecordService.checkout(record.getCouponCode());
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping("cancel")
|
||||
@ApiOperation("取消")
|
||||
public ResponseEntity cancel(@RequestBody TbPointsExchangeRecord record) {
|
||||
tbPointsExchangeRecordService.cancel(record);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping("refund")
|
||||
@ApiOperation("退单")
|
||||
public ResponseEntity refund(@RequestBody TbPointsExchangeRecord record) {
|
||||
tbPointsExchangeRecordService.refund(record);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@GetMapping("total")
|
||||
@ApiOperation("统计")
|
||||
public ResponseEntity total(@RequestParam Map<String, Object> params) {
|
||||
Map<String, Object> data = tbPointsExchangeRecordService.total(params);
|
||||
return ResponseEntity.ok().body(data);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package cn.ysk.cashier.controller.points;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbPointsGoodsSetting;
|
||||
import cn.ysk.cashier.mybatis.service.TbPointsGoodsSettingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 积分商品设置
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/points/goods-setting")
|
||||
@Api(tags = "积分商品设置")
|
||||
public class TbPointsGoodsSettingController {
|
||||
|
||||
@Resource
|
||||
private TbPointsGoodsSettingService tbPointsGoodsSettingService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
public ResponseEntity page(@RequestParam Map<String, Object> params) {
|
||||
Map<String, Object> data = tbPointsGoodsSettingService.page(params);
|
||||
return ResponseEntity.ok().body(data);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
public ResponseEntity get(@PathVariable("id") Long id) {
|
||||
TbPointsGoodsSetting data = tbPointsGoodsSettingService.getById(id);
|
||||
return ResponseEntity.ok().body(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
public ResponseEntity save(@RequestBody TbPointsGoodsSetting entity) {
|
||||
boolean ret = tbPointsGoodsSettingService.save(entity);
|
||||
return ResponseEntity.ok().body(ret);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
public ResponseEntity update(@RequestBody TbPointsGoodsSetting dto) {
|
||||
boolean ret = tbPointsGoodsSettingService.update(dto);
|
||||
return ResponseEntity.ok().body(ret);
|
||||
}
|
||||
|
||||
@DeleteMapping("{id}")
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity delete(@PathVariable("id") Long id) {
|
||||
tbPointsGoodsSettingService.delete(id);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package cn.ysk.cashier.controller.product;
|
||||
|
||||
import cn.ysk.cashier.mybatis.service.TbPadLayoutService;
|
||||
import cn.ysk.cashier.pojo.product.TbPadLayout;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Pad商品布局版式
|
||||
* @author tankaikai
|
||||
* @since 2024-10-22 16:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/pad/layout")
|
||||
@Api(tags="Pad商品布局版式")
|
||||
public class TbPadLayoutController {
|
||||
|
||||
@Resource
|
||||
private TbPadLayoutService mpPadLayoutService;
|
||||
|
||||
@GetMapping("list")
|
||||
@ApiOperation("分页")
|
||||
public ResponseEntity list(@RequestParam Map<String, Object> params) {
|
||||
List<TbPadLayout> list = mpPadLayoutService.findList();
|
||||
return ResponseEntity.ok().body(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package cn.ysk.cashier.controller.product;
|
||||
|
||||
import cn.ysk.cashier.dto.product.PadProductCategoryDTO;
|
||||
import cn.ysk.cashier.mybatis.service.TbPadProductCategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Pad商品自定义分类
|
||||
* @author tankaikai
|
||||
* @since 2024-10-22 16:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/pad/productCategory")
|
||||
@Api(tags="Pad商品自定义分类")
|
||||
public class TbPadProductCategoryController {
|
||||
|
||||
@Resource
|
||||
private TbPadProductCategoryService mpPadProductCategoryService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
public ResponseEntity page(@RequestParam Map<String, Object> params) {
|
||||
Map<String, Object> page = mpPadProductCategoryService.findPage(params);
|
||||
return ResponseEntity.ok().body(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("详情")
|
||||
public ResponseEntity get(@PathVariable("id") Long id) {
|
||||
PadProductCategoryDTO data = mpPadProductCategoryService.get(id);
|
||||
return ResponseEntity.ok().body(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
public ResponseEntity save(@RequestBody PadProductCategoryDTO dto) {
|
||||
mpPadProductCategoryService.save(dto);
|
||||
return ResponseEntity.ok().body(dto.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
public ResponseEntity update(@RequestBody PadProductCategoryDTO dto) {
|
||||
mpPadProductCategoryService.update(dto);
|
||||
return ResponseEntity.ok().body(dto.getId());
|
||||
}
|
||||
|
||||
@DeleteMapping("{id}")
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity delete(@PathVariable("id") Long id) {
|
||||
mpPadProductCategoryService.delete(id);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping("sort")
|
||||
@ApiOperation("排序")
|
||||
public ResponseEntity sort(@RequestBody List<PadProductCategoryDTO> sortList) {
|
||||
mpPadProductCategoryService.sort(sortList);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping("copy/{id}")
|
||||
@ApiOperation("复制")
|
||||
public ResponseEntity copy(@PathVariable("id") Long id) {
|
||||
mpPadProductCategoryService.copy(id);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ public class TbPlaceController {
|
|||
@PostMapping("/order")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> createOrder(@RequestBody CreateOrderDTO createOrderDTO) {
|
||||
return ResponseEntity.ok(tbShopTableService.createOrder(createOrderDTO, !createOrderDTO.isPostPay(), true));
|
||||
return ResponseEntity.ok(tbShopTableService.createOrder(createOrderDTO, false));
|
||||
}
|
||||
|
||||
@PostMapping("/pending")
|
||||
|
|
@ -175,13 +175,23 @@ public class TbPlaceController {
|
|||
JSONObject userInfo = JSON.parseObject(JSON.toJSONString(redisUtils.get("online-token-" + token)));
|
||||
String userName = userInfo.getString("userName");
|
||||
String shopId = userInfo.getString("shopId");
|
||||
TbPlussShopStaff shopStaff = staffRepository.queryByAccount(userName, shopId);
|
||||
TbMerchantAccount merchantAccount = tbMerchantAccountMapper.selectOne(Wrappers.<TbMerchantAccount>lambdaQuery().eq(TbMerchantAccount::getAccount, shopStaff.getAccount()));
|
||||
TbPlussShopStaff shopStaff;
|
||||
if (userName.contains("@")) {
|
||||
shopStaff = staffRepository.queryMasterAccount(shopId);
|
||||
} else {
|
||||
shopStaff = staffRepository.queryByAccount(userName, shopId);
|
||||
}
|
||||
TbMerchantAccount merchantAccount = tbMerchantAccountMapper.selectOne(Wrappers.<TbMerchantAccount>lambdaQuery()
|
||||
.eq(TbMerchantAccount::getAccount, shopStaff.getAccount()));
|
||||
Integer accountId = merchantAccount.getId();
|
||||
Integer staffId = shopStaff.getId();
|
||||
List<TbToken> onlineUserList = tbTokenRepository.findListByAccountIdAndStaffId(accountId, staffId);
|
||||
if (CollUtil.isNotEmpty(onlineUserList)) {
|
||||
payDTO.setToken(onlineUserList.get(0).getToken());
|
||||
} else {
|
||||
payDTO.setShopId(Integer.valueOf(shopId));
|
||||
payDTO.setStaffId(staffId);
|
||||
payDTO.setLoginName(userName);
|
||||
}
|
||||
return ResponseEntity.ok(tbShopTableService.pay(payDTO));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
package cn.ysk.cashier.controller.product;
|
||||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.pojo.product.TbProductStockOperate;
|
||||
import cn.ysk.cashier.service.TbProductStockOperateService;
|
||||
import cn.ysk.cashier.dto.product.OutAndOnDto;
|
||||
import cn.ysk.cashier.dto.product.TbProductStockOperateQueryCriteria;
|
||||
import cn.ysk.cashier.pojo.product.TbProductStockOperate;
|
||||
import cn.ysk.cashier.service.TbProductStockOperateService;
|
||||
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.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;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
|
|
@ -40,6 +41,11 @@ public class TbProductStockOperateController {
|
|||
return new ResponseEntity<>(tbProductStockOperateService.queryAllPage(criteria),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
public ResponseEntity<Object> page(@RequestBody TbProductStockOperateQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbProductStockOperateService.queryAllPage(criteria),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<Object> queryById(@PathVariable Integer id){
|
||||
return new ResponseEntity<>(tbProductStockOperateService.findById(id),HttpStatus.OK);
|
||||
|
|
|
|||
|
|
@ -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<String, Object> params) {
|
||||
MapProxy mapProxy = MapProxy.create(params);
|
||||
String shopId = mapProxy.getStr("shopId");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousGetMapping;
|
||||
import cn.ysk.cashier.dto.ShopSummaryDto;
|
||||
import cn.ysk.cashier.service.SummaryService;
|
||||
import cn.ysk.cashier.vo.TbOrderPayCountVo;
|
||||
|
|
@ -33,6 +34,7 @@ public class SummaryByDayController {
|
|||
|
||||
|
||||
@GetMapping
|
||||
@AnonymousGetMapping
|
||||
public Page<T> shopSummary(ShopSummaryDto summaryDto,
|
||||
@RequestParam(required = false, defaultValue = "0") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ public class SummaryController {
|
|||
|
||||
//营业板块 上
|
||||
@PostMapping("/trade")
|
||||
@AnonymousPostMapping
|
||||
private Object shopSummaryDate(@RequestBody BaseQueryDto param) {
|
||||
return summaryService.trade(param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Object> queryTbMerchantCoupon(TbMerchantCouponQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbMerchantCouponService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation("查询优惠卷")
|
||||
public ResponseEntity<Object> 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<Object> createTbMerchantCoupon(@Validated @RequestBody TbMerchantCoupon resources){
|
||||
return new ResponseEntity<>(tbMerchantCouponService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改商家优惠卷:#resources.title")
|
||||
public ResponseEntity<Object> updateTbMerchantCoupon(@Validated @RequestBody TbMerchantCoupon resources){
|
||||
tbMerchantCouponService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除商家优惠卷:#ids")
|
||||
public ResponseEntity<Object> deleteTbMerchantCoupon(@RequestBody Integer[] ids) {
|
||||
tbMerchantCouponService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object> 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<Object> createTbReceiptSales(@Validated @RequestBody TbReceiptSales resources){
|
||||
return new ResponseEntity<>(tbReceiptSalesService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/shop/receiptSales")
|
||||
@PreAuthorize("@el.check('tbReceiptSales:edit')")
|
||||
public ResponseEntity<Object> 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<Object> deleteTbReceiptSales(@RequestBody Integer[] ids) {
|
||||
tbReceiptSalesService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object> 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<Object> createTbShopCashSpread(@Validated @RequestBody TbShopCashSpread resources){
|
||||
return new ResponseEntity<>(tbShopCashSpreadService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/shop/spread")
|
||||
@PreAuthorize("@el.check('tbShopCashSpread:edit')")
|
||||
public ResponseEntity<Object> 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<Object> deleteTbShopCashSpread(@RequestBody String[] ids) {
|
||||
tbShopCashSpreadService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object> 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<Object> createTbShopCurrency(@Validated @RequestBody TbShopCurrency resources){
|
||||
return new ResponseEntity<>(tbShopCurrencyService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/shop/currency")
|
||||
public ResponseEntity<Object> updateTbShopCurrency(@Validated @RequestBody TbShopCurrency resources){
|
||||
tbShopCurrencyService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除/shop/currency")
|
||||
public ResponseEntity<Object> deleteTbShopCurrency(@RequestBody Integer[] ids) {
|
||||
tbShopCurrencyService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +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.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Data
|
||||
public class BotButtonConfigDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 按钮名称 */
|
||||
private String buttonName;
|
||||
|
||||
/** 按钮值 */
|
||||
private String buttonValue;
|
||||
}
|
||||
|
|
@ -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.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Data
|
||||
public class BotButtonConfigQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String buttonName;
|
||||
}
|
||||
|
|
@ -1,40 +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.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Data
|
||||
public class BotConfigDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 元素键值 */
|
||||
private String configKey;
|
||||
|
||||
/** 元素值 */
|
||||
private String configValue;
|
||||
|
||||
/** 描述 */
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -1,36 +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.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Data
|
||||
public class BotConfigQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String configKey;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String configValue;
|
||||
}
|
||||
|
|
@ -1,87 +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.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Data
|
||||
public class BotUserDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer fatherId;
|
||||
|
||||
/** 父级电报号 */
|
||||
private String fatherTelegramId;
|
||||
|
||||
/** 电报号 */
|
||||
private String userTelegramId;
|
||||
|
||||
/** 用户名称 */
|
||||
private String userName;
|
||||
|
||||
/** 组电报号 */
|
||||
private String groupTelegramId;
|
||||
|
||||
/** 用户代码 */
|
||||
private String userCode;
|
||||
|
||||
private String userPayPass;
|
||||
|
||||
private String bombStatus;
|
||||
|
||||
/** 用户状态 */
|
||||
private String botStatus;
|
||||
|
||||
/** 总充值 */
|
||||
private BigDecimal usdtRechargeTotal;
|
||||
|
||||
/** 总提现 */
|
||||
private BigDecimal usdtWithdrawTotal;
|
||||
|
||||
/** 总资金 */
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 冻结资金 */
|
||||
private BigDecimal freezeBalance;
|
||||
|
||||
/** 版本号 */
|
||||
private Integer version;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private Timestamp updateTime;
|
||||
|
||||
/** 语言 */
|
||||
private String userLanguage;
|
||||
|
||||
/** 质押资金 */
|
||||
private BigDecimal chipBalance;
|
||||
|
||||
/** 绑定时间 */
|
||||
private Timestamp fatherBindTime;
|
||||
}
|
||||
|
|
@ -1,54 +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.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Data
|
||||
public class BotUserFlowDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 电报号 */
|
||||
private String userTelegramId;
|
||||
|
||||
/** 用户名称 */
|
||||
private String userName;
|
||||
|
||||
/** 业务代码 */
|
||||
private String bizCode;
|
||||
|
||||
/** 变动金额 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 变动前金额 */
|
||||
private BigDecimal oldBalance;
|
||||
|
||||
/** 变动后金额 */
|
||||
private BigDecimal newBalance;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
}
|
||||
|
|
@ -1,40 +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.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Data
|
||||
public class BotUserFlowQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String userTelegramId;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String userName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String bizCode;
|
||||
}
|
||||
|
|
@ -1,48 +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.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Data
|
||||
public class BotUserQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String fatherTelegramId;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String userTelegramId;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String userName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String userCode;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String botStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CouponDto {
|
||||
private Integer shopId;
|
||||
private Integer userId;
|
||||
//-1已过期 1未使用 2已使用
|
||||
private Integer status;
|
||||
private Integer orderId;
|
||||
private BigDecimal amount;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package cn.ysk.cashier.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class QueryReceiveDto extends BaseQueryDto{
|
||||
@NotBlank(message = "优惠券id 不可为空")
|
||||
private String couponId;
|
||||
//用户昵称 手机号 模糊
|
||||
private String value;
|
||||
//状态 0 未使用 1 已使用
|
||||
private Integer status;
|
||||
|
||||
private Integer page = 1;
|
||||
|
||||
private Integer size = 10;
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import java.util.Date;
|
|||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表(TbActivateProduct)表查询类
|
||||
* 活动赠送商品表(TbCouponProduct)表查询类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
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 Integer type;
|
||||
private long page;
|
||||
private long size;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package cn.ysk.cashier.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* (TbShopShareRecord)表查询类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-11-08 09:17:38
|
||||
*/
|
||||
@Data
|
||||
public class TbShopShareRecordQueryCriteria {
|
||||
|
||||
private Integer shareId;
|
||||
//店铺Id
|
||||
private Integer shopId;
|
||||
//邀请人名称/被邀请人/昵称/手机号 模糊查询
|
||||
private String search;
|
||||
|
||||
//0 非新用户 1 未领取 2 已领取 3 已使用
|
||||
private Integer status;
|
||||
|
||||
private long page = 1;
|
||||
private long size = 10;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package cn.ysk.cashier.dto.order;
|
||||
|
||||
import cn.ysk.cashier.pojo.order.TbCashierCart;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OrderCartInfoDTO {
|
||||
private BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
private BigDecimal newAddTotalAmount = BigDecimal.ZERO;
|
||||
private List<TbCashierCart> newCashierCarts = new ArrayList<>();
|
||||
private List<TbCashierCart> cashierCarts = new ArrayList<>();
|
||||
private List<Integer> cashierCartIds = new ArrayList<>();
|
||||
private Integer orderId;
|
||||
private TbCashierCart seatCart;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package cn.ysk.cashier.dto.order;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbActivateOutRecord;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopUser;
|
||||
import cn.ysk.cashier.vo.TbUserCouponVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OrderCouponInfoDTO {
|
||||
private TbShopUser shopUser;
|
||||
private List<TbActivateOutRecord> outRecordList = new ArrayList<>();
|
||||
// 满减优惠券
|
||||
private HashMap<Integer, TbUserCouponVo> fullReductionCouponMap = new HashMap<>();
|
||||
// 商品优惠券
|
||||
private HashMap<Integer, TbUserCouponVo> productCouponMap = new HashMap<>();
|
||||
private HashMap<Integer, List<TbUserCouponVo>> couponMap = new HashMap<>();
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package cn.ysk.cashier.dto.order;
|
||||
|
||||
import cn.ysk.cashier.pojo.order.TbOrderDetail;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OrderPriceDTO {
|
||||
private BigDecimal originAmount = BigDecimal.ZERO;
|
||||
private BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
private BigDecimal packAmount = BigDecimal.ZERO;
|
||||
private boolean hasNewInfo = false;
|
||||
private List<TbOrderDetail> newOrderDetailList = new ArrayList<>();
|
||||
private List<TbOrderDetail> removeOrderDetailList = new ArrayList<>();
|
||||
private List<Integer> removeOrderDetailIds = new ArrayList<>();
|
||||
private List<TbOrderDetail> orderDetailList = new ArrayList<>();
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package cn.ysk.cashier.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
|
||||
@Data
|
||||
public class UserCouponInfoDTO {
|
||||
private Integer userCouponId;
|
||||
@Min(1)
|
||||
private Integer num;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package cn.ysk.cashier.dto.points;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 获取会员可用积分
|
||||
* @author tankaikai
|
||||
* @since 2024-10-26 11:40
|
||||
*/
|
||||
@Data
|
||||
public class OrderDeductionPointsDTO {
|
||||
|
||||
/**
|
||||
* 本单最多可抵扣多少积分
|
||||
*/
|
||||
private Integer maxUsablePoints;
|
||||
/**
|
||||
* 根据策略计算出的最少可以抵扣的金额
|
||||
*/
|
||||
private BigDecimal minDeductionAmount;
|
||||
/**
|
||||
* 根据策略计算出的最多可以抵扣的金额
|
||||
*/
|
||||
private BigDecimal maxDeductionAmount;
|
||||
/**
|
||||
* 下单实付抵扣门槛(实付金额不低于这个值)
|
||||
*/
|
||||
private BigDecimal minPaymentAmount;
|
||||
/**
|
||||
* 下单积分抵扣门槛(每次使用不低于这个值)
|
||||
*/
|
||||
private Integer minDeductionPoints;
|
||||
/**
|
||||
* 会员账户积分
|
||||
*/
|
||||
private Integer accountPoints;
|
||||
/**
|
||||
* 订单金额 (扣除各类折扣)
|
||||
*/
|
||||
private BigDecimal orderAmount;
|
||||
/**
|
||||
* 使用的积分数量
|
||||
*/
|
||||
private Integer usedPoints;
|
||||
/**
|
||||
* 实际抵扣的金额
|
||||
*/
|
||||
private Integer deductionAmount;
|
||||
/**
|
||||
* 下单抵扣积分比例 1元=?积分
|
||||
*/
|
||||
private Integer equivalentPoints;
|
||||
/**
|
||||
* 不可抵扣原因
|
||||
*/
|
||||
private String unusableReason;
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean usable;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package cn.ysk.cashier.dto.product;
|
||||
|
||||
import cn.ysk.cashier.pojo.product.TbProduct;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Pad商品自定义分类
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2024-10-22 17:07
|
||||
*/
|
||||
@Data
|
||||
public class PadProductCategoryDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 布局版式id
|
||||
*/
|
||||
private Long padLayoutId;
|
||||
|
||||
/**
|
||||
* 自定义名称
|
||||
*/
|
||||
private String customName;
|
||||
/**
|
||||
* 商品分类id
|
||||
*/
|
||||
private Long productCategoryId;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productNames;
|
||||
|
||||
/**
|
||||
* 布局版式代码
|
||||
*/
|
||||
private String padLayoutCode;
|
||||
|
||||
/**
|
||||
* 布局类型
|
||||
*/
|
||||
private String padLayoutName;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String productCategoryName;
|
||||
|
||||
/**
|
||||
* 商品id列表
|
||||
*/
|
||||
private List<Long> productIdList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
private List<TbProduct> productList = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,6 @@ package cn.ysk.cashier.dto.product;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -39,6 +37,11 @@ public class TbProductGroupDto implements Serializable {
|
|||
|
||||
private String style;
|
||||
|
||||
/**
|
||||
* 排序方式 0-默认; 1-价格从高到低; 2-销量由高到低;
|
||||
*/
|
||||
private String sortMode;
|
||||
|
||||
/** 排序 */
|
||||
private Integer sort;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,10 @@
|
|||
*/
|
||||
package cn.ysk.cashier.dto.product;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
|
|
@ -34,6 +35,12 @@ public class TbProductStockOperateQueryCriteria{
|
|||
@Query(type = Query.Type.BETWEEN)
|
||||
private List<Long> createdAt;
|
||||
|
||||
@Query(type = Query.Type.IN)
|
||||
private List<String> type;
|
||||
|
||||
@Query(type = Query.Type.EQUAL)
|
||||
private String purveyorId;
|
||||
|
||||
private Integer page;
|
||||
|
||||
private Integer size;
|
||||
|
|
|
|||
|
|
@ -199,4 +199,7 @@ public class TbShopInfoDto implements Serializable {
|
|||
//程序码(零点八零首页)
|
||||
private String smallQrcode;
|
||||
private String paymentQrcode;
|
||||
|
||||
private Integer isMemberPrice;
|
||||
private String consumeColony;
|
||||
}
|
||||
|
|
@ -29,4 +29,6 @@ public class AddCartDTO {
|
|||
// 用餐类型
|
||||
@NotBlank
|
||||
private String useType;
|
||||
|
||||
private Integer vipUserId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import cn.ysk.cashier.dto.order.UserCouponInfoDTO;
|
||||
import lombok.Data;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CreateOrderDTO {
|
||||
|
|
@ -17,5 +23,11 @@ public class CreateOrderDTO {
|
|||
private Integer orderId;
|
||||
@NotEmpty
|
||||
private String useType;
|
||||
private String vipUserId;
|
||||
private Integer vipUserId;
|
||||
// 使用的优惠券
|
||||
@Valid
|
||||
private List<UserCouponInfoDTO> userCouponInfos = new ArrayList<>();
|
||||
// 使用的积分抵扣数量
|
||||
private Integer pointsNum;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import cn.ysk.cashier.dto.order.UserCouponInfoDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PayDTO {
|
||||
|
|
@ -20,6 +24,13 @@ public class PayDTO {
|
|||
private Double discount;
|
||||
private Integer vipUserId;
|
||||
private String code;
|
||||
|
||||
private String token;
|
||||
// 使用的优惠券
|
||||
@Valid
|
||||
private List<UserCouponInfoDTO> userCouponInfos = new ArrayList<>();
|
||||
// 使用的积分抵扣数量
|
||||
private Integer pointsNum;
|
||||
private Integer staffId;
|
||||
private String loginName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public class ShopEatTypeInfoDTO {
|
|||
private boolean isNoneTable;
|
||||
// 是否增加masterId
|
||||
private boolean isIncrMaterId;
|
||||
private boolean isMemberPrice;
|
||||
private TbShopInfo shopInfo;
|
||||
private String useType;
|
||||
private Object shopId;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class UpdateVipDTO {
|
|||
private String tableId;
|
||||
@NotNull
|
||||
private String masterId;
|
||||
|
||||
private Integer orderId;
|
||||
private Integer vipUserId;
|
||||
@NotNull
|
||||
@Range(min = 0, max = 1)
|
||||
|
|
|
|||
|
|
@ -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<BotButtonConfigDto, BotButtonConfig> {
|
||||
|
||||
}
|
||||
|
|
@ -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<BotConfigDto, BotConfig> {
|
||||
|
||||
}
|
||||
|
|
@ -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<BotUserFlowDto, BotUserFlow> {
|
||||
|
||||
}
|
||||
|
|
@ -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<BotUserDto, BotUser> {
|
||||
|
||||
}
|
||||
|
|
@ -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<TbRenewalsPayLogDto, TbRenewalsPayLog> {
|
||||
|
||||
}
|
||||
|
|
@ -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<TbMerchantCouponDto, TbMerchantCoupon> {
|
||||
|
||||
}
|
||||
|
|
@ -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<TbReceiptSalesDto, TbReceiptSales> {
|
||||
|
||||
}
|
||||
|
|
@ -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<TbShopCashSpreadDto, TbShopCashSpread> {
|
||||
|
||||
}
|
||||
|
|
@ -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<TbShopCurrencyDto, TbShopCurrency> {
|
||||
|
||||
}
|
||||
|
|
@ -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<Activate> {
|
||||
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<TbActivateProduct> products;
|
||||
}
|
||||
|
|
@ -1,44 +1,127 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
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;
|
||||
import java.util.Date;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivate extends Model<TbActivate> {
|
||||
|
||||
@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;
|
||||
//赠送积分
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private Integer giftPoints;
|
||||
//是否使用优惠卷 0否 1是
|
||||
private Integer isUseCoupon;
|
||||
//优惠卷id
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private Integer couponId;
|
||||
@TableField(exist = false)
|
||||
private String couponName;
|
||||
//优惠卷数量
|
||||
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 String getCouponName() {
|
||||
return couponName;
|
||||
}
|
||||
|
||||
public void setCouponName(String couponName) {
|
||||
this.couponName = couponName;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public Integer getGiftPoints() {
|
||||
return giftPoints;
|
||||
}
|
||||
|
||||
public void setGiftPoints(Integer giftPoints) {
|
||||
this.giftPoints = giftPoints;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,40 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 活动商品赠送表(TbActivateInRecord)表实体类
|
||||
* 活动商品赠送记录表(TbActivateInRecord)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-22 14:50:16
|
||||
* @since 2024-11-08 09:53:21
|
||||
*/
|
||||
@Data
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
||||
|
||||
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 BigDecimal fullAmount;
|
||||
//减多少金额
|
||||
private BigDecimal discountAmount;
|
||||
//赠送数量
|
||||
private Integer num;
|
||||
//未使用数量
|
||||
|
|
@ -30,90 +45,17 @@ public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
|||
private Integer sourceActId;
|
||||
|
||||
private Integer sourceFlowId;
|
||||
|
||||
//可用开始时间
|
||||
private Date useStartTime;
|
||||
//可用结束时间
|
||||
private Date useEndTime;
|
||||
@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 getVipUserId() {
|
||||
return vipUserId;
|
||||
}
|
||||
|
||||
public void setVipUserId(Integer vipUserId) {
|
||||
this.vipUserId = vipUserId;
|
||||
}
|
||||
|
||||
public Integer getProId() {
|
||||
return proId;
|
||||
}
|
||||
|
||||
public void setProId(Integer proId) {
|
||||
this.proId = proId;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public Integer getOverNum() {
|
||||
return overNum;
|
||||
}
|
||||
|
||||
public void setOverNum(Integer overNum) {
|
||||
this.overNum = overNum;
|
||||
}
|
||||
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public Integer getSourceActId() {
|
||||
return sourceActId;
|
||||
}
|
||||
|
||||
public void setSourceActId(Integer sourceActId) {
|
||||
this.sourceActId = sourceActId;
|
||||
}
|
||||
|
||||
public Integer getSourceFlowId() {
|
||||
return sourceFlowId;
|
||||
}
|
||||
|
||||
public void setSourceFlowId(Integer sourceFlowId) {
|
||||
this.sourceFlowId = sourceFlowId;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
private String couponJson;
|
||||
//invited/activate
|
||||
private String source;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<TbActivateOutRecord> {
|
||||
|
||||
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<TbActivateOutRecord> {
|
|||
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<TbActivateOutRecord> {
|
|||
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<TbActivateOutRecord> {
|
|||
this.refNum = refNum;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<TbActivateProduct> {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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<TbCouponProduct> {
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会员积分
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName("tb_shop_user")
|
||||
public class TbMemberPoints {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
@TableField(value = "id", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private Long memberId;
|
||||
/**
|
||||
* 会员名称
|
||||
*/
|
||||
@TableField("name")
|
||||
private String memberName;
|
||||
/**
|
||||
* 会员头像
|
||||
*/
|
||||
@TableField("head_img")
|
||||
private String avatarUrl;
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@TableField("telephone")
|
||||
private String mobile;
|
||||
/**
|
||||
* 账户积分
|
||||
*/
|
||||
@TableField("account_points")
|
||||
private Integer accountPoints;
|
||||
/**
|
||||
* 最近一次积分变动时间
|
||||
*/
|
||||
@TableField("last_points_change_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date lastPointsChangeTime;
|
||||
/**
|
||||
* 最近一次浮动积分
|
||||
*/
|
||||
@TableField("last_float_points")
|
||||
private Integer lastFloatPoints;
|
||||
/**
|
||||
* 是否会员 1-是 0-否
|
||||
*/
|
||||
@TableField("is_vip")
|
||||
private Integer vip;
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会员积分变动记录
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName("tb_member_points_log")
|
||||
public class TbMemberPointsLog {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
private Long memberId;
|
||||
/**
|
||||
* 会员名称
|
||||
*/
|
||||
private String memberName;
|
||||
/**
|
||||
* 会员头像
|
||||
*/
|
||||
private String avatarUrl;
|
||||
/**
|
||||
* 摘要信息(如:兑换某个商品/消费多少钱/充值多少钱/新会员赠送积分等)
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 浮动类型 add-累加 subtract-扣减
|
||||
*/
|
||||
private String floatType;
|
||||
/**
|
||||
* 浮动积分(非0正负数)
|
||||
*/
|
||||
private Integer floatPoints;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 积分基本设置
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName("tb_points_basic_setting")
|
||||
public class TbPointsBasicSetting {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 开启消费赠送积分 1-开启 0-关闭
|
||||
*/
|
||||
private Integer enableRewards;
|
||||
/**
|
||||
* 赠积分适用群体 all-全部 vip-仅会员
|
||||
*/
|
||||
private String rewardsGroup;
|
||||
/**
|
||||
* 每消费xx元赠送1积分
|
||||
*/
|
||||
private BigDecimal consumeAmount;
|
||||
/**
|
||||
* 开启下单积分抵扣 1-开启 0-关闭
|
||||
*/
|
||||
private Integer enableDeduction;
|
||||
/**
|
||||
* 抵扣适用群体 all-全部 vip-仅会员
|
||||
*/
|
||||
private String deductionGroup;
|
||||
/**
|
||||
* 下单实付抵扣门槛
|
||||
*/
|
||||
private BigDecimal minPaymentAmount;
|
||||
/**
|
||||
* 下单最高抵扣比例
|
||||
*/
|
||||
private BigDecimal maxDeductionRatio;
|
||||
/**
|
||||
* 下单抵扣积分比例 1元=?积分
|
||||
*/
|
||||
private Integer equivalentPoints;
|
||||
/**
|
||||
* 开启积分商城 1-开启 0-关闭
|
||||
*/
|
||||
private Integer enablePointsMall;
|
||||
/**
|
||||
* 浏览模式 list-列表 grid-宫格
|
||||
*/
|
||||
private String browseMode;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 积分兑换记录
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("tb_points_exchange_record")
|
||||
public class TbPointsExchangeRecord {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 积分商品id
|
||||
*/
|
||||
private Long pointsGoodsId;
|
||||
/**
|
||||
* 积分商品名称
|
||||
*/
|
||||
private String pointsGoodsName;
|
||||
/**
|
||||
* 商品图片URL
|
||||
*/
|
||||
private String goodsImageUrl;
|
||||
/**
|
||||
* 领取方式 self-自取 post-邮寄
|
||||
*/
|
||||
private String pickupMethod;
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
private Long memberId;
|
||||
/**
|
||||
* 会员名称
|
||||
*/
|
||||
private String memberName;
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 会员头像
|
||||
*/
|
||||
private String avatarUrl;
|
||||
/**
|
||||
* 消耗积分
|
||||
*/
|
||||
private Integer spendPoints;
|
||||
/**
|
||||
* 额外支付
|
||||
*/
|
||||
private BigDecimal extraPaymentAmount;
|
||||
/**
|
||||
* 兑换券券码
|
||||
*/
|
||||
private String couponCode;
|
||||
/**
|
||||
* 支付平台订单号
|
||||
*/
|
||||
private String payOrderId;
|
||||
/**
|
||||
* 渠道订单号(微信/支付宝订单号)
|
||||
*/
|
||||
private String channelTradeNo;
|
||||
/**
|
||||
* 支付方式 积分支付/积分+微信/积分+支付宝
|
||||
*/
|
||||
private String payMethod;
|
||||
/**
|
||||
* 支付类型 POINTS-积分 WECHAT-微信 ALIPAY-支付宝 UNIONPAY-银联云闪付
|
||||
*/
|
||||
private String payType;
|
||||
/**
|
||||
* 状态 unpaid-待支付 waiting-待自取 done-已完成 cancel-已取消
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 取消/退款原因
|
||||
*/
|
||||
private String cancelOrRefundReason;
|
||||
/**
|
||||
* 取消/退款时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date cancelOrRefundTime;
|
||||
/**
|
||||
* 实际支付时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date payTime;
|
||||
/**
|
||||
* 创建时间(下单时间)
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间(核销时间)
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(value = "count(*)", select = false, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private Long count;
|
||||
|
||||
@TableField(value = "sum(extra_payment_amount)", select = false, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 用户ip
|
||||
*/
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 微信openId/支付完userId
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
@TableField(exist = false)
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 拉起支付所需信息
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String payInfo;
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 积分商品设置
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 2.0 2024-10-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("tb_points_goods_setting")
|
||||
public class TbPointsGoodsSetting {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 商品类型 physical-实物 coupon-优惠劵
|
||||
*/
|
||||
private String goodsCategory;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
/**
|
||||
* 商品图片URL
|
||||
*/
|
||||
@TableField(value = "goods_image_url", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String goodsImageUrl;
|
||||
/**
|
||||
* 所需积分
|
||||
*/
|
||||
private Integer requiredPoints;
|
||||
/**
|
||||
* 额外价格
|
||||
*/
|
||||
private BigDecimal extraPrice;
|
||||
/**
|
||||
* 排序(权重),数字越高,显示约靠前
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@TableField(value = "goods_description", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String goodsDescription;
|
||||
/**
|
||||
* 累计兑换数量
|
||||
*/
|
||||
private Integer totalExchangeCount;
|
||||
/**
|
||||
* 是否上架 1-是 0-否
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 逻辑删除标志 1-是 0-否
|
||||
*/
|
||||
private Integer delFlag;
|
||||
}
|
||||
|
|
@ -0,0 +1,254 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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<TbShopCoupon> {
|
||||
//自增
|
||||
private Integer id;
|
||||
|
||||
private String shopId;
|
||||
//名称(无意义)
|
||||
private String title;
|
||||
//1-满减 2-商品
|
||||
private Integer type;
|
||||
//满多少金额
|
||||
private BigDecimal fullAmount;
|
||||
//减多少金额
|
||||
private BigDecimal 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 BigDecimal getFullAmount() {
|
||||
return fullAmount;
|
||||
}
|
||||
|
||||
public void setFullAmount(BigDecimal fullAmount) {
|
||||
this.fullAmount = fullAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getDiscountAmount() {
|
||||
return discountAmount;
|
||||
}
|
||||
|
||||
public void setDiscountAmount(BigDecimal 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -150,6 +150,12 @@ public class TbShopExtend extends Model<TbShopExtend> {
|
|||
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";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,98 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.ysk.cashier.utils.JSONUtil;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺分享(TbShopShare)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-11-06 15:47:37
|
||||
*/
|
||||
@Data
|
||||
@SuppressWarnings("serial")
|
||||
public class TbShopShare extends Model<TbShopShare> {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
//店铺Id
|
||||
private Integer shopId;
|
||||
//标题
|
||||
private String title;
|
||||
//分享封面图
|
||||
private String shareImg;
|
||||
//邀请顶部图
|
||||
private String invitedImg;
|
||||
//被邀顶部图
|
||||
private String beInvitedImg;
|
||||
//活动开始时间
|
||||
private Date startTime;
|
||||
//活动结束时间
|
||||
private Date endTime;
|
||||
//新用户获得券
|
||||
private String newCoupon;
|
||||
//邀请num人数 可获奖励券
|
||||
private Integer invitedNum;
|
||||
//奖励券
|
||||
private String rewardCoupon;
|
||||
//获取方法 get-新用户领取获得 use-新用户使用获得
|
||||
private String getMethod;
|
||||
|
||||
private Integer status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ShareCoupons> newCoupons;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ShareCoupons> rewardCoupons;
|
||||
|
||||
public void setNewCoupon(String newCoupon) {
|
||||
this.newCoupon = newCoupon;
|
||||
if(StringUtils.isNotBlank(newCoupon)){
|
||||
this.newCoupons = JSONUtil.parseJSONStrTList(newCoupon,ShareCoupons.class);
|
||||
}
|
||||
}
|
||||
|
||||
public void setRewardCoupon(String rewardCoupon) {
|
||||
this.rewardCoupon = rewardCoupon;
|
||||
if(StringUtils.isNotBlank(rewardCoupon)){
|
||||
this.rewardCoupons = JSONUtil.parseJSONStrTList(rewardCoupon,ShareCoupons.class);
|
||||
}
|
||||
}
|
||||
|
||||
public void setNewCoupons(List<ShareCoupons> newCoupons) {
|
||||
this.newCoupons = newCoupons;
|
||||
if(CollectionUtil.isNotEmpty(newCoupons)){
|
||||
this.newCoupon = JSONUtil.toJSONString(newCoupons);
|
||||
}
|
||||
}
|
||||
|
||||
public void setRewardCoupons(List<ShareCoupons> rewardCoupons) {
|
||||
this.rewardCoupons = rewardCoupons;
|
||||
if(CollectionUtil.isNotEmpty(rewardCoupons)){
|
||||
this.rewardCoupon = JSONUtil.toJSONString(rewardCoupons);
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ShareCoupons {
|
||||
//优惠券Id
|
||||
private Integer couponId;
|
||||
//优惠券名称
|
||||
private String couponName;
|
||||
//优惠券数量
|
||||
private Integer couponNum;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (TbShopShareRecord)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-11-08 09:17:37
|
||||
*/
|
||||
@Data
|
||||
@SuppressWarnings("serial")
|
||||
public class TbShopShareRecord extends Model<TbShopShareRecord> {
|
||||
|
||||
private Integer id;
|
||||
//tb_shop_share 主键Id
|
||||
private Integer shareId;
|
||||
//店铺Id
|
||||
private Integer shopId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String invitedHeadImg;
|
||||
//邀请人id
|
||||
private Integer invitedId;
|
||||
//邀请人名称
|
||||
private String invitedName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String beInvitedHeadImg;
|
||||
//被邀请人Id
|
||||
private Integer beInvitedId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String beInvitedName;
|
||||
//奖励券获得方式 get/use 领取获得/使用获得
|
||||
private String method;
|
||||
//0 非新用户 1 未领取 2 已领取 3 已使用
|
||||
private Integer status;
|
||||
//生效时间/获得奖励的时间
|
||||
private Date rewardTime;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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<TbUserStorage> {
|
||||
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;
|
||||
}
|
||||
|
|
@ -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<Activate> {
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue