初始化项目

This commit is contained in:
2024-10-29 12:10:22 +08:00
commit 029195fbbc
847 changed files with 125861 additions and 0 deletions

124
mall-admin/pom.xml Normal file
View File

@@ -0,0 +1,124 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.buy507.mall</groupId>
<artifactId>mall-admin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mall-admin</name>
<description>mall-admin project for mall</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<skipTests>true</skipTests>
</properties>
<parent>
<groupId>com.buy507.mall</groupId>
<artifactId>mall</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.buy507.mall</groupId>
<artifactId>mall-dao</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!--JWT(Json Web Token)登录支持-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
<!--redis依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--集成消息队列-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<!-- 阿里云OSS -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.5.0</version>
</dependency>
<!--集成logstash-->
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>4.8</version>
</dependency>
<!--lombok依赖-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- poi excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--<plugin>-->
<!--<groupId>com.spotify</groupId>-->
<!--<artifactId>docker-maven-plugin</artifactId>-->
<!--<version>1.1.0</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>build-image</id>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>build</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<imageName>mall/${project.artifactId}:${project.version}</imageName>-->
<!--<dockerHost>http://39.98.190.128:2375</dockerHost>-->
<!--<baseImage>java:8</baseImage>-->
<!--<entryPoint>["java", "-jar", "-Dspring.profiles.active=prod","/${project.build.finalName}.jar"]</entryPoint>-->
<!--<resources>-->
<!--<resource>-->
<!--<targetPath>/</targetPath>-->
<!--<directory>${project.build.directory}</directory>-->
<!--<include>${project.build.finalName}.jar</include>-->
<!--</resource>-->
<!--</resources>-->
<!--</configuration>-->
<!--</plugin>-->
</plugins>
</build>
</project>

View File

@@ -0,0 +1,25 @@
package com.buy507.mall;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
/**
* 应用启动入口
*/
@EnableTransactionManagement
@SpringBootApplication
public class MallAdminApplication {
public static void main(String[] args) {
SpringApplication.run(MallAdminApplication.class, args);
}
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}

View File

@@ -0,0 +1,62 @@
package com.buy507.mall.bo;
import com.buy507.mall.model.UmsAdmin;
import com.buy507.mall.model.UmsPermission;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
* SpringSecurity需要的用户详情
*/
public class AdminUserDetails implements UserDetails {
private UmsAdmin umsAdmin;
private List<UmsPermission> permissionList;
public AdminUserDetails(UmsAdmin umsAdmin,List<UmsPermission> permissionList) {
this.umsAdmin = umsAdmin;
this.permissionList = permissionList;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
//返回当前用户的权限
return permissionList.stream()
.filter(permission -> permission.getValue()!=null)
.map(permission ->new SimpleGrantedAuthority(permission.getValue()))
.collect(Collectors.toList());
}
@Override
public String getPassword() {
return umsAdmin.getPassword();
}
@Override
public String getUsername() {
return umsAdmin.getUsername();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return umsAdmin.getStatus().equals(1);
}
}

View File

@@ -0,0 +1,143 @@
package com.buy507.mall.bo;
/**
* Controller层的日志封装类
*/
public class WebLog {
/**
* 操作描述
*/
private String description;
/**
* 操作用户
*/
private String username;
/**
* 操作时间
*/
private Long startTime;
/**
* 消耗时间
*/
private Integer spendTime;
/**
* 根路径
*/
private String basePath;
/**
* URI
*/
private String uri;
/**
* URL
*/
private String url;
/**
* 请求类型
*/
private String method;
/**
* IP地址
*/
private String ip;
private Object parameter;
private Object result;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Integer getSpendTime() {
return spendTime;
}
public void setSpendTime(Integer spendTime) {
this.spendTime = spendTime;
}
public String getBasePath() {
return basePath;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Object getParameter() {
return parameter;
}
public void setParameter(Object parameter) {
this.parameter = parameter;
}
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
}

View File

@@ -0,0 +1,29 @@
package com.buy507.mall.component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.buy507.mall.service.OmsOrderService;
/**
* 自动确认收货消息的处理者
*/
@Component
@RabbitListener(queues = "mall.receiving.confirm")
public class AutoConfirmReceivingReceiver {
private static Logger LOGGER = LoggerFactory.getLogger(AutoConfirmReceivingReceiver.class);
@Autowired
private OmsOrderService orderService;
@RabbitHandler
public void handle(Long orderId){
LOGGER.info("Confirm receiving receive orderId:{}", orderId);
orderService.confirmReceiving(orderId, true);
}
}

View File

@@ -0,0 +1,37 @@
package com.buy507.mall.component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.buy507.mall.dto.ReceivingQueueEnum;
/**
* 自动确认收货消息的发出者
*/
@Component
public class AutoConfirmReceivingSender {
private static Logger LOGGER = LoggerFactory.getLogger(AutoConfirmReceivingSender.class);
@Autowired
private AmqpTemplate amqpTemplate;
public void sendMessage(Long orderId, final long delayTimes){
//给延迟队列发送消息
amqpTemplate.convertAndSend(ReceivingQueueEnum.QUEUE_TTL_RECEIVING_CONFIRM.getExchange(), ReceivingQueueEnum.QUEUE_TTL_RECEIVING_CONFIRM.getRouteKey(), orderId, new MessagePostProcessor() {
@Override
public Message postProcessMessage(Message message) throws AmqpException {
//给消息设置延迟毫秒值
message.getMessageProperties().setExpiration(String.valueOf(delayTimes));
return message;
}
});
LOGGER.info("Confirm receiving send orderId:{}", orderId);
}
}

View File

@@ -0,0 +1,42 @@
package com.buy507.mall.component;
import com.buy507.mall.common.api.CommonResult;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
/**
* HibernateValidator错误结果处理切面
*/
@Aspect
@Component
@Order(2)
public class BindingResultAspect {
@Pointcut("execution(public * com.buy507.mall.controller.*.*(..))")
public void BindingResult() {
}
@Around("BindingResult()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
Object[] args = joinPoint.getArgs();
for (Object arg : args) {
if (arg instanceof BindingResult) {
BindingResult result = (BindingResult) arg;
if (result.hasErrors()) {
FieldError fieldError = result.getFieldError();
if(fieldError!=null){
return CommonResult.validateFailed(fieldError.getDefaultMessage());
}else{
return CommonResult.validateFailed();
}
}
}
}
return joinPoint.proceed();
}
}

View File

@@ -0,0 +1,100 @@
package com.buy507.mall.component;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import com.buy507.mall.mapper.OmsOrderMapper;
import com.buy507.mall.model.OmsOrder;
import com.buy507.mall.service.DistributionService;
/**
* 分销冻结账户队列处理类
* @author wuming
*
*/
@Component
public class DistributeHandlerQueue implements CommandLineRunner {
private static final Logger LOGGER = LoggerFactory.getLogger(DistributeHandlerQueue.class);
private static LinkedBlockingQueue<Long> queue = new LinkedBlockingQueue<>();
@Autowired
private DistributionService distributionService;
@Autowired
private ExecutorService executorService;
@Autowired
private OmsOrderMapper orderMapper;
@Override
public void run(String... args) throws Exception {
executorService.execute(new Runnable() {
@Override
public void run() {
while(true) {
Long orderId = null;
try {
LOGGER.info("distribution handler queue size: {}", queue.size());
orderId = queue.take();
LOGGER.info("distribution handler start: {}", orderId);
OmsOrder order = orderMapper.selectByPrimaryKey(orderId);
//1. 分享劳务费和服务劳务费计算
distributionService.computeRefereeCharge(order.getMemberId(), order);
//2. 店补计算
distributionService.computeStoreSubsidy(order.getMemberId(), order);
//3. 上级团队的累计消费信息
distributionService.computeTeamTotalConsume(order.getMemberId(), order);
//4. 团队服务劳务费计算
distributionService.computeTeamIncome(order.getMemberId(), order);
//5. 会员等级计算,根据参数和消费情况计算会员等级
distributionService.computMemberLevel(order.getMemberId(), order);
LOGGER.info("distribution handler end: {}", orderId);
LOGGER.info("distribution handler queue size: {}", queue.size());
} catch (InterruptedException e) {
LOGGER.error("distribution handler failed");
e.printStackTrace();
} catch (Exception e) {
if(orderId != null) {
LOGGER.error("distribution handler failed: {}", orderId);
} else {
LOGGER.error("distribution handler failed");
}
e.printStackTrace();
}
}
}
});
}
/**
* 添加订单到分销处理队列中
* @param order
*/
public static void addOrderToQueue(Long orderId) {
try {
queue.put(orderId);
} catch (InterruptedException e) {
LOGGER.error("distribution add order to queue failed: {}", orderId);
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,23 @@
package com.buy507.mall.component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
/**
* 分销预结算消息的处理者
*/
@Component
@RabbitListener(queues = "mall.distribute.compute")
public class DistributeReceiver {
private static Logger LOGGER = LoggerFactory.getLogger(DistributeReceiver.class);
@RabbitHandler
public void handle(Long orderId){
LOGGER.info("Distribute receive orderId:{}", orderId);
DistributeHandlerQueue.addOrderToQueue(orderId);
}
}

View File

@@ -0,0 +1,24 @@
package com.buy507.mall.component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 分销预结算消息的发出者
*/
@Component
public class DistributeSender {
private static Logger LOGGER = LoggerFactory.getLogger(DistributeSender.class);
@Autowired
private AmqpTemplate amqpTemplate;
public void sendMessage(Long orderId){
amqpTemplate.convertAndSend("mall.distribute.compute", orderId);
LOGGER.info("Distribute send orderId:{}", orderId);
}
}

View File

@@ -0,0 +1,61 @@
package com.buy507.mall.component;
import com.buy507.mall.util.JwtTokenUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* JWT登录授权过滤器
*/
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
private static final Logger LOGGER = LoggerFactory.getLogger(JwtAuthenticationTokenFilter.class);
@Autowired
private UserDetailsService userDetailsService;
@Autowired
private JwtTokenUtil jwtTokenUtil;
@Value("${jwt.tokenHeader}")
private String tokenHeader;
@Value("${jwt.tokenHead}")
private String tokenHead;
@Override
protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain) throws ServletException, IOException {
String authHeader = request.getHeader(this.tokenHeader);
if (authHeader != null && authHeader.startsWith(this.tokenHead)) {
String authToken = authHeader.substring(this.tokenHead.length());// The part after "Bearer "
String username = jwtTokenUtil.getUserNameFromToken(authToken);
LOGGER.info("checking username:{}", username);
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
if (jwtTokenUtil.validateToken(authToken, userDetails)) {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
LOGGER.info("authenticated user:{}", username);
SecurityContextHolder.getContext().setAuthentication(authentication);
}
}
}
chain.doFilter(request, response);
}
}

View File

@@ -0,0 +1,65 @@
package com.buy507.mall.component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@Component
public class RedisLock {
private static final Logger LOGGER = LoggerFactory.getLogger(RedisLock.class);
@Autowired
private StringRedisTemplate stringRedisTemplate;
public static final int TIMEOUT = 60 * 1000; //超时时间 60s
/**
* 加锁
* @param key 唯一标识
* @param value 当前时间 + 超时时间 也就是时间戳
* @return
*/
public boolean lock(String key, String value){
if(stringRedisTemplate.opsForValue().setIfAbsent(key, value)){//对应setnx命令
//可以成功设置,也就是key不存在
return true;
}
//判断锁超时 - 防止原来的操作异常,没有运行解锁操作 防止死锁
String currentValue = stringRedisTemplate.opsForValue().get(key);
//如果锁过期
if(!StringUtils.isEmpty(currentValue) && Long.parseLong(currentValue) < System.currentTimeMillis()){//currentValue不为空且小于当前时间
//获取上一个锁的时间value
String oldValue = stringRedisTemplate.opsForValue().getAndSet(key, value);//对应getset如果key存在
//假设两个线程同时进来这里因为key被占用了而且锁过期了。获取的值currentValue=A(get取的旧的值肯定是一样的),两个线程的value都是B,key都是K.锁时间已经过期了。
//而这里面的getAndSet一次只会一个执行也就是一个执行之后上一个的value已经变成了B。只有一个线程获取的上一个值会是A另一个线程拿到的值是B。
if(!StringUtils.isEmpty(oldValue) && oldValue.equals(currentValue) ){
//oldValue不为空且oldValue等于currentValue也就是校验是不是上个对应的商品时间戳也是防止并发
return true;
}
}
return false;
}
/**
* 解锁
* @param key
* @param value
*/
public void unlock(String key, String value){
try {
String currentValue = stringRedisTemplate.opsForValue().get(key);
if(!StringUtils.isEmpty(currentValue) && currentValue.equals(value) ){
stringRedisTemplate.opsForValue().getOperations().delete(key);//删除key
}
} catch (Exception e) {
LOGGER.error("[Redis distributed lock] failed: {}", e);
}
}
}

View File

@@ -0,0 +1,26 @@
package com.buy507.mall.component;
import cn.hutool.json.JSONUtil;
import com.buy507.mall.common.api.CommonResult;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 当未登录或者token失效访问接口时自定义的返回结果
*/
@Component
public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(JSONUtil.parse(CommonResult.unauthorized(authException.getMessage())));
response.getWriter().flush();
}
}

View File

