| | |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-parent</artifactId> |
| | | <version>2.5.3</version> |
| | | <version>3.5.10</version> |
| | | <relativePath/> |
| | | </parent> |
| | | |
| | |
| | | <properties> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <spring-cloud.version>2020.0.5</spring-cloud.version> |
| | | <spring-boot.version>2.5.3</spring-boot.version> |
| | | <jedis.version>2.9.0</jedis.version> |
| | | <snakeyaml.version>1.33</snakeyaml.version> |
| | | <java.version>17</java.version> |
| | | <spring-cloud.version>2025.0.0</spring-cloud.version> |
| | | <spring-boot.version>3.5.10</spring-boot.version> |
| | | <druid.version>1.2.27</druid.version> |
| | | <springdoc.version>2.8.14</springdoc.version> |
| | | <jjwt.version>0.11.5</jjwt.version> |
| | | <jedis.version>5.2.0</jedis.version> |
| | | <fastjson.version>1.2.83</fastjson.version> |
| | | </properties> |
| | | |
| | | <dependencies> |
| | |
| | | <artifactId>spring-boot-starter</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-validation</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>1.2.21</version> |
| | | <artifactId>druid-spring-boot-3-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | |
| | | <artifactId>jedis</artifactId> |
| | | <version>${jedis.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.yaml</groupId> |
| | | <artifactId>snakeyaml</artifactId> |
| | | <version>${snakeyaml.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <configuration> |
| | | <release>${java.version}</release> |
| | | <parameters>true</parameters> |
| | | <annotationProcessorPaths> |
| | | <path> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <version>${lombok.version}</version> |
| | | </path> |
| | | </annotationProcessorPaths> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| | |
| | | package com.vincent.rsf.ai.gateway; |
| | | |
| | | import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; |
| | | import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.boot.SpringApplication; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.io.InterruptedIOException; |
| | | import java.nio.charset.StandardCharsets; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <gson.version>2.11.0</gson.version> |
| | | <fastjson.version>1.2.58</fastjson.version> |
| | | <mysql-driver.version>5.1.47</mysql-driver.version> |
| | | </properties> |
| | | |
| | | <dependencies> |
| | |
| | | <artifactId>jedis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>javax.validation</groupId> |
| | | <artifactId>validation-api</artifactId> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-validation</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ibeetl</groupId> |
| | |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <version>${mysql-driver.version}</version> |
| | | <groupId>com.mysql</groupId> |
| | | <artifactId>mysql-connector-j</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- mybatis-plus --> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <version>3.4.1</version> |
| | | <artifactId>mybatis-plus-spring-boot3-starter</artifactId> |
| | | <version>3.5.12</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-jsqlparser</artifactId> |
| | | <version>3.5.12</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>3.4.1</version> |
| | | <version>3.5.12</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.guava</groupId> |
| | |
| | | <artifactId>aspectjweaver</artifactId> |
| | | <version>1.9.19</version> <!-- 用于织入切面 --> |
| | | </dependency> |
| | | <!-- swagger --> |
| | | <!-- openapi --> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | <version>3.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-spring-boot-starter</artifactId> |
| | | <version>3.0.2</version> |
| | | <groupId>org.springdoc</groupId> |
| | | <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> |
| | | <version>${springdoc.version}</version> |
| | | </dependency> |
| | | <!-- jjwt --> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt-api</artifactId> |
| | | <version>${jjwt.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt-impl</artifactId> |
| | | <version>0.11.2</version> |
| | | <version>${jjwt.version}</version> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt-jackson</artifactId> |
| | | <version>0.11.2</version> |
| | | <version>${jjwt.version}</version> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | | |
| | | <!-- 图形验证码 --> |
| | |
| | | <!-- druid --> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>1.2.6</version> |
| | | <artifactId>druid-spring-boot-3-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | |
| | | import com.google.common.collect.Maps; |
| | | import com.google.common.collect.Sets; |
| | | |
| | | import javax.validation.ConstraintViolation; |
| | | import javax.validation.ConstraintViolationException; |
| | | import javax.validation.Validator; |
| | | import jakarta.validation.ConstraintViolation; |
| | | import jakarta.validation.ConstraintViolationException; |
| | | import jakarta.validation.Validator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | |
| | | <version>${spring-framework.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <version>5.1.46</version> |
| | | <groupId>com.mysql</groupId> |
| | | <artifactId>mysql-connector-j</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | |
| | | } |
| | | switch (this.sqlOsType) { |
| | | case MYSQL: |
| | | Class.forName("com.mysql.jdbc.Driver").newInstance(); |
| | | Class.forName("com.mysql.cj.jdbc.Driver").newInstance(); |
| | | conn = DriverManager.getConnection("jdbc:mysql://"+url, username, password); |
| | | this.columns = getMysqlColumns(conn, table, true, sqlOsType); |
| | | break; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt-api</artifactId> |
| | | <version>0.11.5</version> |
| | | <version>${jjwt.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt-impl</artifactId> |
| | | <version>0.11.5</version> |
| | | <version>${jjwt.version}</version> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt-jackson</artifactId> |
| | | <version>0.11.5</version> |
| | | <version>${jjwt.version}</version> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | | <dependency> |
| | |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| | | </project> |
| | |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | import java.rmi.NoSuchObjectException; |
| | | import java.util.*; |
| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | |
| | | /** |
| | | * API安全配置类 |
| | |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * WebMvc配置, 拦截器、资源映射等都在此配置 |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | |
| | | /** |
| | | * App认证控制器 |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * App认证使用示例控制器 |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.Valid; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.Valid; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 托盘信息同步请求 |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.filter.OncePerRequestFilter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.FilterChain; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.FilterChain; |
| | | import jakarta.servlet.ServletException; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | |
| | | /** |
| | | * App认证服务 |
| | |
| | | import com.vincent.rsf.openApi.entity.constant.Constants; |
| | | import com.vincent.rsf.openApi.entity.app.App; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 认证工具类 |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import javax.crypto.SecretKey; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.PostConstruct; |
| | | import jakarta.annotation.Resource; |
| | | import javax.net.ssl.SSLContext; |
| | | import javax.net.ssl.TrustManager; |
| | | import javax.net.ssl.X509TrustManager; |
| | |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.PostConstruct; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.openApi.entity.constant.Constants; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | |
| | | mvc: |
| | | static-path-pattern: /** |
| | | datasource: |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://10.10.10.200:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: xltys1995 |
| | |
| | | <charset>UTF-8</charset> <!-- 设置字符集 --> |
| | | </encoder> |
| | | <!-- 指定日志记录器的拆分归档策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
| | | <!-- 日志归档 --> |
| | | <fileNamePattern>${logback.logdir}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | <!--日志文件保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <!-- 指定日志记录器的拆分归档策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
| | | <!-- 每天日志归档路径以及格式 --> |
| | | <fileNamePattern>${logback.logdir}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | <!--日志文件保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 指定日志记录器的拆分归档策略 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logback.logdir}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | <!--日志文件保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!--指定日志记录器的拆分归档策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
| | | <fileNamePattern>${logback.logdir}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | <!--日志文件保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | |
| | | <!--</root>--> |
| | | <!--</springProfile>--> |
| | | |
| | | </configuration> |
| | | </configuration> |
| | |
| | | <properties> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <mysql-driver.version>5.1.47</mysql-driver.version> |
| | | </properties> |
| | | <dependencies> |
| | | <dependency> |
| | |
| | | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.PostConstruct; |
| | | import jakarta.annotation.Resource; |
| | | import javax.sql.DataSource; |
| | | import java.sql.Connection; |
| | | import java.sql.ResultSet; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | |
| | | import com.vincent.rsf.server.ai.dto.GatewayChatRequest; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | |
| | | import lombok.Data; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashSet; |
| | |
| | | import com.vincent.rsf.server.system.service.AiPromptTemplateService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | import lombok.Data; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | import com.vincent.rsf.server.ai.dto.GatewayChatRequest; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | |
| | | @Service |
| | | public class AiTextCompletionService { |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.io.InterruptedIOException; |
| | | import java.util.ArrayList; |
| | |
| | | import com.vincent.rsf.server.ai.service.mcp.AiMcpRegistryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.LinkedHashMap; |
| | |
| | | import com.vincent.rsf.server.system.service.AiDiagnosisPlanService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.InterruptedIOException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | import com.vincent.rsf.server.system.service.AiDiagnosisRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @Service |
| | |
| | | import com.vincent.rsf.server.system.service.AiDiagnosticToolConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Comparator; |
| | |
| | | import com.vincent.rsf.server.ai.service.AiSessionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.PostConstruct; |
| | | import jakarta.annotation.Resource; |
| | | import javax.sql.DataSource; |
| | | import java.sql.Connection; |
| | | import java.sql.ResultSet; |
| | |
| | | import com.vincent.rsf.server.system.entity.AiMcpMount; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | |
| | | import com.vincent.rsf.server.system.entity.AiMcpMount; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | |
| | | import com.vincent.rsf.server.ai.model.AiPromptContext; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | |
| | | import com.vincent.rsf.server.system.service.AiMcpMountService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | |
| | | import com.vincent.rsf.server.system.service.AiCallLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | |
| | | import com.vincent.rsf.server.manager.mapper.DeviceSiteMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | |
| | | import com.vincent.rsf.server.system.service.OperationRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | |
| | | import com.vincent.rsf.server.manager.mapper.TaskMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | |
| | | import com.vincent.rsf.server.manager.mapper.LocMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.*; |
| | | import jakarta.validation.Valid; |
| | | import jakarta.validation.constraints.*; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.*; |
| | | import jakarta.validation.constraints.*; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | @RestController |
| | | @RequestMapping("/ai/mcp") |
| | | public class AiMcpProtocolController extends BaseController { |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Date; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | |
| | | @Api(tags = "PDA入库操作接口") |
| | | @RequestMapping("/pda") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | import com.vincent.rsf.server.system.entity.Fields; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | import com.vincent.rsf.server.api.service.ReportMsgService; |
| | | import com.vincent.rsf.server.manager.entity.WkOrder; |
| | | import com.vincent.rsf.server.manager.entity.WkOrderItem; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.entity.Purchase; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.manager.service.PurchaseService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Autowired |
| | | private RemotesInfoProperties remotesInfoProperties; |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | private AsnOrderMapper asnOrderMapper; |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | @Autowired |
| | |
| | | //ASN明细单据分组 |
| | | Map<Long, List<WkOrderItem>> asnIds = wkOrderItems.stream().collect(Collectors.groupingBy(WkOrderItem::getOrderId)); |
| | | ids.forEach(id -> { |
| | | int count = asnOrderService.count(new LambdaQueryWrapper<WkOrder>().in(WkOrder::getId, id)); |
| | | long count = Optional.ofNullable(asnOrderMapper.selectCount(new LambdaQueryWrapper<WkOrder>().in(WkOrder::getId, id))).orElse(0L); |
| | | if (count == asnIds.get(id).size()) { |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<WkOrder>().eq(WkOrder::getId, id).set(WkOrder::getNtyStatus, 1))) { |
| | | if (asnOrderMapper.update(null, new LambdaUpdateWrapper<WkOrder>().eq(WkOrder::getId, id).set(WkOrder::getNtyStatus, 1)) <= 0) { |
| | | throw new CoolException("ASN主单状态修改失败!!"); |
| | | } |
| | | } else { |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<WkOrder>().eq(WkOrder::getId, id).set(WkOrder::getNtyStatus, 2))) { |
| | | if (asnOrderMapper.update(null, new LambdaUpdateWrapper<WkOrder>().eq(WkOrder::getId, id).set(WkOrder::getNtyStatus, 2)) <= 0) { |
| | | throw new CoolException("ASN主单状态修改失败!!"); |
| | | } |
| | | } |
| | |
| | | import com.vincent.rsf.server.api.utils.LocUtils; |
| | | import com.vincent.rsf.server.api.utils.SlaveProperties; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.mapper.LocItemMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.LocServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | @Autowired |
| | | private LocServiceImpl locService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | private LocItemMapper locItemMapper; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | |
| | | //入库靠近摆放 |
| | | if (ioType == 1 && deviceBind.getBeSimilar().equals("1") && !Cools.isEmpty(matnr) && Cools.isEmpty(orgLoc)) { |
| | | if (nearRow != curRow) { |
| | | List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getMatnrCode, matnr)); |
| | | List<LocItem> locItems = locItemMapper.selectList(new LambdaQueryWrapper<LocItem>().eq(LocItem::getMatnrCode, matnr)); |
| | | for (LocItem locItem : locItems) { |
| | | Loc loc1 = locService.getById(locItem.getLocId()); |
| | | if (LocUtils.isShallowLoc(loc1.getCode())) { |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import jakarta.annotation.PostConstruct; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | |
| | | package com.vincent.rsf.server.common.config; |
| | | |
| | | import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.beans.factory.config.BeanPostProcessor; |
| | | import io.swagger.v3.oas.models.OpenAPI; |
| | | import io.swagger.v3.oas.models.info.Info; |
| | | import org.springdoc.core.models.GroupedOpenApi; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.util.ReflectionUtils; |
| | | import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.oas.annotations.EnableOpenApi; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider; |
| | | import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; |
| | | import java.lang.reflect.Field; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Configuration |
| | | @EnableKnife4j |
| | | @EnableOpenApi |
| | | public class SwaggerConfig { |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | @Bean |
| | | public Docket docket() { |
| | | Docket docket = new Docket(DocumentationType.OAS_30) |
| | | .apiInfo(apiInfo()) |
| | | .enable("dev".equals(active)) |
| | | .groupName("测试分组") |
| | | .select() |
| | | //apis: 添加swagger接口提取范围 |
| | | .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) |
| | | .paths(PathSelectors.any()) |
| | | .build(); |
| | | |
| | | return docket; |
| | | public OpenAPI openAPI() { |
| | | return new OpenAPI() |
| | | .info(new Info() |
| | | .title("WMS标版1.0版本接口文档") |
| | | .description("WMS标版1.0版本接口文档,技术栈主要包括:SpringBoot、React.js、MySQL5.7") |
| | | .version("v1.0")); |
| | | } |
| | | |
| | | @Bean |
| | | public Docket erpDocket() { |
| | | Docket docket = new Docket(DocumentationType.OAS_30) |
| | | .apiInfo(apiInfo()) |
| | | .enable("dev".equals(active)) |
| | | .groupName("ERP接口对接") |
| | | .select() |
| | | .apis(RequestHandlerSelectors.basePackage("com.vincent.rsf.server.api.controller.erp")) |
| | | .paths(PathSelectors.any()) |
| | | .build(); |
| | | |
| | | return docket; |
| | | } |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("WMS标版1.0版本接口文档") |
| | | .description("WMS标版1.0版本接口文档,技术栈主要包括:SpringBoot、React.js、MySQL5.7") |
| | | .version("v1.0") |
| | | public GroupedOpenApi defaultApi() { |
| | | return GroupedOpenApi.builder() |
| | | .group("测试分组") |
| | | .pathsToMatch("/**") |
| | | .build(); |
| | | } |
| | | |
| | | @Bean |
| | | public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() { |
| | | return new BeanPostProcessor() { |
| | | |
| | | @Override |
| | | public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { |
| | | if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) { |
| | | customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); |
| | | } |
| | | return bean; |
| | | } |
| | | |
| | | private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) { |
| | | List<T> copy = mappings.stream() |
| | | .filter(mapping -> mapping.getPatternParser() == null) |
| | | .collect(Collectors.toList()); |
| | | mappings.clear(); |
| | | mappings.addAll(copy); |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) { |
| | | try { |
| | | Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings"); |
| | | field.setAccessible(true); |
| | | return (List<RequestMappingInfoHandlerMapping>) field.get(bean); |
| | | } catch (IllegalArgumentException | IllegalAccessException e) { |
| | | throw new IllegalStateException(e); |
| | | } |
| | | } |
| | | }; |
| | | public GroupedOpenApi erpApi() { |
| | | return GroupedOpenApi.builder() |
| | | .group("ERP接口对接") |
| | | .packagesToScan("com.vincent.rsf.server.api.controller.erp") |
| | | .build(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * WebMvc配置, 拦截器、资源映射等都在此配置 |
| | |
| | | package com.vincent.rsf.server.common.constant; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | |
| | | /** |
| | | * 系统常量 |
| | | * Created by vincent on 2019-10-29 15:55 |
| | |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Modifier; |
| | | import java.util.*; |
| | |
| | | continue; |
| | | } |
| | | boolean asc = temp.length == 1 || !temp[temp.length - 1].toLowerCase().equals(ORDER_DESC_VALUE); |
| | | orders.add(new OrderItem(column, asc)); |
| | | orders.add(asc ? OrderItem.asc(column) : OrderItem.desc(column)); |
| | | } |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.filter.OncePerRequestFilter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.FilterChain; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.FilterChain; |
| | | import jakarta.servlet.ServletException; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| New file |
| | |
| | | package com.vincent.rsf.server.common.security; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | |
| | | @Configuration |
| | | public class PasswordEncoderConfig { |
| | | |
| | | @Bean |
| | | public PasswordEncoder passwordEncoder() { |
| | | return new BCryptPasswordEncoder(); |
| | | } |
| | | } |
| | |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.security.access.AccessDeniedException; |
| | | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; |
| | | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| | | import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; |
| | | import org.springframework.security.config.http.SessionCreationPolicy; |
| | | import org.springframework.security.core.AuthenticationException; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.web.AuthenticationEntryPoint; |
| | | import org.springframework.security.web.SecurityFilterChain; |
| | | import org.springframework.security.web.access.AccessDeniedHandler; |
| | | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.ServletException; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.annotation.Resource; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Configuration |
| | | @EnableWebSecurity |
| | | @EnableGlobalMethodSecurity(prePostEnabled = true) |
| | | public class SecurityConfig extends WebSecurityConfigurerAdapter { |
| | | @EnableMethodSecurity(prePostEnabled = true) |
| | | public class SecurityConfig { |
| | | |
| | | public static final String[] FILTER_PATH = new String[] { |
| | | "/demo/**", |
| | |
| | | @Resource |
| | | private JwtAuthenticationFilter jwtAuthenticationFilter; |
| | | |
| | | @Override |
| | | protected void configure(HttpSecurity http) throws Exception { |
| | | http.authorizeRequests() |
| | | .antMatchers(HttpMethod.OPTIONS, "/**") |
| | | .permitAll() |
| | | .antMatchers(HttpMethod.GET, "/file/**", "/captcha", "/") |
| | | .permitAll() |
| | | .antMatchers(FILTER_PATH) |
| | | .permitAll() |
| | | .anyRequest() |
| | | .authenticated() |
| | | .and() |
| | | .sessionManagement() |
| | | .sessionCreationPolicy(SessionCreationPolicy.STATELESS) |
| | | .and() |
| | | .csrf() |
| | | .disable() |
| | | .cors() |
| | | .and() |
| | | .logout() |
| | | .disable() |
| | | .headers() |
| | | .frameOptions() |
| | | .disable() |
| | | .and() |
| | | .exceptionHandling() |
| | | .accessDeniedHandler(jwtAccessDeniedHandler) |
| | | .authenticationEntryPoint(jwtAuthenticationEntryPoint) |
| | | .and() |
| | | .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); |
| | | } |
| | | |
| | | @Bean |
| | | public BCryptPasswordEncoder bCryptPasswordEncoder() { |
| | | return new BCryptPasswordEncoder(); |
| | | public SecurityFilterChain securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) |
| | | throws Exception { |
| | | http.authorizeHttpRequests(authorize -> authorize |
| | | .requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() |
| | | .requestMatchers(HttpMethod.GET, "/file/**", "/captcha", "/").permitAll() |
| | | .requestMatchers(FILTER_PATH).permitAll() |
| | | .anyRequest().authenticated()) |
| | | .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) |
| | | .csrf(csrf -> csrf.disable()) |
| | | .cors(cors -> { |
| | | }) |
| | | .logout(logout -> logout.disable()) |
| | | .headers(headers -> headers.frameOptions(frameOptions -> frameOptions.disable())) |
| | | .exceptionHandling(exceptionHandling -> exceptionHandling |
| | | .accessDeniedHandler(jwtAccessDeniedHandler) |
| | | .authenticationEntryPoint(jwtAuthenticationEntryPoint)) |
| | | .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); |
| | | |
| | | return http.build(); |
| | | } |
| | | |
| | | // 没有访问权限异常处理 |
| | |
| | | @Override |
| | | public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException e) |
| | | throws IOException, ServletException { |
| | | if (response.isCommitted()) { |
| | | return; |
| | | } |
| | | CommonUtil.responseError(response, Constants.UNAUTHORIZED_CODE, Constants.UNAUTHORIZED_MSG, e.getMessage()); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) |
| | | throws IOException, ServletException { |
| | | if (response.isCommitted()) { |
| | | return; |
| | | } |
| | | CommonUtil.responseError(response, Constants.UNAUTHENTICATED_CODE, Constants.UNAUTHENTICATED_MSG, |
| | | e.getMessage()); |
| | | } |
| | |
| | | import org.springframework.mail.javamail.MimeMessageHelper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.mail.MessagingException; |
| | | import javax.mail.internet.MimeMessage; |
| | | import jakarta.mail.MessagingException; |
| | | import jakarta.mail.internet.MimeMessage; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | |
| | | try{ |
| | | Jedis jedis = this.getPool().getResource(); |
| | | |
| | | if(this.index != jedis.getDB().intValue()) { |
| | | if(this.index != jedis.getDB()) { |
| | | jedis.select(this.index); |
| | | } |
| | | return jedis; |
| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.common.constant.Constants; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | |
| | | * @param error 错误信息 |
| | | */ |
| | | public static void responseError(HttpServletResponse response, Integer code, String message, String error) { |
| | | if (response.isCommitted()) { |
| | | return; |
| | | } |
| | | response.resetBuffer(); |
| | | response.setStatus(code); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("application/json;charset=UTF-8"); |
| | | addCrossHeaders(response); |
| | | try { |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(JSON.toJSONString(R.parse(code + "-" + message))); |
| | |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Modifier; |
| | |
| | | import org.apache.tika.Tika; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URLEncoder; |
| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.common.constant.Constants; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.net.Inet4Address; |
| | | import java.net.InetAddress; |
| | | import java.net.NetworkInterface; |
| | |
| | | import io.jsonwebtoken.io.Encoders; |
| | | import io.jsonwebtoken.security.Keys; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.security.Key; |
| | | import java.util.Date; |
| | | |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "往来企业") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "逻辑分区") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "库区物料关系绑定") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.Valid; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api("库存调整单") |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "库位类型") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "出库单明细") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "质检明细") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api("库存调整历史") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "货主") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "库存信息") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "库存明细") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api("调拔单") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "组拖档明细") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "仓库库区") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "库区库存明细") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "仓库") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value = "条码") |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | @TableField(updateStrategy = FieldStrategy.ALWAYS) |
| | | private String barcode; |
| | | |
| | | /** |
| | |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value = "条码") |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | @TableField(updateStrategy = FieldStrategy.ALWAYS) |
| | | private String barcode; |
| | | |
| | | /** |
| | |
| | | import com.vincent.rsf.server.manager.entity.excel.annotation.ExcelAutoColumnSize; |
| | | import com.vincent.rsf.server.manager.entity.excel.annotation.ExcelComment; |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.experimental.Accessors; |
| | | import lombok.Data; |
| | | |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | } |
| | | //查询终点是否需要补充此容器 |
| | | String barcodeType = "barcode REGEXP '"+basContainer.getCodeType()+"'"; |
| | | int count = locService.count(new LambdaQueryWrapper<Loc>() |
| | | long count = locService.count(new LambdaQueryWrapper<Loc>() |
| | | .apply(barcodeType) |
| | | .in(Loc::getUseStatus, new ArrayList<>(Arrays.asList( |
| | | LocStsType.LOC_STS_TYPE_D.type, |
| | |
| | | .eq(Loc::getStatus, 1) |
| | | .orderByDesc(Loc::getId)); |
| | | if (!Cools.isEmpty(count) && count<autoOutCount){ |
| | | CONTAINER_IDS.put(barcodeType, autoOutCount-count); |
| | | CONTAINER_IDS.put(barcodeType, Math.toIntExact(autoOutCount - count)); |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | |
| | | import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate; |
| | | import com.vincent.rsf.server.manager.enums.CompanysType; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptResult; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderItemMapper; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | | import com.vincent.rsf.server.manager.service.MatnrService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | public class AsnOrderItemServiceImpl extends ServiceImpl<AsnOrderItemMapper, WkOrderItem> implements AsnOrderItemService { |
| | | |
| | | @Autowired |
| | | private AsnOrderService asnOrderMapper; |
| | | private AsnOrderMapper asnOrderMapper; |
| | | |
| | | @Autowired |
| | | private FieldsService fieldsService; |
| | |
| | | private MatnrService matnrService; |
| | | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | |
| | | @Autowired |
| | | private DictDataService dictDataService; |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | |
| | | @Override |
| | | public R generateBarcode(List<Long> orders) { |
| | |
| | | throw new CoolException("单号不能为空!!"); |
| | | } |
| | | AsnOrderTemplate template = listMap.get(key).stream().findFirst().get(); |
| | | WkOrder order = asnOrderMapper.getOne(new LambdaQueryWrapper<WkOrder>().eq(WkOrder::getCode, key)); |
| | | WkOrder order = asnOrderMapper.selectOne(new LambdaQueryWrapper<WkOrder>().eq(WkOrder::getCode, key)); |
| | | if (!Objects.isNull(order)) { |
| | | sbFaild.append(template.getCode()).append(",已添加!!"); |
| | | throw new CoolException(sbFaild.toString()); |
| | |
| | | .setCreateBy(loginUserId) |
| | | .setType(OrderType.getTypeVal(template.getType())) |
| | | .setWkType(OrderWorkType.getWorkType(template.getWkType())); |
| | | if (!asnOrderMapper.save(order)) { |
| | | if (asnOrderMapper.insert(order) <= 0) { |
| | | throw new CoolException("单据保存失败!!"); |
| | | } |
| | | List<WkOrderItem> items = new ArrayList<>(); |
| | |
| | | } |
| | | items.add(orderItem); |
| | | |
| | | if (!asnOrderItemService.save(orderItem)) { |
| | | if (!this.save(orderItem)) { |
| | | throw new CoolException("单据明细保存失败!!"); |
| | | } |
| | | } |
| | | if (!items.isEmpty()) { |
| | | // double qty = items.stream().mapToDouble(AsnOrderItem::getQty).sum(); |
| | | double anfme = items.stream().mapToDouble(WkOrderItem::getAnfme).sum(); |
| | | if (!asnOrderMapper.update(new LambdaUpdateWrapper<WkOrder>() |
| | | if (asnOrderMapper.update(null, new LambdaUpdateWrapper<WkOrder>() |
| | | // .set(AsnOrder::getQty, qty) |
| | | .set(WkOrder::getAnfme, anfme) |
| | | .eq(WkOrder::getId, order.getId()))) { |
| | | .eq(WkOrder::getId, order.getId())) <= 0) { |
| | | throw new CoolException("单据数量修改失败!!"); |
| | | } |
| | | } |
| | |
| | | wkOrderItem.setId(originalId); |
| | | wkOrderItem.setMatnrCode(matnr.getCode()).setMatnrId(matnr.getId()).setMaktx(matnr.getName()); |
| | | |
| | | WkOrder wkOrder = asnOrderService.getById(Long.parseLong(params.get("orderId").toString())); |
| | | WkOrder wkOrder = asnOrderMapper.selectById(Long.parseLong(params.get("orderId").toString())); |
| | | if (Objects.isNull(wkOrder)) { |
| | | throw new CoolException("数据错误,单据不存在!!"); |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.entity.WkOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItemLog; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderLogMapper; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderLog; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemLogService; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderLogService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | private AsnOrderMapper asnOrderMapper; |
| | | /** |
| | | * @author Ryan |
| | | * @description 继续收货 |
| | |
| | | .setDeleted(0) |
| | | .setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_EXCE_ING.val); |
| | | |
| | | WkOrder wkOrder = asnOrderService.getOne(new LambdaQueryWrapper<WkOrder>().eq(WkOrder::getCode, orderLog.getCode())); |
| | | WkOrder wkOrder = asnOrderMapper.selectOne(new LambdaQueryWrapper<WkOrder>().eq(WkOrder::getCode, orderLog.getCode())); |
| | | if (!Objects.isNull(wkOrder)) { |
| | | throw new CoolException("收货单据已添加,刷新后再操作!!"); |
| | | } |
| | | |
| | | if (!asnOrderService.saveOrUpdate(order)) { |
| | | if (asnOrderMapper.insert(order) <= 0) { |
| | | throw new CoolException("单据保存失败!!"); |
| | | } |
| | | List<AsnOrderItemLog> itemLogs = asnOrderItemLogService |
| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.entity.dto.PoItemsDto; |
| | | import com.vincent.rsf.server.api.service.ReceiveMsgService; |
| | | import com.vincent.rsf.server.api.service.ReportMsgService; |
| | | import com.vincent.rsf.server.common.utils.DateUtils; |
| | | import com.vincent.rsf.server.manager.controller.dto.DashboardDto; |
| | |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.mapper.TaskMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.text.DateFormat; |
| | | import java.text.ParsePosition; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | @Service("asnOrderService") |
| | | public class AsnOrderServiceImpl extends ServiceImpl<AsnOrderMapper, WkOrder> implements AsnOrderService { |
| | | |
| | | @Autowired |
| | | private ReceiveMsgService receiveMsgService; |
| | | @Autowired |
| | | private ReportMsgService reportMsgService; |
| | | |
| | |
| | | @Autowired |
| | | private PurchaseItemService purchaseItemService; |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | private TaskMapper taskMapper; |
| | | |
| | | @Override |
| | | public boolean notifyInspect(List<WkOrder> orders) { |
| | |
| | | dto.setOutAnf(outTrand.getAnfme()).setTaskOut(outTrand.getRealAnfme()).setTotalOut(outTrand.getAnfme() + outTrand.getRealAnfme()); |
| | | |
| | | //获取执行中任务数量 |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<>()); |
| | | List<Task> tasks = taskMapper.selectList(new LambdaQueryWrapper<>()); |
| | | if (!tasks.isEmpty()) { |
| | | dto.setTaskQty(tasks.size()); |
| | | } |
| | |
| | | private LocServiceImpl locService; |
| | | @Autowired |
| | | private TaskItemServiceImpl taskItemService; |
| | | @Autowired |
| | | private CheckOrderService checkOrderService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate; |
| | | import com.vincent.rsf.server.manager.entity.excel.DeliveryTemplate; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.mapper.DeliveryMapper; |
| | | import com.vincent.rsf.server.manager.mapper.DeliveryItemMapper; |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | | import com.vincent.rsf.server.manager.service.DeliveryItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.DeliveryService; |
| | | import com.vincent.rsf.server.manager.service.MatnrService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | |
| | | public class DeliveryItemServiceImpl extends ServiceImpl<DeliveryItemMapper, DeliveryItem> implements DeliveryItemService { |
| | | |
| | | @Autowired |
| | | private DeliveryService deliveryService; |
| | | private DeliveryMapper deliveryMapper; |
| | | @Autowired |
| | | private MatnrService matnrService; |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | @Autowired |
| | | private DeliveryItemService deliveryItemService; |
| | | |
| | | /** |
| | | * excel DO单导入 |
| | | * |
| | |
| | | throw new CoolException("单号不能为空!!"); |
| | | } |
| | | DeliveryTemplate template = listMap.get(key).stream().findFirst().get(); |
| | | Delivery order = deliveryService.getOne(new LambdaQueryWrapper<Delivery>().eq(Delivery::getCode, key)); |
| | | Delivery order = deliveryMapper.selectOne(new LambdaQueryWrapper<Delivery>().eq(Delivery::getCode, key)); |
| | | if (!Objects.isNull(order)) { |
| | | sbFaild.append(template.getDoCode()).append(",已添加!!"); |
| | | throw new CoolException(sbFaild.toString()); |
| | |
| | | .setAnfme(Double.parseDouble(template.getAnfme())) |
| | | .setUpdateBy(loginUserId) |
| | | .setCreateBy(loginUserId); |
| | | if (!deliveryService.save(order)) { |
| | | if (deliveryMapper.insert(order) <= 0) { |
| | | throw new CoolException("单据保存失败!!"); |
| | | } |
| | | List<DeliveryItem> items = new ArrayList<>(); |
| | |
| | | } |
| | | items.add(orderItem); |
| | | |
| | | if (!deliveryItemService.save(orderItem)) { |
| | | if (!this.save(orderItem)) { |
| | | throw new CoolException("单据明细保存失败!!"); |
| | | } |
| | | } |
| | | if (!items.isEmpty()) { |
| | | Double anfme = items.stream().mapToDouble(DeliveryItem::getAnfme).sum(); |
| | | if (!deliveryService.update(new LambdaUpdateWrapper<Delivery>() |
| | | if (deliveryMapper.update(null, new LambdaUpdateWrapper<Delivery>() |
| | | .set(Delivery::getAnfme, anfme) |
| | | .eq(Delivery::getId, order.getId()))) { |
| | | .eq(Delivery::getId, order.getId())) <= 0) { |
| | | throw new CoolException("单据数量修改失败!!"); |
| | | } |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.LocToTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.mapper.LocItemMapper; |
| | | import com.vincent.rsf.server.manager.mapper.TaskMapper; |
| | | import com.vincent.rsf.server.manager.mapper.WaveMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | private TaskMapper taskMapper; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | @Autowired |
| | | private DeviceSiteService deviceSiteService; |
| | | @Autowired |
| | | @Lazy |
| | | private WcsService wcsService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | private AsnOrderMapper asnOrderMapper; |
| | | @Autowired |
| | | private WaveService waveService; |
| | | private WaveMapper waveMapper; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | |
| | | throw new CoolException("空容器出库!!其他类型无效,进入类型:"+map.getType()); |
| | | } |
| | | |
| | | if (!taskService.save(task)) { |
| | | if (taskMapper.insert(task) <= 0) { |
| | | throw new CoolException("任务创建失败!!"); |
| | | } |
| | | } |
| | |
| | | if (!Objects.isNull(map.getSourceId())) { |
| | | if (map.getType().equals(Constants.TASK_TYPE_WAVE_OUT_STOCK)) { |
| | | order = new WkOrder(); |
| | | wave = waveService.getById(map.getSourceId()); |
| | | wave = waveMapper.selectById(map.getSourceId()); |
| | | } else { |
| | | wave = new Wave(); |
| | | order = outStockService.getById(map.getSourceId()); |
| | | order = asnOrderMapper.selectById(map.getSourceId()); |
| | | } |
| | | } else { |
| | | wave = new Wave(); |
| | |
| | | task.setTaskType(TaskType.TASK_TYPE_CHECK_OUT.type).setWarehType(deviceSite.getDevice()); |
| | | } |
| | | |
| | | if (!taskService.save(task)) { |
| | | if (taskMapper.insert(task) <= 0) { |
| | | throw new CoolException("任务创建失败!!"); |
| | | } |
| | | |
| | |
| | | |
| | | if (!Objects.isNull(moveTask.getId())) { |
| | | moveTask.setParentId(task.getId()).setSort(moveTask.getSort() + 1); |
| | | if (!taskService.saveOrUpdate(moveTask)) { |
| | | if ((Objects.isNull(moveTask.getId()) ? taskMapper.insert(moveTask) : taskMapper.updateById(moveTask)) <= 0) { |
| | | throw new CoolException("任务信息修改失败!!"); |
| | | } |
| | | task.setParentId(moveTask.getId()); |
| | | if (!taskService.updateById(task)) { |
| | | if (taskMapper.updateById(task) <= 0) { |
| | | throw new CoolException("主任务关联失败!!"); |
| | | } |
| | | } |
| | |
| | | taskItems.add(taskItem); |
| | | |
| | | Double qty = Math.round((item.getWorkQty() + item.getOutQty()) * 10000) / 10000.0; |
| | | LocItem locItem = locItemService.getById(item.getId()); |
| | | LocItem locItem = this.getById(item.getId()); |
| | | if (Objects.isNull(locItem)) { |
| | | throw new CoolException("库存信息不存在!"); |
| | | } |
| | |
| | | } |
| | | item.setUpdateBy(loginUserId).setUpdateTime(new Date()); |
| | | |
| | | if (!locItemService.updateById(item)) { |
| | | if (!this.updateById(item)) { |
| | | throw new CoolException("库存信息修改失败!!"); |
| | | } |
| | | |
| | |
| | | .setBarcode(orgLoc.getBarcode()) |
| | | .setMemo(map.getMemo()); |
| | | |
| | | if (!taskService.save(task)) { |
| | | if (taskMapper.insert(task) <= 0) { |
| | | throw new CoolException("新建移库任务失败!!"); |
| | | } |
| | | |
| | | List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, orgLoc.getId())); |
| | | List<LocItem> locItems = this.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, orgLoc.getId())); |
| | | if (!locItems.isEmpty()) { |
| | | List<TaskItem> taskItems = new ArrayList<>(); |
| | | for (LocItem item : locItems) { |
| | |
| | | private LocAreaService locAreaService; |
| | | @Autowired |
| | | private LocTypeRelaMapper locTypeRelaMapper; |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | | @Override |
| | | public R modifyLocs(LocModifyParams locs) { |
| | | if (locs.getId().isEmpty()) { |
| | |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.entity.Matnr; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderItemMapper; |
| | | import com.vincent.rsf.server.manager.service.MatnrService; |
| | | import com.vincent.rsf.server.manager.service.OutStockItemService; |
| | | import com.vincent.rsf.server.manager.service.OutStockService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | public class OutStockItemServiceImpl extends ServiceImpl<AsnOrderItemMapper, WkOrderItem> implements OutStockItemService { |
| | | |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | private AsnOrderMapper asnOrderMapper; |
| | | @Autowired |
| | | private MatnrService matnrService; |
| | | @Autowired |
| | | private OutStockItemService outStockItemService; |
| | | |
| | | /** |
| | | * @param |
| | |
| | | Map<String, List<OutStockTemplate>> listMap = resultList.stream().collect(Collectors.groupingBy(OutStockTemplate::getCode)); |
| | | for (String key : listMap.keySet()) { |
| | | OutStockTemplate template = listMap.get(key).stream().findFirst().get(); |
| | | WkOrder wkOrder = outStockService.getOne(new LambdaQueryWrapper<WkOrder>().eq(WkOrder::getCode, template.getCode())); |
| | | WkOrder wkOrder = asnOrderMapper.selectOne(new LambdaQueryWrapper<WkOrder>().eq(WkOrder::getCode, template.getCode())); |
| | | if (!Objects.isNull(wkOrder)) { |
| | | continue; |
| | | } |
| | |
| | | .setCreateBy(loginUserId) |
| | | .setType(OrderType.getTypeVal(template.getType())) |
| | | .setWkType(OrderWorkType.getWorkType(template.getWkType())); |
| | | if (!outStockService.save(order)) { |
| | | if (asnOrderMapper.insert(order) <= 0) { |
| | | throw new CoolException("单据保存失败!!"); |
| | | } |
| | | List<WkOrderItem> items = new ArrayList<>(); |
| | |
| | | orderItem.setMaktx(matnr.getName()).setMatnrCode(matnr.getCode()).setMatnrId(matnr.getId()); |
| | | } |
| | | items.add(orderItem); |
| | | if (!outStockItemService.saveBatch(items)) { |
| | | if (!this.saveBatch(items)) { |
| | | throw new CoolException("单据明细保存失败!!"); |
| | | } |
| | | } |
| | | if (!items.isEmpty()) { |
| | | double purQty = items.stream().mapToDouble(WkOrderItem::getAnfme).sum(); |
| | | if (!outStockService.update(new LambdaUpdateWrapper<WkOrder>() |
| | | if (asnOrderMapper.update(null, new LambdaUpdateWrapper<WkOrder>() |
| | | .set(WkOrder::getExceStatus, AsnExceStatus.OUT_STOCK_STATUS_TASK_INIT.val) |
| | | .set(WkOrder::getAnfme, purQty).eq(WkOrder::getId, order.getId()))) { |
| | | .set(WkOrder::getAnfme, purQty).eq(WkOrder::getId, order.getId())) <= 0) { |
| | | throw new CoolException("单据数量修改失败!!"); |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private OutStockItemService outStockItemService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | @Autowired |
| | | private WaveRuleService waveRuleService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | |
| | | return LocUtils.isShallowLoc(item.getLocCode()) ? 1 : 0; |
| | | }).reversed()).collect(Collectors.toList()); |
| | | |
| | | WkOrder wkOrder = outStockService.getById(outId); |
| | | WkOrder wkOrder = this.getById(outId); |
| | | if (Cools.isEmpty(wkOrder)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | |
| | | |
| | | Double sum = itemList.stream().mapToDouble(OutStockToTaskParams::getOutQty).sum(); |
| | | //更新出库单明细及主单 |
| | | WkOrder outOrder = outStockService.getById(outId); |
| | | WkOrder outOrder = this.getById(outId); |
| | | if (Objects.isNull(outOrder)) { |
| | | throw new CoolException("出库单据不存在!!"); |
| | | } |
| | |
| | | |
| | | outOrder.setWorkQty(workQty).setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_CREATE.val); |
| | | |
| | | if (!outStockService.updateById(outOrder)) { |
| | | if (!this.updateById(outOrder)) { |
| | | throw new CoolException("出库单状态修改失败!!"); |
| | | } |
| | | |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.IsptItemsParams; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptResult; |
| | | import com.vincent.rsf.server.manager.mapper.QlyInspectMapper; |
| | | import com.vincent.rsf.server.manager.mapper.QlyIsptItemMapper; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectResultService; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectService; |
| | | import com.vincent.rsf.server.manager.service.QlyIsptItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | public class QlyIsptItemServiceImpl extends ServiceImpl<QlyIsptItemMapper, QlyIsptItem> implements QlyIsptItemService { |
| | | |
| | | @Autowired |
| | | private QlyInspectService qlyInspectService; |
| | | private QlyInspectMapper qlyInspectMapper; |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | |
| | | @Autowired |
| | | private QlyInspectResultService qlyInspectResultService; |
| | | @Autowired |
| | | private QlyIsptItemService qlyIsptItemService; |
| | | @Autowired |
| | | private WarehouseAreasItemServiceImpl warehouseAreasItemService; |
| | | @Autowired |
| | |
| | | |
| | | Double isptQty = isptRelt.stream().mapToDouble(QlyInspectResult::getAnfme).sum(); |
| | | |
| | | if (!qlyIsptItemService.update(new LambdaUpdateWrapper<QlyIsptItem>() |
| | | if (!this.update(new LambdaUpdateWrapper<QlyIsptItem>() |
| | | .set(QlyIsptItem::getUpdateBy, loginUserId) |
| | | .set(QlyIsptItem::getAnfme, isptQty) |
| | | .eq(QlyIsptItem::getId, item.getId()))) { |
| | |
| | | .in(QlyInspectResult::getIsptId, isptIds)); |
| | | Double sum = items.stream().mapToDouble(QlyInspectResult::getAnfme).sum(); |
| | | if (sum.compareTo(0.00) > 0) { |
| | | qlyInspectService.update(new LambdaUpdateWrapper<QlyInspect>() |
| | | qlyInspectMapper.update(null, new LambdaUpdateWrapper<QlyInspect>() |
| | | .set(QlyInspect::getIsptQty, sum) |
| | | .set(QlyInspect::getUpdateBy, loginUserId) |
| | | .eq(QlyInspect::getId, isptItem.stream().findFirst().get().getIspectId())); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.ReviseLogItemParams; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.CommonExceStatus; |
| | | import com.vincent.rsf.server.manager.mapper.ReviseLogMapper; |
| | | import com.vincent.rsf.server.manager.mapper.ReviseLogItemMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | public class ReviseLogItemServiceImpl extends ServiceImpl<ReviseLogItemMapper, ReviseLogItem> implements ReviseLogItemService { |
| | | |
| | | @Autowired |
| | | private ReviseLogService reviseLogService; |
| | | private ReviseLogMapper reviseLogMapper; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private ReviseLogItemService reviseLogItemService; |
| | | @Autowired |
| | | private LocReviseService locReviseService; |
| | | |
| | |
| | | @Override |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public List<ReviseLogItem> itemSave(ReviseLogItemParams reviseLogItem, Long userId) { |
| | | ReviseLog reviseLog = reviseLogService.getById(reviseLogItem.getReviseLogId()); |
| | | ReviseLog reviseLog = reviseLogMapper.selectById(reviseLogItem.getReviseLogId()); |
| | | if (Objects.isNull(reviseLog)) { |
| | | throw new RuntimeException("库存历史单据不存在!!"); |
| | | } |
| | |
| | | // } |
| | | }); |
| | | |
| | | List<ReviseLog> list = reviseLogService.list(new LambdaQueryWrapper<ReviseLog>().eq(ReviseLog::getReviseId, reviseLog.getReviseId())); |
| | | List<ReviseLog> list = reviseLogMapper.selectList(new LambdaQueryWrapper<ReviseLog>().eq(ReviseLog::getReviseId, reviseLog.getReviseId())); |
| | | if (Objects.isNull(list)) { |
| | | throw new RuntimeException("数据错误:库存调整单不存在!!"); |
| | | } |
| | | List<Long> reviseIds = list.stream().map(ReviseLog::getId).collect(Collectors.toList()); |
| | | List<ReviseLogItem> logItems = reviseLogItemService.list(new LambdaQueryWrapper<ReviseLogItem>() |
| | | List<ReviseLogItem> logItems = this.list(new LambdaQueryWrapper<ReviseLogItem>() |
| | | .in(ReviseLogItem::getReviseLogId, reviseIds)); |
| | | |
| | | Double anfems = logItems.stream().mapToDouble(ReviseLogItem::getAnfme).sum(); |
| | |
| | | private LocReviseService locReviseService; |
| | | |
| | | @Autowired |
| | | private ReviseLogService reviseLogService; |
| | | |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | |
| | | @Autowired |
| | |
| | | .setCreateBy(loginUserId) |
| | | .setUpdateBy(loginUserId) |
| | | .setReviseCode(locRevise.getCode()); |
| | | if (!reviseLogService.save(reviseLog)) { |
| | | if (!this.save(reviseLog)) { |
| | | throw new CoolException("调整单明细保存失败!!"); |
| | | } |
| | | |
| | |
| | | if (!revise.getExceStatus().equals(CommonExceStatus.COMMON_EXCE_STATUS_EXCE_ING.val)) { |
| | | throw new CoolException("单据状态未执行或已完成,无法执行完成操作!!"); |
| | | } |
| | | List<ReviseLog> logs = reviseLogService.list(new LambdaQueryWrapper<ReviseLog>().eq(ReviseLog::getReviseId, revise.getId())); |
| | | List<ReviseLog> logs = this.list(new LambdaQueryWrapper<ReviseLog>().eq(ReviseLog::getReviseId, revise.getId())); |
| | | if (logs.isEmpty()) { |
| | | throw new CoolException("库存日志不存在!!"); |
| | | } |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private LocItemWorkingService locItemWorkingService; |
| | | @Autowired |
| | | @Lazy |
| | | private WcsService wcsService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | |
| | | @Autowired |
| | | private CheckOrderItemService checkOrderItemService; |
| | | @Autowired |
| | | @Lazy |
| | | private CheckOrderService checkOrderService; |
| | | @Autowired |
| | | private CheckDiffService checkDiffService; |
| | |
| | | @Autowired |
| | | private RemotesInfoProperties.RcsApi rcsApi; |
| | | @Autowired |
| | | @Lazy |
| | | private FlowStepInstanceService flowStepInstanceService; |
| | | @Autowired |
| | | private RemotesInfoProperties.WmsOpenApi wmsOpenApi; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Task taskToTop(Long id, Long loginUserId) throws Exception { |
| | | List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id); |
| | | Task tasks = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs)); |
| | | Task tasks = this.getOne(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs)); |
| | | if (Objects.isNull(tasks)) { |
| | | throw new CoolException("任务已处执行状态不可一键置顶!!"); |
| | | } |
| | | //判断浅库位任务,修改任务优先级 |
| | | modiftyTaskSort(tasks, loginUserId); |
| | | |
| | | if (!taskService.updateById(tasks)) { |
| | | if (!this.updateById(tasks)) { |
| | | throw new CoolException("置顶失败!!"); |
| | | } |
| | | return null; |
| | |
| | | throw new CoolException("数据错误,库位不存在!!"); |
| | | } |
| | | if (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) { |
| | | Task serviceOne = taskService.getOne(new LambdaQueryWrapper<Task>() |
| | | Task serviceOne = this.getOne(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getOrgLoc, loc.getCode()) |
| | | .or() |
| | | .eq(Task::getTargLoc, loc.getCode())); |
| | |
| | | locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId())); |
| | | |
| | | task.setTaskStatus(TaskStsType.UPDATED_IN.id).setUpdateTime(new Date()).setUpdateBy(loginUserId); |
| | | if (!taskService.updateById(task)) { |
| | | if (!this.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | |
| | |
| | | locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId())); |
| | | |
| | | task.setTaskStatus(TaskStsType.UPDATED_IN.id).setUpdateTime(new Date()).setUpdateBy(loginUserId); |
| | | if (!taskService.updateById(task)) { |
| | | if (!this.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | // 盘点再入库任务结束:将关联的盘点差异单置为已审核 |
| | |
| | | */ |
| | | @Override |
| | | public void markCheckDiffApprovedWhenCheckInDone(Task checkInTask) { |
| | | Task outTask = taskService.getOne(new LambdaQueryWrapper<Task>() |
| | | Task outTask = this.getOne(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getBarcode, checkInTask.getBarcode()) |
| | | .eq(Task::getTaskType, TaskType.TASK_TYPE_CHECK_OUT.type) |
| | | .last("limit 1")); |
| | |
| | | throw new CoolException("移库目标库位状态修改失败!!"); |
| | | } |
| | | |
| | | Task outTask = taskService.getById(task.getParentId()); |
| | | Task outTask = this.getById(task.getParentId()); |
| | | if (!Objects.isNull(outTask)) { |
| | | LocToTaskParams params = new LocToTaskParams(); |
| | | params.setOrgLoc(task.getOrgLoc()).setSiteNo(task.getOrgSite()); |
| | |
| | | return R.error("任务编码不能为空!!"); |
| | | } |
| | | List<Integer> integers = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id); |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>() |
| | | List<Task> tasks = this.list(new LambdaQueryWrapper<Task>() |
| | | .in(Task::getId, ids) |
| | | .in(Task::getTaskStatus, integers) |
| | | .orderByDesc(Task::getSort)); |
| | |
| | | } |
| | | } |
| | | |
| | | taskService.pubTaskToWcs(tasks); |
| | | this.pubTaskToWcs(tasks); |
| | | |
| | | return R.ok(); |
| | | } |
| | |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | |
| | | if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) |
| | | if (!this.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) |
| | | .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_IN.id))) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | |
| | | if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) |
| | | if (!this.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) |
| | | .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_OUT.id))) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | |
| | | @Autowired |
| | | private TransferOrderService transferOrderService; |
| | | @Autowired |
| | | private TransferService transferService; |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | |
| | | transferOrderService.remove(new LambdaQueryWrapper<TransferOrder>().in(TransferOrder::getTransferId, list)); |
| | | } |
| | | |
| | | transferService.removeByIds(list); |
| | | this.removeByIds(list); |
| | | transferItemService.remove(new LambdaQueryWrapper<TransferItem>().in(TransferItem::getTransferId, list)); |
| | | return true; |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.mapper.WaitPakinMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | private AsnOrderMapper asnOrderMapper; |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | @Autowired |
| | | @Lazy |
| | | private AgvService agvService; |
| | | |
| | | |
| | |
| | | throw new CoolException("参数错误:托盘码为空!!"); |
| | | } |
| | | // List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | WaitPakin pakin = this.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!Objects.isNull(pakin)) { |
| | | throw new CoolException("托盘码:" + waitPakin.getBarcode() + "已被组托单:" + pakin.getCode() + "使用!!"); |
| | |
| | | .setUpdateBy(userId) |
| | | .setCreateBy(userId) |
| | | .setMatnrCode(warehouseAreasItems.getMatnrCode()); |
| | | WkOrder order = asnOrderService.getById(warehouseAreasItems.getAsnId()); |
| | | WkOrder order = asnOrderMapper.selectById(warehouseAreasItems.getAsnId()); |
| | | if (!Objects.isNull(order)) { |
| | | pakinItem.setType(null == order.getType() ? null : order.getType()) |
| | | .setWkType(null == order.getWkType() ? null : Short.parseShort(order.getWkType())); |
| | |
| | | if (StringUtils.isBlank(waitPakin.getBarcode())) { |
| | | throw new CoolException("参数错误:托盘码为空!!"); |
| | | } |
| | | WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | WaitPakin pakin = this.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!Objects.isNull(pakin)) { |
| | | throw new CoolException("托盘码:" + waitPakin.getBarcode() + "已被组托单:" + pakin.getCode() + "使用!!"); |
| | |
| | | throw new CoolException("参数错误:托盘码为空!!"); |
| | | } |
| | | // List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | WaitPakin pakin = this.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!Objects.isNull(pakin)) { |
| | | throw new CoolException("托盘码:" + waitPakin.getBarcode() + "已被组托单:" + pakin.getCode() + "使用!!"); |
| | |
| | | .setUpdateBy(userId) |
| | | .setCreateBy(userId) |
| | | .setMatnrCode(warehouseAreasItems.getMatnrCode()); |
| | | WkOrder order = asnOrderService.getById(warehouseAreasItems.getAsnId()); |
| | | WkOrder order = asnOrderMapper.selectById(warehouseAreasItems.getAsnId()); |
| | | if (!Objects.isNull(order)) { |
| | | pakinItem.setType(null == order.getType() ? null : order.getType()) |
| | | .setWkType(null == order.getWkType() ? null : Short.parseShort(order.getWkType())); |
| | |
| | | public synchronized WaitPakin unBind(WaitPakinParam param) { |
| | | String barcode = param.getBarcode(); |
| | | if (StringUtils.isNotBlank(barcode)) { |
| | | WaitPakin waitPakins = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, barcode)); |
| | | WaitPakin waitPakins = this.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, barcode)); |
| | | if (Objects.isNull(waitPakins)) { |
| | | throw new CoolException("组托不存在!!"); |
| | | } |
| | |
| | | double anfmes = paramItems.stream().mapToDouble(PakinItem::getReceiptQty).sum(); |
| | | // double anfmes = warehouseAreasItems.stream().mapToDouble(WarehouseAreasItem::getAnfme).sum(); |
| | | if (waitPakins.getAnfme().compareTo(anfmes) <= 0) { |
| | | if (!waitPakinService.removeById(waitPakins.getId())) { |
| | | if (!this.removeById(waitPakins.getId())) { |
| | | throw new CoolException("组托删除失败!!"); |
| | | } |
| | | } else { |
| | | Double anfme = Math.round((waitPakins.getAnfme() - anfmes) * 10000) / 10000.0; |
| | | waitPakins.setAnfme(anfme); |
| | | if (!waitPakinService.updateById(waitPakins)) { |
| | | if (!this.updateById(waitPakins)) { |
| | | throw new CoolException("组托数据修改失败!!"); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (!waitPakinService.removeByIds(pakinIds)) { |
| | | if (!this.removeByIds(pakinIds)) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | |
| | |
| | | @Autowired |
| | | private WaveItemService waveItemService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | @Autowired |
| | | private WaveService waveService; |
| | | @Autowired |
| | | private WaveRuleServiceImpl waveRuleService; |
| | | @Autowired |
| | |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | List<Long> WaveIds = JSONArray.parseArray(JSON.toJSONString(map.get("ids")), Long.class); |
| | | List<Wave> waves = waveService.listByIds(WaveIds); |
| | | List<Wave> waves = this.listByIds(WaveIds); |
| | | if (Objects.isNull(waves)) { |
| | | throw new CoolException("数据错误: 波次不存在!!"); |
| | | } |
| | |
| | | wave.setExceStatus(WaveExceStatus.WAVE_EXCE_STATUS_EXCING.val); |
| | | } |
| | | wave.setMemo("-->库存不足"); |
| | | waveService.updateById(wave); |
| | | this.updateById(wave); |
| | | return R.ok(); |
| | | } |
| | | try { |
| | |
| | | Double sum = taskItems.stream().mapToDouble(TaskItem::getAnfme).sum(); |
| | | Double v = Math.round((wave.getWorkQty() + sum) * 1000000) / 1000000.0; |
| | | if (wave.getAnfme().compareTo(v) == 0) { |
| | | if (!waveService.update(new LambdaUpdateWrapper<Wave>() |
| | | if (!this.update(new LambdaUpdateWrapper<Wave>() |
| | | .set(Wave::getExceStatus, WaveExceStatus.WAVE_EXCE_STATUS_TASK.val) |
| | | .set(Wave::getWorkQty, v) |
| | | .set(Wave::getUpdateBy, loginUserId) |
| | |
| | | throw new CoolException("波次状态修改失败!!"); |
| | | } |
| | | } else { |
| | | if (!waveService.update(new LambdaUpdateWrapper<Wave>() |
| | | if (!this.update(new LambdaUpdateWrapper<Wave>() |
| | | .set(Wave::getExceStatus, WaveExceStatus.WAVE_EXCE_STATUS_EXCING.val) |
| | | .set(Wave::getWorkQty, v) |
| | | .set(Wave::getUpdateBy, loginUserId) |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Map; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = "动态扩展字段") |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.system.entity.UserLogin; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | |
| | | public interface UserLoginService extends IService<UserLogin> { |
| | | |
| | |
| | | import com.vincent.rsf.server.system.entity.AiDiagnosisPlan; |
| | | import com.vincent.rsf.server.system.mapper.AiDiagnosisPlanMapper; |
| | | import com.vincent.rsf.server.system.service.AiDiagnosisPlanService; |
| | | import org.springframework.scheduling.support.CronSequenceGenerator; |
| | | import org.springframework.scheduling.support.CronExpression; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.ZoneId; |
| | | import java.time.ZonedDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | if (!validateCron(cronExpr)) { |
| | | return null; |
| | | } |
| | | return new CronSequenceGenerator(cronExpr.trim()).next(after == null ? new Date() : after); |
| | | ZonedDateTime next = CronExpression.parse(cronExpr.trim()) |
| | | .next((after == null ? new Date() : after).toInstant().atZone(ZoneId.systemDefault())); |
| | | return next == null ? null : Date.from(next.toInstant()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (cronExpr == null || cronExpr.trim().isEmpty()) { |
| | | return false; |
| | | } |
| | | return CronSequenceGenerator.isValidExpression(cronExpr.trim()); |
| | | return CronExpression.isValidExpression(cronExpr.trim()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.vincent.rsf.server.system.service.AiPromptTemplateService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | import com.vincent.rsf.server.system.service.ConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import jakarta.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | |
| | | @Service("userLoginService") |
| | | public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin> implements UserLoginService { |
| | |
| | | import com.vincent.rsf.server.system.service.RoleMenuService; |
| | | import com.vincent.rsf.server.system.service.UserRoleService; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import jakarta.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service("userService") |
| | |
| | | @Resource |
| | | private RoleMenuService roleMenuService; |
| | | @Resource |
| | | private BCryptPasswordEncoder bCryptPasswordEncoder; |
| | | private PasswordEncoder passwordEncoder; |
| | | |
| | | @Override |
| | | public PageResult<User> pageRel(PageParam<User, BaseParam> pageParam) { |
| | |
| | | |
| | | @Override |
| | | public boolean comparePassword(String dbPassword, String inputPassword) { |
| | | return bCryptPasswordEncoder.matches(inputPassword, dbPassword); |
| | | return passwordEncoder.matches(inputPassword, dbPassword); |
| | | } |
| | | |
| | | @Override |
| | | public String encodePassword(String password) { |
| | | return password == null ? null : bCryptPasswordEncoder.encode(password); |
| | | return password == null ? null : passwordEncoder.encode(password); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import jakarta.annotation.PostConstruct; |
| | | import java.util.Objects; |
| | | |
| | | @Component |
| | |
| | | mvc: |
| | | static-path-pattern: /** |
| | | datasource: |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://10.10.10.200:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: xltys1995 |
| | |
| | | <!--info级别--> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${LOG_PATH}/info.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${LOG_PATH}/info_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
| | | <fileNamePattern>${LOG_PATH}/info_%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | <maxHistory>10</maxHistory> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern> |
| | |
| | | <level>ERROR</level> |
| | | </filter> |
| | | <file>${LOG_PATH}/error.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${LOG_PATH}/error_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
| | | <fileNamePattern>${LOG_PATH}/error_%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | <maxHistory>10</maxHistory> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern> |
| | |
| | | <appender-ref ref="INFO_FILE"/> |
| | | <appender-ref ref="ERROR_FILE"/> |
| | | </root> |
| | | </configuration> |
| | | </configuration> |