青石-办公小程序后台初始化代码
This commit is contained in:
commit
c1c49429ce
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
<<<<<<< HEAD
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
=======
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
>>>>>>> firstcommit
|
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright 2007-present the original author or authors.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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.
|
||||
*/
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenWrapperDownloader {
|
||||
|
||||
private static final String WRAPPER_VERSION = "0.5.6";
|
||||
/**
|
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||
*/
|
||||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||
|
||||
/**
|
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||
* use instead of the default one.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||
".mvn/wrapper/maven-wrapper.properties";
|
||||
|
||||
/**
|
||||
* Path where the maven-wrapper.jar will be saved to.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||
".mvn/wrapper/maven-wrapper.jar";
|
||||
|
||||
/**
|
||||
* Name of the property which should be used to override the default download url for the wrapper.
|
||||
*/
|
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("- Downloader started");
|
||||
File baseDirectory = new File(args[0]);
|
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||
String url = DEFAULT_DOWNLOAD_URL;
|
||||
if(mavenWrapperPropertyFile.exists()) {
|
||||
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||
try {
|
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||
Properties mavenWrapperProperties = new Properties();
|
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||
} catch (IOException e) {
|
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||
} finally {
|
||||
try {
|
||||
if(mavenWrapperPropertyFileInputStream != null) {
|
||||
mavenWrapperPropertyFileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore ...
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading from: " + url);
|
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||
if(!outputFile.getParentFile().exists()) {
|
||||
if(!outputFile.getParentFile().mkdirs()) {
|
||||
System.out.println(
|
||||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||
try {
|
||||
downloadFileFromURL(url, outputFile);
|
||||
System.out.println("Done");
|
||||
System.exit(0);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("- Error downloading");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||
String username = System.getenv("MVNW_USERNAME");
|
||||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
});
|
||||
}
|
||||
URL website = new URL(urlString);
|
||||
ReadableByteChannel rbc;
|
||||
rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(destination);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
fos.close();
|
||||
rbc.close();
|
||||
}
|
||||
|
||||
}
|
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
Binary file not shown.
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
1
doc/trans_new_漫画翻译数据库文档_1.0.html
Normal file
1
doc/trans_new_漫画翻译数据库文档_1.0.html
Normal file
File diff suppressed because one or more lines are too long
275
pom.xml
Normal file
275
pom.xml
Normal file
@ -0,0 +1,275 @@
|
||||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.2.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.soft</groupId>
|
||||
<artifactId>soft</artifactId>
|
||||
<version>1.0</version>
|
||||
<name>soft</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-expression</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>5.2.3</version> <!-- 请根据需要选择版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>5.2.3</version> <!-- 请根据需要选择版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>4.1.2</version> <!-- 请根据需要选择版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlbeans</groupId>
|
||||
<artifactId>xmlbeans</artifactId>
|
||||
<version>5.0.2</version> <!-- 请根据需要选择版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<version>2.2.4.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.1.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.3</version> <!-- 替换为你想要使用的Jsoup版本 -->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.janeluo</groupId>
|
||||
<artifactId>ikanalyzer</artifactId>
|
||||
<version>2012_u6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.huaban</groupId>
|
||||
<artifactId>jieba-analysis</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
<version>1.60</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baidubce</groupId>
|
||||
<artifactId>bce-java-sdk</artifactId>
|
||||
<version>0.10.154</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.58</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib-ext-spring</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<!–<dependency>
|
||||
<groupId>io.github.swagger2markup</groupId>
|
||||
<artifactId>swagger2markup</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>–>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-core</artifactId>
|
||||
<version>1.5.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.5.16</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<!--swaggerui更新前-->
|
||||
<!-- <dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>swagger-bootstrap-ui</artifactId>
|
||||
<version>${swagger.ui.version}</version>
|
||||
</dependency>-->
|
||||
<!--更新后-->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<!--在引用时请在maven中央仓库搜索2.X最新版本号-->
|
||||
<version>2.0.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.pegdown</groupId>
|
||||
<artifactId>pegdown</artifactId>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.11.0</version> <!-- 请根据需要选择合适的版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>4.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12-beta-3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.4.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
|
||||
</plugin>
|
||||
<!--生成数据库文档 项目/doc/目录下-->
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
23
src/main/java/com/soft/SoftApplication.java
Normal file
23
src/main/java/com/soft/SoftApplication.java
Normal file
@ -0,0 +1,23 @@
|
||||
package com.soft;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAspectJAutoProxy
|
||||
@EnableScheduling
|
||||
public class SoftApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SoftApplication.class, args);
|
||||
// RedisTemplate<String,Object> redisTemplate= SpringBeanUtil.getBean(RedisTemplate.class);
|
||||
// redisTemplate.opsForValue().set("user1", new User1(2,"lumia"));
|
||||
// System.out.println(redisTemplate.opsForValue().getOperations().getExpire("user1"));
|
||||
// Object name = redisTemplate.opsForValue().get("shopping_car1");
|
||||
// System.out.println(name);
|
||||
|
||||
}
|
||||
}
|
23
src/main/java/com/soft/annotations/HasPermission.java
Normal file
23
src/main/java/com/soft/annotations/HasPermission.java
Normal file
@ -0,0 +1,23 @@
|
||||
package com.soft.annotations;
|
||||
|
||||
import com.soft.components.security.PermissionCalcType;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface HasPermission {
|
||||
String[] value();
|
||||
|
||||
PermissionCalcType calcType() default PermissionCalcType.OR;
|
||||
|
||||
/**
|
||||
* 用户ID的 SpEL 表达式(例如:#userId 或 #user.id)
|
||||
*/
|
||||
String userId() default "";
|
||||
}
|
13
src/main/java/com/soft/annotations/NotNull.java
Normal file
13
src/main/java/com/soft/annotations/NotNull.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.soft.annotations;
|
||||
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface NotNull {
|
||||
|
||||
String message() default "";
|
||||
|
||||
}
|
10
src/main/java/com/soft/annotations/Valid.java
Normal file
10
src/main/java/com/soft/annotations/Valid.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.soft.annotations;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Valid {
|
||||
|
||||
}
|
83
src/main/java/com/soft/aop/PermissionAspect.java
Normal file
83
src/main/java/com/soft/aop/PermissionAspect.java
Normal file
@ -0,0 +1,83 @@
|
||||
package com.soft.aop;
|
||||
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.soft.annotations.HasPermission;
|
||||
import com.soft.service.PermissionService;
|
||||
import com.sun.tools.example.debug.expr.ExpressionParser;
|
||||
import org.apache.hadoop.hbase.security.AccessDeniedException;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
import org.springframework.expression.EvaluationContext;
|
||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@Aspect
|
||||
public class PermissionAspect {
|
||||
|
||||
@Autowired
|
||||
private PermissionService permissionService; // 权限服务(需自行实现)
|
||||
|
||||
public PermissionAspect() {
|
||||
}
|
||||
|
||||
@Pointcut("@annotation(com.soft.annotations.HasPermission) && execution(public * *(..))")
|
||||
public void permissionPointCut() {
|
||||
}
|
||||
|
||||
@Around("permissionPointCut()")
|
||||
public Object permission(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
HasPermission hasPermission = method.getAnnotation(HasPermission.class);
|
||||
|
||||
// 1. 解析用户ID(通过SpEL表达式)
|
||||
String userIdSpEL = hasPermission.userId();
|
||||
String userId = parseUserId(joinPoint, method, userIdSpEL);
|
||||
|
||||
// 2. 校验权限
|
||||
if (!permissionService.hasPermission(
|
||||
userId,
|
||||
hasPermission.value(),
|
||||
hasPermission.calcType())) {
|
||||
throw new AccessDeniedException("用户[" + userId + "]无操作权限");
|
||||
}
|
||||
|
||||
// 3. 执行目标方法
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析SpEL表达式获取用户ID
|
||||
*/
|
||||
private String parseUserId(ProceedingJoinPoint joinPoint, Method method, String spEL) {
|
||||
if (StringUtils.isEmpty(spEL)) {
|
||||
// 默认从安全上下文获取当前用户ID(例如Spring Security)
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
return authentication.getName();
|
||||
}
|
||||
|
||||
// 使用Spring的SpEL解析器
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
EvaluationContext context = new StandardEvaluationContext();
|
||||
|
||||
// 将方法参数绑定到上下文
|
||||
Object[] args = joinPoint.getArgs();
|
||||
String[] paramNames = new DefaultParameterNameDiscoverer().getParameterNames(method);
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
context.setVariable(paramNames[i], args[i]);
|
||||
}
|
||||
// 解析表达式并获取用户ID
|
||||
return parser.parseExpression(spEL).getValue(context, String.class);
|
||||
}
|
||||
}
|
||||
|
4
src/main/java/com/soft/bo/SuperBo.java
Normal file
4
src/main/java/com/soft/bo/SuperBo.java
Normal file
@ -0,0 +1,4 @@
|
||||
package com.soft.bo;
|
||||
|
||||
public interface SuperBo {
|
||||
}
|
58
src/main/java/com/soft/bo/purchase/QueryPurchaseOrderBo.java
Normal file
58
src/main/java/com/soft/bo/purchase/QueryPurchaseOrderBo.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.soft.bo.purchase;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.soft.common.constants.StringPool;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QueryPurchaseOrderBo {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
@ApiModelProperty("单号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 销售金额
|
||||
*/
|
||||
@ApiModelProperty("销售金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 销售总商品数
|
||||
*/
|
||||
@ApiModelProperty("销售总商品数")
|
||||
private BigDecimal productAmount;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty("创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ApiModelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String productName;
|
||||
}
|
59
src/main/java/com/soft/bo/sale/QuerySaleOrderBo.java
Normal file
59
src/main/java/com/soft/bo/sale/QuerySaleOrderBo.java
Normal file
@ -0,0 +1,59 @@
|
||||
package com.soft.bo.sale;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.soft.common.constants.StringPool;
|
||||
import com.soft.entitys.voice.SaleOrder;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class QuerySaleOrderBo {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
@ApiModelProperty("单号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 销售金额
|
||||
*/
|
||||
@ApiModelProperty("销售金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 销售总商品数
|
||||
*/
|
||||
@ApiModelProperty("销售总商品数")
|
||||
private BigDecimal productAmount;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty("创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ApiModelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String productName;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.soft.common.constants;
|
||||
|
||||
public class ResponseConstants {
|
||||
public static final Integer INVOKE_RESULT_SUCCESS_CODE = 200;
|
||||
public static final Integer INVOKE_RESULT_FAIL_CODE_INPUT_ERROR = 400;
|
||||
public static final Integer INVOKE_RESULT_FAIL_CODE_AUTH_EXPIRED = 401;
|
||||
public static final Integer INVOKE_RESULT_FAIL_CODE_ACCESS_DENIED = 403;
|
||||
public static final Integer INVOKE_RESULT_FAIL_CODE_REPEAT_REQUEST = 410;
|
||||
public static final Integer INVOKE_RESULT_FAIL_USER_LOGIN_FAIL = 419;
|
||||
public static final Integer INVOKE_RESULT_FAIL_CODE = 500;
|
||||
public static final String INVOKE_RESULT_SUCCESS_MSG = "success";
|
||||
public static final String INVOKE_RESULT_FAIL_MSG = "fail";
|
||||
public static final String INVOKE_RESULT_ERROR_MSG = "系统出现内部错误,请联系系统管理员!";
|
||||
public static final String INVOKE_RESULT_ERROR_MSG_INPUT_ERROR = "传入参数有误!";
|
||||
public static final String INVOKE_RESULT_ERROR_MSG_AUTH_EXPIRED = "请重新登录!";
|
||||
public static final String INVOKE_RESULT_ERROR_MSG_ACCESS_DENIED = "无系统权限!";
|
||||
public static final String INVOKE_RESULT_ERROR_MSG_REPEAT_REQUEST = "请求过于频繁,请稍后再试!";
|
||||
|
||||
public ResponseConstants() {
|
||||
}
|
||||
}
|
9
src/main/java/com/soft/common/constants/StringPool.java
Normal file
9
src/main/java/com/soft/common/constants/StringPool.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.soft.common.constants;
|
||||
|
||||
public interface StringPool {
|
||||
String EXCEL_DATE_PATTERN = "yyyy/MM/dd";
|
||||
String DATE_PATTERN = "yyyy-MM-dd";
|
||||
String TIME_PATTERN = "HH:mm:ss";
|
||||
String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
|
||||
String DATE_TIME_HOUR_PATTER = "yyyy-MM-dd HH";
|
||||
}
|
8
src/main/java/com/soft/common/functions/SFunction.java
Normal file
8
src/main/java/com/soft/common/functions/SFunction.java
Normal file
@ -0,0 +1,8 @@
|
||||
package com.soft.common.functions;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.function.Function;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface SFunction<T, R> extends Function<T, R>, Serializable {
|
||||
}
|
21
src/main/java/com/soft/common/security/UserDetails.java
Normal file
21
src/main/java/com/soft/common/security/UserDetails.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.soft.common.security;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface UserDetails extends Serializable {
|
||||
String getPassword();
|
||||
|
||||
String getUsername();
|
||||
|
||||
boolean isAccountNonExpired();
|
||||
|
||||
boolean isAccountNonLocked();
|
||||
|
||||
boolean isCredentialsNonExpired();
|
||||
|
||||
boolean isEnabled();
|
||||
|
||||
boolean isAdmin();
|
||||
|
||||
boolean hasAdminPermission();
|
||||
}
|
21
src/main/java/com/soft/common/util/DateUtils.java
Normal file
21
src/main/java/com/soft/common/util/DateUtils.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.soft.common.util;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
|
||||
public class DateUtils {
|
||||
// Date 转 LocalDateTime(默认时区)
|
||||
public static LocalDateTime toLocalDateTime(Date date) {
|
||||
if (date == null) return null;
|
||||
return date.toInstant()
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDateTime();
|
||||
}
|
||||
|
||||
// LocalDateTime 转 Date(按需反向转换)
|
||||
public static Date toDate(LocalDateTime localDateTime) {
|
||||
if (localDateTime == null) return null;
|
||||
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.soft.components.security;
|
||||
|
||||
public enum PermissionCalcType {
|
||||
OR,
|
||||
AND;
|
||||
|
||||
private PermissionCalcType() {
|
||||
}
|
||||
}
|
||||
|
17
src/main/java/com/soft/config/BeanConfig.java
Normal file
17
src/main/java/com/soft/config/BeanConfig.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.soft.config;
|
||||
|
||||
import com.soft.utils.SpringBeanUtil;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
@Configuration
|
||||
@Order(25)
|
||||
public class BeanConfig {
|
||||
|
||||
@Bean
|
||||
public SpringBeanUtil getSpringBeanUtil(){
|
||||
return new SpringBeanUtil();
|
||||
}
|
||||
|
||||
}
|
64
src/main/java/com/soft/config/DateConverterConfig.java
Normal file
64
src/main/java/com/soft/config/DateConverterConfig.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.soft.config;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.jackson.JsonComponent;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@Component
|
||||
public class DateConverterConfig implements Converter<String, Date> {
|
||||
|
||||
|
||||
private static final String YYYY_MM_DD = "yyyy-MM-dd";
|
||||
private static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
@JsonComponent
|
||||
public static class DateJsonSerializer extends JsonSerializer<Date> {
|
||||
@Override
|
||||
public void serialize(Date date, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
|
||||
SimpleDateFormat sdf=new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
|
||||
jsonGenerator.writeString(sdf.format(date));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date convert(String source) {
|
||||
if (StringUtils.isBlank(source)) {
|
||||
return null;
|
||||
}
|
||||
source = source.trim();
|
||||
if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")){
|
||||
return parseDate(source, YYYY_MM_DD);
|
||||
}else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")){
|
||||
return parseDate(source, YYYY_MM_DD_HH_MM_SS);
|
||||
}else {
|
||||
throw new IllegalArgumentException("Invalid false value '" + source + "'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化日期
|
||||
* @param dateStr String 字符型日期
|
||||
* @param format String 格式
|
||||
* @return Date 日期
|
||||
*/
|
||||
private Date parseDate(String dateStr, String format) {
|
||||
Date date;
|
||||
try {
|
||||
DateFormat dateFormat = new SimpleDateFormat(format);
|
||||
date = dateFormat.parse(dateStr);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(e.getLocalizedMessage());
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
}
|
69
src/main/java/com/soft/config/DruidConfig.java
Normal file
69
src/main/java/com/soft/config/DruidConfig.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.soft.config;
|
||||
|
||||
import com.alibaba.druid.support.http.StatViewServlet;
|
||||
import com.alibaba.druid.support.http.WebStatFilter;
|
||||
import com.alibaba.druid.support.spring.stat.DruidStatInterceptor;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
import org.springframework.aop.support.JdkRegexpMethodPointcut;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Configuration
|
||||
@Order(1)
|
||||
public class DruidConfig {
|
||||
|
||||
@Bean
|
||||
public ServletRegistrationBean druidServlet() {
|
||||
ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
|
||||
Map<String,String> initParam = new HashMap<>();
|
||||
initParam.put("loginUsername","druid");
|
||||
initParam.put("loginPassword","123456");
|
||||
initParam.put("allow",""); //默认就是允许所有访问
|
||||
initParam.put("deny",""); //默认访问
|
||||
servletRegistrationBean.setInitParameters(initParam);
|
||||
return servletRegistrationBean;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean webStatFilter() {
|
||||
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
|
||||
filterRegistrationBean.setFilter(new WebStatFilter());
|
||||
Map<String, String> initParams = new HashMap<>();
|
||||
initParams.put("exclusions", "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*");
|
||||
filterRegistrationBean.setInitParameters(initParams);
|
||||
filterRegistrationBean.addUrlPatterns("/*");
|
||||
filterRegistrationBean.setOrder(2);
|
||||
filterRegistrationBean.setName("webStatFilter");
|
||||
return filterRegistrationBean;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DruidStatInterceptor druidStatInterceptor() {
|
||||
DruidStatInterceptor dsInterceptor = new DruidStatInterceptor();
|
||||
return dsInterceptor;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Scope("prototype")
|
||||
public JdkRegexpMethodPointcut druidStatPointcut() {
|
||||
JdkRegexpMethodPointcut pointcut = new JdkRegexpMethodPointcut();
|
||||
pointcut.setPattern("com.soft.mapper.*");
|
||||
return pointcut;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DefaultPointcutAdvisor druidStatAdvisor(DruidStatInterceptor druidStatInterceptor, JdkRegexpMethodPointcut druidStatPointcut) {
|
||||
DefaultPointcutAdvisor defaultPointAdvisor = new DefaultPointcutAdvisor();
|
||||
defaultPointAdvisor.setPointcut(druidStatPointcut);
|
||||
defaultPointAdvisor.setAdvice(druidStatInterceptor);
|
||||
return defaultPointAdvisor;
|
||||
}
|
||||
|
||||
}
|
121
src/main/java/com/soft/config/RedisConfig.java
Normal file
121
src/main/java/com/soft/config/RedisConfig.java
Normal file
@ -0,0 +1,121 @@
|
||||
package com.soft.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
import org.springframework.data.redis.cache.RedisCacheManager;
|
||||
import org.springframework.data.redis.cache.RedisCacheWriter;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.*;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
//@RefreshScope
|
||||
@Configuration
|
||||
@Order(20)
|
||||
public class RedisConfig {
|
||||
|
||||
@Bean
|
||||
//如使用注解的话需要配置cacheManager
|
||||
CacheManager cacheManager(RedisConnectionFactory connectionFactory) {
|
||||
//初始化一个RedisCacheWriter
|
||||
RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory);
|
||||
RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig();
|
||||
//设置默认超过期时间是1天
|
||||
//defaultCacheConfig.entryTtl(Duration.ofDays(1));
|
||||
defaultCacheConfig.entryTtl(Duration.ofDays(-1));
|
||||
//初始化RedisCacheManager
|
||||
RedisCacheManager cacheManager = new RedisCacheManager(redisCacheWriter, defaultCacheConfig);
|
||||
return cacheManager;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
|
||||
|
||||
RedisTemplate<String, Object> template = new RedisTemplate<>(); // 配置连接工厂
|
||||
template.setConnectionFactory(factory); //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
|
||||
Jackson2JsonRedisSerializer jacksonSerial = new Jackson2JsonRedisSerializer(Object.class);
|
||||
|
||||
ObjectMapper om = new ObjectMapper(); // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
|
||||
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
|
||||
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
|
||||
jacksonSerial.setObjectMapper(om); // 值采用json序列化
|
||||
template.setValueSerializer(jacksonSerial); //使用StringRedisSerializer来序列化和反序列化redis的key值
|
||||
template.setKeySerializer(new StringRedisSerializer()); // 设置hash key 和value序列化模式
|
||||
template.setHashKeySerializer(new StringRedisSerializer());
|
||||
template.setHashValueSerializer(jacksonSerial);
|
||||
template.afterPropertiesSet();
|
||||
return template;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对hash类型的数据操作
|
||||
*
|
||||
* @param redisTemplate
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Bean
|
||||
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForHash();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对redis字符串类型数据操作
|
||||
*
|
||||
* @param redisTemplate
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Bean
|
||||
public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对链表类型的数据操作
|
||||
*
|
||||
* @param redisTemplate
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Bean
|
||||
public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对无序集合类型的数据操作
|
||||
*
|
||||
* @param redisTemplate
|
||||
* @return
|
||||
*/
|
||||
|
||||
|
||||
@Bean
|
||||
public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对有序集合类型的数据操作
|
||||
*
|
||||
* @param redisTemplate
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForZSet();
|
||||
}
|
||||
|
||||
|
||||
}
|
40
src/main/java/com/soft/config/SecurityConfig.java
Normal file
40
src/main/java/com/soft/config/SecurityConfig.java
Normal file
@ -0,0 +1,40 @@
|
||||
package com.soft.config;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@Order(0)
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests()
|
||||
.antMatchers("/**").permitAll() // 所有路径无需认证
|
||||
.anyRequest().permitAll()
|
||||
.and()
|
||||
.csrf().disable(); // 禁用CSRF
|
||||
}
|
||||
|
||||
// 可选:忽略静态资源(如果不需要认证)
|
||||
@Override
|
||||
public void configure(WebSecurity web) throws Exception {
|
||||
web.ignoring().antMatchers("/static/**");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder() {
|
||||
return new BCryptPasswordEncoder(BCryptPasswordEncoder.BCryptVersion.$2A, 10);
|
||||
}
|
||||
}
|
77
src/main/java/com/soft/config/SwaggerConfig.java
Normal file
77
src/main/java/com/soft/config/SwaggerConfig.java
Normal file
@ -0,0 +1,77 @@
|
||||
package com.soft.config;
|
||||
|
||||
import com.soft.enums.AuthEnum;
|
||||
import com.soft.enums.CommEnum;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.builders.ResponseMessageBuilder;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.service.ResponseMessage;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@Order(55)
|
||||
public class SwaggerConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Value("http:localhost:${server.port:8088}")
|
||||
private String url;
|
||||
|
||||
@Bean
|
||||
public Docket docketCommon() {
|
||||
List<ResponseMessage> responseMessageList = new ArrayList<>();
|
||||
Arrays.stream(CommEnum.values()).forEach(enums -> {
|
||||
responseMessageList.add(
|
||||
new ResponseMessageBuilder().code(enums.getCode()).message(enums.getMessage()).build()
|
||||
);
|
||||
});
|
||||
Arrays.stream(AuthEnum.values()).forEach(enums -> {
|
||||
responseMessageList.add(
|
||||
new ResponseMessageBuilder().code(enums.getCode()).message(enums.getMessage()).build()
|
||||
);
|
||||
});
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.globalResponseMessage(RequestMethod.GET, responseMessageList)
|
||||
.globalResponseMessage(RequestMethod.POST, responseMessageList)
|
||||
.globalResponseMessage(RequestMethod.PUT, responseMessageList)
|
||||
.globalResponseMessage(RequestMethod.DELETE, responseMessageList)
|
||||
.groupName("soft").select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.soft.controller"))
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
.apiInfo(new ApiInfoBuilder().
|
||||
title("soft API").
|
||||
description("接口API").
|
||||
contact(new Contact("", "", "")).termsOfServiceUrl(url).
|
||||
version("1.0").
|
||||
build());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests()
|
||||
// 限制 Swagger 路径需要 ADMIN 权限
|
||||
.antMatchers("/swagger-ui/**", "/v3/api-docs/**").hasRole("ADMIN")
|
||||
// 其他接口放行
|
||||
.anyRequest().permitAll()
|
||||
.and()
|
||||
// 启用 Basic 认证(浏览器弹窗登录)
|
||||
.httpBasic();
|
||||
}
|
||||
|
||||
}
|
27
src/main/java/com/soft/config/TransDataSourceConfig.java
Normal file
27
src/main/java/com/soft/config/TransDataSourceConfig.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.soft.config;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
@Configuration
|
||||
@MapperScan(basePackages = "com.soft.mapper")
|
||||
@Order(10)
|
||||
public class TransDataSourceConfig {
|
||||
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource")
|
||||
public DataSource getDataSource() {
|
||||
return new DruidDataSource();
|
||||
}
|
||||
|
||||
|
||||
}
|
16
src/main/java/com/soft/config/UnifiedResultErrorConfig.java
Normal file
16
src/main/java/com/soft/config/UnifiedResultErrorConfig.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.soft.config;
|
||||
|
||||
import com.soft.resp.Result;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
@RestControllerAdvice
|
||||
public class UnifiedResultErrorConfig {
|
||||
|
||||
@ExceptionHandler(value = RuntimeException.class)
|
||||
public Result exception(RuntimeException e){
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
|
||||
}
|
29
src/main/java/com/soft/config/WebConfiguration.java
Normal file
29
src/main/java/com/soft/config/WebConfiguration.java
Normal file
@ -0,0 +1,29 @@
|
||||
package com.soft.config;
|
||||
|
||||
import com.soft.filter.CrossFilter;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* @description WebConfiguration
|
||||
* @author TDW
|
||||
* @date 2021年3月4日
|
||||
*
|
||||
*/
|
||||
//@Configuration
|
||||
public class WebConfiguration implements WebMvcConfigurer {
|
||||
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Bean
|
||||
public FilterRegistrationBean crossFilter(CrossFilter crossFilter) {
|
||||
FilterRegistrationBean registrationBean = new FilterRegistrationBean(crossFilter);
|
||||
registrationBean.setFilter(crossFilter);
|
||||
registrationBean.addUrlPatterns("/*");
|
||||
registrationBean.setOrder(1);
|
||||
registrationBean.setName("crossFilter");
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
}
|
52
src/main/java/com/soft/controller/AgentController.java
Normal file
52
src/main/java/com/soft/controller/AgentController.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.soft.controller;
|
||||
|
||||
import com.soft.dto.UserIdDTO;
|
||||
import com.soft.resp.Result;
|
||||
import com.soft.entitys.user.User;
|
||||
import com.soft.mapper.UserMapper;
|
||||
import com.soft.service.AgentService;
|
||||
import com.soft.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/agent")
|
||||
@Api(tags = "代理中心api")
|
||||
public class AgentController {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(com.soft.controller.AgentController.class);
|
||||
|
||||
@Autowired
|
||||
private AgentService agentService;
|
||||
|
||||
@Autowired
|
||||
private UserMapper userMapper;
|
||||
|
||||
@GetMapping("/getAgentLevelList")
|
||||
@ApiOperation(value = "代理等级和利润")
|
||||
public Result<List<AgentLevelVo>> getAgentLevelList(){
|
||||
|
||||
return Result.success(agentService.getAgentLevelList());
|
||||
}
|
||||
|
||||
@PostMapping("/getMySilverAgent")
|
||||
@ApiOperation(value = "我的银牌代理")
|
||||
public Result<List<User>> getMySilverAgent(@RequestBody UserIdDTO userIdDTO){
|
||||
|
||||
return Result.success(userMapper.getMySilverAgent(userIdDTO.getUserId()));
|
||||
}
|
||||
|
||||
@PostMapping("/getMyGoldMedalAgent")
|
||||
@ApiOperation(value = "我的金牌代理")
|
||||
public Result<List<User>> getMyGoldMedalAgent(@RequestBody UserIdDTO userIdDTO){
|
||||
|
||||
return Result.success(userMapper.getMyGoldMedalAgent(userIdDTO.getUserId()));
|
||||
}
|
||||
|
||||
}
|
31
src/main/java/com/soft/controller/BaseController.java
Normal file
31
src/main/java/com/soft/controller/BaseController.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.soft.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.soft.vo.page.PageVo;
|
||||
|
||||
public abstract class BaseController {
|
||||
public BaseController() {
|
||||
}
|
||||
|
||||
public int getPageIndex(PageVo vo) {
|
||||
return !ObjectUtil.isNull(vo) && !ObjectUtil.isNull(vo.getPageIndex()) && vo.getPageIndex() > 0 ? vo.getPageIndex() : 1;
|
||||
}
|
||||
|
||||
public int getPageSize(PageVo vo) {
|
||||
return !ObjectUtil.isNull(vo) && !ObjectUtil.isNull(vo.getPageSize()) && vo.getPageSize() > 0 ? vo.getPageSize() : 20;
|
||||
}
|
||||
|
||||
public int getPageIndex() {
|
||||
return this.getPageIndex((PageVo)null);
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return this.getPageSize((PageVo)null);
|
||||
}
|
||||
|
||||
public int getExportSize() {
|
||||
return 2000;
|
||||
}
|
||||
|
||||
}
|
||||
|
115
src/main/java/com/soft/controller/PurchaseOrderController.java
Normal file
115
src/main/java/com/soft/controller/PurchaseOrderController.java
Normal file
@ -0,0 +1,115 @@
|
||||
package com.soft.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.soft.annotations.HasPermission;
|
||||
import com.soft.annotations.Valid;
|
||||
import com.soft.bo.purchase.QueryPurchaseOrderBo;
|
||||
import com.soft.dto.ApprovePassOrderDTO;
|
||||
import com.soft.entitys.voice.Product;
|
||||
import com.soft.entitys.voice.PurchaseOrderDetail;
|
||||
import com.soft.entitys.voice.SaleOrder;
|
||||
import com.soft.enums.OrderStatus;
|
||||
import com.soft.resp.InvokeResult;
|
||||
import com.soft.resp.InvokeResultBuilder;
|
||||
import com.soft.service.ProductService;
|
||||
import com.soft.service.PurchaseOrderDetailService;
|
||||
import com.soft.service.PurchaseOrderService;
|
||||
import com.soft.utils.PageResult;
|
||||
import com.soft.utils.PageResultUtil;
|
||||
import com.soft.utils.convert.purchase.QueryPurchaseOrderBOUtil;
|
||||
import com.soft.vo.sale.QuerySaleOrderVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.soft.resp.Result;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/purchase/order")
|
||||
@Api(tags = "采购订单")
|
||||
public class PurchaseOrderController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private PurchaseOrderService purchaseOrderService;
|
||||
|
||||
@Autowired
|
||||
private PurchaseOrderDetailService purchaseOrderDetailService;
|
||||
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
|
||||
/**
|
||||
* 根据状态查询采购订单总数
|
||||
*/
|
||||
@ApiOperation("根据状态查询采购订单总数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "订单审核状态(0-待审核,3-审核通过,6-审核拒绝)", name = "status", paramType = "query")})
|
||||
@GetMapping("/total")
|
||||
public Result queryPurchaseTotal(
|
||||
Integer status) {
|
||||
if (OrderStatus.valueOfCode(status) == null){
|
||||
return Result.success(0);
|
||||
}
|
||||
Integer total = purchaseOrderService.getOrderSumByStatus(status);
|
||||
return Result.success(total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 采购订单审核
|
||||
*/
|
||||
@ApiOperation("采购订单审核")
|
||||
@HasPermission(
|
||||
value = {"sale:order:approve"},
|
||||
userId = "#approveOrder.sysUserId" // 使用SpEL引用方法参数
|
||||
)
|
||||
@GetMapping("/approve")
|
||||
public Result approvePass(@RequestBody @Valid ApprovePassOrderDTO dto) {
|
||||
purchaseOrderService.approvePass(dto);
|
||||
return Result.success();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未审核采购订单列表
|
||||
*/
|
||||
@ApiOperation("查询未审核采购订单列表")
|
||||
@GetMapping("/pendList")
|
||||
public InvokeResult<PageResult<QueryPurchaseOrderBo>> pendApproveList(QuerySaleOrderVo vo) {
|
||||
PageResult<SaleOrder> pageResult = purchaseOrderService.pendApproveList(getPageIndex(vo), getPageSize(vo), vo.getStatus());
|
||||
|
||||
List<SaleOrder> datas = pageResult.getDatas();
|
||||
List<QueryPurchaseOrderBo> results = null;
|
||||
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QueryPurchaseOrderBOUtil::toQueryPurchaseOrderBo).collect(Collectors.toList());
|
||||
}
|
||||
//商品名称处理
|
||||
if(results!=null){
|
||||
for (QueryPurchaseOrderBo result : results) {
|
||||
List<PurchaseOrderDetail> orderDetails=purchaseOrderDetailService.getByOrderId(result.getId());
|
||||
|
||||
List<String> productNames = new ArrayList<>();
|
||||
for (PurchaseOrderDetail orderDetail : orderDetails) {
|
||||
Product product= productService.findById(orderDetail.getProductId());
|
||||
if (product != null && product.getName() != null) {
|
||||
productNames.add(product.getName());
|
||||
}
|
||||
|
||||
}
|
||||
result.setProductName(String.join(", ", productNames));
|
||||
}
|
||||
}
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
}
|
130
src/main/java/com/soft/controller/SaleOrderController.java
Normal file
130
src/main/java/com/soft/controller/SaleOrderController.java
Normal file
@ -0,0 +1,130 @@
|
||||
package com.soft.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.soft.annotations.HasPermission;
|
||||
import com.soft.annotations.Valid;
|
||||
import com.soft.bo.sale.QuerySaleOrderBo;
|
||||
import com.soft.dto.ApprovePassOrderDTO;
|
||||
import com.soft.dto.SysUserDTO;
|
||||
import com.soft.entitys.voice.Product;
|
||||
import com.soft.entitys.voice.SaleOrder;
|
||||
import com.soft.entitys.voice.SaleOrderDetail;
|
||||
import com.soft.enums.OrderStatus;
|
||||
import com.soft.resp.InvokeResult;
|
||||
import com.soft.resp.InvokeResultBuilder;
|
||||
import com.soft.service.ProductService;
|
||||
import com.soft.service.SaleOrderDetailService;
|
||||
import com.soft.service.SaleOrderService;
|
||||
import com.soft.service.SysUserService;
|
||||
import com.soft.utils.PageResult;
|
||||
import com.soft.utils.PageResultUtil;
|
||||
import com.soft.utils.convert.sale.QuerySaleOrderBOUtil;
|
||||
import com.soft.vo.sale.QuerySaleOrderVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.soft.resp.Result;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "销售订单")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/sale/order")
|
||||
public class SaleOrderController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private SaleOrderService saleOrderService;
|
||||
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Autowired
|
||||
private SaleOrderDetailService saleOrderDetailService;
|
||||
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
/**
|
||||
* 根据状态查询销售订单总数
|
||||
*/
|
||||
@ApiOperation("根据状态查询销售订单总数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "订单审核状态(0-待审核,3-审核通过,6-审核拒绝)", name = "status", paramType = "query")})
|
||||
@GetMapping("/total")
|
||||
public Result querySaleTotal(
|
||||
Integer status) {
|
||||
if (OrderStatus.valueOfCode(status) == null){
|
||||
return Result.success(0);
|
||||
}
|
||||
Integer total = saleOrderService.getOrderSumByStatus(status);
|
||||
return Result.success(total);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 销售订单审核
|
||||
*/
|
||||
@ApiOperation("销售订单审核")
|
||||
@HasPermission(
|
||||
value = {"sale:order:approve"}, //判断用户是否具有审核权限
|
||||
userId = "#approveOrder.sysUserId" // 使用SpEL引用方法参数
|
||||
)
|
||||
@GetMapping("/approve")
|
||||
public Result approvePass(@RequestBody @Valid ApprovePassOrderDTO approveOrder) {
|
||||
//1. 查询用户id 关联的后台用户id; 3.判断订单是否存在,且状态是否是已审核状态
|
||||
SysUserDTO sysUserDTO = sysUserService.selectById(approveOrder.getSysUserId());
|
||||
if (sysUserDTO == null){
|
||||
return Result.fail("系统用户不存在,请检查后重试!");
|
||||
}
|
||||
// 审核 修改订单状态
|
||||
saleOrderService.approve(approveOrder.getOrderId(), approveOrder.getSysUserId());
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未审核销售订单
|
||||
*/
|
||||
@ApiOperation("查询未审核销售订单列表")
|
||||
@GetMapping("/pendList")
|
||||
public InvokeResult<PageResult<QuerySaleOrderBo>> pendApproveList(QuerySaleOrderVo vo) {
|
||||
PageResult<SaleOrder> pageResult = saleOrderService.pendApproveList(getPageIndex(vo), getPageSize(vo), vo.getStatus());
|
||||
|
||||
List<SaleOrder> datas = pageResult.getDatas();
|
||||
List<QuerySaleOrderBo> results = null;
|
||||
|
||||
//转换
|
||||
if (!CollectionUtil.isEmpty(datas)) {
|
||||
results = datas.stream().map(QuerySaleOrderBOUtil::toQuerySaleOrderBo).collect(Collectors.toList());
|
||||
}
|
||||
//商品名称处理
|
||||
if(results!=null){
|
||||
for (QuerySaleOrderBo result : results) {
|
||||
List<SaleOrderDetail> orderDetails=saleOrderDetailService.getBySaleOrderId(result.getId());
|
||||
|
||||
List<String> productNames = new ArrayList<>();
|
||||
for (SaleOrderDetail orderDetail : orderDetails) {
|
||||
Product product= productService.findById(orderDetail.getProductId());
|
||||
if (product != null && product.getName() != null) {
|
||||
productNames.add(product.getName());
|
||||
}
|
||||
|
||||
}
|
||||
result.setProductName(String.join(", ", productNames));
|
||||
}
|
||||
}
|
||||
return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
39
src/main/java/com/soft/controller/SoftController.java
Normal file
39
src/main/java/com/soft/controller/SoftController.java
Normal file
@ -0,0 +1,39 @@
|
||||
package com.soft.controller;
|
||||
|
||||
import com.soft.dto.SaveDemandDTO;
|
||||
import com.soft.resp.Result;
|
||||
import com.soft.service.DemandService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/soft")
|
||||
@Api(tags = "api")
|
||||
public class SoftController {
|
||||
|
||||
@Autowired
|
||||
private DemandService demandService;
|
||||
|
||||
|
||||
@PostMapping("/saveSoftWareDemand")
|
||||
@ApiOperation(value = "提交表单")
|
||||
public Result saveSoftWareDemand(@RequestBody SaveDemandDTO saveDemandDTO) {
|
||||
if (saveDemandDTO == null) {
|
||||
return Result.isEmpty();
|
||||
}
|
||||
Integer result=demandService.saveSoftWareDemand(saveDemandDTO);
|
||||
|
||||
if(result>0){
|
||||
return Result.success("ok");
|
||||
}else{
|
||||
return Result.fail("fail");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
103
src/main/java/com/soft/controller/UserController.java
Normal file
103
src/main/java/com/soft/controller/UserController.java
Normal file
@ -0,0 +1,103 @@
|
||||
package com.soft.controller;
|
||||
|
||||
import com.soft.dto.BindPhoneNumberDTO;
|
||||
import com.soft.dto.WeChatLoginRequestDTO;
|
||||
import com.soft.resp.Result;
|
||||
import com.soft.entitys.user.SystemUser;
|
||||
import com.soft.dto.SysUserDTO;
|
||||
import com.soft.entitys.user.User;
|
||||
import com.soft.service.SysUserService;
|
||||
import com.soft.service.UserService;
|
||||
import com.soft.vo.BindPhoneVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
@Api(tags = "用户api")
|
||||
public class UserController {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
|
||||
|
||||
@PostMapping("/wxLogin")
|
||||
@ApiOperation(value = "微信授权登录")
|
||||
public Result<Map<String, Object>> login(@RequestBody WeChatLoginRequestDTO weChatLoginRequestDTO) {
|
||||
|
||||
if(weChatLoginRequestDTO==null){
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<String, Object> userInfoMap = userService.getUserInfoMap(weChatLoginRequestDTO);
|
||||
|
||||
return Result.success(userInfoMap);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/getPhoneNumber")
|
||||
@ApiOperation(value = "绑定手机号及上级")
|
||||
public Result<BindPhoneVo> getPhoneNumber(@RequestBody BindPhoneNumberDTO bindPhoneNumberDto){
|
||||
if(bindPhoneNumberDto==null){
|
||||
return null;
|
||||
}
|
||||
|
||||
return Result.success(userService.getPhoneNumber(bindPhoneNumberDto.getCode(),bindPhoneNumberDto.getPid(),bindPhoneNumberDto.getUId(),bindPhoneNumberDto.getType()));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/bindSysUser")
|
||||
@ApiOperation(value = "绑定后台系统用户")
|
||||
public Result<String> bindSysUser(@RequestBody SystemUser systemUser){
|
||||
User user = userService.queryByOpenId(systemUser.getOpenId());
|
||||
if (user == null ){
|
||||
return Result.fail("用户未登录,请先登录!");
|
||||
}
|
||||
String[] tmpArr = systemUser.getUsername().split("@");
|
||||
if (tmpArr.length <= 1) {
|
||||
throw new RuntimeException("用户名或密码错误!");
|
||||
}
|
||||
String tenantId = tmpArr[0];
|
||||
String username = tmpArr[1];
|
||||
systemUser.setUsername(username);
|
||||
|
||||
SysUserDTO sysUserDTO = sysUserService.query(systemUser);
|
||||
if(sysUserDTO == null ){
|
||||
return Result.fail("绑定失败,系统用户不存在!");
|
||||
}
|
||||
// 查询系统用户是否已经被绑定
|
||||
User user1 = userService.queryBySysUserId(sysUserDTO.getId());
|
||||
if (Objects.nonNull(user1)){
|
||||
return Result.fail("系统用户已被绑定!");
|
||||
}
|
||||
|
||||
User updateUser = new User();
|
||||
updateUser.setId(user.getId());
|
||||
updateUser.setSysUserId(sysUserDTO.getId());
|
||||
int update = userService.updateUserById(updateUser);
|
||||
if (update > 0 ){
|
||||
return Result.success("绑定成功!");
|
||||
}
|
||||
return Result.fail("绑定失败,请排查!");
|
||||
}
|
||||
|
||||
@GetMapping("/query")
|
||||
@ApiOperation(value = "查询用户信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "小程序用户id", name = "id", paramType = "query")})
|
||||
public Result<User> bindSysUser(Integer id){
|
||||
User user = userService.getUserById(id);
|
||||
return Result.success(user);
|
||||
}
|
||||
|
||||
}
|
192
src/main/java/com/soft/controller/VoiceQueryController.java
Normal file
192
src/main/java/com/soft/controller/VoiceQueryController.java
Normal file
@ -0,0 +1,192 @@
|
||||
package com.soft.controller;
|
||||
|
||||
import com.soft.dto.OrderProportionDto;
|
||||
import com.soft.dto.StatisticsProductStockDto;
|
||||
import com.soft.dto.VoiceQueryDto;
|
||||
import com.soft.entitys.Page;
|
||||
import com.soft.entitys.QueryParams;
|
||||
import com.soft.resp.Result;
|
||||
import com.soft.service.VoiceQueryService;
|
||||
import com.soft.utils.UnsupportedQueryException;
|
||||
import com.soft.utils.VoiceQueryParser;
|
||||
import com.soft.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/voice")
|
||||
@Api(tags = "语音api")
|
||||
public class VoiceQueryController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private VoiceQueryService voiceQueryService;
|
||||
|
||||
|
||||
private final VoiceQueryParser queryParser;
|
||||
|
||||
public VoiceQueryController(VoiceQueryService voiceQueryService) {
|
||||
this.queryParser = new VoiceQueryParser();
|
||||
this.voiceQueryService = voiceQueryService;
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/handleVoiceQuery")
|
||||
@ApiOperation(value = "语音助手")
|
||||
public Result handleVoiceQuery(@RequestBody VoiceQueryDto voiceQueryDto) {
|
||||
// 1. 解析语音文本
|
||||
|
||||
try {
|
||||
QueryParams params = queryParser.parse(voiceQueryDto.getText());
|
||||
|
||||
// 2. 执行查询
|
||||
return Result.success(voiceQueryService.processQuery(params));
|
||||
}catch (UnsupportedQueryException e){
|
||||
// Map<String, Object> errorResponse = new HashMap<>();
|
||||
// errorResponse.put("error", "不支持的查询类型");
|
||||
// errorResponse.put("received", voiceQueryDto.getText());
|
||||
// errorResponse.put("message", "请尝试以下查询类型:今日采购订单金额、今日销售订单金额");
|
||||
|
||||
return Result.fail("请尝试以下查询类型:今日采购订单、今日销售订单");
|
||||
|
||||
}catch (Exception e) {
|
||||
// 其他异常返回500
|
||||
return Result.fail("其他错误,请稍后重试!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/statisticsTodaysOrderData")
|
||||
@ApiOperation(value = "今日-销售与采购情况")
|
||||
public Result<OrderDataVo> statisticsTodaysOrderData() {
|
||||
|
||||
OrderDataVo orderDataVo=voiceQueryService.statisticsTodaysOrderData();
|
||||
|
||||
return Result.success(orderDataVo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/statisticsMonthOrderData")
|
||||
@ApiOperation(value = "近30日-销售与采购情况")
|
||||
public Result<OrderDataMonthVo> statisticsMonthOrderData() {
|
||||
|
||||
OrderDataMonthVo orderDataVo=voiceQueryService.statisticsMonthOrderData();
|
||||
|
||||
return Result.success(orderDataVo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/statisticsWeekOrderData")
|
||||
@ApiOperation(value = "近7日-销售与采购情况")
|
||||
public Result<OrderDataMonthVo> statisticsWeekOrderData() {
|
||||
|
||||
OrderDataWeekVo orderDataVo=voiceQueryService.statisticsWeekOrderData();
|
||||
|
||||
return Result.success(orderDataVo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/orderMonthContrast")
|
||||
@ApiOperation(value = "每月-订单对比分析")
|
||||
public Result<OrderMonthContrastVo> orderMonthContrast() {
|
||||
|
||||
OrderMonthContrastVo orderContrastVo=voiceQueryService.orderMonthContrast();
|
||||
|
||||
return Result.success(orderContrastVo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/orderTodaysContrast")
|
||||
@ApiOperation(value = "每日-订单对比分析")
|
||||
public Result<OrderTodaysContrastVo> orderTodaysContrast() {
|
||||
|
||||
OrderTodaysContrastVo orderContrastVo=voiceQueryService.orderTodaysContrast();
|
||||
|
||||
return Result.success(orderContrastVo);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/orderProportion")
|
||||
@ApiOperation(value = "订单占比")
|
||||
public Result<OrderProportionVo> orderProportion(@RequestBody OrderProportionDto orderProportionDto) {
|
||||
|
||||
OrderProportionVo orderProportionVo=voiceQueryService.orderProportion(orderProportionDto);
|
||||
|
||||
return Result.success(orderProportionVo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/productProductStockProportion")
|
||||
@ApiOperation(value = "商品库存占比")
|
||||
public Result<List<ProductStockProportionVo>> productProductStockProportion() {
|
||||
|
||||
List<ProductStockProportionVo> list=voiceQueryService.productProductStockProportion();
|
||||
|
||||
return Result.success(list);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/saleSalerMonthRank")
|
||||
@ApiOperation(value = "本月-销售人员排名")
|
||||
public Result<List<SaleSalerRankVo>> saleSalerMonthRank() {
|
||||
|
||||
List<SaleSalerRankVo> list=voiceQueryService.saleSalerMonthRank();
|
||||
|
||||
return Result.success(list);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/saleSalerWeekRank")
|
||||
@ApiOperation(value = "本周-销售人员排名")
|
||||
public Result<List<SaleSalerRankVo>> saleSalerWeekRank() {
|
||||
|
||||
List<SaleSalerRankVo> list=voiceQueryService.saleSalerWeekRank();
|
||||
|
||||
return Result.success(list);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/saleOrderGrossMargin")
|
||||
@ApiOperation(value = "最近12个月-销售毛利分析")
|
||||
public Result<SaleOrderGrossMarginVo> saleOrderGrossMargin() {
|
||||
|
||||
SaleOrderGrossMarginVo saleOrderGrossMarginVo=voiceQueryService.saleOrderGrossMargin();
|
||||
|
||||
return Result.success(saleOrderGrossMarginVo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/saleOrderLastYearProfit")
|
||||
@ApiOperation(value = "去年-销售毛利分析")
|
||||
public Result<SaleOrderLastYearProfitVo> saleOrderLastYearProfit() {
|
||||
|
||||
SaleOrderLastYearProfitVo saleOrderLastYearProfitVo=voiceQueryService.saleOrderLastYearProfit();
|
||||
|
||||
return Result.success(saleOrderLastYearProfitVo);
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/saleOrderCurrentYearAmount")
|
||||
@ApiOperation(value = "年度累计销售额,销售数量,销售成本,毛利率")
|
||||
public Result<SaleOrderCurrentYearAmountVo> saleOrderCurrentYearAmount() {
|
||||
|
||||
SaleOrderCurrentYearAmountVo saleOrderCurrentYearAmountVo=voiceQueryService.saleOrderCurrentYearAmount();
|
||||
|
||||
return Result.success(saleOrderCurrentYearAmountVo);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/statisticsProductStock")
|
||||
@ApiOperation(value = "商品库存")
|
||||
public Result<Page<List<ProductStockDataVo>>> statisticsProductStock(@RequestBody StatisticsProductStockDto statisticsProductStockDto) {
|
||||
|
||||
Page<List<ProductStockDataVo>> list=voiceQueryService.statisticsProductStock(statisticsProductStockDto);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
18
src/main/java/com/soft/dto/ApprovePassOrderDTO.java
Normal file
18
src/main/java/com/soft/dto/ApprovePassOrderDTO.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.soft.dto;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
|
||||
@Data
|
||||
public class ApprovePassOrderDTO {
|
||||
|
||||
@ApiModelProperty(value = "订单id",required = true)
|
||||
@NonNull
|
||||
private String orderId;
|
||||
|
||||
@ApiModelProperty(value = "审核人-后台用户Id",required = true)
|
||||
@NonNull
|
||||
private String sysUserId;
|
||||
}
|
4
src/main/java/com/soft/dto/BaseDto.java
Normal file
4
src/main/java/com/soft/dto/BaseDto.java
Normal file
@ -0,0 +1,4 @@
|
||||
package com.soft.dto;
|
||||
|
||||
public interface BaseDto {
|
||||
}
|
21
src/main/java/com/soft/dto/BindPhoneNumberDTO.java
Normal file
21
src/main/java/com/soft/dto/BindPhoneNumberDTO.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BindPhoneNumberDTO {
|
||||
|
||||
@ApiModelProperty(value = "code",required = true)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "推荐人ID")
|
||||
private Integer pid;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer uId;
|
||||
|
||||
@ApiModelProperty(value = "推广类型 1:推广代理")
|
||||
private Integer type;
|
||||
|
||||
}
|
11
src/main/java/com/soft/dto/OrderProportionDto.java
Normal file
11
src/main/java/com/soft/dto/OrderProportionDto.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderProportionDto {
|
||||
|
||||
@ApiModelProperty(value = "月份")
|
||||
private Integer month;
|
||||
}
|
14
src/main/java/com/soft/dto/PageUtilDTO.java
Normal file
14
src/main/java/com/soft/dto/PageUtilDTO.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PageUtilDTO {
|
||||
|
||||
@ApiModelProperty(value = "起始页")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty(value = "一页数量")
|
||||
private Integer pageSize;
|
||||
}
|
51
src/main/java/com/soft/dto/SaveDemandDTO.java
Normal file
51
src/main/java/com/soft/dto/SaveDemandDTO.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SaveDemandDTO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "公司名")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty(value = "公司地址")
|
||||
private String companyAddress;
|
||||
|
||||
@ApiModelProperty(value = "对接人")
|
||||
private String person;
|
||||
|
||||
@ApiModelProperty(value = "对接人手机号")
|
||||
private String personPhone;
|
||||
|
||||
@ApiModelProperty(value = "需要使用的系统")
|
||||
private String demandSystem;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "公司类型")
|
||||
private String companyType;
|
||||
|
||||
@ApiModelProperty(value = "公司规模")
|
||||
private String companyScale;
|
||||
|
||||
@ApiModelProperty(value = "公司经营范围")
|
||||
private String companyScope;
|
||||
|
||||
@ApiModelProperty(value = "公司组织架构")
|
||||
private String companyFramework;
|
||||
|
||||
@ApiModelProperty(value = "公司业务范围")
|
||||
private String companyBusinessScope;
|
||||
|
||||
@ApiModelProperty(value = "意向代理级别")
|
||||
private String agentLevel;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
}
|
14
src/main/java/com/soft/dto/StatisticsProductStockDto.java
Normal file
14
src/main/java/com/soft/dto/StatisticsProductStockDto.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StatisticsProductStockDto {
|
||||
|
||||
@ApiModelProperty(value = "起始页",required = true)
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty(value = "一页数量",required = true)
|
||||
private Integer pageSize;
|
||||
}
|
91
src/main/java/com/soft/dto/SysUserDTO.java
Normal file
91
src/main/java/com/soft/dto/SysUserDTO.java
Normal file
@ -0,0 +1,91 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-04
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user")
|
||||
public class SysUserDTO {
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
|
||||
/**
|
||||
* 状态 1-在用 0停用
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 锁定状态
|
||||
*/
|
||||
private Boolean lockStatus;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
private String updateById;
|
||||
|
||||
private Date updateTime;
|
||||
}
|
11
src/main/java/com/soft/dto/UserIdDTO.java
Normal file
11
src/main/java/com/soft/dto/UserIdDTO.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserIdDTO {
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
}
|
9
src/main/java/com/soft/dto/VoiceQueryDto.java
Normal file
9
src/main/java/com/soft/dto/VoiceQueryDto.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VoiceQueryDto {
|
||||
|
||||
private String text;
|
||||
}
|
17
src/main/java/com/soft/dto/WeChatLoginRequestDTO.java
Normal file
17
src/main/java/com/soft/dto/WeChatLoginRequestDTO.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.soft.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WeChatLoginRequestDTO {
|
||||
|
||||
@ApiModelProperty(value = "微信code", required = true)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "用户敏感字段",required = true)
|
||||
private String encryptedData;
|
||||
|
||||
@ApiModelProperty(value = "解密向量",required = true)
|
||||
private String iv;
|
||||
}
|
35
src/main/java/com/soft/entitys/BaseEntity.java
Normal file
35
src/main/java/com/soft/entitys/BaseEntity.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.soft.entitys;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public abstract class BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public BaseEntity() {
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof BaseEntity)) {
|
||||
return false;
|
||||
} else {
|
||||
BaseEntity other = (BaseEntity)o;
|
||||
return other.canEqual(this);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof BaseEntity;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
boolean result = true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "BaseEntity()";
|
||||
}
|
||||
}
|
||||
|
55
src/main/java/com/soft/entitys/OrderChart.java
Normal file
55
src/main/java/com/soft/entitys/OrderChart.java
Normal file
@ -0,0 +1,55 @@
|
||||
package com.soft.entitys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-11-19
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_order_chart")
|
||||
public class OrderChart extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单据总金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 创建时间(小时)
|
||||
*/
|
||||
private String createHour;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private int bizType;
|
||||
}
|
47
src/main/java/com/soft/entitys/OrderPayType.java
Normal file
47
src/main/java/com/soft/entitys/OrderPayType.java
Normal file
@ -0,0 +1,47 @@
|
||||
package com.soft.entitys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2023-03-28
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_order_pay_type")
|
||||
public class OrderPayType {
|
||||
|
||||
public static final String CACHE_NAME = "OrderPayType";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 支付方式ID
|
||||
*/
|
||||
private String payTypeId;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 支付内容
|
||||
*/
|
||||
private String text;
|
||||
}
|
119
src/main/java/com/soft/entitys/Page.java
Normal file
119
src/main/java/com/soft/entitys/Page.java
Normal file
@ -0,0 +1,119 @@
|
||||
package com.soft.entitys;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class Page<T> {
|
||||
|
||||
@ApiModelProperty("当前页数")
|
||||
private int pageNum;
|
||||
|
||||
@ApiModelProperty("总记录数")
|
||||
private int total;
|
||||
|
||||
@ApiModelProperty("总页数")
|
||||
private int pageTotal;
|
||||
|
||||
@ApiModelProperty("一页记录数")
|
||||
private int pageSize;
|
||||
|
||||
@ApiModelProperty("当前页记录数")
|
||||
private int size;
|
||||
|
||||
@ApiModelProperty("是否还有下一页")
|
||||
private boolean hasNext;
|
||||
|
||||
@ApiModelProperty("数据记录")
|
||||
private T data;
|
||||
|
||||
public Page(int pageNum, int total, int pageSize, T data){
|
||||
this.pageNum=pageNum;
|
||||
this.pageSize=pageSize;
|
||||
this.total = total;
|
||||
this.data=data;
|
||||
int model=total%pageSize;
|
||||
boolean bool=model==0;
|
||||
int pageTotal=bool?total/pageSize:total/pageSize+1;
|
||||
this.pageTotal=pageTotal;
|
||||
if(pageTotal>pageNum){
|
||||
this.hasNext=true;
|
||||
this.size=pageSize;
|
||||
}else if(pageTotal==pageNum){
|
||||
this.size=bool?pageSize:model;
|
||||
}
|
||||
}
|
||||
|
||||
public Page(){
|
||||
|
||||
}
|
||||
|
||||
public static Integer getStartNum(Integer pageNum, Integer pageSize){
|
||||
return (pageNum-1)*pageSize;
|
||||
}
|
||||
|
||||
public static String sqlLimit(Integer pageNum, Integer pageSize){
|
||||
Integer startNum=getStartNum(pageNum,pageSize);
|
||||
return "LIMIT "+startNum+","+pageSize;
|
||||
}
|
||||
|
||||
public int getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(int pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
int pageTotal=total%pageSize==0?total/pageSize:total/pageSize+1;
|
||||
this.pageTotal=pageTotal;
|
||||
if(pageTotal>pageNum){
|
||||
hasNext=true;
|
||||
}
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public int getPageTotal() {
|
||||
return pageTotal;
|
||||
}
|
||||
|
||||
public void setPageTotal(int pageTotal) {
|
||||
this.pageTotal = pageTotal;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public boolean isHasNext() {
|
||||
return hasNext;
|
||||
}
|
||||
|
||||
public void setHasNext(boolean hasNext) {
|
||||
this.hasNext = hasNext;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
}
|
18
src/main/java/com/soft/entitys/QueryParams.java
Normal file
18
src/main/java/com/soft/entitys/QueryParams.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.soft.entitys;
|
||||
|
||||
import com.soft.enums.QueryType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class QueryParams {
|
||||
|
||||
private QueryType type;
|
||||
private String productName;
|
||||
private String userName;
|
||||
private LocalDate date;
|
||||
private String customerName;
|
||||
private String queryDate; // 新增查询日期字段
|
||||
|
||||
}
|
56
src/main/java/com/soft/entitys/demand/Demand.java
Normal file
56
src/main/java/com/soft/entitys/demand/Demand.java
Normal file
@ -0,0 +1,56 @@
|
||||
package com.soft.entitys.demand;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("soft_demand")
|
||||
@Api(tags = "表单收集表")
|
||||
public class Demand {
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "公司名")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty(value = "公司地址")
|
||||
private String companyAddress;
|
||||
|
||||
@ApiModelProperty(value = "对接人")
|
||||
private String person;
|
||||
|
||||
@ApiModelProperty(value = "对接人手机号")
|
||||
private String personPhone;
|
||||
|
||||
@ApiModelProperty(value = "需要使用的系统")
|
||||
private String demandSystem;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "公司类型")
|
||||
private String companyType;
|
||||
|
||||
@ApiModelProperty(value = "公司规模")
|
||||
private String companyScale;
|
||||
|
||||
@ApiModelProperty(value = "公司经营范围")
|
||||
private String companyScope;
|
||||
|
||||
@ApiModelProperty(value = "公司组织架构")
|
||||
private String companyFramework;
|
||||
|
||||
@ApiModelProperty(value = "公司业务范围")
|
||||
private String companyBusinessScope;
|
||||
|
||||
@ApiModelProperty(value = "意向代理级别")
|
||||
private String agentLevel;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.soft.entitys.purchase;
|
||||
|
||||
public class PurchaseOrderStatus {
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.soft.entitys.sale;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2023-05-26
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_sale_order_detail_bundle")
|
||||
public class SaleOrderDetailBundle{
|
||||
|
||||
public static final String CACHE_NAME = "SaleOrderDetailBundle";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 销售单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 明细ID
|
||||
*/
|
||||
private String detailId;
|
||||
|
||||
/**
|
||||
* 组合商品ID
|
||||
*/
|
||||
private String mainProductId;
|
||||
|
||||
/**
|
||||
* 组合商品数量
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 单品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 单品数量
|
||||
*/
|
||||
private Integer productOrderNum;
|
||||
|
||||
/**
|
||||
* 单品原价
|
||||
*/
|
||||
private BigDecimal productOriPrice;
|
||||
|
||||
/**
|
||||
* 单品含税价格
|
||||
*/
|
||||
private BigDecimal productTaxPrice;
|
||||
|
||||
/**
|
||||
* 单品税率
|
||||
*/
|
||||
private BigDecimal productTaxRate;
|
||||
|
||||
/**
|
||||
* 单品明细ID
|
||||
*/
|
||||
private String productDetailId;
|
||||
}
|
148
src/main/java/com/soft/entitys/sys/SysMenu.java
Normal file
148
src/main/java/com/soft/entitys/sys/SysMenu.java
Normal file
@ -0,0 +1,148 @@
|
||||
package com.soft.entitys.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.soft.enums.system.SysMenuComponentType;
|
||||
import com.soft.enums.system.SysMenuDisplay;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统菜单
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-05-10
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_menu")
|
||||
public class SysMenu {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String CACHE_NAME = "SysMenu";
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称(前端使用)
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 组件类型
|
||||
*/
|
||||
private SysMenuComponentType componentType;
|
||||
|
||||
/**
|
||||
* 组件(前端使用)
|
||||
*/
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 自定义请求参数
|
||||
*/
|
||||
private String requestParam;
|
||||
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 路由路径(前端使用)
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 是否缓存(前端使用)
|
||||
*/
|
||||
private Boolean noCache;
|
||||
|
||||
/**
|
||||
* 类型 0-目录 1-菜单 2-功能
|
||||
*/
|
||||
private SysMenuDisplay display;
|
||||
|
||||
/**
|
||||
* 是否隐藏(前端使用)
|
||||
*/
|
||||
private Boolean hidden;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
private String permission;
|
||||
|
||||
/**
|
||||
* 是否特殊菜单
|
||||
*/
|
||||
private Boolean isSpecial;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
36
src/main/java/com/soft/entitys/sys/SysRoleMenu.java
Normal file
36
src/main/java/com/soft/entitys/sys/SysRoleMenu.java
Normal file
@ -0,0 +1,36 @@
|
||||
package com.soft.entitys.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-04
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_role_menu")
|
||||
public class SysRoleMenu{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private String menuId;
|
||||
|
||||
|
||||
}
|
34
src/main/java/com/soft/entitys/sys/SysUserRole.java
Normal file
34
src/main/java/com/soft/entitys/sys/SysUserRole.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.soft.entitys.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-04
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user_role")
|
||||
public class SysUserRole{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
}
|
35
src/main/java/com/soft/entitys/user/Agent.java
Normal file
35
src/main/java/com/soft/entitys/user/Agent.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.soft.entitys.user;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("soft_agent")
|
||||
@Api(tags = "代理表")
|
||||
public class Agent {
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "代理类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "代理等级")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty(value = "利润返点")
|
||||
private String profitRebate;
|
||||
|
||||
@ApiModelProperty(value = "利润比率")
|
||||
private String profit;
|
||||
|
||||
@ApiModelProperty(value = "升级所需")
|
||||
private Integer count;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Date addTime;
|
||||
|
||||
}
|
31
src/main/java/com/soft/entitys/user/Category.java
Normal file
31
src/main/java/com/soft/entitys/user/Category.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.soft.entitys.user;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("soft_category")
|
||||
@Api(tags = "分类表")
|
||||
public class Category {
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "pid")
|
||||
private Integer pid;
|
||||
|
||||
@ApiModelProperty(value = "栏目类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "栏目名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
}
|
36
src/main/java/com/soft/entitys/user/SystemUser.java
Normal file
36
src/main/java/com/soft/entitys/user/SystemUser.java
Normal file
@ -0,0 +1,36 @@
|
||||
package com.soft.entitys.user;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("sys_user")
|
||||
@Api(tags = "系统用户表")
|
||||
public class SystemUser {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "微信用户openId", required = true)
|
||||
@NotBlank(message = "微信用户openId不能为空!")
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名", required = true)
|
||||
@NotBlank(message = "用户名不能为空!")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码", required = true)
|
||||
@NotBlank(message = "密码不能为空!")
|
||||
private String password;
|
||||
}
|
50
src/main/java/com/soft/entitys/user/User.java
Normal file
50
src/main/java/com/soft/entitys/user/User.java
Normal file
@ -0,0 +1,50 @@
|
||||
package com.soft.entitys.user;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("soft_user")
|
||||
@Api(tags = "用户表")
|
||||
public class User {
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "绑定ID")
|
||||
private Integer pid;
|
||||
|
||||
@ApiModelProperty(value = "推广员关联时间")
|
||||
private Date spreadTime;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
private String nickName;
|
||||
|
||||
@ApiModelProperty(value = "等级")
|
||||
private Integer levelId;
|
||||
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String avatar;
|
||||
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "小程序唯一标识")
|
||||
private String openId;//小程序唯一标识
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "最后一次登录时间")
|
||||
private Date lastLoginTime;
|
||||
|
||||
@ApiModelProperty(value = "后台系统用户地id")
|
||||
private String sysUserId;
|
||||
}
|
136
src/main/java/com/soft/entitys/voice/Customer.java
Normal file
136
src/main/java/com/soft/entitys/voice/Customer.java
Normal file
@ -0,0 +1,136 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("base_data_customer")
|
||||
public class Customer {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
private String mnemonicCode;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
private String zipCode;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String creditCode;
|
||||
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
private String taxIdentifyNo;
|
||||
|
||||
/**
|
||||
* 开户银行
|
||||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 户名
|
||||
*/
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 银行账号
|
||||
*/
|
||||
private String accountNo;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
117
src/main/java/com/soft/entitys/voice/Product.java
Normal file
117
src/main/java/com/soft/entitys/voice/Product.java
Normal file
@ -0,0 +1,117 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.soft.enums.ProductType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_product")
|
||||
public class Product {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* SKU
|
||||
*/
|
||||
private String skuCode;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
private String externalCode;
|
||||
|
||||
/**
|
||||
* 分类ID
|
||||
*/
|
||||
private String categoryId;
|
||||
|
||||
/**
|
||||
* 品牌ID
|
||||
*/
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
private int productType;
|
||||
|
||||
|
||||
/**
|
||||
* 进项税率(%)
|
||||
*/
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 销项税率(%)
|
||||
*/
|
||||
private BigDecimal saleTaxRate;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 重量(kg)
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 体积(cm3)
|
||||
*/
|
||||
private BigDecimal volume;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
private String createById;
|
||||
|
||||
private String createBy;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
private String updateById;
|
||||
|
||||
private Date updateTime;
|
||||
}
|
50
src/main/java/com/soft/entitys/voice/ProductStock.java
Normal file
50
src/main/java/com/soft/entitys/voice/ProductStock.java
Normal file
@ -0,0 +1,50 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-09-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_product_stock")
|
||||
public class ProductStock {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private String scId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private Integer stockNum;
|
||||
|
||||
/**
|
||||
* 含税价格
|
||||
*/
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
/**
|
||||
* 含税金额
|
||||
*/
|
||||
private BigDecimal taxAmount;
|
||||
}
|
94
src/main/java/com/soft/entitys/voice/ProductStockLog.java
Normal file
94
src/main/java/com/soft/entitys/voice/ProductStockLog.java
Normal file
@ -0,0 +1,94 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("tbl_product_stock_log")
|
||||
public class ProductStockLog{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private String scId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 原库存数量
|
||||
*/
|
||||
private Integer oriStockNum;
|
||||
|
||||
/**
|
||||
* 现库存数量
|
||||
*/
|
||||
private Integer curStockNum;
|
||||
|
||||
/**
|
||||
* 原含税成本价
|
||||
*/
|
||||
private BigDecimal oriTaxPrice;
|
||||
|
||||
/**
|
||||
* 现含税成本价
|
||||
*/
|
||||
private BigDecimal curTaxPrice;
|
||||
|
||||
/**
|
||||
* 变动库存数量
|
||||
*/
|
||||
private Integer stockNum;
|
||||
|
||||
/**
|
||||
* 变动含税金额
|
||||
*/
|
||||
private BigDecimal taxAmount;
|
||||
|
||||
|
||||
private String createById;
|
||||
|
||||
|
||||
private String createBy;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 业务单据ID
|
||||
*/
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 业务单据号
|
||||
*/
|
||||
private String bizCode;
|
||||
|
||||
/**
|
||||
* 业务单据明细ID
|
||||
*/
|
||||
private String bizDetailId;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private Integer bizType;
|
||||
|
||||
|
||||
}
|
135
src/main/java/com/soft/entitys/voice/PurchaseOrder.java
Normal file
135
src/main/java/com/soft/entitys/voice/PurchaseOrder.java
Normal file
@ -0,0 +1,135 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-09-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_purchase_order")
|
||||
public class PurchaseOrder{
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private String scId;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private String supplierId;
|
||||
|
||||
/**
|
||||
* 采购员ID
|
||||
*/
|
||||
private String purchaserId;
|
||||
|
||||
/**
|
||||
* 预计到货日期
|
||||
*/
|
||||
private LocalDate expectArriveDate;
|
||||
|
||||
/**
|
||||
* 采购数量
|
||||
*/
|
||||
private Integer totalNum;
|
||||
|
||||
/**
|
||||
* 赠品数量
|
||||
*/
|
||||
private Integer totalGiftNum;
|
||||
|
||||
/**
|
||||
* 采购金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String approveBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date approveTime;
|
||||
|
||||
/**
|
||||
* 订单审核状态
|
||||
*/
|
||||
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
private String refuseReason;
|
||||
|
||||
/**
|
||||
* 关联订单号
|
||||
*/
|
||||
private String linkNumber;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-09-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_purchase_order_detail")
|
||||
public class PurchaseOrderDetail {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 采购数量
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
/**
|
||||
* 是否赠品
|
||||
*/
|
||||
private Boolean isGift;
|
||||
|
||||
/**
|
||||
* 税率(%)
|
||||
*/
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序编号
|
||||
*/
|
||||
private Integer orderNo;
|
||||
|
||||
/**
|
||||
* 已收货数量
|
||||
*/
|
||||
private Integer receiveNum;
|
||||
}
|
128
src/main/java/com/soft/entitys/voice/PurchaseReturn.java
Normal file
128
src/main/java/com/soft/entitys/voice/PurchaseReturn.java
Normal file
@ -0,0 +1,128 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-10-16
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_purchase_return")
|
||||
public class PurchaseReturn {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private String scId;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private String supplierId;
|
||||
|
||||
/**
|
||||
* 采购员ID
|
||||
*/
|
||||
private String purchaserId;
|
||||
|
||||
/**
|
||||
* 付款日期
|
||||
*/
|
||||
private LocalDate paymentDate;
|
||||
|
||||
/**
|
||||
* 收货单ID
|
||||
*/
|
||||
private String receiveSheetId;
|
||||
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer totalNum;
|
||||
|
||||
/**
|
||||
* 赠品数量
|
||||
*/
|
||||
private Integer totalGiftNum;
|
||||
|
||||
/**
|
||||
* 退货金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String approveBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date approveTime;
|
||||
|
||||
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
private String refuseReason;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-10-16
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_purchase_return_detail")
|
||||
public class PurchaseReturnDetail {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 收货单ID
|
||||
*/
|
||||
private String returnId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 退货数量
|
||||
*/
|
||||
private Integer returnNum;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
/**
|
||||
* 是否赠品
|
||||
*/
|
||||
private Boolean isGift;
|
||||
|
||||
/**
|
||||
* 税率(%)
|
||||
*/
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序编号
|
||||
*/
|
||||
private Integer orderNo;
|
||||
|
||||
/**
|
||||
* 收货单明细ID
|
||||
*/
|
||||
private String receiveSheetDetailId;
|
||||
|
||||
|
||||
}
|
155
src/main/java/com/soft/entitys/voice/SaleOrder.java
Normal file
155
src/main/java/com/soft/entitys/voice/SaleOrder.java
Normal file
@ -0,0 +1,155 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("tbl_sale_order")
|
||||
public class SaleOrder {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private String scId;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
private String customerId;
|
||||
|
||||
/**
|
||||
* 销售员ID
|
||||
*/
|
||||
private String salerId;
|
||||
|
||||
/**
|
||||
* 销售数量
|
||||
*/
|
||||
private Integer totalNum;
|
||||
|
||||
/**
|
||||
* 赠品数量
|
||||
*/
|
||||
private Integer totalGiftNum;
|
||||
|
||||
/**
|
||||
* 销售金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
|
||||
private String createBy;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String approveBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date approveTime;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
private String refuseReason;
|
||||
|
||||
/**
|
||||
* 本单利润
|
||||
*/
|
||||
private BigDecimal thisOrderProfit;
|
||||
|
||||
/**
|
||||
* 客户费用
|
||||
*/
|
||||
private BigDecimal customMoney;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
private BigDecimal purchaseDecimal;
|
||||
|
||||
/**
|
||||
* 采购总价
|
||||
*/
|
||||
private BigDecimal totalPurchasePrice;
|
||||
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
private BigDecimal shippingFee;
|
||||
|
||||
/**
|
||||
* 是否租赁订单
|
||||
*/
|
||||
private Integer isLease;
|
||||
|
||||
|
||||
private Integer purchaseStatus;
|
||||
|
||||
/**
|
||||
* 租赁起始日期
|
||||
*/
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date leaseStartTime;
|
||||
|
||||
/**
|
||||
* 租赁结束日期
|
||||
*/
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date leaseEndTime;
|
||||
}
|
102
src/main/java/com/soft/entitys/voice/SaleOrderDetail.java
Normal file
102
src/main/java/com/soft/entitys/voice/SaleOrderDetail.java
Normal file
@ -0,0 +1,102 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-10-21
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_sale_order_detail")
|
||||
public class SaleOrderDetail {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 销售数量
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal oriPrice;
|
||||
|
||||
/**
|
||||
* 现价
|
||||
*/
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
/**
|
||||
* 折扣率(%)
|
||||
*/
|
||||
private BigDecimal discountRate;
|
||||
|
||||
/**
|
||||
* 是否赠品
|
||||
*/
|
||||
private Boolean isGift;
|
||||
|
||||
/**
|
||||
* 税率(%)
|
||||
*/
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序编号
|
||||
*/
|
||||
private Integer orderNo;
|
||||
|
||||
/**
|
||||
* 已出库数量
|
||||
*/
|
||||
private Integer outNum;
|
||||
|
||||
/**
|
||||
* 组合商品原始明细ID
|
||||
*/
|
||||
private String oriBundleDetailId;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
private BigDecimal purchaseDecimal;
|
||||
|
||||
/**
|
||||
* 采购总价
|
||||
*/
|
||||
private BigDecimal totalPurchasePrice;
|
||||
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private String scId;
|
||||
}
|
120
src/main/java/com/soft/entitys/voice/SaleOutSheet.java
Normal file
120
src/main/java/com/soft/entitys/voice/SaleOutSheet.java
Normal file
@ -0,0 +1,120 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-10-26
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_sale_out_sheet")
|
||||
public class SaleOutSheet {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private String scId;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
private String customerId;
|
||||
|
||||
/**
|
||||
* 销售员ID
|
||||
*/
|
||||
private String salerId;
|
||||
|
||||
/**
|
||||
* 付款日期
|
||||
*/
|
||||
private Date paymentDate;
|
||||
|
||||
/**
|
||||
* 销售单ID
|
||||
*/
|
||||
private String saleOrderId;
|
||||
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer totalNum;
|
||||
|
||||
/**
|
||||
* 赠品数量
|
||||
*/
|
||||
private Integer totalGiftNum;
|
||||
|
||||
/**
|
||||
* 出库金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
|
||||
private String createById;
|
||||
|
||||
|
||||
private String createBy;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
|
||||
private String updateBy;
|
||||
|
||||
|
||||
private String updateById;
|
||||
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String approveBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date approveTime;
|
||||
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
private String refuseReason;
|
||||
|
||||
/**
|
||||
* 结算状态
|
||||
*/
|
||||
private Integer settleStatus;
|
||||
|
||||
|
||||
}
|
99
src/main/java/com/soft/entitys/voice/SaleOutSheetDetail.java
Normal file
99
src/main/java/com/soft/entitys/voice/SaleOutSheetDetail.java
Normal file
@ -0,0 +1,99 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-10-26
|
||||
*/
|
||||
@Data
|
||||
@TableName("tbl_sale_out_sheet_detail")
|
||||
public class SaleOutSheetDetail {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 出库单ID
|
||||
*/
|
||||
private String sheetId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal oriPrice;
|
||||
|
||||
/**
|
||||
* 现价
|
||||
*/
|
||||
private BigDecimal taxPrice;
|
||||
|
||||
/**
|
||||
* 折扣率(%)
|
||||
*/
|
||||
private BigDecimal discountRate;
|
||||
|
||||
/**
|
||||
* 是否赠品
|
||||
*/
|
||||
private Boolean isGift;
|
||||
|
||||
/**
|
||||
* 税率(%)
|
||||
*/
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序编号
|
||||
*/
|
||||
private Integer orderNo;
|
||||
|
||||
/**
|
||||
* 结算状态
|
||||
*/
|
||||
private Integer settleStatus;
|
||||
|
||||
/**
|
||||
* 销售订单明细ID
|
||||
*/
|
||||
private String saleOrderDetailId;
|
||||
|
||||
/**
|
||||
* 已退货数量
|
||||
*/
|
||||
private Integer returnNum;
|
||||
|
||||
/**
|
||||
* 组合商品原始明细ID
|
||||
*/
|
||||
private String oriBundleDetailId;
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private String scId;
|
||||
}
|
148
src/main/java/com/soft/entitys/voice/SettleCheckSheet.java
Normal file
148
src/main/java/com/soft/entitys/voice/SettleCheckSheet.java
Normal file
@ -0,0 +1,148 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-12-02
|
||||
*/
|
||||
@Data
|
||||
@TableName("settle_check_sheet")
|
||||
public class SettleCheckSheet {
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private String supplierId;
|
||||
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 应付金额
|
||||
*/
|
||||
private BigDecimal totalPayAmount;
|
||||
|
||||
/**
|
||||
* 已付金额
|
||||
*/
|
||||
private BigDecimal totalPayedAmount;
|
||||
|
||||
/**
|
||||
* 已优惠金额
|
||||
*/
|
||||
private BigDecimal totalDiscountAmount;
|
||||
|
||||
/**
|
||||
* 起始时间
|
||||
*/
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String approveBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date approveTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
private String refuseReason;
|
||||
|
||||
/**
|
||||
* 结算状态
|
||||
*/
|
||||
private Integer settleStatus;
|
||||
|
||||
/**
|
||||
* 应付
|
||||
*/
|
||||
private BigDecimal numberOne;
|
||||
|
||||
|
||||
/**
|
||||
* 已付
|
||||
*/
|
||||
private BigDecimal numberTwo;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-12-02
|
||||
*/
|
||||
@Data
|
||||
@TableName("settle_check_sheet_detail")
|
||||
public class SettleCheckSheetDetail {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 对账单ID
|
||||
*/
|
||||
private String sheetId;
|
||||
|
||||
/**
|
||||
* 单据ID
|
||||
*/
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private Integer bizType;
|
||||
|
||||
/**
|
||||
* 计算方式
|
||||
*/
|
||||
private Integer calcType;
|
||||
|
||||
/**
|
||||
* 应付金额
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序编号
|
||||
*/
|
||||
private Integer orderNo;
|
||||
|
||||
|
||||
}
|
121
src/main/java/com/soft/entitys/voice/SettleSheet.java
Normal file
121
src/main/java/com/soft/entitys/voice/SettleSheet.java
Normal file
@ -0,0 +1,121 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-12-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("settle_sheet")
|
||||
public class SettleSheet {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private String supplierId;
|
||||
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 已优惠金额
|
||||
*/
|
||||
private BigDecimal totalDiscountAmount;
|
||||
|
||||
/**
|
||||
* 起始时间
|
||||
*/
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String approveBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date approveTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
private String refuseReason;
|
||||
}
|
57
src/main/java/com/soft/entitys/voice/SettleSheetDetail.java
Normal file
57
src/main/java/com/soft/entitys/voice/SettleSheetDetail.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-12-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("settle_sheet_detail")
|
||||
public class SettleSheetDetail {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 结算单ID
|
||||
*/
|
||||
private String sheetId;
|
||||
|
||||
/**
|
||||
* 单据ID
|
||||
*/
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 实付金额
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序编号
|
||||
*/
|
||||
private Integer orderNo;
|
||||
|
||||
|
||||
}
|
108
src/main/java/com/soft/entitys/voice/StoreCenter.java
Normal file
108
src/main/java/com/soft/entitys/voice/StoreCenter.java
Normal file
@ -0,0 +1,108 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_store_center")
|
||||
public class StoreCenter {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系人手机号码
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 仓库人数
|
||||
*/
|
||||
private Integer peopleNum;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
}
|
164
src/main/java/com/soft/entitys/voice/Supplier.java
Normal file
164
src/main/java/com/soft/entitys/voice/Supplier.java
Normal file
@ -0,0 +1,164 @@
|
||||
package com.soft.entitys.voice;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zmj
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_data_supplier")
|
||||
public class Supplier {
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简码
|
||||
*/
|
||||
private String mnemonicCode;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
private String zipCode;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* 地区ID
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 送货周期(天)
|
||||
*/
|
||||
private Integer deliveryCycle;
|
||||
|
||||
/**
|
||||
* 经营方式
|
||||
*/
|
||||
private Integer manageType;
|
||||
|
||||
/**
|
||||
* 结算方式
|
||||
*/
|
||||
private Integer settleType;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String creditCode;
|
||||
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
private String taxIdentifyNo;
|
||||
|
||||
/**
|
||||
* 开户银行
|
||||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 户名
|
||||
*/
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 银行账号
|
||||
*/
|
||||
private String accountNo;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean available;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人ID 新增时赋值
|
||||
*/
|
||||
|
||||
private String createById;
|
||||
|
||||
/**
|
||||
* 创建人 新增时赋值
|
||||
*/
|
||||
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间 新增时赋值
|
||||
*/
|
||||
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改人ID 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private String updateById;
|
||||
|
||||
/**
|
||||
* 修改时间 新增和修改时赋值
|
||||
*/
|
||||
|
||||
private Date updateTime;
|
||||
}
|
24
src/main/java/com/soft/enums/AuthEnum.java
Normal file
24
src/main/java/com/soft/enums/AuthEnum.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.soft.enums;
|
||||
|
||||
import com.soft.utils.ResultUtil;
|
||||
|
||||
public enum AuthEnum {
|
||||
|
||||
NOT_AUTHENTICATION(ResultUtil.NOT_AUTHENTICATION_CODE),
|
||||
LOGIN_TOKEN_INVALID(ResultUtil.LOGIN_TOKEN_INVALID_CODE);
|
||||
private AuthEnum(int code){
|
||||
this.code=code;
|
||||
this.message=ResultUtil.getMessage(code);
|
||||
}
|
||||
|
||||
private int code;
|
||||
private String message;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
29
src/main/java/com/soft/enums/CommEnum.java
Normal file
29
src/main/java/com/soft/enums/CommEnum.java
Normal file
@ -0,0 +1,29 @@
|
||||
package com.soft.enums;
|
||||
|
||||
import com.soft.utils.ResultUtil;
|
||||
|
||||
/**
|
||||
* 通用返回信息
|
||||
*/
|
||||
public enum CommEnum {
|
||||
|
||||
SUCCESS(ResultUtil.SUCCESS_CODE),
|
||||
FAIL(ResultUtil.FAIL_CODE),
|
||||
EMPTY_PARAM(ResultUtil.EMPTY_PARAM_CODE),
|
||||
ERROR(ResultUtil.ERROR_CODE);
|
||||
private CommEnum(int code){
|
||||
this.code=code;
|
||||
this.message=ResultUtil.getMessage(code);
|
||||
}
|
||||
|
||||
private int code;
|
||||
private String message;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
30
src/main/java/com/soft/enums/OrderChartBizType.java
Normal file
30
src/main/java/com/soft/enums/OrderChartBizType.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.soft.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
|
||||
public enum OrderChartBizType{
|
||||
PURCHASE_ORDER(0, "采购订单"), PURCHASE_RETURN(1, "采购退单"), SALE_ORDER(2, "销售订单"), SALE_RETURN(3,
|
||||
"销售退单"), RETAIL_OUT_SHEET(4, "零售出库单"), RETAIL_RETURN(5, "零售退单");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
OrderChartBizType(Integer code, String desc) {
|
||||
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
|
||||
return this.desc;
|
||||
}
|
||||
}
|
39
src/main/java/com/soft/enums/OrderStatus.java
Normal file
39
src/main/java/com/soft/enums/OrderStatus.java
Normal file
@ -0,0 +1,39 @@
|
||||
package com.soft.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public enum OrderStatus {
|
||||
CREATED(0, "待审核"), APPROVE_PASS(3, "审核通过"), APPROVE_REFUSE(6, "审核拒绝");
|
||||
|
||||
@EnumValue
|
||||
private Integer code;
|
||||
|
||||
private String desc;
|
||||
|
||||
OrderStatus(Integer code, String desc) {
|
||||
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
public static String valueOfCode(Integer code) {
|
||||
for (OrderStatus status : values()) {
|
||||
if (Objects.equals(status.getCode(), code)) {
|
||||
return status.getDesc();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
27
src/main/java/com/soft/enums/ProductType.java
Normal file
27
src/main/java/com/soft/enums/ProductType.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.soft.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
public enum ProductType {
|
||||
NORMAL(1, "普通商品"), BUNDLE(2, "组合商品");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
ProductType(Integer code, String desc) {
|
||||
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
}
|
24
src/main/java/com/soft/enums/QueryType.java
Normal file
24
src/main/java/com/soft/enums/QueryType.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.soft.enums;
|
||||
|
||||
public enum QueryType {
|
||||
|
||||
TODAY_PURCHASE_AMOUNT, // 今日采购订单金额
|
||||
TODAY_SALES_AMOUNT, // 今日销售订单金额
|
||||
PRODUCT_INVENTORY, // 商品库存查询
|
||||
TODAY_OUTBOUND_ORDERS, // 今日销售出库订单
|
||||
TODAY_PURCHASE_ORDERS, //今天采购入库订单
|
||||
TODAY_PURCHASE_RETURN, //今日销售退货订单
|
||||
CUSTOMER_NAME_SEARCH, //根据客户名搜索
|
||||
USER_NAME_ORDERS_SEARCH,
|
||||
SALES_ORDERS_BY_DATE, //时间查询销售订单
|
||||
PURCHASE_ORDERS_BY_DATE, //时间查询采购订单
|
||||
PRODUCT_STOCK_LOG_BY_NAME, //出入库流水
|
||||
REVENUE_COUNT, //营收账款
|
||||
ACCOUNTS_PAYABLE, //应付账款
|
||||
PAYMENT_TOF_FEES, //费用支付
|
||||
TOTAL_PROFIT, //利润总和
|
||||
MONTH_SALE_AMOUNT, //本月销售订单
|
||||
MONTH_PURCHASE_AMOUNT, //本月采购订单
|
||||
YEAR_SALE_AMOUNT, //本年销售订单
|
||||
YEAR_PURCHASE_AMOUNT //本年采购订单
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.soft.enums.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
public enum SysMenuComponentType {
|
||||
|
||||
NORMAL(0, "普通"), CUSTOM_LIST(1, "自定义列表"), CUSTOM_PAGE(3, "自定义页面");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
SysMenuComponentType(Integer code, String desc) {
|
||||
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
27
src/main/java/com/soft/enums/system/SysMenuDisplay.java
Normal file
27
src/main/java/com/soft/enums/system/SysMenuDisplay.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.soft.enums.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
public enum SysMenuDisplay {
|
||||
|
||||
CATALOG(0, "目录"), FUNCTION(1, "菜单"), PERMISSION(2, "权限");
|
||||
|
||||
@EnumValue
|
||||
private final Integer code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
SysMenuDisplay(Integer code, String desc) {
|
||||
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.soft.events.order;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 业务单据审核通过Event
|
||||
*/
|
||||
public abstract class ApprovePassOrderEvent extends ApplicationEvent {
|
||||
|
||||
/**
|
||||
* 业务单据ID
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单据总金额
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
private LocalDateTime approveTime = LocalDateTime.now();
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
@Getter
|
||||
private OrderType orderType;
|
||||
|
||||
/**
|
||||
* Create a new {@code ApplicationEvent}.
|
||||
*
|
||||
* @param source the object on which the event initially occurred or with which the event is
|
||||
* associated (never {@code null})
|
||||
*/
|
||||
public ApprovePassOrderEvent(Object source, OrderType orderType) {
|
||||
|
||||
super(source);
|
||||
this.orderType = orderType;
|
||||
}
|
||||
|
||||
public enum OrderType {
|
||||
PURCHASE_ORDER, PURCHASE_RETURN, SALE_ORDER, SALE_RETURN, RETAIL_OUT_SHEET, RETAIL_RETURN
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.soft.events.order.impl;
|
||||
|
||||
|
||||
import com.soft.events.order.ApprovePassOrderEvent;
|
||||
|
||||
public class ApprovePassPurchaseOrderEvent extends ApprovePassOrderEvent {
|
||||
|
||||
/**
|
||||
* Create a new {@code ApplicationEvent}.
|
||||
*
|
||||
* @param source the object on which the event initially occurred or with which the event is
|
||||
* associated (never {@code null})
|
||||
*/
|
||||
public ApprovePassPurchaseOrderEvent(Object source) {
|
||||
|
||||
super(source, OrderType.PURCHASE_ORDER);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.soft.events.order.impl;
|
||||
|
||||
|
||||
import com.soft.events.order.ApprovePassOrderEvent;
|
||||
|
||||
public class ApprovePassPurchaseReturnEvent extends ApprovePassOrderEvent {
|
||||
|
||||
/**
|
||||
* Create a new {@code ApplicationEvent}.
|
||||
*
|
||||
* @param source the object on which the event initially occurred or with which the event is
|
||||
* associated (never {@code null})
|
||||
*/
|
||||
public ApprovePassPurchaseReturnEvent(Object source) {
|
||||
|
||||
super(source, OrderType.PURCHASE_RETURN);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.soft.events.order.impl;
|
||||
|
||||
|
||||
import com.soft.events.order.ApprovePassOrderEvent;
|
||||
|
||||
public class ApprovePassRetailOutSheetEvent extends ApprovePassOrderEvent {
|
||||
|
||||
/**
|
||||
* Create a new {@code ApplicationEvent}.
|
||||
*
|
||||
* @param source the object on which the event initially occurred or with which the event is
|
||||
* associated (never {@code null})
|
||||
*/
|
||||
public ApprovePassRetailOutSheetEvent(Object source) {
|
||||
|
||||
super(source, OrderType.RETAIL_OUT_SHEET);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.soft.events.order.impl;
|
||||
|
||||
import com.soft.events.order.ApprovePassOrderEvent;
|
||||
|
||||
public class ApprovePassRetailReturnEvent extends ApprovePassOrderEvent {
|
||||
|
||||
/**
|
||||
* Create a new {@code ApplicationEvent}.
|
||||
*
|
||||
* @param source the object on which the event initially occurred or with which the event is
|
||||
* associated (never {@code null})
|
||||
*/
|
||||
public ApprovePassRetailReturnEvent(Object source) {
|
||||
|
||||
super(source, OrderType.RETAIL_RETURN);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.soft.events.order.impl;
|
||||
|
||||
|
||||
import com.soft.events.order.ApprovePassOrderEvent;
|
||||
|
||||
public class ApprovePassSaleOrderEvent extends ApprovePassOrderEvent {
|
||||
|
||||
/**
|
||||
* Create a new {@code ApplicationEvent}.
|
||||
*
|
||||
* @param source the object on which the event initially occurred or with which the event is
|
||||
* associated (never {@code null})
|
||||
*/
|
||||
public ApprovePassSaleOrderEvent(Object source) {
|
||||
|
||||
super(source, OrderType.SALE_ORDER);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.soft.events.order.impl;
|
||||
|
||||
|
||||
import com.soft.events.order.ApprovePassOrderEvent;
|
||||
|
||||
public class ApprovePassSaleReturnEvent extends ApprovePassOrderEvent {
|
||||
|
||||
/**
|
||||
* Create a new {@code ApplicationEvent}.
|
||||
*
|
||||
* @param source the object on which the event initially occurred or with which the event is
|
||||
* associated (never {@code null})
|
||||
*/
|
||||
public ApprovePassSaleReturnEvent(Object source) {
|
||||
|
||||
super(source, OrderType.SALE_RETURN);
|
||||
}
|
||||
}
|
196
src/main/java/com/soft/filter/CrossFilter.java
Normal file
196
src/main/java/com/soft/filter/CrossFilter.java
Normal file
@ -0,0 +1,196 @@
|
||||
package com.soft.filter;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.annotation.WebFilter;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
|
||||
/**
|
||||
* @description CrossFilter
|
||||
* @author TDW
|
||||
* @date 2017年6月22日
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
@WebFilter(urlPatterns = "/*", filterName = "crossFilter")
|
||||
public class CrossFilter implements Filter {
|
||||
|
||||
private static final boolean debug = true;
|
||||
// The filter configuration object we are associated with. If
|
||||
// this value is null, this filter instance is not currently
|
||||
// configured.
|
||||
private FilterConfig filterConfig = null;
|
||||
|
||||
public CrossFilter() {
|
||||
}
|
||||
|
||||
private void doBeforeProcessing(ServletRequest request, ServletResponse response)
|
||||
throws IOException, ServletException {
|
||||
if (debug) {
|
||||
log("CrossFilter:DoBeforeProcessing");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void doAfterProcessing(ServletRequest request, ServletResponse response)
|
||||
throws IOException, ServletException {
|
||||
if (debug) {
|
||||
log("CrossFilter:DoAfterProcessing");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void addHeadersFor200Response(HttpServletResponse response){
|
||||
//TODO: externalize the Allow-Origin
|
||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||
response.addHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, HEAD");
|
||||
response.addHeader("Access-Control-Allow-Headers", "X-PINGOTHER, Origin, X-Requested-With, Content-Type, Accept");
|
||||
response.addHeader("Access-Control-Max-Age", "1728000");
|
||||
}
|
||||
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
if (debug) {
|
||||
log("CrossFilter:doFilter()");
|
||||
}
|
||||
|
||||
if(response instanceof HttpServletResponse){
|
||||
HttpServletResponse alteredResponse = ((HttpServletResponse)response);
|
||||
// I need to find a way to make sure this only gets called on 200-300 http responses
|
||||
// TODO: see above comment
|
||||
addHeadersFor200Response(alteredResponse);
|
||||
}
|
||||
|
||||
doBeforeProcessing(request, response);
|
||||
|
||||
Throwable problem = null;
|
||||
try {
|
||||
chain.doFilter(request, response);
|
||||
} catch (Throwable t) {
|
||||
// If an exception is thrown somewhere down the filter chain,
|
||||
// we still want to execute our after processing, and then
|
||||
// rethrow the problem after that.
|
||||
problem = t;
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
doAfterProcessing(request, response);
|
||||
|
||||
// If there was a problem, we want to rethrow it if it is
|
||||
// a known type, otherwise log it.
|
||||
if (problem != null) {
|
||||
if (problem instanceof ServletException) {
|
||||
throw (ServletException) problem;
|
||||
}
|
||||
if (problem instanceof IOException) {
|
||||
throw (IOException) problem;
|
||||
}
|
||||
sendProcessingError(problem, response);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the filter configuration object for this filter.
|
||||
*/
|
||||
public FilterConfig getFilterConfig() {
|
||||
return (this.filterConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the filter configuration object for this filter.
|
||||
*
|
||||
* @param filterConfig The filter configuration object
|
||||
*/
|
||||
public void setFilterConfig(FilterConfig filterConfig) {
|
||||
this.filterConfig = filterConfig;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Destroy method for this filter
|
||||
*/
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Init method for this filter
|
||||
*/
|
||||
public void init(FilterConfig filterConfig) throws ServletException{
|
||||
this.filterConfig = filterConfig;
|
||||
if (filterConfig != null) {
|
||||
if (debug) {
|
||||
log("CrossFilter:Initializing filter");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a String representation of this object.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (filterConfig == null) {
|
||||
return ("CrossFilter()");
|
||||
}
|
||||
StringBuffer sb = new StringBuffer("CrossFilter(");
|
||||
sb.append(filterConfig);
|
||||
sb.append(")");
|
||||
return (sb.toString());
|
||||
}
|
||||
|
||||
private void sendProcessingError(Throwable t, ServletResponse response) {
|
||||
String stackTrace = getStackTrace(t);
|
||||
|
||||
if (stackTrace != null && !stackTrace.equals("")) {
|
||||
try {
|
||||
response.setContentType("text/html");
|
||||
PrintStream ps = new PrintStream(response.getOutputStream());
|
||||
PrintWriter pw = new PrintWriter(ps);
|
||||
pw.print("<html>\n<head>\n<title>Error</title>\n</head>\n<body>\n"); //NOI18N
|
||||
|
||||
// PENDING! Localize this for next official release
|
||||
pw.print("<h1>The resource did not process correctly</h1>\n<pre>\n");
|
||||
pw.print(stackTrace);
|
||||
pw.print("</pre></body>\n</html>"); //NOI18N
|
||||
pw.close();
|
||||
ps.close();
|
||||
response.getOutputStream().close();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
PrintStream ps = new PrintStream(response.getOutputStream());
|
||||
t.printStackTrace(ps);
|
||||
ps.close();
|
||||
response.getOutputStream().close();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String getStackTrace(Throwable t) {
|
||||
String stackTrace = null;
|
||||
try {
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
t.printStackTrace(pw);
|
||||
pw.close();
|
||||
sw.close();
|
||||
stackTrace = sw.getBuffer().toString();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
return stackTrace;
|
||||
}
|
||||
|
||||
public void log(String msg) {
|
||||
filterConfig.getServletContext().log(msg);
|
||||
}
|
||||
}
|
60
src/main/java/com/soft/listeners/OrderDataListener.java
Normal file
60
src/main/java/com/soft/listeners/OrderDataListener.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.soft.listeners;
|
||||
|
||||
import com.soft.enums.OrderChartBizType;
|
||||
import com.soft.events.order.ApprovePassOrderEvent;
|
||||
import com.soft.service.OrderChartService;
|
||||
import com.soft.vo.CreateOrderChartVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class OrderDataListener implements ApplicationListener<ApprovePassOrderEvent> {
|
||||
|
||||
@Autowired
|
||||
private OrderChartService orderChartService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApprovePassOrderEvent event) {
|
||||
|
||||
OrderChartBizType bizType = this.convertBizType(event.getOrderType());
|
||||
if (event.getOrderType() == null) {
|
||||
log.error("orderType={},无法匹配业务类型", event.getOrderType());
|
||||
return;
|
||||
}
|
||||
|
||||
CreateOrderChartVo vo = new CreateOrderChartVo();
|
||||
vo.setTotalAmount(event.getTotalAmount());
|
||||
vo.setCreateTime(event.getApproveTime());
|
||||
vo.setBizType(bizType);
|
||||
|
||||
orderChartService.create(vo);
|
||||
}
|
||||
|
||||
private OrderChartBizType convertBizType(ApprovePassOrderEvent.OrderType orderType) {
|
||||
|
||||
if (orderType == ApprovePassOrderEvent.OrderType.PURCHASE_ORDER) {
|
||||
return OrderChartBizType.PURCHASE_ORDER;
|
||||
}
|
||||
if (orderType == ApprovePassOrderEvent.OrderType.PURCHASE_RETURN) {
|
||||
return OrderChartBizType.PURCHASE_RETURN;
|
||||
}
|
||||
if (orderType == ApprovePassOrderEvent.OrderType.SALE_ORDER) {
|
||||
return OrderChartBizType.SALE_ORDER;
|
||||
}
|
||||
if (orderType == ApprovePassOrderEvent.OrderType.SALE_RETURN) {
|
||||
return OrderChartBizType.SALE_RETURN;
|
||||
}
|
||||
if (orderType == ApprovePassOrderEvent.OrderType.RETAIL_OUT_SHEET) {
|
||||
return OrderChartBizType.RETAIL_OUT_SHEET;
|
||||
}
|
||||
if (orderType == ApprovePassOrderEvent.OrderType.RETAIL_RETURN) {
|
||||
return OrderChartBizType.RETAIL_RETURN;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
18
src/main/java/com/soft/mapper/AgentMapper.java
Normal file
18
src/main/java/com/soft/mapper/AgentMapper.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.soft.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.soft.entitys.user.Agent;
|
||||
import com.soft.vo.AgentLevelVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AgentMapper extends BaseMapper<Agent> {
|
||||
|
||||
Agent getAgentByLevel(Integer levelId);
|
||||
|
||||
List<AgentLevelVo> getAgentLevelList();
|
||||
|
||||
Agent getAgentById(Integer id);
|
||||
|
||||
|
||||
}
|
13
src/main/java/com/soft/mapper/CategoryMapper.java
Normal file
13
src/main/java/com/soft/mapper/CategoryMapper.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.soft.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.soft.entitys.user.Category;
|
||||
|
||||
public interface CategoryMapper extends BaseMapper<Category> {
|
||||
|
||||
Category getAllCategoryById(String id);
|
||||
|
||||
|
||||
Category getAllCategory(Integer id);
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user