@@ -0,0 +1,28 @@
package com.buy507.mall.component;
import cn.hutool.json.JSONUtil;
import com.buy507.mall.common.api.CommonResult;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 当访问接口没有权限时,自定义的返回结果
*/
@Component
public class RestfulAccessDeniedHandler implements AccessDeniedHandler{
@Override
public void handle(HttpServletRequest request,
HttpServletResponse response,
AccessDeniedException e) throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(JSONUtil.parse(CommonResult.forbidden(e.getMessage())));
response.getWriter().flush();
}
}

View File

@@ -0,0 +1,123 @@
package com.buy507.mall.component;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.buy507.mall.bo.WebLog;
import io.swagger.annotations.ApiOperation;
import net.logstash.logback.marker.Markers;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.*;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 统一日志处理切面
*/
@Aspect
@Component
@Order(1)
public class WebLogAspect {
private static final Logger LOGGER = LoggerFactory.getLogger(WebLogAspect.class);
private ThreadLocal<Long> startTime = new ThreadLocal<>();
@Pointcut("execution(public * com.buy507.mall.controller.*.*(..))")
public void webLog() {
}
@Before("webLog()")
public void doBefore(JoinPoint joinPoint) throws Throwable {
startTime.set(System.currentTimeMillis());
}
@AfterReturning(value = "webLog()", returning = "ret")
public void doAfterReturning(Object ret) throws Throwable {
}
@Around("webLog()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
//获取当前请求对象
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
//记录请求信息(通过logstash传入elasticsearch)
WebLog webLog = new WebLog();
Object result = joinPoint.proceed();
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method.isAnnotationPresent(ApiOperation.class)) {
ApiOperation log = method.getAnnotation(ApiOperation.class);
webLog.setDescription(log.value());
}
long endTime = System.currentTimeMillis();
String urlStr = request.getRequestURL().toString();
webLog.setBasePath(StrUtil.removeSuffix(urlStr, URLUtil.url(urlStr).getPath()));
webLog.setIp(request.getRemoteUser());
webLog.setMethod(request.getMethod());
webLog.setParameter(getParameter(method, joinPoint.getArgs()));
webLog.setResult(result);
webLog.setSpendTime((int) (endTime - startTime.get()));
webLog.setStartTime(startTime.get());
webLog.setUri(request.getRequestURI());
webLog.setUrl(request.getRequestURL().toString());
Map<String,Object> logMap = new HashMap<>();
logMap.put("url",webLog.getUrl());
logMap.put("method",webLog.getMethod());
logMap.put("parameter",webLog.getParameter());
logMap.put("spendTime",webLog.getSpendTime());
logMap.put("description",webLog.getDescription());
// LOGGER.info("{}", JSONUtil.parse(webLog));
LOGGER.info(Markers.appendEntries(logMap), JSONUtil.parse(webLog).toString());
return result;
}
/**
* 根据方法和传入的参数获取请求参数
*/
private Object getParameter(Method method, Object[] args) {
List<Object> argList = new ArrayList<>();
Parameter[] parameters = method.getParameters();
for (int i = 0; i < parameters.length; i++) {
RequestBody requestBody = parameters[i].getAnnotation(RequestBody.class);
if (requestBody != null) {
argList.add(args[i]);
}
RequestParam requestParam = parameters[i].getAnnotation(RequestParam.class);
if (requestParam != null) {
Map<String, Object> map = new HashMap<>();
String key = parameters[i].getName();
if (!StringUtils.isEmpty(requestParam.value())) {
key = requestParam.value();
}
map.put(key, args[i]);
argList.add(map);
}
}
if (argList.size() == 0) {
return null;
} else if (argList.size() == 1) {
return argList.get(0);
} else {
return argList;
}
}
}

View File

@@ -0,0 +1,14 @@
package com.buy507.mall.config;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* MyBatis配置类
*/
@Configuration
@EnableTransactionManagement
@MapperScan({"com.buy507.mall.mapper","com.buy507.mall.dao"})
public class MyBatisConfig {
}

View File

@@ -0,0 +1,23 @@
package com.buy507.mall.config;
import com.aliyun.oss.OSSClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 阿里云配置类
*/
@Configuration
public class OssConfig {
@Value("${aliyun.oss.endpoint}")
private String ALIYUN_OSS_ENDPOINT;
@Value("${aliyun.oss.accessKeyId}")
private String ALIYUN_OSS_ACCESSKEYID;
@Value("${aliyun.oss.accessKeySecret}")
private String ALIYUN_OSS_ACCESSKEYSECRET;
@Bean
public OSSClient ossClient(){
return new OSSClient(ALIYUN_OSS_ENDPOINT,ALIYUN_OSS_ACCESSKEYID,ALIYUN_OSS_ACCESSKEYSECRET);
}
}

View File

@@ -0,0 +1,21 @@
package com.buy507.mall.config;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 分销结算消息队列配置
*/
@Configuration
public class RabbitMqDistributeConfig {
/**
* 分销结算实际消费队列
*/
@Bean
public Queue predistributeQueue() {
return new Queue("mall.distribute.compute");
}
}

View File

@@ -0,0 +1,84 @@
package com.buy507.mall.config;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.ExchangeBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.buy507.mall.dto.ReceivingQueueEnum;
/**
* 自动确认收货消息队列配置
*/
@Configuration
public class RabbitMqReceivingConfig {
/**
* 自动确认收货消息实际消费队列所绑定的交换机
*/
@Bean
DirectExchange receivingDirect() {
return (DirectExchange) ExchangeBuilder
.directExchange(ReceivingQueueEnum.QUEUE_RECEIVING_CONFIRM.getExchange())
.durable(true)
.build();
}
/**
* 自动确认收货延迟队列队列所绑定的交换机
*/
@Bean
DirectExchange receivingTtlDirect() {
return (DirectExchange) ExchangeBuilder
.directExchange(ReceivingQueueEnum.QUEUE_TTL_RECEIVING_CONFIRM.getExchange())
.durable(true)
.build();
}
/**
* 自动确认收货实际消费队列
*/
@Bean
public Queue receivingQueue() {
return new Queue(ReceivingQueueEnum.QUEUE_RECEIVING_CONFIRM.getName());
}
/**
* 自动确认收货延迟队列(死信队列)
*/
@Bean
public Queue receivingTtlQueue() {
return QueueBuilder
.durable(ReceivingQueueEnum.QUEUE_TTL_RECEIVING_CONFIRM.getName())
.withArgument("x-dead-letter-exchange", ReceivingQueueEnum.QUEUE_RECEIVING_CONFIRM.getExchange())//到期后转发的交换机
.withArgument("x-dead-letter-routing-key", ReceivingQueueEnum.QUEUE_RECEIVING_CONFIRM.getRouteKey())//到期后转发的路由键
.build();
}
/**
* 将自动确认收货队列绑定到交换机
*/
@Bean
Binding receivingBinding(DirectExchange receivingDirect, Queue receivingQueue){
return BindingBuilder
.bind(receivingQueue)
.to(receivingDirect)
.with(ReceivingQueueEnum.QUEUE_RECEIVING_CONFIRM.getRouteKey());
}
/**
* 将自动确认收货延迟队列绑定到交换机
*/
@Bean
Binding receivingTtlBinding(DirectExchange receivingTtlDirect, Queue receivingTtlQueue){
return BindingBuilder
.bind(receivingTtlQueue)
.to(receivingTtlDirect)
.with(ReceivingQueueEnum.QUEUE_TTL_RECEIVING_CONFIRM.getRouteKey());
}
}

View File

@@ -0,0 +1,137 @@
package com.buy507.mall.config;
import com.buy507.mall.bo.AdminUserDetails;
import com.buy507.mall.component.JwtAuthenticationTokenFilter;
import com.buy507.mall.component.RestAuthenticationEntryPoint;
import com.buy507.mall.component.RestfulAccessDeniedHandler;
import com.buy507.mall.model.UmsAdmin;
import com.buy507.mall.model.UmsPermission;
import com.buy507.mall.service.UmsAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.util.List;
/**
* SpringSecurity的配置
*/
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled=true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UmsAdminService adminService;
@Autowired
private RestfulAccessDeniedHandler restfulAccessDeniedHandler;
@Autowired
private RestAuthenticationEntryPoint restAuthenticationEntryPoint;
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity.csrf()// 由于使用的是JWT我们这里不需要csrf
.disable()
.sessionManagement()// 基于token所以不需要session
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers(HttpMethod.GET, // 允许对于网站静态资源的无授权访问
"/",
"/*.html",
"/favicon.ico",
"/**/*.html",
"/**/*.css",
"/**/*.js",
"/swagger-resources/**",
"/v2/api-docs/**"
)
.permitAll()
.antMatchers("/admin/login", "/admin/register")// 对登录注册要允许匿名访问
.permitAll()
.antMatchers(HttpMethod.OPTIONS)//跨域请求会先进行一次options请求
.permitAll()
.antMatchers("/**")//测试时全部运行访问
.permitAll()
.anyRequest()// 除上面外的所有请求全部需要鉴权认证
.authenticated();
// 禁用缓存
httpSecurity.headers().cacheControl();
// 添加JWT filter
httpSecurity.addFilterBefore(jwtAuthenticationTokenFilter(), UsernamePasswordAuthenticationFilter.class);
//添加自定义未授权和未登录结果返回
httpSecurity.exceptionHandling()
.accessDeniedHandler(restfulAccessDeniedHandler)
.authenticationEntryPoint(restAuthenticationEntryPoint);
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService())
.passwordEncoder(passwordEncoder());
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Bean
public UserDetailsService userDetailsService() {
//获取登录用户信息
return username -> {
UmsAdmin admin = adminService.getAdminByUsername(username);
if (admin != null) {
List<UmsPermission> permissionList = adminService.getPermissionList(admin.getId());
return new AdminUserDetails(admin, permissionList);
}
throw new UsernameNotFoundException("用户名或密码错误");
};
}
@Bean
public JwtAuthenticationTokenFilter jwtAuthenticationTokenFilter(){
return new JwtAuthenticationTokenFilter();
}
/**
* 允许跨域调用的过滤器
*/
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.addAllowedOrigin("*");
config.setAllowCredentials(true);
config.addAllowedHeader("*");
config.addAllowedMethod("*");
source.registerCorsConfiguration("/**", config);
FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
bean.setOrder(0);
return new CorsFilter(source);
}
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
}

View File

@@ -0,0 +1,79 @@
package com.buy507.mall.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
/**
* Swagger2API文档的配置
*/
@Configuration
@EnableSwagger2
public class Swagger2Config {
@Bean
public Docket createRestApi(){
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.buy507.mall.controller"))
.paths(PathSelectors.any())
.build()
.securitySchemes(securitySchemes())
.securityContexts(securityContexts());
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("mall后台系统")
.description("mall后台模块")
.contact("buy507")
.version("1.0")
.build();
}
private List<ApiKey> securitySchemes() {
//设置请求头信息
List<ApiKey> result = new ArrayList<>();
ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
result.add(apiKey);
return result;
}
private List<SecurityContext> securityContexts() {
//设置需要登录认证的路径
List<SecurityContext> result = new ArrayList<>();
result.add(getContextByPath("/brand/.*"));
result.add(getContextByPath("/product/.*"));
result.add(getContextByPath("/productCategory/.*"));
return result;
}
private SecurityContext getContextByPath(String pathRegex){
return SecurityContext.builder()
.securityReferences(defaultAuth())
.forPaths(PathSelectors.regex(pathRegex))
.build();
}
private List<SecurityReference> defaultAuth() {
List<SecurityReference> result = new ArrayList<>();
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
result.add(new SecurityReference("Authorization", authorizationScopes));
return result;
}
}

View File

@@ -0,0 +1,22 @@
package com.buy507.mall.config;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 线程池初始化
* @author yeyun
*
*/
@Configuration
public class ThreadPoolConfig {
@Bean
public ExecutorService getThreadPool() {
return Executors.newCachedThreadPool();
}
}

View File

@@ -0,0 +1,33 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.CmsPrefrenceArea;
import com.buy507.mall.service.CmsPrefrenceAreaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 商品优选管理Controller
*/
@Controller
@Api(tags = "CmsPrefrenceAreaController", description = "商品优选管理")
@RequestMapping("/prefrenceArea")
public class CmsPrefrenceAreaController {
@Autowired
private CmsPrefrenceAreaService prefrenceAreaService;
@ApiOperation("获取所有商品优选")
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<CmsPrefrenceArea>> listAll() {
List<CmsPrefrenceArea> prefrenceAreaList = prefrenceAreaService.listAll();
return CommonResult.success(prefrenceAreaList);
}
}

View File

@@ -0,0 +1,45 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.CmsSubject;
import com.buy507.mall.service.CmsSubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 商品专题Controller
*/
@Controller
@Api(tags = "CmsSubjectController", description = "商品专题管理")
@RequestMapping("/subject")
public class CmsSubjectController {
@Autowired
private CmsSubjectService subjectService;
@ApiOperation("获取全部商品专题")
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<CmsSubject>> listAll() {
List<CmsSubject> subjectList = subjectService.listAll();
return CommonResult.success(subjectList);
}
@ApiOperation(value = "根据专题名称分页获取专题")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<CmsSubject>> getList(@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
List<CmsSubject> subjectList = subjectService.list(keyword, pageNum, pageSize);
return CommonResult.success(CommonPage.restPage(subjectList));
}
}

View File

@@ -0,0 +1,32 @@
package com.buy507.mall.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.DmsDistributionDictionary;
import com.buy507.mall.service.DmsDistributionDictionaryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@RestController
@Api(tags = "DmsDistributionDictionaryController", description = "分销参数管理")
@RequestMapping("/distribution/dictionary")
public class DmsDistributionDictionaryController {
@Autowired
private DmsDistributionDictionaryService service;
@ApiOperation("查询分销字典信息")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<List<DmsDistributionDictionary>> list() {
List<DmsDistributionDictionary> list = service.list();
return CommonResult.success(list);
}
}

