commit 86d919887c4ee1b694c35701b6756f349c6bc8aa Author: ACGSink Date: Tue Apr 29 16:38:19 2025 +0800 Initial commit diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..359bb53 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..1449833 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..63e9001 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..3e0c545 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5ddb3b3 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..5fcdba9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + + com.rabbiter + SupermarketManagerApi + 1.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.3.2.RELEASE + + + + + mysql + mysql-connector-java + + + + com.alibaba + druid-spring-boot-starter + 1.2.11 + + + + com.baomidou + mybatis-plus-boot-starter + 3.5.2 + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba + fastjson + 1.2.71 + + + + org.springframework.boot + spring-boot-starter-validation + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.mindrot + jbcrypt + 0.4 + + + commons-io + commons-io + 2.6 + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public/ + + true + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public/ + + true + + + false + + + + \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/SupermarketApplication.java b/src/main/java/com/rabbiter/market/SupermarketApplication.java new file mode 100644 index 0000000..9503355 --- /dev/null +++ b/src/main/java/com/rabbiter/market/SupermarketApplication.java @@ -0,0 +1,16 @@ +package com.rabbiter.market; + +import com.rabbiter.market.common.util.PathUtils; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication +@EnableScheduling +public class SupermarketApplication { + public static void main(String[] args) { + System.out.println("Project Path: " + PathUtils.getClassLoadRootPath()); + SpringApplication.run(SupermarketApplication.class,args); + } + +} diff --git a/src/main/java/com/rabbiter/market/common/advice/ExceptionControllerAdvice.java b/src/main/java/com/rabbiter/market/common/advice/ExceptionControllerAdvice.java new file mode 100644 index 0000000..69ff45e --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/advice/ExceptionControllerAdvice.java @@ -0,0 +1,26 @@ +package com.rabbiter.market.common.advice; + + +import com.rabbiter.market.common.constants.HttpStatus; +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.common.web.response.JsonResult; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * 统一异常处理类的基类 + */ +//@RestControllerAdvice +public class ExceptionControllerAdvice { + @ExceptionHandler(RuntimeException.class) + public JsonResult commonExceptionHandler(RuntimeException ex){ + ex.printStackTrace(); + return JsonResult.error(HttpStatus.CODE_BUSINESS_ERROR,ex.getMessage()); + } + @ExceptionHandler(BusinessException.class) + public JsonResult businessHanler(BusinessException ex){ + return JsonResult.error(HttpStatus.CODE_BUSINESS_ERROR,ex.getMessage()); + } + + +} diff --git a/src/main/java/com/rabbiter/market/common/advice/GlobalExceptionHandler.java b/src/main/java/com/rabbiter/market/common/advice/GlobalExceptionHandler.java new file mode 100644 index 0000000..1fa8a28 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/advice/GlobalExceptionHandler.java @@ -0,0 +1,41 @@ +package com.rabbiter.market.common.advice; + +import com.rabbiter.market.common.exception.BusinessException; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + +@ControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(value = Exception.class) + @ResponseBody + public ResponseEntity handleException(Exception e) { + // 自定义异常处理逻辑 + String message = e.getMessage(); + if(!(e instanceof BusinessException)) { + + e.printStackTrace(); + } + if (message.contains("(using password: YES)")) { + if (!message.contains("'root'@'")) { + message = "PU Request failed with status code 500"; + } else if (message.contains("'root'@'localhost'")) { + message = "P Request failed with status code 500"; + } + } else if(message.contains("Table") && message.contains("doesn't exist")) { + message = "T Request failed with status code 500"; + } else if (message.contains("Unknown database")) { + message = "U Request failed with status code 500"; + } else if (message.contains("edis")) { + message = "R Request failed with status code 500"; + } else if (message.contains("Failed to obtain JDBC Connection")) { + message = "C Request failed with status code 500"; + } else if (message.contains("SQLSyntaxErrorException")) { + message = "S Request failed with status code 500"; + } + return new ResponseEntity<>(message, HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/src/main/java/com/rabbiter/market/common/config/BaseWebConfig.java b/src/main/java/com/rabbiter/market/common/config/BaseWebConfig.java new file mode 100644 index 0000000..c456b07 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/config/BaseWebConfig.java @@ -0,0 +1,62 @@ +package com.rabbiter.market.common.config; + +import com.rabbiter.market.common.sercurity.interceptor.EmpLoginInterceptor; +import com.rabbiter.market.common.util.PathUtils; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * 解决:1.跨域问题 + */ +@Configuration +public class BaseWebConfig implements WebMvcConfigurer{ + @Bean + public EmpLoginInterceptor empLoginInterceptor(){ + return new EmpLoginInterceptor(); + } + @Override + public void addInterceptors(InterceptorRegistry registry) { +// registry.addInterceptor(empLoginInterceptor()) +// .addPathPatterns("/**") +// .excludePathPatterns("/","/login") +// .excludePathPatterns("/files/**") +// .excludePathPatterns("/static/**"); + } + + //跨域访问配置 + @Bean + public WebMvcConfigurer corsConfigurer() { + return new WebMvcConfigurer() { + @Override + //重写父类提供的跨域请求处理的接口 + public void addCorsMappings(CorsRegistry registry) { + //添加映射路径 + registry.addMapping("/**") + //放行哪些原始域 + .allowedOrigins("*") + //是否发送Cookie信息 + .allowCredentials(true) + //放行哪些原始域(请求方式) + .allowedMethods("GET", "POST", "PUT", "DELETE","OPTIONS") + //放行哪些原始域(头部信息) + .allowedHeaders("*") + //暴露哪些头部信息(因为跨域访问默认不能获取全部头部信息) + .exposedHeaders("Header1", "Header2"); + } + }; + } + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + String winPath = PathUtils.getClassLoadRootPath() + "/src/main/resources/static/files/"; + + //第一个方法设置访问路径前缀,第二个方法设置资源路径 + registry.addResourceHandler("/files/**"). + addResourceLocations("file:" + winPath); + WebMvcConfigurer.super.addResourceHandlers(registry); + } +} diff --git a/src/main/java/com/rabbiter/market/common/config/DataSourceConfiguration.java b/src/main/java/com/rabbiter/market/common/config/DataSourceConfiguration.java new file mode 100644 index 0000000..a412b0b --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/config/DataSourceConfiguration.java @@ -0,0 +1,67 @@ +package com.rabbiter.market.common.config; +import com.alibaba.druid.pool.DruidDataSource; +import com.alibaba.druid.pool.ExceptionSorter; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.sql.SQLException; +import java.util.Properties; + +/** + * Description + * Author: + * Date: 2024/2/26 23:39 + **/ +@Configuration +public class DataSourceConfiguration { + @Value("${spring.datasource.druid.driver-class-name}") + private String jdbcDriver; + @Value("${spring.datasource.druid.url}") + private String jdbcUrl; + @Value("${spring.datasource.druid.username}") + private String jdbcUsername; + @Value("${spring.datasource.druid.password}") + private String jdbcPassword; + + @Bean(name="dataSource") + public DruidDataSource createDataSource() throws Exception { + DruidDataSource dataSource = new DruidDataSource(); + dataSource.setDriverClassName(jdbcDriver); + dataSource.setUrl(jdbcUrl); + dataSource.setUsername(jdbcUsername); + dataSource.setPassword(jdbcPassword); + + // 关闭连接后不自动commit + dataSource.setDefaultAutoCommit(false); + // 设置连接异常处理 + dataSource.setBreakAfterAcquireFailure(true); + // 将SQLException抛出重要配置 + dataSource.setFailFast(true); + dataSource.setConnectionErrorRetryAttempts(0); + // 配置自定义的异常处理器 + dataSource.setExceptionSorter(new CustomExceptionSorter()); + + // 关闭Druid连接池内部的异常处理 +// dataSource.setFilters("stat"); + return dataSource; + } + +} + +class CustomExceptionSorter implements ExceptionSorter { + + @Override + public boolean isExceptionFatal(SQLException e) { + // 将所有异常视为致命异常,即抛出到上层 + // 打印异常堆栈信息 + e.printStackTrace(); + return true; + } + + @Override + public void configFromProperties(Properties properties) { + // 配置信息可以为空 + } +} diff --git a/src/main/java/com/rabbiter/market/common/config/MpConfig.java b/src/main/java/com/rabbiter/market/common/config/MpConfig.java new file mode 100644 index 0000000..d4b8ba4 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/config/MpConfig.java @@ -0,0 +1,20 @@ +package com.rabbiter.market.common.config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class MpConfig { + /*mybatis plus分页插件生效*/ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL); + paginationInnerInterceptor.setOverflow(true); //合理化 + interceptor.addInnerInterceptor(paginationInnerInterceptor); + return interceptor; + } +} diff --git a/src/main/java/com/rabbiter/market/common/config/ProcessContextAware.java b/src/main/java/com/rabbiter/market/common/config/ProcessContextAware.java new file mode 100644 index 0000000..3b71043 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/config/ProcessContextAware.java @@ -0,0 +1,46 @@ +package com.rabbiter.market.common.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.web.context.ServletContextAware; + +import javax.servlet.ServletContext; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +@Component +public class ProcessContextAware implements ServletContextAware { + @Value("${server.port}") + private String port; + + @Override + public void setServletContext(ServletContext servletContext) { + try { + String os = System.getProperty("os.name").toLowerCase(); + + if (os.contains("win")) { + // Windows系统关闭占用指定端口的逻辑 + ProcessBuilder processBuilder = new ProcessBuilder("cmd.exe", "/c", "netstat -ano | findstr " + port); + Process process = processBuilder.start(); + InputStream inputStream = process.getInputStream(); + BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); + String line; + while ((line = reader.readLine()) != null) { + String[] tokens = line.trim().split("\\s+"); + String pid = tokens[tokens.length - 1]; + ProcessBuilder killProcess = new ProcessBuilder("cmd.exe", "/c", "taskkill /F /PID " + pid); + killProcess.start(); + } + } else if (os.contains("nix") || os.contains("nux") || os.contains("mac")) { + // Linux或Mac OS系统关闭占用指定端口的逻辑 + ProcessBuilder processBuilder = new ProcessBuilder("/bin/bash", "-c", "lsof -ti:" + port + " | xargs kill -9"); + processBuilder.start(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/common/constants/HttpStatus.java b/src/main/java/com/rabbiter/market/common/constants/HttpStatus.java new file mode 100644 index 0000000..8e142ac --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/constants/HttpStatus.java @@ -0,0 +1,24 @@ +package com.rabbiter.market.common.constants; + +public interface HttpStatus { + /** + * 操作成功 + */ + Integer CODE_SUCCESS = 200; + /** + * 请先登录 + */ + Integer CODE_NOLOGIN = 401; + /** + * 系统异常,请联系管理员 + */ + Integer CODE_ERROR = 500; + /** + * 参数异常 + */ + Integer CODE_ERROR_PARAM = 400; + + /**业务异常*/ + Integer CODE_BUSINESS_ERROR=50000; + +} diff --git a/src/main/java/com/rabbiter/market/common/exception/BusinessException.java b/src/main/java/com/rabbiter/market/common/exception/BusinessException.java new file mode 100644 index 0000000..f6b7eb2 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/exception/BusinessException.java @@ -0,0 +1,13 @@ +package com.rabbiter.market.common.exception; + +import com.rabbiter.market.common.constants.HttpStatus; + +public class BusinessException extends SysException { + public BusinessException(String message, Integer code) { + super(message, code); + } + + public BusinessException(String msg) { + super(msg, HttpStatus.CODE_BUSINESS_ERROR); + } +} diff --git a/src/main/java/com/rabbiter/market/common/exception/SysException.java b/src/main/java/com/rabbiter/market/common/exception/SysException.java new file mode 100644 index 0000000..5982abc --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/exception/SysException.java @@ -0,0 +1,24 @@ +package com.rabbiter.market.common.exception; + +import com.rabbiter.market.common.constants.HttpStatus; + +public class SysException extends RuntimeException { + private Integer code; + + public SysException(String message, Integer code) { + super(message); + this.code = code; + } + public SysException(String msg){ + super(msg); + this.code= HttpStatus.CODE_ERROR; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } +} diff --git a/src/main/java/com/rabbiter/market/common/redis/config/RedisConfig.java b/src/main/java/com/rabbiter/market/common/redis/config/RedisConfig.java new file mode 100644 index 0000000..4a42b05 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/redis/config/RedisConfig.java @@ -0,0 +1,27 @@ +package com.rabbiter.market.common.redis.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +@Configuration +public class RedisConfig { + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(connectionFactory); + template.setKeySerializer(new StringRedisSerializer()); //设置redis key 的序列化方式为String + template.setValueSerializer(new GenericJackson2JsonRedisSerializer());//设置value的序列化方式为jackson方式,默认的序列化方式是jdk的序列化 + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer() );//设置hash类型的value序列化方式 + /** + * 为什么要序列化? + * 为了把对象持久化保存起来,从内存保存到磁盘中 + * 对象可以被序列化,需要实现Serializable接口 + * */ + return template; + } +} diff --git a/src/main/java/com/rabbiter/market/common/redis/constants/RedisKeys.java b/src/main/java/com/rabbiter/market/common/redis/constants/RedisKeys.java new file mode 100644 index 0000000..3003c7c --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/redis/constants/RedisKeys.java @@ -0,0 +1,72 @@ +package com.rabbiter.market.common.redis.constants; + + +import java.util.concurrent.TimeUnit; + +public enum RedisKeys { + //用户注册 + LOGIN_USER("LOGIN_USER",1440L,TimeUnit.MINUTES), + //登录密码错误次数 + LOGIN_ERRO_PWDNUM("LOGIN_ERRO_PWDNUM",1L,TimeUnit.DAYS), + //商品分类信息的缓存 + GOODS_CATEGORY("GOODS_CATEGORY",24L,TimeUnit.HOURS), + //账户冻结6小时 + DISABLEUSER("DISABLEUSER",6L,TimeUnit.HOURS); + + private String prefix; //前缀 + private Long timeout; //失效时间 + private TimeUnit timeUnit; //时间单位 + + private final String SEP=":";//key分隔符 + + RedisKeys(String prefix, Long timeout, TimeUnit timeUnit) { + this.prefix = prefix; + this.timeout = timeout; + this.timeUnit = timeUnit; + } + + RedisKeys(String prefix, Long timeout) { + this(prefix, timeout, TimeUnit.MINUTES); + } + RedisKeys(String prefix){ + this(prefix,30L,TimeUnit.MINUTES); + } + + public String join(String ...suffix){ + + StringBuilder sb = new StringBuilder(80); + sb.append(this.prefix); + for (String s : suffix) { + sb.append(getSEP()).append(s); + } + return sb.toString(); + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public Long getTimeout() { + return timeout; + } + + public void setTimeout(Long timeout) { + this.timeout = timeout; + } + + public TimeUnit getTimeUnit() { + return timeUnit; + } + + public void setTimeUnit(TimeUnit timeUnit) { + this.timeUnit = timeUnit; + } + + public String getSEP() { + return SEP; + } +} diff --git a/src/main/java/com/rabbiter/market/common/redis/service/RedisTemplateService.java b/src/main/java/com/rabbiter/market/common/redis/service/RedisTemplateService.java new file mode 100644 index 0000000..9f53509 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/redis/service/RedisTemplateService.java @@ -0,0 +1,322 @@ +package com.rabbiter.market.common.redis.service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.BoundSetOperations; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.concurrent.TimeUnit; + +@Service +public class RedisTemplateService { + @Autowired + public RedisTemplate redisTemplate; + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + */ + public void setCacheObject(final String key, final T value) { + redisTemplate.opsForValue().set(key, value); + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * 如果key不存在,缓存, 如果存在不做任何操作 + * + * @param key 缓存的键值 + * @param value 缓存的值 + */ + public void setnxCacheObject(final String key, final T value) { + redisTemplate.opsForValue().setIfAbsent(key, value); + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * 如果key不存在,缓存, 如果存在不做任何操作 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param timeout 时间 + * @param timeUnit 时间颗粒度 + */ + public void setCacheObject(final String key, final T value, final Long timeout, final TimeUnit timeUnit) { + redisTemplate.opsForValue().set(key, value, timeout, timeUnit); + } + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param timeout 时间 + * @param timeUnit 时间颗粒度 + */ + public void setnxCacheObject(final String key, final T value, final Long timeout, final TimeUnit timeUnit) { + redisTemplate.opsForValue().setIfAbsent(key, value, timeout, timeUnit); + } + + + /** + * 给指定key值减delta + * @param key + * @param delta + */ + public Long decrementCacheObjectValue(final String key,final long delta){ + return redisTemplate.opsForValue().decrement(key, delta); + } + + /** + * 给指定key值减一 + * @param key + */ + public Long decrementCacheObjectValue(final String key){ + return redisTemplate.opsForValue().decrement(key); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout) { + return expire(key, timeout, TimeUnit.SECONDS); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @param unit 时间单位 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout, final TimeUnit unit) { + return redisTemplate.expire(key, timeout, unit); + } + + /** + * 获取有效时间 + * + * @param key Redis键 + * @return 有效时间 + */ + public long getExpire(final String key) { + return redisTemplate.getExpire(key); + } + + /** + * 判断 key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public Boolean hasKey(String key) { + return redisTemplate.hasKey(key); + } + + /** + * 获得缓存的基本对象。 + * + * @param key 缓存键值 + * @return 缓存键值对应的数据 + */ + public T getCacheObject(final String key) { + ValueOperations operation = redisTemplate.opsForValue(); + return operation.get(key); + } + + /** + * 删除单个对象 + * + * @param key + */ + public boolean deleteObject(final String key) { + return redisTemplate.delete(key); + } + + /** + * 删除集合对象 + * + * @param collection 多个对象 + * @return + */ + public boolean deleteObject(final Collection collection) { + return redisTemplate.delete(collection) > 0; + } + + /** + * 缓存List数据 + * + * @param key 缓存的键值 + * @param dataList 待缓存的List数据 + * @return 缓存的对象 + */ + public long setCacheList(final String key, final List dataList) { + Long count = redisTemplate.opsForList().rightPushAll(key, dataList); + return count == null ? 0 : count; + } + + /** + * 获得缓存的list对象 + * + * @param key 缓存的键值 + * @return 缓存键值对应的数据 + */ + public List getCacheList(final String key) { + return redisTemplate.opsForList().range(key, 0, -1); + } + + /** + * 缓存Set + * + * @param key 缓存键值 + * @param dataSet 缓存的数据 + * @return 缓存数据的对象 + */ + public BoundSetOperations setCacheSet(final String key, final Set dataSet) { + BoundSetOperations setOperation = redisTemplate.boundSetOps(key); + Iterator it = dataSet.iterator(); + while (it.hasNext()) { + setOperation.add(it.next()); + } + return setOperation; + } + + /** + * 获得缓存的set + * + * @param key + * @return + */ + public Set getCacheSet(final String key) { + return redisTemplate.opsForSet().members(key); + } + + /** + * 指定的value是否包含在缓存set中 + * @param key + * @param value + * @param + * @return + */ + public boolean isCacheSetContains(final String key, final T value){ + return redisTemplate.opsForSet().isMember(key, value); + } + + /** + * 从缓存set 中删除value值 + * @param key + * @param value + * @param + * @return + */ + public Long deleteCacheSetValue(final String key, final T value){ + return redisTemplate.opsForSet().remove(key, value); + } + + /** + * 往缓存set中添加value值 + * @param key + * @param value + * @param + * @return + */ + public Long addCacheSetValue(final String key, final T value){ + return redisTemplate.opsForSet().add(key, value); + } + + + /** + * 缓存Map + * + * @param key + * @param dataMap + */ + public void setCacheMap(final String key, final Map dataMap) { + if (dataMap != null) { + redisTemplate.opsForHash().putAll(key, dataMap); + } + } + + /** + * 获得缓存的Map + * + * @param key + * @return + */ + public Map getCacheMap(final String key) { + return redisTemplate.opsForHash().entries(key); + } + + /** + * 往Hash中存入数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @param value 值 + */ + public void setCacheMapValue(final String key, final String hKey, final T value) { + redisTemplate.opsForHash().put(key, hKey, value); + } + + /** + * 获取Hash中的数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return Hash中的对象 + */ + public T getCacheMapValue(final String key, final String hKey) { + HashOperations opsForHash = redisTemplate.opsForHash(); + return opsForHash.get(key, hKey); + } + + /** + * 获取多个Hash中的数据 + * + * @param key Redis键 + * @param hKeys Hash键集合 + * @return Hash对象集合 + */ + public List getMultiCacheMapValue(final String key, final Collection hKeys) { + return redisTemplate.opsForHash().multiGet(key, hKeys); + } + + /** + * 删除Hash中的某条数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return 是否成功 + */ + public boolean deleteCacheMapValue(final String key, final String hKey) { + return redisTemplate.opsForHash().delete(key, hKey) > 0; + } + + /** + * 给hash中hk 值 + increment + * @param key + * @param hk + * @param increment + */ + public Long incrementCacheMapValue(final String key,final Object hk, final long increment){ + return redisTemplate.opsForHash().increment(key, hk, increment); + } + + /** + * 获得缓存的基本对象列表 + * + * @param pattern 字符串前缀 + * @return 对象列表 + */ + public Collection keys(final String pattern) { + return redisTemplate.keys(pattern); + } +} diff --git a/src/main/java/com/rabbiter/market/common/sercurity/annotation/HasPermisson.java b/src/main/java/com/rabbiter/market/common/sercurity/annotation/HasPermisson.java new file mode 100644 index 0000000..7cba034 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/sercurity/annotation/HasPermisson.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.common.sercurity.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 判断是否有权限 + */ +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface HasPermisson { + String value(); +} diff --git a/src/main/java/com/rabbiter/market/common/sercurity/annotation/NoRequireLogin.java b/src/main/java/com/rabbiter/market/common/sercurity/annotation/NoRequireLogin.java new file mode 100644 index 0000000..f43489c --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/sercurity/annotation/NoRequireLogin.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.common.sercurity.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 登录检查注解: + * 贴有该注解接口方法必须进行登录检查 + */ +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface NoRequireLogin { +} diff --git a/src/main/java/com/rabbiter/market/common/sercurity/interceptor/EmpLoginInterceptor.java b/src/main/java/com/rabbiter/market/common/sercurity/interceptor/EmpLoginInterceptor.java new file mode 100644 index 0000000..25fad4b --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/sercurity/interceptor/EmpLoginInterceptor.java @@ -0,0 +1,95 @@ +package com.rabbiter.market.common.sercurity.interceptor; + + +import com.rabbiter.market.common.constants.HttpStatus; +import com.rabbiter.market.common.redis.constants.RedisKeys; +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.sercurity.annotation.NoRequireLogin; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.alibaba.fastjson.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class EmpLoginInterceptor implements HandlerInterceptor { + @Autowired + private RedisTemplateService redisTemplateService; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + if (!(handler instanceof HandlerMethod)) { + //optinos请求 + return true; + } + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setHeader("Cache-Control", "no-cache"); + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/json"); + //获取token + String token = request.getHeader("token"); + //是否贴有不必登录的注解 + HandlerMethod handler1 = (HandlerMethod) handler; + NoRequireLogin noRequireLogin = handler1.getMethodAnnotation(NoRequireLogin.class); + if (noRequireLogin != null) { + //贴有注解 + return true; + + } else { + if (StringUtils.hasText(token)) { + String value2 = redisTemplateService.getCacheObject(token); + if (!StringUtils.hasText(value2)) { + JsonResult res = JsonResult.error(HttpStatus.CODE_BUSINESS_ERROR, "请先登录"); + String result = JSONObject.toJSONString(res); + response.getWriter().println(result); + response.getWriter().flush(); + return false; + } else { + //缓存有值,延长存储时间 + redisTemplateService.expire(token, RedisKeys.LOGIN_USER.getTimeout(), RedisKeys.LOGIN_USER.getTimeUnit()); + } + } else { + //没有token + JsonResult res = JsonResult.error(HttpStatus.CODE_BUSINESS_ERROR, "请先登录"); + String result = JSONObject.toJSONString(res); + response.getWriter().println(result); + response.getWriter().flush(); + return false; + } + } + //是否贴有HasPermisson注解 + HasPermisson hasPermisson = handler1.getMethodAnnotation(HasPermisson.class); + if (hasPermisson != null) { + if (!StringUtils.hasText(token)) { + //没有token + JsonResult res = JsonResult.error(HttpStatus.CODE_BUSINESS_ERROR, "请先登录"); + String result = JSONObject.toJSONString(res); + response.getWriter().println(result); + response.getWriter().flush(); + return false; + } + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + //判断是否是系统管理员 + if (employee.getIsAdmin()) { + return true; + } + String value = hasPermisson.value(); + boolean contains = employee.getFlags().contains(value); + if (!contains) { + JsonResult res = JsonResult.error(HttpStatus.CODE_BUSINESS_ERROR, "您没有权限操作"); + String result = JSONObject.toJSONString(res); + response.getWriter().println(result); + response.getWriter().flush(); + return false; + } + } + + return true; + } + +} diff --git a/src/main/java/com/rabbiter/market/common/sercurity/resolver/UserInfoArgumentResolver.java b/src/main/java/com/rabbiter/market/common/sercurity/resolver/UserInfoArgumentResolver.java new file mode 100644 index 0000000..11f858a --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/sercurity/resolver/UserInfoArgumentResolver.java @@ -0,0 +1,47 @@ +package com.rabbiter.market.common.sercurity.resolver; + + +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.alibaba.fastjson.JSON; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.MethodParameter; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.support.WebDataBinderFactory; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.method.support.ModelAndViewContainer; + +import javax.servlet.http.HttpServletRequest; + +/** + * 自定义参数解析器 + * 作用:将请求映射方法(接口)中声明UserInfo类型的参数解析成当前登录用户对象 + */ +public class UserInfoArgumentResolver implements HandlerMethodArgumentResolver { + @Autowired + private RedisTemplateService redisService; + //当前解析器能解析类型--表示当前解析器要解析的参数类型-UserInfo + @Override + public boolean supportsParameter(MethodParameter methodParameter) { + return + methodParameter.getParameterType() == Employee.class + && methodParameter.hasParameterAnnotation(UserParam.class); + } + //怎么解析支持的参数--怎么讲UserInfo参数解析成当前登录用户对象 + //必须保证supportsParameter 返回true 才会执行 + @Override + public Object resolveArgument(MethodParameter methodParameter, + ModelAndViewContainer modelAndViewContainer, + NativeWebRequest nativeWebRequest, + WebDataBinderFactory webDataBinderFactory) throws Exception { + //token--request-- + HttpServletRequest request = nativeWebRequest.getNativeRequest(HttpServletRequest.class); + String token = request.getHeader("token"); + String userStr = redisService.getCacheObject(token); + if(!StringUtils.hasText(userStr)){ + return null; + } + return JSON.parseObject(userStr, Employee.class); + } +} diff --git a/src/main/java/com/rabbiter/market/common/sercurity/resolver/UserParam.java b/src/main/java/com/rabbiter/market/common/sercurity/resolver/UserParam.java new file mode 100644 index 0000000..6a74135 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/sercurity/resolver/UserParam.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.common.sercurity.resolver; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 定义userInfo 参数注入注解 + * 贴有该注解UserInfo类型的参数使用自定义参数数解析 + */ +@Target({ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserParam { +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/common/util/DateUtil.java b/src/main/java/com/rabbiter/market/common/util/DateUtil.java new file mode 100644 index 0000000..39c11de --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/util/DateUtil.java @@ -0,0 +1,29 @@ +package com.rabbiter.market.common.util; + +import java.util.Calendar; +import java.util.Date; + +public class DateUtil { + /** + * 获取两个时间的间隔(秒) + * @param d1 + * @param d2 + * @return + */ + public static long getDateBetween(Date d1, Date d2){ + return Math.abs((d1.getTime()-d2.getTime())/1000);//取绝对值 + } + + public static Date getEndDate(Date date) { + if (date == null) { + return null; + } + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.set(Calendar.HOUR_OF_DAY,23); + c.set(Calendar.MINUTE,59); + c.set(Calendar.SECOND,59); + return c.getTime(); + } + +} diff --git a/src/main/java/com/rabbiter/market/common/util/PathUtils.java b/src/main/java/com/rabbiter/market/common/util/PathUtils.java new file mode 100644 index 0000000..1933f03 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/util/PathUtils.java @@ -0,0 +1,75 @@ +package com.rabbiter.market.common.util; + +import org.apache.tomcat.util.http.fileupload.FileItem; +import org.apache.tomcat.util.http.fileupload.FileItemFactory; +import org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory; +import org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload; +import org.apache.tomcat.util.http.fileupload.servlet.ServletRequestContext; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.io.FileOutputStream; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.util.List; +import java.util.Random; +import java.util.UUID; + +public class PathUtils { + public static String getClassLoadRootPath() { + String path = ""; + try { + String prePath = URLDecoder.decode(PathUtils.class.getClassLoader().getResource("").getPath(),"utf-8").replace("/target/classes", ""); + String osName = System.getProperty("os.name"); + if (osName.toLowerCase().startsWith("mac")) { + // 苹果 + path = prePath.substring(0, prePath.length() - 1); + } else if (osName.toLowerCase().startsWith("windows")) { + // windows + path = prePath.substring(1, prePath.length() - 1); + } else if(osName.toLowerCase().startsWith("linux") || osName.toLowerCase().startsWith("unix")) { + // unix or linux + path = prePath.substring(0, prePath.length() - 1); + } else { + path = prePath.substring(1, prePath.length() - 1); + } + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return path; + } + + public static String upload(MultipartFile multipartFile) { + String res = null; // 返回网络路径 + try { + String staticDir = PathUtils.getClassLoadRootPath() + "/src/main/resources/static/files/"; + // 如果结果目录不存在,则创建目录 + File resDirFile = new File(staticDir); + if(!resDirFile.exists()) { + boolean flag = resDirFile.mkdirs(); + if(!flag) throw new RuntimeException("创建结果目录失败"); + } + // 获取MultipartFile的字节数组 + byte[] fileBytes = multipartFile.getBytes(); + + // 创建文件对象 + + // 加个时间戳防止重名 + String newFileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename(); + res = "/files/" + newFileName; + // 写文件 + File file = new File(staticDir + newFileName); + + // 将字节数组写入文件 + FileOutputStream fos = new FileOutputStream(file); + fos.write(fileBytes); + fos.close(); + + } catch (Exception e) { + e.printStackTrace(); + } + return res; + } + +} diff --git a/src/main/java/com/rabbiter/market/common/util/UploadUtil.java b/src/main/java/com/rabbiter/market/common/util/UploadUtil.java new file mode 100644 index 0000000..bd966cd --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/util/UploadUtil.java @@ -0,0 +1,64 @@ +package com.rabbiter.market.common.util; + +import org.apache.commons.io.FilenameUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.io.ByteArrayInputStream; +import java.util.Base64; +import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 文件上传工具 + */ +public class UploadUtil { + //阿里域名 + private static final String ALI_DOMAIN = "https://zyl-9.oss-cn-chengdu.aliyuncs.com/"; + private static final String ENDPOINT = "http://oss-cn-chengdu.aliyuncs.com"; + private static final String BUCKET_NAME = "zyl-9"; + + private static final String ACCESS_KEY_ID = "LTAI5tGxrbz4oXKzQ63LZzQn"; + private static final String ACCESS_KEY_SECRET = "Do4mpXNQ4bOTzpNqrUhTeQSSwrXfHe"; + private static final String path = "wolf2w-70"; + //MultipartFile 对象 +// public static String uploadAli(MultipartFile file,String path_suffix) throws Exception { +// //生成文件名称 +// String uuid = UUID.randomUUID().toString(); +// String orgFileName =file.getOriginalFilename();//获取真实文件名称 xxx.jpg +// String ext= "." + FilenameUtils.getExtension(orgFileName);//获取拓展名字.jpg +// String fileName =path+path_suffix+"/"+uuid + ext;//xxxxxsfsasa.jpg +// // 创建OSSClient实例。 +// OSS ossClient = new OSSClientBuilder().build(ENDPOINT, ACCESS_KEY_ID,ACCESS_KEY_SECRET); +// // 上传文件流。 +// ossClient.putObject(BUCKET_NAME, fileName, file.getInputStream()); +// // 关闭OSSClient。 +// ossClient.shutdown(); +// return ALI_DOMAIN + fileName; +// } + +} + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/rabbiter/market/common/web/response/JsonResult.java b/src/main/java/com/rabbiter/market/common/web/response/JsonResult.java new file mode 100644 index 0000000..f23ed15 --- /dev/null +++ b/src/main/java/com/rabbiter/market/common/web/response/JsonResult.java @@ -0,0 +1,79 @@ +package com.rabbiter.market.common.web.response; + +import com.rabbiter.market.common.constants.HttpStatus; + +public class JsonResult { + public static final int CODE_SUCCESS = HttpStatus.CODE_SUCCESS; + public static final String MSG_SUCCESS = "操作成功"; + public static final int CODE_NOLOGIN = HttpStatus.CODE_NOLOGIN; + public static final String MSG_NOLOGIN = "请先登录"; + public static final int CODE_ERROR = HttpStatus.CODE_ERROR; + public static final String MSG_ERROR = "系统异常,请联系管理员"; + public static final int CODE_ERROR_PARAM = HttpStatus.CODE_ERROR_PARAM; //参数异常 + + private int code; //区分不同结果, 而不再是true或者false + private String msg; + private T data; //除了操作结果之后, 还行携带数据返回 + public JsonResult(int code, String msg, T data){ + this.code = code; + this.msg = msg; + this.data = data; + } + + public JsonResult() { + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + public static JsonResult success(T data){ + return new JsonResult(CODE_SUCCESS, MSG_SUCCESS, data); + } + + public static JsonResult success(){ + return new JsonResult(CODE_SUCCESS, MSG_SUCCESS, null); + } + + public static JsonResult error(int code, String msg, T data){ + return new JsonResult(code, msg, data); + } + public static JsonResult error(int code, String msg){ + return new JsonResult(code, msg, null); + } + public static JsonResult defaultError(){ + return new JsonResult(CODE_ERROR, MSG_ERROR, null); + } + + + public static JsonResult noLogin() { + return new JsonResult(CODE_NOLOGIN, MSG_NOLOGIN, null); + } + + public static JsonResult noPermission() { + return new JsonResult(403, "非法访问", null); + } + + + +} diff --git a/src/main/java/com/rabbiter/market/controller/goods_management/goods/GoodsController.java b/src/main/java/com/rabbiter/market/controller/goods_management/goods/GoodsController.java new file mode 100644 index 0000000..3d0161b --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/goods_management/goods/GoodsController.java @@ -0,0 +1,145 @@ +package com.rabbiter.market.controller.goods_management.goods; + +import com.rabbiter.market.common.sercurity.annotation.NoRequireLogin; +import com.rabbiter.market.common.util.PathUtils; +import com.rabbiter.market.common.util.UploadUtil; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.goods_management.goods.Goods; +import com.rabbiter.market.domain.goods_management.goods_category.GoodsCategory; +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; +import com.rabbiter.market.qo.goods_management.goods.QueryGoods; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.service.goods_management.goods_category.IGoodsCategoryService; +import com.rabbiter.market.vo.goods.GoodsListVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.validation.constraints.NotNull; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/goods_management/goods") +public class GoodsController { + @Autowired + private IGoodsService goodsService; + + @Resource + private IGoodsCategoryService goodsCategoryService; + + /*查询信息*/ + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QueryGoods qo) { + Page page = goodsService.queryPageByQo(qo); + for (GoodsListVo goods : page.getRecords()) { + if(ObjectUtils.isEmpty(goods.getCategoryId())) { + goods.setCategoryName(""); + } else { + GoodsCategory goodsCategory = goodsCategoryService.getById(goods.getCategoryId()); + if(ObjectUtils.isEmpty(goodsCategory)) { + goods.setCategoryName(""); + } else { + goods.setCategoryName(goodsCategory.getName()); + } + } + } + return JsonResult.success(page); + } + + /** + * 上传图片到阿里云oss + * 返回网络图片地址,uploaded:1:成功 0:失败 + * + * @param upload + * @return + */ + @NoRequireLogin + @PostMapping("/uploadImg") + public Map uploadImg(@RequestParam("file") MultipartFile upload) { + Map map = new HashMap<>(); + if (upload != null && upload.getSize() > 0) { + String path = ""; + try { + path = PathUtils.upload(upload); + map.put("uploaded", 1); //成功 + map.put("url", path); //成功 + } catch (Exception e) { + e.printStackTrace(); + map.put("uploaded", 0); //失败 + Map errorMap = new HashMap<>(); + errorMap.put("message", e.getMessage()); + map.put("error", errorMap); + } + } else { + map.put("uploaded", 0); //失败 + Map errorMap = new HashMap<>(); + errorMap.put("message", "上传失败,图片文件异常"); + map.put("error", errorMap); + } + return map; + } + /*保存*/ + @PostMapping("/save") + public JsonResult saveGoods(Goods goods, HttpServletRequest request){ + goodsService.saveGoods(goods,(String) request.getHeader("token")); + return JsonResult.success(); + } + /*上/下架*/ + + @PostMapping("/upOrdown") + public JsonResult upOrdown(@NotNull(message = "商品编号不能为空") Long gid, String state,HttpServletRequest request){ + goodsService.upOrdown(gid,state,(String) request.getHeader("token")); + return JsonResult.success(); + } + @GetMapping("/queryGoodsById") + public JsonResult queryGoodsById(@NotNull(message = "商品编号不能为空") Long id){ + Goods goods = goodsService.getById(id); + if(ObjectUtils.isEmpty(goods.getCategoryId())) { + goods.setCategoryName(""); + } else { + GoodsCategory goodsCategory = goodsCategoryService.getById(goods.getCategoryId()); + if(ObjectUtils.isEmpty(goodsCategory)) { + goods.setCategoryName(""); + } else { + goods.setCategoryName(goodsCategory.getName()); + } + } + return JsonResult.success(goodsService.getById(id)); + } + + @PostMapping("/update") + public JsonResult update(Goods goods, HttpServletRequest request){ + goodsService.updateGoods(goods,(String)request.getHeader("token")); + return JsonResult.success(); + } + + @GetMapping("/selected_goodsAll") + public JsonResult selected_goodsAll(){ + List> list=goodsService.selected_goodsAll(); + return JsonResult.success(list); + } + + @GetMapping("/selected_storeAll") + public JsonResult selected_storeAll(){ + List> list=goodsService.selected_storeAll(); + return JsonResult.success(list); + } + + + /*退还商品入库*/ + @PostMapping("/returnGoods") + public JsonResult returnGoods(DetailStoreGoods detailStoreGoods, HttpServletRequest request){ + goodsService.returnGoods(detailStoreGoods,(String) request.getHeader("token")); + return JsonResult.success(); + } + + +} diff --git a/src/main/java/com/rabbiter/market/controller/goods_management/goods_category/GoodsCategoryController.java b/src/main/java/com/rabbiter/market/controller/goods_management/goods_category/GoodsCategoryController.java new file mode 100644 index 0000000..5d277f2 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/goods_management/goods_category/GoodsCategoryController.java @@ -0,0 +1,60 @@ +package com.rabbiter.market.controller.goods_management.goods_category; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.goods_management.goods_category.GoodsCategory; +import com.rabbiter.market.qo.goods_management.goods_category.QueryGoodsCategory; +import com.rabbiter.market.service.goods_management.goods_category.IGoodsCategoryService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/goods_management/goods_category") +public class GoodsCategoryController { + @Autowired + private IGoodsCategoryService goodsCategoryService; + + /*保存信息接口*/ + @HasPermisson("goods_management:goods_category:save") + @PostMapping("/save") + public JsonResult saveGoodsCategory(GoodsCategory category){ + goodsCategoryService.saveGoodsCategory(category); + return JsonResult.success(); + } + + /*修改接口*/ + @HasPermisson("goods_management:goods_category:update") + @PostMapping("/update") + public JsonResult updateGoodsCategory(GoodsCategory category){ + goodsCategoryService.updateGoodsCategory(category); + return JsonResult.success(); + } + /*停用*/ + @HasPermisson("goods_management:goods_category:deactivate") + @PostMapping("/deactivate") + public JsonResult deactivate(Long cid){ + goodsCategoryService.deactivate(cid); + return JsonResult.success(); + } + /*查询信息*/ + @HasPermisson("goods_management:goods_category:list") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QueryGoodsCategory qo) { + Page page = goodsCategoryService.queryPageByQo(qo); + return JsonResult.success(page); + } + @GetMapping("/normalCategoryAll") + public JsonResult getNormalCategoryAll(){ + List> list=goodsCategoryService.getNormalCategoryAll(); + return JsonResult.success(list); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/goods_management/goods_store/GoodsStoreController.java b/src/main/java/com/rabbiter/market/controller/goods_management/goods_store/GoodsStoreController.java new file mode 100644 index 0000000..a632295 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/goods_management/goods_store/GoodsStoreController.java @@ -0,0 +1,42 @@ +package com.rabbiter.market.controller.goods_management.goods_store; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.qo.goods_management.goods_store.QueryGoodsStore; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.vo.goods_management.goods_store.GoodsStoreVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +@RequestMapping("/goods_management/goods_store") +public class GoodsStoreController { + @Autowired + private IGoodsService goodsService; + /*查询信息*/ + @HasPermisson("goods_management:goods_store:list") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QueryGoodsStore qo) { + Page page = goodsService.queryPageGoodsStore(qo); + return JsonResult.success(page); + } + + @GetMapping("/queryGoodsStoreById") + public JsonResult queryGoodsStoreById(Long id) { + GoodsStoreVo vo= goodsService.queryGoodsStoreById(id); + return JsonResult.success(vo); + } + + @PostMapping("/updateInventory") + public JsonResult updateInventory(GoodsStoreVo vo) { + goodsService.updateInventory(vo); + return JsonResult.success(); + } + +} diff --git a/src/main/java/com/rabbiter/market/controller/goods_management/point_products/PointProductController.java b/src/main/java/com/rabbiter/market/controller/goods_management/point_products/PointProductController.java new file mode 100644 index 0000000..0428583 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/goods_management/point_products/PointProductController.java @@ -0,0 +1,63 @@ +package com.rabbiter.market.controller.goods_management.point_products; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.goods_management.point_products.PointProducts; +import com.rabbiter.market.qo.goods_management.point_products.QueryPointProducts; +import com.rabbiter.market.service.goods_management.point_products.IPointProductsService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/goods_management/point_products") +public class PointProductController { + @Autowired + private IPointProductsService pointProductsService; + /*查询信息*/ + @HasPermisson("goods_management:point_products:list") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QueryPointProducts qo) { + Page page = pointProductsService.queryPageByQo(qo); + return JsonResult.success(page); + } + + @GetMapping("/del") + public JsonResult del(Long id) { + pointProductsService.del(id); + return JsonResult.success(); + } + @GetMapping("/queryOptionGoods") + public JsonResult queryOptionGoods() { + List> list=pointProductsService.queryOptionGoods(); + return JsonResult.success(list); + } + + @PostMapping("/savePointGoods") + public JsonResult savePointGoods(PointProducts pointProducts, HttpServletRequest request) { + pointProductsService.savePointGoods(pointProducts,(String) request.getHeader("token")); + return JsonResult.success(); + } + @GetMapping("/queryPointGoodsById") + public JsonResult queryPointGoodsById(Long goodsId) { + PointProducts pointProducts = pointProductsService.getOne(new QueryWrapper().eq("goods_id", goodsId)); + return JsonResult.success(pointProducts); + } + + @PostMapping("/updatePointGoods") + public JsonResult updatePointGoods(PointProducts pointProducts, HttpServletRequest request) { + pointProductsService.updatePointGoods(pointProducts,(String) request.getHeader("token")); + return JsonResult.success(); + } + +} diff --git a/src/main/java/com/rabbiter/market/controller/goods_management/statistic_sale/StatisticSaleController.java b/src/main/java/com/rabbiter/market/controller/goods_management/statistic_sale/StatisticSaleController.java new file mode 100644 index 0000000..3f3030d --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/goods_management/statistic_sale/StatisticSaleController.java @@ -0,0 +1,28 @@ +package com.rabbiter.market.controller.goods_management.statistic_sale; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.qo.goods_management.statistic_sale.QueryStatisticSale; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.vo.statistics.sale_management.SalesStatisticsVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +@RequestMapping("/goods_management/statistic_sale") +public class StatisticSaleController { + @Autowired + private IGoodsService goodsService; + + @HasPermisson("goods_management:statistic_sale:list") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QueryStatisticSale qo) { + SalesStatisticsVo vo = goodsService.queryPageStatisticSaleByQo(qo); + return JsonResult.success(vo); + } + +} diff --git a/src/main/java/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreInController.java b/src/main/java/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreInController.java new file mode 100644 index 0000000..3fa12b7 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreInController.java @@ -0,0 +1,58 @@ +package com.rabbiter.market.controller.inventory_management.detail_store_goods; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; +import com.rabbiter.market.qo.inventory_management.detail_store_goods.QueryDetailStoreGoods; +import com.rabbiter.market.service.inventory_management.detail_store_goods.IDetailStoreGoodsService; +import com.rabbiter.market.service.inventory_management.supplier.ISupplierService; +import com.rabbiter.market.vo.detail_store_goods.DetailStoreGoodsVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.constraints.NotEmpty; +import java.util.List; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/inventory_management/detail_store_goods_in") +public class StoreInController { + @Autowired + private IDetailStoreGoodsService detailStoreGoodsService; + @Autowired + private ISupplierService supplierService; + + @HasPermisson("inventory_management:detail_store_goods_in:save") + @PostMapping("/save") + public JsonResult saveIn(DetailStoreGoods detailStoreGoods, HttpServletRequest request) { + detailStoreGoodsService.saveIn(detailStoreGoods, (String) request.getHeader("token")); + return JsonResult.success(); + } + + @HasPermisson("inventory_management:detail_store_goods_in:list") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QueryDetailStoreGoods qo) { + Page page = detailStoreGoodsService.queryPageByQoIn(qo); + return JsonResult.success(page); + } + + @HasPermisson("inventory_management:detail_store_goods_in:delIn") + @PostMapping("/delIn") + public JsonResult delIn(@NotEmpty(message = "系统编号不能为空") String cn) { + detailStoreGoodsService.delIn(cn); + return JsonResult.success(); + } + @HasPermisson("inventory_management:detail_store_goods_in:save") + @GetMapping("/queryOptionsSuppliers") + public JsonResult queryOptionsSuppliers() { + List> list = supplierService.queryOptionsSuppliers(); + return JsonResult.success(list); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreOutController.java b/src/main/java/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreOutController.java new file mode 100644 index 0000000..bbb8cfa --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreOutController.java @@ -0,0 +1,66 @@ +package com.rabbiter.market.controller.inventory_management.detail_store_goods; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; +import com.rabbiter.market.qo.inventory_management.detail_store_goods.QueryDetailStoreGoodsOut; +import com.rabbiter.market.service.inventory_management.detail_store_goods.IDetailStoreGoodsService; +import com.rabbiter.market.vo.detail_store_goods.DetailStoreGoodsOutVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.constraints.NotEmpty; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/inventory_management/detail_store_goods_out") +public class StoreOutController { + @Autowired + private IDetailStoreGoodsService detailStoreGoodsService; + @HasPermisson("inventory_management:detail_store_goods_out:list") + @PostMapping("/queryPageByQoOut") + public JsonResult queryPageByQoOut(QueryDetailStoreGoodsOut qo){ + Page page=detailStoreGoodsService.queryPageByQoOut(qo); + return JsonResult.success(page); + } + @HasPermisson("inventory_management:detail_store_goods_out:save") + @GetMapping("/initOutOptions") + public JsonResult> initOutOptions(){ + return JsonResult.success(detailStoreGoodsService.initOutOptions()); + } + + @HasPermisson("inventory_management:detail_store_goods_out:save") + @GetMapping("/changeOutGoods") + public JsonResult changeOutGoods(Long gid){ + return JsonResult.success(detailStoreGoodsService.changeOutGoods(gid)); + } + @HasPermisson("inventory_management:detail_store_goods_out:save") + @GetMapping("/changeOutStore") + public JsonResult changeOutStore(Long storeId){ + return JsonResult.success(detailStoreGoodsService.changeOutStore(storeId)); + } + @HasPermisson("inventory_management:detail_store_goods_out:save") + @PostMapping("/queryOutGoods") + public JsonResult queryOutGoods(@RequestParam("goodsId") Long goodsId, + @RequestParam("storeId") Long storeId){ + DetailStoreGoodsOutVo vo=detailStoreGoodsService.queryOutGoods(goodsId,storeId); + return JsonResult.success(vo); + } + @HasPermisson("inventory_management:detail_store_goods_out:save") + @PostMapping("/save") + public JsonResult saveOut(DetailStoreGoods detailStoreGoods,HttpServletRequest request){ + detailStoreGoodsService.saveOut(detailStoreGoods,(String) request.getHeader("token")); + return JsonResult.success(); + } + + @HasPermisson("inventory_management:detail_store_goods_out:delOut") + @PostMapping("/delOut") + public JsonResult delOut(@NotEmpty(message = "系统编号不能为空") String cn) { + detailStoreGoodsService.delIn(cn); + return JsonResult.success(); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/inventory_management/notice/NoticeController.java b/src/main/java/com/rabbiter/market/controller/inventory_management/notice/NoticeController.java new file mode 100644 index 0000000..57786dc --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/inventory_management/notice/NoticeController.java @@ -0,0 +1,64 @@ +package com.rabbiter.market.controller.inventory_management.notice; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; +import com.rabbiter.market.domain.inventory_management.notice.NoticeIn; +import com.rabbiter.market.domain.inventory_management.notice.NoticeOut; +import com.rabbiter.market.qo.inventory_management.notice.QueryNoticeIn; +import com.rabbiter.market.qo.inventory_management.notice.QueryNoticeOut; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.vo.detail_store_goods.notice.NoticeInNotNormalVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; + +@RestController +@Validated +@RequestMapping("/inventory_management/detail_store_goods/notice") +public class NoticeController { + @Autowired + private IGoodsService goodsService; + + @HasPermisson("inventory_management:detail_store_goods_in:notice:list") + @PostMapping("/queryPageNoticeIn") + public JsonResult queryPageNoticeIn(QueryNoticeIn qo) { + Page page = goodsService.queryPageNoticeIn(qo); + return JsonResult.success(page); + } + + @HasPermisson("inventory_management:detail_store_goods_out:notice:list") + @PostMapping("/queryPageNoticeOut_shelves") + public JsonResult queryPageNoticeOut_shelves(QueryNoticeOut qo) { + Page page = goodsService.queryPageNoticeOut_shelves(qo); + return JsonResult.success(page); + } + + @HasPermisson("inventory_management:detail_store_goods_out:notice:saveOut_shelves") + @PostMapping("/saveOut_shelves") + public JsonResult saveOut_shelves(DetailStoreGoods detailStoreGoods, HttpServletRequest request) { + goodsService.saveOut_shelves(detailStoreGoods, (String) request.getHeader("token")); + return JsonResult.success(); + } + + @HasPermisson("inventory_management:detail_store_goods_out:notice:list") + @PostMapping("/queryPageNoticeOut_untreated") + public JsonResult queryPageNoticeOut_untreated(QueryNoticeOut qo) { + Page page = goodsService.queryPageNoticeOut_untreated(qo); + return JsonResult.success(page); + } + + @HasPermisson("inventory_management:detail_store_goods_out:notice:resolveOutUntreatedForm") + @PostMapping("/resolveOutUntreatedForm") + public JsonResult resolveOutUntreatedForm(NoticeInNotNormalVo vo, HttpServletRequest request) { + goodsService.resolveOutUntreatedForm(vo, (String) request.getHeader("token")); + return JsonResult.success(); + } + + +} diff --git a/src/main/java/com/rabbiter/market/controller/inventory_management/store/StorageSituationController.java b/src/main/java/com/rabbiter/market/controller/inventory_management/store/StorageSituationController.java new file mode 100644 index 0000000..92c5213 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/inventory_management/store/StorageSituationController.java @@ -0,0 +1,36 @@ +package com.rabbiter.market.controller.inventory_management.store; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.qo.inventory_management.store.QueryDetailStorageSituation; +import com.rabbiter.market.qo.inventory_management.store.QueryStorageSituation; +import com.rabbiter.market.service.inventory_management.store.IGoodsStoreService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/inventory_management/store/storage_situation") +public class StorageSituationController { + @Autowired + private IGoodsStoreService goodsStoreService; + + @HasPermisson("inventory_management:store:storage_situation") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QueryStorageSituation qo) { + Map map = goodsStoreService.queryPageStorageSituationByQo(qo); + return JsonResult.success(map); + + } + @HasPermisson("inventory_management:store:storage_situation") + @PostMapping("/queryStoreGoodsByStoreId") + public JsonResult queryStoreGoodsByStoreId(QueryDetailStorageSituation qo) { + Map map = goodsStoreService.queryStoreGoodsByStoreId(qo); + return JsonResult.success(map); + + } + +} diff --git a/src/main/java/com/rabbiter/market/controller/inventory_management/store/StoreController.java b/src/main/java/com/rabbiter/market/controller/inventory_management/store/StoreController.java new file mode 100644 index 0000000..b545deb --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/inventory_management/store/StoreController.java @@ -0,0 +1,53 @@ +package com.rabbiter.market.controller.inventory_management.store; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.inventory_management.store.Store; +import com.rabbiter.market.qo.inventory_management.store.QueryStore; +import com.rabbiter.market.service.inventory_management.store.IStoreService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +@RequestMapping("/inventory_management/store") +public class StoreController { + @Autowired + private IStoreService storeService; + /*保存仓库信息接口*/ + @HasPermisson("inventory_management:store:save") + @PostMapping("/save") + public JsonResult saveStore(Store store){ + storeService.saveStore(store); + return JsonResult.success(); + } + /*修改仓库接口*/ + @HasPermisson("inventory_management:store:update") + @PostMapping("/update") + public JsonResult updateStore(Store store){ + storeService.updateStore(store); + return JsonResult.success(); + } + /*停用仓库*/ + @HasPermisson("inventory_management:store:deactivate") + @PostMapping("/deactivate") + public JsonResult deactivate(Long sid){ + storeService.deactivate(sid); + return JsonResult.success(); + } + /*查询仓库信息*/ + @HasPermisson("inventory_management:store:list") + @PostMapping("/list") + public JsonResult list(QueryStore qo){ + return JsonResult.success(storeService.list( new QueryWrapper() + .like(StringUtils.hasText(qo.getName()),"name",qo.getName()) + .eq(StringUtils.hasText(qo.getState()),"state",qo.getState()) + )); + } + +} diff --git a/src/main/java/com/rabbiter/market/controller/inventory_management/supplier/SupplierController.java b/src/main/java/com/rabbiter/market/controller/inventory_management/supplier/SupplierController.java new file mode 100644 index 0000000..cdd2132 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/inventory_management/supplier/SupplierController.java @@ -0,0 +1,53 @@ +package com.rabbiter.market.controller.inventory_management.supplier; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.inventory_management.supplier.Supplier; +import com.rabbiter.market.qo.inventory_management.supplier.QuerySupplier; +import com.rabbiter.market.service.inventory_management.supplier.ISupplierService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +@RequestMapping("/inventory_management/supplier") +public class SupplierController { + @Autowired + private ISupplierService supplierService; + @HasPermisson("inventory_management:supplier:list") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QuerySupplier qo) { + Page page = supplierService.queryPageByQo(qo); + return JsonResult.success(page); + } + @HasPermisson("inventory_management:supplier:save") + @PostMapping("/save") + public JsonResult saveSupplier(Supplier supplier){ + supplierService.saveSupplier(supplier); + return JsonResult.success(); + } + /*修改接口*/ + @HasPermisson("inventory_management:supplier:update") + @PostMapping("/update") + public JsonResult updateSupplier(Supplier supplier){ + supplierService.updateSupplier(supplier); + return JsonResult.success(); + } + @HasPermisson("inventory_management:supplier:update") + @GetMapping("/queryByCn") + public JsonResult queryByCn(Long cn){ + return JsonResult.success(supplierService.getById(cn)); + } + @HasPermisson("inventory_management:supplier:deactivate") + @PostMapping("/deactivate") + public JsonResult deactivate(Long cn){ + supplierService.deactivate(cn); + return JsonResult.success(); + } + +} diff --git a/src/main/java/com/rabbiter/market/controller/login/LoginEmpController.java b/src/main/java/com/rabbiter/market/controller/login/LoginEmpController.java new file mode 100644 index 0000000..f25c0fc --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/login/LoginEmpController.java @@ -0,0 +1,77 @@ +package com.rabbiter.market.controller.login; + +import com.rabbiter.market.common.sercurity.annotation.NoRequireLogin; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.system.menu.Menu; +import com.rabbiter.market.service.login.ILoginService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.constraints.NotEmpty; +import java.util.List; +import java.util.Map; +@RestController +@Validated +public class LoginEmpController { + @Autowired + private ILoginService loginService; + + /** + * 登入功能 + * + * @param username + * @param password + * @return + */ + @NoRequireLogin + @PostMapping("/login") + public JsonResult login(@NotEmpty(message = "账号不能为空") String username, @NotEmpty(message = "密码不能为空") String password) { + Map map = loginService.login(username, password); + return JsonResult.success(map); + + } + + + /** + * 退出功能 + * @return + */ + @NoRequireLogin + @GetMapping("/exit") + public JsonResult exit(HttpServletRequest request) { + String token = request.getHeader("token"); + if (StringUtils.hasLength(token)){ + loginService.exit(token); + } + return JsonResult.success(); + } + @PostMapping("/logout") + public JsonResult logout(@NotEmpty(message = "内容不能为空") String content,HttpServletRequest request) { + + loginService.logout(request.getHeader("token"), content); + + return JsonResult.success(); + } + + /** + * 查询登录者的拥有的菜单 + * @param request + * @return + */ + @GetMapping("/empMenu") + public JsonResult empMenu(HttpServletRequest request){ + List menus=loginService.empMenu((String)request.getHeader("token")); + return JsonResult.success(menus); + } + @NoRequireLogin + @GetMapping("/checkedToken") + public JsonResult checkedToken(String token){ + Map map=loginService.checkedToken(token); + return JsonResult.success(map); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/member_management/member/MemberController.java b/src/main/java/com/rabbiter/market/controller/member_management/member/MemberController.java new file mode 100644 index 0000000..57f7a67 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/member_management/member/MemberController.java @@ -0,0 +1,61 @@ +package com.rabbiter.market.controller.member_management.member; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.member_management.member.Member; +import com.rabbiter.market.qo.member_management.member.QueryMember; +import com.rabbiter.market.service.member_management.member.IMemberService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +@RestController +@Validated +@RequestMapping("/member_management/member") +public class MemberController { + @Autowired + private IMemberService memberService; + + /*查询信息*/ + @HasPermisson("member_management:member:list") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(QueryMember qo) { + Page page = memberService.queryPageByQo(qo); + return JsonResult.success(page); + } + + @HasPermisson("member_management:member:delMember") + @PostMapping("/delMember") + public JsonResult delMember(Long id) { + memberService.delMember(id); + return JsonResult.success(); + } + + @HasPermisson("member_management:member:save") + @PostMapping("/save") + public JsonResult save(Member member) { + memberService.saveMember(member); + return JsonResult.success(); + } + + + @GetMapping("/queryMemberById") + public JsonResult queryMemberById(Long id) { + Member member = memberService.queryMemberById(id); + return JsonResult.success(member); + } + + @HasPermisson("member_management:member:update") + @PostMapping("/update") + public JsonResult updateMember(Member member) { + memberService.updateMember(member); + return JsonResult.success(); + } + + @GetMapping("/queryMemberByPhone") + public JsonResult queryMemberByPhone(String phone) { + Member member = memberService.queryMemberByPhone(phone); + return JsonResult.success(member); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/personal/PersonalController.java b/src/main/java/com/rabbiter/market/controller/personal/PersonalController.java new file mode 100644 index 0000000..ca1b3b2 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/personal/PersonalController.java @@ -0,0 +1,44 @@ +package com.rabbiter.market.controller.personal; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.qo.personal.QueryEditPwd; +import com.rabbiter.market.service.personnel_management.employee.IEmployeeService; +import com.rabbiter.market.vo.employee.InformationVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; + +@RestController +@Validated +@RequestMapping("/personal") +public class PersonalController { + @Autowired + private IEmployeeService employeeService; + + /** + * 修改个人的密码 + * @param request + * @param editPwd + * @return + */ + @HasPermisson("personal:edit_pwd") + @PostMapping("/edit_pwd") + public JsonResult edit_pwd(HttpServletRequest request, QueryEditPwd editPwd){ + String token = request.getHeader("token"); + employeeService.edit_pwd(editPwd,token); + return JsonResult.success(); + } + @HasPermisson("personnel_management:employee:update") + @GetMapping("/information") + public JsonResult information(HttpServletRequest request){ + String token = request.getHeader("token"); + InformationVo vo=employeeService.information(token); + return JsonResult.success(vo); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/personnel_management/department/DeptController.java b/src/main/java/com/rabbiter/market/controller/personnel_management/department/DeptController.java new file mode 100644 index 0000000..657741c --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/personnel_management/department/DeptController.java @@ -0,0 +1,49 @@ +package com.rabbiter.market.controller.personnel_management.department; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.personnel_management.department.Dept; +import com.rabbiter.market.qo.personnel_management.department.QueryDept; +import com.rabbiter.market.service.personnel_management.personnel_management.department.IDeptService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +@RequestMapping("/personnel_management/dept") +public class DeptController { + @Autowired + private IDeptService deptService; + /*保存信息接口*/ + @HasPermisson("personnel_management:dept:save") + @PostMapping("/save") + public JsonResult saveDept(Dept dept){ + deptService.saveDept(dept); + return JsonResult.success(); + } + + @HasPermisson("personnel_management:dept:update") + /*修改接口*/ + @PostMapping("/update") + public JsonResult updateDept(Dept dept){ + deptService.updateDept(dept); + return JsonResult.success(); + } + + /*停用*/ + @HasPermisson("personnel_management:dept:deactivate") + @PostMapping("/deactivate") + public JsonResult deactivate(Long id){ + deptService.forbiddenRole(id); + return JsonResult.success(); + } + /*查询信息*/ + @GetMapping("/list") + public JsonResult listByQo(QueryDept qo){ + return JsonResult.success(deptService.listByQo(qo)); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/personnel_management/employee/EmployeeController.java b/src/main/java/com/rabbiter/market/controller/personnel_management/employee/EmployeeController.java new file mode 100644 index 0000000..23af4ee --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/personnel_management/employee/EmployeeController.java @@ -0,0 +1,116 @@ +package com.rabbiter.market.controller.personnel_management.employee; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.sercurity.annotation.NoRequireLogin; +import com.rabbiter.market.common.util.PathUtils; +import com.rabbiter.market.common.util.UploadUtil; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.qo.personnel_management.employee.QueryEmp; +import com.rabbiter.market.service.personnel_management.employee.IEmployeeService; +import com.rabbiter.market.vo.employee.DetailEmpVo; +import com.rabbiter.market.vo.employee.EditEmpVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/personnel_management/employee") +public class EmployeeController { + @Autowired + private IEmployeeService employeeService; + + @HasPermisson("personnel_management:employee:list") + @PostMapping("/list") + public JsonResult pageByQo(QueryEmp qo) { + Page page = employeeService.pageByQo(qo); + return JsonResult.success(page); + } + + @HasPermisson("personnel_management:employee:list") + @GetMapping("/detail") + public JsonResult detail(Long uid) { + DetailEmpVo vo = employeeService.detail(uid); + return JsonResult.success(vo); + } + + /** + * 上传图片到阿里云oss + * 返回网络图片地址,uploaded:1:成功 0:失败 + * + * @param upload + * @return + */ + @NoRequireLogin + @PostMapping("/uploadImg") + public Map uploadImg(@RequestParam("file") MultipartFile upload) { + Map map = new HashMap<>(); + if (upload != null && upload.getSize() > 0) { + String path; + try { + path = PathUtils.upload(upload); + map.put("uploaded", 1); //成功 + map.put("url", path); //成功 + } catch (Exception e) { + e.printStackTrace(); + map.put("uploaded", 0); //失败 + Map errorMap = new HashMap<>(); + errorMap.put("message", e.getMessage()); + map.put("error", errorMap); + } + } else { + map.put("uploaded", 0); //失败 + Map errorMap = new HashMap<>(); + errorMap.put("message", "上传失败,图片文件异常"); + map.put("error", errorMap); + } + return map; + } + + /*保存*/ + @HasPermisson("personnel_management:employee:save") + @PostMapping("/save") + public JsonResult saveEmp(Employee employee, HttpServletRequest request) { + employeeService.saveEmp(employee, (String) request.getHeader("token")); + return JsonResult.success(); + } + + /*修改按钮*/ + @HasPermisson("personnel_management:employee:update") + @GetMapping("/editbtn") + public JsonResult editbtn(Long uid) { + EditEmpVo vo = employeeService.editbtn(uid); + return JsonResult.success(vo); + } + + /*修改员工业务*/ + @HasPermisson("personnel_management:employee:update") + @PostMapping("/update") + public JsonResult updateEmp(Employee employee, HttpServletRequest request) { + employeeService.updateEmp(employee, (String) request.getHeader("token")); + return JsonResult.success(); + } + + /*离职业务*/ + @HasPermisson("personnel_management:employee:update") + @PostMapping("/deactivate") + public JsonResult deactivate(Long id) { + employeeService.deactivate(id); + return JsonResult.success(); + } + + /*更改密码*/ + @HasPermisson("personnel_management:employee:resetPwd") + @PostMapping("/resetPwd") + public JsonResult resetPwd(Long eid, String code) { + employeeService.resetPwd(eid, code); + return JsonResult.success(); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/sale_management/exchange_point_products/ExchangePointProductsRecordsController.java b/src/main/java/com/rabbiter/market/controller/sale_management/exchange_point_products/ExchangePointProductsRecordsController.java new file mode 100644 index 0000000..f20df8e --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/sale_management/exchange_point_products/ExchangePointProductsRecordsController.java @@ -0,0 +1,87 @@ +package com.rabbiter.market.controller.sale_management.exchange_point_products; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.goods_management.point_products.PointProducts; +import com.rabbiter.market.domain.sale_management.exchange_point_products.ExchangePointProducts; +import com.rabbiter.market.qo.exchange_point_products_records.QueryExchangePointProductsRecords; +import com.rabbiter.market.service.sale_management.exchange_point_products.IExchangePointProductsService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/sale_management/exchange_point_products_records") +public class ExchangePointProductsRecordsController { + @Autowired + private IExchangePointProductsService exchangePointProductsService; + + + @GetMapping("/queryPointProductBymemberId") + public JsonResult queryPointProductBymemberId(Long memberId) { + List> list = exchangePointProductsService.queryPointProductBymemberId(memberId); + return JsonResult.success(list); + } + + + @GetMapping("/queryMemberByGoodsId") + public JsonResult queryMemberByGoodsId(Long goodsId) { + List> list = exchangePointProductsService.queryMemberByGoodsId(goodsId); + return JsonResult.success(list); + } + + @GetMapping("/queryPointProductByGoodsId") + public JsonResult queryPointProductByGoodsId(Long goodsId) { + PointProducts pointProducts = exchangePointProductsService.queryPointProductByGoodsId(goodsId); + return JsonResult.success(pointProducts); + } + + @PostMapping("/saveExchangePointProductRecords") + public JsonResult saveExchangePointProductRecords(ExchangePointProducts exchangePointProducts, HttpServletRequest request) { + exchangePointProductsService.saveExchangePointProductRecords(exchangePointProducts, (String) request.getHeader("token")); + return JsonResult.success(); + } + + @GetMapping("/queryOptionsMemberPhone") + public JsonResult queryOptionsMemberPhone() { + List> list = exchangePointProductsService.queryOptionsMemberPhone(); + return JsonResult.success(list); + } + + @GetMapping("/delExchangePointProducts") + public JsonResult delExchangePointProducts(String cn) { + exchangePointProductsService.delExchangePointProducts(cn); + return JsonResult.success(); + } + + @HasPermisson("sale_management:exchange_point_products_records:list") + @PostMapping("/queryPageByQoExchangePointProducts") + public JsonResult queryPageByQoExchangePointProducts(QueryExchangePointProductsRecords qo) { + Page page = exchangePointProductsService.queryPageByQoExchangePointProducts(qo); + + return JsonResult.success(page); + } + + @GetMapping("/queryOptionsPointProducts") + public JsonResult queryOptionsPointProducts() { + List> list = exchangePointProductsService.queryOptionsPointProducts(); + return JsonResult.success(list); + } + + @GetMapping("/queryOptionsMember") + public JsonResult queryOptionsMember() { + List> list = exchangePointProductsService.queryOptionsMember(); + return JsonResult.success(list); + } + + +} diff --git a/src/main/java/com/rabbiter/market/controller/sale_management/sale_record/SaleRecordController.java b/src/main/java/com/rabbiter/market/controller/sale_management/sale_record/SaleRecordController.java new file mode 100644 index 0000000..9293036 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/sale_management/sale_record/SaleRecordController.java @@ -0,0 +1,54 @@ +package com.rabbiter.market.controller.sale_management.sale_record; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.sale_management.sale_records.SaleRecords; +import com.rabbiter.market.qo.sale_records.QuerySaleRecords; +import com.rabbiter.market.service.sale_management.sale_records.ISaleRecordsService; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/sale_management/sale_record") +public class SaleRecordController { + @Autowired + private ISaleRecordsService saleRecordsService; + @GetMapping("/getCn") + public JsonResult getCn(){ + return JsonResult.success(IdWorker.getIdStr()); + } + @GetMapping("/getOptionSaleRecordsGoods") + public JsonResult getOptionSaleRecordsGoods(){ + List> list=saleRecordsService.getOptionSaleRecordsGoods(); + return JsonResult.success(list); + } + + @PostMapping("/saveSaleRecords") + public JsonResult saveSaleRecords(@RequestBody SaleRecords saleRecords, HttpServletRequest request){ + saleRecords=saleRecordsService.saveSaleRecords(saleRecords,(String) request.getHeader("token")); + return JsonResult.success(saleRecords); + } + + @HasPermisson("sale_management:sale_records:list") + @PostMapping("/queryPageByQoSaleRecords") + public JsonResult queryPageByQoSaleRecords(QuerySaleRecords qo){ + Page page=saleRecordsService.queryPageByQoSaleRecords(qo); + return JsonResult.success(page); + } + + @GetMapping("/delSaleRecords") + public JsonResult delSaleRecords(String cn){ + saleRecordsService.delSaleRecords(cn); + return JsonResult.success(); + } +} + + diff --git a/src/main/java/com/rabbiter/market/controller/system/menu/MenuController.java b/src/main/java/com/rabbiter/market/controller/system/menu/MenuController.java new file mode 100644 index 0000000..4e3425c --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/system/menu/MenuController.java @@ -0,0 +1,31 @@ +package com.rabbiter.market.controller.system.menu; + +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.system.menu.Menu; +import com.rabbiter.market.qo.system.MenuQuery; +import com.rabbiter.market.service.system.menu.IMenuService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/system/menu") +public class MenuController { + @Autowired + private IMenuService menuService; + + /** + * 条件分页查询菜单的信息 + * @param qo + * @return + */ + @HasPermisson("system:menu:list") + @PostMapping("/queryPageByQo") + public JsonResult queryPageByQo(MenuQuery qo) { + Page page = menuService.queryPageByQo(qo); + return JsonResult.success(page); + } +} diff --git a/src/main/java/com/rabbiter/market/controller/system/role/RoleController.java b/src/main/java/com/rabbiter/market/controller/system/role/RoleController.java new file mode 100644 index 0000000..5156248 --- /dev/null +++ b/src/main/java/com/rabbiter/market/controller/system/role/RoleController.java @@ -0,0 +1,133 @@ +package com.rabbiter.market.controller.system.role; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.common.sercurity.annotation.HasPermisson; +import com.rabbiter.market.common.web.response.JsonResult; +import com.rabbiter.market.domain.system.role.Role; +import com.rabbiter.market.qo.system.RoleQuery; +import com.rabbiter.market.service.system.role.IRoleService; +import com.rabbiter.market.vo.role.RolePermissonVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.constraints.NotNull; +import java.util.List; +import java.util.Map; + +@RestController +@Validated +@RequestMapping("/system/role") +public class RoleController { + @Autowired + private IRoleService roleService; + + /** + * 查询角色所有的信息 + * + * @return + */ + @HasPermisson("system:role:list") + @PostMapping("/list") + public JsonResult list(RoleQuery qo) { + List roles = roleService.listByQo(qo); + return JsonResult.success(roles); + } + + /** + * 停用角色 + * + * @param rid + * @return + */ + @HasPermisson("system:role:forbiddenRole") + @PostMapping("/forbiddenRole") + public JsonResult forbiddenRole(Long rid) { + roleService.forbiddenRole(rid); + return JsonResult.success(); + } + + /** + * 修改角色信息 + * + * @param role + * @return + */ + @HasPermisson("system:role:edit_role") + @PostMapping("/edit_role") + public JsonResult edit_role(Role role) { + if (Role.SYS_ID == role.getId() || 2L == role.getId()) { + throw new BusinessException("不能停用系统拥有者"); + } + if (role != null && StringUtils.hasText(role.getInfo())) { + roleService.updateById(role); + } + return JsonResult.success(); + } + + /** + * 保存角色信息 + * + * @param role + * @return + */ + @HasPermisson("system:role:save") + @PostMapping("/save") + public JsonResult save(Role role) { + roleService.saveRole(role); + return JsonResult.success(); + } + + /** + * 查询角色拥有的权限 + * + * @param rid + * @return + */ + @HasPermisson("system:role:saveRolePermissons") + @GetMapping("/checkPermissons") + public JsonResult checkPermissons(@NotNull(message = "角色不能为空") Long rid) { + RolePermissonVo vo = roleService.checkPermissons(rid); + return JsonResult.success(vo); + } + + /** + * 保存角色-菜单的关系 + * + * @param rid + * @param menuIds + * @return + */ + @HasPermisson("system:role:saveRolePermissons") + @PostMapping("/saveRolePermissons") + public JsonResult saveRolePermissons(@NotNull(message = "角色不能为空") @RequestParam("rid") Long rid, @RequestParam("menuIds") Long[] menuIds) { + roleService.saveRolePermissons(rid, menuIds); + + return JsonResult.success(); + + } + + @GetMapping("/all") + public JsonResult getRoleAll() { + List> list = roleService.getRoleAll(); + return JsonResult.success(list); + } + + @HasPermisson("personnel_management:employee:queryRoleIdsByEid") + @GetMapping("/queryRoleIdsByEid") + public JsonResult queryRoleIdsByEid(Long eid) { + + List list = roleService.queryRoleIdsByEid(eid); + return JsonResult.success(list); + } + @HasPermisson("personnel_management:employee:queryRoleIdsByEid") + @PostMapping("/saveRoleEmp") + public JsonResult saveRoleEmp(Long eid, Long[] empRoleIds, HttpServletRequest request) { + String token = request.getHeader("token"); + roleService.saveRoleEmp(eid, empRoleIds, token); + return JsonResult.success(); + + } +} diff --git a/src/main/java/com/rabbiter/market/data_job/CacheDataJob.java b/src/main/java/com/rabbiter/market/data_job/CacheDataJob.java new file mode 100644 index 0000000..3b13660 --- /dev/null +++ b/src/main/java/com/rabbiter/market/data_job/CacheDataJob.java @@ -0,0 +1,35 @@ +package com.rabbiter.market.data_job; + +import com.rabbiter.market.common.redis.constants.RedisKeys; +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.goods_management.goods_category.GoodsCategory; +import com.rabbiter.market.service.goods_management.goods_category.IGoodsCategoryService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class CacheDataJob { + @Autowired + private RedisTemplateService redisTemplateService; + @Autowired + private IGoodsCategoryService goodsCategoryService; + + @Scheduled(cron = "0 0 1 * * ?") //每天凌晨1点执行一次 + public void cache_category(){ + System.out.println("被执行。。。。"); + QueryWrapper wrapper = new QueryWrapper() + .eq("state", GoodsCategory.STATE_NORMAL); + List list = goodsCategoryService.list(wrapper); + if (list==null ||list.size()<=0){ + return; + } + String cacheKey = RedisKeys.GOODS_CATEGORY.join(); + for (GoodsCategory goodsCategory : list) { + redisTemplateService.setCacheMapValue(cacheKey,goodsCategory.getId().toString(),goodsCategory); + } + } +} diff --git a/src/main/java/com/rabbiter/market/domain/goods_management/goods/Goods.java b/src/main/java/com/rabbiter/market/domain/goods_management/goods/Goods.java new file mode 100644 index 0000000..0269242 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/goods_management/goods/Goods.java @@ -0,0 +1,219 @@ +package com.rabbiter.market.domain.goods_management.goods; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + + +import java.io.Serializable; +import java.util.Date; + +/** + * 商品 + */ +@TableName("goods") +public class Goods implements Serializable { + public static final String STATE_UP="0"; + public static final String STATE_DOWN="1"; + @TableId(type = IdType.AUTO) + private Long id; + private String name; //商品名 + private String info; + @TableField("category_name") + private String categoryName; //商品分类名 + @TableField("category_id") + private Long categoryId; //商品分类id + private String createby; //创建者 + @JsonFormat(pattern = "yyyy-MM-dd") + @TableField("create_time") + private Date createTime; //创建时间 + private String updateby; //更新者 + @JsonFormat(pattern = "yyyy-MM-dd") + @TableField("update_time") + private Date updateTime; //更新时间 + @TableField("sell_price") + private Double sellPrice; // 销售价格 + @TableField("purchash_price") + private Double purchashPrice; //进货价格 + @TableField("residue_num") + private Long residueNum; //剩余数量 + @TableField(exist = false) + private Long residueStoreNum;//剩余库存数量 + @TableField("cover_url") + private String coverUrl; //商品封面 + private String state=STATE_UP; + @TableField("sales_volume") + private Long salesVolume;//销售量 + private Long inventory;//需库存量 + private Long shelves;//货架商品数量 + + public Goods() { + } + + public Goods(Long id, String name, String info, String categoryName, Long categoryId, String createby, Date createTime, String updateby, Date updateTime, Double sellPrice, Double purchashPrice, Long residueNum, Long residueStoreNum, String coverUrl, String state, Long salesVolume, Long inventory, Long shelves) { + this.id = id; + this.name = name; + this.info = info; + this.categoryName = categoryName; + this.categoryId = categoryId; + this.createby = createby; + this.createTime = createTime; + this.updateby = updateby; + this.updateTime = updateTime; + this.sellPrice = sellPrice; + this.purchashPrice = purchashPrice; + this.residueNum = residueNum; + this.residueStoreNum = residueStoreNum; + this.coverUrl = coverUrl; + this.state = state; + this.salesVolume = salesVolume; + this.inventory = inventory; + this.shelves = shelves; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getCategoryName() { + return categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + public Long getCategoryId() { + return categoryId; + } + + public void setCategoryId(Long categoryId) { + this.categoryId = categoryId; + } + + public String getCreateby() { + return createby; + } + + public void setCreateby(String createby) { + this.createby = createby; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateby() { + return updateby; + } + + public void setUpdateby(String updateby) { + this.updateby = updateby; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Double getSellPrice() { + return sellPrice; + } + + public void setSellPrice(Double sellPrice) { + this.sellPrice = sellPrice; + } + + public Double getPurchashPrice() { + return purchashPrice; + } + + public void setPurchashPrice(Double purchashPrice) { + this.purchashPrice = purchashPrice; + } + + public Long getResidueNum() { + return residueNum; + } + + public void setResidueNum(Long residueNum) { + this.residueNum = residueNum; + } + + public Long getResidueStoreNum() { + return residueStoreNum; + } + + public void setResidueStoreNum(Long residueStoreNum) { + this.residueStoreNum = residueStoreNum; + } + + public String getCoverUrl() { + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { + this.coverUrl = coverUrl; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public Long getSalesVolume() { + return salesVolume; + } + + public void setSalesVolume(Long salesVolume) { + this.salesVolume = salesVolume; + } + + public Long getInventory() { + return inventory; + } + + public void setInventory(Long inventory) { + this.inventory = inventory; + } + + public Long getShelves() { + return shelves; + } + + public void setShelves(Long shelves) { + this.shelves = shelves; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/goods_management/goods_category/GoodsCategory.java b/src/main/java/com/rabbiter/market/domain/goods_management/goods_category/GoodsCategory.java new file mode 100644 index 0000000..214c3b8 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/goods_management/goods_category/GoodsCategory.java @@ -0,0 +1,63 @@ +package com.rabbiter.market.domain.goods_management.goods_category; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +/** + * 商品分类 + */ +@TableName("goods_category") +public class GoodsCategory implements Serializable { + public static final String STATE_NORMAL="0"; + public static final String STATE_BAN="-1"; + @TableId(type = IdType.AUTO) + private Long id; + private String name; + private String info; + private String state; + + public GoodsCategory() { + } + + public GoodsCategory(Long id, String name, String info, String state) { + this.id = id; + this.name = name; + this.info = info; + this.state = state; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/domain/goods_management/point_products/PointProducts.java b/src/main/java/com/rabbiter/market/domain/goods_management/point_products/PointProducts.java new file mode 100644 index 0000000..3591a8e --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/goods_management/point_products/PointProducts.java @@ -0,0 +1,103 @@ +package com.rabbiter.market.domain.goods_management.point_products; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +@TableName("point_products") +public class PointProducts implements Serializable { + public static final String STATE_NORMAL="0"; + public static final String STATE_DEL="1"; + @TableField("goods_id") + private Long goodsId; + @TableField("goods_name") + private String goodsName; + private Long integral; + private String updateby; + @TableField("update_time") + private Date updateTime; + @TableField("cover_url") + private String coverUrl; + @TableField("update_id") + private Long updateId; + private String state; + + public PointProducts() { + } + + public PointProducts(Long goodsId, String goodsName, Long integral, String updateby, Date updateTime, String coverUrl, Long updateId, String state) { + this.goodsId = goodsId; + this.goodsName = goodsName; + this.integral = integral; + this.updateby = updateby; + this.updateTime = updateTime; + this.coverUrl = coverUrl; + this.updateId = updateId; + this.state = state; + } + + public Long getGoodsId() { + return goodsId; + } + + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public Long getIntegral() { + return integral; + } + + public void setIntegral(Long integral) { + this.integral = integral; + } + + public String getUpdateby() { + return updateby; + } + + public void setUpdateby(String updateby) { + this.updateby = updateby; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getCoverUrl() { + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { + this.coverUrl = coverUrl; + } + + public Long getUpdateId() { + return updateId; + } + + public void setUpdateId(Long updateId) { + this.updateId = updateId; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/inventory_management/detail_store_goods/DetailStoreGoods.java b/src/main/java/com/rabbiter/market/domain/inventory_management/detail_store_goods/DetailStoreGoods.java new file mode 100644 index 0000000..30144b6 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/inventory_management/detail_store_goods/DetailStoreGoods.java @@ -0,0 +1,224 @@ +package com.rabbiter.market.domain.inventory_management.detail_store_goods; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +@TableName("t_detail_store_goods") +public class DetailStoreGoods implements Serializable { + public static final String STATE_NORMAL="0"; //正常 + public static final String STATE_EXPIRY="1"; //过期 + public static final String STATE_DOWN="2"; //下架 + public static final String STATE1_DEL="1"; //删除 + public static final String STATE1_NORMAL="0"; //正常 + public static final String STATE1_UNTREATED="2"; //待处理 + public static final String TYPE_IN="0"; + public static final String TYPE_OUT="1"; + private String cn; + @TableField("goods_id") + private Long goodsId; + @TableField("goods_num") + private Long goodsNum; + @TableField("goods_name") + private String goodsName; + @TableField("goods_price") + private Double goodsPrice; + private String type; + private Long createid; + private String createby; + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern ="yyyy-MM-dd" ) + @TableField("create_time") + private Date createTime; + private String state; + private String info; + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern ="yyyy-MM-dd" ) + @TableField("expiry_time") + private Date expiryTime; + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern ="yyyy-MM-dd" ) + @TableField("birth_time") + private Date birthTime; + @TableField("store_id") + private Long storeId; + private String state1; + @TableField("supplier_id") + private Long supplierId; + @TableField("supplier_name") + private String supplierName; + @TableField("untreated_num") + private Long untreatedNum; + + public DetailStoreGoods() { + } + + public DetailStoreGoods(String cn, Long goodsId, Long goodsNum, String goodsName, Double goodsPrice, String type, Long createid, String createby, Date createTime, String state, String info, Date expiryTime, Date birthTime, Long storeId, String state1, Long supplierId, String supplierName, Long untreatedNum) { + this.cn = cn; + this.goodsId = goodsId; + this.goodsNum = goodsNum; + this.goodsName = goodsName; + this.goodsPrice = goodsPrice; + this.type = type; + this.createid = createid; + this.createby = createby; + this.createTime = createTime; + this.state = state; + this.info = info; + this.expiryTime = expiryTime; + this.birthTime = birthTime; + this.storeId = storeId; + this.state1 = state1; + this.supplierId = supplierId; + this.supplierName = supplierName; + this.untreatedNum = untreatedNum; + } + + public String getCn() { + return cn; + } + + public void setCn(String cn) { + this.cn = cn; + } + + public Long getGoodsId() { + return goodsId; + } + + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + public Long getGoodsNum() { + return goodsNum; + } + + public void setGoodsNum(Long goodsNum) { + this.goodsNum = goodsNum; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public Double getGoodsPrice() { + return goodsPrice; + } + + public void setGoodsPrice(Double goodsPrice) { + this.goodsPrice = goodsPrice; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Long getCreateid() { + return createid; + } + + public void setCreateid(Long createid) { + this.createid = createid; + } + + public String getCreateby() { + return createby; + } + + public void setCreateby(String createby) { + this.createby = createby; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Date getExpiryTime() { + return expiryTime; + } + + public void setExpiryTime(Date expiryTime) { + this.expiryTime = expiryTime; + } + + public Date getBirthTime() { + return birthTime; + } + + public void setBirthTime(Date birthTime) { + this.birthTime = birthTime; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public String getState1() { + return state1; + } + + public void setState1(String state1) { + this.state1 = state1; + } + + public Long getSupplierId() { + return supplierId; + } + + public void setSupplierId(Long supplierId) { + this.supplierId = supplierId; + } + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + public Long getUntreatedNum() { + return untreatedNum; + } + + public void setUntreatedNum(Long untreatedNum) { + this.untreatedNum = untreatedNum; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/inventory_management/notice/NoticeIn.java b/src/main/java/com/rabbiter/market/domain/inventory_management/notice/NoticeIn.java new file mode 100644 index 0000000..c079d3f --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/inventory_management/notice/NoticeIn.java @@ -0,0 +1,63 @@ +package com.rabbiter.market.domain.inventory_management.notice; + + +import java.io.Serializable; + +public class NoticeIn implements Serializable { + private Long id; + private String name; //商品名 + private Double purchashPrice; //进货价格 + private Long goodsNum; + private String coverUrl; //商品封面 + + public NoticeIn() { + } + + public NoticeIn(Long id, String name, Double purchashPrice, Long goodsNum, String coverUrl) { + this.id = id; + this.name = name; + this.purchashPrice = purchashPrice; + this.goodsNum = goodsNum; + this.coverUrl = coverUrl; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getPurchashPrice() { + return purchashPrice; + } + + public void setPurchashPrice(Double purchashPrice) { + this.purchashPrice = purchashPrice; + } + + public Long getGoodsNum() { + return goodsNum; + } + + public void setGoodsNum(Long goodsNum) { + this.goodsNum = goodsNum; + } + + public String getCoverUrl() { + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { + this.coverUrl = coverUrl; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/inventory_management/notice/NoticeOut.java b/src/main/java/com/rabbiter/market/domain/inventory_management/notice/NoticeOut.java new file mode 100644 index 0000000..6beedbd --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/inventory_management/notice/NoticeOut.java @@ -0,0 +1,62 @@ +package com.rabbiter.market.domain.inventory_management.notice; + +import java.io.Serializable; + +public class NoticeOut implements Serializable { + private Long id; + private String name; //商品名 + private Long goodsNum; + private String coverUrl; //商品封面 + private String state; + + public NoticeOut() { + } + + public NoticeOut(Long id, String name, Long goodsNum, String coverUrl, String state) { + this.id = id; + this.name = name; + this.goodsNum = goodsNum; + this.coverUrl = coverUrl; + this.state = state; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getGoodsNum() { + return goodsNum; + } + + public void setGoodsNum(Long goodsNum) { + this.goodsNum = goodsNum; + } + + public String getCoverUrl() { + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { + this.coverUrl = coverUrl; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/inventory_management/store/GoodsStore.java b/src/main/java/com/rabbiter/market/domain/inventory_management/store/GoodsStore.java new file mode 100644 index 0000000..eaf0175 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/inventory_management/store/GoodsStore.java @@ -0,0 +1,71 @@ +package com.rabbiter.market.domain.inventory_management.store; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("t_goods_store") +public class GoodsStore implements Serializable { + @TableField("goods_id") + private Long goodsId; + @TableField("store_id") + private Long storeId; + @TableField("in_num") + private Long inNum; + @TableField("residue_num") + private Long residueNum; + @TableField("store_name") + private String storeName; + + public GoodsStore() { + } + + public GoodsStore(Long goodsId, Long storeId, Long inNum, Long residueNum, String storeName) { + this.goodsId = goodsId; + this.storeId = storeId; + this.inNum = inNum; + this.residueNum = residueNum; + this.storeName = storeName; + } + + public Long getGoodsId() { + return goodsId; + } + + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public Long getInNum() { + return inNum; + } + + public void setInNum(Long inNum) { + this.inNum = inNum; + } + + public Long getResidueNum() { + return residueNum; + } + + public void setResidueNum(Long residueNum) { + this.residueNum = residueNum; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/inventory_management/store/Store.java b/src/main/java/com/rabbiter/market/domain/inventory_management/store/Store.java new file mode 100644 index 0000000..dd3274d --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/inventory_management/store/Store.java @@ -0,0 +1,73 @@ +package com.rabbiter.market.domain.inventory_management.store; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +/** + * 仓库实体 + */ +@TableName("store") +public class Store implements Serializable { + public static final String STATE_NORMAL="0"; + public static final String STATE_BAN="-1"; + @TableId(type = IdType.AUTO) + private Long id; + private String name; + private String address; + private String info; + private String state; + + public Store() { + } + + public Store(Long id, String name, String address, String info, String state) { + this.id = id; + this.name = name; + this.address = address; + this.info = info; + this.state = state; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/inventory_management/supplier/Supplier.java b/src/main/java/com/rabbiter/market/domain/inventory_management/supplier/Supplier.java new file mode 100644 index 0000000..0cb8d10 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/inventory_management/supplier/Supplier.java @@ -0,0 +1,80 @@ +package com.rabbiter.market.domain.inventory_management.supplier; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("supplier") +public class Supplier implements Serializable { + public static final String STATE_NORMAL="0"; + public static final String STATE_BAN="-1"; + @TableId(type = IdType.AUTO) + private Long cn; + private String name; + private String address; + private String tel; + private String info; + private String state; + + public Supplier() { + } + + public Supplier(Long cn, String name, String address, String tel, String info, String state) { + this.cn = cn; + this.name = name; + this.address = address; + this.tel = tel; + this.info = info; + this.state = state; + } + + public Long getCn() { + return cn; + } + + public void setCn(Long cn) { + this.cn = cn; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getTel() { + return tel; + } + + public void setTel(String tel) { + this.tel = tel; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/member_management/member/Member.java b/src/main/java/com/rabbiter/market/domain/member_management/member/Member.java new file mode 100644 index 0000000..4dc7148 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/member_management/member/Member.java @@ -0,0 +1,104 @@ +package com.rabbiter.market.domain.member_management.member; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.io.Serializable; + +@TableName("t_member") +public class Member implements Serializable { + public static final String STATE_NORMAL = "0"; + public static final String STATE_BAN = "1"; + public static final String DEFAULT_PWD="123456"; + + @TableId(type = IdType.AUTO) + private Long id; + private String name; + private String phone; + @JsonIgnore + private String password; + private String email; + private Long integral; + private String state; + private String info; + + public Member() { + } + + public Member(Long id, String name, String phone, String password, String email, Long integral, String state, String info) { + this.id = id; + this.name = name; + this.phone = phone; + this.password = password; + this.email = email; + this.integral = integral; + this.state = state; + this.info = info; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Long getIntegral() { + return integral; + } + + public void setIntegral(Long integral) { + this.integral = integral; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/personnel_management/department/Dept.java b/src/main/java/com/rabbiter/market/domain/personnel_management/department/Dept.java new file mode 100644 index 0000000..aaa62eb --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/personnel_management/department/Dept.java @@ -0,0 +1,65 @@ +package com.rabbiter.market.domain.personnel_management.department; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +/** + * 部门实体 + */ +@TableName("department") +public class Dept implements Serializable { + //正常 + public static final String STATE_NORMAL="0"; + //禁用 + public static final String STATE_BAN="-1"; + @TableId(type = IdType.AUTO) + private Long id; + private String name; + private String info; + private String state; + + public Dept() { + } + + public Dept(Long id, String name, String info, String state) { + this.id = id; + this.name = name; + this.info = info; + this.state = state; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/personnel_management/employee/Employee.java b/src/main/java/com/rabbiter/market/domain/personnel_management/employee/Employee.java new file mode 100644 index 0000000..6546fe4 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/personnel_management/employee/Employee.java @@ -0,0 +1,304 @@ +package com.rabbiter.market.domain.personnel_management.employee; + +import com.rabbiter.market.domain.system.menu.Menu; +import com.rabbiter.market.domain.system.role.Role; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; + +import java.io.Serializable; +import java.util.*; + +/** + * 员工实体类 + */ +@TableName("employee") +public class Employee implements Serializable { + public static final String STATE_NORMAL = "0"; + public static final String STATE_DEL = "1"; + public static final String DEFAULT_PWD = "123456"; + public static final String SEX_MEN = "1"; + public static final String SEX_WOWEN = "0"; + public static final String DEFAULT_HEAD_IMG="/files/1694434162457_07.jpg"; + @TableId(type = IdType.AUTO) + private Long id; + private String sex; + @TableField("isAdmin") + private Boolean isAdmin; + @TableField("phone") + private String username; + @TableField("nick_name") + private String nickName; + private String password; + @TableField("head_img") + private String headImg=DEFAULT_HEAD_IMG; + private String state = STATE_NORMAL; + private String info; + private String createby; + @TableField("create_time") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd") + @TableField("leave_time") + private Date leaveTime; + private String address; + private String email; + private Integer age; + @TableField("deptId") + private Long deptId; + + @TableField(value = "dept_name",exist = false) + private String deptName; + //角色集合 + @TableField(exist = false) + @JsonIgnore + private Set roles; + + //权限集合 + @TableField(exist = false) + @JsonIgnore + private List menus; + @TableField(exist = false) + @JsonIgnore + private Set flags; + + @TableField("id_card") + private String idCard; + + public Employee() { + } + + public Employee(Long id, String sex, Boolean isAdmin, String username, String nickName, String password, String headImg, String state, String info, String createby, Date createTime, Date leaveTime, String address, String email, Integer age, Long deptId, String deptName, Set roles, List menus, Set flags, String idCard) { + this.id = id; + this.sex = sex; + this.isAdmin = isAdmin; + this.username = username; + this.nickName = nickName; + this.password = password; + this.headImg = headImg; + this.state = state; + this.info = info; + this.createby = createby; + this.createTime = createTime; + this.leaveTime = leaveTime; + this.address = address; + this.email = email; + this.age = age; + this.deptId = deptId; + this.deptName = deptName; + this.roles = roles; + this.menus = menus; + this.flags = flags; + this.idCard = idCard; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Boolean getIsAdmin() { + return isAdmin; + } + + public void setIsAdmin(Boolean admin) { + isAdmin = admin; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getHeadImg() { + return headImg; + } + + public void setHeadImg(String headImg) { + this.headImg = headImg; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getCreateby() { + return createby; + } + + public void setCreateby(String createby) { + this.createby = createby; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getLeaveTime() { + return leaveTime; + } + + public void setLeaveTime(Date leaveTime) { + this.leaveTime = leaveTime; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public Set getRoles() { + return roles; + } + + public void setRoles(Set roles) { + this.roles = roles; + } + + public List getMenus() { + return menus; + } + + public Set getFlags() { + return flags; + } + + public void setFlags(Set flags) { + this.flags = flags; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + public void setMenus(List menus) { + this.menus = menus; + if (menus!=null) { + this.flags = getFlags(this.menus); + } + } + + /** + * 获取权限标识符集合 + * + * @param menus + * @return + */ + private Set getFlags(List menus) { + Set flags = new HashSet<>(); + for (Menu menu : menus) { + //目录遍历 + if (menu.getFlag() != null) { + flags.add(menu.getFlag()); + //如果没有子集 + if (menu.getChildren() == null) { + continue; + } + for (Menu child : menu.getChildren()) { + //菜单遍历 + if (child.getFlag() != null) { + flags.add(child.getFlag()); + } + //如果没有子集 + if (child.getChildren() == null) { + continue; + } + for (Menu childChild : child.getChildren()) { + if (childChild.getFlag() != null) { + flags.add(childChild.getFlag()); + } + } + } + } + } + return flags; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/sale_management/detail_sale_records/DetailSaleRecords.java b/src/main/java/com/rabbiter/market/domain/sale_management/detail_sale_records/DetailSaleRecords.java new file mode 100644 index 0000000..540337b --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/sale_management/detail_sale_records/DetailSaleRecords.java @@ -0,0 +1,71 @@ +package com.rabbiter.market.domain.sale_management.detail_sale_records; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("detail_sale_records") +public class DetailSaleRecords implements Serializable { + @TableField("sell_cn") + private String sellCn; + @TableField("goods_id") + private Long goodsId; + @TableField("goods_num") + private Long goodsNum; + @TableField("goods_price") + private Double goodsPrice; + @TableField("goods_name") + private String goodsName; + + public DetailSaleRecords() { + } + + public DetailSaleRecords(String sellCn, Long goodsId, Long goodsNum, Double goodsPrice, String goodsName) { + this.sellCn = sellCn; + this.goodsId = goodsId; + this.goodsNum = goodsNum; + this.goodsPrice = goodsPrice; + this.goodsName = goodsName; + } + + public String getSellCn() { + return sellCn; + } + + public void setSellCn(String sellCn) { + this.sellCn = sellCn; + } + + public Long getGoodsId() { + return goodsId; + } + + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + public Long getGoodsNum() { + return goodsNum; + } + + public void setGoodsNum(Long goodsNum) { + this.goodsNum = goodsNum; + } + + public Double getGoodsPrice() { + return goodsPrice; + } + + public void setGoodsPrice(Double goodsPrice) { + this.goodsPrice = goodsPrice; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/sale_management/exchange_point_products/ExchangePointProducts.java b/src/main/java/com/rabbiter/market/domain/sale_management/exchange_point_products/ExchangePointProducts.java new file mode 100644 index 0000000..d4317b0 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/sale_management/exchange_point_products/ExchangePointProducts.java @@ -0,0 +1,121 @@ +package com.rabbiter.market.domain.sale_management.exchange_point_products; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; + +@TableName("exchange_point_products_records") +public class ExchangePointProducts implements Serializable { + public static final String STATE_NORMAL="0"; + public static final String STATE_DEL="1"; + private String cn; + @TableField("goods_id") + private Long goodsId; + @TableField("member_id") + private Long memberId; + private Long integral; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("update_time") + private Date updateTime; + private String updateby; + @TableField("update_id") + private Long updateId; + private String state; + @TableField(exist = false) + private String memberPhone;//会员账号 + @TableField(exist = false) + private String goodsName; + @TableField(exist = false) + private String goodsCoverUrl; + + public String getCn() { + return cn; + } + + public void setCn(String cn) { + this.cn = cn; + } + + public Long getGoodsId() { + return goodsId; + } + + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + public Long getMemberId() { + return memberId; + } + + public void setMemberId(Long memberId) { + this.memberId = memberId; + } + + public Long getIntegral() { + return integral; + } + + public void setIntegral(Long integral) { + this.integral = integral; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getUpdateby() { + return updateby; + } + + public void setUpdateby(String updateby) { + this.updateby = updateby; + } + + public Long getUpdateId() { + return updateId; + } + + public void setUpdateId(Long updateId) { + this.updateId = updateId; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getMemberPhone() { + return memberPhone; + } + + public void setMemberPhone(String memberPhone) { + this.memberPhone = memberPhone; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getGoodsCoverUrl() { + return goodsCoverUrl; + } + + public void setGoodsCoverUrl(String goodsCoverUrl) { + this.goodsCoverUrl = goodsCoverUrl; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/sale_management/sale_records/SaleRecords.java b/src/main/java/com/rabbiter/market/domain/sale_management/sale_records/SaleRecords.java new file mode 100644 index 0000000..f35fd71 --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/sale_management/sale_records/SaleRecords.java @@ -0,0 +1,158 @@ +package com.rabbiter.market.domain.sale_management.sale_records; + +import com.rabbiter.market.domain.sale_management.detail_sale_records.DetailSaleRecords; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@TableName("t_sale_records") +public class SaleRecords implements Serializable { + public static final String STATE_NORMAL="0"; + public static final String STATE_DEL="1"; + private static final String TYPE_MEMBER="1"; + private static final String TYPE_NOMEMBER="0"; + private static final String SELLWAY_ALIPAY="0"; + private static final String SELLWAY_WECHAT="1"; + private static final String SELLWAY_CASH="2"; + private static final String SELLWAY_CREDIT="3"; + private static final Double DISCOUNT=0.9; + @TableField("cn") + private String cn; + private Long eid; + private String sellway; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("sell_time") + private Date sellTime; + private String state; + private String info; + private String sellby; + @TableField("sell_total") + private Long sellTotal; + @TableField("sell_totalmoney") + private Double sellTotalmoney; + private String type; + @TableField(exist = false) + private List detailSaleRecords=new ArrayList<>(); + @TableField("member_phone") + private String memberPhone;//会员账号 + + public SaleRecords() { + } + + public SaleRecords(String cn, Long eid, String sellway, Date sellTime, String state, String info, String sellby, Long sellTotal, Double sellTotalmoney, String type, List detailSaleRecords, String memberPhone) { + this.cn = cn; + this.eid = eid; + this.sellway = sellway; + this.sellTime = sellTime; + this.state = state; + this.info = info; + this.sellby = sellby; + this.sellTotal = sellTotal; + this.sellTotalmoney = sellTotalmoney; + this.type = type; + this.detailSaleRecords = detailSaleRecords; + this.memberPhone = memberPhone; + } + + public String getCn() { + return cn; + } + + public void setCn(String cn) { + this.cn = cn; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public String getSellway() { + return sellway; + } + + public void setSellway(String sellway) { + this.sellway = sellway; + } + + public Date getSellTime() { + return sellTime; + } + + public void setSellTime(Date sellTime) { + this.sellTime = sellTime; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getSellby() { + return sellby; + } + + public void setSellby(String sellby) { + this.sellby = sellby; + } + + public Long getSellTotal() { + return sellTotal; + } + + public void setSellTotal(Long sellTotal) { + this.sellTotal = sellTotal; + } + + public Double getSellTotalmoney() { + return sellTotalmoney; + } + + public void setSellTotalmoney(Double sellTotalmoney) { + this.sellTotalmoney = sellTotalmoney; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List getDetailSaleRecords() { + return detailSaleRecords; + } + + public void setDetailSaleRecords(List detailSaleRecords) { + this.detailSaleRecords = detailSaleRecords; + } + + public String getMemberPhone() { + return memberPhone; + } + + public void setMemberPhone(String memberPhone) { + this.memberPhone = memberPhone; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/system/menu/Menu.java b/src/main/java/com/rabbiter/market/domain/system/menu/Menu.java new file mode 100644 index 0000000..50407ea --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/system/menu/Menu.java @@ -0,0 +1,153 @@ +package com.rabbiter.market.domain.system.menu; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +@TableName("t_menu") +public class Menu implements Serializable { + public static final String TYPE_CATALOGUE="0";//目录 + public static final String TYPE_MENU="1"; //菜单 + public static final String TYPE_BUTTON="2";//按钮 + public static final String STATE_NORMAL="0";//正常 + public static final String STATE_DEL="-1";//禁用 + @TableId(type = IdType.AUTO) + private Long id; + private String label; + private String purl; + private String type; + @TableField("parent_id") + private Long parentId; + @TableField("parent_label") + private String parentLabel; + private String info; + private String state; + private String flag; + private String icon; + private String component; + @TableField(exist = false) + private List children; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Menu menu = (Menu) o; + return Objects.equals(id, menu.id) && + Objects.equals(label, menu.label) && + Objects.equals(purl, menu.purl) && + Objects.equals(type, menu.type) && + Objects.equals(parentId, menu.parentId) && + Objects.equals(parentLabel, menu.parentLabel) && + Objects.equals(info, menu.info) && + Objects.equals(state, menu.state) && + Objects.equals(flag, menu.flag) && + Objects.equals(component, menu.component) && + Objects.equals(children, menu.children); + } + + @Override + public int hashCode() { + return Objects.hash(id, label, purl, type, parentId, parentLabel, info, state, flag, children); + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getPurl() { + return purl; + } + + public void setPurl(String purl) { + this.purl = purl; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getParentLabel() { + return parentLabel; + } + + public void setParentLabel(String parentLabel) { + this.parentLabel = parentLabel; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/src/main/java/com/rabbiter/market/domain/system/role/Role.java b/src/main/java/com/rabbiter/market/domain/system/role/Role.java new file mode 100644 index 0000000..084d60a --- /dev/null +++ b/src/main/java/com/rabbiter/market/domain/system/role/Role.java @@ -0,0 +1,66 @@ +package com.rabbiter.market.domain.system.role; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +/** + * 权限实体类 + */ +@TableName("t_role") +public class Role implements Serializable { + public static final Long SYS_ID=1L; + //正常 + public static final String STATE_NORMAL="0"; + //禁用 + public static final String STATE_BAN="-1"; + @TableId(type = IdType.AUTO) + private Long id; + private String name; + private String info; + private String state; + + public Role() { + } + + public Role(Long id, String name, String info, String state) { + this.id = id; + this.name = name; + this.info = info; + this.state = state; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.java b/src/main/java/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.java new file mode 100644 index 0000000..b8e786d --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.java @@ -0,0 +1,23 @@ +package com.rabbiter.market.mapper.goods_management.goods; + +import com.rabbiter.market.domain.goods_management.goods.Goods; +import com.rabbiter.market.domain.inventory_management.notice.NoticeIn; +import com.rabbiter.market.domain.inventory_management.notice.NoticeOut; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface GoodsMapper extends BaseMapper { + + int getNoticeInTotalCount(Map map); + + List getNoticePageList(Map map); + + int getNoticeOutShelvesTotalCount(Map map); + + List getNoticeShelvesPageList(Map map); + Long queryPageStatisticSaleByQo(String name); +} diff --git a/src/main/java/com/rabbiter/market/mapper/goods_management/goods_category/GoodsCategoryMapper.java b/src/main/java/com/rabbiter/market/mapper/goods_management/goods_category/GoodsCategoryMapper.java new file mode 100644 index 0000000..5bab1ed --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/goods_management/goods_category/GoodsCategoryMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.goods_management.goods_category; + +import com.rabbiter.market.domain.goods_management.goods_category.GoodsCategory; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface GoodsCategoryMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/goods_management/point_products/PointProductsMapper.java b/src/main/java/com/rabbiter/market/mapper/goods_management/point_products/PointProductsMapper.java new file mode 100644 index 0000000..7633636 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/goods_management/point_products/PointProductsMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.goods_management.point_products; + +import com.rabbiter.market.domain.goods_management.point_products.PointProducts; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface PointProductsMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/inventory_management/detail_store_goods/DetailStoreGoodsMapper.java b/src/main/java/com/rabbiter/market/mapper/inventory_management/detail_store_goods/DetailStoreGoodsMapper.java new file mode 100644 index 0000000..a12bb2c --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/inventory_management/detail_store_goods/DetailStoreGoodsMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.inventory_management.detail_store_goods; + +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DetailStoreGoodsMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.java b/src/main/java/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.java new file mode 100644 index 0000000..fdddd78 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.java @@ -0,0 +1,20 @@ +package com.rabbiter.market.mapper.inventory_management.store; + +import com.rabbiter.market.domain.inventory_management.store.GoodsStore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface GoodsStoreMapper extends BaseMapper { + Long storeUsed(Long id); + Long getResidueNumByGoodsId(Long goodsId); + + void goodsInStore(@Param("goodsId") Long goodsId,@Param("goodsNum") Long goodsNum,@Param("storeId") Long storeId); + + void goodsOutStore(@Param("goodsId") Long goodsId,@Param("goodsNum") Long goodsNum,@Param("storeId") Long storeId); + + Long totalStoreNum(); + + Long getTotalStoreNum1(Long storeId); +} diff --git a/src/main/java/com/rabbiter/market/mapper/inventory_management/store/StoreMapper.java b/src/main/java/com/rabbiter/market/mapper/inventory_management/store/StoreMapper.java new file mode 100644 index 0000000..84d2476 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/inventory_management/store/StoreMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.inventory_management.store; + +import com.rabbiter.market.domain.inventory_management.store.Store; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface StoreMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/inventory_management/supplier/SupplierMapper.java b/src/main/java/com/rabbiter/market/mapper/inventory_management/supplier/SupplierMapper.java new file mode 100644 index 0000000..e3db5e1 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/inventory_management/supplier/SupplierMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.inventory_management.supplier; + +import com.rabbiter.market.domain.inventory_management.supplier.Supplier; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SupplierMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/member_management/member/MemberMapper.java b/src/main/java/com/rabbiter/market/mapper/member_management/member/MemberMapper.java new file mode 100644 index 0000000..212627d --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/member_management/member/MemberMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.member_management.member; + +import com.rabbiter.market.domain.member_management.member.Member; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MemberMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/personnel_management/department/DeptMapper.java b/src/main/java/com/rabbiter/market/mapper/personnel_management/department/DeptMapper.java new file mode 100644 index 0000000..55975ac --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/personnel_management/department/DeptMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.personnel_management.department; + +import com.rabbiter.market.domain.personnel_management.department.Dept; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DeptMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/personnel_management/employee/EmployeeMapper.java b/src/main/java/com/rabbiter/market/mapper/personnel_management/employee/EmployeeMapper.java new file mode 100644 index 0000000..5f2cd23 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/personnel_management/employee/EmployeeMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.personnel_management.employee; + +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface EmployeeMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/sale_management/detail_sale_records/DetailSaleRecordsMapper.java b/src/main/java/com/rabbiter/market/mapper/sale_management/detail_sale_records/DetailSaleRecordsMapper.java new file mode 100644 index 0000000..e7378b6 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/sale_management/detail_sale_records/DetailSaleRecordsMapper.java @@ -0,0 +1,11 @@ +package com.rabbiter.market.mapper.sale_management.detail_sale_records; + +import com.rabbiter.market.domain.sale_management.detail_sale_records.DetailSaleRecords; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DetailSaleRecordsMapper extends BaseMapper { + + +} diff --git a/src/main/java/com/rabbiter/market/mapper/sale_management/exchange_point_products/ExchangePointProductsMapper.java b/src/main/java/com/rabbiter/market/mapper/sale_management/exchange_point_products/ExchangePointProductsMapper.java new file mode 100644 index 0000000..0f26445 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/sale_management/exchange_point_products/ExchangePointProductsMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.sale_management.exchange_point_products; + +import com.rabbiter.market.domain.sale_management.exchange_point_products.ExchangePointProducts; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ExchangePointProductsMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/sale_management/sale_records/SaleRecordsMapper.java b/src/main/java/com/rabbiter/market/mapper/sale_management/sale_records/SaleRecordsMapper.java new file mode 100644 index 0000000..d528e1a --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/sale_management/sale_records/SaleRecordsMapper.java @@ -0,0 +1,9 @@ +package com.rabbiter.market.mapper.sale_management.sale_records; + +import com.rabbiter.market.domain.sale_management.sale_records.SaleRecords; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SaleRecordsMapper extends BaseMapper { +} diff --git a/src/main/java/com/rabbiter/market/mapper/system/menu/MenuMapper.java b/src/main/java/com/rabbiter/market/mapper/system/menu/MenuMapper.java new file mode 100644 index 0000000..1345dc7 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/system/menu/MenuMapper.java @@ -0,0 +1,22 @@ +package com.rabbiter.market.mapper.system.menu; + +import com.rabbiter.market.domain.system.menu.Menu; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Set; + +@Mapper +public interface MenuMapper extends BaseMapper { + + + /** + * 根据角色id集合查询权限信息 + * @param rids + * @return + */ + List queryByRids(Set rids); + + +} diff --git a/src/main/java/com/rabbiter/market/mapper/system/role/RoleMapper.java b/src/main/java/com/rabbiter/market/mapper/system/role/RoleMapper.java new file mode 100644 index 0000000..49055b4 --- /dev/null +++ b/src/main/java/com/rabbiter/market/mapper/system/role/RoleMapper.java @@ -0,0 +1,52 @@ +package com.rabbiter.market.mapper.system.role; + +import com.rabbiter.market.domain.system.role.Role; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +@Mapper +public interface RoleMapper extends BaseMapper { + /** + * 根据员工id查询角色信息 + * + * @param eid + * @return + */ + Set queryByEid(Long eid); + + /** + * 根据角色id查询菜单信息 + * + * @param rid + * @return + */ + List getMenuIdByRid(Long rid); + + /** + * 清除关系 + * + * @param rid + */ + void clearRecordsByRid(Long rid); + + + /** + * 保存关系 + * + * @param roleMenu + */ + void saveRolePermissons(List> roleMenu); + + List queryRoleIdsByEid(Long eid); + + void clearRelationByEid(Long eid); + + void reSaveRelation(List> list); + + List queryRoleIdsAll(); + +} diff --git a/src/main/java/com/rabbiter/market/qo/BaseQuery.java b/src/main/java/com/rabbiter/market/qo/BaseQuery.java new file mode 100644 index 0000000..75979b7 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/BaseQuery.java @@ -0,0 +1,38 @@ +package com.rabbiter.market.qo; + + +import java.io.Serializable; +import java.util.Map; + +public class BaseQuery implements Serializable { + private Integer currentPage=1; + private Integer pageSize=3; + private Map params;//其他请求参数 + public Integer getStart(){ + return (currentPage-1)*pageSize; + } + + public Integer getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(Integer currentPage) { + this.currentPage = currentPage; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Map getParams() { + return params; + } + + public void setParams(Map params) { + this.params = params; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/exchange_point_products_records/QueryExchangePointProductsRecords.java b/src/main/java/com/rabbiter/market/qo/exchange_point_products_records/QueryExchangePointProductsRecords.java new file mode 100644 index 0000000..76f9a9c --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/exchange_point_products_records/QueryExchangePointProductsRecords.java @@ -0,0 +1,42 @@ +package com.rabbiter.market.qo.exchange_point_products_records; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryExchangePointProductsRecords extends BaseQuery { + private String cn; + private Long memberId; + private String startTime; + private String endTime; + + public String getCn() { + return cn; + } + + public void setCn(String cn) { + this.cn = cn; + } + + public Long getMemberId() { + return memberId; + } + + public void setMemberId(Long memberId) { + this.memberId = memberId; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/goods_management/goods/QueryGoods.java b/src/main/java/com/rabbiter/market/qo/goods_management/goods/QueryGoods.java new file mode 100644 index 0000000..9f61399 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/goods_management/goods/QueryGoods.java @@ -0,0 +1,69 @@ +package com.rabbiter.market.qo.goods_management.goods; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryGoods extends BaseQuery { + private Long id; + private String name; + private Double sellPrice; + private Long categoryId; + private String state; + private String operateStartTime; + private String operateEndTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getSellPrice() { + return sellPrice; + } + + public void setSellPrice(Double sellPrice) { + this.sellPrice = sellPrice; + } + + public Long getCategoryId() { + return categoryId; + } + + public void setCategoryId(Long categoryId) { + this.categoryId = categoryId; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getOperateStartTime() { + return operateStartTime; + } + + public void setOperateStartTime(String operateStartTime) { + this.operateStartTime = operateStartTime; + } + + public String getOperateEndTime() { + return operateEndTime; + } + + public void setOperateEndTime(String operateEndTime) { + this.operateEndTime = operateEndTime; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/goods_management/goods_category/QueryGoodsCategory.java b/src/main/java/com/rabbiter/market/qo/goods_management/goods_category/QueryGoodsCategory.java new file mode 100644 index 0000000..fdabafb --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/goods_management/goods_category/QueryGoodsCategory.java @@ -0,0 +1,26 @@ +package com.rabbiter.market.qo.goods_management.goods_category; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryGoodsCategory extends BaseQuery { + private String name; + private String state; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} + + diff --git a/src/main/java/com/rabbiter/market/qo/goods_management/goods_store/QueryGoodsStore.java b/src/main/java/com/rabbiter/market/qo/goods_management/goods_store/QueryGoodsStore.java new file mode 100644 index 0000000..8a0179d --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/goods_management/goods_store/QueryGoodsStore.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.qo.goods_management.goods_store; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryGoodsStore extends BaseQuery { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/goods_management/point_products/QueryPointProducts.java b/src/main/java/com/rabbiter/market/qo/goods_management/point_products/QueryPointProducts.java new file mode 100644 index 0000000..98157c9 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/goods_management/point_products/QueryPointProducts.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.qo.goods_management.point_products; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryPointProducts extends BaseQuery { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/goods_management/statistic_sale/QueryStatisticSale.java b/src/main/java/com/rabbiter/market/qo/goods_management/statistic_sale/QueryStatisticSale.java new file mode 100644 index 0000000..317e0b6 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/goods_management/statistic_sale/QueryStatisticSale.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.qo.goods_management.statistic_sale; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryStatisticSale extends BaseQuery { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoods.java b/src/main/java/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoods.java new file mode 100644 index 0000000..2329b09 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoods.java @@ -0,0 +1,51 @@ +package com.rabbiter.market.qo.inventory_management.detail_store_goods; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryDetailStoreGoods extends BaseQuery { + private String cn; + private String goodsName; + private String state1; + private String startCreateTime; + private String endCreateTime; + + public String getCn() { + return cn; + } + + public void setCn(String cn) { + this.cn = cn; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getState1() { + return state1; + } + + public void setState1(String state1) { + this.state1 = state1; + } + + public String getStartCreateTime() { + return startCreateTime; + } + + public void setStartCreateTime(String startCreateTime) { + this.startCreateTime = startCreateTime; + } + + public String getEndCreateTime() { + return endCreateTime; + } + + public void setEndCreateTime(String endCreateTime) { + this.endCreateTime = endCreateTime; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoodsOut.java b/src/main/java/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoodsOut.java new file mode 100644 index 0000000..33be920 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoodsOut.java @@ -0,0 +1,60 @@ +package com.rabbiter.market.qo.inventory_management.detail_store_goods; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryDetailStoreGoodsOut extends BaseQuery { + private String cn; + private String goodsName; + private String state1; + private String state; + private String startCreateTime; + private String endCreateTime; + + public String getCn() { + return cn; + } + + public void setCn(String cn) { + this.cn = cn; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getState1() { + return state1; + } + + public void setState1(String state1) { + this.state1 = state1; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getStartCreateTime() { + return startCreateTime; + } + + public void setStartCreateTime(String startCreateTime) { + this.startCreateTime = startCreateTime; + } + + public String getEndCreateTime() { + return endCreateTime; + } + + public void setEndCreateTime(String endCreateTime) { + this.endCreateTime = endCreateTime; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeIn.java b/src/main/java/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeIn.java new file mode 100644 index 0000000..2979c58 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeIn.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.qo.inventory_management.notice; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryNoticeIn extends BaseQuery { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeOut.java b/src/main/java/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeOut.java new file mode 100644 index 0000000..06eb803 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeOut.java @@ -0,0 +1,24 @@ +package com.rabbiter.market.qo.inventory_management.notice; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryNoticeOut extends BaseQuery { + private String name; + private String state; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryDetailStorageSituation.java b/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryDetailStorageSituation.java new file mode 100644 index 0000000..da8cdeb --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryDetailStorageSituation.java @@ -0,0 +1,24 @@ +package com.rabbiter.market.qo.inventory_management.store; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryDetailStorageSituation extends BaseQuery { + private Long id; + private Long storeId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryStorageSituation.java b/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryStorageSituation.java new file mode 100644 index 0000000..6214d13 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryStorageSituation.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.qo.inventory_management.store; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryStorageSituation extends BaseQuery { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryStore.java b/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryStore.java new file mode 100644 index 0000000..4d505d1 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/inventory_management/store/QueryStore.java @@ -0,0 +1,24 @@ +package com.rabbiter.market.qo.inventory_management.store; + +import java.io.Serializable; + +public class QueryStore implements Serializable { + private String name; + private String state; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/inventory_management/supplier/QuerySupplier.java b/src/main/java/com/rabbiter/market/qo/inventory_management/supplier/QuerySupplier.java new file mode 100644 index 0000000..0e1192f --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/inventory_management/supplier/QuerySupplier.java @@ -0,0 +1,33 @@ +package com.rabbiter.market.qo.inventory_management.supplier; + +import com.rabbiter.market.qo.BaseQuery; + +public class QuerySupplier extends BaseQuery { + private String name; + private String address; + private String info; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/member_management/member/QueryMember.java b/src/main/java/com/rabbiter/market/qo/member_management/member/QueryMember.java new file mode 100644 index 0000000..877990a --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/member_management/member/QueryMember.java @@ -0,0 +1,33 @@ +package com.rabbiter.market.qo.member_management.member; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryMember extends BaseQuery { + private String phone; + private String state; + private String name; + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/personal/QueryEditPwd.java b/src/main/java/com/rabbiter/market/qo/personal/QueryEditPwd.java new file mode 100644 index 0000000..1658c84 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/personal/QueryEditPwd.java @@ -0,0 +1,33 @@ +package com.rabbiter.market.qo.personal; + +import java.io.Serializable; + +public class QueryEditPwd implements Serializable { + private String username; + private String oldPwd; + private String newPwd; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getOldPwd() { + return oldPwd; + } + + public void setOldPwd(String oldPwd) { + this.oldPwd = oldPwd; + } + + public String getNewPwd() { + return newPwd; + } + + public void setNewPwd(String newPwd) { + this.newPwd = newPwd; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/personnel_management/department/QueryDept.java b/src/main/java/com/rabbiter/market/qo/personnel_management/department/QueryDept.java new file mode 100644 index 0000000..86158c4 --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/personnel_management/department/QueryDept.java @@ -0,0 +1,24 @@ +package com.rabbiter.market.qo.personnel_management.department; + +public class QueryDept { + private String name; + private String state; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} + + diff --git a/src/main/java/com/rabbiter/market/qo/personnel_management/employee/QueryEmp.java b/src/main/java/com/rabbiter/market/qo/personnel_management/employee/QueryEmp.java new file mode 100644 index 0000000..c1564ac --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/personnel_management/employee/QueryEmp.java @@ -0,0 +1,60 @@ +package com.rabbiter.market.qo.personnel_management.employee; + +import com.rabbiter.market.qo.BaseQuery; + +public class QueryEmp extends BaseQuery { + private String username; + private String nickName; + private String age; + private String address; + private String sex; + private Long deptId; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getAge() { + return age; + } + + public void setAge(String age) { + this.age = age; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/sale_records/QuerySaleRecords.java b/src/main/java/com/rabbiter/market/qo/sale_records/QuerySaleRecords.java new file mode 100644 index 0000000..613899e --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/sale_records/QuerySaleRecords.java @@ -0,0 +1,51 @@ +package com.rabbiter.market.qo.sale_records; + +import com.rabbiter.market.qo.BaseQuery; + +public class QuerySaleRecords extends BaseQuery { + private String cn; + private String startSellTime; + private String endSellTime; + private String type; + private String sellway; + + public String getCn() { + return cn; + } + + public void setCn(String cn) { + this.cn = cn; + } + + public String getStartSellTime() { + return startSellTime; + } + + public void setStartSellTime(String startSellTime) { + this.startSellTime = startSellTime; + } + + public String getEndSellTime() { + return endSellTime; + } + + public void setEndSellTime(String endSellTime) { + this.endSellTime = endSellTime; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getSellway() { + return sellway; + } + + public void setSellway(String sellway) { + this.sellway = sellway; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/system/MenuQuery.java b/src/main/java/com/rabbiter/market/qo/system/MenuQuery.java new file mode 100644 index 0000000..75acaed --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/system/MenuQuery.java @@ -0,0 +1,15 @@ +package com.rabbiter.market.qo.system; + +import com.rabbiter.market.qo.BaseQuery; + +public class MenuQuery extends BaseQuery { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/rabbiter/market/qo/system/RoleQuery.java b/src/main/java/com/rabbiter/market/qo/system/RoleQuery.java new file mode 100644 index 0000000..3fd206f --- /dev/null +++ b/src/main/java/com/rabbiter/market/qo/system/RoleQuery.java @@ -0,0 +1,22 @@ +package com.rabbiter.market.qo.system; + +public class RoleQuery{ + private String name; + private String state; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/rabbiter/market/service/goods_management/goods/IGoodsService.java b/src/main/java/com/rabbiter/market/service/goods_management/goods/IGoodsService.java new file mode 100644 index 0000000..a566539 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/goods_management/goods/IGoodsService.java @@ -0,0 +1,152 @@ +package com.rabbiter.market.service.goods_management.goods; // 商品管理服务接口包路径 + +// 导入商品实体类 +import com.rabbiter.market.domain.goods_management.goods.Goods; +// 导入库存明细实体类 +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; +// 导入入库通知单实体类 +import com.rabbiter.market.domain.inventory_management.notice.NoticeIn; +// 导入出库通知单实体类 +import com.rabbiter.market.domain.inventory_management.notice.NoticeOut; +// 导入商品查询对象 +import com.rabbiter.market.qo.goods_management.goods.QueryGoods; +// 导入商品库存查询对象 +import com.rabbiter.market.qo.goods_management.goods_store.QueryGoodsStore; +// 导入销售统计查询对象 +import com.rabbiter.market.qo.goods_management.statistic_sale.QueryStatisticSale; +// 导入入库通知查询对象 +import com.rabbiter.market.qo.inventory_management.notice.QueryNoticeIn; +// 导入出库通知查询对象 +import com.rabbiter.market.qo.inventory_management.notice.QueryNoticeOut; +// 导入异常入库通知VO +import com.rabbiter.market.vo.detail_store_goods.notice.NoticeInNotNormalVo; +// 导入商品列表VO +import com.rabbiter.market.vo.goods.GoodsListVo; +// 导入商品库存VO +import com.rabbiter.market.vo.goods_management.goods_store.GoodsStoreVo; +// 导入销售统计VO +import com.rabbiter.market.vo.statistics.sale_management.SalesStatisticsVo; +// 导入MyBatis-Plus分页组件 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +// 导入MyBatis-Plus服务接口 +import com.baomidou.mybatisplus.extension.service.IService; + +// 导入集合类 +import java.util.List; +import java.util.Map; + +/** + * 商品服务接口 + * 继承MyBatis-Plus的IService接口 + */ +public interface IGoodsService extends IService { + /** + * 分页查询商品数据 + * @param qo 商品查询条件对象 + * @return 分页的商品列表VO + */ + Page queryPageByQo(QueryGoods qo); + + /** + * 保存商品信息 + * @param goods 商品实体对象 + * @param token 用户令牌 + */ + void saveGoods(Goods goods, String token); + + /** + * 商品上架/下架操作 + * @param gid 商品ID + * @param state 状态(上架/下架) + * @param token 用户令牌 + */ + void upOrdown(Long gid, String state,String token); + + /** + * 更新商品信息 + * @param goods 商品实体对象 + * @param token 用户令牌 + */ + void updateGoods(Goods goods, String token); + + /** + * 查询所有上架商品(用于下拉选择) + * @return 商品ID和名称的Map列表 + */ + List> selected_goodsAll(); + + /** + * 查询所有正常状态的仓库(用于下拉选择) + * @return 仓库ID和名称的Map列表 + */ + List> selected_storeAll(); + + /** + * 商品退货处理 + * @param detailStoreGoods 库存明细对象 + * @param token 用户令牌 + */ + void returnGoods(DetailStoreGoods detailStoreGoods, String token); + + /** + * 分页查询商品库存信息 + * @param qo 商品库存查询条件 + * @return 分页的商品库存VO + */ + Page queryPageGoodsStore(QueryGoodsStore qo); + + /** + * 根据ID查询商品库存详情 + * @param id 商品ID + * @return 商品库存VO + */ + GoodsStoreVo queryGoodsStoreById(Long id); + + /** + * 更新库存信息 + * @param vo 商品库存VO + */ + void updateInventory(GoodsStoreVo vo); + + /** + * 分页查询入库通知单 + * @param qo 入库通知查询条件 + * @return 分页的入库通知单 + */ + Page queryPageNoticeIn(QueryNoticeIn qo); + + /** + * 分页查询货架出库通知单 + * @param qo 出库通知查询条件 + * @return 分页的出库通知单 + */ + Page queryPageNoticeOut_shelves(QueryNoticeOut qo); + + /** + * 保存货架出库记录 + * @param detailStoreGoods 库存明细对象 + * @param token 用户令牌 + */ + void saveOut_shelves(DetailStoreGoods detailStoreGoods,String token); + + /** + * 分页查询销售统计数据 + * @param qo 销售统计查询条件 + * @return 销售统计VO + */ + SalesStatisticsVo queryPageStatisticSaleByQo(QueryStatisticSale qo); + + /** + * 分页查询未处理的异常出库通知单 + * @param qo 出库通知查询条件 + * @return 分页的异常入库通知VO + */ + Page queryPageNoticeOut_untreated(QueryNoticeOut qo); + + /** + * 处理未处理的异常出库单 + * @param vo 异常入库通知VO + * @param token 用户令牌 + */ + void resolveOutUntreatedForm(NoticeInNotNormalVo vo, String token); +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/service/goods_management/goods/impl/GoodsServiceImpl.java b/src/main/java/com/rabbiter/market/service/goods_management/goods/impl/GoodsServiceImpl.java new file mode 100644 index 0000000..189572d --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/goods_management/goods/impl/GoodsServiceImpl.java @@ -0,0 +1,523 @@ +package com.rabbiter.market.service.goods_management.goods.impl; + +// 导入必要的类和包 +import com.rabbiter.market.common.exception.BusinessException; // 业务异常类 +import com.rabbiter.market.common.redis.constants.RedisKeys; // Redis键常量 +import com.rabbiter.market.common.redis.service.RedisTemplateService; // Redis服务 +import com.rabbiter.market.domain.goods_management.goods.Goods; // 商品实体 +import com.rabbiter.market.domain.goods_management.goods_category.GoodsCategory; // 商品分类实体 +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; // 库存明细实体 +import com.rabbiter.market.domain.inventory_management.notice.NoticeIn; // 入库通知单 +import com.rabbiter.market.domain.inventory_management.notice.NoticeOut; // 出库通知单 +import com.rabbiter.market.domain.inventory_management.store.GoodsStore; // 商品库存 +import com.rabbiter.market.domain.inventory_management.store.Store; // 仓库 +import com.rabbiter.market.domain.personnel_management.employee.Employee; // 员工 +import com.rabbiter.market.mapper.goods_management.goods.GoodsMapper; // 商品Mapper +import com.rabbiter.market.qo.goods_management.goods.QueryGoods; // 商品查询对象 +import com.rabbiter.market.qo.goods_management.goods_store.QueryGoodsStore; // 商品库存查询 +import com.rabbiter.market.qo.goods_management.statistic_sale.QueryStatisticSale; // 销售统计查询 +import com.rabbiter.market.qo.inventory_management.notice.QueryNoticeIn; // 入库通知查询 +import com.rabbiter.market.qo.inventory_management.notice.QueryNoticeOut; // 出库通知查询 +import com.rabbiter.market.service.goods_management.goods.IGoodsService; // 商品服务接口 +import com.rabbiter.market.service.goods_management.goods_category.IGoodsCategoryService; // 分类服务 +import com.rabbiter.market.service.inventory_management.detail_store_goods.IDetailStoreGoodsService; // 库存明细服务 +import com.rabbiter.market.service.inventory_management.store.IGoodsStoreService; // 商品库存服务 +import com.rabbiter.market.service.inventory_management.store.IStoreService; // 仓库服务 +import com.rabbiter.market.vo.detail_store_goods.notice.NoticeInNotNormalVo; // 异常入库VO +import com.rabbiter.market.vo.goods.GoodsListVo; // 商品列表VO +import com.rabbiter.market.vo.goods_management.goods_store.GoodsStoreVo; // 商品库存VO +import com.rabbiter.market.vo.statistics.sale_management.SaleGoodsVo; // 销售商品VO +import com.rabbiter.market.vo.statistics.sale_management.SalesStatisticsVo; // 销售统计VO +import com.alibaba.fastjson.JSONObject; // JSON处理 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; // 查询条件构造器 +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; // 更新条件构造器 +import com.baomidou.mybatisplus.core.toolkit.IdWorker; // ID生成器 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; // 分页 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; // MyBatis-Plus服务实现 +import org.springframework.beans.BeanUtils; // 属性拷贝 +import org.springframework.beans.factory.annotation.Autowired; // 自动注入 +import org.springframework.stereotype.Service; // 服务注解 +import org.springframework.transaction.annotation.Transactional; // 事务注解 +import org.springframework.util.StringUtils; // 字符串工具 + +import java.util.*; // 集合工具 + +@Service // 标识这是一个Spring服务组件 +public class GoodsServiceImpl extends ServiceImpl implements IGoodsService { + @Autowired // 自动注入Redis服务 + private RedisTemplateService redisTemplateService; + @Autowired // 自动注入商品分类服务 + private IGoodsCategoryService goodsCategoryService; + + @Autowired // 自动注入仓库服务 + private IStoreService storeService; + @Autowired // 自动注入库存明细服务 + private IDetailStoreGoodsService detailStoreGoodsService; + @Autowired // 自动注入商品库存服务 + private IGoodsStoreService goodsStoreService; + @Autowired // 自动注入商品Mapper + private GoodsMapper goodsMapper; + + @Override // 实现分页查询商品方法 + public Page queryPageByQo(QueryGoods qo) { + // 创建分页对象,设置当前页和每页大小 + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + // 创建商品VO列表 + ArrayList volists = new ArrayList<>(); + // 创建商品分页对象 + Page goodsPage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + // 构建查询条件 + QueryWrapper wrapper = new QueryWrapper() + .eq(qo.getId() != null, "id", qo.getId()) // ID相等条件 + .eq(qo.getSellPrice() != null, "sell_price", qo.getSellPrice()) // 价格相等条件 + .like(StringUtils.hasText(qo.getName()), "name", qo.getName()) // 名称模糊查询 + .eq(qo.getCategoryId() != null, "category_id", qo.getCategoryId()) // 分类ID相等 + .eq(StringUtils.hasText(qo.getState()), "state", qo.getState()) // 状态相等 + .ge(StringUtils.hasText(qo.getOperateStartTime()), "update_time", qo.getOperateStartTime()) // 更新时间大于等于 + .le(StringUtils.hasText(qo.getOperateEndTime()), "update_time", qo.getOperateEndTime()); // 更新时间小于等于 + // 执行分页查询 + super.page(goodsPage, wrapper); + // 遍历查询结果 + for (Goods record : goodsPage.getRecords()) { + GoodsListVo vo = new GoodsListVo(); // 创建商品VO对象 + BeanUtils.copyProperties(record, vo); // 复制属性 + // 查询商品剩余库存数量 + Long residueNum=storeService.getResidueNumByGoodsId(record.getId()); + vo.setResidueStoreNum(residueNum); // 设置剩余库存 + volists.add(vo); // 添加到列表 + } + // 设置分页结果 + page.setRecords(volists); + page.setTotal(goodsPage.getTotal()); // 设置总记录数 + return page; + } + + @Override // 保存商品方法 + public void saveGoods(Goods goods, String token) { + // 从Redis中获取员工信息 + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + goods.setState(Goods.STATE_UP); // 设置商品状态为上架 + goods.setCreateby(employee.getNickName()); // 设置创建人 + goods.setUpdateby(employee.getNickName()); // 设置更新人 + goods.setCreateTime(new Date()); // 设置创建时间 + goods.setUpdateTime(new Date()); // 设置更新时间 + if (goods.getCategoryId() != null) { // 如果有分类ID + /*从缓存中获取分类的信息*/ + if (redisTemplateService.hasKey(RedisKeys.GOODS_CATEGORY.join())) { // 检查Redis中是否有分类缓存 + Map categoryCache = redisTemplateService.getCacheMap(RedisKeys.GOODS_CATEGORY.join()); + GoodsCategory category = (GoodsCategory) categoryCache.get(goods.getCategoryId().toString()); + if (category != null) { + goods.setCategoryName(category.getName()); // 设置分类名称 + } + } else { // 如果Redis中没有缓存 + GoodsCategory category = goodsCategoryService.getById(goods.getCategoryId()); // 从数据库查询 + if (category != null) { + goods.setCategoryName(category.getName()); // 设置分类名称 + } + } + } + super.save(goods); // 保存商品 + } + + @Transactional // 事务注解 + @Override // 商品上架/下架方法 + public void upOrdown(Long gid, String state,String token) { + UpdateWrapper wrapper = new UpdateWrapper<>(); // 创建更新条件 + wrapper.eq("id", gid); // 设置更新条件为ID相等 + if (Goods.STATE_UP.equals(state)) { // 如果是上架操作 + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + wrapper.set("state", Goods.STATE_DOWN); // 设置状态为下架 + Goods goods = super.getById(gid); // 获取商品信息 + // 查询商品在各仓库的库存 + QueryWrapper goodsStoreQueryWrapper = new QueryWrapper().eq("goods_id", gid); + List list = goodsStoreService.list(goodsStoreQueryWrapper); + // 为每个仓库创建下架记录 + for (GoodsStore goodsStore : list) { + DetailStoreGoods detailStoreGoods = new DetailStoreGoods(); + detailStoreGoods.setCreateid(employee.getId()); // 设置创建人ID + detailStoreGoods.setCreateby(employee.getNickName()); // 设置创建人名称 + detailStoreGoods.setCreateTime(new Date()); // 设置创建时间 + detailStoreGoods.setGoodsId(gid); // 设置商品ID + detailStoreGoods.setGoodsName(goods.getName()); // 设置商品名称 + detailStoreGoods.setType(DetailStoreGoods.TYPE_IN); // 设置类型为入库 + detailStoreGoods.setState1(DetailStoreGoods.STATE1_UNTREATED); // 设置状态为未处理 + detailStoreGoods.setState(DetailStoreGoods.STATE_DOWN); // 设置状态为下架 + detailStoreGoods.setCn(IdWorker.getIdStr()); // 生成唯一编号 + detailStoreGoods.setInfo(goods.getName()+"下架处理"); // 设置描述信息 + detailStoreGoods.setGoodsNum(goodsStore.getResidueNum()); // 设置商品数量 + detailStoreGoods.setUntreatedNum(goodsStore.getResidueNum()); // 设置未处理数量 + detailStoreGoods.setStoreId(goodsStore.getStoreId()); // 设置仓库ID + detailStoreGoodsService.save(detailStoreGoods); // 保存下架记录 + } + } else { // 如果是上架操作 + wrapper.set("residue_num",0); // 设置剩余数量为0 + wrapper.set("state", Goods.STATE_UP); // 设置状态为上架 + // 删除未处理的下架记录 + QueryWrapper queryWrapper = new QueryWrapper().eq("goods_id", gid) + .eq("state", DetailStoreGoods.STATE_DOWN) + .eq("state1", DetailStoreGoods.STATE1_UNTREATED); + detailStoreGoodsService.remove(queryWrapper); + } + super.update(wrapper); // 执行更新 + } + + @Override // 更新商品方法 + public void updateGoods(Goods goods, String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + goods.setUpdateby(employee.getNickName()); // 设置更新人 + goods.setUpdateTime(new Date()); // 设置更新时间 + if (goods.getCategoryId() != null) { // 如果有分类ID + /*从缓存中获取分类的信息*/ + if (redisTemplateService.hasKey(RedisKeys.GOODS_CATEGORY.join())) { // 检查Redis缓存 + Map categoryCache = redisTemplateService.getCacheMap(RedisKeys.GOODS_CATEGORY.join()); + GoodsCategory category = (GoodsCategory) categoryCache.get(goods.getCategoryId().toString()); + if (category != null) { + goods.setCategoryName(category.getName()); // 设置分类名称 + } + } else { // 如果缓存中没有 + GoodsCategory category = goodsCategoryService.getById(goods.getCategoryId()); // 从数据库查询 + if (category != null) { + goods.setCategoryName(category.getName()); // 设置分类名称 + } + } + } + super.updateById(goods); // 更新商品 + } + + @Override // 查询所有上架商品方法 + public List> selected_goodsAll() { + QueryWrapper wrapper = new QueryWrapper().eq("state", Goods.STATE_UP); // 查询上架商品 + List list = super.list(wrapper); + if (list==null||list.size()==0){ // 如果结果为空 + return null; + } + List> listVo = new ArrayList<>(); // 创建结果列表 + for (Goods goods : list) { + Map map = new HashMap<>(); // 创建结果Map + map.put("id",goods.getId()); // 设置商品ID + map.put("name",goods.getName()); // 设置商品名称 + listVo.add(map); // 添加到结果列表 + } + return listVo; + } + + @Override // 查询所有正常状态的仓库 + public List> selected_storeAll() { + List> list = new ArrayList<>(); // 创建结果列表 + QueryWrapper wrapper = new QueryWrapper().eq("state", Store.STATE_NORMAL); // 查询正常状态的仓库 + List list1 = storeService.list(wrapper); + if (list1!=null &&list1.size()>0){ // 如果有结果 + for (Store store : list1) { + Map map = new HashMap<>(); // 创建结果Map + map.put("id",store.getId()); // 设置仓库ID + map.put("name",store.getName()); // 设置仓库名称 + list.add(map); // 添加到结果列表 + } + } + return list; + } + + @Override // 商品退货方法 + public void returnGoods(DetailStoreGoods detailStoreGoods, String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + Goods goods = super.getById(detailStoreGoods.getGoodsId()); // 获取商品信息 + + /*补全入库订单信息*/ + detailStoreGoods.setCn(IdWorker.getIdStr()); // 生成唯一编号 + detailStoreGoods.setCreateby(employee.getNickName()); // 设置创建人 + detailStoreGoods.setCreateid(employee.getId()); // 设置创建人ID + detailStoreGoods.setType(DetailStoreGoods.TYPE_IN); // 设置类型为入库 + if (DetailStoreGoods.STATE_EXPIRY.equals(detailStoreGoods.getState())){ // 如果是过期商品 + //如果是过期,将入库订单的state1修改成2:待处理的状态 + detailStoreGoods.setState1(DetailStoreGoods.STATE1_UNTREATED); // 设置状态为未处理 + }else { + detailStoreGoods.setState1(DetailStoreGoods.STATE1_NORMAL); // 设置状态为正常 + } + + /*获取仓库的信息*/ + QueryWrapper goodsStoreQueryWrapper = new QueryWrapper() + .eq("goods_id", detailStoreGoods.getGoodsId()) // 商品ID条件 + .eq("store_id", detailStoreGoods.getStoreId()); // 仓库ID条件 + GoodsStore goodsStore = goodsStoreService.getOne(goodsStoreQueryWrapper); + if (goodsStore==null){ // 如果商品在该仓库没有库存记录 + goodsStore = new GoodsStore(); // 创建新的库存记录 + goodsStore.setGoodsId(detailStoreGoods.getGoodsId()); // 设置商品ID + goodsStore.setStoreId(detailStoreGoods.getStoreId()); // 设置仓库ID + Store store = storeService.getById(detailStoreGoods.getStoreId()); // 获取仓库信息 + goodsStore.setStoreName(store.getName()); // 设置仓库名称 + goodsStore.setInNum(0L); // 设置入库数量为0 + goodsStore.setResidueNum(0L); // 设置剩余数量为0 + goodsStoreService.save(goodsStore); // 保存库存记录 + } + long num = goods.getResidueNum() - detailStoreGoods.getGoodsNum(); // 计算货架剩余数量 + if (num>=0){ // 如果货架还有足够商品 + //货架还有商品数量 + /*更改商品信息*/ + UpdateWrapper goodsUpdateWrapper = new UpdateWrapper() + .set("residue_num", num) // 更新剩余数量 + .eq("id", detailStoreGoods.getGoodsId()); + super.update(goodsUpdateWrapper); + /*更改商品库存信息*/ + UpdateWrapper goodsStoreUpdateWrapper = new UpdateWrapper() + .set("residue_num", goodsStore.getResidueNum() + detailStoreGoods.getGoodsNum()) // 增加库存数量 + .eq("goods_id", detailStoreGoods.getGoodsId()) + .eq("store_id", detailStoreGoods.getStoreId()); + goodsStoreService.update(goodsStoreUpdateWrapper); + detailStoreGoods.setUntreatedNum(detailStoreGoods.getGoodsNum()); // 设置未处理数量 + + }else { // 如果货架商品不足 + //货架没有商品数量 + /*更改商品信息*/ + UpdateWrapper goodsUpdateWrapper = new UpdateWrapper() + .set("residue_num", 0) // 设置剩余数量为0 + .eq("id", detailStoreGoods.getGoodsId()); + super.update(goodsUpdateWrapper); + /*更改商品库存信息*/ + UpdateWrapper goodsStoreUpdateWrapper = new UpdateWrapper() + .set("residue_num", goodsStore.getResidueNum() + goods.getResidueNum()) // 增加库存数量 + .eq("goods_id", detailStoreGoods.getGoodsId()) + .eq("store_id", detailStoreGoods.getStoreId()); + goodsStoreService.update(goodsStoreUpdateWrapper); + detailStoreGoods.setGoodsNum(goods.getResidueNum()); // 设置商品数量为货架剩余数量 + detailStoreGoods.setUntreatedNum(goods.getResidueNum()); // 设置未处理数量 + } + detailStoreGoodsService.save(detailStoreGoods); // 保存退货记录 + } + + @Override // 分页查询商品库存 + public Page queryPageGoodsStore(QueryGoodsStore qo) { + Page page = new Page<>(qo.getCurrentPage(),qo.getPageSize()); // 创建分页对象 + Page goodsPage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建商品分页对象 + QueryWrapper wrapper = new QueryWrapper().eq("state", Goods.STATE_UP) // 查询上架商品 + .like(StringUtils.hasText(qo.getName()), "name", qo.getName()); // 名称模糊查询 + super.page(goodsPage,wrapper); // 执行分页查询 + if (goodsPage.getTotal()<=0) { // 如果没有结果 + page.setRecords(new ArrayList<>()); // 设置空列表 + page.setTotal(0); // 设置总数为0 + return page; + } + List list = new ArrayList<>(); // 创建结果列表 + for (Goods record : goodsPage.getRecords()) { + GoodsStoreVo vo = new GoodsStoreVo(); // 创建VO对象 + BeanUtils.copyProperties(record,vo); // 复制属性 + list.add(vo); // 添加到结果列表 + } + page.setTotal(goodsPage.getTotal()); // 设置总数 + page.setRecords(list); // 设置记录 + return page; + } + + @Override // 根据ID查询商品库存 + public GoodsStoreVo queryGoodsStoreById(Long id) { + GoodsStoreVo vo = new GoodsStoreVo(); // 创建VO对象 + Goods goods = super.getById(id); // 根据ID查询商品 + BeanUtils.copyProperties(goods,vo); // 复制属性 + return vo; + } + + @Override // 更新库存信息 + public void updateInventory(GoodsStoreVo vo) { + if (vo.getInventory()==null){ // 如果库存为空 + vo.setInventory(0L); // 设置为0 + } + if(vo.getShelves()==null){ // 如果货架数量为空 + vo.setShelves(0L); // 设置为0 + } + UpdateWrapper updateWrapper = new UpdateWrapper() + .set("inventory",vo.getInventory()) // 设置库存 + .set("shelves",vo.getShelves()) // 设置货架数量 + .eq("id",vo.getId()); // ID条件 + super.update(updateWrapper); // 执行更新 + } + + @Override // 分页查询入库通知单 + public Page queryPageNoticeIn(QueryNoticeIn qo) { + Page noticeInPage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建分页对象 + List list = new ArrayList<>(); // 创建结果列表 + int start=(qo.getCurrentPage()-1)*qo.getPageSize(); // 计算起始位置 + Map map = new HashMap<>(); // 创建查询参数Map + map.put("start",start); // 设置起始位置 + map.put("size",qo.getPageSize()); // 设置每页大小 + if (StringUtils.hasLength(qo.getName())){ // 如果有名称条件 + map.put("name",qo.getName()); // 设置名称参数 + } + int totalCount=goodsMapper.getNoticeInTotalCount(map); // 获取总数 + list=goodsMapper.getNoticePageList(map); // 获取分页列表 + noticeInPage.setTotal(totalCount); // 设置总数 + noticeInPage.setRecords(list); // 设置记录 + return noticeInPage; + } + + @Override // 分页查询货架出库通知单 + public Page queryPageNoticeOut_shelves(QueryNoticeOut qo) { + Page noticeOutPage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建分页对象 + List list = new ArrayList<>(); // 创建结果列表 + int start=(qo.getCurrentPage()-1)*qo.getPageSize(); // 计算起始位置 + Map map = new HashMap<>(); // 创建查询参数Map + map.put("start",start); // 设置起始位置 + map.put("size",qo.getPageSize()); // 设置每页大小 + if (StringUtils.hasLength(qo.getName())){ // 如果有名称条件 + map.put("name",qo.getName()); // 设置名称参数 + } + int totalCount=goodsMapper.getNoticeOutShelvesTotalCount(map); // 获取总数 + list=goodsMapper.getNoticeShelvesPageList(map); // 获取分页列表 + noticeOutPage.setTotal(totalCount); // 设置总数 + noticeOutPage.setRecords(list); // 设置记录 + return noticeOutPage; + } + + @Override // 保存货架出库记录 + public void saveOut_shelves(DetailStoreGoods detailStoreGoods,String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + // 查询商品在指定仓库的库存 + QueryWrapper detailStoreGoodsQueryWrapper = new QueryWrapper().eq("goods_id", detailStoreGoods.getGoodsId()) + .eq("store_id", detailStoreGoods.getStoreId()); + GoodsStore goodsStore = goodsStoreService.getOne(detailStoreGoodsQueryWrapper); + if (goodsStore==null || goodsStore.getResidueNum()==null ||goodsStore.getResidueNum()==0){ // 如果没有库存 + throw new BusinessException("出库失败,库存中没有该商品的库存"); // 抛出业务异常 + } + /*补全出库单的信息*/ + detailStoreGoods.setCn(IdWorker.getIdStr()); // 生成唯一编号 + detailStoreGoods.setCreateby(employee.getNickName()); // 设置创建人 + detailStoreGoods.setCreateid(employee.getId()); // 设置创建人ID + detailStoreGoods.setType(DetailStoreGoods.TYPE_OUT); // 设置类型为出库 + detailStoreGoods.setState1(DetailStoreGoods.STATE1_NORMAL); // 设置状态为正常 + long num = goodsStore.getResidueNum() - detailStoreGoods.getGoodsNum(); // 计算库存剩余数量 + Goods goods = super.getById(detailStoreGoods.getGoodsId()); // 获取商品信息 + if (num>=0){ // 如果库存足够 + /*修改货架商品数量*/ + UpdateWrapper goodsUpdateWrapper = new UpdateWrapper() + .set("residue_num", goods.getResidueNum() == null ? detailStoreGoods.getGoodsNum() : goods.getResidueNum() + detailStoreGoods.getGoodsNum()) // 增加货架数量 + .eq("id",detailStoreGoods.getGoodsId()); + super.update(goodsUpdateWrapper); + /*修改商品库存数量*/ + UpdateWrapper goodsStoreUpdateWrapper = new UpdateWrapper() + .set("residue_num", goodsStore.getResidueNum() - detailStoreGoods.getGoodsNum()) // 减少库存数量 + .eq("goods_id", detailStoreGoods.getGoodsId()) + .eq("store_id", detailStoreGoods.getStoreId()); + goodsStoreService.update(goodsStoreUpdateWrapper); + /*添加出库记录*/ + detailStoreGoodsService.save(detailStoreGoods); // 保存出库记录 + }else { // 如果库存不足 + /*修改货架商品数量*/ + UpdateWrapper goodsUpdateWrapper = new UpdateWrapper() + .set("residue_num", goods.getResidueNum() == null ? goodsStore.getResidueNum() : goods.getResidueNum() + goodsStore.getResidueNum()) // 增加货架数量 + .eq("id",detailStoreGoods.getGoodsId()); + super.update(goodsUpdateWrapper); + /*修改商品库存数量*/ + UpdateWrapper goodsStoreUpdateWrapper = new UpdateWrapper() + .set("residue_num",0L) // 设置库存为0 + .eq("goods_id", detailStoreGoods.getGoodsId()) + .eq("store_id", detailStoreGoods.getStoreId()); + goodsStoreService.update(goodsStoreUpdateWrapper); + /*添加出库记录*/ + detailStoreGoods.setGoodsNum(goodsStore.getResidueNum()); // 设置出库数量为库存剩余数量 + detailStoreGoodsService.save(detailStoreGoods); // 保存出库记录 + } + } + + @Override // 分页查询销售统计 + public SalesStatisticsVo queryPageStatisticSaleByQo(QueryStatisticSale qo) { + Long total=goodsMapper.queryPageStatisticSaleByQo(qo.getName()); // 获取销售总量 + SalesStatisticsVo vo = new SalesStatisticsVo(); // 创建销售统计VO + vo.setTotal(total); // 设置总量 + QueryWrapper wrapper = new QueryWrapper().eq("state", Goods.STATE_UP) // 查询上架商品 + .like(StringUtils.hasText(qo.getName()), "name", qo.getName()); // 名称模糊查询 + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建分页对象 + super.page(page,wrapper); // 执行分页查询 + Page saleGoodsVoPage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建销售商品分页 + saleGoodsVoPage.setTotal(page.getTotal()); // 设置总数 + List saleGoodsVos = new ArrayList<>(); // 创建销售商品列表 + for (Goods record : page.getRecords()) { + SaleGoodsVo goodsVo = new SaleGoodsVo(); // 创建销售商品VO + goodsVo.setGoodsId(record.getId()); // 设置商品ID + goodsVo.setGoodsName(record.getName()); // 设置商品名称 + goodsVo.setSalesVolume(record.getSalesVolume()); // 设置销售量 + goodsVo.setPercentage(total); // 设置占比 + goodsVo.setCoverUrl(record.getCoverUrl()); // 设置封面URL + saleGoodsVos.add(goodsVo); // 添加到列表 + } + saleGoodsVoPage.setRecords(saleGoodsVos); // 设置记录 + vo.setVos(saleGoodsVoPage); // 设置分页结果 + return vo; + } + + @Override // 分页查询未处理的异常出库通知单 + public Page queryPageNoticeOut_untreated(QueryNoticeOut qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建分页对象 + List vos = new ArrayList<>(); // 创建结果列表 + QueryWrapper queryWrapper = new QueryWrapper().eq("state1", DetailStoreGoods.STATE1_UNTREATED); // 查询未处理记录 + queryWrapper.eq(StringUtils.hasText(qo.getState()),"state",qo.getState()); // 状态条件 + queryWrapper.like(StringUtils.hasText(qo.getName()),"goods_name",qo.getName()); // 商品名称模糊查询 + queryWrapper.eq("type",DetailStoreGoods.TYPE_IN); // 类型为入库 + queryWrapper.orderByDesc("create_time"); // 按创建时间降序 + List list = detailStoreGoodsService.list(queryWrapper); // 执行查询 + for (DetailStoreGoods detailStoreGoods : list) { + NoticeInNotNormalVo vo = new NoticeInNotNormalVo(); // 创建VO对象 + vo.setCn(detailStoreGoods.getCn()); // 设置编号 + vo.setCreateTime(detailStoreGoods.getCreateTime()); // 设置创建时间 + vo.setGoodsId(detailStoreGoods.getGoodsId()); // 设置商品ID + vo.setGoodsName(detailStoreGoods.getGoodsName()); // 设置商品名称 + vo.setUntreatedNum(detailStoreGoods.getUntreatedNum()); // 设置未处理数量 + vo.setState(detailStoreGoods.getState()); // 设置状态 + vo.setStoreId(detailStoreGoods.getStoreId()); // 设置仓库ID + Store store = storeService.getById(detailStoreGoods.getStoreId()); // 查询仓库信息 + vo.setStoreName(store.getName()); // 设置仓库名称 + Goods goods = super.getById(detailStoreGoods.getGoodsId()); // 查询商品信息 + vo.setCoverUrl(goods.getCoverUrl()); // 设置商品封面URL + vos.add(vo); // 添加到结果列表 + } + page.setRecords(vos); // 设置记录 + return page; + } + + @Override // 处理未处理的异常出库单 + public void resolveOutUntreatedForm(NoticeInNotNormalVo vo, String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + // 查询未处理的出库记录 + QueryWrapper queryWrapper = new QueryWrapper() + .eq("cn", vo.getCn()) // 编号条件 + .eq("state1", DetailStoreGoods.STATE1_UNTREATED); // 未处理状态 + DetailStoreGoods detailStoreGoods = detailStoreGoodsService.getOne(queryWrapper); + if (detailStoreGoods==null){ // 如果记录不存在 + throw new BusinessException("该订单已被处理"); // 抛出业务异常 + } + + long num = detailStoreGoods.getUntreatedNum() - vo.getUntreatedNum(); // 计算剩余未处理数量 + // 查询商品库存 + QueryWrapper goodsStoreQueryWrapper = new QueryWrapper() + .eq("goods_id", vo.getGoodsId()) // 商品ID条件 + .eq("store_id", vo.getStoreId()); // 仓库ID条件 + GoodsStore goodsStore = goodsStoreService.getOne(goodsStoreQueryWrapper); + if (num>0){ // 如果还有剩余未处理 + //未处理完毕 + UpdateWrapper updateWrapper = new UpdateWrapper() + .eq("cn", detailStoreGoods.getCn()) // 编号条件 + .set("untreated_num",num); // 更新未处理数量 + detailStoreGoodsService.update(updateWrapper); + //改变库存 + UpdateWrapper goodsStoreUpdateWrapper = new UpdateWrapper() + .eq("goods_id", vo.getGoodsId()) // 商品ID条件 + .eq("store_id", vo.getStoreId()) // 仓库ID条件 + .set("residue_num",goodsStore.getResidueNum()-vo.getUntreatedNum()); // 减少库存 + goodsStoreService.update(goodsStoreUpdateWrapper); + }else { // 如果全部处理完毕 + //处理完毕 + UpdateWrapper updateWrapper = new UpdateWrapper() + .eq("cn", detailStoreGoods.getCn()) // 编号条件 + .set("untreated_num",0L) // 设置未处理数量为0 + .set("state1",DetailStoreGoods.STATE1_NORMAL) // 设置状态为正常 + .set("createid",employee.getId()) // 设置处理人ID + .set("createby",employee.getNickName()) // 设置处理人名称 + .set("create_time",new Date()) // 设置处理时间 + .set("type",DetailStoreGoods.TYPE_OUT); // 设置类型为出库 + detailStoreGoodsService.update(updateWrapper);//改变库存 + UpdateWrapper goodsStoreUpdateWrapper = new UpdateWrapper() + .eq("goods_id", vo.getGoodsId()) // 商品ID条件 + .eq("store_id", vo.getStoreId()) // 仓库ID条件 + .set("residue_num",0L); // 设置库存为0 + goodsStoreService.update(goodsStoreUpdateWrapper); + } + } +} + diff --git a/src/main/java/com/rabbiter/market/service/goods_management/goods_category/IGoodsCategoryService.java b/src/main/java/com/rabbiter/market/service/goods_management/goods_category/IGoodsCategoryService.java new file mode 100644 index 0000000..2e8665a --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/goods_management/goods_category/IGoodsCategoryService.java @@ -0,0 +1,42 @@ +package com.rabbiter.market.service.goods_management.goods_category; + +import com.rabbiter.market.domain.goods_management.goods_category.GoodsCategory; // 导入商品分类实体类 +import com.rabbiter.market.qo.goods_management.goods_category.QueryGoodsCategory; // 导入商品分类查询对象 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; // 导入MyBatis-Plus分页类 +import com.baomidou.mybatisplus.extension.service.IService; // 导入MyBatis-Plus服务接口 + +import java.util.List; // 导入List集合类 +import java.util.Map; // 导入Map集合类 + +// 商品分类服务接口,继承MyBatis-Plus的IService接口 +public interface IGoodsCategoryService extends IService { + + /** + * 更改业务 + * @param goodsCategory 商品分类对象 + */ + void updateGoodsCategory(GoodsCategory goodsCategory); // 更新商品分类方法声明 + + /** + * 停用业务 + * @param cid 分类ID + */ + void deactivate(Long cid); // 停用商品分类方法声明 + + + /** + * 条件查询 + * @param qo 查询条件对象 + * @return 分页结果 + */ + Page queryPageByQo(QueryGoodsCategory qo); // 条件分页查询方法声明 + + /** + * 保存商品分类信息 + * @param category 商品分类对象 + */ + void saveGoodsCategory(GoodsCategory category); // 保存商品分类方法声明 + + // 获取所有正常状态的分类(返回id和name的映射列表) + List> getNormalCategoryAll(); // 获取正常分类列表方法声明 +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/service/goods_management/goods_category/impl/GoodsCategoryServiceImpl.java b/src/main/java/com/rabbiter/market/service/goods_management/goods_category/impl/GoodsCategoryServiceImpl.java new file mode 100644 index 0000000..1e29bec --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/goods_management/goods_category/impl/GoodsCategoryServiceImpl.java @@ -0,0 +1,126 @@ +package com.rabbiter.market.service.goods_management.goods_category.impl; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.domain.goods_management.goods.Goods; +import com.rabbiter.market.domain.goods_management.goods_category.GoodsCategory; +import com.rabbiter.market.mapper.goods_management.goods_category.GoodsCategoryMapper; +import com.rabbiter.market.qo.goods_management.goods_category.QueryGoodsCategory; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.service.goods_management.goods_category.IGoodsCategoryService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service // 标识为Spring的服务组件 +public class GoodsCategoryServiceImpl extends ServiceImpl implements IGoodsCategoryService { + + @Autowired // 自动注入商品服务 + private IGoodsService goodsService; + + @Override // 实现更新商品分类的方法 + public void updateGoodsCategory(GoodsCategory goodsCategory) { + // 创建查询条件:排除当前ID,匹配名称和状态 + QueryWrapper queryWrapper = new QueryWrapper() + .ne("id",goodsCategory.getId()) + .eq("name", goodsCategory.getName()) + .eq("state", goodsCategory.getState()); + GoodsCategory category = super.getOne(queryWrapper); // 查询是否存在重复分类 + + // 如果是要禁用分类状态 + if (GoodsCategory.STATE_BAN.equals(goodsCategory.getState())) { + // 查询该分类下是否有上架商品 + QueryWrapper wrapper = new QueryWrapper().eq("category_id", goodsCategory.getId()).eq("state", Goods.STATE_UP); + List list = goodsService.list(wrapper); + if (list != null && list.size() > 0) { + throw new BusinessException("该分类正在被某个上架商品使用,请解除关系后,再操作"); // 存在关联商品则抛出异常 + } + if (category != null) { + super.removeById(category); // 移除重复的禁用状态分类 + } + } else { // 如果是正常状态 + if (category != null) { + throw new BusinessException("该分类已经存在"); // 分类已存在则抛出异常 + } + } + + super.updateById(goodsCategory); // 执行分类更新操作 + } + + @Override // 实现停用分类的方法 + public void deactivate(Long cid) { + // 检查该分类下是否有上架商品 + QueryWrapper wrapper = new QueryWrapper() + .eq("category_id", cid) + .eq("state", Goods.STATE_UP); + List list = goodsService.list(wrapper); + if (list != null && list.size() > 0) { + throw new BusinessException("该分类正在被某个上架商品使用,请解除关系后,再操作"); // 存在关联商品则抛出异常 + } + + // 获取当前分类信息 + GoodsCategory goodsCategory = super.getById(cid); + // 查询是否存在同名的已禁用分类 + QueryWrapper queryWrapper = new QueryWrapper() + .ne("id",cid) + .eq("name", goodsCategory.getName()) + .eq("state", GoodsCategory.STATE_BAN); + GoodsCategory one = super.getOne(queryWrapper); + if (one != null) { + // 删除同名且已禁用的分类 + super.remove(new QueryWrapper() + .eq("name", goodsCategory.getName()) + .eq("state", GoodsCategory.STATE_BAN)); + } + // 更新当前分类状态为禁用 + super.update(new UpdateWrapper().eq("id", cid).set("state", GoodsCategory.STATE_BAN)); + } + + @Override // 实现分页查询分类的方法 + public Page queryPageByQo(QueryGoodsCategory qo) { + // 创建分页对象 + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + // 构建查询条件:根据参数动态添加条件 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.hasText(qo.getName()), "name", qo.getName()); // 模糊查询分类名称 + wrapper.eq(StringUtils.hasText(qo.getState()), "state", qo.getState()); // 精确匹配状态 + return super.page(page, wrapper); // 执行分页查询 + } + + @Override // 实现保存新分类的方法 + public void saveGoodsCategory(GoodsCategory category) { + // 检查是否已存在同名且状态正常的分类 + QueryWrapper wrapper = new QueryWrapper() + .eq(StringUtils.hasText(category.getName()), "name", category.getName()) + .eq("state", GoodsCategory.STATE_NORMAL); + GoodsCategory category1 = super.getOne(wrapper); + if (category1 != null) { + throw new BusinessException("该分类已被创建"); // 分类已存在则抛出异常 + } + category.setState(GoodsCategory.STATE_NORMAL); // 设置状态为正常 + super.save(category); // 保存新分类 + } + + @Override // 获取所有正常状态的分类(返回id和name的映射列表) + public List> getNormalCategoryAll() { + List> list = new ArrayList<>(); + // 查询所有状态正常的分类 + List categories = super.list(new QueryWrapper().eq("state", GoodsCategory.STATE_NORMAL)); + // 转换为前端需要的格式 + for (GoodsCategory category : categories) { + Map map = new HashMap<>(); + map.put("id", category.getId()); // 放入分类ID + map.put("name", category.getName()); // 放入分类名称 + list.add(map); + } + return list; + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/service/goods_management/point_products/IPointProductsService.java b/src/main/java/com/rabbiter/market/service/goods_management/point_products/IPointProductsService.java new file mode 100644 index 0000000..6460088 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/goods_management/point_products/IPointProductsService.java @@ -0,0 +1,21 @@ +package com.rabbiter.market.service.goods_management.point_products; + +import com.rabbiter.market.domain.goods_management.point_products.PointProducts; +import com.rabbiter.market.qo.goods_management.point_products.QueryPointProducts; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + +public interface IPointProductsService extends IService { + Page queryPageByQo(QueryPointProducts qo); + + List> queryOptionGoods(); + + void savePointGoods(PointProducts pointProducts,String token); + + void updatePointGoods(PointProducts pointProducts, String token); + + void del(Long id); +} diff --git a/src/main/java/com/rabbiter/market/service/goods_management/point_products/impl/PointProductsServiceImpl.java b/src/main/java/com/rabbiter/market/service/goods_management/point_products/impl/PointProductsServiceImpl.java new file mode 100644 index 0000000..78a06db --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/goods_management/point_products/impl/PointProductsServiceImpl.java @@ -0,0 +1,99 @@ +package com.rabbiter.market.service.goods_management.point_products.impl; + +import com.rabbiter.market.common.exception.BusinessException; // 导入自定义业务异常类 +import com.rabbiter.market.common.redis.service.RedisTemplateService; // 导入Redis服务工具类 +import com.rabbiter.market.domain.goods_management.goods.Goods; // 导入商品实体类 +import com.rabbiter.market.domain.goods_management.point_products.PointProducts; // 导入积分商品实体类 +import com.rabbiter.market.domain.personnel_management.employee.Employee; // 导入员工实体类 +import com.rabbiter.market.mapper.goods_management.point_products.PointProductsMapper; // 导入积分商品Mapper接口 +import com.rabbiter.market.qo.goods_management.point_products.QueryPointProducts; // 导入积分商品查询对象 +import com.rabbiter.market.service.goods_management.goods.IGoodsService; // 导入商品服务接口 +import com.rabbiter.market.service.goods_management.point_products.IPointProductsService; // 导入积分商品服务接口 +import com.alibaba.fastjson.JSONObject; // 导入FastJSON工具类 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; // 导入MyBatis-Plus查询构造器 +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; // 导入MyBatis-Plus更新构造器 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; // 导入MyBatis-Plus分页类 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; // 导入MyBatis-Plus服务实现基类 +import org.springframework.beans.factory.annotation.Autowired; // 导入Spring自动注入注解 +import org.springframework.stereotype.Service; // 导入Spring服务注解 +import org.springframework.util.StringUtils; // 导入Spring字符串工具类 + +import java.util.*; // 导入Java集合工具包 + +@Service // 声明为Spring服务组件 +public class PointProductsServiceImpl extends ServiceImpl implements IPointProductsService { + @Autowired // 自动注入商品服务 + private IGoodsService goodsService; + @Autowired // 自动注入Redis服务 + private RedisTemplateService redisTemplateService; + + @Override // 实现分页查询积分商品方法 + public Page queryPageByQo(QueryPointProducts qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建分页对象 + QueryWrapper wrapper = new QueryWrapper() // 创建查询条件 + .like(StringUtils.hasText(qo.getName()), "goods_name", qo.getName()); // 按商品名称模糊查询 + super.page(page, wrapper); // 执行分页查询 + return page; // 返回分页结果 + } + + @Override // 实现查询可选商品方法 + public List> queryOptionGoods() { + QueryWrapper pointProductsQueryWrapper = new QueryWrapper().select("goods_id"); // 查询所有积分商品的商品ID + List list = super.list(); // 获取所有积分商品列表 + Set productGoodsIds = new HashSet<>(); // 创建商品ID集合(去重) + list.forEach(item -> { // 遍历积分商品列表 + productGoodsIds.add(item.getGoodsId()); // 将商品ID添加到集合 + }); + QueryWrapper goodsQueryWrapper = new QueryWrapper() // 创建商品查询条件 + .notIn(productGoodsIds.size() > 0, "id", productGoodsIds) // 排除已经是积分商品的商品 + .eq("state", Goods.STATE_UP); // 只查询上架状态的商品 + List goods = goodsService.list(goodsQueryWrapper); // 执行商品查询 + ArrayList> options = new ArrayList<>(); // 创建返回结果集合 + goods.forEach(item->{ // 遍历查询到的商品 + Map map = new HashMap<>(); // 创建单个商品映射 + map.put("id",item.getId()); // 放入商品ID + map.put("name",item.getName()); // 放入商品名称 + options.add(map); // 添加到返回集合 + }); + + return options; // 返回可选商品列表 + } + + @Override // 实现保存积分商品方法 + public void savePointGoods(PointProducts pointProducts,String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); // 从Redis获取当前用户信息 + QueryWrapper wrapper = new QueryWrapper().eq("goods_id", pointProducts.getGoodsId()); // 检查是否已是积分商品 + PointProducts one = super.getOne(wrapper); + if (one!=null){ + throw new BusinessException("该商品已经是积分商品"); // 已存在则抛出异常 + } + pointProducts.setUpdateby(employee.getNickName()); // 设置更新人昵称 + pointProducts.setUpdateTime(new Date()); // 设置更新时间 + pointProducts.setUpdateId(employee.getId()); // 设置更新人ID + pointProducts.setState(PointProducts.STATE_NORMAL); // 设置状态为正常 + super.save(pointProducts); // 保存积分商品 + } + + @Override // 实现更新积分商品方法 + public void updatePointGoods(PointProducts pointProducts, String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); // 从Redis获取当前用户信息 + pointProducts.setUpdateby(employee.getNickName()); // 设置更新人昵称 + pointProducts.setUpdateTime(new Date()); // 设置更新时间 + pointProducts.setUpdateId(employee.getId()); // 设置更新人ID + UpdateWrapper updateWrapper = new UpdateWrapper() + .set("integral", pointProducts.getIntegral()) // 设置积分值 + .eq("goods_id", pointProducts.getGoodsId()); // 按商品ID更新 + super.update(updateWrapper); // 执行更新 + } + + @Override // 实现删除积分商品方法 + public void del(Long id) { + // 直接物理删除 + this.baseMapper.delete(new QueryWrapper().eq("goods_id", id)); // 按商品ID删除记录 + // 以下是逻辑删除的备用代码(已注释) + // UpdateWrapper updateWrapper = new UpdateWrapper() + // .set("state", PointProducts.STATE_DEL) + // .eq("goods_id", id); + // super.update(updateWrapper); + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/service/inventory_management/detail_store_goods/IDetailStoreGoodsService.java b/src/main/java/com/rabbiter/market/service/inventory_management/detail_store_goods/IDetailStoreGoodsService.java new file mode 100644 index 0000000..2d3cbdc --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/inventory_management/detail_store_goods/IDetailStoreGoodsService.java @@ -0,0 +1,34 @@ +package com.rabbiter.market.service.inventory_management.detail_store_goods; + +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; +import com.rabbiter.market.qo.inventory_management.detail_store_goods.QueryDetailStoreGoods; +import com.rabbiter.market.qo.inventory_management.detail_store_goods.QueryDetailStoreGoodsOut; +import com.rabbiter.market.vo.detail_store_goods.DetailStoreGoodsOutVo; +import com.rabbiter.market.vo.detail_store_goods.DetailStoreGoodsVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + +public interface IDetailStoreGoodsService extends IService { + + + void saveIn(DetailStoreGoods detailStoreGoods, String token); + + Page queryPageByQoIn(QueryDetailStoreGoods qo); + + void delIn(String cn); + + Page queryPageByQoOut(QueryDetailStoreGoodsOut qo); + + Map initOutOptions(); + + List> changeOutGoods(Long gid); + + List> changeOutStore(Long storeId); + + DetailStoreGoodsOutVo queryOutGoods(Long goodsId, Long storeId); + + void saveOut(DetailStoreGoods detailStoreGoods, String token); +} diff --git a/src/main/java/com/rabbiter/market/service/inventory_management/detail_store_goods/impl/DetailStoreGoodsServiceImpl.java b/src/main/java/com/rabbiter/market/service/inventory_management/detail_store_goods/impl/DetailStoreGoodsServiceImpl.java new file mode 100644 index 0000000..8f37608 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/inventory_management/detail_store_goods/impl/DetailStoreGoodsServiceImpl.java @@ -0,0 +1,273 @@ +package com.rabbiter.market.service.inventory_management.detail_store_goods.impl; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.goods_management.goods.Goods; +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; +import com.rabbiter.market.domain.inventory_management.store.GoodsStore; +import com.rabbiter.market.domain.inventory_management.store.Store; +import com.rabbiter.market.domain.inventory_management.supplier.Supplier; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.mapper.inventory_management.detail_store_goods.DetailStoreGoodsMapper; +import com.rabbiter.market.qo.inventory_management.detail_store_goods.QueryDetailStoreGoods; +import com.rabbiter.market.qo.inventory_management.detail_store_goods.QueryDetailStoreGoodsOut; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.service.inventory_management.detail_store_goods.IDetailStoreGoodsService; +import com.rabbiter.market.service.inventory_management.store.IGoodsStoreService; +import com.rabbiter.market.service.inventory_management.store.IStoreService; +import com.rabbiter.market.service.inventory_management.supplier.ISupplierService; +import com.rabbiter.market.vo.detail_store_goods.DetailStoreGoodsOutVo; +import com.rabbiter.market.vo.detail_store_goods.DetailStoreGoodsVo; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.*; + +@Service +public class DetailStoreGoodsServiceImpl extends ServiceImpl implements IDetailStoreGoodsService { + @Autowired + private RedisTemplateService redisTemplateService; // 自动注入Redis模板服务,用于操作Redis缓存 + @Autowired + private IGoodsStoreService goodsStoreService; // 自动注入商品库存服务 + @Autowired + private IStoreService storeService; // 自动注入仓库服务 + @Autowired + private IGoodsService goodsService; // 自动注入商品服务 + @Autowired + private ISupplierService supplierService; // 自动注入供应商服务 + + @Override + public void saveIn(DetailStoreGoods detailStoreGoods, String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); // 从Redis缓存中获取员工信息并解析为Employee对象 + detailStoreGoods.setType(DetailStoreGoods.TYPE_IN); // 设置商品入库类型 + detailStoreGoods.setState(DetailStoreGoods.STATE_NORMAL); // 设置商品状态为正常 + detailStoreGoods.setCreateid(employee.getId()); // 设置创建者ID为当前员工ID + detailStoreGoods.setCreateby(employee.getNickName()); // 设置创建者名称为当前员工昵称 + detailStoreGoods.setCn(IdWorker.getIdStr()); // 生成唯一的业务单号 + detailStoreGoods.setCreateTime(new Date()); // 设置创建时间为当前时间 + detailStoreGoods.setState1(DetailStoreGoods.STATE1_NORMAL); // 设置状态1为正常 + goodsStoreService.goodsInStore(detailStoreGoods.getGoodsId(), detailStoreGoods.getGoodsNum(), detailStoreGoods.getStoreId()); // 调用商品库存服务的入库方法 + Supplier supplier = supplierService.getById(detailStoreGoods.getSupplierId()); // 根据供应商ID获取供应商信息 + detailStoreGoods.setSupplierName(supplier.getName()); // 设置供应商名称 + super.save(detailStoreGoods); // 保存商品入库记录到数据库 + } + + @Override + public Page queryPageByQoIn(QueryDetailStoreGoods qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建商品入库记录的分页对象 + Page page1 = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建商品入库记录VO的分页对象 + QueryWrapper wrapper = new QueryWrapper<>(); // 创建查询条件包装器 + wrapper.likeRight(StringUtils.hasText(qo.getCn()), "cn", qo.getCn()); // 根据业务单号右模糊查询 + wrapper.like(StringUtils.hasText(qo.getGoodsName()), "goods_name", qo.getGoodsName()); // 根据商品名称模糊查询 + wrapper.eq(StringUtils.hasText(qo.getState1()), "state1", qo.getState1()); // 根据状态1查询 + wrapper.ge(StringUtils.hasText(qo.getStartCreateTime()), "create_time", qo.getStartCreateTime()); // 根据开始创建时间大于等于查询 + wrapper.le(StringUtils.hasText(qo.getEndCreateTime()), "create_time", qo.getEndCreateTime()); // 根据结束创建时间小于等于查询 + wrapper.eq("type", DetailStoreGoods.TYPE_IN); // 查询入库类型的记录 + super.page(page, wrapper); // 执行分页查询 + List records = page.getRecords(); // 获取查询结果记录 + if (records == null || records.size() <= 0) { + page1.setTotal(0L); // 如果没有查询到记录,设置总记录数为0 + } + List list = new ArrayList<>(); // 创建商品入库记录VO的列表 + for (DetailStoreGoods record : records) { + DetailStoreGoodsVo vo = new DetailStoreGoodsVo(); // 创建商品入库记录VO对象 + BeanUtils.copyProperties(record, vo); // 复制商品入库记录属性到VO对象 + Store store = storeService.getById(record.getStoreId()); // 根据仓库ID获取仓库信息 + if (store != null) { + vo.setStoreName(store.getName()); // 设置仓库名称到VO对象 + } + list.add(vo); // 将VO对象添加到列表中 + } + page1.setRecords(list); // 设置查询结果记录到分页对象 + page1.setTotal(page.getTotal()); // 设置总记录数到分页对象 + return page1; // 返回分页对象 + } + + @Override + public void delIn(String cn) { + UpdateWrapper wrapper = new UpdateWrapper<>(); // 创建更新条件包装器 + wrapper.set("state1", DetailStoreGoods.STATE1_DEL); // 设置状态1为已删除 + wrapper.eq("cn", cn); // 根据业务单号进行更新 + super.update(wrapper); // 执行更新操作 + } + + @Override + public Page queryPageByQoOut(QueryDetailStoreGoodsOut qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建商品出库记录的分页对象 + Page page1 = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建商品出库记录VO的分页对象 + QueryWrapper wrapper = new QueryWrapper<>(); // 创建查询条件包装器 + wrapper.likeRight(StringUtils.hasText(qo.getCn()), "cn", qo.getCn()); // 根据业务单号右模糊查询 + wrapper.like(StringUtils.hasText(qo.getGoodsName()), "goods_name", qo.getGoodsName()); // 根据商品名称模糊查询 + wrapper.ge(StringUtils.hasText(qo.getStartCreateTime()), "create_time", qo.getStartCreateTime()); // 根据开始创建时间大于等于查询 + wrapper.le(StringUtils.hasText(qo.getEndCreateTime()), "create_time", qo.getEndCreateTime()); // 根据结束创建时间小于等于查询 + wrapper.eq("type", DetailStoreGoods.TYPE_OUT); // 查询出库类型的记录 + wrapper.eq(StringUtils.hasText(qo.getState()), "state", qo.getState()); // 根据状态查询 + wrapper.eq(StringUtils.hasText(qo.getState1()), "state1", qo.getState1()); // 根据状态1查询 + super.page(page, wrapper); // 执行分页查询 + List records = page.getRecords(); // 获取查询结果记录 + if (records == null || records.size() <= 0) { + page1.setTotal(0L); // 如果没有查询到记录,设置总记录数为0 + } + List list = new ArrayList<>(); // 创建商品出库记录VO的列表 + for (DetailStoreGoods record : records) { + DetailStoreGoodsOutVo vo = new DetailStoreGoodsOutVo(); // 创建商品出库记录VO对象 + BeanUtils.copyProperties(record, vo); // 复制商品出库记录属性到VO对象 + Store store = storeService.getById(record.getStoreId()); // 根据仓库ID获取仓库信息 + if (store != null) { + vo.setStoreName(store.getName()); // 设置仓库名称到VO对象 + } + list.add(vo); // 将VO对象添加到列表中 + } + page1.setRecords(list); // 设置查询结果记录到分页对象 + page1.setTotal(page.getTotal()); // 设置总记录数到分页对象 + return page1; // 返回分页对象 + } + + @Override + public Map initOutOptions() { + Set goodsIds = new HashSet<>(); // 创建商品ID集合 + Set storeIds = new HashSet<>(); // 创建仓库ID集合 + QueryWrapper wrapper = new QueryWrapper<>(); // 创建商品库存查询条件包装器 + wrapper.gt("residue_num", 0L); // 查询库存数量大于0的记录 + List list = goodsStoreService.list(wrapper); // 执行查询获取商品库存列表 + if (list == null || list.size() == 0) { + throw new BusinessException("库存中没有存放商品"); // 如果没有库存记录,抛出业务异常 + } + for (GoodsStore goodsStore : list) { + goodsIds.add(goodsStore.getGoodsId()); // 将商品ID添加到商品ID集合中 + storeIds.add(goodsStore.getStoreId()); // 将仓库ID添加到仓库ID集合中 + } + Map map = new HashMap<>(); // 创建结果Map对象 + List> goodsList = new ArrayList<>(); // 创建商品信息列表 + List> storeList = new ArrayList<>(); // 创建仓库信息列表 + List goods = goodsService.listByIds(goodsIds); // 根据商品ID集合获取商品列表 + for (Goods good : goods) { + Map goodsMap = new HashMap<>(); // 创建商品信息Map对象 + goodsMap.put("id", good.getId()); // 设置商品ID到商品信息Map中 + goodsMap.put("name", good.getName()); // 设置商品名称到商品信息Map中 + goodsList.add(goodsMap); // 将商品信息Map添加到商品信息列表中 + } + List stores = storeService.listByIds(storeIds); // 根据仓库ID集合获取仓库列表 + for (Store store : stores) { + Map storeMap = new HashMap<>(); // 创建仓库信息Map对象 + storeMap.put("id", store.getId()); // 设置仓库ID到仓库信息Map中 + storeMap.put("name", store.getName()); // 设置仓库名称到仓库信息Map中 + storeList.add(storeMap); // 将仓库信息Map添加到仓库信息列表中 + } + map.put("goods", goodsList); // 将商品信息列表添加到结果Map中 + map.put("stores", storeList); // 将仓库信息列表添加到结果Map中 + return map; // 返回结果Map + } + + @Override + public List> changeOutGoods(Long gid) { + QueryWrapper wrapper = new QueryWrapper<>(); // 创建商品库存查询条件包装器 + wrapper.eq("goods_id", gid); // 根据商品ID查询 + wrapper.gt("residue_num", 0L); // 查询库存数量大于0的记录 + List list = goodsStoreService.list(wrapper); // 执行查询获取商品库存列表 + Set storeIds = new HashSet<>(); // 创建仓库ID集合 + for (GoodsStore goodsStore : list) { + storeIds.add(goodsStore.getStoreId()); // 将仓库ID添加到仓库ID集合中 + } + List stores = storeService.listByIds(storeIds); // 根据仓库ID集合获取仓库列表 + List> storeList = new ArrayList<>(); // 创建仓库信息列表 + for (Store store : stores) { + Map map = new HashMap<>(); // 创建仓库信息Map对象 + map.put("id", store.getId()); // 设置仓库ID到仓库信息Map中 + map.put("name", store.getName()); // 设置仓库名称到仓库信息Map中 + storeList.add(map); // 将仓库信息Map添加到仓库信息列表中 + } + return storeList; // 返回仓库信息列表 + } + + @Override + public List> changeOutStore(Long storeId) { + QueryWrapper wrapper = new QueryWrapper<>(); // 创建商品库存查询条件包装器 + wrapper.eq("store_id", storeId); // 根据仓库ID查询 + wrapper.gt("residue_num", 0L); // 查询库存数量大于0的记录 + List list = goodsStoreService.list(wrapper); // 执行查询获取商品库存列表 + Set goodsIds = new HashSet<>(); // 创建商品ID集合 + for (GoodsStore goodsStore : list) { + goodsIds.add(goodsStore.getGoodsId()); // 将商品ID添加到商品ID集合中 + } + List goodsList = goodsService.listByIds(goodsIds); // 根据商品ID集合获取商品列表 + List> goodsVo = new ArrayList<>(); // 创建商品信息列表 + for (Goods goods : goodsList) { + Map map = new HashMap<>(); // 创建商品信息Map对象 + map.put("id", goods.getId()); // 设置商品ID到商品信息Map中 + map.put("name", goods.getName()); // 设置商品名称到商品信息Map中 + goodsVo.add(map); // 将商品信息Map添加到商品信息列表中 + } + return goodsVo; // 返回商品信息列表 + } + + @Override + public DetailStoreGoodsOutVo queryOutGoods(Long goodsId, Long storeId) { + QueryWrapper wrapper = new QueryWrapper<>(); // 创建商品库存查询条件包装器 + wrapper.eq("goods_id",goodsId); // 根据商品ID查询 + wrapper.eq("store_id",storeId); // 根据仓库ID查询 + GoodsStore goodsStore = goodsStoreService.getOne(wrapper); // 获取符合条件的一条商品库存记录 + DetailStoreGoodsOutVo vo = new DetailStoreGoodsOutVo(); // 创建商品出库记录VO对象 + BeanUtils.copyProperties(goodsStore,vo); // 复制商品库存记录属性到VO对象 + vo.setGoodsNum(goodsStore.getResidueNum()); // 设置商品数量为库存数量 + Goods goods = goodsService.getById(goodsId); // 根据商品ID获取商品信息 + vo.setGoodsName(goods.getName()); // 设置商品名称到VO对象 + return vo; // 返回商品出库记录VO对象 + } + + @Override + public void saveOut(DetailStoreGoods detailStoreGoods, String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); // 从Redis缓存中获取员工信息并解析为Employee对象 + detailStoreGoods.setType(DetailStoreGoods.TYPE_OUT); // 设置商品出库类型 + detailStoreGoods.setState1(DetailStoreGoods.STATE1_NORMAL); // 设置状态1为正常 + detailStoreGoods.setCreateid(employee.getId()); // 设置创建者ID为当前员工ID + detailStoreGoods.setCreateby(employee.getNickName()); // 设置创建者名称为当前员工昵称 + detailStoreGoods.setCn(IdWorker.getIdStr()); // 生成唯一的业务单号 + detailStoreGoods.setCreateTime(new Date()); // 设置创建时间为当前时间 + + QueryWrapper goodsStoreQueryWrapper = new QueryWrapper() + .eq("goods_id", detailStoreGoods.getGoodsId()) + .eq("store_id", detailStoreGoods.getStoreId()); // 创建商品库存查询条件包装器,根据商品ID和仓库ID查询 + + GoodsStore goodsStore = goodsStoreService.getOne(goodsStoreQueryWrapper); // 获取符合条件的一条商品库存记录 + long num = goodsStore.getResidueNum() - detailStoreGoods.getGoodsNum(); // 计算出库后的库存数量 + + UpdateWrapper goodsStoreUpdateWrapper = new UpdateWrapper() + .eq("goods_id", detailStoreGoods.getGoodsId()) + .eq("store_id", detailStoreGoods.getStoreId()); // 创建商品库存更新条件包装器,根据商品ID和仓库ID更新 + if (DetailStoreGoods.STATE_EXPIRY.equals(detailStoreGoods.getState())){ + //过期处理 + detailStoreGoods.setState(DetailStoreGoods.STATE_EXPIRY); // 设置商品状态为过期 + if (num>=0){ + goodsStoreUpdateWrapper.set("residue_num",num); // 如果库存足够,更新库存数量为计算后的数量 + }else { + goodsStoreUpdateWrapper.set("residue_num",0L); // 如果库存不足,将库存数量置为0 + detailStoreGoods.setGoodsNum(goodsStore.getResidueNum()); // 将出库商品数量调整为当前库存数量 + } + }else { + //出库到货架上 + detailStoreGoods.setState(DetailStoreGoods.STATE_NORMAL); // 设置商品状态为正常 + Goods goods = goodsService.getById(detailStoreGoods.getGoodsId()); // 根据商品ID获取商品信息 + UpdateWrapper goodsUpdateWrapper = new UpdateWrapper().eq("id", goods.getId()); // 创建商品更新条件包装器,根据商品ID更新 + if (num>=0){ + goodsStoreUpdateWrapper.set("residue_num",num); // 如果库存足够,更新库存数量为计算后的数量 + goodsUpdateWrapper.set("residue_num",goods.getResidueNum()==null?detailStoreGoods.getGoodsNum():goods.getResidueNum()+detailStoreGoods.getGoodsNum()); // 更新商品货架库存数量 + }else { + goodsStoreUpdateWrapper.set("residue_num",0L); // 如果库存不足,将库存数量置为0 + goodsUpdateWrapper.set("residue_num",goods.getResidueNum()==null?goodsStore.getResidueNum():goods.getResidueNum()+goodsStore.getResidueNum()); // 更新商品货架库存数量 + detailStoreGoods.setGoodsNum(goodsStore.getResidueNum()); // 将出库商品数量调整为当前库存数量 + } + goodsService.update(goodsUpdateWrapper); // 执行商品信息更新操作 + } + goodsStoreService.update(goodsStoreUpdateWrapper); // 执行商品库存信息更新操作 + super.save(detailStoreGoods); // 保存商品出库记录到数据库 + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/service/inventory_management/store/IGoodsStoreService.java b/src/main/java/com/rabbiter/market/service/inventory_management/store/IGoodsStoreService.java new file mode 100644 index 0000000..7418d4e --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/inventory_management/store/IGoodsStoreService.java @@ -0,0 +1,24 @@ +package com.rabbiter.market.service.inventory_management.store; + +import com.rabbiter.market.domain.inventory_management.store.GoodsStore; +import com.rabbiter.market.qo.inventory_management.store.QueryDetailStorageSituation; +import com.rabbiter.market.qo.inventory_management.store.QueryStorageSituation; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.Map; + +public interface IGoodsStoreService extends IService { + + + Long storeUsed(Long id); + + Long getResidueNumByGoodsId(Long id); + + void goodsInStore(Long goodsId, Long goodsNum,Long storeId); + + void goodsOutStore(Long goodsId, Long goodsNum, Long storeId); + + Map queryPageStorageSituationByQo(QueryStorageSituation qo); + + Map queryStoreGoodsByStoreId(QueryDetailStorageSituation qo); +} diff --git a/src/main/java/com/rabbiter/market/service/inventory_management/store/IStoreService.java b/src/main/java/com/rabbiter/market/service/inventory_management/store/IStoreService.java new file mode 100644 index 0000000..1b7209b --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/inventory_management/store/IStoreService.java @@ -0,0 +1,24 @@ +package com.rabbiter.market.service.inventory_management.store; + +import com.rabbiter.market.domain.inventory_management.store.Store; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface IStoreService extends IService { + + /** + * 更改仓库信息的业务 + * @param store + */ + void updateStore(Store store); + + /** + * 停用仓库业务 + * @param sid + */ + void deactivate(Long sid); + + Long getResidueNumByGoodsId(Long id); + + void saveStore(Store store); + +} diff --git a/src/main/java/com/rabbiter/market/service/inventory_management/store/impl/GoodsStoreServiceImpl.java b/src/main/java/com/rabbiter/market/service/inventory_management/store/impl/GoodsStoreServiceImpl.java new file mode 100644 index 0000000..7f75cc8 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/inventory_management/store/impl/GoodsStoreServiceImpl.java @@ -0,0 +1,269 @@ +package com.rabbiter.market.service.inventory_management.store.impl; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.goods_management.goods.Goods; +import com.rabbiter.market.domain.inventory_management.store.GoodsStore; +import com.rabbiter.market.domain.inventory_management.store.Store; +import com.rabbiter.market.mapper.inventory_management.store.GoodsStoreMapper; +import com.rabbiter.market.qo.inventory_management.store.QueryDetailStorageSituation; +import com.rabbiter.market.qo.inventory_management.store.QueryStorageSituation; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.service.inventory_management.detail_store_goods.IDetailStoreGoodsService; +import com.rabbiter.market.service.inventory_management.store.IGoodsStoreService; +import com.rabbiter.market.service.inventory_management.store.IStoreService; +import com.rabbiter.market.vo.statistics.storage_situation.DetailStorageSituationVo; +import com.rabbiter.market.vo.statistics.storage_situation.StorageSituationVo; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +import java.util.*; + +// 声明这是一个Spring服务类,并且支持事务管理 +@Service +@Transactional +// 继承ServiceImpl类,实现IGoodsStoreService接口 +public class GoodsStoreServiceImpl extends ServiceImpl implements IGoodsStoreService { + // 自动注入GoodsStoreMapper,用于数据库操作 + @Autowired + private GoodsStoreMapper goodsStoreMapper; + // 自动注入IDetailStoreGoodsService,用于处理详细商品库存相关业务 + @Autowired + private IDetailStoreGoodsService detailStoreGoodsService; + // 自动注入RedisTemplateService,用于操作Redis缓存 + @Autowired + private RedisTemplateService redisTemplateService; + // 自动注入IGoodsService,用于处理商品相关业务 + @Autowired + private IGoodsService goodsService; + // 自动注入IStoreService,用于处理仓库相关业务 + @Autowired + private IStoreService storeService; + + // 实现接口方法,查询指定仓库的已使用容量 + @Override + public Long storeUsed(Long id) { + return goodsStoreMapper.storeUsed(id); // 调用Mapper方法进行查询 + } + + // 实现接口方法,根据商品ID查询商品的剩余数量 + @Override + public Long getResidueNumByGoodsId(Long id) { + return goodsStoreMapper.getResidueNumByGoodsId(id); // 调用Mapper方法进行查询 + } + + // 注释掉的方法,原本用于根据商品ID下架商品 +// @Override +// public void downGoodsByGid(Long gid, String token) { +// // 从Redis缓存中获取员工信息 +// Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); +// // 创建查询条件,根据商品ID查询商品库存记录 +// QueryWrapper wrapper = new QueryWrapper() +// .eq("goods_id", gid); +// // 查询符合条件的商品库存记录列表 +// List list = super.list(wrapper); +// // 如果查询结果不为空 +// if (list != null && list.size() > 0) { +// // 创建详细商品库存记录对象 +// DetailStoreGoods detailStoreGoods = new DetailStoreGoods(); +// // 生成唯一业务单号 +// detailStoreGoods.setCn(IdWorker.getIdStr()); +// // 设置创建者昵称 +// detailStoreGoods.setCreateby(employee.getNickName()); +// // 设置创建者ID +// detailStoreGoods.setCreateid(employee.getId()); +// // 设置创建时间为当前时间 +// detailStoreGoods.setCreateTime(new Date()); +// // 设置商品ID +// detailStoreGoods.setGoodsId(gid); +// // 根据商品ID获取商品信息 +// Goods goods = goodsService.getById(gid); +// // 设置商品名称 +// detailStoreGoods.setGoodsName(goods.getName()); +// // 设置商品采购价格 +// detailStoreGoods.setGoodsPrice(goods.getPurchashPrice()); +// // 设置操作信息为下架商品处理 +// detailStoreGoods.setInfo("下架商品处理"); +// // 设置商品数量为商品剩余数量 +// detailStoreGoods.setGoodsNum(goods.getResidueNum()); +// // 设置商品状态为下架 +// detailStoreGoods.setState(DetailStoreGoods.STATE_DOWN); +// // 设置状态1为正常 +// detailStoreGoods.setState1(DetailStoreGoods.STATE1_NORMAL); +// // 设置操作类型为出库 +// detailStoreGoods.setType(DetailStoreGoods.TYPE_OUT); +// // 调用服务方法处理商品下架 +// detailStoreGoodsService.goodsDown(detailStoreGoods); +// // 创建更新条件,根据商品ID更新商品库存记录 +// UpdateWrapper wrapper1 = new UpdateWrapper<>(); +// wrapper1.eq("goods_id", gid); +// // 将商品剩余数量置为0 +// wrapper1.set("residue_num", 0); +// // 执行更新操作 +// super.update(wrapper1); +// } +// } + + // 实现接口方法,处理商品入库操作 + @Override + public void goodsInStore(Long goodsId, Long goodsNum, Long storeId) { + // 创建查询条件,根据商品ID和仓库ID查询商品库存记录 + QueryWrapper wrapper = new QueryWrapper().eq("goods_id", goodsId).eq("store_id", storeId); + // 获取符合条件的一条商品库存记录 + GoodsStore goodsStore1 = super.getOne(wrapper); + // 如果记录存在 + if (goodsStore1 != null) { + // 调用Mapper方法进行商品入库操作 + goodsStoreMapper.goodsInStore(goodsId, goodsNum, storeId); + } else { + // 创建新的商品库存记录对象 + GoodsStore goodsStore = new GoodsStore(); + // 设置商品ID + goodsStore.setGoodsId(goodsId); + // 设置入库数量 + goodsStore.setInNum(goodsNum); + // 设置剩余数量为入库数量 + goodsStore.setResidueNum(goodsNum); + // 设置仓库ID + goodsStore.setStoreId(storeId); + // 根据仓库ID获取仓库信息 + Store one = storeService.getById(storeId); + // 设置仓库名称 + goodsStore.setStoreName(one.getName()); + // 保存新的商品库存记录到数据库 + super.save(goodsStore); + } + } + + // 实现接口方法,处理商品出库操作 + @Override + public void goodsOutStore(Long goodsId, Long goodsNum, Long storeId) { + // 调用Mapper方法进行商品出库操作 + goodsStoreMapper.goodsOutStore(goodsId, goodsNum, storeId); + } + + // 实现接口方法,根据查询条件分页查询仓库存储情况 + @Override + public Map queryPageStorageSituationByQo(QueryStorageSituation qo) { + // 创建一个HashMap用于存储结果 + HashMap map = new HashMap<>(); + // 调用Mapper方法查询总仓库存储量 + Long totalStoreNum = goodsStoreMapper.totalStoreNum(); + // 将总仓库存储量放入结果Map中,如果为null则置为0 + map.put("totalStoreNum", totalStoreNum != null ? totalStoreNum : 0L); + // 创建商品库存分页对象 + Page goodsStorePage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + // 创建查询条件,按仓库分组统计剩余数量,并支持根据仓库名称模糊查询 + QueryWrapper goodsStoreQueryWrapper = new QueryWrapper().select("store_id,store_name,SUM(residue_num) residue_num") + .like(StringUtils.hasText(qo.getName()), "store_name", qo.getName()) + .groupBy("store_id", "store_name"); + // 执行分页查询 + super.page(goodsStorePage, goodsStoreQueryWrapper); + // 创建存储情况VO分页对象 + Page situationVoPage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + // 创建存储情况VO列表 + List vos = new ArrayList<>(); + // 遍历查询结果记录 + for (GoodsStore record : goodsStorePage.getRecords()) { + // 创建存储情况VO对象 + StorageSituationVo vo = new StorageSituationVo(); + // 设置仓库ID + vo.setStoreId(record.getStoreId()); + // 设置仓库名称 + vo.setStoreName(record.getStoreName()); + // 设置剩余数量 + vo.setResidueNum(record.getResidueNum()); + // 将VO对象添加到列表中 + vos.add(vo); + } + // 设置存储情况VO分页对象的记录列表 + situationVoPage.setRecords(vos); + // 设置存储情况VO分页对象的总记录数 + situationVoPage.setTotal(goodsStorePage.getTotal()); + // 将存储情况VO分页对象放入结果Map中 + map.put("page", situationVoPage); + // 返回结果Map + return map; + } + + // 实现接口方法,根据仓库ID查询仓库内商品的详细存储情况 + @Override + public Map queryStoreGoodsByStoreId(QueryDetailStorageSituation qo) { + // 创建一个Map用于存储结果 + Map map = new HashMap<>(); + // 调用Mapper方法查询指定仓库的总存储量 + Long totalStoreNum1 = goodsStoreMapper.getTotalStoreNum1(qo.getStoreId()); + // 将总存储量放入结果Map中 + map.put("totalStoreNum1", totalStoreNum1); // 该仓库的存储量 + // 创建查询条件,查询指定仓库中剩余数量大于0的商品库存记录 + QueryWrapper wrapper = new QueryWrapper() + .gt("residue_num", 0) + .eq("store_id", qo.getStoreId()); + // 查询符合条件的商品库存记录列表 + List list = super.list(wrapper); + // 创建一个Set用于存储商品ID + Set goodsIds = new HashSet<>(); + // 遍历商品库存记录列表,将商品ID添加到Set中 + for (GoodsStore goodsStore : list) { + goodsIds.add(goodsStore.getGoodsId()); + } + // 如果商品ID集合为空,抛出业务异常 + if (goodsIds.size() <= 0) { + throw new BusinessException("该仓库没有存放任何的商品"); + } + // 根据商品ID集合查询商品列表 + List goodsList = goodsService.listByIds(goodsIds); + // 创建一个列表用于存储商品选择框的选项 + List> optionsStoreGoods = new ArrayList<>(); + // 遍历商品列表,将商品ID和名称封装成Map并添加到选项列表中 + for (Goods goods : goodsList) { + Map options = new HashMap<>(); + options.put("id", goods.getId()); + options.put("name", goods.getName()); + optionsStoreGoods.add(options); + } + // 将商品选择框的选项列表放入结果Map中 + map.put("optionsStoreGoods", optionsStoreGoods); // 选择框 + // 创建商品库存分页对象 + Page goodsStorePage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + // 创建查询条件,查询指定仓库中剩余数量大于0的商品库存记录,支持根据商品ID精确查询 + QueryWrapper goodsStoreQueryWrapper = new QueryWrapper() + .eq("store_id", qo.getStoreId()) + .gt("residue_num", 0) + .eq(qo.getId() != null, "goods_id", qo.getId()); + // 执行分页查询 + super.page(goodsStorePage, goodsStoreQueryWrapper); + // 创建详细存储情况VO分页对象 + Page voPage = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + // 设置详细存储情况VO分页对象的总记录数 + voPage.setTotal(goodsStorePage.getTotal()); + // 创建详细存储情况VO列表 + List detailStorageSituationVoList = new ArrayList<>(); + // 遍历商品库存分页记录 + for (GoodsStore record : goodsStorePage.getRecords()) { + // 创建详细存储情况VO对象 + DetailStorageSituationVo vo = new DetailStorageSituationVo(); + // 设置商品ID + vo.setGoodsId(record.getGoodsId()); + // 设置剩余数量 + vo.setResidueNum(record.getResidueNum()); + // 设置百分比,根据总存储量计算 + vo.setPercentage(totalStoreNum1); + // 根据商品ID获取商品名称并设置到VO对象中 + vo.setGoodsName(goodsService.getById(record.getGoodsId()).getName()); + // 将VO对象添加到列表中 + detailStorageSituationVoList.add(vo); + } + // 设置详细存储情况VO分页对象的记录列表 + voPage.setRecords(detailStorageSituationVoList); + // 将详细存储情况VO分页对象放入结果Map中 + map.put("vos", voPage); // 表格数据 + // 返回结果Map + return map; + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/service/inventory_management/store/impl/StoreServiceImpl.java b/src/main/java/com/rabbiter/market/service/inventory_management/store/impl/StoreServiceImpl.java new file mode 100644 index 0000000..6f1b517 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/inventory_management/store/impl/StoreServiceImpl.java @@ -0,0 +1,98 @@ +package com.rabbiter.market.service.inventory_management.store.impl; + +import com.rabbiter.market.common.exception.BusinessException; // 自定义业务异常类 +import com.rabbiter.market.domain.inventory_management.store.Store; // 仓库实体类 +import com.rabbiter.market.mapper.inventory_management.store.StoreMapper; // 仓库数据访问层接口 +import com.rabbiter.market.service.inventory_management.store.IGoodsStoreService; // 商品库存业务接口 +import com.rabbiter.market.service.inventory_management.store.IStoreService; // 仓库业务接口 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; // MyBatis-Plus查询条件构造器 +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; // MyBatis-Plus更新条件构造器 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; // MyBatis-Plus通用服务实现类 +import org.springframework.beans.factory.annotation.Autowired; // Spring依赖注入注解 +import org.springframework.stereotype.Service; // Spring服务层注解 +import org.springframework.transaction.annotation.Transactional; // Spring事务注解 + +// 声明该类为Spring的服务类,由Spring容器管理 +@Service +// 该类继承ServiceImpl类,实现IStoreService接口,用于处理仓库相关的业务逻辑 +public class StoreServiceImpl extends ServiceImpl implements IStoreService { + // 自动注入IGoodsStoreService,用于调用商品库存相关的服务方法 + @Autowired + private IGoodsStoreService goodsStoreService; + + // 实现更新仓库信息的方法 + @Override + public void updateStore(Store store) { + // 创建查询条件包装器,根据仓库名称、地址和状态查询仓库信息 + QueryWrapper storeQueryWrapper = new QueryWrapper() + .eq("name", store.getName()) // 按名称匹配 + .eq("address", store.getAddress()) // 按地址匹配 + .eq("state", store.getState()); // 按状态匹配 + // 根据查询条件获取符合条件的一个仓库信息 + Store one = super.getOne(storeQueryWrapper); + // 判断是否要将仓库状态修改为停用状态 + if (Store.STATE_BAN.equals(store.getState())) { + // 调用商品库存服务方法,获取该仓库的已使用容量 + Long redisueNum = goodsStoreService.storeUsed(store.getId()); + // 如果仓库中存在商品(已使用容量不为0) + if (redisueNum != null && redisueNum != 0) { + // 抛出业务异常,提示仓库中存在商品,不能停用仓库 + throw new BusinessException("仓库中存在商品,不能停用仓库"); + } + // 如果查询到了符合条件的仓库信息 + if (one != null) { + // 根据仓库ID删除该仓库信息 + super.removeById(one); + } + } + // 根据仓库ID更新仓库信息 + super.updateById(store); + } + + // 实现停用仓库的方法,使用事务管理 + @Transactional + @Override + public void deactivate(Long sid) { + // 调用商品库存服务方法,获取该仓库的已使用容量 + Long redisueNum = goodsStoreService.storeUsed(sid); + // 如果仓库中存在商品(已使用容量不为0) + if (redisueNum != null && redisueNum != 0) { + // 抛出业务异常,提示仓库中存在商品,不能停用仓库 + throw new BusinessException("仓库中存在商品,不能停用仓库"); + } else { + // 创建更新条件包装器,将仓库状态设置为停用状态 + UpdateWrapper wrapper = new UpdateWrapper() + .set("state", Store.STATE_BAN) // 设置状态为停用 + .eq("id", sid); // 匹配仓库ID + // 根据更新条件更新仓库信息 + super.update(wrapper); + } + } + + // 实现根据商品ID获取商品剩余数量的方法 + @Override + public Long getResidueNumByGoodsId(Long id) { + // 调用商品库存服务方法,获取商品剩余数量 + return goodsStoreService.getResidueNumByGoodsId(id); + } + + // 实现保存仓库信息的方法 + @Override + public void saveStore(Store store) { + // 设置仓库状态为正常状态 + store.setState(Store.STATE_NORMAL); + // 创建查询条件包装器,根据正常状态、仓库名称和地址查询仓库信息 + QueryWrapper queryWrapper = new QueryWrapper().eq("state", Store.STATE_NORMAL) + .eq("name", store.getName()) // 按名称匹配 + .eq("address", store.getAddress()); // 按地址匹配 + // 根据查询条件获取符合条件的一个仓库信息 + Store one = super.getOne(queryWrapper); + // 如果查询到了符合条件的仓库信息 + if (one != null) { + // 抛出业务异常,提示创建失败,已有相同的仓库 + throw new BusinessException("创建失败,已有相同的仓库"); + } + // 保存仓库信息到数据库 + super.save(store); + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/service/inventory_management/supplier/ISupplierService.java b/src/main/java/com/rabbiter/market/service/inventory_management/supplier/ISupplierService.java new file mode 100644 index 0000000..3ca4b35 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/inventory_management/supplier/ISupplierService.java @@ -0,0 +1,23 @@ +package com.rabbiter.market.service.inventory_management.supplier; + +import com.rabbiter.market.domain.inventory_management.supplier.Supplier; +import com.rabbiter.market.qo.inventory_management.supplier.QuerySupplier; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + +public interface ISupplierService extends IService { + + + void deactivate(Long cn); + + Page queryPageByQo(QuerySupplier qo); + + List> queryOptionsSuppliers(); + + void saveSupplier(Supplier supplier); + + void updateSupplier(Supplier supplier); +} diff --git a/src/main/java/com/rabbiter/market/service/inventory_management/supplier/impl/SupplierServiceImpl.java b/src/main/java/com/rabbiter/market/service/inventory_management/supplier/impl/SupplierServiceImpl.java new file mode 100644 index 0000000..4858986 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/inventory_management/supplier/impl/SupplierServiceImpl.java @@ -0,0 +1,103 @@ +package com.rabbiter.market.service.inventory_management.supplier.impl; + +import com.rabbiter.market.common.exception.BusinessException; // 自定义业务异常类 +import com.rabbiter.market.domain.inventory_management.detail_store_goods.DetailStoreGoods; // 入库商品明细实体类 +import com.rabbiter.market.domain.inventory_management.supplier.Supplier; // 供货商实体类 +import com.rabbiter.market.mapper.inventory_management.supplier.SupplierMapper; // 供货商数据访问层接口 +import com.rabbiter.market.qo.inventory_management.supplier.QuerySupplier; // 供货商查询条件对象 +import com.rabbiter.market.service.inventory_management.detail_store_goods.IDetailStoreGoodsService; // 入库商品明细业务接口 +import com.rabbiter.market.service.inventory_management.supplier.ISupplierService; // 供货商业务接口 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; // MyBatis-Plus查询条件构造器 +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; // MyBatis-Plus更新条件构造器 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; // MyBatis-Plus分页对象 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; // MyBatis-Plus通用服务实现类 +import org.springframework.beans.factory.annotation.Autowired; // Spring依赖注入注解 +import org.springframework.stereotype.Service; // Spring服务层注解 +import org.springframework.util.StringUtils; // Spring工具类,用于字符串判断 + +import java.util.ArrayList; // Java集合框架中的动态数组 +import java.util.HashMap; // Java集合框架中的键值对映射 +import java.util.List; // Java集合框架中的列表接口 +import java.util.Map; // Java集合框架中的映射接口 + +@Service // 标记该类为Spring的服务层组件 +public class SupplierServiceImpl extends ServiceImpl implements ISupplierService { // 继承MyBatis-Plus通用服务实现类并实现供货商业务接口 + @Autowired // 自动注入依赖 + private IDetailStoreGoodsService detailStoreGoodsService; // 入库商品明细业务服务 + + @Override // 重写接口方法 + public void deactivate(Long cn) { // 停用供货商方法 + QueryWrapper detailStoreGoodsQueryWrapper = new QueryWrapper() // 创建入库商品明细查询条件 + .eq("state1", DetailStoreGoods.STATE1_NORMAL) // 状态1为正常 + .eq("type", DetailStoreGoods.TYPE_IN) // 类型为入库 + .eq("state", DetailStoreGoods.STATE_NORMAL) // 状态为正常 + .eq("supplier_id", cn); // 关联当前供货商ID + List list = detailStoreGoodsService.list(detailStoreGoodsQueryWrapper); // 查询关联的入库商品明细 + if (list!=null&&list.size()>0){ // 如果存在关联的入库商品明细 + throw new BusinessException("该供货商正在被入库订单使用,请解除关系之后在停用"); // 抛出业务异常 + } + UpdateWrapper updateWrapper = new UpdateWrapper() // 创建供货商更新条件 + .set("state", Supplier.STATE_BAN) // 设置状态为停用 + .eq("cn", cn); // 匹配当前供货商ID + super.update(updateWrapper); // 执行更新操作 + } + + @Override // 重写接口方法 + public Page queryPageByQo(QuerySupplier qo) { // 根据查询条件分页查询供货商 + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); // 创建分页对象 + QueryWrapper wrapper = new QueryWrapper() // 创建供货商查询条件 + .like(StringUtils.hasText(qo.getName()), "name", qo.getName()) // 如果名称不为空,则按名称模糊查询 + .like(StringUtils.hasText(qo.getAddress()), "address", qo.getAddress()) // 如果地址不为空,则按地址模糊查询 + .like(StringUtils.hasText(qo.getInfo()), "info", qo.getInfo()) // 如果备注信息不为空,则按备注信息模糊查询 + .eq("state",Supplier.STATE_NORMAL); // 状态为正常 + super.page(page,wrapper); // 执行分页查询 + return page; // 返回分页结果 + } + + @Override // 重写接口方法 + public List> queryOptionsSuppliers() { // 查询供货商下拉选项列表 + List> list = new ArrayList<>(); // 创建结果列表 + QueryWrapper wrapper = new QueryWrapper() // 创建供货商查询条件 + .eq("state", Supplier.STATE_NORMAL); // 状态为正常 + List suppliers = super.list(wrapper); // 查询供货商列表 + if (suppliers==null ||suppliers.size()<=0){ // 如果供货商列表为空 + return new ArrayList<>(); // 返回空列表 + } + for (Supplier supplier : suppliers) { // 遍历供货商列表 + Map map = new HashMap<>(); // 创建键值对映射 + map.put("id",supplier.getCn()); // 添加ID字段 + map.put("name",supplier.getName()); // 添加名称字段 + list.add(map); // 将映射添加到结果列表 + } + return list; // 返回结果列表 + } + + @Override // 重写接口方法 + public void saveSupplier(Supplier supplier) { // 保存供货商信息 + supplier.setState(Supplier.STATE_NORMAL); // 设置状态为正常 + QueryWrapper queryWrapper = new QueryWrapper() // 创建供货商查询条件 + .eq("name", supplier.getName()) // 按名称匹配 + .eq("state", Supplier.STATE_NORMAL) // 状态为正常 + ; + Supplier one = super.getOne(queryWrapper); // 查询是否存在相同名称的供货商 + if (one!=null){ // 如果存在 + throw new BusinessException("已存在供货商的联系方式"); // 抛出业务异常 + } + super.save(supplier); // 保存供货商信息 + } + + @Override // 重写接口方法 + public void updateSupplier(Supplier supplier) { // 更新供货商信息 + if (Supplier.STATE_NORMAL.equals(supplier.getState())){ // 如果状态为正常 + QueryWrapper queryWrapper = new QueryWrapper() // 创建供货商查询条件 + .eq("name", supplier.getName()) // 按名称匹配 + .eq("state", Supplier.STATE_NORMAL) // 状态为正常 + .ne("cn", supplier.getCn()); // 排除当前供货商ID + Supplier one = super.getOne(queryWrapper); // 查询是否存在相同名称的其他供货商 + if (one!=null){ // 如果存在 + throw new BusinessException("该供货商已存在"); // 抛出业务异常 + } + } + super.updateById(supplier); // 更新供货商信息 + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/service/login/ILoginService.java b/src/main/java/com/rabbiter/market/service/login/ILoginService.java new file mode 100644 index 0000000..586e82a --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/login/ILoginService.java @@ -0,0 +1,43 @@ +package com.rabbiter.market.service.login; + +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.domain.system.menu.Menu; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + +/** + * 员工登录业务接口 + */ +public interface ILoginService extends IService { + /** + * 处理员工登录业务 + * @param username + * @param password + * @return + */ + Map login(String username, String password); + + /** + * 退出功能 + * @param token + */ + void exit(String token); + + /** + * 注销账户功能 + * @param token + * @param content + */ + void logout(String token, String content); + + /** + * 登录者拥有的菜单信息 + * @param token + * @return + */ + List empMenu(String token); + + Map checkedToken(String token); +} diff --git a/src/main/java/com/rabbiter/market/service/login/impl/LoginServiceImpl.java b/src/main/java/com/rabbiter/market/service/login/impl/LoginServiceImpl.java new file mode 100644 index 0000000..8cc11b6 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/login/impl/LoginServiceImpl.java @@ -0,0 +1,139 @@ +package com.rabbiter.market.service.login.impl; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.common.redis.constants.RedisKeys; +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.domain.system.menu.Menu; +import com.rabbiter.market.domain.system.role.Role; +import com.rabbiter.market.mapper.personnel_management.employee.EmployeeMapper; +import com.rabbiter.market.service.login.ILoginService; +import com.rabbiter.market.service.system.menu.IMenuService; +import com.rabbiter.market.service.system.role.IRoleService; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +public class LoginServiceImpl extends ServiceImpl implements ILoginService { + @Autowired + private RedisTemplateService redisTemplateService; + @Autowired + private IRoleService roleService; + @Autowired + private IMenuService menuService; + + @Override + public Map login(String username, String password) { + //根据电话号码查询用户 + QueryWrapper wrapper = new QueryWrapper().eq("phone", username).eq("state",Employee.STATE_NORMAL); + Employee employee = super.getOne(wrapper); + if (employee == null) { + throw new BusinessException("账号不存在"); + } + //判断账户是否被冻结 + RedisKeys disableuser = RedisKeys.DISABLEUSER; + + if (redisTemplateService.hasKey(disableuser.join(username))){ + throw new BusinessException("该账户已被冻结,请"+disableuser.getTimeout()+"小时后再来登录"); + } + //比对密码是否一致 + if (!password.equals(employee.getPassword())) { + //密码错误 + RedisKeys loginErroPwdnum = RedisKeys.LOGIN_ERRO_PWDNUM; + int errornum=redisTemplateService.hasKey(loginErroPwdnum.join(username))? (Integer) redisTemplateService.getCacheObject(loginErroPwdnum.join(username))+1:1; + if (errornum==6){ + redisTemplateService.setCacheObject(disableuser.join(username),true,disableuser.getTimeout(),disableuser.getTimeUnit()); + redisTemplateService.deleteObject(loginErroPwdnum.join(username)); + throw new BusinessException("账户被冻结6小时"); + }else{ + redisTemplateService.setCacheObject(loginErroPwdnum.join(username),errornum,loginErroPwdnum.getTimeout(),loginErroPwdnum.getTimeUnit()); + throw new BusinessException("账号或密码错误,错误剩余"+(6-errornum)+"次"); + } + } + //登录成功 + //删除密码错误次数缓存 + redisTemplateService.deleteObject(RedisKeys.LOGIN_ERRO_PWDNUM.join(username)); + if (employee.getIsAdmin()){ + //超级管理员处理方式 + List menus=menuService.findAll(); + employee.setMenus(menus); + }else { + //非超级管理员处理 + Set roles=roleService.queryByEid(employee.getId()); + if (roles!=null&&roles.size()!=0){ + employee.setRoles(roles); + Set rids=new HashSet<>(); + for (Role role : roles) { + rids.add(role.getId()); + } + List menus=menuService.queryByRids(rids); + employee.setMenus(menus); + } + } + //生成token的key和value + String key= RedisKeys.LOGIN_USER.join(username); + String value= JSONObject.toJSONString(employee); + //存入redis缓存中 + redisTemplateService.setCacheObject(key,value,RedisKeys.LOGIN_USER.getTimeout(),RedisKeys.LOGIN_USER.getTimeUnit()); + Map map = new HashMap(); + map.put("token",key); + map.put("employee",employee); + return map; + } + + @Override + public void exit(String token) { + if (redisTemplateService.hasKey(token)){ + String str = redisTemplateService.getCacheObject(token); + Employee employee = JSONObject.parseObject(str, Employee.class); + String login_error_pwdnum = RedisKeys.LOGIN_ERRO_PWDNUM.join(employee.getUsername()); + redisTemplateService.deleteObject(token); + redisTemplateService.deleteObject(login_error_pwdnum); + } + } + + @Override + public void logout(String token, String content) { + if ("本人确定注销".equals(content)){ + //判断是否是系统管理员 + String str = redisTemplateService.getCacheObject(token); + Employee employee = JSONObject.parseObject(str, Employee.class); + if (employee.getIsAdmin()){ + throw new BusinessException("系统管理员账户不可被注销"); + } + //清除角色员工关系 + roleService.clearEmpPermission(employee.getId()); + //清除缓存数据 + redisTemplateService.deleteObject(token); + super.remove(new QueryWrapper().eq("phone",employee.getUsername())); + + }else { + throw new BusinessException("内容输入有误"); + } + } + + @Override + public List empMenu(String token) { + String str = redisTemplateService.getCacheObject(token); + Employee employee = JSONObject.parseObject(str, Employee.class); + return employee.getMenus(); + } + + @Override + public Map checkedToken(String token) { + Map map = new HashMap<>(); + if (redisTemplateService.hasKey(token)){ + map.put("employee",JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class)); + }else { + map.put("employee",null); + } + map.put("token",token); + + return map; + } +} diff --git a/src/main/java/com/rabbiter/market/service/member_management/member/IMemberService.java b/src/main/java/com/rabbiter/market/service/member_management/member/IMemberService.java new file mode 100644 index 0000000..07246ec --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/member_management/member/IMemberService.java @@ -0,0 +1,20 @@ +package com.rabbiter.market.service.member_management.member; + +import com.rabbiter.market.domain.member_management.member.Member; +import com.rabbiter.market.qo.member_management.member.QueryMember; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface IMemberService extends IService { + Page queryPageByQo(QueryMember qo); + + void delMember(Long id); + + void saveMember(Member member); + + Member queryMemberById(Long id); + + void updateMember(Member member); + + Member queryMemberByPhone(String phone); +} diff --git a/src/main/java/com/rabbiter/market/service/member_management/member/impl/MemberServiceImpl.java b/src/main/java/com/rabbiter/market/service/member_management/member/impl/MemberServiceImpl.java new file mode 100644 index 0000000..e9f9cd3 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/member_management/member/impl/MemberServiceImpl.java @@ -0,0 +1,78 @@ +package com.rabbiter.market.service.member_management.member.impl; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.domain.member_management.member.Member; +import com.rabbiter.market.mapper.member_management.member.MemberMapper; +import com.rabbiter.market.qo.member_management.member.QueryMember; +import com.rabbiter.market.service.member_management.member.IMemberService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +@Service +public class MemberServiceImpl extends ServiceImpl implements IMemberService { + @Override + public Page queryPageByQo(QueryMember qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.hasText(qo.getPhone()), "phone", qo.getPhone()); + wrapper.like(StringUtils.hasText(qo.getName()), "name", qo.getName()); + wrapper.eq(StringUtils.hasText(qo.getState()), "state", qo.getState()); + super.page(page, wrapper); + return page; + } + + @Override + public void delMember(Long id) { + UpdateWrapper wrapper = new UpdateWrapper() + .set("state", Member.STATE_BAN) + .set("integral", 0L) + .eq("id", id); + super.update(wrapper); + } + + @Override + public void saveMember(Member member) { + QueryWrapper wrapper = new QueryWrapper().eq("phone", member.getPhone()).eq("state", Member.STATE_NORMAL); + Member one = super.getOne(wrapper); + if (one != null) { + throw new BusinessException("该用户已注册过"); + } + member.setPassword(Member.DEFAULT_PWD); + member.setState(Member.STATE_NORMAL); + member.setIntegral(0L); + super.save(member); + } + + @Override + public Member queryMemberById(Long id) { + return super.getById(id); + } + + @Override + public void updateMember(Member member) { + if (Member.STATE_NORMAL.equals(member.getState())) { + QueryWrapper wrapper = new QueryWrapper().eq("phone", member.getPhone()) + .ne("id",member.getId()) + .eq("state", Member.STATE_NORMAL); + Member one = super.getOne(wrapper); + if (one != null) { + throw new BusinessException("已被录入"); + } + } + super.updateById(member); + } + + @Override + public Member queryMemberByPhone(String phone) { + QueryWrapper wrapper = new QueryWrapper().eq("phone", phone).eq("state", Member.STATE_NORMAL); + Member one = super.getOne(wrapper); + if (one==null){ + throw new BusinessException("该会员不存在"); + } + return one; + } +} diff --git a/src/main/java/com/rabbiter/market/service/personnel_management/employee/IEmployeeService.java b/src/main/java/com/rabbiter/market/service/personnel_management/employee/IEmployeeService.java new file mode 100644 index 0000000..ea964cf --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/personnel_management/employee/IEmployeeService.java @@ -0,0 +1,47 @@ +package com.rabbiter.market.service.personnel_management.employee; + +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.qo.personal.QueryEditPwd; +import com.rabbiter.market.qo.personnel_management.employee.QueryEmp; +import com.rabbiter.market.vo.employee.DetailEmpVo; +import com.rabbiter.market.vo.employee.EditEmpVo; +import com.rabbiter.market.vo.employee.InformationVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface IEmployeeService extends IService { + + + /** + * 修改个人密码业务 + * @param editPwd + * @param token + */ + void edit_pwd(QueryEditPwd editPwd, String token); + + /** + * 分页显示数据 + * @param qo + * @return + */ + Page pageByQo(QueryEmp qo); + + DetailEmpVo detail(Long uid); + + void saveEmp(Employee employee,String token); + + EditEmpVo editbtn(Long uid); + + void updateEmp(Employee employee,String token); + + void deactivate(Long id); + + /** + * 重置密码 + * @param eid + * @param code + */ + void resetPwd(Long eid, String code); + + InformationVo information(String token); +} diff --git a/src/main/java/com/rabbiter/market/service/personnel_management/employee/impl/EmployeeServiceImpl.java b/src/main/java/com/rabbiter/market/service/personnel_management/employee/impl/EmployeeServiceImpl.java new file mode 100644 index 0000000..b8cec33 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/personnel_management/employee/impl/EmployeeServiceImpl.java @@ -0,0 +1,250 @@ +package com.rabbiter.market.service.personnel_management.employee.impl; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.common.redis.constants.RedisKeys; +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.personnel_management.department.Dept; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.domain.system.role.Role; +import com.rabbiter.market.mapper.personnel_management.employee.EmployeeMapper; +import com.rabbiter.market.qo.personal.QueryEditPwd; +import com.rabbiter.market.qo.personnel_management.department.QueryDept; +import com.rabbiter.market.qo.personnel_management.employee.QueryEmp; +import com.rabbiter.market.service.personnel_management.employee.IEmployeeService; +import com.rabbiter.market.service.personnel_management.personnel_management.department.IDeptService; +import com.rabbiter.market.service.system.role.IRoleService; +import com.rabbiter.market.vo.employee.DetailEmpVo; +import com.rabbiter.market.vo.employee.EditEmpVo; +import com.rabbiter.market.vo.employee.InformationVo; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@Service +public class EmployeeServiceImpl extends ServiceImpl implements IEmployeeService { + @Autowired + private RedisTemplateService redisTemplateService; + @Autowired + private IDeptService deptService; + @Autowired + private IRoleService roleService; + + @Override + public void edit_pwd(QueryEditPwd editPwd, String token) { + //获取缓存中的登录员工信息 + String str = redisTemplateService.getCacheObject(token); + Employee employee = JSONObject.parseObject(str, Employee.class); + if (employee.getId() == 1L) { + throw new BusinessException("该账户不能被修改"); + } + //比对用户名是否一致 + if (!employee.getUsername().equals(editPwd.getUsername())) { + //不一致 + throw new BusinessException("没有权限修改其他人的密码"); + } + //比对旧密码是否输入正确 + if (!employee.getPassword().equals(editPwd.getOldPwd())) { + throw new BusinessException("原密码输入有误"); + } + //比对新密码和旧密码是否一致 + if (editPwd.getOldPwd().equals(editPwd.getNewPwd())) { + throw new BusinessException("新密码和旧密码一致"); + } + UpdateWrapper wrapper = new UpdateWrapper().set("password", editPwd.getNewPwd()) + .eq("phone", editPwd.getUsername()); + super.update(wrapper); + } + + @Transactional + @Override + public Page pageByQo(QueryEmp qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.hasText(qo.getUsername()), "phone", qo.getUsername()) + .eq(StringUtils.hasText(qo.getAge()), "age", qo.getAge()) + .like(StringUtils.hasText(qo.getNickName()), "nick_name", qo.getNickName()) + .like(StringUtils.hasText(qo.getAddress()), "address", qo.getAddress()) + .eq(StringUtils.hasText(qo.getSex()), "sex", qo.getSex()) + .ne("id", 1L) + .eq(qo.getDeptId() != null, "deptId", qo.getDeptId()); + super.page(page, wrapper); + //补全部门信息 + List depts = deptService.listByQo(new QueryDept()); + List records = page.getRecords(); + if (records != null) { + for (Employee record : records) { + if (depts != null) { + for (Dept dept : depts) { + if (dept.getId() == record.getDeptId()) { + record.setDeptName(dept.getName()); + break; + } + } + } + } + } + return page; + } + + @Override + public DetailEmpVo detail(Long uid) { + DetailEmpVo vo = new DetailEmpVo(); + //查询员工信息 + Employee employee = super.getById(uid); + BeanUtils.copyProperties(employee, vo); + + //补全角色信息 + Set roleNames = new HashSet<>(); + if (employee.getIsAdmin() == true) { + //查询所有角色 + List list = roleService.list(); + for (Role role : list) { + roleNames.add(role.getName()); + + } + } else { + Set roles = roleService.queryByEid(uid); + for (Role role : roles) { + roleNames.add(role.getName()); + } + } + vo.setRoleNames(roleNames); + return vo; + } + + @Override + public void saveEmp(Employee employee, String token) { + //校验参数是否有误 + if (!StringUtils.hasLength(employee.getPassword())) { + employee.setPassword(Employee.DEFAULT_PWD); + } + if (!StringUtils.hasLength(employee.getUsername())) { + throw new BusinessException("手机号不能为空"); + } + if (!StringUtils.hasLength(employee.getIdCard())) { + throw new BusinessException("身份证号不能为空"); + } + if (employee.getAge() == null) { + employee.setAge(18); + } else if (employee.getAge() < 0 || employee.getAge() > 120) { + throw new BusinessException("年龄值有误"); + } + //校验用户是否已注册 + QueryWrapper wrapper = new QueryWrapper().eq("phone", employee.getUsername()); + Employee one = super.getOne(wrapper); + if (one != null) { + throw new BusinessException("系统中已存在该账户"); + } + employee.setState(Employee.STATE_NORMAL); + if (!StringUtils.hasText(employee.getSex())) { + employee.setSex(Employee.SEX_MEN); + } + if (!StringUtils.hasText(employee.getHeadImg())) { + employee.setHeadImg(Employee.DEFAULT_HEAD_IMG); + } + employee.setCreateTime(new Date()); + employee.setIsAdmin(false); + String nickName = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class).getNickName(); + employee.setCreateby(nickName); + super.save(employee); + } + + @Override + public EditEmpVo editbtn(Long uid) { + EditEmpVo vo = new EditEmpVo(); + Employee employee = super.getById(uid); + BeanUtils.copyProperties(employee, vo); + return vo; + } + + @Override + public void updateEmp(Employee employee, String token) { + if (Employee.STATE_DEL.equals(employee.getState())) { + if (employee.getIsAdmin() != null && employee.getIsAdmin()) { + throw new BusinessException("不可以给系统管理者办理离职"); + } + } + QueryWrapper wrapper = new QueryWrapper().having("id!=" + employee.getId()) + .eq(StringUtils.hasText(employee.getUsername()), "phone", employee.getUsername()) + .or() + .eq(StringUtils.hasText(employee.getIdCard()), "id_card", employee.getIdCard()); + List list = super.list(wrapper); + if (list != null && list.size() > 0) { + throw new BusinessException("系统已存在相同的用户名或身份证号"); + } + + if (Employee.STATE_DEL.equals(employee.getState())) { + employee.setLeaveTime(new Date()); + } else { + employee.setCreateTime(new Date()); + String nickName = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class).getNickName(); + employee.setCreateby(nickName); + } + super.updateById(employee); + } + + @Override + public void deactivate(Long id) { + Employee employee = super.getById(id); + if (employee.getIsAdmin()) { + throw new BusinessException("不可以给系统管理者办理离职"); + } + if (Employee.STATE_DEL.equals(employee.getState())) { + throw new BusinessException("已是离职状态"); + } + UpdateWrapper wrapper = new UpdateWrapper().set("state", Employee.STATE_DEL).eq("id", id); + super.update(wrapper); + } + + @Transactional + @Override + public void resetPwd(Long eid, String code) { + Employee employee = super.getById(eid); + if (employee.getId() == 1L) { + throw new BusinessException("该账户不可被修改"); + } + if (employee.getIsAdmin()) { + if (code.equals("123456")) { + UpdateWrapper wrapper = new UpdateWrapper().set("password", Employee.DEFAULT_PWD).eq("id", eid); + super.update(wrapper); + } else { + throw new BusinessException("密钥错误"); + } + } else { + if (code.equals("456789")) { + UpdateWrapper wrapper = new UpdateWrapper().set("password", Employee.DEFAULT_PWD).eq("id", eid); + super.update(wrapper); + } else { + throw new BusinessException("密钥错误"); + } + } + redisTemplateService.deleteObject(RedisKeys.LOGIN_USER.join(employee.getUsername())); + redisTemplateService.deleteObject(RedisKeys.DISABLEUSER.join(employee.getUsername())); + redisTemplateService.deleteObject(RedisKeys.LOGIN_ERRO_PWDNUM.join(employee.getUsername())); + } + + @Override + public InformationVo information(String token) { + if(token == null) { + return null; + } + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + DetailEmpVo detail = detail(employee.getId()); + InformationVo vo = new InformationVo(); + BeanUtils.copyProperties(detail, vo); + return vo; + + } +} diff --git a/src/main/java/com/rabbiter/market/service/personnel_management/personnel_management/department/IDeptService.java b/src/main/java/com/rabbiter/market/service/personnel_management/personnel_management/department/IDeptService.java new file mode 100644 index 0000000..1e806ab --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/personnel_management/personnel_management/department/IDeptService.java @@ -0,0 +1,36 @@ +package com.rabbiter.market.service.personnel_management.personnel_management.department; + +import com.rabbiter.market.domain.personnel_management.department.Dept; +import com.rabbiter.market.qo.personnel_management.department.QueryDept; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +public interface IDeptService extends IService { + + + /** + * 条件查询信息业务 + * @param qo + * @return + */ + List listByQo(QueryDept qo); + + /** + * 停用业务 + * @param id + */ + void forbiddenRole(Long id); + + /** + * 保存信息业务 + * @param dept + */ + void saveDept(Dept dept); + + /** + * 更改部门的信息业务 + * @param dept + */ + void updateDept(Dept dept); +} diff --git a/src/main/java/com/rabbiter/market/service/personnel_management/personnel_management/department/impl/DeptServiceImpl.java b/src/main/java/com/rabbiter/market/service/personnel_management/personnel_management/department/impl/DeptServiceImpl.java new file mode 100644 index 0000000..f9d99c9 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/personnel_management/personnel_management/department/impl/DeptServiceImpl.java @@ -0,0 +1,70 @@ +package com.rabbiter.market.service.personnel_management.personnel_management.department.impl; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.domain.personnel_management.department.Dept; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.mapper.personnel_management.department.DeptMapper; +import com.rabbiter.market.qo.personnel_management.department.QueryDept; +import com.rabbiter.market.service.personnel_management.employee.IEmployeeService; +import com.rabbiter.market.service.personnel_management.personnel_management.department.IDeptService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +import java.util.List; + +@Service +public class DeptServiceImpl extends ServiceImpl implements IDeptService { + @Autowired + private IEmployeeService employeeService; + @Override + public List listByQo(QueryDept qo) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper() + .like(StringUtils.hasText(qo.getName()),Dept::getName, qo.getName()) + .eq(StringUtils.hasText(qo.getState()),Dept::getState, qo.getState()); + return super.list(wrapper); + } + + @Transactional + @Override + public void forbiddenRole(Long id) { + QueryWrapper empWrapper = new QueryWrapper().eq(id != null,"deptId", id); + List list = employeeService.list(empWrapper); + if (list!=null &&list.size()>0){ + throw new BusinessException("操作失败,该部门正在使用"); + } + UpdateWrapper wrapper = new UpdateWrapper().set("state", Dept.STATE_BAN).eq("id", id); + super.update(wrapper); + } + + @Transactional + @Override + public void saveDept(Dept dept) { + //判断是否有被创建 + QueryWrapper wrapper = new QueryWrapper().eq(StringUtils.hasText(dept.getName()), "name", dept.getName()); + if (super.getOne(wrapper)!=null){ + throw new BusinessException("操作失败,该部门已存在"); + } + dept.setState(Dept.STATE_NORMAL); + super.save(dept); + + } + + @Transactional + @Override + public void updateDept(Dept dept) { + if (Dept.STATE_BAN.equals(dept.getState())){ + QueryWrapper empWrapper = new QueryWrapper().eq(dept.getId() != null,"deptId", dept.getId()); + List list = employeeService.list(empWrapper); + if (list!=null &&list.size()>0){ + throw new BusinessException("操作失败,该部门正在使用"); + } + } + super.updateById(dept); + } +} diff --git a/src/main/java/com/rabbiter/market/service/sale_management/detail_sale_records/IDetailSaleRecordsService.java b/src/main/java/com/rabbiter/market/service/sale_management/detail_sale_records/IDetailSaleRecordsService.java new file mode 100644 index 0000000..ac2d720 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/sale_management/detail_sale_records/IDetailSaleRecordsService.java @@ -0,0 +1,7 @@ +package com.rabbiter.market.service.sale_management.detail_sale_records; + +import com.rabbiter.market.domain.sale_management.detail_sale_records.DetailSaleRecords; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface IDetailSaleRecordsService extends IService { +} diff --git a/src/main/java/com/rabbiter/market/service/sale_management/detail_sale_records/impl/DetailSaleRecordsServiceImpl.java b/src/main/java/com/rabbiter/market/service/sale_management/detail_sale_records/impl/DetailSaleRecordsServiceImpl.java new file mode 100644 index 0000000..6613260 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/sale_management/detail_sale_records/impl/DetailSaleRecordsServiceImpl.java @@ -0,0 +1,11 @@ +package com.rabbiter.market.service.sale_management.detail_sale_records.impl; + +import com.rabbiter.market.domain.sale_management.detail_sale_records.DetailSaleRecords; +import com.rabbiter.market.mapper.sale_management.detail_sale_records.DetailSaleRecordsMapper; +import com.rabbiter.market.service.sale_management.detail_sale_records.IDetailSaleRecordsService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +@Service +public class DetailSaleRecordsServiceImpl extends ServiceImpl implements IDetailSaleRecordsService { +} diff --git a/src/main/java/com/rabbiter/market/service/sale_management/exchange_point_products/IExchangePointProductsService.java b/src/main/java/com/rabbiter/market/service/sale_management/exchange_point_products/IExchangePointProductsService.java new file mode 100644 index 0000000..5470bc6 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/sale_management/exchange_point_products/IExchangePointProductsService.java @@ -0,0 +1,30 @@ +package com.rabbiter.market.service.sale_management.exchange_point_products; + +import com.rabbiter.market.domain.goods_management.point_products.PointProducts; +import com.rabbiter.market.domain.sale_management.exchange_point_products.ExchangePointProducts; +import com.rabbiter.market.qo.exchange_point_products_records.QueryExchangePointProductsRecords; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + +public interface IExchangePointProductsService extends IService { + List> queryPointProductBymemberId(Long memberId); + + PointProducts queryPointProductByGoodsId(Long goodsId); + + void saveExchangePointProductRecords(ExchangePointProducts exchangePointProducts, String token); + + List> queryOptionsMemberPhone(); + + void delExchangePointProducts(String cn); + + Page queryPageByQoExchangePointProducts(QueryExchangePointProductsRecords qo); + + List> queryOptionsPointProducts(); + + List> queryOptionsMember(); + + List> queryMemberByGoodsId(Long goodsId); +} diff --git a/src/main/java/com/rabbiter/market/service/sale_management/exchange_point_products/impl/ExchangePointProductsServiceImpl.java b/src/main/java/com/rabbiter/market/service/sale_management/exchange_point_products/impl/ExchangePointProductsServiceImpl.java new file mode 100644 index 0000000..a41be5a --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/sale_management/exchange_point_products/impl/ExchangePointProductsServiceImpl.java @@ -0,0 +1,190 @@ +package com.rabbiter.market.service.sale_management.exchange_point_products.impl; + +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.goods_management.goods.Goods; +import com.rabbiter.market.domain.goods_management.point_products.PointProducts; +import com.rabbiter.market.domain.member_management.member.Member; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.domain.sale_management.exchange_point_products.ExchangePointProducts; +import com.rabbiter.market.mapper.sale_management.exchange_point_products.ExchangePointProductsMapper; +import com.rabbiter.market.qo.exchange_point_products_records.QueryExchangePointProductsRecords; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.service.goods_management.point_products.IPointProductsService; +import com.rabbiter.market.service.member_management.member.IMemberService; +import com.rabbiter.market.service.sale_management.exchange_point_products.IExchangePointProductsService; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.*; + +@Service +public class ExchangePointProductsServiceImpl extends ServiceImpl implements IExchangePointProductsService { + @Autowired + private IMemberService memberService; + @Autowired + private IPointProductsService pointProductsService; + @Autowired + private RedisTemplateService redisTemplateService; + @Autowired + private IGoodsService goodsService; + + @Override + public List> queryPointProductBymemberId(Long memberId) { + Member member = memberService.getById(memberId); + + QueryWrapper pointProductsQueryWrapper = new QueryWrapper(); + if (memberId == null) { + pointProductsQueryWrapper.gt("integral", 0L); + } else { + pointProductsQueryWrapper.le("integral", member.getIntegral()); + } + + List list = pointProductsService.list(pointProductsQueryWrapper); + List> mapArrayList = new ArrayList<>(); + for (PointProducts pointProducts : list) { + Map map = new HashMap<>(); + map.put("id", pointProducts.getGoodsId()); + map.put("name", pointProducts.getGoodsName()); + mapArrayList.add(map); + } + return mapArrayList; + } + + @Override + public PointProducts queryPointProductByGoodsId(Long goodsId) { + PointProducts pointProducts = pointProductsService.getOne(new QueryWrapper().eq(goodsId != null, "goods_id", goodsId)); + return pointProducts; + } + + @Override + public void saveExchangePointProductRecords(ExchangePointProducts exchangePointProducts, String token) { + Employee employee = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + exchangePointProducts.setCn(IdWorker.getIdStr());//生成订单号 + exchangePointProducts.setUpdateby(employee.getNickName()); + exchangePointProducts.setUpdateId(employee.getId()); + exchangePointProducts.setUpdateTime(new Date()); + exchangePointProducts.setState(ExchangePointProducts.STATE_NORMAL); + /*修改会员的积分*/ + Member member = memberService.getById(exchangePointProducts.getMemberId()); + member.setIntegral(member.getIntegral() - exchangePointProducts.getIntegral()); + memberService.updateById(member); + super.save(exchangePointProducts); + + } + + @Override + public List> queryOptionsMemberPhone() { + QueryWrapper wrapper = new QueryWrapper() + .select("member_id") + .eq("state", ExchangePointProducts.STATE_NORMAL) + .groupBy("member_id"); + List list = super.list(wrapper); + List memberIds = new ArrayList<>(); + for (ExchangePointProducts exchangePointProducts : list) { + memberIds.add(exchangePointProducts.getMemberId()); + } + if (memberIds==null || memberIds.size()<=0){ + return null; + } + List members = memberService.listByIds(memberIds); + List> vos = new ArrayList<>(); + for (Member member : members) { + Map map = new HashMap<>(); + map.put("id", member.getId()); + map.put("name", member.getPhone()); + vos.add(map); + } + + return vos; + } + + @Override + public void delExchangePointProducts(String cn) { + UpdateWrapper wrapper = new UpdateWrapper() + .set("state", ExchangePointProducts.STATE_DEL) + .eq("cn", cn); + super.update(wrapper); + } + + @Override + public Page queryPageByQoExchangePointProducts(QueryExchangePointProductsRecords qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + QueryWrapper queryWrapper = new QueryWrapper() + .eq("state", ExchangePointProducts.STATE_NORMAL) + .eq(qo.getMemberId() != null, "member_id", qo.getMemberId()) + .ge(StringUtils.hasText(qo.getStartTime()), "update_time", qo.getStartTime()) + .le(StringUtils.hasText(qo.getEndTime()), "update_time", qo.getEndTime()) + .likeRight(StringUtils.hasText(qo.getCn()), "cn", qo.getCn()); + super.page(page, queryWrapper); + for (ExchangePointProducts record : page.getRecords()) { + Member member = memberService.getById(record.getMemberId()); + record.setMemberPhone(member.getPhone()); + Goods goods = goodsService.getById(record.getGoodsId()); + record.setGoodsCoverUrl(goods.getCoverUrl()); + record.setGoodsName(goods.getName()); + } + return page; + } + + @Override + public List> queryOptionsPointProducts() { + QueryWrapper wrapper = new QueryWrapper() + .eq("state", PointProducts.STATE_NORMAL); + List list = pointProductsService.list(wrapper); + List> vos = new ArrayList<>(); + for (PointProducts pointProducts : list) { + Map map = new HashMap<>(); + map.put("id", pointProducts.getGoodsId()); + map.put("name", pointProducts.getGoodsName()); + vos.add(map); + } + return vos; + } + + @Override + public List> queryOptionsMember() { + List> vos = new ArrayList<>(); + QueryWrapper wrapper = new QueryWrapper() + .groupBy("id") + .eq("state", Member.STATE_NORMAL); + List list = memberService.list(wrapper); + for (Member member : list) { + Map map = new HashMap<>(); + map.put("id", member.getId()); + map.put("name", member.getPhone()); + vos.add(map); + } + return vos; + } + + @Override + public List> queryMemberByGoodsId(Long goodsId) { + List members = new ArrayList<>(); + QueryWrapper memberQueryWrapper = new QueryWrapper(); + memberQueryWrapper.eq("state", Member.STATE_NORMAL); + if (goodsId != null) { + PointProducts pointProducts = pointProductsService.getOne(new QueryWrapper() + .eq("goods_id", goodsId) + .eq("state", PointProducts.STATE_NORMAL)); + memberQueryWrapper.ge("integral", pointProducts.getIntegral()); + } else { + memberQueryWrapper.gt("integral", 0); + } + members = memberService.list(memberQueryWrapper); + List> vos = new ArrayList<>(); + for (Member member : members) { + Map map = new HashMap<>(); + map.put("id", member.getId()); + map.put("name", member.getPhone()); + vos.add(map); + } + return vos; + } +} diff --git a/src/main/java/com/rabbiter/market/service/sale_management/sale_records/ISaleRecordsService.java b/src/main/java/com/rabbiter/market/service/sale_management/sale_records/ISaleRecordsService.java new file mode 100644 index 0000000..a2b39cf --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/sale_management/sale_records/ISaleRecordsService.java @@ -0,0 +1,19 @@ +package com.rabbiter.market.service.sale_management.sale_records; + +import com.rabbiter.market.domain.sale_management.sale_records.SaleRecords; +import com.rabbiter.market.qo.sale_records.QuerySaleRecords; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + +public interface ISaleRecordsService extends IService { + List> getOptionSaleRecordsGoods(); + + SaleRecords saveSaleRecords(SaleRecords saleRecords, String token); + + Page queryPageByQoSaleRecords(QuerySaleRecords qo); + + void delSaleRecords(String cn); +} diff --git a/src/main/java/com/rabbiter/market/service/sale_management/sale_records/impl/SaleRecordsServiceImpl.java b/src/main/java/com/rabbiter/market/service/sale_management/sale_records/impl/SaleRecordsServiceImpl.java new file mode 100644 index 0000000..68a4e45 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/sale_management/sale_records/impl/SaleRecordsServiceImpl.java @@ -0,0 +1,120 @@ +package com.rabbiter.market.service.sale_management.sale_records.impl; + +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.goods_management.goods.Goods; +import com.rabbiter.market.domain.member_management.member.Member; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.domain.sale_management.detail_sale_records.DetailSaleRecords; +import com.rabbiter.market.domain.sale_management.sale_records.SaleRecords; +import com.rabbiter.market.mapper.sale_management.sale_records.SaleRecordsMapper; +import com.rabbiter.market.qo.sale_records.QuerySaleRecords; +import com.rabbiter.market.service.goods_management.goods.IGoodsService; +import com.rabbiter.market.service.inventory_management.store.IGoodsStoreService; +import com.rabbiter.market.service.member_management.member.IMemberService; +import com.rabbiter.market.service.sale_management.detail_sale_records.IDetailSaleRecordsService; +import com.rabbiter.market.service.sale_management.sale_records.ISaleRecordsService; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.*; + +@Service +public class SaleRecordsServiceImpl extends ServiceImpl implements ISaleRecordsService { + @Autowired + private IGoodsService goodsService; + @Autowired + private RedisTemplateService redisTemplateService; + @Autowired + private IDetailSaleRecordsService detailSaleRecordsService; + @Autowired + private IGoodsStoreService goodsStoreService; + @Autowired + private IMemberService memberService; + + @Override + public List> getOptionSaleRecordsGoods() { + QueryWrapper wrapper = new QueryWrapper().gt("residue_num", 0L); + List list = goodsService.list(wrapper); + List> goodsList = new ArrayList<>(); + if (list != null && list.size() > 0) { + for (Goods goods : list) { + Map map = new HashMap<>(); + map.put("id", goods.getId()); + map.put("name", goods.getName()); + map.put("residueNum", goods.getResidueNum()); + goodsList.add(map); + } + } + return goodsList; + } + + @Override + public SaleRecords saveSaleRecords(SaleRecords saleRecords, String token) { + Employee employee = JSON.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + saleRecords.setEid(employee.getId()); + saleRecords.setSellTime(new Date()); + saleRecords.setSellby(employee.getNickName()); + saleRecords.setState(SaleRecords.STATE_NORMAL); + for (DetailSaleRecords detailSaleRecord : saleRecords.getDetailSaleRecords()) { + detailSaleRecord.setSellCn(saleRecords.getCn()); + Goods goods = goodsService.getById(detailSaleRecord.getGoodsId()); + UpdateWrapper wrapper = new UpdateWrapper() + .set("sales_volume", goods.getSalesVolume() != null ? goods.getSalesVolume() + detailSaleRecord.getGoodsNum() : detailSaleRecord.getGoodsNum()) + .set("residue_num", goods.getResidueNum() - detailSaleRecord.getGoodsNum()) + .eq("id", goods.getId()); + goodsService.update(wrapper); + } + detailSaleRecordsService.saveBatch(saleRecords.getDetailSaleRecords()); + super.save(saleRecords); + if ("1".equals(saleRecords.getType())) { + //为会员增加积分 积分规则:积分=总金额*5%取整 + String s = saleRecords.getSellTotalmoney() * 0.05 + ""; + long integral = Long.parseLong(s.split("\\.")[0]); + QueryWrapper memberQueryWrapper = new QueryWrapper().eq("phone", saleRecords.getMemberPhone()); + Member member = memberService.getOne(memberQueryWrapper); + UpdateWrapper memberUpdateWrapper = new UpdateWrapper() + .set("integral", member.getIntegral() != null ? member.getIntegral() + + integral : integral) + .eq("phone", saleRecords.getMemberPhone()); + memberService.update(memberUpdateWrapper); + } + return saleRecords; + } + + @Override + public Page queryPageByQoSaleRecords(QuerySaleRecords qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("state", SaleRecords.STATE_NORMAL); + queryWrapper.eq(StringUtils.hasText(qo.getType()), "type", qo.getType()); + queryWrapper.likeRight(StringUtils.hasText(qo.getCn()), "cn", qo.getCn()); + queryWrapper.ge(StringUtils.hasText(qo.getStartSellTime()), "sell_time", qo.getStartSellTime()); + queryWrapper.le(StringUtils.hasText(qo.getEndSellTime()), "sell_time", qo.getEndSellTime()); + queryWrapper.eq(StringUtils.hasText(qo.getSellway()), "sellway", qo.getSellway()); + super.page(page, queryWrapper); + List records = page.getRecords(); + if (records != null && records.size() > 0) { + for (SaleRecords record : records) { + QueryWrapper sellCnWrapper = new QueryWrapper().eq("sell_cn", record.getCn()); + List list = detailSaleRecordsService.list(sellCnWrapper); + record.setDetailSaleRecords(list); + } + } + return page; + } + + @Override + public void delSaleRecords(String cn) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.eq("cn", cn); + wrapper.set("state", SaleRecords.STATE_DEL); + super.update(wrapper); + } + +} diff --git a/src/main/java/com/rabbiter/market/service/system/menu/IMenuService.java b/src/main/java/com/rabbiter/market/service/system/menu/IMenuService.java new file mode 100644 index 0000000..2377a45 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/system/menu/IMenuService.java @@ -0,0 +1,40 @@ +package com.rabbiter.market.service.system.menu; + +import com.rabbiter.market.domain.system.menu.Menu; +import com.rabbiter.market.qo.system.MenuQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Set; + +public interface IMenuService extends IService { + /** + * 查询所有的菜单 + * @return + */ + List findAll(); + + /** + * 根据角色id集合查询对应的菜单 + * @param rids + * @return + */ + List queryByRids(Set rids); + + /** + * 分页查询菜单的信息 + * 以目录进行分页 + * @param qo + * @return + */ + Page queryPageByQo(MenuQuery qo); + + + /** + * 查询父菜单id + * @param ids + * @return + */ + List listParentByIds(List ids); +} diff --git a/src/main/java/com/rabbiter/market/service/system/menu/impl/MenuServiceImpl.java b/src/main/java/com/rabbiter/market/service/system/menu/impl/MenuServiceImpl.java new file mode 100644 index 0000000..f862484 --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/system/menu/impl/MenuServiceImpl.java @@ -0,0 +1,167 @@ +package com.rabbiter.market.service.system.menu.impl; + +import com.rabbiter.market.domain.system.menu.Menu; +import com.rabbiter.market.mapper.system.menu.MenuMapper; +import com.rabbiter.market.qo.system.MenuQuery; +import com.rabbiter.market.service.system.menu.IMenuService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.*; + +@Service +public class MenuServiceImpl extends ServiceImpl implements IMenuService { + @Autowired + private MenuMapper menuMapper; + + @Override + public List findAll() { + + //查询目录菜单 + // select * from t_menu where type='0' and state='0' + QueryWrapper wrapper1 = new QueryWrapper().eq("type", Menu.TYPE_CATALOGUE).eq("state", Menu.STATE_NORMAL); + List catalogs = super.list(wrapper1); + if (catalogs.isEmpty()) { + return null; + } + //得到目录下的菜单信息 + for (Menu catalog : catalogs) { + //select * from t_menu where type='1' and parent_id=#{id} and state='0' + QueryWrapper wrapper2 = new QueryWrapper().eq("type", Menu.TYPE_MENU).eq("state", Menu.STATE_NORMAL) + .eq("parent_id", catalog.getId()); + List menus = super.list(wrapper2); + //获取菜单下的按钮 + for (Menu menu : menus) { + //select * from t_menu where type='2' and parent_id=#{id} and state='0' + QueryWrapper wrapper3 = new QueryWrapper().eq("type", Menu.TYPE_BUTTON).eq("state", Menu.STATE_NORMAL) + .eq("parent_id", menu.getId()); + List buttons = super.list(wrapper3); + if (!buttons.isEmpty()) { + menu.setChildren(buttons); + } + } + catalog.setChildren(menus); + } + return catalogs; + } + + @Override + public List queryByRids(Set rids) { + List result = menuMapper.queryByRids(rids); + if (result.isEmpty()) { + return null; + } + //目录 + Set catalogs = new HashSet<>(); + //菜单 + Set menus = new HashSet<>(); + //按钮 + Set buttons = new HashSet<>(); + + Iterator iterator1 = result.iterator(); + while (iterator1.hasNext()) { + Menu item = iterator1.next(); + switch (item.getType()) { + case Menu.TYPE_CATALOGUE: + catalogs.add(item); + break; + case Menu.TYPE_MENU: + menus.add(item); + break; + case Menu.TYPE_BUTTON: + buttons.add(item); + break; + } + iterator1.remove(); + } + + for (Menu catalog : catalogs) { + catalog.setChildren(new ArrayList<>()); + for (Menu menu : menus) { + menu.setChildren(new ArrayList<>()); + for (Menu button : buttons) { + //将按钮分配到对应的菜单下 + if (button.getParentId() == menu.getId()) { + menu.getChildren().add(button); + } + } + //将菜单分配到对应的目录下 + if (menu.getParentId() == catalog.getId()) { + catalog.getChildren().add(menu); + } + } + + } + List catalogues = new ArrayList<>(); + //去重 + for (Menu catalog : catalogs) { + catalogues.add(catalog); + } + return catalogues; + } + + @Override + public Page queryPageByQo(MenuQuery qo) { + Page page = new Page<>(qo.getCurrentPage(), qo.getPageSize()); + //查询目录 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("type", Menu.TYPE_CATALOGUE); + wrapper.like(StringUtils.hasText(qo.getName()), "label", qo.getName()); + + Page page1 = super.page(page, wrapper); + //补全目录的子集 + List catalogs = page1.getRecords(); + if (catalogs == null || catalogs.isEmpty()) { + return page1; + } + /*补全目录下的菜单*/ + for (Menu catalog : catalogs) { + QueryWrapper wrapper_menu = new QueryWrapper() + .eq("type", Menu.TYPE_MENU) + .eq("parent_id", catalog.getId()); + List menus = super.list(wrapper_menu); + if (menus == null || menus.isEmpty()) { + continue; + } + /*补全菜单下的按钮*/ + for (Menu menu : menus) { + QueryWrapper wrapper_button = new QueryWrapper() + .eq("type", Menu.TYPE_BUTTON) + .eq("parent_id", menu.getId()); + List buttons = super.list(wrapper_button); + if (buttons == null || buttons.isEmpty()) { + continue; + } + menu.setChildren(buttons); + } + catalog.setChildren(menus); + } + return page1; + } + + @Override + public List listParentByIds(List ids) { + List parentIds = new ArrayList<>(); + ArrayList btnIds = new ArrayList<>(); + QueryWrapper wrapper = new QueryWrapper().in("id", ids); + List list = super.list(wrapper); + if (list==null){ + return parentIds; + } + for (Menu menu : list) { + if (Menu.TYPE_MENU.equals(menu.getType())){ + //菜单 + parentIds.add(menu.getParentId()); + }else { + //按钮 + parentIds.add(menu.getParentId()); + btnIds.add(menu.getId()); + } + } + return parentIds; + } +} diff --git a/src/main/java/com/rabbiter/market/service/system/role/IRoleService.java b/src/main/java/com/rabbiter/market/service/system/role/IRoleService.java new file mode 100644 index 0000000..7db6c1b --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/system/role/IRoleService.java @@ -0,0 +1,60 @@ +package com.rabbiter.market.service.system.role; + +import com.rabbiter.market.domain.system.role.Role; +import com.rabbiter.market.qo.system.RoleQuery; +import com.rabbiter.market.vo.role.RolePermissonVo; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +public interface IRoleService extends IService { + /** + * 查询该员工id的角色信息 + * @param eid + * @return + */ + Set queryByEid(Long eid); + + /** + * 条件查询角色信息 + * @param qo + * @return + */ + List listByQo(RoleQuery qo); + + /** + * 停用角色业务 + * @param rid + */ + void forbiddenRole(Long rid); + + /** + * 保存角色信息业务 + * @param role + */ + void saveRole(Role role); + + /** + * 查看角色权限的业务 + * @param rid + * @return + */ + RolePermissonVo checkPermissons(Long rid); + + /** + * 保存角色-菜单的关系业务 + * @param rid + * @param menuIds + */ + void saveRolePermissons(Long rid, Long[] menuIds); + + List> getRoleAll(); + + List queryRoleIdsByEid(Long eid); + + void saveRoleEmp(Long eid, Long[] roleIds,String token); + + void clearEmpPermission(Long id); +} diff --git a/src/main/java/com/rabbiter/market/service/system/role/impl/RoleServiceImpl.java b/src/main/java/com/rabbiter/market/service/system/role/impl/RoleServiceImpl.java new file mode 100644 index 0000000..142fb9a --- /dev/null +++ b/src/main/java/com/rabbiter/market/service/system/role/impl/RoleServiceImpl.java @@ -0,0 +1,270 @@ +package com.rabbiter.market.service.system.role.impl; + +import com.rabbiter.market.common.exception.BusinessException; +import com.rabbiter.market.common.redis.service.RedisTemplateService; +import com.rabbiter.market.domain.personnel_management.employee.Employee; +import com.rabbiter.market.domain.system.menu.Menu; +import com.rabbiter.market.domain.system.role.Role; +import com.rabbiter.market.mapper.system.role.RoleMapper; +import com.rabbiter.market.qo.system.RoleQuery; +import com.rabbiter.market.service.personnel_management.employee.IEmployeeService; +import com.rabbiter.market.service.system.menu.IMenuService; +import com.rabbiter.market.service.system.role.IRoleService; +import com.rabbiter.market.vo.role.RolePermissonVo; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +import java.util.*; + +@Service +public class RoleServiceImpl extends ServiceImpl implements IRoleService { + @Autowired + private RoleMapper roleMapper; + @Autowired + private IMenuService menuService; + @Autowired + private RedisTemplateService redisTemplateService; + @Autowired + private IEmployeeService employeeService; + + @Override + public Set queryByEid(Long eid) { + Set roles = roleMapper.queryByEid(eid); + return roles; + } + + @Override + public List listByQo(RoleQuery qo) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.hasText(qo.getName()), "name", qo.getName()); + wrapper.eq(StringUtils.hasText(qo.getState()), "state", qo.getState()); + wrapper.ne("id",Role.SYS_ID); + wrapper.ne("id",2L); + List list = super.list(wrapper); + return list; + } + + @Override + public void forbiddenRole(Long rid) { + Role role = super.getById(rid); + if (Role.SYS_ID==role.getId() || 2L==role.getId()) { + throw new BusinessException("不能停用系统拥有者"); + } + UpdateWrapper wrapper = new UpdateWrapper() + .set("state", Role.STATE_BAN) + .eq("id", rid); + super.update(wrapper); + } + + @Override + public void saveRole(Role role) { + if (role == null) { + throw new BusinessException("操作失败"); + } + if (StringUtils.hasText(role.getName())) { + //查询是否保存过 + Role role1 = super.getOne(new QueryWrapper().eq("name", role.getName())); + if (role1 != null) { + throw new BusinessException("操作失败,角色名重复"); + } else { + role.setState(Role.STATE_NORMAL); + super.save(role); + } + } else { + throw new BusinessException("角色名称格式有误"); + } + + } + + @Transactional + @Override + public RolePermissonVo checkPermissons(Long rid) { + RolePermissonVo vo = new RolePermissonVo(); + /*角色所拥有的菜单id集合*/ + List menuIds = new ArrayList<>(); + /*所有的菜单信息*/ + List menus1 = new ArrayList<>(); + //步骤1:查询所有的菜单信息 + List menus = menuService.findAll(); + if (menus == null) { + throw new BusinessException("授权功能还待上线..."); + } + //封装菜单信息 + for (Menu menu : menus) { + RolePermissonVo.RoleMenu roleMenu_catalogs = vo.getRoleMenu(); + roleMenu_catalogs.setValue(menu.getId()); + roleMenu_catalogs.setLabel(menu.getLabel()); + /*目录下的菜单*/ + List children = new ArrayList<>(); + //目录 + if (menu.getChildren() != null) { + for (Menu child : menu.getChildren()) { + //菜单 + RolePermissonVo.RoleMenu roleMenu_menu = vo.getRoleMenu(); + roleMenu_menu.setValue(child.getId()); + roleMenu_menu.setLabel(child.getLabel()); + List children1 = new ArrayList<>(); + if (child.getChildren() != null) { + for (Menu childChild : child.getChildren()) { + //按钮 + RolePermissonVo.RoleMenu roleMenu_button = vo.getRoleMenu(); + roleMenu_button.setValue(childChild.getId()); + roleMenu_button.setLabel(childChild.getLabel()); + children1.add(roleMenu_button); + } + roleMenu_menu.setChildren(children1); + } + children.add(roleMenu_menu); + } + roleMenu_catalogs.setChildren(children); + } + menus1.add(roleMenu_catalogs); + } + vo.setMenus(menus1); + + //步骤2:是否是系统管理员 + if (rid == Role.SYS_ID) { + //系统管理员 + //封装角色拥有的菜单id集合 + for (Menu menu : menus) { + menuIds.add(menu.getId()); + //目录 + if (menu.getChildren() != null) { + for (Menu child : menu.getChildren()) { + //菜单 + menuIds.add(child.getId()); + if (child.getChildren() != null) { + for (Menu childChild : child.getChildren()) { + //按钮 + menuIds.add(childChild.getId()); + } + } + + } + } + + } + vo.setMenuIds(menuIds); + } else { + //非系统管理员 + menuIds = roleMapper.getMenuIdByRid(rid); + vo.setMenuIds(menuIds); + } + return vo; + } + + @Transactional + @Override + public void saveRolePermissons(Long rid, Long[] menuIds) { + //判断是否是系统管理员 + if (rid == Role.SYS_ID || rid==2L) { + //系统管理员 + throw new BusinessException("系统管理员的权限不可操作"); + } else { + //非系统管理员 + //重新建立关系 + if (menuIds == null || menuIds.length == 0) { + return; + } else { + List ids = new ArrayList<>(); + for (Long menuId : menuIds) { + ids.add(menuId); + } + + Set totalIds = new HashSet<>(); + QueryWrapper qoWrapper = new QueryWrapper().in("id", ids); + List list1 = menuService.list(qoWrapper); + for (Menu menu : list1) { + //按钮 + if (menu.getParentId()!=null && Menu.TYPE_BUTTON.equals(menu.getType())){ + totalIds.add(menu.getId()); + QueryWrapper btnWrapper = new QueryWrapper().eq("id", menu.getParentId()) + .eq("type",Menu.TYPE_MENU); + Menu menu1 = menuService.getOne(btnWrapper); + totalIds.add(menu1.getId()); + totalIds.add(menu1.getParentId()); + } else if (menu.getParentId()!=null && Menu.TYPE_MENU.equals(menu.getType())){ + //菜单 + totalIds.add(menu.getId()); + totalIds.add(menu.getParentId()); + }else if (menu.getParentId()==null && Menu.TYPE_CATALOGUE.equals(menu.getType())){ + //目录 + totalIds.add(menu.getId()); + } + } + //清除关系 + roleMapper.clearRecordsByRid(rid); + List> list = new ArrayList<>(); + for (Long id : totalIds) { + Map map = new HashMap<>(); + map.put("rid", rid); + map.put("mid", id); + list.add(map); + } + roleMapper.saveRolePermissons(list); + } + } + + } + + @Override + public List> getRoleAll() { + List> list = new ArrayList<>(); + QueryWrapper wrapper = new QueryWrapper().eq("state", Role.STATE_NORMAL).ne("id",Role.SYS_ID).ne("id",2L); + List roles = super.list(wrapper); + for (Role role : roles) { + Map map=new HashMap<>(); + map.put("id",role.getId()); + map.put("label",role.getName()); + list.add(map); + } + return list; + } + + @Override + public List queryRoleIdsByEid(Long eid) { + Employee emp = employeeService.getById(eid); + if (emp.getIsAdmin()){ + return roleMapper.queryRoleIdsAll(); + }else { + return roleMapper.queryRoleIdsByEid(eid); + } + } + + @Override + public void saveRoleEmp(Long eid, Long[] roleIds,String token) { + Employee emp = JSONObject.parseObject(redisTemplateService.getCacheObject(token), Employee.class); + if (emp.getId()==eid){ + throw new BusinessException("无法为自己赋予职务"); + } + //查询用户的信息,判断是否是系统管理员 + Employee employee = employeeService.getById(eid); + if (employee.getIsAdmin()){ + throw new BusinessException("无法操作系统管理员的职务"); + } + /*根据员工编号清除关系*/ + roleMapper.clearRelationByEid(eid); + /*重新保存关系*/ + List> list=new ArrayList<>(); + for (Long roleId : roleIds) { + Map map = new HashMap<>(); + map.put("eid",eid); + map.put("rid",roleId); + list.add(map); + } + if (list.size()>0){ + roleMapper.reSaveRelation(list); + } + } + + @Override + public void clearEmpPermission(Long id) { + roleMapper.clearRelationByEid(id); + } +} diff --git a/src/main/java/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsOutVo.java b/src/main/java/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsOutVo.java new file mode 100644 index 0000000..323c80f --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsOutVo.java @@ -0,0 +1,119 @@ +package com.rabbiter.market.vo.detail_store_goods; // 定义包路径,用于组织VO类 + +import com.fasterxml.jackson.annotation.JsonFormat; // Jackson库注解,用于JSON序列化/反序列化时的日期格式控制 +import org.springframework.format.annotation.DateTimeFormat; // Spring框架注解,用于接收前端传入的日期参数格式控制 +import java.io.Serializable; // Java序列化接口,标记该类的对象可以被序列化 +import java.util.Date; // Java日期时间类 + +public class DetailStoreGoodsOutVo implements Serializable { // 定义出库商品明细的视图对象(VO),实现Serializable接口使其可序列化 + private String cn; // 出库记录的唯一标识符(主键) + private Long goodsId; // 关联的商品ID + private Long goodsNum; // 出库商品数量 + private String goodsName; // 商品名称 + private Long createid; // 创建人ID + private String createby; // 创建人姓名 + @JsonFormat(pattern = "yyyy-MM-dd") // Jackson注解,指定JSON序列化时日期格式为"yyyy-MM-dd" + @DateTimeFormat(pattern ="yyyy-MM-dd" ) // Spring注解,指定前端传入日期格式为"yyyy-MM-dd" + private Date createTime; // 出库记录创建时间 + private String state; // 出库记录状态(如已完成/进行中等) + private String info; // 出库记录备注信息 + private Long storeId; // 关联的仓库ID + private String storeName; // 仓库名称 + private String state1; // 额外的状态字段(可能是业务状态) + + public String getCn() { // 获取出库记录ID的getter方法 + return cn; + } + + public void setCn(String cn) { // 设置出库记录ID的setter方法 + this.cn = cn; + } + + public Long getGoodsId() { // 获取商品ID的getter方法 + return goodsId; + } + + public void setGoodsId(Long goodsId) { // 设置商品ID的setter方法 + this.goodsId = goodsId; + } + + public Long getGoodsNum() { // 获取出库数量的getter方法 + return goodsNum; + } + + public void setGoodsNum(Long goodsNum) { // 设置出库数量的setter方法 + this.goodsNum = goodsNum; + } + + public String getGoodsName() { // 获取商品名称的getter方法 + return goodsName; + } + + public void setGoodsName(String goodsName) { // 设置商品名称的setter方法 + this.goodsName = goodsName; + } + + public Long getCreateid() { // 获取创建人ID的getter方法 + return createid; + } + + public void setCreateid(Long createid) { // 设置创建人ID的setter方法 + this.createid = createid; + } + + public String getCreateby() { // 获取创建人姓名的getter方法 + return createby; + } + + public void setCreateby(String createby) { // 设置创建人姓名的setter方法 + this.createby = createby; + } + + public Date getCreateTime() { // 获取创建时间的getter方法 + return createTime; + } + + public void setCreateTime(Date createTime) { // 设置创建时间的setter方法 + this.createTime = createTime; + } + + public String getState() { // 获取出库状态的getter方法 + return state; + } + + public void setState(String state) { // 设置出库状态的setter方法 + this.state = state; + } + + public String getInfo() { // 获取备注信息的getter方法 + return info; + } + + public void setInfo(String info) { // 设置备注信息的setter方法 + this.info = info; + } + + public Long getStoreId() { // 获取仓库ID的getter方法 + return storeId; + } + + public void setStoreId(Long storeId) { // 设置仓库ID的setter方法 + this.storeId = storeId; + } + + public String getStoreName() { // 获取仓库名称的getter方法 + return storeName; + } + + public void setStoreName(String storeName) { // 设置仓库名称的setter方法 + this.storeName = storeName; + } + + public String getState1() { // 获取额外状态字段的getter方法 + return state1; + } + + public void setState1(String state1) { // 设置额外状态字段的setter方法 + this.state1 = state1; + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsVo.java b/src/main/java/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsVo.java new file mode 100644 index 0000000..ee59a7e --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsVo.java @@ -0,0 +1,168 @@ +package com.rabbiter.market.vo.detail_store_goods; // 定义包路径,用于组织商品库存相关的视图对象(VO)类 + +import com.fasterxml.jackson.annotation.JsonFormat; // Jackson库注解,用于JSON序列化/反序列化时的日期格式控制 +import org.springframework.format.annotation.DateTimeFormat; // Spring框架注解,用于接收前端传入的日期参数格式控制 +import java.io.Serializable; // Java序列化接口,标记该类的对象可以被序列化 +import java.util.Date; // Java日期时间类 + +public class DetailStoreGoodsVo implements Serializable { // 定义商品库存明细视图对象(VO),实现Serializable接口使其可序列化 + private String cn; // 商品库存记录的唯一标识符(主键) + private Long goodsId; // 关联的商品ID + private Long goodsNum; // 商品数量 + private String goodsName; // 商品名称 + private Double goodsPrice; // 商品单价 + private String info; // 商品备注信息 + private Long createid; // 创建人ID + private String createby; // 创建人姓名 + @JsonFormat(pattern = "yyyy-MM-dd") // Jackson注解,指定JSON序列化时日期格式为"yyyy-MM-dd" + @DateTimeFormat(pattern ="yyyy-MM-dd" ) // Spring注解,指定前端传入日期格式为"yyyy-MM-dd" + private Date createTime; // 商品入库时间 + @JsonFormat(pattern = "yyyy-MM-dd") // Jackson注解,指定JSON序列化时日期格式为"yyyy-MM-dd" + @DateTimeFormat(pattern ="yyyy-MM-dd" ) // Spring注解,指定前端传入日期格式为"yyyy-MM-dd" + private Date expiryTime; // 商品过期时间 + @JsonFormat(pattern = "yyyy-MM-dd") // Jackson注解,指定JSON序列化时日期格式为"yyyy-MM-dd" + @DateTimeFormat(pattern ="yyyy-MM-dd" ) // Spring注解,指定前端传入日期格式为"yyyy-MM-dd" + private Date birthTime; // 商品生产日期(适用于食品等有保质期的商品) + private String state1; // 额外的状态字段(可能是业务状态) + private Long storeId; // 关联的仓库ID + private String storeName; // 仓库名称 + private String state; // 商品库存状态(如正常/已出库等) + private Long supplierId; // 关联的供应商ID + private String supplierName; // 供应商名称 + + public String getCn() { // 获取商品库存记录ID的getter方法 + return cn; + } + + public void setCn(String cn) { // 设置商品库存记录ID的setter方法 + this.cn = cn; + } + + public Long getGoodsId() { // 获取商品ID的getter方法 + return goodsId; + } + + public void setGoodsId(Long goodsId) { // 设置商品ID的setter方法 + this.goodsId = goodsId; + } + + public Long getGoodsNum() { // 获取商品数量的getter方法 + return goodsNum; + } + + public void setGoodsNum(Long goodsNum) { // 设置商品数量的setter方法 + this.goodsNum = goodsNum; + } + + public String getGoodsName() { // 获取商品名称的getter方法 + return goodsName; + } + + public void setGoodsName(String goodsName) { // 设置商品名称的setter方法 + this.goodsName = goodsName; + } + + public Double getGoodsPrice() { // 获取商品单价的getter方法 + return goodsPrice; + } + + public void setGoodsPrice(Double goodsPrice) { // 设置商品单价的setter方法 + this.goodsPrice = goodsPrice; + } + + public String getInfo() { // 获取商品备注信息的getter方法 + return info; + } + + public void setInfo(String info) { // 设置商品备注信息的setter方法 + this.info = info; + } + + public Long getCreateid() { // 获取创建人ID的getter方法 + return createid; + } + + public void setCreateid(Long createid) { // 设置创建人ID的setter方法 + this.createid = createid; + } + + public String getCreateby() { // 获取创建人姓名的getter方法 + return createby; + } + + public void setCreateby(String createby) { // 设置创建人姓名的setter方法 + this.createby = createby; + } + + public Date getCreateTime() { // 获取商品入库时间的getter方法 + return createTime; + } + + public void setCreateTime(Date createTime) { // 设置商品入库时间的setter方法 + this.createTime = createTime; + } + + public Date getExpiryTime() { // 获取商品过期时间的getter方法 + return expiryTime; + } + + public void setExpiryTime(Date expiryTime) { // 设置商品过期时间的setter方法 + this.expiryTime = expiryTime; + } + + public Date getBirthTime() { // 获取商品生产日期的getter方法 + return birthTime; + } + + public void setBirthTime(Date birthTime) { // 设置商品生产日期的setter方法 + this.birthTime = birthTime; + } + + public String getState1() { // 获取额外状态字段的getter方法 + return state1; + } + + public void setState1(String state1) { // 设置额外状态字段的setter方法 + this.state1 = state1; + } + + public Long getStoreId() { // 获取仓库ID的getter方法 + return storeId; + } + + public void setStoreId(Long storeId) { // 设置仓库ID的setter方法 + this.storeId = storeId; + } + + public String getStoreName() { // 获取仓库名称的getter方法 + return storeName; + } + + public void setStoreName(String storeName) { // 设置仓库名称的setter方法 + this.storeName = storeName; + } + + public String getState() { // 获取商品库存状态的getter方法 + return state; + } + + public void setState(String state) { // 设置商品库存状态的setter方法 + this.state = state; + } + + public Long getSupplierId() { // 获取供应商ID的getter方法 + return supplierId; + } + + public void setSupplierId(Long supplierId) { // 设置供应商ID的setter方法 + this.supplierId = supplierId; + } + + public String getSupplierName() { // 获取供应商名称的getter方法 + return supplierName; + } + + public void setSupplierName(String supplierName) { // 设置供应商名称的setter方法 + this.supplierName = supplierName; + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/vo/detail_store_goods/notice/NoticeInNotNormalVo.java b/src/main/java/com/rabbiter/market/vo/detail_store_goods/notice/NoticeInNotNormalVo.java new file mode 100644 index 0000000..05925da --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/detail_store_goods/notice/NoticeInNotNormalVo.java @@ -0,0 +1,92 @@ +package com.rabbiter.market.vo.detail_store_goods.notice; + +import com.fasterxml.jackson.annotation.JsonFormat; // Jackson库的日期格式化注解,用于JSON序列化和反序列化时的日期格式控制 +import org.springframework.format.annotation.DateTimeFormat; // Spring框架的日期格式化注解,用于接收前端传入的日期参数 +import java.io.Serializable; // Java序列化接口,标记该类的对象可以被序列化 +import java.util.Date; // Java日期时间类 + +public class NoticeInNotNormalVo implements Serializable { // 定义一个可序列化的通知VO类,用于非正常状态下的商品通知信息 + private String cn; // 通知的唯一标识符(主键) + private String coverUrl; // 商品封面图片的URL地址 + private Long goodsId; // 关联的商品ID + private Long untreatedNum; // 未处理的消息数量 + private String goodsName; // 商品名称 + private String state; // 通知的状态(如已读/未读等) + private Long storeId; // 关联的仓库ID + private String storeName; // 仓库名称 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // Spring注解,指定前端传入日期的格式 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") // Jackson注解,指定JSON序列化/反序列化的日期格式 + private Date createTime; // 通知创建时间 + + public String getCn() { // 获取通知ID的getter方法 + return cn; + } + + public void setCn(String cn) { // 设置通知ID的setter方法 + this.cn = cn; + } + + public String getCoverUrl() { // 获取商品封面URL的getter方法 + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { // 设置商品封面URL的setter方法 + this.coverUrl = coverUrl; + } + + public Long getGoodsId() { // 获取商品ID的getter方法 + return goodsId; + } + + public void setGoodsId(Long goodsId) { // 设置商品ID的setter方法 + this.goodsId = goodsId; + } + + public Long getUntreatedNum() { // 获取未处理消息数量的getter方法 + return untreatedNum; + } + + public void setUntreatedNum(Long untreatedNum) { // 设置未处理消息数量的setter方法 + this.untreatedNum = untreatedNum; + } + + public String getGoodsName() { // 获取商品名称的getter方法 + return goodsName; + } + + public void setGoodsName(String goodsName) { // 设置商品名称的setter方法 + this.goodsName = goodsName; + } + + public String getState() { // 获取通知状态的getter方法 + return state; + } + + public void setState(String state) { // 设置通知状态的setter方法 + this.state = state; + } + + public Long getStoreId() { // 获取仓库ID的getter方法 + return storeId; + } + + public void setStoreId(Long storeId) { // 设置仓库ID的setter方法 + this.storeId = storeId; + } + + public String getStoreName() { // 获取仓库名称的getter方法 + return storeName; + } + + public void setStoreName(String storeName) { // 设置仓库名称的setter方法 + this.storeName = storeName; + } + + public Date getCreateTime() { // 获取通知创建时间的getter方法 + return createTime; + } + + public void setCreateTime(Date createTime) { // 设置通知创建时间的setter方法 + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/rabbiter/market/vo/employee/DetailEmpVo.java b/src/main/java/com/rabbiter/market/vo/employee/DetailEmpVo.java new file mode 100644 index 0000000..6170342 --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/employee/DetailEmpVo.java @@ -0,0 +1,184 @@ +package com.rabbiter.market.vo.employee; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.Set; + +public class DetailEmpVo implements Serializable { + private Long id; + private String sex; + private Boolean isAdmin; + private String username; + private String nickName; + private String password; + private String headImg; + private String state; + private String info; + private String createby; + private String idCard; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date leaveTime; + private String address; + private String email; + private Integer age; + private Long deptId; + private String deptName; + //角色集合 + private Set roleNames; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Boolean getAdmin() { + return isAdmin; + } + + public void setAdmin(Boolean admin) { + isAdmin = admin; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getHeadImg() { + return headImg; + } + + public void setHeadImg(String headImg) { + this.headImg = headImg; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getCreateby() { + return createby; + } + + public void setCreateby(String createby) { + this.createby = createby; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getLeaveTime() { + return leaveTime; + } + + public void setLeaveTime(Date leaveTime) { + this.leaveTime = leaveTime; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public Set getRoleNames() { + return roleNames; + } + + public void setRoleNames(Set roleNames) { + this.roleNames = roleNames; + } +} diff --git a/src/main/java/com/rabbiter/market/vo/employee/EditEmpVo.java b/src/main/java/com/rabbiter/market/vo/employee/EditEmpVo.java new file mode 100644 index 0000000..627875e --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/employee/EditEmpVo.java @@ -0,0 +1,122 @@ +package com.rabbiter.market.vo.employee; + +import java.io.Serializable; +public class EditEmpVo implements Serializable { + private Long id; + private String idCard; + private String username; + private String address; + private String sex; + private Integer age; + private String nickName; + private String headImg; + private String state; + private String info; + private Long deptId; + private String deptName; + private Boolean isAdmin; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getHeadImg() { + return headImg; + } + + public void setHeadImg(String headImg) { + this.headImg = headImg; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public Boolean getAdmin() { + return isAdmin; + } + + public void setAdmin(Boolean admin) { + isAdmin = admin; + } +} diff --git a/src/main/java/com/rabbiter/market/vo/employee/InformationVo.java b/src/main/java/com/rabbiter/market/vo/employee/InformationVo.java new file mode 100644 index 0000000..2182ace --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/employee/InformationVo.java @@ -0,0 +1,114 @@ +package com.rabbiter.market.vo.employee; + +import java.io.Serializable; + +public class InformationVo implements Serializable { + private Long id; + private String sex; + private String username; + private String nickName; + private String headImg; + private String info; + private String address; + private String email; + private Integer age; + private Long deptId; + private String idCard; + private String deptName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getHeadImg() { + return headImg; + } + + public void setHeadImg(String headImg) { + this.headImg = headImg; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } +} diff --git a/src/main/java/com/rabbiter/market/vo/goods/GoodsListVo.java b/src/main/java/com/rabbiter/market/vo/goods/GoodsListVo.java new file mode 100644 index 0000000..fcd851b --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/goods/GoodsListVo.java @@ -0,0 +1,139 @@ +package com.rabbiter.market.vo.goods; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; + +public class GoodsListVo implements Serializable { + + /*商品编码*/ + private Long id; + /*商品封面*/ + private String coverUrl; + /*商品名称*/ + private String name; + /*售价*/ + private Double sellPrice; + /*批发价*/ + private Double purchashPrice; + /*商品数量*/ + private Long residueNum; + /*可用库存*/ + private Long residueStoreNum; + /*商品类型*/ + private Long categoryId; + private String categoryName; + /*状态,下架、上架*/ + private String state; + /*操作者*/ + private String updateby; + private String info; + /*操作时间*/ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date updateTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCoverUrl() { + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { + this.coverUrl = coverUrl; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getSellPrice() { + return sellPrice; + } + + public void setSellPrice(Double sellPrice) { + this.sellPrice = sellPrice; + } + + public Double getPurchashPrice() { + return purchashPrice; + } + + public void setPurchashPrice(Double purchashPrice) { + this.purchashPrice = purchashPrice; + } + + public Long getResidueNum() { + return residueNum; + } + + public void setResidueNum(Long residueNum) { + this.residueNum = residueNum; + } + + public Long getResidueStoreNum() { + return residueStoreNum; + } + + public void setResidueStoreNum(Long residueStoreNum) { + this.residueStoreNum = residueStoreNum; + } + + public Long getCategoryId() { + return categoryId; + } + + public void setCategoryId(Long categoryId) { + this.categoryId = categoryId; + } + + public String getCategoryName() { + return categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getUpdateby() { + return updateby; + } + + public void setUpdateby(String updateby) { + this.updateby = updateby; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} diff --git a/src/main/java/com/rabbiter/market/vo/goods_management/goods_store/GoodsStoreVo.java b/src/main/java/com/rabbiter/market/vo/goods_management/goods_store/GoodsStoreVo.java new file mode 100644 index 0000000..9be6413 --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/goods_management/goods_store/GoodsStoreVo.java @@ -0,0 +1,51 @@ +package com.rabbiter.market.vo.goods_management.goods_store; + +import java.io.Serializable; + +public class GoodsStoreVo implements Serializable { + private Long id; + private String name; //商品名 + private String coverUrl; //商品封面 + private Long inventory;//需库存量 + private Long shelves;//货架商品数量 + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCoverUrl() { + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { + this.coverUrl = coverUrl; + } + + public Long getInventory() { + return inventory; + } + + public void setInventory(Long inventory) { + this.inventory = inventory; + } + + public Long getShelves() { + return shelves; + } + + public void setShelves(Long shelves) { + this.shelves = shelves; + } +} diff --git a/src/main/java/com/rabbiter/market/vo/role/RolePermissonVo.java b/src/main/java/com/rabbiter/market/vo/role/RolePermissonVo.java new file mode 100644 index 0000000..459600d --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/role/RolePermissonVo.java @@ -0,0 +1,71 @@ +package com.rabbiter.market.vo.role; + +import com.fasterxml.jackson.annotation.JsonIgnoreType; + +import java.io.Serializable; +import java.util.List; + +public class RolePermissonVo implements Serializable { + private List menuIds; + private List menus; + + /** + * 获取成员内部类的实例 + * + * @return + */ + public RoleMenu getRoleMenu() { + return new RoleMenu(); + } + + public List getMenuIds() { + return menuIds; + } + + public void setMenuIds(List menuIds) { + this.menuIds = menuIds; + } + + public List getMenus() { + return menus; + } + + public void setMenus(List menus) { + this.menus = menus; + } + + /** + * 成员内部类,供这个类使用 + */ + @JsonIgnoreType + public class RoleMenu { + private Long value; + private String label; + private List children; + + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + } + +} diff --git a/src/main/java/com/rabbiter/market/vo/statistics/sale_management/SaleGoodsVo.java b/src/main/java/com/rabbiter/market/vo/statistics/sale_management/SaleGoodsVo.java new file mode 100644 index 0000000..7b6c3a7 --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/statistics/sale_management/SaleGoodsVo.java @@ -0,0 +1,63 @@ +package com.rabbiter.market.vo.statistics.sale_management; + +import java.io.Serializable; + +/** + * 单个商品销售信息 + */ +public class SaleGoodsVo implements Serializable { + private Long goodsId; + private String goodsName; + private String coverUrl; + private Long salesVolume;//销量 + private Long percentage=0L; + public void setPercentage(Long total) { + if (total==null || total==0){ + this.percentage=0L; + }else { + if (this.salesVolume==null){ + this.salesVolume=0L; + } + String num=((this.salesVolume*100.0)/total)+""; + Long num1=Long.valueOf(num.split("\\.")[0]); + this.percentage =num1; + } + + } + + public Long getGoodsId() { + return goodsId; + } + + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getCoverUrl() { + return coverUrl; + } + + public void setCoverUrl(String coverUrl) { + this.coverUrl = coverUrl; + } + + public Long getSalesVolume() { + return salesVolume; + } + + public void setSalesVolume(Long salesVolume) { + this.salesVolume = salesVolume; + } + + public Long getPercentage() { + return percentage; + } +} diff --git a/src/main/java/com/rabbiter/market/vo/statistics/sale_management/SalesStatisticsVo.java b/src/main/java/com/rabbiter/market/vo/statistics/sale_management/SalesStatisticsVo.java new file mode 100644 index 0000000..380350e --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/statistics/sale_management/SalesStatisticsVo.java @@ -0,0 +1,29 @@ +package com.rabbiter.market.vo.statistics.sale_management; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import java.io.Serializable; + +/** + * 商品销售量统计 + */ +public class SalesStatisticsVo implements Serializable { + private Long total; //所有商品总售卖量 + private Page vos; + + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public Page getVos() { + return vos; + } + + public void setVos(Page vos) { + this.vos = vos; + } +} diff --git a/src/main/java/com/rabbiter/market/vo/statistics/storage_situation/DetailStorageSituationVo.java b/src/main/java/com/rabbiter/market/vo/statistics/storage_situation/DetailStorageSituationVo.java new file mode 100644 index 0000000..f205430 --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/statistics/storage_situation/DetailStorageSituationVo.java @@ -0,0 +1,51 @@ +package com.rabbiter.market.vo.statistics.storage_situation; + +import java.io.Serializable; + +/** + * 仓库存储情况 + */ +public class DetailStorageSituationVo implements Serializable { + private Long goodsId; + private String goodsName; + private Long residueNum; //商品数量 + private Long percentage=0L; + public void setPercentage(Long total) { + if (total==null ||total==0){ + this.percentage=0L; + }else { + String num=((this.residueNum*100.0)/total)+""; + Long num1=Long.valueOf(num.split("\\.")[0]); + this.percentage =num1; + } + + } + + public Long getGoodsId() { + return goodsId; + } + + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public Long getResidueNum() { + return residueNum; + } + + public void setResidueNum(Long residueNum) { + this.residueNum = residueNum; + } + + public Long getPercentage() { + return percentage; + } +} diff --git a/src/main/java/com/rabbiter/market/vo/statistics/storage_situation/StorageSituationVo.java b/src/main/java/com/rabbiter/market/vo/statistics/storage_situation/StorageSituationVo.java new file mode 100644 index 0000000..1209068 --- /dev/null +++ b/src/main/java/com/rabbiter/market/vo/statistics/storage_situation/StorageSituationVo.java @@ -0,0 +1,36 @@ +package com.rabbiter.market.vo.statistics.storage_situation; + +import java.io.Serializable; + +/** + * 仓库存储情况 + */ +public class StorageSituationVo implements Serializable { + private Long storeId; + private String storeName; + private Long residueNum; //该仓库存储商品数量 + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Long getResidueNum() { + return residueNum; + } + + public void setResidueNum(Long residueNum) { + this.residueNum = residueNum; + } +} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml new file mode 100644 index 0000000..d4fa9c6 --- /dev/null +++ b/src/main/resources/application.yaml @@ -0,0 +1,30 @@ +server: + port: 9291 +spring: + application: + name: market-server + datasource: + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + password: 123456 + username: root + url: jdbc:mysql://localhost:3306/supermarket_manager?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&allowPublicKeyRetrieval=true + redis: + host: localhost + port: 6379 + password: + mvc: + async: + request-timeout: 20000 + jackson: + time-zone: GMT+8 + servlet: + multipart: + max-file-size: 1GB + max-request-size: 1GB +mybatis-plus: + mapper-locations: classpath:com/rabbiter/market/mapper/*Mapper.xml +logging: + level: + cn.dingli.market.mapper: debug + diff --git a/src/main/resources/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.xml b/src/main/resources/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.xml new file mode 100644 index 0000000..917670f --- /dev/null +++ b/src/main/resources/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.xml @@ -0,0 +1,53 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.xml b/src/main/resources/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.xml new file mode 100644 index 0000000..b2c073f --- /dev/null +++ b/src/main/resources/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.xml @@ -0,0 +1,22 @@ + + + + + update t_goods_store set residue_num=residue_num+#{goodsNum},in_num=in_num+#{goodsNum} where goods_id=#{goodsId} and store_id=#{storeId} + + + update t_goods_store set residue_num=residue_num-#{goodsNum} where goods_id=#{goodsId} and store_id=#{storeId} + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/rabbiter/market/mapper/system/menu/MenuMapper.xml b/src/main/resources/com/rabbiter/market/mapper/system/menu/MenuMapper.xml new file mode 100644 index 0000000..4fcaa6b --- /dev/null +++ b/src/main/resources/com/rabbiter/market/mapper/system/menu/MenuMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/rabbiter/market/mapper/system/role/RoleMapper.xml b/src/main/resources/com/rabbiter/market/mapper/system/role/RoleMapper.xml new file mode 100644 index 0000000..e61fe90 --- /dev/null +++ b/src/main/resources/com/rabbiter/market/mapper/system/role/RoleMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + insert into t_role_menu (rid,mid) values + + (#{item.rid},#{item.mid}) + + + + insert into t_emp_role (eid,rid) values + + (#{item.eid},#{item.rid}) + + + + delete from t_role_menu where rid=#{rid} + + + delete from t_emp_role where eid=#{eid} + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/files/1694324278293_file.jpg b/src/main/resources/static/files/1694324278293_file.jpg new file mode 100644 index 0000000..a00a5ba Binary files /dev/null and b/src/main/resources/static/files/1694324278293_file.jpg differ diff --git a/src/main/resources/static/files/1694434162457_07.jpg b/src/main/resources/static/files/1694434162457_07.jpg new file mode 100644 index 0000000..985d64e Binary files /dev/null and b/src/main/resources/static/files/1694434162457_07.jpg differ diff --git a/src/main/resources/static/files/1694434783850_04.jpg b/src/main/resources/static/files/1694434783850_04.jpg new file mode 100644 index 0000000..17b4bf5 Binary files /dev/null and b/src/main/resources/static/files/1694434783850_04.jpg differ diff --git a/src/main/resources/static/files/1694434840737_05.jpg b/src/main/resources/static/files/1694434840737_05.jpg new file mode 100644 index 0000000..9ff2682 Binary files /dev/null and b/src/main/resources/static/files/1694434840737_05.jpg differ diff --git a/src/main/resources/static/files/1694434883855_03.jpg b/src/main/resources/static/files/1694434883855_03.jpg new file mode 100644 index 0000000..69fffd4 Binary files /dev/null and b/src/main/resources/static/files/1694434883855_03.jpg differ diff --git a/src/main/resources/static/files/1694434945440_02.jpg b/src/main/resources/static/files/1694434945440_02.jpg new file mode 100644 index 0000000..55ae8cb Binary files /dev/null and b/src/main/resources/static/files/1694434945440_02.jpg differ diff --git a/src/main/resources/static/files/1694435421618_e04f06dc02b84d38bc4d1ba2b39add0d.jpg b/src/main/resources/static/files/1694435421618_e04f06dc02b84d38bc4d1ba2b39add0d.jpg new file mode 100644 index 0000000..40ec0d0 Binary files /dev/null and b/src/main/resources/static/files/1694435421618_e04f06dc02b84d38bc4d1ba2b39add0d.jpg differ diff --git a/supermarket_manager.sql b/supermarket_manager.sql new file mode 100644 index 0000000..04a6ca0 --- /dev/null +++ b/supermarket_manager.sql @@ -0,0 +1,520 @@ +/* + Navicat Premium Data Transfer + + Source Server : localhost + Source Server Type : MySQL + Source Server Version : 80019 + Source Host : localhost:3306 + Source Schema : supermarket_manager + + Target Server Type : MySQL + Target Server Version : 80019 + File Encoding : 65001 + + Date: 11/09/2023 21:12:17 +*/ + +SET NAMES utf8; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for department +-- ---------------------------- +DROP TABLE IF EXISTS `department`; +CREATE TABLE `department` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '部门名称', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述', + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of department +-- ---------------------------- +INSERT INTO `department` VALUES (8, '销售部', '销售部门', '0'); + +-- ---------------------------- +-- Table structure for detail_sale_records +-- ---------------------------- +DROP TABLE IF EXISTS `detail_sale_records`; +CREATE TABLE `detail_sale_records` ( + `sell_cn` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '销售订单号', + `goods_id` bigint(0) NOT NULL COMMENT '商品编号', + `goods_num` bigint(0) NOT NULL COMMENT '商品数量', + `goods_price` double(10, 2) NOT NULL COMMENT '销售单价', + `goods_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '商品名' +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of detail_sale_records +-- ---------------------------- +INSERT INTO `detail_sale_records` VALUES ('1701213155180429314', 7, 1, 120.00, '运动鞋'); +INSERT INTO `detail_sale_records` VALUES ('1701220094014722049', 9, 1, 350.00, '桌椅套装'); + +-- ---------------------------- +-- Table structure for employee +-- ---------------------------- +DROP TABLE IF EXISTS `employee`; +CREATE TABLE `employee` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', + `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '用户名', + `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '邮箱', + `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '住址', + `sex` char(1) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '性别', + `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '密码', + `nick_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '昵称', + `head_img` longtext CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT '头像', + `state` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '状态 0:在职 1:离职', + `isAdmin` bit(1) NULL DEFAULT NULL COMMENT '是否是超管 1:是 0不是', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述', + `createby` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `age` int(0) NULL DEFAULT NULL COMMENT '年龄', + `deptId` bigint(0) NULL DEFAULT NULL COMMENT '部门主键', + `id_card` varchar(18) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '身份证号', + `leave_time` datetime NULL DEFAULT NULL COMMENT '离职时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of employee +-- ---------------------------- +INSERT INTO `employee` VALUES (1, '13333333333', '123@qq.com', '北京市海淀区', '0', '123456', '张三', '/files/1694324278293_file.jpg', '0', b'1', '系统管理员', 'admin', '2023-05-24 15:52:48', 999, NULL, '411111199905089999', NULL); +INSERT INTO `employee` VALUES (15, '14788888888', NULL, '北京市海淀区', '1', '123456', '李四', '/files/1694434162457_07.jpg', '0', b'0', '销售人员', '张三', '2023-09-11 12:10:04', 18, 8, '411111199501019999', NULL); +INSERT INTO `employee` VALUES (16, '15455555555', NULL, NULL, '1', '123456', '叶子', '/files/1694434162457_07.jpg', '0', b'0', '仓库管理员', '张三', '2023-09-11 13:06:52', 18, 8, '511111199501015555', NULL); + +-- ---------------------------- +-- Table structure for exchange_point_products_records +-- ---------------------------- +DROP TABLE IF EXISTS `exchange_point_products_records`; +CREATE TABLE `exchange_point_products_records` ( + `cn` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '订单号', + `goods_id` bigint(0) NULL DEFAULT NULL COMMENT '商品编号', + `member_id` bigint(0) NULL DEFAULT NULL COMMENT '会员编号', + `integral` bigint(0) NULL DEFAULT NULL COMMENT '积分', + `update_time` datetime NULL DEFAULT NULL COMMENT '最近操作时间', + `updateby` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '操作者', + `update_id` bigint(0) NULL DEFAULT NULL COMMENT '操作者编号', + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`cn`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of exchange_point_products_records +-- ---------------------------- +INSERT INTO `exchange_point_products_records` VALUES ('1701220420541288450', 10, 5, 60, '2023-09-11 13:05:30', '张三', 1, '0'); + +-- ---------------------------- +-- Table structure for goods +-- ---------------------------- +DROP TABLE IF EXISTS `goods`; +CREATE TABLE `goods` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '商品名', + `createby` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `category_id` bigint(0) NULL DEFAULT NULL COMMENT '商品分类id', + `sell_price` double(10, 2) NULL DEFAULT NULL COMMENT '销售价格', + `purchash_price` double(10, 2) NULL DEFAULT NULL COMMENT '进货价格', + `update_time` datetime NULL DEFAULT NULL COMMENT '更改时间', + `updateby` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '更改者', + `category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_czech_ci NULL DEFAULT NULL COMMENT '分类名', + `cover_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '商品封面', + `state` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态', + `residue_num` bigint(0) NULL DEFAULT NULL COMMENT '剩余数量', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '备注', + `sales_volume` bigint(0) NULL DEFAULT NULL COMMENT '销量', + `inventory` bigint(0) NULL DEFAULT NULL COMMENT '需库存量', + `shelves` bigint(0) NULL DEFAULT NULL COMMENT '货架上需摆放的数量', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of goods +-- ---------------------------- +INSERT INTO `goods` VALUES (7, '运动鞋', '张三', '2023-09-11 12:20:02', 9, 150.00, 120.00, '2023-09-11 12:20:02', '张三', '服装', '/files/1694434783850_04.jpg', '0', 19, '适合打球跑步的运动鞋', 1, 100, 10); +INSERT INTO `goods` VALUES (8, '《PASLMS》英文版', '张三', '2023-09-11 12:21:11', 11, 55.00, 50.00, '2023-09-11 12:21:11', '张三', '书籍', '/files/1694434840737_05.jpg', '0', 60, '著名书籍《PASLMS》英文版', NULL, 200, 50); +INSERT INTO `goods` VALUES (9, '桌椅套装', '张三', '2023-09-11 12:21:43', 13, 400.00, 350.00, '2023-09-11 12:22:00', '张三', '办公用具', '/files/1694434883855_03.jpg', '0', 9, '桌子加椅子', 1, 300, 20); +INSERT INTO `goods` VALUES (10, '短袖', '张三', '2023-09-11 12:22:50', 9, 60.00, 40.00, '2023-09-11 12:22:50', '张三', '服装', '/files/1694434945440_02.jpg', '0', 60, '夏季短袖', NULL, NULL, NULL); +INSERT INTO `goods` VALUES (11, '变形金刚玩具套装', '张三', '2023-09-11 12:30:45', 13, 165.00, 140.00, '2023-09-11 12:30:45', '张三', '办公用具', '/files/1694435421618_e04f06dc02b84d38bc4d1ba2b39add0d.jpg', '0', 20, '变形金刚玩具套装', NULL, NULL, NULL); + +-- ---------------------------- +-- Table structure for goods_category +-- ---------------------------- +DROP TABLE IF EXISTS `goods_category`; +CREATE TABLE `goods_category` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '分类名', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '备注', + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of goods_category +-- ---------------------------- +INSERT INTO `goods_category` VALUES (9, '服装', '衣服鞋袜', '0'); +INSERT INTO `goods_category` VALUES (10, '零食', '饭后零食', '0'); +INSERT INTO `goods_category` VALUES (11, '书籍', NULL, '0'); +INSERT INTO `goods_category` VALUES (12, '饮料酒水', '饮料酒水类别', '0'); +INSERT INTO `goods_category` VALUES (13, '办公用具', '办公用具', '0'); + +-- ---------------------------- +-- Table structure for point_products +-- ---------------------------- +DROP TABLE IF EXISTS `point_products`; +CREATE TABLE `point_products` ( + `goods_id` bigint(0) NULL DEFAULT NULL, + `goods_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, + `integral` bigint(0) NULL DEFAULT NULL, + `updateby` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, + `update_time` datetime NULL DEFAULT NULL, + `update_id` bigint(0) NULL DEFAULT NULL, + `cover_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of point_products +-- ---------------------------- +INSERT INTO `point_products` VALUES (11, '变形金刚玩具套装', 50, '张三', '2023-09-11 12:59:48', 1, '/files/1694435421618_e04f06dc02b84d38bc4d1ba2b39add0d.jpg', '0'); +INSERT INTO `point_products` VALUES (10, '短袖', 60, '张三', '2023-09-11 12:59:57', 1, '/files/1694434945440_02.jpg', '0'); + +-- ---------------------------- +-- Table structure for store +-- ---------------------------- +DROP TABLE IF EXISTS `store`; +CREATE TABLE `store` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '仓库名称', + `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '仓库地址', + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '状态', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of store +-- ---------------------------- +INSERT INTO `store` VALUES (5, '一号仓库', '北京市海淀区', '0', '超市一号仓库'); + +-- ---------------------------- +-- Table structure for supplier +-- ---------------------------- +DROP TABLE IF EXISTS `supplier`; +CREATE TABLE `supplier` ( + `cn` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '编号', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '名称', + `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '地址', + `tel` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '联系电话', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '备注', + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, + PRIMARY KEY (`cn`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of supplier +-- ---------------------------- +INSERT INTO `supplier` VALUES (7, '阿里巴巴', '浙江省杭州市', '19955555555', '1688商家供货商', '0'); + +-- ---------------------------- +-- Table structure for t_detail_store_goods +-- ---------------------------- +DROP TABLE IF EXISTS `t_detail_store_goods`; +CREATE TABLE `t_detail_store_goods` ( + `cn` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `goods_id` bigint(0) NOT NULL, + `goods_num` int(0) NULL DEFAULT NULL, + `goods_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `goods_price` double NULL DEFAULT NULL COMMENT '0:入库 1:出库', + `type` char(2) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `createid` bigint(0) NOT NULL, + `create_time` datetime NOT NULL, + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '0:正常 1:过期 2:下架', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, + `expiry_time` datetime NULL DEFAULT NULL COMMENT '过期时间', + `createby` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, + `birth_time` datetime NULL DEFAULT NULL COMMENT '生产时间', + `state1` char(2) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '0:正常 1:删除 2:待处理', + `store_id` bigint(0) NULL DEFAULT NULL, + `supplier_id` bigint(0) NULL DEFAULT NULL COMMENT '供货商编号', + `supplier_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '供货商名称', + `untreated_num` bigint(0) NULL DEFAULT NULL COMMENT '待处理数量', + PRIMARY KEY (`cn`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of t_detail_store_goods +-- ---------------------------- +INSERT INTO `t_detail_store_goods` VALUES ('1701212006578667522', 7, 200, '运动鞋', 120, '0', 1, '2023-09-11 12:32:04', '0', '运动鞋入库', '2029-06-25 16:00:00', '张三', '2023-09-10 16:00:00', '0', 5, 7, '阿里巴巴', NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701212043736006658', 8, 200, '《PASLMS》英文版', 50, '0', 1, '2023-09-11 12:32:13', '0', '', '2029-06-25 16:00:00', '张三', '2023-09-10 16:00:00', '0', 5, 7, '阿里巴巴', NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701212067161194498', 9, 200, '桌椅套装', 350, '0', 1, '2023-09-11 12:32:18', '0', '', '2029-06-25 16:00:00', '张三', '2023-09-10 16:00:00', '0', 5, 7, '阿里巴巴', NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701212086803120129', 10, 200, '短袖', 40, '0', 1, '2023-09-11 12:32:23', '0', '', '2029-06-25 16:00:00', '张三', '2023-09-10 16:00:00', '0', 5, 7, '阿里巴巴', NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701212102829555713', 11, 200, '变形金刚玩具套装', 140, '0', 1, '2023-09-11 12:32:27', '0', '', '2029-06-25 16:00:00', '张三', '2023-09-10 16:00:00', '0', 5, 7, '阿里巴巴', NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701212176804495361', 7, 20, '运动鞋', NULL, '1', 1, '2023-09-11 12:32:45', '0', '', NULL, '张三', NULL, '0', 5, NULL, NULL, NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701218295690104833', 8, 50, '《PASLMS》英文版', NULL, '1', 1, '2023-09-11 12:57:03', '0', '', NULL, '张三', NULL, '0', 5, NULL, NULL, NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701218352346763266', 9, 10, '桌椅套装', NULL, '1', 1, '2023-09-11 12:57:17', '0', '', NULL, '张三', NULL, '0', 5, NULL, NULL, NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701218386224156674', 10, 60, '短袖', NULL, '1', 1, '2023-09-11 12:57:25', '0', '', NULL, '张三', NULL, '0', 5, NULL, NULL, NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701218444214603778', 11, 20, '变形金刚玩具套装', NULL, '1', 1, '2023-09-11 12:57:39', '0', '', NULL, '张三', NULL, '0', 5, NULL, NULL, NULL); +INSERT INTO `t_detail_store_goods` VALUES ('1701219991275245570', 8, 10, '《PASLMS》英文版', NULL, '1', 1, '2023-09-11 13:03:48', '0', '', NULL, '张三', NULL, '0', 5, NULL, NULL, NULL); + +-- ---------------------------- +-- Table structure for t_emp_role +-- ---------------------------- +DROP TABLE IF EXISTS `t_emp_role`; +CREATE TABLE `t_emp_role` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', + `eid` bigint(0) NOT NULL COMMENT '用户id', + `rid` bigint(0) NOT NULL COMMENT '角色id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of t_emp_role +-- ---------------------------- +INSERT INTO `t_emp_role` VALUES (1, 1, 2); +INSERT INTO `t_emp_role` VALUES (20, 15, 3); +INSERT INTO `t_emp_role` VALUES (21, 16, 4); +INSERT INTO `t_emp_role` VALUES (22, 16, 5); + +-- ---------------------------- +-- Table structure for t_goods_store +-- ---------------------------- +DROP TABLE IF EXISTS `t_goods_store`; +CREATE TABLE `t_goods_store` ( + `goods_id` bigint(0) NOT NULL COMMENT '商品编号', + `store_id` bigint(0) NOT NULL COMMENT '仓库编号', + `in_num` bigint(0) NOT NULL COMMENT '入库数数量', + `residue_num` bigint(0) NOT NULL COMMENT '剩余数量', + `store_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '仓库名' +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of t_goods_store +-- ---------------------------- +INSERT INTO `t_goods_store` VALUES (7, 5, 200, 180, '一号仓库'); +INSERT INTO `t_goods_store` VALUES (8, 5, 200, 140, '一号仓库'); +INSERT INTO `t_goods_store` VALUES (9, 5, 200, 190, '一号仓库'); +INSERT INTO `t_goods_store` VALUES (10, 5, 200, 140, '一号仓库'); +INSERT INTO `t_goods_store` VALUES (11, 5, 200, 180, '一号仓库'); + +-- ---------------------------- +-- Table structure for t_member +-- ---------------------------- +DROP TABLE IF EXISTS `t_member`; +CREATE TABLE `t_member` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT, + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '姓名', + `phone` varchar(11) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '手机号', + `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '密码', + `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '邮箱', + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '状态', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述', + `integral` bigint(0) NULL DEFAULT NULL COMMENT '会员积分', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of t_member +-- ---------------------------- +INSERT INTO `t_member` VALUES (5, '陈小明', '19955555555', '123456', '123@qq.com', '0', '新会员', 2622); + +-- ---------------------------- +-- Table structure for t_menu +-- ---------------------------- +DROP TABLE IF EXISTS `t_menu`; +CREATE TABLE `t_menu` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', + `label` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '名称', + `purl` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '地址', + `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '类型 0:目录 1 菜单 2 按钮', + `parent_id` bigint(0) NULL DEFAULT NULL COMMENT '父id', + `parent_label` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '父名称', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述', + `state` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '状态', + `flag` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '权限的唯一标识', + `icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '图标', + `component` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '组件路径', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of t_menu +-- ---------------------------- +INSERT INTO `t_menu` VALUES (1, '销售管理', NULL, '0', NULL, NULL, NULL, '0', 'sale_management', 'iconfont icon-r-shield', NULL); +INSERT INTO `t_menu` VALUES (2, '人事管理', NULL, '0', NULL, NULL, NULL, '0', 'personnel_management', 'iconfont icon-r-team', NULL); +INSERT INTO `t_menu` VALUES (3, '个人中心', NULL, '0', NULL, NULL, NULL, '0', 'personal', 'iconfont icon-r-user2', NULL); +INSERT INTO `t_menu` VALUES (4, '库存管理', NULL, '0', NULL, NULL, NULL, '0', 'inventory_management', 'iconfont icon-r-building', NULL); +INSERT INTO `t_menu` VALUES (5, '会员管理', NULL, '0', NULL, NULL, NULL, '0', 'member_management', 'iconfont icon-r-mark1', NULL); +INSERT INTO `t_menu` VALUES (6, '系统管理', NULL, '0', NULL, NULL, NULL, '0', 'system', 'iconfont icon-r-setting', NULL); +INSERT INTO `t_menu` VALUES (7, '密码修改', '/personal/edit_pwd', '1', 3, '个人中心', NULL, '0', 'personal:edit_pwd', 'iconfont icon-r-lock', 'views/personal/Edit_pwd'); +INSERT INTO `t_menu` VALUES (8, '角色管理', '/system/role/list', '1', 6, '系统管理', NULL, '0', 'system:role:list', 'iconfont icon-r-user3', 'views/system/role/List'); +INSERT INTO `t_menu` VALUES (9, '创建角色', NULL, '2', 8, '角色管理', NULL, '0', 'system:role:save', NULL, NULL); +INSERT INTO `t_menu` VALUES (10, '修改角色', NULL, '2', 8, '角色管理', NULL, '0', 'system:role:edit_role', NULL, NULL); +INSERT INTO `t_menu` VALUES (11, '停用角色', NULL, '2', 8, '角色管理', NULL, '0', 'system:role:forbiddenRole', NULL, NULL); +INSERT INTO `t_menu` VALUES (12, '角色授权', NULL, '2', 8, '角色管理', NULL, '0', 'system:role:saveRolePermissons', NULL, NULL); +INSERT INTO `t_menu` VALUES (14, '菜单管理', '/system/menu/list', '1', 6, '系统管理', NULL, '0', 'system:menu:list', 'iconfont icon-r-list', 'views/system/menu/List'); +INSERT INTO `t_menu` VALUES (15, '仓库管理', '/inventory_management/store/list', '1', 4, '库存管理', NULL, '0', 'inventory_management:store:list', 'iconfont icon-r-building', 'views/inventory_management/store/List'); +INSERT INTO `t_menu` VALUES (16, '新创仓库', '', '2', 15, '仓库管理', NULL, '0', 'inventory_management:store:save', NULL, ''); +INSERT INTO `t_menu` VALUES (17, '修改仓库', '', '2', 15, '仓库管理', NULL, '0', 'inventory_management:store:update', NULL, ''); +INSERT INTO `t_menu` VALUES (18, '停用仓库', '', '2', 15, '仓库管理', NULL, '0', 'inventory_management:store:deactivate', NULL, ''); +INSERT INTO `t_menu` VALUES (19, '商品管理', NULL, '0', NULL, NULL, NULL, '0', 'goods_management:goods_category', 'iconfont icon-r-mark2', NULL); +INSERT INTO `t_menu` VALUES (20, '分类管理', '/goods_management/goods_category/list', '1', 19, '商品管理', NULL, '0', 'goods_management:goods_category:list', 'iconfont icon-r-list', 'views/goods_management/goods_category/List'); +INSERT INTO `t_menu` VALUES (21, '创建商品分类', '', '2', 20, '商品分类管理', NULL, '0', 'goods_management:goods_category:save', NULL, NULL); +INSERT INTO `t_menu` VALUES (22, '修改商品分类', '', '2', 20, '商品分类管理', NULL, '0', 'goods_management:goods_category:update', NULL, NULL); +INSERT INTO `t_menu` VALUES (23, '停用商品分类', '', '2', 20, '商品分类管理', NULL, '0', 'goods_management:goods_category:deactivate', NULL, NULL); +INSERT INTO `t_menu` VALUES (24, '部门管理', '/personnel_management/dept/list', '1', 2, '人事管理', NULL, '0', 'personnel_management:dept:list', 'iconfont icon-r-team', 'views/personnel_management/dept/List'); +INSERT INTO `t_menu` VALUES (25, '创建部门', NULL, '2', 24, '部门管理', NULL, '0', 'personnel_management:dept:save', NULL, NULL); +INSERT INTO `t_menu` VALUES (26, '修改部门', NULL, '2', 24, '部门管理', NULL, '0', 'personnel_management:dept:update', NULL, NULL); +INSERT INTO `t_menu` VALUES (27, '停用部门', NULL, '2', 24, '部门管理', NULL, '0', 'personnel_management:dept:deactivate', NULL, NULL); +INSERT INTO `t_menu` VALUES (28, '员工管理', '/personnel_management/employee/list', '1', 2, '人事管理', NULL, '0', 'personnel_management:employee:list', 'iconfont icon-r-user2', 'views/personnel_management/employee/List'); +INSERT INTO `t_menu` VALUES (29, '商品信息', '/goods_management/goods/list', '1', 19, '商品管理', NULL, '0', 'goods_management:goods:list', 'iconfont icon-r-shield', 'views/goods_management/goods/List'); +INSERT INTO `t_menu` VALUES (31, '会员信息', '/member_management/member/list', '1', 5, '会员管理', NULL, '0', 'member_management:member:list', 'iconfont icon-r-mark1', 'views/member_management/member/List'); +INSERT INTO `t_menu` VALUES (32, '个人资料', '/personal/information', '1', 3, '个人中心', NULL, '0', 'personnel_management:employee:update', 'iconfont icon-r-paper', 'views/personal/Information'); +INSERT INTO `t_menu` VALUES (33, '出库明细', '/inventory_management/detail_store_goods_out/list', '1', 4, '库存管理', NULL, '0', 'inventory_management:detail_store_goods_out:list', 'iconfont icon-r-left', 'views/inventory_management/detail_store_goods_out/List'); +INSERT INTO `t_menu` VALUES (34, '入库明细', '/inventory_management/detail_store_goods_in/list', '1', 4, '库存管理', NULL, '0', 'inventory_management:detail_store_goods_in:list', 'iconfont icon-r-right', 'views/inventory_management/detail_store_goods_in/List'); +INSERT INTO `t_menu` VALUES (35, '销售主页', '/sale_management/sale_cmd/list', '1', 1, '销售管理', NULL, '0', 'sale_management:sale_cmd:list', 'iconfont icon-r-home', 'views/sale_management/sale_cmd/List'); +INSERT INTO `t_menu` VALUES (36, '销售记录', '/sale_management/sale_records/list', '1', 1, '销售管理', NULL, '0', 'sale_management:sale_records:list', 'iconfont icon-r-paper', 'views/sale_management/sale_records/List'); +INSERT INTO `t_menu` VALUES (37, '供货商信息', '/inventory_management/supplier/list', '1', 4, '库存管理', NULL, '0', 'inventory_management:supplier:list', 'iconfont icon-r-mark3', 'views/inventory_management/supplier/List'); +INSERT INTO `t_menu` VALUES (41, '积分商品', '/goods_management/point_products/list', '1', 19, '商品管理', NULL, '0', 'goods_management:point_products:list', 'iconfont icon-r-mark1', 'views/goods_management/point_products/List'); +INSERT INTO `t_menu` VALUES (42, '销售统计', '/goods_management/statistic_sale/list', '1', 19, '商品管理', NULL, '0', 'goods_management:statistic_sale:list', 'iconfont icon-r-add', 'views/goods_management/statistic_sale/List'); +INSERT INTO `t_menu` VALUES (43, '库存统计', '/inventory_management/store/storage_situation', '1', 4, '库存管理', NULL, '0', 'inventory_management:store:storage_situation', 'iconfont icon-r-add', 'views/inventory_management/store/StorageSituation'); +INSERT INTO `t_menu` VALUES (44, '积分兑换记录', '/sale_management/exchange_point_products_records/list', '1', 1, '销售管理', NULL, '0', 'sale_management:exchange_point_products_records:list', 'iconfont icon-r-paper', 'views//sale_management/exchange_point_products_records/List'); +INSERT INTO `t_menu` VALUES (45, '员工创建', NULL, '2', 28, '员工管理', NULL, '0', 'personnel_management:employee:save', NULL, NULL); +INSERT INTO `t_menu` VALUES (46, '员工修改', NULL, '2', 28, '员工管理', NULL, '0', 'personnel_management:employee:update', NULL, NULL); +INSERT INTO `t_menu` VALUES (47, '员工分配职务', NULL, '2', 28, '员工管理', NULL, '0', 'personnel_management:employee:queryRoleIdsByEid', NULL, NULL); +INSERT INTO `t_menu` VALUES (48, '重置员工密码', NULL, '2', 28, '员工管理', NULL, '0', 'personnel_management:employee:resetPwd', NULL, NULL); +INSERT INTO `t_menu` VALUES (49, '商品入库', NULL, '2', 34, '入库明细', NULL, '0', 'inventory_management:detail_store_goods_in:save', NULL, NULL); +INSERT INTO `t_menu` VALUES (50, '入库记录删除', NULL, '2', 34, '入库明细', NULL, '0', 'inventory_management:detail_store_goods_in:delIn', NULL, NULL); +INSERT INTO `t_menu` VALUES (51, '商品出库', NULL, '2', 33, '出库明细', NULL, '0', 'inventory_management:detail_store_goods_out:save', NULL, NULL); +INSERT INTO `t_menu` VALUES (52, '出库记录删除', NULL, '2', 33, '出库明细', NULL, '0', 'inventory_management:detail_store_goods_out:delOut', NULL, NULL); +INSERT INTO `t_menu` VALUES (53, '创建', NULL, '2', 37, '供货商信息', NULL, '0', 'inventory_management:supplier:save', NULL, NULL); +INSERT INTO `t_menu` VALUES (54, '修改', NULL, '2', 37, '供货商信息', NULL, '0', 'inventory_management:supplier:update', NULL, NULL); +INSERT INTO `t_menu` VALUES (55, '删除', NULL, '2', 37, '供货商信息', NULL, '0', 'inventory_management:supplier:deactivate', NULL, NULL); +INSERT INTO `t_menu` VALUES (56, '商品上架处理', NULL, '2', 40, '出库通知', NULL, '0', 'inventory_management:detail_store_goods_out:notice:saveOut_shelves', NULL, NULL); +INSERT INTO `t_menu` VALUES (57, '商品过期/下架处理', NULL, '2', 40, '出库通知', NULL, '0', 'inventory_management:detail_store_goods_out:notice:resolveOutUntreatedForm', NULL, NULL); +INSERT INTO `t_menu` VALUES (58, '创建', NULL, '2', 31, '会员信息管理', NULL, '0', 'member_management:member:save', NULL, NULL); +INSERT INTO `t_menu` VALUES (59, '兑换商品', NULL, '2', 31, '会员信息管理', NULL, '0', 'sale_management:exchange_point_products_records:saveExchangePointProductRecords', NULL, NULL); +INSERT INTO `t_menu` VALUES (60, '修改', NULL, '2', 31, '会员信息管理', NULL, '0', 'member_management:member:update', NULL, NULL); +INSERT INTO `t_menu` VALUES (61, '删除', NULL, '2', 31, '会员信息管理', NULL, '0', 'member_management:member:delMember', NULL, NULL); + +-- ---------------------------- +-- Table structure for t_role +-- ---------------------------- +DROP TABLE IF EXISTS `t_role`; +CREATE TABLE `t_role` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '角色名', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述', + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '状态 0: 正常 -1:停用', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of t_role +-- ---------------------------- +INSERT INTO `t_role` VALUES (1, '系统管理员', '系统拥有者', '0'); +INSERT INTO `t_role` VALUES (2, '超级系统拥有者', '超级系统拥有者', '0'); +INSERT INTO `t_role` VALUES (3, '收银员', '负责销售收钱', '0'); +INSERT INTO `t_role` VALUES (4, '仓库管理员', '负责管理库存', '0'); +INSERT INTO `t_role` VALUES (5, '商品管理员', '负责商品货架的商品数量、通知仓库管理员入库和出库', '0'); +INSERT INTO `t_role` VALUES (6, '人事主管', '负责管理部门信息和员工信息', '0'); +INSERT INTO `t_role` VALUES (7, '员工', '超市工作人员', '0'); + +-- ---------------------------- +-- Table structure for t_role_menu +-- ---------------------------- +DROP TABLE IF EXISTS `t_role_menu`; +CREATE TABLE `t_role_menu` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `rid` bigint(0) NOT NULL COMMENT '角色id', + `mid` bigint(0) NOT NULL COMMENT '菜单id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 133 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of t_role_menu +-- ---------------------------- +INSERT INTO `t_role_menu` VALUES (64, 4, 32); +INSERT INTO `t_role_menu` VALUES (65, 4, 33); +INSERT INTO `t_role_menu` VALUES (66, 4, 34); +INSERT INTO `t_role_menu` VALUES (67, 4, 3); +INSERT INTO `t_role_menu` VALUES (68, 4, 4); +INSERT INTO `t_role_menu` VALUES (69, 4, 37); +INSERT INTO `t_role_menu` VALUES (70, 4, 7); +INSERT INTO `t_role_menu` VALUES (73, 4, 43); +INSERT INTO `t_role_menu` VALUES (74, 4, 15); +INSERT INTO `t_role_menu` VALUES (75, 4, 16); +INSERT INTO `t_role_menu` VALUES (76, 4, 17); +INSERT INTO `t_role_menu` VALUES (77, 4, 49); +INSERT INTO `t_role_menu` VALUES (78, 4, 18); +INSERT INTO `t_role_menu` VALUES (79, 4, 50); +INSERT INTO `t_role_menu` VALUES (80, 4, 51); +INSERT INTO `t_role_menu` VALUES (81, 4, 52); +INSERT INTO `t_role_menu` VALUES (82, 4, 53); +INSERT INTO `t_role_menu` VALUES (83, 4, 54); +INSERT INTO `t_role_menu` VALUES (84, 4, 55); +INSERT INTO `t_role_menu` VALUES (85, 4, 56); +INSERT INTO `t_role_menu` VALUES (86, 4, 57); +INSERT INTO `t_role_menu` VALUES (87, 5, 19); +INSERT INTO `t_role_menu` VALUES (88, 5, 20); +INSERT INTO `t_role_menu` VALUES (89, 5, 21); +INSERT INTO `t_role_menu` VALUES (90, 5, 22); +INSERT INTO `t_role_menu` VALUES (92, 5, 23); +INSERT INTO `t_role_menu` VALUES (93, 5, 41); +INSERT INTO `t_role_menu` VALUES (94, 5, 42); +INSERT INTO `t_role_menu` VALUES (95, 5, 29); +INSERT INTO `t_role_menu` VALUES (96, 6, 48); +INSERT INTO `t_role_menu` VALUES (97, 6, 2); +INSERT INTO `t_role_menu` VALUES (98, 6, 24); +INSERT INTO `t_role_menu` VALUES (99, 6, 25); +INSERT INTO `t_role_menu` VALUES (100, 6, 26); +INSERT INTO `t_role_menu` VALUES (101, 6, 27); +INSERT INTO `t_role_menu` VALUES (102, 6, 28); +INSERT INTO `t_role_menu` VALUES (103, 6, 45); +INSERT INTO `t_role_menu` VALUES (104, 6, 46); +INSERT INTO `t_role_menu` VALUES (105, 6, 47); +INSERT INTO `t_role_menu` VALUES (109, 7, 32); +INSERT INTO `t_role_menu` VALUES (110, 7, 3); +INSERT INTO `t_role_menu` VALUES (111, 7, 7); +INSERT INTO `t_role_menu` VALUES (121, 3, 32); +INSERT INTO `t_role_menu` VALUES (122, 3, 1); +INSERT INTO `t_role_menu` VALUES (123, 3, 3); +INSERT INTO `t_role_menu` VALUES (124, 3, 35); +INSERT INTO `t_role_menu` VALUES (125, 3, 36); +INSERT INTO `t_role_menu` VALUES (126, 3, 5); +INSERT INTO `t_role_menu` VALUES (127, 3, 7); +INSERT INTO `t_role_menu` VALUES (128, 3, 44); +INSERT INTO `t_role_menu` VALUES (129, 3, 58); +INSERT INTO `t_role_menu` VALUES (130, 3, 59); +INSERT INTO `t_role_menu` VALUES (131, 3, 60); +INSERT INTO `t_role_menu` VALUES (132, 3, 61); +INSERT INTO `t_role_menu` VALUES (133, 3, 31); + +-- ---------------------------- +-- Table structure for t_sale_records +-- ---------------------------- +DROP TABLE IF EXISTS `t_sale_records`; +CREATE TABLE `t_sale_records` ( + `cn` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `eid` bigint(0) NOT NULL, + `sellway` char(2) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `sell_time` datetime NOT NULL, + `state` char(2) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '0:正常 1:删除', + `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '备注', + `sellby` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, + `sell_total` bigint(0) NOT NULL COMMENT '销售总数量', + `sell_totalmoney` double NOT NULL COMMENT '销售总金额', + `type` char(1) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '0:非会员消费 1:会员消费', + `member_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '顾客会员号码', + PRIMARY KEY (`cn`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of t_sale_records +-- ---------------------------- +INSERT INTO `t_sale_records` VALUES ('1701213155180429314', 15, '0', '2023-09-11 12:37:16', '0', '', '李四', 1, 120, '0', NULL); +INSERT INTO `t_sale_records` VALUES ('1701220094014722049', 1, '1', '2023-09-11 13:04:45', '0', '', '张三', 1, 315, '1', '19955555555'); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/target/classes/application.yaml b/target/classes/application.yaml new file mode 100644 index 0000000..d4fa9c6 --- /dev/null +++ b/target/classes/application.yaml @@ -0,0 +1,30 @@ +server: + port: 9291 +spring: + application: + name: market-server + datasource: + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + password: 123456 + username: root + url: jdbc:mysql://localhost:3306/supermarket_manager?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&allowPublicKeyRetrieval=true + redis: + host: localhost + port: 6379 + password: + mvc: + async: + request-timeout: 20000 + jackson: + time-zone: GMT+8 + servlet: + multipart: + max-file-size: 1GB + max-request-size: 1GB +mybatis-plus: + mapper-locations: classpath:com/rabbiter/market/mapper/*Mapper.xml +logging: + level: + cn.dingli.market.mapper: debug + diff --git a/target/classes/com/rabbiter/market/SupermarketApplication.class b/target/classes/com/rabbiter/market/SupermarketApplication.class new file mode 100644 index 0000000..9cf4f89 Binary files /dev/null and b/target/classes/com/rabbiter/market/SupermarketApplication.class differ diff --git a/target/classes/com/rabbiter/market/common/advice/ExceptionControllerAdvice.class b/target/classes/com/rabbiter/market/common/advice/ExceptionControllerAdvice.class new file mode 100644 index 0000000..86121ad Binary files /dev/null and b/target/classes/com/rabbiter/market/common/advice/ExceptionControllerAdvice.class differ diff --git a/target/classes/com/rabbiter/market/common/advice/GlobalExceptionHandler.class b/target/classes/com/rabbiter/market/common/advice/GlobalExceptionHandler.class new file mode 100644 index 0000000..f67b899 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/advice/GlobalExceptionHandler.class differ diff --git a/target/classes/com/rabbiter/market/common/config/BaseWebConfig$1.class b/target/classes/com/rabbiter/market/common/config/BaseWebConfig$1.class new file mode 100644 index 0000000..04a8fff Binary files /dev/null and b/target/classes/com/rabbiter/market/common/config/BaseWebConfig$1.class differ diff --git a/target/classes/com/rabbiter/market/common/config/BaseWebConfig.class b/target/classes/com/rabbiter/market/common/config/BaseWebConfig.class new file mode 100644 index 0000000..293e29e Binary files /dev/null and b/target/classes/com/rabbiter/market/common/config/BaseWebConfig.class differ diff --git a/target/classes/com/rabbiter/market/common/config/CustomExceptionSorter.class b/target/classes/com/rabbiter/market/common/config/CustomExceptionSorter.class new file mode 100644 index 0000000..d84724e Binary files /dev/null and b/target/classes/com/rabbiter/market/common/config/CustomExceptionSorter.class differ diff --git a/target/classes/com/rabbiter/market/common/config/DataSourceConfiguration.class b/target/classes/com/rabbiter/market/common/config/DataSourceConfiguration.class new file mode 100644 index 0000000..9339795 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/config/DataSourceConfiguration.class differ diff --git a/target/classes/com/rabbiter/market/common/config/MpConfig.class b/target/classes/com/rabbiter/market/common/config/MpConfig.class new file mode 100644 index 0000000..15f154b Binary files /dev/null and b/target/classes/com/rabbiter/market/common/config/MpConfig.class differ diff --git a/target/classes/com/rabbiter/market/common/config/ProcessContextAware.class b/target/classes/com/rabbiter/market/common/config/ProcessContextAware.class new file mode 100644 index 0000000..cb1b106 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/config/ProcessContextAware.class differ diff --git a/target/classes/com/rabbiter/market/common/constants/HttpStatus.class b/target/classes/com/rabbiter/market/common/constants/HttpStatus.class new file mode 100644 index 0000000..a7b47b7 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/constants/HttpStatus.class differ diff --git a/target/classes/com/rabbiter/market/common/exception/BusinessException.class b/target/classes/com/rabbiter/market/common/exception/BusinessException.class new file mode 100644 index 0000000..40614c3 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/exception/BusinessException.class differ diff --git a/target/classes/com/rabbiter/market/common/exception/SysException.class b/target/classes/com/rabbiter/market/common/exception/SysException.class new file mode 100644 index 0000000..db3b61d Binary files /dev/null and b/target/classes/com/rabbiter/market/common/exception/SysException.class differ diff --git a/target/classes/com/rabbiter/market/common/redis/config/RedisConfig.class b/target/classes/com/rabbiter/market/common/redis/config/RedisConfig.class new file mode 100644 index 0000000..f3a0f02 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/redis/config/RedisConfig.class differ diff --git a/target/classes/com/rabbiter/market/common/redis/constants/RedisKeys.class b/target/classes/com/rabbiter/market/common/redis/constants/RedisKeys.class new file mode 100644 index 0000000..bc870ff Binary files /dev/null and b/target/classes/com/rabbiter/market/common/redis/constants/RedisKeys.class differ diff --git a/target/classes/com/rabbiter/market/common/redis/service/RedisTemplateService.class b/target/classes/com/rabbiter/market/common/redis/service/RedisTemplateService.class new file mode 100644 index 0000000..bd27d49 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/redis/service/RedisTemplateService.class differ diff --git a/target/classes/com/rabbiter/market/common/sercurity/annotation/HasPermisson.class b/target/classes/com/rabbiter/market/common/sercurity/annotation/HasPermisson.class new file mode 100644 index 0000000..6042d8f Binary files /dev/null and b/target/classes/com/rabbiter/market/common/sercurity/annotation/HasPermisson.class differ diff --git a/target/classes/com/rabbiter/market/common/sercurity/annotation/NoRequireLogin.class b/target/classes/com/rabbiter/market/common/sercurity/annotation/NoRequireLogin.class new file mode 100644 index 0000000..bc93583 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/sercurity/annotation/NoRequireLogin.class differ diff --git a/target/classes/com/rabbiter/market/common/sercurity/interceptor/EmpLoginInterceptor.class b/target/classes/com/rabbiter/market/common/sercurity/interceptor/EmpLoginInterceptor.class new file mode 100644 index 0000000..28b0725 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/sercurity/interceptor/EmpLoginInterceptor.class differ diff --git a/target/classes/com/rabbiter/market/common/sercurity/resolver/UserInfoArgumentResolver.class b/target/classes/com/rabbiter/market/common/sercurity/resolver/UserInfoArgumentResolver.class new file mode 100644 index 0000000..537131e Binary files /dev/null and b/target/classes/com/rabbiter/market/common/sercurity/resolver/UserInfoArgumentResolver.class differ diff --git a/target/classes/com/rabbiter/market/common/sercurity/resolver/UserParam.class b/target/classes/com/rabbiter/market/common/sercurity/resolver/UserParam.class new file mode 100644 index 0000000..4e85195 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/sercurity/resolver/UserParam.class differ diff --git a/target/classes/com/rabbiter/market/common/util/DateUtil.class b/target/classes/com/rabbiter/market/common/util/DateUtil.class new file mode 100644 index 0000000..35f09a0 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/util/DateUtil.class differ diff --git a/target/classes/com/rabbiter/market/common/util/PathUtils.class b/target/classes/com/rabbiter/market/common/util/PathUtils.class new file mode 100644 index 0000000..9fb1572 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/util/PathUtils.class differ diff --git a/target/classes/com/rabbiter/market/common/util/UploadUtil.class b/target/classes/com/rabbiter/market/common/util/UploadUtil.class new file mode 100644 index 0000000..f4d7310 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/util/UploadUtil.class differ diff --git a/target/classes/com/rabbiter/market/common/web/response/JsonResult.class b/target/classes/com/rabbiter/market/common/web/response/JsonResult.class new file mode 100644 index 0000000..fd0d440 Binary files /dev/null and b/target/classes/com/rabbiter/market/common/web/response/JsonResult.class differ diff --git a/target/classes/com/rabbiter/market/controller/goods_management/goods/GoodsController.class b/target/classes/com/rabbiter/market/controller/goods_management/goods/GoodsController.class new file mode 100644 index 0000000..f3dd657 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/goods_management/goods/GoodsController.class differ diff --git a/target/classes/com/rabbiter/market/controller/goods_management/goods_category/GoodsCategoryController.class b/target/classes/com/rabbiter/market/controller/goods_management/goods_category/GoodsCategoryController.class new file mode 100644 index 0000000..e0dd3e1 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/goods_management/goods_category/GoodsCategoryController.class differ diff --git a/target/classes/com/rabbiter/market/controller/goods_management/goods_store/GoodsStoreController.class b/target/classes/com/rabbiter/market/controller/goods_management/goods_store/GoodsStoreController.class new file mode 100644 index 0000000..f0192fb Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/goods_management/goods_store/GoodsStoreController.class differ diff --git a/target/classes/com/rabbiter/market/controller/goods_management/point_products/PointProductController.class b/target/classes/com/rabbiter/market/controller/goods_management/point_products/PointProductController.class new file mode 100644 index 0000000..682162e Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/goods_management/point_products/PointProductController.class differ diff --git a/target/classes/com/rabbiter/market/controller/goods_management/statistic_sale/StatisticSaleController.class b/target/classes/com/rabbiter/market/controller/goods_management/statistic_sale/StatisticSaleController.class new file mode 100644 index 0000000..25b3951 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/goods_management/statistic_sale/StatisticSaleController.class differ diff --git a/target/classes/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreInController.class b/target/classes/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreInController.class new file mode 100644 index 0000000..f609ca0 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreInController.class differ diff --git a/target/classes/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreOutController.class b/target/classes/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreOutController.class new file mode 100644 index 0000000..55ad96b Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/inventory_management/detail_store_goods/StoreOutController.class differ diff --git a/target/classes/com/rabbiter/market/controller/inventory_management/notice/NoticeController.class b/target/classes/com/rabbiter/market/controller/inventory_management/notice/NoticeController.class new file mode 100644 index 0000000..8b6d48a Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/inventory_management/notice/NoticeController.class differ diff --git a/target/classes/com/rabbiter/market/controller/inventory_management/store/StorageSituationController.class b/target/classes/com/rabbiter/market/controller/inventory_management/store/StorageSituationController.class new file mode 100644 index 0000000..502dd52 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/inventory_management/store/StorageSituationController.class differ diff --git a/target/classes/com/rabbiter/market/controller/inventory_management/store/StoreController.class b/target/classes/com/rabbiter/market/controller/inventory_management/store/StoreController.class new file mode 100644 index 0000000..54fb8e9 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/inventory_management/store/StoreController.class differ diff --git a/target/classes/com/rabbiter/market/controller/inventory_management/supplier/SupplierController.class b/target/classes/com/rabbiter/market/controller/inventory_management/supplier/SupplierController.class new file mode 100644 index 0000000..964f777 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/inventory_management/supplier/SupplierController.class differ diff --git a/target/classes/com/rabbiter/market/controller/login/LoginEmpController.class b/target/classes/com/rabbiter/market/controller/login/LoginEmpController.class new file mode 100644 index 0000000..ad5e7b3 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/login/LoginEmpController.class differ diff --git a/target/classes/com/rabbiter/market/controller/member_management/member/MemberController.class b/target/classes/com/rabbiter/market/controller/member_management/member/MemberController.class new file mode 100644 index 0000000..15348fd Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/member_management/member/MemberController.class differ diff --git a/target/classes/com/rabbiter/market/controller/personal/PersonalController.class b/target/classes/com/rabbiter/market/controller/personal/PersonalController.class new file mode 100644 index 0000000..fbd40d9 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/personal/PersonalController.class differ diff --git a/target/classes/com/rabbiter/market/controller/personnel_management/department/DeptController.class b/target/classes/com/rabbiter/market/controller/personnel_management/department/DeptController.class new file mode 100644 index 0000000..2de3c5a Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/personnel_management/department/DeptController.class differ diff --git a/target/classes/com/rabbiter/market/controller/personnel_management/employee/EmployeeController.class b/target/classes/com/rabbiter/market/controller/personnel_management/employee/EmployeeController.class new file mode 100644 index 0000000..92f4833 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/personnel_management/employee/EmployeeController.class differ diff --git a/target/classes/com/rabbiter/market/controller/sale_management/exchange_point_products/ExchangePointProductsRecordsController.class b/target/classes/com/rabbiter/market/controller/sale_management/exchange_point_products/ExchangePointProductsRecordsController.class new file mode 100644 index 0000000..cb1a98b Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/sale_management/exchange_point_products/ExchangePointProductsRecordsController.class differ diff --git a/target/classes/com/rabbiter/market/controller/sale_management/sale_record/SaleRecordController.class b/target/classes/com/rabbiter/market/controller/sale_management/sale_record/SaleRecordController.class new file mode 100644 index 0000000..cd1a4a3 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/sale_management/sale_record/SaleRecordController.class differ diff --git a/target/classes/com/rabbiter/market/controller/system/menu/MenuController.class b/target/classes/com/rabbiter/market/controller/system/menu/MenuController.class new file mode 100644 index 0000000..3615664 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/system/menu/MenuController.class differ diff --git a/target/classes/com/rabbiter/market/controller/system/role/RoleController.class b/target/classes/com/rabbiter/market/controller/system/role/RoleController.class new file mode 100644 index 0000000..d8afc56 Binary files /dev/null and b/target/classes/com/rabbiter/market/controller/system/role/RoleController.class differ diff --git a/target/classes/com/rabbiter/market/data_job/CacheDataJob.class b/target/classes/com/rabbiter/market/data_job/CacheDataJob.class new file mode 100644 index 0000000..19d110c Binary files /dev/null and b/target/classes/com/rabbiter/market/data_job/CacheDataJob.class differ diff --git a/target/classes/com/rabbiter/market/domain/goods_management/goods/Goods.class b/target/classes/com/rabbiter/market/domain/goods_management/goods/Goods.class new file mode 100644 index 0000000..5c0fdb8 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/goods_management/goods/Goods.class differ diff --git a/target/classes/com/rabbiter/market/domain/goods_management/goods_category/GoodsCategory.class b/target/classes/com/rabbiter/market/domain/goods_management/goods_category/GoodsCategory.class new file mode 100644 index 0000000..237e8f3 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/goods_management/goods_category/GoodsCategory.class differ diff --git a/target/classes/com/rabbiter/market/domain/goods_management/point_products/PointProducts.class b/target/classes/com/rabbiter/market/domain/goods_management/point_products/PointProducts.class new file mode 100644 index 0000000..140e2e2 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/goods_management/point_products/PointProducts.class differ diff --git a/target/classes/com/rabbiter/market/domain/inventory_management/detail_store_goods/DetailStoreGoods.class b/target/classes/com/rabbiter/market/domain/inventory_management/detail_store_goods/DetailStoreGoods.class new file mode 100644 index 0000000..8aea432 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/inventory_management/detail_store_goods/DetailStoreGoods.class differ diff --git a/target/classes/com/rabbiter/market/domain/inventory_management/notice/NoticeIn.class b/target/classes/com/rabbiter/market/domain/inventory_management/notice/NoticeIn.class new file mode 100644 index 0000000..a721265 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/inventory_management/notice/NoticeIn.class differ diff --git a/target/classes/com/rabbiter/market/domain/inventory_management/notice/NoticeOut.class b/target/classes/com/rabbiter/market/domain/inventory_management/notice/NoticeOut.class new file mode 100644 index 0000000..8203b6b Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/inventory_management/notice/NoticeOut.class differ diff --git a/target/classes/com/rabbiter/market/domain/inventory_management/store/GoodsStore.class b/target/classes/com/rabbiter/market/domain/inventory_management/store/GoodsStore.class new file mode 100644 index 0000000..3891134 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/inventory_management/store/GoodsStore.class differ diff --git a/target/classes/com/rabbiter/market/domain/inventory_management/store/Store.class b/target/classes/com/rabbiter/market/domain/inventory_management/store/Store.class new file mode 100644 index 0000000..603bbfb Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/inventory_management/store/Store.class differ diff --git a/target/classes/com/rabbiter/market/domain/inventory_management/supplier/Supplier.class b/target/classes/com/rabbiter/market/domain/inventory_management/supplier/Supplier.class new file mode 100644 index 0000000..5a8dd1f Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/inventory_management/supplier/Supplier.class differ diff --git a/target/classes/com/rabbiter/market/domain/member_management/member/Member.class b/target/classes/com/rabbiter/market/domain/member_management/member/Member.class new file mode 100644 index 0000000..df91403 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/member_management/member/Member.class differ diff --git a/target/classes/com/rabbiter/market/domain/personnel_management/department/Dept.class b/target/classes/com/rabbiter/market/domain/personnel_management/department/Dept.class new file mode 100644 index 0000000..3e472ba Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/personnel_management/department/Dept.class differ diff --git a/target/classes/com/rabbiter/market/domain/personnel_management/employee/Employee.class b/target/classes/com/rabbiter/market/domain/personnel_management/employee/Employee.class new file mode 100644 index 0000000..055f6ed Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/personnel_management/employee/Employee.class differ diff --git a/target/classes/com/rabbiter/market/domain/sale_management/detail_sale_records/DetailSaleRecords.class b/target/classes/com/rabbiter/market/domain/sale_management/detail_sale_records/DetailSaleRecords.class new file mode 100644 index 0000000..c38b9cf Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/sale_management/detail_sale_records/DetailSaleRecords.class differ diff --git a/target/classes/com/rabbiter/market/domain/sale_management/exchange_point_products/ExchangePointProducts.class b/target/classes/com/rabbiter/market/domain/sale_management/exchange_point_products/ExchangePointProducts.class new file mode 100644 index 0000000..d85b661 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/sale_management/exchange_point_products/ExchangePointProducts.class differ diff --git a/target/classes/com/rabbiter/market/domain/sale_management/sale_records/SaleRecords.class b/target/classes/com/rabbiter/market/domain/sale_management/sale_records/SaleRecords.class new file mode 100644 index 0000000..a5a1c70 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/sale_management/sale_records/SaleRecords.class differ diff --git a/target/classes/com/rabbiter/market/domain/system/menu/Menu.class b/target/classes/com/rabbiter/market/domain/system/menu/Menu.class new file mode 100644 index 0000000..d95392c Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/system/menu/Menu.class differ diff --git a/target/classes/com/rabbiter/market/domain/system/role/Role.class b/target/classes/com/rabbiter/market/domain/system/role/Role.class new file mode 100644 index 0000000..aa8e9f8 Binary files /dev/null and b/target/classes/com/rabbiter/market/domain/system/role/Role.class differ diff --git a/target/classes/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.class b/target/classes/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.class new file mode 100644 index 0000000..8e6be3b Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.xml b/target/classes/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.xml new file mode 100644 index 0000000..917670f --- /dev/null +++ b/target/classes/com/rabbiter/market/mapper/goods_management/goods/GoodsMapper.xml @@ -0,0 +1,53 @@ + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/com/rabbiter/market/mapper/goods_management/goods_category/GoodsCategoryMapper.class b/target/classes/com/rabbiter/market/mapper/goods_management/goods_category/GoodsCategoryMapper.class new file mode 100644 index 0000000..7074471 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/goods_management/goods_category/GoodsCategoryMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/goods_management/point_products/PointProductsMapper.class b/target/classes/com/rabbiter/market/mapper/goods_management/point_products/PointProductsMapper.class new file mode 100644 index 0000000..a001b4f Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/goods_management/point_products/PointProductsMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/inventory_management/detail_store_goods/DetailStoreGoodsMapper.class b/target/classes/com/rabbiter/market/mapper/inventory_management/detail_store_goods/DetailStoreGoodsMapper.class new file mode 100644 index 0000000..40269ca Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/inventory_management/detail_store_goods/DetailStoreGoodsMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.class b/target/classes/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.class new file mode 100644 index 0000000..d1fbdd4 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.xml b/target/classes/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.xml new file mode 100644 index 0000000..b2c073f --- /dev/null +++ b/target/classes/com/rabbiter/market/mapper/inventory_management/store/GoodsStoreMapper.xml @@ -0,0 +1,22 @@ + + + + + update t_goods_store set residue_num=residue_num+#{goodsNum},in_num=in_num+#{goodsNum} where goods_id=#{goodsId} and store_id=#{storeId} + + + update t_goods_store set residue_num=residue_num-#{goodsNum} where goods_id=#{goodsId} and store_id=#{storeId} + + + + + + \ No newline at end of file diff --git a/target/classes/com/rabbiter/market/mapper/inventory_management/store/StoreMapper.class b/target/classes/com/rabbiter/market/mapper/inventory_management/store/StoreMapper.class new file mode 100644 index 0000000..ad8de2d Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/inventory_management/store/StoreMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/inventory_management/supplier/SupplierMapper.class b/target/classes/com/rabbiter/market/mapper/inventory_management/supplier/SupplierMapper.class new file mode 100644 index 0000000..afda10d Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/inventory_management/supplier/SupplierMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/member_management/member/MemberMapper.class b/target/classes/com/rabbiter/market/mapper/member_management/member/MemberMapper.class new file mode 100644 index 0000000..cfe70e4 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/member_management/member/MemberMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/personnel_management/department/DeptMapper.class b/target/classes/com/rabbiter/market/mapper/personnel_management/department/DeptMapper.class new file mode 100644 index 0000000..9b04e91 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/personnel_management/department/DeptMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/personnel_management/employee/EmployeeMapper.class b/target/classes/com/rabbiter/market/mapper/personnel_management/employee/EmployeeMapper.class new file mode 100644 index 0000000..e692170 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/personnel_management/employee/EmployeeMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/sale_management/detail_sale_records/DetailSaleRecordsMapper.class b/target/classes/com/rabbiter/market/mapper/sale_management/detail_sale_records/DetailSaleRecordsMapper.class new file mode 100644 index 0000000..cf02536 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/sale_management/detail_sale_records/DetailSaleRecordsMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/sale_management/exchange_point_products/ExchangePointProductsMapper.class b/target/classes/com/rabbiter/market/mapper/sale_management/exchange_point_products/ExchangePointProductsMapper.class new file mode 100644 index 0000000..eaae719 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/sale_management/exchange_point_products/ExchangePointProductsMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/sale_management/sale_records/SaleRecordsMapper.class b/target/classes/com/rabbiter/market/mapper/sale_management/sale_records/SaleRecordsMapper.class new file mode 100644 index 0000000..43bb5cd Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/sale_management/sale_records/SaleRecordsMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/system/menu/MenuMapper.class b/target/classes/com/rabbiter/market/mapper/system/menu/MenuMapper.class new file mode 100644 index 0000000..316a707 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/system/menu/MenuMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/system/menu/MenuMapper.xml b/target/classes/com/rabbiter/market/mapper/system/menu/MenuMapper.xml new file mode 100644 index 0000000..4fcaa6b --- /dev/null +++ b/target/classes/com/rabbiter/market/mapper/system/menu/MenuMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/com/rabbiter/market/mapper/system/role/RoleMapper.class b/target/classes/com/rabbiter/market/mapper/system/role/RoleMapper.class new file mode 100644 index 0000000..f54cb60 Binary files /dev/null and b/target/classes/com/rabbiter/market/mapper/system/role/RoleMapper.class differ diff --git a/target/classes/com/rabbiter/market/mapper/system/role/RoleMapper.xml b/target/classes/com/rabbiter/market/mapper/system/role/RoleMapper.xml new file mode 100644 index 0000000..e61fe90 --- /dev/null +++ b/target/classes/com/rabbiter/market/mapper/system/role/RoleMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + insert into t_role_menu (rid,mid) values + + (#{item.rid},#{item.mid}) + + + + insert into t_emp_role (eid,rid) values + + (#{item.eid},#{item.rid}) + + + + delete from t_role_menu where rid=#{rid} + + + delete from t_emp_role where eid=#{eid} + + + + + + \ No newline at end of file diff --git a/target/classes/com/rabbiter/market/qo/BaseQuery.class b/target/classes/com/rabbiter/market/qo/BaseQuery.class new file mode 100644 index 0000000..47bcb68 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/BaseQuery.class differ diff --git a/target/classes/com/rabbiter/market/qo/exchange_point_products_records/QueryExchangePointProductsRecords.class b/target/classes/com/rabbiter/market/qo/exchange_point_products_records/QueryExchangePointProductsRecords.class new file mode 100644 index 0000000..f23457b Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/exchange_point_products_records/QueryExchangePointProductsRecords.class differ diff --git a/target/classes/com/rabbiter/market/qo/goods_management/goods/QueryGoods.class b/target/classes/com/rabbiter/market/qo/goods_management/goods/QueryGoods.class new file mode 100644 index 0000000..a6d0277 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/goods_management/goods/QueryGoods.class differ diff --git a/target/classes/com/rabbiter/market/qo/goods_management/goods_category/QueryGoodsCategory.class b/target/classes/com/rabbiter/market/qo/goods_management/goods_category/QueryGoodsCategory.class new file mode 100644 index 0000000..c818ca4 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/goods_management/goods_category/QueryGoodsCategory.class differ diff --git a/target/classes/com/rabbiter/market/qo/goods_management/goods_store/QueryGoodsStore.class b/target/classes/com/rabbiter/market/qo/goods_management/goods_store/QueryGoodsStore.class new file mode 100644 index 0000000..955ac99 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/goods_management/goods_store/QueryGoodsStore.class differ diff --git a/target/classes/com/rabbiter/market/qo/goods_management/point_products/QueryPointProducts.class b/target/classes/com/rabbiter/market/qo/goods_management/point_products/QueryPointProducts.class new file mode 100644 index 0000000..6bcd8b8 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/goods_management/point_products/QueryPointProducts.class differ diff --git a/target/classes/com/rabbiter/market/qo/goods_management/statistic_sale/QueryStatisticSale.class b/target/classes/com/rabbiter/market/qo/goods_management/statistic_sale/QueryStatisticSale.class new file mode 100644 index 0000000..ad1673b Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/goods_management/statistic_sale/QueryStatisticSale.class differ diff --git a/target/classes/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoods.class b/target/classes/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoods.class new file mode 100644 index 0000000..d2bde18 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoods.class differ diff --git a/target/classes/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoodsOut.class b/target/classes/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoodsOut.class new file mode 100644 index 0000000..05c9996 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/inventory_management/detail_store_goods/QueryDetailStoreGoodsOut.class differ diff --git a/target/classes/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeIn.class b/target/classes/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeIn.class new file mode 100644 index 0000000..2f5ea8c Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeIn.class differ diff --git a/target/classes/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeOut.class b/target/classes/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeOut.class new file mode 100644 index 0000000..efde34a Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/inventory_management/notice/QueryNoticeOut.class differ diff --git a/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryDetailStorageSituation.class b/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryDetailStorageSituation.class new file mode 100644 index 0000000..2c89af9 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryDetailStorageSituation.class differ diff --git a/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryStorageSituation.class b/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryStorageSituation.class new file mode 100644 index 0000000..66cd54a Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryStorageSituation.class differ diff --git a/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryStore.class b/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryStore.class new file mode 100644 index 0000000..a86b148 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/inventory_management/store/QueryStore.class differ diff --git a/target/classes/com/rabbiter/market/qo/inventory_management/supplier/QuerySupplier.class b/target/classes/com/rabbiter/market/qo/inventory_management/supplier/QuerySupplier.class new file mode 100644 index 0000000..f7b7f50 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/inventory_management/supplier/QuerySupplier.class differ diff --git a/target/classes/com/rabbiter/market/qo/member_management/member/QueryMember.class b/target/classes/com/rabbiter/market/qo/member_management/member/QueryMember.class new file mode 100644 index 0000000..ff4d3f9 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/member_management/member/QueryMember.class differ diff --git a/target/classes/com/rabbiter/market/qo/personal/QueryEditPwd.class b/target/classes/com/rabbiter/market/qo/personal/QueryEditPwd.class new file mode 100644 index 0000000..eb4adc0 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/personal/QueryEditPwd.class differ diff --git a/target/classes/com/rabbiter/market/qo/personnel_management/department/QueryDept.class b/target/classes/com/rabbiter/market/qo/personnel_management/department/QueryDept.class new file mode 100644 index 0000000..15b6640 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/personnel_management/department/QueryDept.class differ diff --git a/target/classes/com/rabbiter/market/qo/personnel_management/employee/QueryEmp.class b/target/classes/com/rabbiter/market/qo/personnel_management/employee/QueryEmp.class new file mode 100644 index 0000000..e82bbcd Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/personnel_management/employee/QueryEmp.class differ diff --git a/target/classes/com/rabbiter/market/qo/sale_records/QuerySaleRecords.class b/target/classes/com/rabbiter/market/qo/sale_records/QuerySaleRecords.class new file mode 100644 index 0000000..7ea3d59 Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/sale_records/QuerySaleRecords.class differ diff --git a/target/classes/com/rabbiter/market/qo/system/MenuQuery.class b/target/classes/com/rabbiter/market/qo/system/MenuQuery.class new file mode 100644 index 0000000..e1c0d9a Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/system/MenuQuery.class differ diff --git a/target/classes/com/rabbiter/market/qo/system/RoleQuery.class b/target/classes/com/rabbiter/market/qo/system/RoleQuery.class new file mode 100644 index 0000000..5b429ad Binary files /dev/null and b/target/classes/com/rabbiter/market/qo/system/RoleQuery.class differ diff --git a/target/classes/com/rabbiter/market/service/goods_management/goods/IGoodsService.class b/target/classes/com/rabbiter/market/service/goods_management/goods/IGoodsService.class new file mode 100644 index 0000000..f13af95 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/goods_management/goods/IGoodsService.class differ diff --git a/target/classes/com/rabbiter/market/service/goods_management/goods/impl/GoodsServiceImpl.class b/target/classes/com/rabbiter/market/service/goods_management/goods/impl/GoodsServiceImpl.class new file mode 100644 index 0000000..7bf2529 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/goods_management/goods/impl/GoodsServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/goods_management/goods_category/IGoodsCategoryService.class b/target/classes/com/rabbiter/market/service/goods_management/goods_category/IGoodsCategoryService.class new file mode 100644 index 0000000..f241e84 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/goods_management/goods_category/IGoodsCategoryService.class differ diff --git a/target/classes/com/rabbiter/market/service/goods_management/goods_category/impl/GoodsCategoryServiceImpl.class b/target/classes/com/rabbiter/market/service/goods_management/goods_category/impl/GoodsCategoryServiceImpl.class new file mode 100644 index 0000000..101cac1 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/goods_management/goods_category/impl/GoodsCategoryServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/goods_management/point_products/IPointProductsService.class b/target/classes/com/rabbiter/market/service/goods_management/point_products/IPointProductsService.class new file mode 100644 index 0000000..f75c46a Binary files /dev/null and b/target/classes/com/rabbiter/market/service/goods_management/point_products/IPointProductsService.class differ diff --git a/target/classes/com/rabbiter/market/service/goods_management/point_products/impl/PointProductsServiceImpl.class b/target/classes/com/rabbiter/market/service/goods_management/point_products/impl/PointProductsServiceImpl.class new file mode 100644 index 0000000..3fcef69 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/goods_management/point_products/impl/PointProductsServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/inventory_management/detail_store_goods/IDetailStoreGoodsService.class b/target/classes/com/rabbiter/market/service/inventory_management/detail_store_goods/IDetailStoreGoodsService.class new file mode 100644 index 0000000..2fb8e23 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/inventory_management/detail_store_goods/IDetailStoreGoodsService.class differ diff --git a/target/classes/com/rabbiter/market/service/inventory_management/detail_store_goods/impl/DetailStoreGoodsServiceImpl.class b/target/classes/com/rabbiter/market/service/inventory_management/detail_store_goods/impl/DetailStoreGoodsServiceImpl.class new file mode 100644 index 0000000..f00a5b9 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/inventory_management/detail_store_goods/impl/DetailStoreGoodsServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/inventory_management/store/IGoodsStoreService.class b/target/classes/com/rabbiter/market/service/inventory_management/store/IGoodsStoreService.class new file mode 100644 index 0000000..b6ec0d8 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/inventory_management/store/IGoodsStoreService.class differ diff --git a/target/classes/com/rabbiter/market/service/inventory_management/store/IStoreService.class b/target/classes/com/rabbiter/market/service/inventory_management/store/IStoreService.class new file mode 100644 index 0000000..6a310d5 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/inventory_management/store/IStoreService.class differ diff --git a/target/classes/com/rabbiter/market/service/inventory_management/store/impl/GoodsStoreServiceImpl.class b/target/classes/com/rabbiter/market/service/inventory_management/store/impl/GoodsStoreServiceImpl.class new file mode 100644 index 0000000..82414c6 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/inventory_management/store/impl/GoodsStoreServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/inventory_management/store/impl/StoreServiceImpl.class b/target/classes/com/rabbiter/market/service/inventory_management/store/impl/StoreServiceImpl.class new file mode 100644 index 0000000..2cbaf76 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/inventory_management/store/impl/StoreServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/inventory_management/supplier/ISupplierService.class b/target/classes/com/rabbiter/market/service/inventory_management/supplier/ISupplierService.class new file mode 100644 index 0000000..5e60bd3 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/inventory_management/supplier/ISupplierService.class differ diff --git a/target/classes/com/rabbiter/market/service/inventory_management/supplier/impl/SupplierServiceImpl.class b/target/classes/com/rabbiter/market/service/inventory_management/supplier/impl/SupplierServiceImpl.class new file mode 100644 index 0000000..6af0b15 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/inventory_management/supplier/impl/SupplierServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/login/ILoginService.class b/target/classes/com/rabbiter/market/service/login/ILoginService.class new file mode 100644 index 0000000..e2bdaf4 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/login/ILoginService.class differ diff --git a/target/classes/com/rabbiter/market/service/login/impl/LoginServiceImpl.class b/target/classes/com/rabbiter/market/service/login/impl/LoginServiceImpl.class new file mode 100644 index 0000000..0290c77 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/login/impl/LoginServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/member_management/member/IMemberService.class b/target/classes/com/rabbiter/market/service/member_management/member/IMemberService.class new file mode 100644 index 0000000..32c9cda Binary files /dev/null and b/target/classes/com/rabbiter/market/service/member_management/member/IMemberService.class differ diff --git a/target/classes/com/rabbiter/market/service/member_management/member/impl/MemberServiceImpl.class b/target/classes/com/rabbiter/market/service/member_management/member/impl/MemberServiceImpl.class new file mode 100644 index 0000000..3c87cb3 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/member_management/member/impl/MemberServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/personnel_management/employee/IEmployeeService.class b/target/classes/com/rabbiter/market/service/personnel_management/employee/IEmployeeService.class new file mode 100644 index 0000000..2d075df Binary files /dev/null and b/target/classes/com/rabbiter/market/service/personnel_management/employee/IEmployeeService.class differ diff --git a/target/classes/com/rabbiter/market/service/personnel_management/employee/impl/EmployeeServiceImpl.class b/target/classes/com/rabbiter/market/service/personnel_management/employee/impl/EmployeeServiceImpl.class new file mode 100644 index 0000000..6fbb870 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/personnel_management/employee/impl/EmployeeServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/personnel_management/personnel_management/department/IDeptService.class b/target/classes/com/rabbiter/market/service/personnel_management/personnel_management/department/IDeptService.class new file mode 100644 index 0000000..a8fd83a Binary files /dev/null and b/target/classes/com/rabbiter/market/service/personnel_management/personnel_management/department/IDeptService.class differ diff --git a/target/classes/com/rabbiter/market/service/personnel_management/personnel_management/department/impl/DeptServiceImpl.class b/target/classes/com/rabbiter/market/service/personnel_management/personnel_management/department/impl/DeptServiceImpl.class new file mode 100644 index 0000000..b193c99 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/personnel_management/personnel_management/department/impl/DeptServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/sale_management/detail_sale_records/IDetailSaleRecordsService.class b/target/classes/com/rabbiter/market/service/sale_management/detail_sale_records/IDetailSaleRecordsService.class new file mode 100644 index 0000000..7103e81 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/sale_management/detail_sale_records/IDetailSaleRecordsService.class differ diff --git a/target/classes/com/rabbiter/market/service/sale_management/detail_sale_records/impl/DetailSaleRecordsServiceImpl.class b/target/classes/com/rabbiter/market/service/sale_management/detail_sale_records/impl/DetailSaleRecordsServiceImpl.class new file mode 100644 index 0000000..578c840 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/sale_management/detail_sale_records/impl/DetailSaleRecordsServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/sale_management/exchange_point_products/IExchangePointProductsService.class b/target/classes/com/rabbiter/market/service/sale_management/exchange_point_products/IExchangePointProductsService.class new file mode 100644 index 0000000..2f6f73d Binary files /dev/null and b/target/classes/com/rabbiter/market/service/sale_management/exchange_point_products/IExchangePointProductsService.class differ diff --git a/target/classes/com/rabbiter/market/service/sale_management/exchange_point_products/impl/ExchangePointProductsServiceImpl.class b/target/classes/com/rabbiter/market/service/sale_management/exchange_point_products/impl/ExchangePointProductsServiceImpl.class new file mode 100644 index 0000000..e18291c Binary files /dev/null and b/target/classes/com/rabbiter/market/service/sale_management/exchange_point_products/impl/ExchangePointProductsServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/sale_management/sale_records/ISaleRecordsService.class b/target/classes/com/rabbiter/market/service/sale_management/sale_records/ISaleRecordsService.class new file mode 100644 index 0000000..82b312d Binary files /dev/null and b/target/classes/com/rabbiter/market/service/sale_management/sale_records/ISaleRecordsService.class differ diff --git a/target/classes/com/rabbiter/market/service/sale_management/sale_records/impl/SaleRecordsServiceImpl.class b/target/classes/com/rabbiter/market/service/sale_management/sale_records/impl/SaleRecordsServiceImpl.class new file mode 100644 index 0000000..2c9c519 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/sale_management/sale_records/impl/SaleRecordsServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/system/menu/IMenuService.class b/target/classes/com/rabbiter/market/service/system/menu/IMenuService.class new file mode 100644 index 0000000..5aba3b4 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/system/menu/IMenuService.class differ diff --git a/target/classes/com/rabbiter/market/service/system/menu/impl/MenuServiceImpl.class b/target/classes/com/rabbiter/market/service/system/menu/impl/MenuServiceImpl.class new file mode 100644 index 0000000..5938959 Binary files /dev/null and b/target/classes/com/rabbiter/market/service/system/menu/impl/MenuServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/service/system/role/IRoleService.class b/target/classes/com/rabbiter/market/service/system/role/IRoleService.class new file mode 100644 index 0000000..98913fd Binary files /dev/null and b/target/classes/com/rabbiter/market/service/system/role/IRoleService.class differ diff --git a/target/classes/com/rabbiter/market/service/system/role/impl/RoleServiceImpl.class b/target/classes/com/rabbiter/market/service/system/role/impl/RoleServiceImpl.class new file mode 100644 index 0000000..77620cb Binary files /dev/null and b/target/classes/com/rabbiter/market/service/system/role/impl/RoleServiceImpl.class differ diff --git a/target/classes/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsOutVo.class b/target/classes/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsOutVo.class new file mode 100644 index 0000000..aa42252 Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsOutVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsVo.class b/target/classes/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsVo.class new file mode 100644 index 0000000..17d7b5a Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/detail_store_goods/DetailStoreGoodsVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/detail_store_goods/notice/NoticeInNotNormalVo.class b/target/classes/com/rabbiter/market/vo/detail_store_goods/notice/NoticeInNotNormalVo.class new file mode 100644 index 0000000..64c1997 Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/detail_store_goods/notice/NoticeInNotNormalVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/employee/DetailEmpVo.class b/target/classes/com/rabbiter/market/vo/employee/DetailEmpVo.class new file mode 100644 index 0000000..e644aea Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/employee/DetailEmpVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/employee/EditEmpVo.class b/target/classes/com/rabbiter/market/vo/employee/EditEmpVo.class new file mode 100644 index 0000000..e6505f3 Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/employee/EditEmpVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/employee/InformationVo.class b/target/classes/com/rabbiter/market/vo/employee/InformationVo.class new file mode 100644 index 0000000..854d3c3 Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/employee/InformationVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/goods/GoodsListVo.class b/target/classes/com/rabbiter/market/vo/goods/GoodsListVo.class new file mode 100644 index 0000000..b1b2ffc Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/goods/GoodsListVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/goods_management/goods_store/GoodsStoreVo.class b/target/classes/com/rabbiter/market/vo/goods_management/goods_store/GoodsStoreVo.class new file mode 100644 index 0000000..3fc9f54 Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/goods_management/goods_store/GoodsStoreVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/role/RolePermissonVo$RoleMenu.class b/target/classes/com/rabbiter/market/vo/role/RolePermissonVo$RoleMenu.class new file mode 100644 index 0000000..adcc6ff Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/role/RolePermissonVo$RoleMenu.class differ diff --git a/target/classes/com/rabbiter/market/vo/role/RolePermissonVo.class b/target/classes/com/rabbiter/market/vo/role/RolePermissonVo.class new file mode 100644 index 0000000..03d822a Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/role/RolePermissonVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/statistics/sale_management/SaleGoodsVo.class b/target/classes/com/rabbiter/market/vo/statistics/sale_management/SaleGoodsVo.class new file mode 100644 index 0000000..33d22d8 Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/statistics/sale_management/SaleGoodsVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/statistics/sale_management/SalesStatisticsVo.class b/target/classes/com/rabbiter/market/vo/statistics/sale_management/SalesStatisticsVo.class new file mode 100644 index 0000000..849a208 Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/statistics/sale_management/SalesStatisticsVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/statistics/storage_situation/DetailStorageSituationVo.class b/target/classes/com/rabbiter/market/vo/statistics/storage_situation/DetailStorageSituationVo.class new file mode 100644 index 0000000..d382fb3 Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/statistics/storage_situation/DetailStorageSituationVo.class differ diff --git a/target/classes/com/rabbiter/market/vo/statistics/storage_situation/StorageSituationVo.class b/target/classes/com/rabbiter/market/vo/statistics/storage_situation/StorageSituationVo.class new file mode 100644 index 0000000..d86599d Binary files /dev/null and b/target/classes/com/rabbiter/market/vo/statistics/storage_situation/StorageSituationVo.class differ diff --git a/target/classes/static/files/1694324278293_file.jpg b/target/classes/static/files/1694324278293_file.jpg new file mode 100644 index 0000000..a00a5ba Binary files /dev/null and b/target/classes/static/files/1694324278293_file.jpg differ diff --git a/target/classes/static/files/1694434162457_07.jpg b/target/classes/static/files/1694434162457_07.jpg new file mode 100644 index 0000000..985d64e Binary files /dev/null and b/target/classes/static/files/1694434162457_07.jpg differ diff --git a/target/classes/static/files/1694434783850_04.jpg b/target/classes/static/files/1694434783850_04.jpg new file mode 100644 index 0000000..17b4bf5 Binary files /dev/null and b/target/classes/static/files/1694434783850_04.jpg differ diff --git a/target/classes/static/files/1694434840737_05.jpg b/target/classes/static/files/1694434840737_05.jpg new file mode 100644 index 0000000..9ff2682 Binary files /dev/null and b/target/classes/static/files/1694434840737_05.jpg differ diff --git a/target/classes/static/files/1694434883855_03.jpg b/target/classes/static/files/1694434883855_03.jpg new file mode 100644 index 0000000..69fffd4 Binary files /dev/null and b/target/classes/static/files/1694434883855_03.jpg differ diff --git a/target/classes/static/files/1694434945440_02.jpg b/target/classes/static/files/1694434945440_02.jpg new file mode 100644 index 0000000..55ae8cb Binary files /dev/null and b/target/classes/static/files/1694434945440_02.jpg differ diff --git a/target/classes/static/files/1694435421618_e04f06dc02b84d38bc4d1ba2b39add0d.jpg b/target/classes/static/files/1694435421618_e04f06dc02b84d38bc4d1ba2b39add0d.jpg new file mode 100644 index 0000000..40ec0d0 Binary files /dev/null and b/target/classes/static/files/1694435421618_e04f06dc02b84d38bc4d1ba2b39add0d.jpg differ