View File

@@ -0,0 +1,88 @@
package com.buy507.mall.controller;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.MemberWithdrawApplyResult;
import com.buy507.mall.service.DmsMemberWithdrawApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@RestController
@Api(tags = "DmsMemberWithdrawApplyController", description = "会员提现申请管理")
@RequestMapping("/member/withdraw/apply")
public class DmsMemberWithdrawApplyController {
@Autowired
private DmsMemberWithdrawApplyService service;
@ApiOperation("分页查询提现申请")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<CommonPage<MemberWithdrawApplyResult>> list(
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "paymentStatus", required = false) Integer paymentStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<MemberWithdrawApplyResult> list = service.list(startTime, endTime, paymentStatus, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(list));
}
@ApiOperation("批量确认打款")
@RequestMapping(value = "/payment", method = RequestMethod.POST)
public CommonResult<String> payment(@RequestParam("ids") List<Long> ids) {
service.payment(ids);
return CommonResult.success(null);
}
@ApiOperation("打款失败")
@RequestMapping(value = "/payment/failed/{id}", method = RequestMethod.POST)
public CommonResult<String> paymentFailed(@PathVariable Long id, @RequestParam("failedReason") String failedReason) {
service.paymentFailed(id, failedReason);
return CommonResult.success(null);
}
@RequestMapping(value = "/exportExcel")
public ResponseEntity<byte[]> exportExcel(HttpServletResponse response,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "paymentStatus", required = false) Integer paymentStatus) throws IOException {
try {
Workbook wb = service.exportExcel(startTime, endTime, paymentStatus);
//设置Http响应头告诉浏览器下载这个附件
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Disposition", "attachment;Filename=" + System.currentTimeMillis() + ".xls");
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
ByteArrayOutputStream outByteStream = new ByteArrayOutputStream();
wb.write(outByteStream);
outByteStream.close();
return new ResponseEntity<byte[]>(outByteStream.toByteArray(), headers, HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
throw new IOException("导出Excel出现严重异常!");
}
}
}

View File

@@ -0,0 +1,124 @@
package com.buy507.mall.controller;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.ChartDescriptionResult;
import com.buy507.mall.dto.HomeResult;
import com.buy507.mall.dto.MemberShoppingInfoResult;
import com.buy507.mall.dto.MemberTeamInfoResult;
import com.buy507.mall.dto.OrderChartResult;
import com.buy507.mall.dto.WithdrawChartResult;
import com.buy507.mall.service.DmsQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@RestController
@Api(tags = "DmsQueryController", description = "统计查询管理")
@RequestMapping("/query")
public class DmsQueryController {
@Autowired
private DmsQueryService queryService;
@ApiOperation("查询首页信息")
@RequestMapping(value = "/getHomeInfo", method = RequestMethod.GET)
public CommonResult<HomeResult> getHomeInfo() {
return CommonResult.success(queryService.getHomeInfo());
}
@ApiOperation("获取订单图表")
@RequestMapping(value = "/getOrderChart", method = RequestMethod.GET)
public CommonResult<List<OrderChartResult>> getOrderChart(
@RequestParam(value = "startTime") String startTime,
@RequestParam(value = "endTime") String endTime) {
return CommonResult.success(queryService.getOrderChart(startTime, endTime));
}
@ApiOperation("获取图表描述")
@RequestMapping(value = "/getChartDescription", method = RequestMethod.GET)
public CommonResult<ChartDescriptionResult> getChartDescription() {
return CommonResult.success(queryService.getChartDescription());
}
@ApiOperation("获取提现图表")
@RequestMapping(value = "/getWithdrawChart", method = RequestMethod.GET)
public CommonResult<List<WithdrawChartResult>> getWithdrawChart(
@RequestParam(value = "startTime") String startTime,
@RequestParam(value = "endTime") String endTime) {
return CommonResult.success(queryService.getWithdrawChart(startTime, endTime));
}
@ApiOperation("分页查询会员团队信息")
@RequestMapping(value = "/memberTeamInfo", method = RequestMethod.GET)
public CommonResult<CommonPage<MemberTeamInfoResult>> memberTeamInfo(
@RequestParam(value = "nickname", required = false) String nickname,
@RequestParam(value = "inviterName", required = false) String inviterName,
@RequestParam(value = "inviterId", required = false) Long inviterId,
@RequestParam(value = "memberLevel", required = false) Integer memberLevel,
@RequestParam(value = "storeStatus", required = false) Integer storeStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<MemberTeamInfoResult> list = queryService.memberTeamInfo(nickname, inviterName, inviterId, memberLevel, storeStatus, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(list));
}
@ApiOperation("查询会员购物信息")
@RequestMapping(value = "/getMemberShoppingInfo", method = RequestMethod.GET)
public CommonResult<CommonPage<MemberShoppingInfoResult>> getMemberShoppingInfo(
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<MemberShoppingInfoResult> list = queryService.getMemberShoppingInfo(startTime, endTime, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(list));
}
@ApiOperation("导出会员购物信息")
@RequestMapping(value = "/exportExcel")
public ResponseEntity<byte[]> exportExcel(HttpServletResponse response,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime) throws IOException {
try {
Workbook wb = queryService.exportExcel(startTime, endTime);
//设置Http响应头告诉浏览器下载这个附件
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Disposition", "attachment;Filename=" + System.currentTimeMillis() + ".xls");
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
ByteArrayOutputStream outByteStream = new ByteArrayOutputStream();
wb.write(outByteStream);
outByteStream.close();
return new ResponseEntity<byte[]>(outByteStream.toByteArray(), headers, HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
throw new IOException("导出Excel出现严重异常!");
}
}
}

View File

@@ -0,0 +1,33 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.OmsCompanyAddress;
import com.buy507.mall.service.OmsCompanyAddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 收货地址管理Controller
*/
@Controller
@Api(tags = "OmsCompanyAddressController", description = "收货地址管理")
@RequestMapping("/companyAddress")
public class OmsCompanyAddressController {
@Autowired
private OmsCompanyAddressService companyAddressService;
@ApiOperation("获取所有收货地址")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<OmsCompanyAddress>> list() {
List<OmsCompanyAddress> companyAddressList = companyAddressService.list();
return CommonResult.success(companyAddressList);
}
}

View File

@@ -0,0 +1,28 @@
package com.buy507.mall.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.service.OmsExpressCompanyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = "OmsExpressCompanyController", description = "快递管理")
@RestController
@RequestMapping("/express")
public class OmsExpressCompanyController {
@Autowired
private OmsExpressCompanyService service;
@ApiOperation("获取快递公司信息")
@RequestMapping(value = "/list/expressOptions", method = RequestMethod.GET)
public CommonResult getExpressOptions() {
return CommonResult.success(service.getExpressOptions());
}
}

View File

@@ -0,0 +1,146 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.*;
import com.buy507.mall.model.OmsOrder;
import com.buy507.mall.service.OmsOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 订单管理Controller
*/
@Controller
@Api(tags = "OmsOrderController", description = "订单管理")
@RequestMapping("/order")
public class OmsOrderController {
@Autowired
private OmsOrderService orderService;
@ApiOperation("查询订单")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<OmsOrderResult>> list(OmsOrderQueryParam queryParam,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<OmsOrderResult> orderList = orderService.list(queryParam, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(orderList));
}
@ApiOperation("批量发货")
@RequestMapping(value = "/update/delivery", method = RequestMethod.POST)
@ResponseBody
public CommonResult delivery(@RequestBody List<OmsOrderDeliveryParam> deliveryParamList) {
int count = orderService.delivery(deliveryParamList);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量关闭订单")
@RequestMapping(value = "/update/close", method = RequestMethod.POST)
@ResponseBody
public CommonResult close(@RequestParam("ids") List<Long> ids, @RequestParam String note) {
int count = orderService.close(ids, note);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量删除订单")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = orderService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取订单详情:订单信息、商品信息、操作记录")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<OmsOrderDetail> detail(@PathVariable Long id) {
OmsOrderDetail orderDetailResult = orderService.detail(id);
return CommonResult.success(orderDetailResult);
}
@ApiOperation("修改收货人信息")
@RequestMapping(value = "/update/receiverInfo", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateReceiverInfo(@RequestBody OmsReceiverInfoParam receiverInfoParam) {
int count = orderService.updateReceiverInfo(receiverInfoParam);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改订单费用信息")
@RequestMapping(value = "/update/moneyInfo", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateReceiverInfo(@RequestBody OmsMoneyInfoParam moneyInfoParam) {
int count = orderService.updateMoneyInfo(moneyInfoParam);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("备注订单")
@RequestMapping(value = "/update/note", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateNote(@RequestParam("id") Long id,
@RequestParam("note") String note,
@RequestParam("status") Integer status) {
int count = orderService.updateNote(id, note, status);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("线下支付确认")
@RequestMapping(value = "/update/paymentConfirm", method = RequestMethod.POST)
@ResponseBody
public CommonResult paymentConfirm(@RequestParam("id") Long id) {
return orderService.paymentConfirm(id);
}
@ApiOperation("获取物流信息")
@RequestMapping(value = "/getLogistics", method = RequestMethod.GET)
@ResponseBody
public CommonResult getLogistics(@RequestParam("id") Long id) {
return orderService.getLogistics(id);
}
@ApiOperation("商家确认买家提货")
@ApiImplicitParam(name = "id", value = "订单ID", paramType = "query")
@RequestMapping(value = "/confirm/receiving", method = RequestMethod.POST)
@ResponseBody
public CommonResult confirmReceiving(@RequestParam Long id) {
return orderService.confirmReceiving(id, false);
}
/*
@ApiOperation("后台退货")
@ApiImplicitParam(name = "id", value = "订单ID", paramType = "query")
@RequestMapping(value = "/return/goods", method = RequestMethod.POST)
@ResponseBody
public CommonResult returnGoods(@RequestParam Long id) {
return orderService.returnGoods(id);
}
*/
}

View File

@@ -0,0 +1,68 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.OmsOrderReturnApplyResult;
import com.buy507.mall.dto.OmsReturnApplyQueryParam;
import com.buy507.mall.dto.OmsUpdateStatusParam;
import com.buy507.mall.model.OmsOrderReturnApply;
import com.buy507.mall.service.OmsOrderReturnApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 订单退货申请管理
*/
@Controller
@Api(tags = "OmsOrderReturnApplyController", description = "订单退货申请管理")
@RequestMapping("/returnApply")
public class OmsOrderReturnApplyController {
@Autowired
private OmsOrderReturnApplyService returnApplyService;
@ApiOperation("分页查询退货申请")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<OmsOrderReturnApply>> list(OmsReturnApplyQueryParam queryParam,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<OmsOrderReturnApply> returnApplyList = returnApplyService.list(queryParam, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(returnApplyList));
}
@ApiOperation("批量删除申请")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = returnApplyService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取退货申请详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult getItem(@PathVariable Long id) {
OmsOrderReturnApplyResult result = returnApplyService.getItem(id);
return CommonResult.success(result);
}
@ApiOperation("修改申请状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateStatus(@PathVariable Long id, @RequestBody OmsUpdateStatusParam statusParam) {
int count = returnApplyService.updateStatus(id, statusParam);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
}

View File

@@ -0,0 +1,86 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.OmsOrderReturnReason;
import com.buy507.mall.service.OmsOrderReturnReasonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 退货原因管理Controller
*/
@Controller
@Api(tags = "OmsOrderReturnReasonController", description = "退货原因管理")
@RequestMapping("/returnReason")
public class OmsOrderReturnReasonController {
@Autowired
private OmsOrderReturnReasonService orderReturnReasonService;
@ApiOperation("添加退货原因")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody OmsOrderReturnReason returnReason) {
int count = orderReturnReasonService.create(returnReason);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改退货原因")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody OmsOrderReturnReason returnReason) {
int count = orderReturnReasonService.update(id, returnReason);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量删除退货原因")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = orderReturnReasonService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("分页查询全部退货原因")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<OmsOrderReturnReason>> list(@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<OmsOrderReturnReason> reasonList = orderReturnReasonService.list(pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(reasonList));
}
@ApiOperation("获取单个退货原因详情信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<OmsOrderReturnReason> getItem(@PathVariable Long id) {
OmsOrderReturnReason reason = orderReturnReasonService.getItem(id);
return CommonResult.success(reason);
}
@ApiOperation("修改退货原因启用状态")
@RequestMapping(value = "/update/status", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateStatus(@RequestParam(value = "status") Integer status,
@RequestParam("ids") List<Long> ids) {
int count = orderReturnReasonService.updateStatus(ids, status);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
}

View File

@@ -0,0 +1,40 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.OmsOrderSetting;
import com.buy507.mall.service.OmsOrderSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
/**
* 订单设置Controller
*/
@Controller
@Api(tags = "OmsOrderSettingController", description = "订单设置管理")
@RequestMapping("/orderSetting")
public class OmsOrderSettingController {
@Autowired
private OmsOrderSettingService orderSettingService;
@ApiOperation("获取指定订单设置")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<OmsOrderSetting> getItem(@PathVariable Long id) {
OmsOrderSetting orderSetting = orderSettingService.getItem(id);
return CommonResult.success(orderSetting);
}
@ApiOperation("修改指定订单设置")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody OmsOrderSetting orderSetting) {
int count = orderSettingService.update(id,orderSetting);
if(count>0){
return CommonResult.success(count);
}
return CommonResult.failed();
}
}

View File

@@ -0,0 +1,43 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.OssCallbackResult;
import com.buy507.mall.dto.OssPolicyResult;
import com.buy507.mall.service.impl.OssServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* Oss相关操作接口
*/
@Controller
@Api(tags = "OssController", description = "Oss管理")
@RequestMapping("/aliyun/oss")
public class OssController {
@Autowired
private OssServiceImpl ossService;
@ApiOperation(value = "oss上传签名生成")
@RequestMapping(value = "/policy", method = RequestMethod.GET)
@ResponseBody
public CommonResult<OssPolicyResult> policy() {
OssPolicyResult result = ossService.policy();
return CommonResult.success(result);
}
@ApiOperation(value = "oss上传成功回调")
@RequestMapping(value = "callback", method = RequestMethod.POST)
@ResponseBody
@Deprecated
public CommonResult<OssCallbackResult> callback(HttpServletRequest request) {
OssCallbackResult ossCallbackResult = ossService.callback(request);
return CommonResult.success(ossCallbackResult);
}
}

View File

@@ -0,0 +1,141 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.PmsBrandParam;
import com.buy507.mall.model.PmsBrand;
import com.buy507.mall.service.PmsBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 品牌功能Controller
*/
@Controller
@Api(tags = "PmsBrandController", description = "商品品牌管理")
@RequestMapping("/brand")
public class PmsBrandController {
@Autowired
private PmsBrandService brandService;
@ApiOperation(value = "获取全部品牌列表")
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:read')")
public CommonResult<List<PmsBrand>> getList() {
return CommonResult.success(brandService.listAllBrand());
}
@ApiOperation(value = "添加品牌")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:create')")
public CommonResult create(@Validated @RequestBody PmsBrandParam pmsBrand, BindingResult result) {
CommonResult commonResult;
int count = brandService.createBrand(pmsBrand);
if (count == 1) {
commonResult = CommonResult.success(count);
} else {
commonResult = CommonResult.failed();
}
return commonResult;
}
@ApiOperation(value = "更新品牌")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:update')")
public CommonResult update(@PathVariable("id") Long id,
@Validated @RequestBody PmsBrandParam pmsBrandParam,
BindingResult result) {
CommonResult commonResult;
int count = brandService.updateBrand(id, pmsBrandParam);
if (count == 1) {
commonResult = CommonResult.success(count);
} else {
commonResult = CommonResult.failed();
}
return commonResult;
}
@ApiOperation(value = "删除品牌")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:delete')")
public CommonResult delete(@PathVariable("id") Long id) {
int count = brandService.deleteBrand(id);
if (count == 1) {
return CommonResult.success(null);
} else {
return CommonResult.failed();
}
}
@ApiOperation(value = "根据品牌名称分页获取品牌列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:read')")
public CommonResult<CommonPage<PmsBrand>> getList(@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
List<PmsBrand> brandList = brandService.listBrand(keyword, pageNum, pageSize);
return CommonResult.success(CommonPage.restPage(brandList));
}
@ApiOperation(value = "根据编号查询品牌信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:read')")
public CommonResult<PmsBrand> getItem(@PathVariable("id") Long id) {
return CommonResult.success(brandService.getBrand(id));
}
@ApiOperation(value = "批量删除品牌")
@RequestMapping(value = "/delete/batch", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:delete')")
public CommonResult deleteBatch(@RequestParam("ids") List<Long> ids) {
int count = brandService.deleteBrand(ids);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation(value = "批量更新显示状态")
@RequestMapping(value = "/update/showStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:update')")
public CommonResult updateShowStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("showStatus") Integer showStatus) {
int count = brandService.updateShowStatus(ids, showStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation(value = "批量更新厂家制造商状态")
@RequestMapping(value = "/update/factoryStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:update')")
public CommonResult updateFactoryStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("factoryStatus") Integer factoryStatus) {
int count = brandService.updateFactoryStatus(ids, factoryStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
}

View File

@@ -0,0 +1,85 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.PmsProductAttributeCategoryItem;
import com.buy507.mall.model.PmsProductAttributeCategory;
import com.buy507.mall.service.PmsProductAttributeCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 商品属性分类Controller
*/
@Controller
@Api(tags = "PmsProductAttributeCategoryController", description = "商品属性分类管理")
@RequestMapping("/productAttribute/category")
public class PmsProductAttributeCategoryController {
@Autowired
private PmsProductAttributeCategoryService productAttributeCategoryService;
@ApiOperation("添加商品属性分类")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestParam String name) {
int count = productAttributeCategoryService.create(name);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("修改商品属性分类")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestParam String name) {
int count = productAttributeCategoryService.update(id, name);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("删除单个商品属性分类")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
int count = productAttributeCategoryService.delete(id);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("获取单个商品属性分类信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<PmsProductAttributeCategory> getItem(@PathVariable Long id) {
PmsProductAttributeCategory productAttributeCategory = productAttributeCategoryService.getItem(id);
return CommonResult.success(productAttributeCategory);
}
@ApiOperation("分页获取所有商品属性分类")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<PmsProductAttributeCategory>> getList(@RequestParam(defaultValue = "5") Integer pageSize, @RequestParam(defaultValue = "1") Integer pageNum) {
List<PmsProductAttributeCategory> productAttributeCategoryList = productAttributeCategoryService.getList(pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(productAttributeCategoryList));
}
@ApiOperation("获取所有商品属性分类及其下属性")
@RequestMapping(value = "/list/withAttr", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<PmsProductAttributeCategoryItem>> getListWithAttr() {
List<PmsProductAttributeCategoryItem> productAttributeCategoryResultList = productAttributeCategoryService.getListWithAttr();
return CommonResult.success(productAttributeCategoryResultList);
}
}

View File

@@ -0,0 +1,93 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.PmsProductAttributeParam;
import com.buy507.mall.dto.ProductAttrInfo;
import com.buy507.mall.model.PmsProductAttribute;
import com.buy507.mall.service.PmsProductAttributeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 商品属性管理Controller
*/
@Controller
@Api(tags = "PmsProductAttributeController", description = "商品属性管理")
@RequestMapping("/productAttribute")
public class PmsProductAttributeController {
@Autowired
private PmsProductAttributeService productAttributeService;
@ApiOperation("根据分类查询属性列表或参数列表")
@ApiImplicitParams({@ApiImplicitParam(name = "type", value = "0表示属性1表示参数", required = true, paramType = "query", dataType = "integer")})
@RequestMapping(value = "/list/{cid}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<PmsProductAttribute>> getList(@PathVariable Long cid,
@RequestParam(value = "type") Integer type,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<PmsProductAttribute> productAttributeList = productAttributeService.getList(cid, type, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(productAttributeList));
}
@ApiOperation("添加商品属性信息")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody PmsProductAttributeParam productAttributeParam, BindingResult bindingResult) {
int count = productAttributeService.create(productAttributeParam);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("修改商品属性信息")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody PmsProductAttributeParam productAttributeParam, BindingResult bindingResult) {
int count = productAttributeService.update(id, productAttributeParam);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("查询单个商品属性")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<PmsProductAttribute> getItem(@PathVariable Long id) {
PmsProductAttribute productAttribute = productAttributeService.getItem(id);
return CommonResult.success(productAttribute);
}
@ApiOperation("批量删除商品属性")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = productAttributeService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("根据商品分类的id获取商品属性及属性分类")
@RequestMapping(value = "/attrInfo/{productCategoryId}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<ProductAttrInfo>> getAttrInfo(@PathVariable Long productCategoryId) {
List<ProductAttrInfo> productAttrInfoList = productAttributeService.getProductAttrInfo(productCategoryId);
return CommonResult.success(productAttrInfoList);
}
}

View File

@@ -0,0 +1,134 @@
package com.buy507.mall.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.PmsProductCategoryOptions;
import com.buy507.mall.dto.PmsProductCategoryParam;
import com.buy507.mall.model.PmsProductCategory;
import com.buy507.mall.service.PmsProductCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 商品分类模块Controller
*/
@Controller
@Api(tags = "PmsProductCategoryController", description = "商品分类管理")
@RequestMapping("/productCategory")
public class PmsProductCategoryController {
@Autowired
private PmsProductCategoryService productCategoryService;
@ApiOperation("添加产品分类")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:create')")
public CommonResult create(@Validated @RequestBody PmsProductCategoryParam productCategoryParam,
BindingResult result) {
int count = productCategoryService.create(productCategoryParam);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("修改商品分类")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:update')")
public CommonResult update(@PathVariable Long id,
@Validated
@RequestBody PmsProductCategoryParam productCategoryParam,
BindingResult result) {
int count = productCategoryService.update(id, productCategoryParam);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("分页查询商品分类")
@RequestMapping(value = "/list/{parentId}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:read')")
public CommonResult<CommonPage<PmsProductCategory>> getList(@PathVariable Long parentId,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<PmsProductCategory> productCategoryList = productCategoryService.getList(parentId, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(productCategoryList));
}
@ApiOperation("根据id获取商品分类")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:read')")
public CommonResult<PmsProductCategory> getItem(@PathVariable Long id) {
PmsProductCategory productCategory = productCategoryService.getItem(id);
return CommonResult.success(productCategory);
}
@ApiOperation("删除商品分类")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:delete')")
public CommonResult delete(@PathVariable Long id) {
int count = productCategoryService.delete(id);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("修改导航栏显示状态")
@RequestMapping(value = "/update/navStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:update')")
public CommonResult updateNavStatus(@RequestParam("ids") List<Long> ids, @RequestParam("navStatus") Integer navStatus) {
int count = productCategoryService.updateNavStatus(ids, navStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("修改显示状态")
@RequestMapping(value = "/update/showStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:update')")
public CommonResult updateShowStatus(@RequestParam("ids") List<Long> ids, @RequestParam("showStatus") Integer showStatus) {
int count = productCategoryService.updateShowStatus(ids, showStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("查询所有一级分类及子分类")
@RequestMapping(value = "/list/productCategoryOptions", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:read')")
public CommonResult<List<PmsProductCategoryOptions>> listProductCategoryOptions() {
List<PmsProductCategoryOptions> list = productCategoryService.listProductCategoryOptions();
return CommonResult.success(list);
}
}

View File

@@ -0,0 +1,154 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.PmsProductParam;
import com.buy507.mall.dto.PmsProductQueryParam;
import com.buy507.mall.dto.PmsProductResult;
import com.buy507.mall.model.PmsProduct;
import com.buy507.mall.service.PmsProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 商品管理Controller
*/
@Controller
@Api(tags = "PmsProductController", description = "商品管理")
@RequestMapping("/product")
public class PmsProductController {
@Autowired
private PmsProductService productService;
@ApiOperation("创建商品")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:create')")
public CommonResult create(@RequestBody PmsProductParam productParam, BindingResult bindingResult) {
int count = productService.create(productParam);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("根据商品id获取商品编辑信息")
@RequestMapping(value = "/updateInfo/{id}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:read')")
public CommonResult<PmsProductResult> getUpdateInfo(@PathVariable Long id) {
PmsProductResult productResult = productService.getUpdateInfo(id);
return CommonResult.success(productResult);
}
@ApiOperation("更新商品")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public CommonResult update(@PathVariable Long id, @RequestBody PmsProductParam productParam, BindingResult bindingResult) {
int count = productService.update(id, productParam);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("查询商品")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:read')")
public CommonResult<CommonPage<PmsProduct>> getList(PmsProductQueryParam productQueryParam,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<PmsProduct> productList = productService.list(productQueryParam, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(productList));
}
@ApiOperation("根据商品名称或货号模糊查询")
@RequestMapping(value = "/simpleList", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<PmsProduct>> getList(String keyword) {
List<PmsProduct> productList = productService.list(keyword);
return CommonResult.success(productList);
}
@ApiOperation("批量修改审核状态")
@RequestMapping(value = "/update/verifyStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public CommonResult updateVerifyStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("verifyStatus") Integer verifyStatus,
@RequestParam("detail") String detail) {
int count = productService.updateVerifyStatus(ids, verifyStatus, detail);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("批量上下架")
@RequestMapping(value = "/update/publishStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public CommonResult updatePublishStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("publishStatus") Integer publishStatus) {
int count = productService.updatePublishStatus(ids, publishStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("批量推荐商品")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("recommendStatus") Integer recommendStatus) {
int count = productService.updateRecommendStatus(ids, recommendStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("批量设为新品")
@RequestMapping(value = "/update/newStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public CommonResult updateNewStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("newStatus") Integer newStatus) {
int count = productService.updateNewStatus(ids, newStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("批量修改删除状态")
@RequestMapping(value = "/update/deleteStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:delete')")
public CommonResult updateDeleteStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("deleteStatus") Integer deleteStatus) {
int count = productService.updateDeleteStatus(ids, deleteStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
}

View File

@@ -0,0 +1,42 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.PmsSkuStock;
import com.buy507.mall.service.PmsSkuStockService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* sku库存Controller
*/
@Controller
@Api(tags = "PmsSkuStockController", description = "sku商品库存管理")
@RequestMapping("/sku")
public class PmsSkuStockController {
@Autowired
private PmsSkuStockService skuStockService;
@ApiOperation("根据商品编号及编号模糊搜索sku库存")
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<PmsSkuStock>> getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {
List<PmsSkuStock> skuStockList = skuStockService.getList(pid, keyword);
return CommonResult.success(skuStockList);
}
@ApiOperation("批量更新库存信息")
@RequestMapping(value ="/update/{pid}",method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long pid,@RequestBody List<PmsSkuStock> skuStockList){
int count = skuStockService.update(pid,skuStockList);
if(count>0){
return CommonResult.success(count);
}else{
return CommonResult.failed();
}
}
}

View File

@@ -0,0 +1,77 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.SmsCouponParam;
import com.buy507.mall.model.SmsCoupon;
import com.buy507.mall.service.SmsCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 优惠券管理Controller
*/
@Controller
@Api(tags = "SmsCouponController", description = "优惠券管理")
@RequestMapping("/coupon")
public class SmsCouponController {
@Autowired
private SmsCouponService couponService;
@ApiOperation("添加优惠券")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult add(@RequestBody SmsCouponParam couponParam) {
int count = couponService.create(couponParam);
if(count>0){
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("删除优惠券")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
int count = couponService.delete(id);
if(count>0){
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改优惠券")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id,@RequestBody SmsCouponParam couponParam) {
int count = couponService.update(id,couponParam);
if(count>0){
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("根据优惠券名称和类型分页获取优惠券列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsCoupon>> list(
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "type",required = false) Integer type,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsCoupon> couponList = couponService.list(name,type,pageSize,pageNum);
return CommonResult.success(CommonPage.restPage(couponList));
}
@ApiOperation("获取单个优惠券的详细信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<SmsCouponParam> getItem(@PathVariable Long id) {
SmsCouponParam couponParam = couponService.getItem(id);
return CommonResult.success(couponParam);
}
}

View File

@@ -0,0 +1,39 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.SmsCouponHistory;
import com.buy507.mall.service.SmsCouponHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 优惠券领取记录管理Controller
*/
@Controller
@Api(tags = "SmsCouponHistoryController", description = "优惠券领取记录管理")
@RequestMapping("/couponHistory")
public class SmsCouponHistoryController {
@Autowired
private SmsCouponHistoryService historyService;
@ApiOperation("根据优惠券id使用状态订单编号分页获取领取记录")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsCouponHistory>> list(@RequestParam(value = "couponId", required = false) Long couponId,
@RequestParam(value = "useStatus", required = false) Integer useStatus,
@RequestParam(value = "orderSn", required = false) String orderSn,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsCouponHistory> historyList = historyService.list(couponId, useStatus, orderSn, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(historyList));
}
}

View File

@@ -0,0 +1,86 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.SmsFlashPromotion;
import com.buy507.mall.service.SmsFlashPromotionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 限时购活动管理Controller
*/
@Controller
@Api(tags = "SmsFlashPromotionController", description = "限时购活动管理")
@RequestMapping("/flash")
public class SmsFlashPromotionController {
@Autowired
private SmsFlashPromotionService flashPromotionService;
@ApiOperation("添加活动")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody SmsFlashPromotion flashPromotion) {
int count = flashPromotionService.create(flashPromotion);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("编辑活动信息")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody SmsFlashPromotion flashPromotion) {
int count = flashPromotionService.update(id, flashPromotion);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("删除活动信息")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public Object delete(@PathVariable Long id) {
int count = flashPromotionService.delete(id);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改上下线状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, Integer status) {
int count = flashPromotionService.updateStatus(id, status);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取活动详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {
SmsFlashPromotion flashPromotion = flashPromotionService.getItem(id);
return CommonResult.success(flashPromotion);
}
@ApiOperation("根据活动名称分页查询")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsFlashPromotion> flashPromotionList = flashPromotionService.list(keyword, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(flashPromotionList));
}
}

View File

@@ -0,0 +1,77 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.SmsFlashPromotionProduct;
import com.buy507.mall.model.SmsFlashPromotionProductRelation;
import com.buy507.mall.service.SmsFlashPromotionProductRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 限时购和商品关系管理Controller
*/
@Controller
@Api(tags = "SmsFlashPromotionProductRelationController", description = "限时购和商品关系管理")
@RequestMapping("/flashProductRelation")
public class SmsFlashPromotionProductRelationController {
@Autowired
private SmsFlashPromotionProductRelationService relationService;
@ApiOperation("批量选择商品添加关联")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsFlashPromotionProductRelation> relationList) {
int count = relationService.create(relationList);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改关联相关信息")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody SmsFlashPromotionProductRelation relation) {
int count = relationService.update(id, relation);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("删除关联")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
int count = relationService.delete(id);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取管理商品促销信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<SmsFlashPromotionProductRelation> getItem(@PathVariable Long id) {
SmsFlashPromotionProductRelation relation = relationService.getItem(id);
return CommonResult.success(relation);
}
@ApiOperation("分页查询不同场次关联及商品信息")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsFlashPromotionProduct>> list(@RequestParam(value = "flashPromotionId") Long flashPromotionId,
@RequestParam(value = "flashPromotionSessionId") Long flashPromotionSessionId,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsFlashPromotionProduct> flashPromotionProductList = relationService.list(flashPromotionId, flashPromotionSessionId, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(flashPromotionProductList));
}
}

View File

@@ -0,0 +1,92 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.SmsFlashPromotionSessionDetail;
import com.buy507.mall.model.SmsFlashPromotionSession;
import com.buy507.mall.service.SmsFlashPromotionSessionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 限时购场次管理Controller
*/
@Controller
@Api(tags = "SmsFlashPromotionSessionController", description = "限时购场次管理")
@RequestMapping("/flashSession")
public class SmsFlashPromotionSessionController {
@Autowired
private SmsFlashPromotionSessionService flashPromotionSessionService;
@ApiOperation("添加场次")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody SmsFlashPromotionSession promotionSession) {
int count = flashPromotionSessionService.create(promotionSession);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改场次")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody SmsFlashPromotionSession promotionSession) {
int count = flashPromotionSessionService.update(id, promotionSession);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改启用状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateStatus(@PathVariable Long id, Integer status) {
int count = flashPromotionSessionService.updateStatus(id, status);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("删除场次")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
int count = flashPromotionSessionService.delete(id);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取场次详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<SmsFlashPromotionSession> getItem(@PathVariable Long id) {
SmsFlashPromotionSession promotionSession = flashPromotionSessionService.getItem(id);
return CommonResult.success(promotionSession);
}
@ApiOperation("获取全部场次")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<SmsFlashPromotionSession>> list() {
List<SmsFlashPromotionSession> promotionSessionList = flashPromotionSessionService.list();
return CommonResult.success(promotionSessionList);
}
@ApiOperation("获取全部可选场次及其数量")
@RequestMapping(value = "/selectList", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<SmsFlashPromotionSessionDetail>> selectList(Long flashPromotionId) {
List<SmsFlashPromotionSessionDetail> promotionSessionList = flashPromotionSessionService.selectList(flashPromotionId);
return CommonResult.success(promotionSessionList);
}
}

View File

@@ -0,0 +1,84 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.SmsHomeAdvertise;
import com.buy507.mall.service.SmsHomeAdvertiseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 首页轮播广告管理Controller
*/
@Controller
@Api(tags = "SmsHomeAdvertiseController", description = "首页轮播广告管理")
@RequestMapping("/home/advertise")
public class SmsHomeAdvertiseController {
@Autowired
private SmsHomeAdvertiseService advertiseService;
@ApiOperation("添加广告")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody SmsHomeAdvertise advertise) {
int count = advertiseService.create(advertise);
if (count > 0)
return CommonResult.success(count);
return CommonResult.failed();
}
@ApiOperation("删除广告")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = advertiseService.delete(ids);
if (count > 0)
return CommonResult.success(count);
return CommonResult.failed();
}
@ApiOperation("修改上下线状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateStatus(@PathVariable Long id, Integer status) {
int count = advertiseService.updateStatus(id, status);
if (count > 0)
return CommonResult.success(count);
return CommonResult.failed();
}
@ApiOperation("获取广告详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<SmsHomeAdvertise> getItem(@PathVariable Long id) {
SmsHomeAdvertise advertise = advertiseService.getItem(id);
return CommonResult.success(advertise);
}
@ApiOperation("修改广告")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody SmsHomeAdvertise advertise) {
int count = advertiseService.update(id, advertise);
if (count > 0)
return CommonResult.success(count);
return CommonResult.failed();
}
@ApiOperation("分页查询广告")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsHomeAdvertise>> list(@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeAdvertise> advertiseList = advertiseService.list(name, type, endTime, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(advertiseList));
}
}

View File

@@ -0,0 +1,79 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.SmsHomeBrand;
import com.buy507.mall.service.SmsHomeBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 首页品牌管理Controller
*/
@Controller
@Api(tags = "SmsHomeBrandController", description = "首页品牌管理")
@RequestMapping("/home/brand")
public class SmsHomeBrandController {
@Autowired
private SmsHomeBrandService homeBrandService;
@ApiOperation("添加首页推荐品牌")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsHomeBrand> homeBrandList) {
int count = homeBrandService.create(homeBrandList);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改品牌排序")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateSort(@PathVariable Long id, Integer sort) {
int count = homeBrandService.updateSort(id, sort);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量删除推荐品牌")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = homeBrandService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量修改推荐状态")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = homeBrandService.updateRecommendStatus(ids, recommendStatus);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("分页查询推荐品牌")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsHomeBrand>> list(@RequestParam(value = "brandName", required = false) String brandName,
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeBrand> homeBrandList = homeBrandService.list(brandName, recommendStatus, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(homeBrandList));
}
}

View File

@@ -0,0 +1,79 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.SmsHomeNewProduct;
import com.buy507.mall.service.SmsHomeNewProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 首页新品管理Controller
*/
@Controller
@Api(tags = "SmsHomeNewProductController", description = "首页新品管理")
@RequestMapping("/home/newProduct")
public class SmsHomeNewProductController {
@Autowired
private SmsHomeNewProductService homeNewProductService;
@ApiOperation("添加首页推荐品牌")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsHomeNewProduct> homeBrandList) {
int count = homeNewProductService.create(homeBrandList);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改推荐排序")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateSort(@PathVariable Long id, Integer sort) {
int count = homeNewProductService.updateSort(id, sort);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量删除推荐")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = homeNewProductService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量修改推荐状态")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = homeNewProductService.updateRecommendStatus(ids, recommendStatus);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsHomeNewProduct>> list(@RequestParam(value = "productName", required = false) String productName,
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeNewProduct> homeBrandList = homeNewProductService.list(productName, recommendStatus, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(homeBrandList));
}
}

View File

@@ -0,0 +1,79 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.SmsHomeRecommendProduct;
import com.buy507.mall.service.SmsHomeRecommendProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 首页人气推荐管理Controller
*/
@Controller
@Api(tags = "SmsHomeRecommendProductController", description = "首页人气推荐管理")
@RequestMapping("/home/recommendProduct")
public class SmsHomeRecommendProductController {
@Autowired
private SmsHomeRecommendProductService recommendProductService;
@ApiOperation("添加首页推荐")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsHomeRecommendProduct> homeBrandList) {
int count = recommendProductService.create(homeBrandList);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改推荐排序")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateSort(@PathVariable Long id, Integer sort) {
int count = recommendProductService.updateSort(id, sort);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量删除推荐")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = recommendProductService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量修改推荐状态")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = recommendProductService.updateRecommendStatus(ids, recommendStatus);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsHomeRecommendProduct>> list(@RequestParam(value = "productName", required = false) String productName,
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeRecommendProduct> homeBrandList = recommendProductService.list(productName, recommendStatus, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(homeBrandList));
}
}

View File

@@ -0,0 +1,79 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.SmsHomeRecommendSubject;
import com.buy507.mall.service.SmsHomeRecommendSubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 首页专题推荐管理Controller
*/
@Controller
@Api(tags = "SmsHomeRecommendSubjectController", description = "首页专题推荐管理")
@RequestMapping("/home/recommendSubject")
public class SmsHomeRecommendSubjectController {
@Autowired
private SmsHomeRecommendSubjectService recommendSubjectService;
@ApiOperation("添加首页推荐专题")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsHomeRecommendSubject> homeBrandList) {
int count = recommendSubjectService.create(homeBrandList);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改推荐排序")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateSort(@PathVariable Long id, Integer sort) {
int count = recommendSubjectService.updateSort(id, sort);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量删除推荐")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = recommendSubjectService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量修改推荐状态")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = recommendSubjectService.updateRecommendStatus(ids, recommendStatus);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsHomeRecommendSubject>> list(@RequestParam(value = "subjectName", required = false) String subjectName,
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeRecommendSubject> homeBrandList = recommendSubjectService.list(subjectName, recommendStatus, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(homeBrandList));
}
}

View File

@@ -0,0 +1,82 @@
package com.buy507.mall.controller;
import cn.hutool.core.date.DateTime;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.TmsAdminIstrator;
import com.buy507.mall.service.TmsAdminIstratorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@RestController
@Api(tags = "TmsAdminIstratorController", description = "管理员信息")
@RequestMapping("/administrator")
public class TmsAdminIstratorController {
@Autowired
private TmsAdminIstratorService Service;
public HttpServletRequest request;
@ApiOperation("分页查询管理员信息")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<CommonPage<TmsAdminIstrator>> list(
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<TmsAdminIstrator> list = Service.list(pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(list));
}
@ApiOperation("添加管理员")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody TmsAdminIstrator advertise){
Date date = new Date();
advertise.setCreateTime(date);
int count = Service.create(advertise);
if (count > 0){
return CommonResult.success(count);
}else {
return CommonResult.failed();
}
}
@ApiOperation("获取管理员详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<TmsAdminIstrator> getItem(@PathVariable Long id) {
TmsAdminIstrator advertise = Service.getItem(id);
return CommonResult.success(advertise);
}
@ApiOperation("修改管理员数据")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody TmsAdminIstrator advertise) {
int count = Service.update(id, advertise);
if (count > 0)
{
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("删除管理员")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = Service.delete(ids);
if (count > 0)
return CommonResult.success(count);
return CommonResult.failed();
}
}

View File

@@ -0,0 +1,43 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.TmsPermission;
import com.buy507.mall.model.TmsRolelist;
import com.buy507.mall.service.TmsRolelistService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Api(tags = "TmsRolelistController", description = "系统角色列表")
@RequestMapping("/TmsRolelist")
public class TmsRolelistController {
@Autowired
private TmsRolelistService Service;
@ApiOperation("分页查询角色列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<CommonPage<TmsRolelist>> list(
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<TmsRolelist> list = Service.list(pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(list));
}
@ApiOperation("角色权限查询")
@RequestMapping(value = "/user/PermissionList", method = RequestMethod.GET)
public CommonResult<List<TmsPermission>> bankAccountList(
@RequestParam(value = "Id", required = true) Long Id) {
List<TmsPermission> list = Service.PermissionList(Id);
return CommonResult.success(list);
}
}

View File

@@ -0,0 +1,178 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.UmsAdminLoginParam;
import com.buy507.mall.dto.UmsAdminParam;
import com.buy507.mall.model.UmsAdmin;
import com.buy507.mall.model.UmsPermission;
import com.buy507.mall.model.UmsRole;
import com.buy507.mall.service.UmsAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.security.Principal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 后台用户管理
*/
@Controller
@Api(tags = "UmsAdminController", description = "后台用户管理")
@RequestMapping("/admin")
public class UmsAdminController {
@Autowired
private UmsAdminService adminService;
@Value("${jwt.tokenHeader}")
private String tokenHeader;
@Value("${jwt.tokenHead}")
private String tokenHead;
@ApiOperation(value = "用户注册")
@RequestMapping(value = "/register", method = RequestMethod.POST)
@ResponseBody
public CommonResult<UmsAdmin> register(@RequestBody UmsAdminParam umsAdminParam, BindingResult result) {
UmsAdmin umsAdmin = adminService.register(umsAdminParam);
if (umsAdmin == null) {
CommonResult.failed();
}
return CommonResult.success(umsAdmin);
}
@ApiOperation(value = "登录以后返回token")
@RequestMapping(value = "/login", method = RequestMethod.POST)
@ResponseBody
public CommonResult login(@RequestBody UmsAdminLoginParam umsAdminLoginParam, BindingResult result) {
String token = adminService.login(umsAdminLoginParam.getUsername(), umsAdminLoginParam.getPassword());
if (token == null) {
return CommonResult.validateFailed("用户名或密码错误");
}
Map<String, String> tokenMap = new HashMap<>();
tokenMap.put("token", token);
tokenMap.put("tokenHead", tokenHead);
return CommonResult.success(tokenMap);
}
@ApiOperation(value = "刷新token")
@RequestMapping(value = "/token/refresh", method = RequestMethod.GET)
@ResponseBody
public CommonResult refreshToken(HttpServletRequest request) {
String token = request.getHeader(tokenHeader);
String refreshToken = adminService.refreshToken(token);
if (refreshToken == null) {
return CommonResult.failed();
}
Map<String, String> tokenMap = new HashMap<>();
tokenMap.put("token", refreshToken);
tokenMap.put("tokenHead", tokenHead);
return CommonResult.success(tokenMap);
}
@ApiOperation(value = "获取当前登录用户信息")
@RequestMapping(value = "/info", method = RequestMethod.GET)
@ResponseBody
public CommonResult getAdminInfo(Principal principal) {
String username = principal.getName();
UmsAdmin umsAdmin = adminService.getAdminByUsername(username);
Map<String, Object> data = new HashMap<>();
data.put("username", umsAdmin.getUsername());
data.put("roles", new String[]{"admin"});
data.put("icon", umsAdmin.getIcon());
return CommonResult.success(data);
}
@ApiOperation(value = "登出功能")
@RequestMapping(value = "/logout", method = RequestMethod.POST)
@ResponseBody
public CommonResult logout() {
return CommonResult.success(null);
}
@ApiOperation("根据用户名或姓名分页获取用户列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<UmsAdmin>> list(@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<UmsAdmin> adminList = adminService.list(name, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(adminList));
}
@ApiOperation("获取指定用户信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<UmsAdmin> getItem(@PathVariable Long id) {
UmsAdmin admin = adminService.getItem(id);
return CommonResult.success(admin);
}
@ApiOperation("修改指定用户信息")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody UmsAdmin admin) {
int count = adminService.update(id, admin);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("删除指定用户信息")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
int count = adminService.delete(id);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("给用户分配角色")
@RequestMapping(value = "/role/update", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateRole(@RequestParam("adminId") Long adminId,
@RequestParam("roleIds") List<Long> roleIds) {
int count = adminService.updateRole(adminId, roleIds);
if (count >= 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取指定用户的角色")
@RequestMapping(value = "/role/{adminId}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsRole>> getRoleList(@PathVariable Long adminId) {
List<UmsRole> roleList = adminService.getRoleList(adminId);
return CommonResult.success(roleList);
}
@ApiOperation("给用户分配+-权限")
@RequestMapping(value = "/permission/update", method = RequestMethod.POST)
@ResponseBody
public CommonResult updatePermission(@RequestParam Long adminId,
@RequestParam("permissionIds") List<Long> permissionIds) {
int count = adminService.updatePermission(adminId, permissionIds);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取用户所有权限(包括+-权限)")
@RequestMapping(value = "/permission/{adminId}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsPermission>> getPermissionList(@PathVariable Long adminId) {
List<UmsPermission> permissionList = adminService.getPermissionList(adminId);
return CommonResult.success(permissionList);
}
}

View File

@@ -0,0 +1,60 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.UmsAdminPasswordModification;
import com.buy507.mall.service.UmsAdminPasswordManagementService;
import com.buy507.mall.util.JwtTokenUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@RestController
@Api(tags = "UmsAdminPasswordModificationController", description = "管理员密码修改")
@RequestMapping("/adminPasswordManagement")
public class UmsAdminPasswordModificationController {
@Autowired
private UmsAdminPasswordManagementService service;
@Autowired
private PasswordEncoder passwordEncoder;
@Autowired
private HttpServletRequest request;
@Autowired
private JwtTokenUtil jwtTokenUtil;
@Value("${jwt.tokenHeader}")
private String tokenHeader;
@Value("${jwt.tokenHead}")
private String tokenHead;
@ApiOperation("修改管理员密码")
@RequestMapping(value = "/inquire", method = RequestMethod.POST)
@ResponseBody
public CommonResult inquire(@RequestBody UmsAdminPasswordModification pass) {
String header = request.getHeader("Authorization");
String authHeader = request.getHeader(this.tokenHeader);
String authToken = authHeader.substring(this.tokenHead.length());
String username = jwtTokenUtil.getUserNameFromToken(authToken);
// String oldPassword = passwordEncoder.encode(pass.getOldPsw());
String againNewPassword = passwordEncoder.encode(pass.getAgainNewPsw());
// pass.setOldPsw(oldPassword);
pass.setAgainNewPsw(againNewPassword);
// System.out.print(pass.getOldPsw());
// System.out.print(" ");
// System.out.print(username);
// System.out.print(" ");
pass.setUsername(username);
int count = service.update(pass);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
}

View File

@@ -0,0 +1,75 @@
package com.buy507.mall.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.MemberResult;
import com.buy507.mall.dto.MemberTradeRecordResult;
import com.buy507.mall.model.DmsMemberBankAccount;
import com.buy507.mall.service.UmsMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@RestController
@Api(tags = "UmsMemberController", description = "会员管理")
@RequestMapping("/member")
public class UmsMemberController {
@Autowired
private UmsMemberService memberService;
@ApiOperation("分页查询会员信息")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<CommonPage<MemberResult>> list(
@RequestParam(value = "nickname", required = false) String nickname,
@RequestParam(value = "inviter", required = false) String inviter,
@RequestParam(value = "memberLevel", required = false) Integer memberLevel,
@RequestParam(value = "storeStatus", required = false) Integer storeStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<MemberResult> list = memberService.list(nickname, inviter, memberLevel, storeStatus, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(list));
}
@ApiOperation("修改会员开店状态")
@RequestMapping(value = "/update/storeStatus/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult<String> updateStoreStatus(@PathVariable Long id, @RequestParam Integer storeStatus) {
memberService.updateStoreStatus(id, storeStatus);
return CommonResult.success(null);
}
@ApiOperation("查询会员银行信息")
@RequestMapping(value = "/bankAccount/list", method = RequestMethod.GET)
public CommonResult<List<DmsMemberBankAccount>> bankAccountList(
@RequestParam(value = "memberId", required = true) Long memberId) {
List<DmsMemberBankAccount> list = memberService.bankAccountList(memberId);
return CommonResult.success(list);
}
@ApiOperation("查询会员账户交易明细")
@RequestMapping(value = "/tradeRecord/list", method = RequestMethod.GET)
public CommonResult<CommonPage<MemberTradeRecordResult>> tradeRecordList(
@RequestParam(value = "memberId", required = true) Long memberId,
@RequestParam(value = "orderSn", required = false) String orderSn,
@RequestParam(value = "itemType", required = false) Integer itemType,
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "pageSize", required = false) Integer pageSize,
@RequestParam(value = "pageNum", required = false) Integer pageNum) {
List<MemberTradeRecordResult> list = memberService.tradeRecordList(memberId, orderSn, itemType,
type, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(list));
}
}

View File

@@ -0,0 +1,34 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.UmsMemberLevel;
import com.buy507.mall.service.UmsMemberLevelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 会员等级管理Controller
*/
@Controller
@Api(tags = "UmsMemberLevelController", description = "会员等级管理")
@RequestMapping("/memberLevel")
public class UmsMemberLevelController {
@Autowired
private UmsMemberLevelService memberLevelService;
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation("查询所有会员等级")
@ResponseBody
public CommonResult<List<UmsMemberLevel>> list(@RequestParam("defaultStatus") Integer defaultStatus) {
List<UmsMemberLevel> memberLevelList = memberLevelService.list(defaultStatus);
return CommonResult.success(memberLevelList);
}
}

View File

@@ -0,0 +1,47 @@
package com.buy507.mall.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.MemberMonthRewardResult;
import com.buy507.mall.service.UmsMemberMonthRewardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 会员月度奖励Controller
*/
@Controller
@Api(tags = "UmsMemberMonthRewardController", description = "会员月度奖励管理")
@RequestMapping("/member/monthReward")
public class UmsMemberMonthRewardController {
@Autowired
private UmsMemberMonthRewardService service;
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation("查询会员的月度奖励")
@ResponseBody
public CommonResult<List<MemberMonthRewardResult>> list(@RequestParam Integer month, @RequestParam(required = false) String nickname) {
return CommonResult.success(service.list(nickname, month));
}
@RequestMapping(value = "/compute", method = RequestMethod.POST)
@ApiOperation("计算会员的月度奖励")
@ResponseBody
public CommonResult<String> computeMonthReward(@RequestParam Integer month) {
return service.computeMonthReward(month);
}
}

View File

@@ -0,0 +1,72 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.dto.UmsPermissionNode;
import com.buy507.mall.model.UmsPermission;
import com.buy507.mall.service.UmsPermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 后台用户权限管理
*/
@Controller
@Api(tags = "UmsPermissionController", description = "后台用户权限管理")
@RequestMapping("/permission")
public class UmsPermissionController {
@Autowired
private UmsPermissionService permissionService;
@ApiOperation("添加权限")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody UmsPermission permission) {
int count = permissionService.create(permission);
if(count>0){
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改权限")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody UmsPermission permission) {
int count = permissionService.update(id,permission);
if(count>0){
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("根据id批量删除权限")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = permissionService.delete(ids);
if(count>0){
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("以层级结构返回所有权限")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsPermissionNode>> treeList() {
List<UmsPermissionNode> permissionNodeList = permissionService.treeList();
return CommonResult.success(permissionNodeList);
}
@ApiOperation("获取所有权限列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsPermission>> list() {
List<UmsPermission> permissionList = permissionService.list();
return CommonResult.success(permissionList);
}
}

View File

@@ -0,0 +1,86 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.UmsPermission;
import com.buy507.mall.model.UmsRole;
import com.buy507.mall.service.UmsRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 后台用户角色管理
*/
@Controller
@Api(tags = "UmsRoleController", description = "后台用户角色管理")
@RequestMapping("/role")
public class UmsRoleController {
@Autowired
private UmsRoleService roleService;
@ApiOperation("添加角色")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody UmsRole role) {
int count = roleService.create(role);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("修改角色")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody UmsRole role) {
int count = roleService.update(id, role);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("批量删除角色")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
int count = roleService.delete(ids);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取相应角色权限")
@RequestMapping(value = "/permission/{roleId}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsPermission>> getPermissionList(@PathVariable Long roleId) {
List<UmsPermission> permissionList = roleService.getPermissionList(roleId);
return CommonResult.success(permissionList);
}
@ApiOperation("修改角色权限")
@RequestMapping(value = "/permission/update", method = RequestMethod.POST)
@ResponseBody
public CommonResult updatePermission(@RequestParam Long roleId,
@RequestParam("permissionIds") List<Long> permissionIds) {
int count = roleService.updatePermission(roleId, permissionIds);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("获取所有角色")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list() {
List<UmsRole> roleList = roleService.list();
return CommonResult.success(roleList);
}
}

View File

@@ -0,0 +1,65 @@
package com.buy507.mall.controller;
import com.buy507.mall.common.api.CommonPage;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.UmsMember;
import com.buy507.mall.model.UmsTransferrecord;
import com.buy507.mall.service.UmsTransferrecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@Api(tags = "UmsTransferrecordController", description = "会员转账记录")
@RequestMapping("/memberTransferRecord")
public class UmsTransferrecordController {
@Autowired
private UmsTransferrecordService service;
private HttpServletRequest request;
// @ApiOperation("会员转账查询")
// @RequestMapping(value = "/List" , method = RequestMethod.GET)
// public CommonResult<List<UmsTransferrecord>> list(){
// List<UmsTransferrecord> list = service.list();
// return CommonResult.success(list);
// }
@ApiOperation("分页查询会员信息")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<CommonPage<UmsTransferrecord>> list(
@RequestParam(value = "memberName", required = false) String memberName,
@RequestParam(value = "receiverName", required = false) String receiverName,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum
)
{
List<UmsTransferrecord> list = service.list(pageSize, pageNum, memberName, receiverName, startTime,endTime);
return CommonResult.success(CommonPage.restPage(list));
}
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.CmsPrefrenceAreaProductRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自定义优选和商品关系操作
*/
public interface CmsPrefrenceAreaProductRelationDao {
int insertList(@Param("list") List<CmsPrefrenceAreaProductRelation> prefrenceAreaProductRelationList);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.CmsSubjectProductRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自定义商品和专题关系操作
*/
public interface CmsSubjectProductRelationDao {
int insertList(@Param("list") List<CmsSubjectProductRelation> subjectProductRelationList);
}

View File

@@ -0,0 +1,15 @@
package com.buy507.mall.dao;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.buy507.mall.dto.MemberWithdrawApplyResult;
public interface DmsMemberWithdrawApplyDao {
List<MemberWithdrawApplyResult> selectByExample(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("paymentStatus") Integer paymentStatus);
}

View File

@@ -0,0 +1,141 @@
package com.buy507.mall.dao;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.buy507.mall.dto.MemberShoppingInfoResult;
import com.buy507.mall.dto.MemberTeamInfoResult;
import com.buy507.mall.dto.OrderChartResult;
import com.buy507.mall.dto.WithdrawChartResult;
import com.buy507.mall.model.OmsOrder;
public interface DmsQueryDao {
/**
* 查询会员团队信息
*/
List<MemberTeamInfoResult> selectMemberTeamInfo(@Param("nickname") String nickname, @Param("inviterName") String inviterName,
@Param("inviterId") Long inviterId,
@Param("memberLevel") Integer memberLevel,
@Param("storeStatus") Integer storeStatus);
/**
* 查询今日订单
* @return
*/
List<OmsOrder> selectTodayOrder();
/**
* 查询昨日销售总额
* @return
*/
BigDecimal selectYesterdaySellAmount();
/**
* 查询本周销售总额
* @return
*/
Integer selectCurrentWeekOrderCount();
/**
* 查询本周销售总额
* @return
*/
BigDecimal selectCurrentWeekSellAmount();
/**
* 查询本月销售总额
* @return
*/
Integer selectCurrentMonthOrderCount();
/**
* 查询本月销售总额
* @return
*/
BigDecimal selectCurrentMonthSellAmount();
/**
* 查询本年销售总额
* @return
*/
Integer selectCurrentYearOrderCount();
/**
* 查询本年销售总额
* @return
*/
BigDecimal selectCurrentYearSellAmount();
/**
* 查询销售总金额
* @return
*/
BigDecimal selectAllSellAmount();
/**
* 查询积分支付总金额
* @return
*/
BigDecimal selectBalancePayemntAmount();
/**
* 查询订单图表数据
* @return
*/
List<OrderChartResult> selectOrderChart(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
/**
* 查询提现图表数据
* @return
*/
List<WithdrawChartResult> selectWithdrawChart(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
/**
* 查询本周提现总额
* @return
*/
Integer selectCurrentWeekWithdrawCount();
/**
* 查询本周提现总额
* @return
*/
BigDecimal selectCurrentWeekWithdrawAmount();
/**
* 查询本月提现总额
* @return
*/
Integer selectCurrentMonthWithdrawCount();
/**
* 查询本月提现总额
* @return
*/
BigDecimal selectCurrentMonthWithdrawAmount();
/**
* 查询本年提现总额
* @return
*/
Integer selectCurrentYearWithdrawCount();
/**
* 查询本年提现总额
* @return
*/
BigDecimal selectCurrentYearWithdrawAmount();
/**
* 查询会员购物信息
* @param startTime
* @param endTime
* @return
*/
List<MemberShoppingInfoResult> selectMemberShoppingInfo(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
}

View File

@@ -0,0 +1,34 @@
package com.buy507.mall.dao;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.buy507.mall.dto.OmsOrderDeliveryParam;
import com.buy507.mall.dto.OmsOrderDetail;
import com.buy507.mall.dto.OmsOrderQueryParam;
import com.buy507.mall.dto.OmsOrderResult;
/**
* 订单自定义查询Dao
*/
public interface OmsOrderDao {
/**
* 条件查询订单
*/
List<OmsOrderResult> getList(@Param("queryParam") OmsOrderQueryParam queryParam);
/**
* 批量发货
*/
int delivery(@Param("list") List<OmsOrderDeliveryParam> deliveryParamList);
/**
* 获取订单详情
*/
OmsOrderDetail getDetail(@Param("id") Long id);
BigDecimal getTotalAmountByMonth(Integer month);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.OmsOrderOperateHistory;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 订单操作记录自定义Dao
*/
public interface OmsOrderOperateHistoryDao {
int insertList(@Param("list") List<OmsOrderOperateHistory> orderOperateHistoryList);
}

View File

@@ -0,0 +1,23 @@
package com.buy507.mall.dao;
import com.buy507.mall.dto.OmsOrderReturnApplyResult;
import com.buy507.mall.dto.OmsReturnApplyQueryParam;
import com.buy507.mall.model.OmsOrderReturnApply;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 订单退货申请自定义Dao
*/
public interface OmsOrderReturnApplyDao {
/**
* 查询申请列表
*/
List<OmsOrderReturnApply> getList(@Param("queryParam") OmsReturnApplyQueryParam queryParam);
/**
* 获取申请详情
*/
OmsOrderReturnApplyResult getDetail(@Param("id")Long id);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.PmsMemberPrice;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自定义会员价格Dao
*/
public interface PmsMemberPriceDao {
int insertList(@Param("list") List<PmsMemberPrice> memberPriceList);
}

View File

@@ -0,0 +1,12 @@
package com.buy507.mall.dao;
import com.buy507.mall.dto.PmsProductAttributeCategoryItem;
import java.util.List;
/**
* 自定义商品属性分类Dao
*/
public interface PmsProductAttributeCategoryDao {
List<PmsProductAttributeCategoryItem> getListWithAttr();
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.dto.ProductAttrInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自定义商品属性Dao
*/
public interface PmsProductAttributeDao {
List<ProductAttrInfo> getProductAttrInfo(@Param("id") Long productCategoryId);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.PmsProductAttributeValue;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品参数商品自定义规格属性Dao
*/
public interface PmsProductAttributeValueDao {
int insertList(@Param("list")List<PmsProductAttributeValue> productAttributeValueList);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.PmsProductCategoryAttributeRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自定义商品分类和属性关系Dao
*/
public interface PmsProductCategoryAttributeRelationDao {
int insertList(@Param("list") List<PmsProductCategoryAttributeRelation> productCategoryAttributeRelationList);
}

View File

@@ -0,0 +1,15 @@
package com.buy507.mall.dao;
import com.buy507.mall.dto.PmsProductResult;
import org.apache.ibatis.annotations.Param;
/**
* 商品自定义Dao
*/
public interface PmsProductDao {
/**
* 获取商品编辑信息
*/
PmsProductResult getUpdateInfo(@Param("id") Long id);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.PmsProductFullReduction;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自定义商品满减Dao
*/
public interface PmsProductFullReductionDao {
int insertList(@Param("list") List<PmsProductFullReduction> productFullReductionList);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.PmsProductLadder;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自定义会员阶梯价格Dao
*/
public interface PmsProductLadderDao {
int insertList(@Param("list") List<PmsProductLadder> productLadderList);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.PmsProductVertifyRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品审核日志自定义dao
*/
public interface PmsProductVertifyRecordDao {
int insertList(@Param("list") List<PmsProductVertifyRecord> list);
}

View File

@@ -0,0 +1,21 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.PmsSkuStock;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自定义商品sku库存Dao
*/
public interface PmsSkuStockDao {
/**
* 批量插入操作
*/
int insertList(@Param("list")List<PmsSkuStock> skuStockList);
/**
* 批量插入或替换操作
*/
int replaceList(@Param("list")List<PmsSkuStock> skuStockList);
}

View File

@@ -0,0 +1,11 @@
package com.buy507.mall.dao;
import com.buy507.mall.dto.SmsCouponParam;
import org.apache.ibatis.annotations.Param;
/**
* 优惠券管理自定义查询Dao
*/
public interface SmsCouponDao {
SmsCouponParam getItem(@Param("id") Long id);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.SmsCouponProductCategoryRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 优惠券和商品分类关系自定义Dao
*/
public interface SmsCouponProductCategoryRelationDao {
int insertList(@Param("list")List<SmsCouponProductCategoryRelation> productCategoryRelationList);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.SmsCouponProductRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 优惠券和产品关系自定义Dao
*/
public interface SmsCouponProductRelationDao {
int insertList(@Param("list")List<SmsCouponProductRelation> productRelationList);
}

View File

@@ -0,0 +1,16 @@
package com.buy507.mall.dao;
import com.buy507.mall.dto.SmsFlashPromotionProduct;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 限时购商品关联自定义Dao
*/
public interface SmsFlashPromotionProductRelationDao {
/**
* 获取限时购及相关商品信息
*/
List<SmsFlashPromotionProduct> getList(@Param("flashPromotionId") Long flashPromotionId, @Param("flashPromotionSessionId") Long flashPromotionSessionId);
}

View File

@@ -0,0 +1,21 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.SmsHomeAdvertiseExample;
import com.buy507.mall.model.TmsAdminIstrator;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface TmsAdminIstratorDao {
List<TmsAdminIstrator> selectAll();
int insert(TmsAdminIstrator advertise);
TmsAdminIstrator selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TmsAdminIstrator record);
int deleteByExample(SmsHomeAdvertiseExample example);
}

View File

@@ -0,0 +1,15 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.TmsPermission;
import com.buy507.mall.model.TmsRolelist;
import java.util.List;
public interface TmsRolelistDao {
List<TmsRolelist> selectAll();
List<TmsPermission> selectPermissionId(Long Id);
// List<TmsPermission> selectnew(Long Id);
}

View File

@@ -0,0 +1,9 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.UmsAdminPasswordModification;
public interface UmsAdminPasswordManagementDao {
int updateAdminPsw(UmsAdminPasswordModification pass);
}

View File

@@ -0,0 +1,13 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.UmsAdminPermissionRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户权限自定义Dao
*/
public interface UmsAdminPermissionRelationDao {
int insertList(@Param("list") List<UmsAdminPermissionRelation> list);
}

View File

@@ -0,0 +1,33 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.UmsAdminRoleRelation;
import com.buy507.mall.model.UmsPermission;
import com.buy507.mall.model.UmsRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 后台用户与角色管理自定义Dao
*/
public interface UmsAdminRoleRelationDao {
/**
* 批量插入用户角色关系
*/
int insertList(@Param("list") List<UmsAdminRoleRelation> adminRoleRelationList);
/**
* 获取用于所有角色
*/
List<UmsRole> getRoleList(@Param("adminId") Long adminId);
/**
* 获取用户所有角色权限
*/
List<UmsPermission> getRolePermissionList(@Param("adminId") Long adminId);
/**
* 获取用户所有权限(包括+-权限)
*/
List<UmsPermission> getPermissionList(@Param("adminId") Long adminId);
}

View File

@@ -0,0 +1,23 @@
package com.buy507.mall.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.buy507.mall.dto.MemberMonthRewardResult;
import com.buy507.mall.dto.MemberResult;
import com.buy507.mall.dto.MemberTradeRecordResult;
public interface UmsMemberDao {
List<MemberResult> selectByExample(@Param("nickname") String nickname, @Param("inviter") String inviter,
@Param("memberLevel") Integer memberLevel,
@Param("storeStatus") Integer storeStatus);
List<MemberTradeRecordResult> selectMemberTradeRecord(@Param("memberId") Long memberId, @Param("orderSn") String orderSn,
@Param("itemType") Integer itemType, @Param("type") Integer type);
List<MemberMonthRewardResult> selectByMemberLevelAndNickname(@Param("memberLevel") Integer memberLevel,
@Param("nickname") String nickname);
}

View File

@@ -0,0 +1,22 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.UmsPermission;
import com.buy507.mall.model.UmsRolePermissionRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 后台用户角色管理自定义Dao
*/
public interface UmsRolePermissionRelationDao {
/**
* 批量插入角色和权限关系
*/
int insertList(@Param("list")List<UmsRolePermissionRelation> list);
/**
* 根据角色获取权限
*/
List<UmsPermission> getPermissionList(@Param("roleId") Long roleId);
}

View File

@@ -0,0 +1,14 @@
package com.buy507.mall.dao;
import com.buy507.mall.model.UmsTransferrecord;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface UmsTransferrecordDao {
List<UmsTransferrecord> selectAll(@Param("memberName") String memberName, @Param("receiverName") String receiverName,
@Param("startTime") Date startTime, @Param("endTime") Date endTime);
}

View File

@@ -0,0 +1,55 @@
package com.buy507.mall.dto;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel("图表描述返回实体")
@Data
public class ChartDescriptionResult {
@ApiModelProperty("今日订单总数")
private Integer todayOrderCount;
@ApiModelProperty("今日销售总额")
private BigDecimal todaySellAmount;
@ApiModelProperty("本周订单总数")
private Integer currentWeekOrderCount;
@ApiModelProperty("本周销售总额")
private BigDecimal currentWeekSellAmount;
@ApiModelProperty("本月订单总数")
private Integer currentMonthOrderCount;
@ApiModelProperty("本月销售总额")
private BigDecimal currentMonthSellAmount;
@ApiModelProperty("本年订单总数")
private Integer currentYearOrderCount;
@ApiModelProperty("本年销售总额")
private BigDecimal currenYearSellAmount;
@ApiModelProperty("本周提现总数")
private Integer currentWeekWithdrawCount;
@ApiModelProperty("本周提现总额")
private BigDecimal currentWeekWithdrawAmount;
@ApiModelProperty("本月提现总数")
private Integer currentMonthWithdrawCount;
@ApiModelProperty("本月提现总额")
private BigDecimal currentMonthWithdrawAmount;
@ApiModelProperty("本年提现总数")
private Integer currentYearWithdrawCount;
@ApiModelProperty("本年提现总额")
private BigDecimal currenYearWithdrawAmount;
}

View File

@@ -0,0 +1,25 @@
package com.buy507.mall.dto;
public class ExpressOptions {
private String value;
private String label;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@@ -0,0 +1,94 @@
package com.buy507.mall.dto;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel("首页查询返回实体")
@Data
public class HomeResult {
@ApiModelProperty("今日订单总数")
private Integer todayOrderCount;
@ApiModelProperty("今日销售总额")
private BigDecimal todaySellAmount;
@ApiModelProperty("昨日销售总额")
private BigDecimal yesterdaySellAmount;
@ApiModelProperty("本月销售总额")
private BigDecimal currentMonthSellAmount;
@ApiModelProperty("销售总金额")
private BigDecimal allSellAmount;
@ApiModelProperty("积分支付总金额")
private BigDecimal balancePayemntAmount;
@ApiModelProperty("提现总金额")
private BigDecimal withdrawAmount;
@ApiModelProperty("提现总人数")
private Integer withdrawMemberCount;
@ApiModelProperty("普通会员总数")
private Integer memberCount;
@ApiModelProperty("消费商总数")
private Integer consumerCount;
@ApiModelProperty("经销商总数")
private Integer partnerCount;
@ApiModelProperty("合作商总数")
private Integer diamondCount;
@ApiModelProperty("初级合作商总数")
private Integer oneDiamondCount;
@ApiModelProperty("中级合作商总数")
private Integer twoDiamondCount;
@ApiModelProperty("高级合作商总数")
private Integer threeDiamondCount;
@ApiModelProperty("特级合作商总数")
private Integer fourDiamondCount;
@ApiModelProperty("开店会员总数")
private Integer openStoreCount;
@ApiModelProperty("会员总数")
private Integer allMemberCount;
@ApiModelProperty("待付款订单")
private Integer waitPaymentOrderCount;
@ApiModelProperty("已完成订单")
private Integer doneOrderCount;
@ApiModelProperty("待发货订单")
private Integer waitDeliveryOrderCount;
@ApiModelProperty("待提货订单")
private Integer waitPickUpOrderCount;
@ApiModelProperty("已发货订单")
private Integer deliveredOrderCount;
@ApiModelProperty("待确认付款订单")
private Integer waitConfirmPaymentOrderCount;
@ApiModelProperty("待确认收货订单")
private Integer waitConfirmReceiveOrderCount;
@ApiModelProperty("待处理提现申请")
private Integer waitHandleWithdrawApplyCount;
@ApiModelProperty("已处理提现申请")
private Integer handledWithdrawApplyCount;
}

View File

@@ -0,0 +1,35 @@
package com.buy507.mall.dto;
public class LogisticsResult {
private String state;
private String stateName;
private Object data;
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getStateName() {
return stateName;
}
public void setStateName(String stateName) {
this.stateName = stateName;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}

View File

@@ -0,0 +1,103 @@
package com.buy507.mall.dto;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 会员月度奖励查询实体
*/
@ApiModel("会员月度奖励查询实体")
public class MemberMonthRewardResult {
@ApiModelProperty(value = "会员ID")
private Long memberId;
@ApiModelProperty(value = "昵称")
private String nickname;
@ApiModelProperty(value = "分销会员等级0->普通会员1->消费商2->经销商3->合作商4->初级合作商5->中级合作商6->高级合作商7->特级合作商)")
private Integer memberLevel;
@ApiModelProperty(value = "手机号码")
private String phone;
@ApiModelProperty(value = "性别0->未知1->男2->女")
private Integer gender;
@ApiModelProperty(value = "月度奖励")
private BigDecimal value;
@ApiModelProperty(value = "分享人")
private String inviter;
@ApiModelProperty(value = "注册时间")
private Date createTime;
public Long getMemberId() {
return memberId;
}
public void setMemberId(Long memberId) {
this.memberId = memberId;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getMemberLevel() {
return memberLevel;
}
public void setMemberLevel(Integer memberLevel) {
this.memberLevel = memberLevel;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public BigDecimal getValue() {
return value;
}
public void setValue(BigDecimal value) {
this.value = value;
}
public String getInviter() {
return inviter;
}
public void setInviter(String inviter) {
this.inviter = inviter;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@@ -0,0 +1,150 @@
package com.buy507.mall.dto;
import java.math.BigDecimal;
import java.util.Date;
import com.buy507.mall.model.MemberLevel;
import com.buy507.mall.model.StoreStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel("会员返回实体")
public class MemberResult {
private Long id;
@ApiModelProperty(value = "分销会员等级0->普通会员1->消费商2->经销商3->合作商4->初级合作商5->中级合作商6->高级合作商7->特级合作商)")
private MemberLevel memberLevel;
@ApiModelProperty(value = "用户名")
private String username;
@ApiModelProperty(value = "昵称")
private String nickname;
@ApiModelProperty(value = "手机号码")
private String phone;
@ApiModelProperty(value = "性别0->未知1->男2->女")
private Integer gender;
@ApiModelProperty(value = "分销实体店状态0->未开店1->已开店)")
private StoreStatus storeStatus;
@ApiModelProperty(value = "余额")
private BigDecimal balance;
@ApiModelProperty(value = "冻结余额")
private BigDecimal freeze;
@ApiModelProperty(value = "总收入")
private BigDecimal totalIncome;
@ApiModelProperty(value = "总支出")
private BigDecimal totalExpenditure;
@ApiModelProperty(value = "邀请人")
private String inviter;
@ApiModelProperty(value = "注册时间")
private Date createTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public MemberLevel getMemberLevel() {
return memberLevel;
}
public void setMemberLevel(MemberLevel memberLevel) {
this.memberLevel = memberLevel;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public StoreStatus getStoreStatus() {
return storeStatus;
}
public void setStoreStatus(StoreStatus storeStatus) {
this.storeStatus = storeStatus;
}
public BigDecimal getBalance() {
return balance;
}
public void setBalance(BigDecimal balance) {
this.balance = balance;
}
public BigDecimal getFreeze() {
return freeze;
}
public void setFreeze(BigDecimal freeze) {
this.freeze = freeze;
}
public BigDecimal getTotalIncome() {
return totalIncome;
}
public void setTotalIncome(BigDecimal totalIncome) {
this.totalIncome = totalIncome;
}
public BigDecimal getTotalExpenditure() {
return totalExpenditure;
}
public void setTotalExpenditure(BigDecimal totalExpenditure) {
this.totalExpenditure = totalExpenditure;
}
public String getInviter() {
return inviter;
}
public void setInviter(String inviter) {
this.inviter = inviter;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@@ -0,0 +1,28 @@
package com.buy507.mall.dto;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
@Data
public class MemberShoppingInfoResult {
private String name; //姓名
private String nickname; //昵称
private String phone; //电话
private String productName; //商品名称
private Integer quantity; //数量
private BigDecimal price; //单价
private BigDecimal totalPrice; //总价
private Date createTime;
}

View File

@@ -0,0 +1,47 @@
package com.buy507.mall.dto;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel("会员团队信息返回实体")
@Data
public class MemberTeamInfoResult {
@ApiModelProperty(value = "会员id")
private Long id;
@ApiModelProperty(value = "分销会员等级0->普通会员1->消费商2->经销商3->合作商4->初级合作商5->中级合作商6->高级合作商7->特级合作商)")
private Integer memberLevel;
@ApiModelProperty(value = "昵称")
private String nickname;
@ApiModelProperty(value = "手机号码")
private String phone;
@ApiModelProperty(value = "性别0->未知1->男2->女")
private Integer gender;
@ApiModelProperty(value = "分销实体店状态0->未开店1->已开店)")
private Integer storeStatus;
@ApiModelProperty(value = "个人累计消费")
private BigDecimal personalConsume;
@ApiModelProperty(value = "团队累计消费")
private BigDecimal teamConsume;
@ApiModelProperty(value = "邀请人姓名")
private String inviterName;
@ApiModelProperty(value = "邀请人id")
private Long inviterId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
}

View File

@@ -0,0 +1,103 @@
package com.buy507.mall.dto;
import java.math.BigDecimal;
import java.util.Date;
/**
* 会员账户交易记录查询实体
* @author yeyun
*
*/
public class MemberTradeRecordResult {
private String username;
private String nickname;
private Integer itemType;
private Integer type;
private BigDecimal value;
private String title;
private String note;
private String orderSn;
private Date createTime;
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 Integer getItemType() {
return itemType;
}
public void setItemType(Integer itemType) {
this.itemType = itemType;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public BigDecimal getValue() {
return value;
}
public void setValue(BigDecimal value) {
this.value = value;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public String getOrderSn() {
return orderSn;
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@@ -0,0 +1,209 @@
package com.buy507.mall.dto;
import java.math.BigDecimal;
import java.util.Date;
public class MemberWithdrawApplyResult {
private Long id;
private Long memberId;
private String name;
private String phone;
private BigDecimal value; //提现金额
private BigDecimal poundage; //提现金额
private BigDecimal actualValue; //扣出手续费后的值
private String accountName;
private String bankName;
private String bankCardNum;
private String openBankAddress;
private String realName; //真实姓名
private String alipayAccount; //支付宝账号
private String wechatAccount; //微信账号
private String wechatNickname; //微信昵称
private Integer withdrawType; //提现方式(0: 支付宝; 1: 微信; 2: 银行卡)
private Integer paymentStatus; //付款状态0->未打款1->已打款2->打款失败
private String failedReason;
// 打款时间
private Date paymentTime;
// 创建时间
private Date createTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getMemberId() {
return memberId;
}
public void setMemberId(Long memberId) {
this.memberId = memberId;
}
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 BigDecimal getValue() {
return value;
}
public void setValue(BigDecimal value) {
this.value = value;
}
public BigDecimal getPoundage() {
return poundage;
}
public void setPoundage(BigDecimal poundage) {
this.poundage = poundage;
}
public BigDecimal getActualValue() {
return actualValue;
}
public void setActualValue(BigDecimal actualValue) {
this.actualValue = actualValue;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBankCardNum() {
return bankCardNum;
}
public void setBankCardNum(String bankCardNum) {
this.bankCardNum = bankCardNum;
}
public String getOpenBankAddress() {
return openBankAddress;
}
public void setOpenBankAddress(String openBankAddress) {
this.openBankAddress = openBankAddress;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getAlipayAccount() {
return alipayAccount;
}
public void setAlipayAccount(String alipayAccount) {
this.alipayAccount = alipayAccount;
}
public String getWechatAccount() {
return wechatAccount;
}
public void setWechatAccount(String wechatAccount) {
this.wechatAccount = wechatAccount;
}
public String getWechatNickname() {
return wechatNickname;
}
public void setWechatNickname(String wechatNickname) {
this.wechatNickname = wechatNickname;
}
public Integer getWithdrawType() {
return withdrawType;
}
public void setWithdrawType(Integer withdrawType) {
this.withdrawType = withdrawType;
}
public Integer getPaymentStatus() {
return paymentStatus;
}
public void setPaymentStatus(Integer paymentStatus) {
this.paymentStatus = paymentStatus;
}
public String getFailedReason() {
return failedReason;
}
public void setFailedReason(String failedReason) {
this.failedReason = failedReason;
}
public Date getPaymentTime() {
return paymentTime;
}
public void setPaymentTime(Date paymentTime) {
this.paymentTime = paymentTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@@ -0,0 +1,18 @@
package com.buy507.mall.dto;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
/**
* 修改订单费用信息参数
*/
@Getter
@Setter
public class OmsMoneyInfoParam {
private Long orderId;
private BigDecimal freightAmount;
private BigDecimal discountAmount;
private Integer status;
}

Some files were not shown because too many files have changed in this diff Show More