Commit 1420ba5a authored by sunsongtao's avatar sunsongtao

千卓

parents
Pipeline #50 failed with stages
File added
######################################################################
# Build Tools
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
target/
!.mvn/wrapper/maven-wrapper.jar
######################################################################
# IDE
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
nbproject/private/
build/*
nbbuild/
dist/
nbdist/
.nb-gradle/
######################################################################
# Others
*.log
*.xml.versionsBackup
*.swp
!*/build/*.java
!*/build/*.html
!*/build/*.xml
The MIT License (MIT)
Copyright (c) 2018 RuoYi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
## 平台简介
励晓是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 前端采用Vue、Element UI。
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
* 权限认证使用Jwt,支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了单应用版本[RuoYi-Vue-fast](https://github.com/yangzongzhuan/RuoYi-Vue-fast),Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 特别鸣谢:[element](https://github.com/ElemeFE/element)[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)[eladmin-web](https://github.com/elunez/eladmin-web)
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)  
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
7. 参数管理:对系统动态配置常用参数。
8. 通知公告:系统通知公告信息发布维护。
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
10. 登录日志:系统登录日志记录查询包含登录异常。
11. 在线用户:当前系统中活跃用户状态监控。
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
14. 系统接口:根据业务代码自动生成相关的api接口文档。
15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 缓存监控:对系统的缓存信息查询,命令统计等。
17. 在线构建器:拖动表单元素生成相应的HTML代码。
18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
## 在线体验
- admin/admin123
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
演示地址:http://vue.ruoyi.vip
文档地址:http://doc.ruoyi.vip
## 演示图
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 励晓前后端分离交流群
QQ群: [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) 点击按钮入群。
@echo off
echo.
echo [信息] 清理工程target生成路径。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean
pause
\ No newline at end of file
@echo off
echo.
echo [信息] 打包Web工程,生成war/jar包文件。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean package -Dmaven.test.skip=true
pause
\ No newline at end of file
@echo off
echo.
echo [信息] 使用Jar命令运行Web工程。
echo.
cd %~dp0
cd ../ruoyi-admin/target
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -jar %JAVA_OPTS% ruoyi-admin.jar
cd bin
pause
\ No newline at end of file
{
"lockfileVersion": 1
}
This diff is collapsed.
@echo off
rem jar平级目录
set AppName=ruoyi-admin.jar
rem JVM参数
set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
ECHO.
ECHO. [1] 启动%AppName%
ECHO. [2] 关闭%AppName%
ECHO. [3] 重启%AppName%
ECHO. [4] 启动状态 %AppName%
ECHO. [5] 退 出
ECHO.
ECHO.请输入选择项目的序号:
set /p ID=
IF "%id%"=="1" GOTO start
IF "%id%"=="2" GOTO stop
IF "%id%"=="3" GOTO restart
IF "%id%"=="4" GOTO status
IF "%id%"=="5" EXIT
PAUSE
:start
for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do (
set pid=%%a
set image_name=%%b
)
if defined pid (
echo %%is running
PAUSE
)
start javaw -jar %JAVA_OPTS% ruoyi-admin.jar
echo starting……
echo Start %AppName% success...
goto:eof
rem 函数stop通过jps命令查找pid并结束进程
:stop
for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do (
set pid=%%a
set image_name=%%b
)
if not defined pid (echo process %AppName% does not exists) else (
echo prepare to kill %image_name%
echo start kill %pid% ...
rem 根据进程ID,kill进程
taskkill /f /pid %pid%
)
goto:eof
:restart
call :stop
call :start
goto:eof
:status
for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do (
set pid=%%a
set image_name=%%b
)
if not defined pid (echo process %AppName% is dead ) else (
echo %image_name% is running
)
goto:eof
\ No newline at end of file
#!/bin/sh
# author ruoyi
# ./ry.sh start 启动
# ./ry.sh stop 停止
# ./ry.sh restart 重启
# ./ry.sh status 状态
AppName=ruoyi-admin.jar
# JVM参数
JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
APP_HOME=`pwd`
LOG_PATH=$APP_HOME/logs/$AppName.log
if [ "$1" = "" ];
then
echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m"
exit 1
fi
if [ "$AppName" = "" ];
then
echo -e "\033[0;31m 未输入应用名 \033[0m"
exit 1
fi
function start()
{
PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
if [ x"$PID" != x"" ]; then
echo "$AppName is running..."
else
nohup java -jar $JVM_OPTS target/$AppName > /dev/null 2>&1 &
echo "Start $AppName success..."
fi
}
function stop()
{
echo "Stop $AppName"
PID=""
query(){
PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
}
query
if [ x"$PID" != x"" ]; then
kill -TERM $PID
echo "$AppName (pid:$PID) exiting..."
while [ x"$PID" != x"" ]
do
sleep 1
query
done
echo "$AppName exited."
else
echo "$AppName already stopped."
fi
}
function restart()
{
stop
sleep 2
start
}
function status()
{
PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l`
if [ $PID != 0 ];then
echo "$AppName is running..."
else
echo "$AppName is not running..."
fi
}
case $1 in
start)
start;;
stop)
stop;;
restart)
restart;;
status)
status;;
*)
esac
xiaoniu-admin; jdk:8-c08; tcp ; 25956
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>xiaoniu-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!--json转化-->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160212</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.6</version>
</dependency>
<!--阿里支付 start-->
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.7.1.ALL</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--end-->
<!--阿里云短信sdk-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.1.0</version>
</dependency>
<!--七牛云-->
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>[7.2.0, 7.2.99]</version>
</dependency>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>xiaoniu-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>xiaoniu-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>xiaoniu-generator</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.10</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.1.RELEASE</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>
package com.ruoyi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
* 启动程序
*
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class ClifeApplication
{
public static void main(String[] args)
{
SpringApplication.run(ClifeApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 千卓启动成功 ლ(´ڡ`ლ)゙ \n" +
" ''-' `'-' `-..-' ");
}
}
package com.ruoyi;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web容器中进行部署
*
* @author ruoyi
*/
public class ClifeServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(ClifeApplication.class);
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallBanner;
import com.ruoyi.mall.service.IMallBannerService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 轮播图Controller
*
* @author ruoyi
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallBanner")
public class MallBannerController extends BaseController
{
@Autowired
private IMallBannerService mallBannerService;
/**
* 查询轮播图列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallBanner:list')")
@GetMapping("/list")
public TableDataInfo list(MallBanner mallBanner)
{
startPage();
List<MallBanner> list = mallBannerService.selectMallBannerList(mallBanner);
return getDataTable(list);
}
/**
* 导出轮播图列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallBanner:export')")
@Log(title = "轮播图", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallBanner mallBanner)
{
List<MallBanner> list = mallBannerService.selectMallBannerList(mallBanner);
ExcelUtil<MallBanner> util = new ExcelUtil<MallBanner>(MallBanner.class);
return util.exportExcel(list, "轮播图数据");
}
/**
* 获取轮播图详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallBanner:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallBannerService.selectMallBannerById(id));
}
/**
* 新增轮播图
*/
@PreAuthorize("@ss.hasPermi('mall:mallBanner:add')")
@Log(title = "轮播图", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallBanner mallBanner)
{
mallBanner.setCreateAt(DateUtils.getTime());
return toAjax(mallBannerService.insertMallBanner(mallBanner));
}
/**
* 修改轮播图
*/
@PreAuthorize("@ss.hasPermi('mall:mallBanner:edit')")
@Log(title = "轮播图", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallBanner mallBanner)
{
return toAjax(mallBannerService.updateMallBanner(mallBanner));
}
/**
* 删除轮播图
*/
@PreAuthorize("@ss.hasPermi('mall:mallBanner:remove')")
@Log(title = "轮播图", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallBannerService.deleteMallBannerByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallCmsNotice;
import com.ruoyi.mall.service.IMallCmsNoticeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 公告Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallCmsNotice")
public class MallCmsNoticeController extends BaseController
{
@Autowired
private IMallCmsNoticeService mallCmsNoticeService;
/**
* 查询公告列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallCmsNotice:list')")
@GetMapping("/list")
public TableDataInfo list(MallCmsNotice mallCmsNotice)
{
startPage();
List<MallCmsNotice> list = mallCmsNoticeService.selectMallCmsNoticeList(mallCmsNotice);
return getDataTable(list);
}
/**
* 导出公告列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallCmsNotice:export')")
@Log(title = "公告", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallCmsNotice mallCmsNotice)
{
List<MallCmsNotice> list = mallCmsNoticeService.selectMallCmsNoticeList(mallCmsNotice);
ExcelUtil<MallCmsNotice> util = new ExcelUtil<MallCmsNotice>(MallCmsNotice.class);
return util.exportExcel(list, "公告数据");
}
/**
* 获取公告详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallCmsNotice:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallCmsNoticeService.selectMallCmsNoticeById(id));
}
/**
* 新增公告
*/
@PreAuthorize("@ss.hasPermi('mall:mallCmsNotice:add')")
@Log(title = "公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallCmsNotice mallCmsNotice)
{
mallCmsNotice.setCreateAt(DateUtils.getTime());
return toAjax(mallCmsNoticeService.insertMallCmsNotice(mallCmsNotice));
}
/**
* 修改公告
*/
@PreAuthorize("@ss.hasPermi('mall:mallCmsNotice:edit')")
@Log(title = "公告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallCmsNotice mallCmsNotice)
{
return toAjax(mallCmsNoticeService.updateMallCmsNotice(mallCmsNotice));
}
/**
* 删除公告
*/
@PreAuthorize("@ss.hasPermi('mall:mallCmsNotice:remove')")
@Log(title = "公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallCmsNoticeService.deleteMallCmsNoticeByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallCoupon;
import com.ruoyi.mall.service.IMallCouponService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 优惠券Controller
*
* @author ruoyi
* @date 2021-12-17
*/
@RestController
@RequestMapping("/mall/mallCoupon")
public class MallCouponController extends BaseController
{
@Autowired
private IMallCouponService mallCouponService;
/**
* 查询优惠券列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallCoupon:list')")
@GetMapping("/list")
public TableDataInfo list(MallCoupon mallCoupon)
{
startPage();
List<MallCoupon> list = mallCouponService.selectMallCouponList(mallCoupon);
return getDataTable(list);
}
/**
* 导出优惠券列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallCoupon:export')")
@Log(title = "优惠券", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallCoupon mallCoupon)
{
List<MallCoupon> list = mallCouponService.selectMallCouponList(mallCoupon);
ExcelUtil<MallCoupon> util = new ExcelUtil<MallCoupon>(MallCoupon.class);
return util.exportExcel(list, "优惠券数据");
}
/**
* 获取优惠券详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallCoupon:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallCouponService.selectMallCouponById(id));
}
/**
* 新增优惠券
*/
@PreAuthorize("@ss.hasPermi('mall:mallCoupon:add')")
@Log(title = "优惠券", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallCoupon mallCoupon)
{
if ("0".equals(mallCoupon.getType())){
MallCoupon typeCoupon = new MallCoupon();
typeCoupon.setType("0");
List<MallCoupon> list = mallCouponService.selectMallCouponList(typeCoupon);
if (list.size() > 0){
return AjaxResult.error("新人优惠券已经存在,请前去修改");
}
}
mallCoupon.setCreateAt(DateUtils.getTime());
return toAjax(mallCouponService.insertMallCoupon(mallCoupon));
}
/**
* 修改优惠券
*/
@PreAuthorize("@ss.hasPermi('mall:mallCoupon:edit')")
@Log(title = "优惠券", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallCoupon mallCoupon)
{
mallCoupon.setUpdateAt(DateUtils.getTime());
return toAjax(mallCouponService.updateMallCoupon(mallCoupon));
}
/**
* 删除优惠券
*/
@PreAuthorize("@ss.hasPermi('mall:mallCoupon:remove')")
@Log(title = "优惠券", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallCouponService.deleteMallCouponByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallFeedback;
import com.ruoyi.mall.service.IMallFeedbackService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 意见反馈Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallFeedback")
public class MallFeedbackController extends BaseController
{
@Autowired
private IMallFeedbackService mallFeedbackService;
/**
* 查询意见反馈列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallFeedback:list')")
@GetMapping("/list")
public TableDataInfo list(MallFeedback mallFeedback)
{
startPage();
List<MallFeedback> list = mallFeedbackService.selectMallFeedbackList(mallFeedback);
return getDataTable(list);
}
/**
* 导出意见反馈列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallFeedback:export')")
@Log(title = "意见反馈", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallFeedback mallFeedback)
{
List<MallFeedback> list = mallFeedbackService.selectMallFeedbackList(mallFeedback);
ExcelUtil<MallFeedback> util = new ExcelUtil<MallFeedback>(MallFeedback.class);
return util.exportExcel(list, "意见反馈数据");
}
/**
* 获取意见反馈详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallFeedback:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallFeedbackService.selectMallFeedbackById(id));
}
/**
* 新增意见反馈
*/
@PreAuthorize("@ss.hasPermi('mall:mallFeedback:add')")
@Log(title = "意见反馈", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallFeedback mallFeedback)
{
return toAjax(mallFeedbackService.insertMallFeedback(mallFeedback));
}
/**
* 修改意见反馈
*/
@PreAuthorize("@ss.hasPermi('mall:mallFeedback:edit')")
@Log(title = "意见反馈", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallFeedback mallFeedback)
{
mallFeedback.setUpdateAt(DateUtils.getTime());
return toAjax(mallFeedbackService.updateMallFeedback(mallFeedback));
}
/**
* 删除意见反馈
*/
@PreAuthorize("@ss.hasPermi('mall:mallFeedback:remove')")
@Log(title = "意见反馈", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallFeedbackService.deleteMallFeedbackByIds(ids));
}
}
package com.ruoyi.mall.controller;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.mall.domain.MallGoodsClass;
import com.ruoyi.mall.domain.vo.MallGoodsClassVO;
import com.ruoyi.mall.service.IMallGoodsClassService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 商品类型Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallGoodsClass")
public class MallGoodsClassController extends BaseController
{
@Autowired
private IMallGoodsClassService mallGoodsClassService;
/**
* 查询商品类型列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsClass:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsClass mallGoodsClass)
{
startPage();
mallGoodsClass.setParentId(0L);
List<MallGoodsClass> list = mallGoodsClassService.selectMallGoodsClassList(mallGoodsClass);
if (CollectionUtils.isNotEmpty(list)){
List<MallGoodsClass> mallGoodsClasses = mallGoodsClassService.listByParentIds(
list.stream().map(MallGoodsClass::getId).collect(Collectors.toList()));
list.addAll(mallGoodsClasses);
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(buildTree(list));
rspData.setTotal(new PageInfo(list).getTotal());
return rspData;
}
return getDataTable(list);
}
/**
* 导出商品类型列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsClass:export')")
@Log(title = "商品类型", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallGoodsClass mallGoodsClass)
{
List<MallGoodsClass> list = mallGoodsClassService.selectMallGoodsClassList(mallGoodsClass);
ExcelUtil<MallGoodsClass> util = new ExcelUtil<MallGoodsClass>(MallGoodsClass.class);
return util.exportExcel(list, "商品类型数据");
}
/**
* 获取商品类型详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsClass:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsClassService.selectMallGoodsClassById(id));
}
/**
* 新增商品类型
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsClass:add')")
@Log(title = "商品类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsClass mallGoodsClass)
{
mallGoodsClass.setCreateAt(DateUtils.getTime());
return toAjax(mallGoodsClassService.insertMallGoodsClass(mallGoodsClass));
}
/**
* 修改商品类型
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsClass:edit')")
@Log(title = "商品类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsClass mallGoodsClass)
{
return toAjax(mallGoodsClassService.updateMallGoodsClass(mallGoodsClass));
}
/**
* 删除商品类型
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsClass:remove')")
@Log(title = "商品类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsClassService.deleteMallGoodsClassByIds(ids));
}
@GetMapping("/getClassList")
public AjaxResult getClassList(MallGoodsClass mallGoodsClass)
{
List<MallGoodsClass> list = mallGoodsClassService.selectMallGoodsClassList(mallGoodsClass);
if (CollectionUtils.isNotEmpty(list)){
return AjaxResult.success(buildTree(list));
}
return AjaxResult.success(list);
}
@GetMapping("/tree")
public AjaxResult tree()
{
MallGoodsClass mallGoodsClass = new MallGoodsClass();
mallGoodsClass.setStatus("0");
List<MallGoodsClass> list = mallGoodsClassService.selectMallGoodsClassList(mallGoodsClass);
if (CollectionUtils.isNotEmpty(list)){
return AjaxResult.success(buildTree(list));
}
return AjaxResult.success(list);
}
/**
* 将扁平化的列表转换为树形结构
*
* @param flatList 扁平化的列表
* @return 树形结构的根节点列表
*/
public static List<MallGoodsClassVO> buildTree(List<MallGoodsClass> flatList) {
List<MallGoodsClassVO> rootNodes = new ArrayList<>();
Map<Long, List<MallGoodsClass>> map = new HashMap<>();
List<MallGoodsClass> collect = flatList.stream().filter(
f -> f.getParentId() == null || f.getParentId() == 0).collect(Collectors.toList());
List<MallGoodsClass> collect1 = flatList.stream().filter(
f -> f.getParentId() != null && f.getParentId() != 0).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect1)){
map = collect1.stream().collect(Collectors.groupingBy(MallGoodsClass::getParentId));
}
// 将所有节点放入Map中,方便通过id快速查找
for (MallGoodsClass node : collect) {
MallGoodsClassVO vo = new MallGoodsClassVO();
BeanUtils.copyProperties(node , vo);
List<MallGoodsClass> mallGoodsClasses = map.get(node.getId());
if(CollectionUtils.isNotEmpty(mallGoodsClasses)){
vo.setMallGoodsClassVOS(mallGoodsClasses.stream().map(
m -> {
MallGoodsClassVO vo1 = new MallGoodsClassVO();
BeanUtils.copyProperties(m , vo1);
return vo1;
}).collect(Collectors.toList()));
}
rootNodes.add(vo);
}
return rootNodes;
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallGoodsFollow;
import com.ruoyi.mall.service.IMallGoodsFollowService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 产品关注Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallGoodsFollow")
public class MallGoodsFollowController extends BaseController
{
@Autowired
private IMallGoodsFollowService mallGoodsFollowService;
/**
* 查询产品关注列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsFollow:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsFollow mallGoodsFollow)
{
startPage();
List<MallGoodsFollow> list = mallGoodsFollowService.selectMallGoodsFollowList(mallGoodsFollow);
return getDataTable(list);
}
/**
* 导出产品关注列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsFollow:export')")
@Log(title = "产品关注", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallGoodsFollow mallGoodsFollow)
{
List<MallGoodsFollow> list = mallGoodsFollowService.selectMallGoodsFollowList(mallGoodsFollow);
ExcelUtil<MallGoodsFollow> util = new ExcelUtil<MallGoodsFollow>(MallGoodsFollow.class);
return util.exportExcel(list, "产品关注数据");
}
/**
* 获取产品关注详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsFollow:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsFollowService.selectMallGoodsFollowById(id));
}
/**
* 新增产品关注
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsFollow:add')")
@Log(title = "产品关注", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsFollow mallGoodsFollow)
{
return toAjax(mallGoodsFollowService.insertMallGoodsFollow(mallGoodsFollow));
}
/**
* 修改产品关注
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsFollow:edit')")
@Log(title = "产品关注", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsFollow mallGoodsFollow)
{
return toAjax(mallGoodsFollowService.updateMallGoodsFollow(mallGoodsFollow));
}
/**
* 删除产品关注
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsFollow:remove')")
@Log(title = "产品关注", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsFollowService.deleteMallGoodsFollowByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallGoodsGoods;
import com.ruoyi.mall.service.IMallGoodsGoodsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallGoodsGoods")
public class MallGoodsGoodsController extends BaseController
{
@Autowired
private IMallGoodsGoodsService mallGoodsGoodsService;
/**
* 查询商品列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsGoods:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsGoods mallGoodsGoods)
{
startPage();
List<MallGoodsGoods> list = mallGoodsGoodsService.selectMallGoodsGoodsList(mallGoodsGoods);
return getDataTable(list);
}
/**
* 导出商品列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsGoods:export')")
@Log(title = "商品", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallGoodsGoods mallGoodsGoods)
{
List<MallGoodsGoods> list = mallGoodsGoodsService.selectMallGoodsGoodsList(mallGoodsGoods);
ExcelUtil<MallGoodsGoods> util = new ExcelUtil<MallGoodsGoods>(MallGoodsGoods.class);
return util.exportExcel(list, "商品数据");
}
/**
* 获取商品详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsGoods:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsGoodsService.selectMallGoodsGoodsById(id));
}
/**
* 新增商品
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsGoods:add')")
@Log(title = "商品", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsGoods mallGoodsGoods)
{
// if (StringUtils.isEmpty(mallGoodsGoods.getGoodsBanner()) || StringUtils.isEmpty(mallGoodsGoods.getGoodsDetail())){
// return AjaxResult.error("缺少轮播图和详情图");
// }
try {
return toAjax(mallGoodsGoodsService.insertMallGoodsGoods(mallGoodsGoods));
} catch (Exception e) {
return AjaxResult.error("填写内容不完整,请仔细填写");
}
}
/**
* 修改商品
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsGoods:edit')")
@Log(title = "商品", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsGoods mallGoodsGoods)
{
// if (StringUtils.isEmpty(mallGoodsGoods.getGoodsBanner()) || StringUtils.isEmpty(mallGoodsGoods.getGoodsDetail())){
// return AjaxResult.error("缺少轮播图和详情图");
// }
return toAjax(mallGoodsGoodsService.updateMallGoodsGoods(mallGoodsGoods));
}
/**
* 删除商品
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsGoods:remove')")
@Log(title = "商品", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsGoodsService.deleteMallGoodsGoodsByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallGoodsPostFee;
import com.ruoyi.mall.service.IMallGoodsPostFeeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品邮费Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallGoodsPostFee")
public class MallGoodsPostFeeController extends BaseController
{
@Autowired
private IMallGoodsPostFeeService mallGoodsPostFeeService;
/**
* 查询商品邮费列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsPostFee:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsPostFee mallGoodsPostFee)
{
startPage();
List<MallGoodsPostFee> list = mallGoodsPostFeeService.selectMallGoodsPostFeeList(mallGoodsPostFee);
return getDataTable(list);
}
/**
* 导出商品邮费列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsPostFee:export')")
@Log(title = "商品邮费", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallGoodsPostFee mallGoodsPostFee)
{
List<MallGoodsPostFee> list = mallGoodsPostFeeService.selectMallGoodsPostFeeList(mallGoodsPostFee);
ExcelUtil<MallGoodsPostFee> util = new ExcelUtil<MallGoodsPostFee>(MallGoodsPostFee.class);
return util.exportExcel(list, "商品邮费数据");
}
/**
* 获取商品邮费详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsPostFee:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsPostFeeService.selectMallGoodsPostFeeById(id));
}
/**
* 新增商品邮费
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsPostFee:add')")
@Log(title = "商品邮费", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsPostFee mallGoodsPostFee)
{
return toAjax(mallGoodsPostFeeService.insertMallGoodsPostFee(mallGoodsPostFee));
}
/**
* 修改商品邮费
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsPostFee:edit')")
@Log(title = "商品邮费", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsPostFee mallGoodsPostFee)
{
return toAjax(mallGoodsPostFeeService.updateMallGoodsPostFee(mallGoodsPostFee));
}
/**
* 删除商品邮费
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsPostFee:remove')")
@Log(title = "商品邮费", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsPostFeeService.deleteMallGoodsPostFeeByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallGoodsProduct;
import com.ruoyi.mall.service.IMallGoodsProductService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品 产品Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallGoodsProduct")
public class MallGoodsProductController extends BaseController
{
@Autowired
private IMallGoodsProductService mallGoodsProductService;
/**
* 查询商品 产品列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsProduct:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsProduct mallGoodsProduct)
{
startPage();
List<MallGoodsProduct> list = mallGoodsProductService.selectMallGoodsProductList(mallGoodsProduct);
return getDataTable(list);
}
/**
* 导出商品 产品列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsProduct:export')")
@Log(title = "商品 产品", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallGoodsProduct mallGoodsProduct)
{
List<MallGoodsProduct> list = mallGoodsProductService.selectMallGoodsProductList(mallGoodsProduct);
ExcelUtil<MallGoodsProduct> util = new ExcelUtil<MallGoodsProduct>(MallGoodsProduct.class);
return util.exportExcel(list, "商品 产品数据");
}
/**
* 获取商品 产品详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsProduct:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsProductService.selectMallGoodsProductById(id));
}
/**
* 新增商品 产品
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsProduct:add')")
@Log(title = "商品 产品", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsProduct mallGoodsProduct)
{
return toAjax(mallGoodsProductService.insertMallGoodsProduct(mallGoodsProduct));
}
/**
* 修改商品 产品
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsProduct:edit')")
@Log(title = "商品 产品", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsProduct mallGoodsProduct)
{
return toAjax(mallGoodsProductService.updateMallGoodsProduct(mallGoodsProduct));
}
/**
* 删除商品 产品
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsProduct:remove')")
@Log(title = "商品 产品", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsProductService.deleteMallGoodsProductByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import com.ruoyi.mall.domain.MallGoodsSpecValue;
import com.ruoyi.mall.service.IMallGoodsSpecValueService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallGoodsSpec;
import com.ruoyi.mall.service.IMallGoodsSpecService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品规格名Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallGoodsSpec")
public class MallGoodsSpecController extends BaseController
{
@Autowired
private IMallGoodsSpecService mallGoodsSpecService;
@Autowired
private IMallGoodsSpecValueService mallGoodsSpecValueService;
/**
* 查询商品规格名列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpec:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsSpec mallGoodsSpec)
{
startPage();
List<MallGoodsSpec> list = mallGoodsSpecService.selectMallGoodsSpecList(mallGoodsSpec);
return getDataTable(list);
}
/**
* 导出商品规格名列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpec:export')")
@Log(title = "商品规格名", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallGoodsSpec mallGoodsSpec)
{
List<MallGoodsSpec> list = mallGoodsSpecService.selectMallGoodsSpecList(mallGoodsSpec);
ExcelUtil<MallGoodsSpec> util = new ExcelUtil<MallGoodsSpec>(MallGoodsSpec.class);
return util.exportExcel(list, "商品规格名数据");
}
/**
* 获取商品规格名详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpec:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsSpecService.selectMallGoodsSpecById(id));
}
/**
* 新增商品规格名
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpec:add')")
@Log(title = "商品规格名", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsSpec mallGoodsSpec)
{
if (mallGoodsSpec.getSpec().size()<1){
return AjaxResult.error("至少有一个规格");
}
return AjaxResult.success(mallGoodsSpecService.insertMallGoodsSpec(mallGoodsSpec));
}
/**
* 修改商品规格名
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpec:edit')")
@Log(title = "商品规格名", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsSpec mallGoodsSpec)
{
return toAjax(mallGoodsSpecService.updateMallGoodsSpec(mallGoodsSpec));
}
/**
* 删除商品规格名
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpec:remove')")
@Log(title = "商品规格名", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsSpecService.deleteMallGoodsSpecByIds(ids));
}
/**
* 查询商品规格名列表
*/
@GetMapping("/getSpecList")
public AjaxResult getSpecList(MallGoodsSpec mallGoodsSpec)
{
List<MallGoodsSpec> list = mallGoodsSpecService.selectMallGoodsSpecList(mallGoodsSpec);
if (list.size()>0){
MallGoodsSpecValue specValue = new MallGoodsSpecValue();
for (MallGoodsSpec goodsSpec:list){
specValue.setSpecId(goodsSpec.getId());
List<MallGoodsSpecValue> list1 =mallGoodsSpecValueService.selectMallGoodsSpecValueList(specValue);
goodsSpec.setSpec(list1);
}
}
return AjaxResult.success(list);
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallGoodsSpecValue;
import com.ruoyi.mall.service.IMallGoodsSpecValueService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品规格值Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallGoodsSpecValue")
public class MallGoodsSpecValueController extends BaseController
{
@Autowired
private IMallGoodsSpecValueService mallGoodsSpecValueService;
/**
* 查询商品规格值列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpecValue:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsSpecValue mallGoodsSpecValue)
{
startPage();
List<MallGoodsSpecValue> list = mallGoodsSpecValueService.selectMallGoodsSpecValueList(mallGoodsSpecValue);
return getDataTable(list);
}
/**
* 导出商品规格值列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpecValue:export')")
@Log(title = "商品规格值", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallGoodsSpecValue mallGoodsSpecValue)
{
List<MallGoodsSpecValue> list = mallGoodsSpecValueService.selectMallGoodsSpecValueList(mallGoodsSpecValue);
ExcelUtil<MallGoodsSpecValue> util = new ExcelUtil<MallGoodsSpecValue>(MallGoodsSpecValue.class);
return util.exportExcel(list, "商品规格值数据");
}
/**
* 获取商品规格值详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpecValue:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsSpecValueService.selectMallGoodsSpecValueById(id));
}
/**
* 新增商品规格值
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpecValue:add')")
@Log(title = "商品规格值", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsSpecValue mallGoodsSpecValue)
{
return toAjax(mallGoodsSpecValueService.insertMallGoodsSpecValue(mallGoodsSpecValue));
}
/**
* 修改商品规格值
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpecValue:edit')")
@Log(title = "商品规格值", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsSpecValue mallGoodsSpecValue)
{
return toAjax(mallGoodsSpecValueService.updateMallGoodsSpecValue(mallGoodsSpecValue));
}
/**
* 删除商品规格值
*/
@PreAuthorize("@ss.hasPermi('mall:mallGoodsSpecValue:remove')")
@Log(title = "商品规格值", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsSpecValueService.deleteMallGoodsSpecValueByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallGoodsTips;
import com.ruoyi.mall.service.IMallGoodsTipsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* mallController
*
* @author ruoyi
* @date 2021-12-31
*/
@RestController
@RequestMapping("/mall/tips")
public class MallGoodsTipsController extends BaseController
{
@Autowired
private IMallGoodsTipsService mallGoodsTipsService;
/**
* 查询mall列表
*/
@PreAuthorize("@ss.hasPermi('mall:tips:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsTips mallGoodsTips)
{
startPage();
List<MallGoodsTips> list = mallGoodsTipsService.selectMallGoodsTipsList(mallGoodsTips);
return getDataTable(list);
}
/**
* 导出mall列表
*/
@PreAuthorize("@ss.hasPermi('mall:tips:export')")
@Log(title = "mall", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallGoodsTips mallGoodsTips)
{
List<MallGoodsTips> list = mallGoodsTipsService.selectMallGoodsTipsList(mallGoodsTips);
ExcelUtil<MallGoodsTips> util = new ExcelUtil<MallGoodsTips>(MallGoodsTips.class);
return util.exportExcel(list, "mall数据");
}
/**
* 获取mall详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:tips:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsTipsService.selectMallGoodsTipsById(id));
}
/**
* 新增mall
*/
@PreAuthorize("@ss.hasPermi('mall:tips:add')")
@Log(title = "mall", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsTips mallGoodsTips)
{
return toAjax(mallGoodsTipsService.insertMallGoodsTips(mallGoodsTips));
}
/**
* 修改mall
*/
@PreAuthorize("@ss.hasPermi('mall:tips:edit')")
@Log(title = "mall", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsTips mallGoodsTips)
{
return toAjax(mallGoodsTipsService.updateMallGoodsTips(mallGoodsTips));
}
/**
* 删除mall
*/
@PreAuthorize("@ss.hasPermi('mall:tips:remove')")
@Log(title = "mall", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsTipsService.deleteMallGoodsTipsByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallHotWord;
import com.ruoyi.mall.service.IMallHotWordService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 热词Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallHotWord")
public class MallHotWordController extends BaseController
{
@Autowired
private IMallHotWordService mallHotWordService;
/**
* 查询热词列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallHotWord:list')")
@GetMapping("/list")
public TableDataInfo list(MallHotWord mallHotWord)
{
startPage();
List<MallHotWord> list = mallHotWordService.selectMallHotWordList(mallHotWord);
return getDataTable(list);
}
/**
* 导出热词列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallHotWord:export')")
@Log(title = "热词", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallHotWord mallHotWord)
{
List<MallHotWord> list = mallHotWordService.selectMallHotWordList(mallHotWord);
ExcelUtil<MallHotWord> util = new ExcelUtil<MallHotWord>(MallHotWord.class);
return util.exportExcel(list, "热词数据");
}
/**
* 获取热词详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallHotWord:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallHotWordService.selectMallHotWordById(id));
}
/**
* 新增热词
*/
@PreAuthorize("@ss.hasPermi('mall:mallHotWord:add')")
@Log(title = "热词", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallHotWord mallHotWord)
{
return toAjax(mallHotWordService.insertMallHotWord(mallHotWord));
}
/**
* 修改热词
*/
@PreAuthorize("@ss.hasPermi('mall:mallHotWord:edit')")
@Log(title = "热词", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallHotWord mallHotWord)
{
return toAjax(mallHotWordService.updateMallHotWord(mallHotWord));
}
/**
* 删除热词
*/
@PreAuthorize("@ss.hasPermi('mall:mallHotWord:remove')")
@Log(title = "热词", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallHotWordService.deleteMallHotWordByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallImg;
import com.ruoyi.mall.service.IMallImgService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 图片Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallImg")
public class MallImgController extends BaseController
{
@Autowired
private IMallImgService mallImgService;
/**
* 查询图片列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallImg:list')")
@GetMapping("/list")
public TableDataInfo list(MallImg mallImg)
{
startPage();
List<MallImg> list = mallImgService.selectMallImgList(mallImg);
return getDataTable(list);
}
/**
* 导出图片列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallImg:export')")
@Log(title = "图片", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallImg mallImg)
{
List<MallImg> list = mallImgService.selectMallImgList(mallImg);
ExcelUtil<MallImg> util = new ExcelUtil<MallImg>(MallImg.class);
return util.exportExcel(list, "图片数据");
}
/**
* 获取图片详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallImg:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallImgService.selectMallImgById(id));
}
/**
* 新增图片
*/
@PreAuthorize("@ss.hasPermi('mall:mallImg:add')")
@Log(title = "图片", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallImg mallImg)
{
return toAjax(mallImgService.insertMallImg(mallImg));
}
/**
* 修改图片
*/
@PreAuthorize("@ss.hasPermi('mall:mallImg:edit')")
@Log(title = "图片", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallImg mallImg)
{
return toAjax(mallImgService.updateMallImg(mallImg));
}
/**
* 删除图片
*/
@PreAuthorize("@ss.hasPermi('mall:mallImg:remove')")
@Log(title = "图片", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallImgService.deleteMallImgByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallMemberAddress;
import com.ruoyi.mall.service.IMallMemberAddressService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 收货地址Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallMemberAddress")
public class MallMemberAddressController extends BaseController
{
@Autowired
private IMallMemberAddressService mallMemberAddressService;
/**
* 查询收货地址列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberAddress:list')")
@GetMapping("/list")
public TableDataInfo list(MallMemberAddress mallMemberAddress)
{
startPage();
List<MallMemberAddress> list = mallMemberAddressService.selectMallMemberAddressList(mallMemberAddress);
return getDataTable(list);
}
/**
* 导出收货地址列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberAddress:export')")
@Log(title = "收货地址", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallMemberAddress mallMemberAddress)
{
List<MallMemberAddress> list = mallMemberAddressService.selectMallMemberAddressList(mallMemberAddress);
ExcelUtil<MallMemberAddress> util = new ExcelUtil<MallMemberAddress>(MallMemberAddress.class);
return util.exportExcel(list, "收货地址数据");
}
/**
* 获取收货地址详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberAddress:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallMemberAddressService.selectMallMemberAddressById(id));
}
/**
* 新增收货地址
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberAddress:add')")
@Log(title = "收货地址", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallMemberAddress mallMemberAddress)
{
return toAjax(mallMemberAddressService.insertMallMemberAddress(mallMemberAddress));
}
/**
* 修改收货地址
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberAddress:edit')")
@Log(title = "收货地址", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallMemberAddress mallMemberAddress)
{
return toAjax(mallMemberAddressService.updateMallMemberAddress(mallMemberAddress));
}
/**
* 删除收货地址
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberAddress:remove')")
@Log(title = "收货地址", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallMemberAddressService.deleteMallMemberAddressByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallMemberCart;
import com.ruoyi.mall.service.IMallMemberCartService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 购物车Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallMemberCart")
public class MallMemberCartController extends BaseController
{
@Autowired
private IMallMemberCartService mallMemberCartService;
/**
* 查询购物车列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberCart:list')")
@GetMapping("/list")
public TableDataInfo list(MallMemberCart mallMemberCart)
{
startPage();
List<MallMemberCart> list = mallMemberCartService.selectMallMemberCartList(mallMemberCart);
return getDataTable(list);
}
/**
* 导出购物车列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberCart:export')")
@Log(title = "购物车", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallMemberCart mallMemberCart)
{
List<MallMemberCart> list = mallMemberCartService.selectMallMemberCartList(mallMemberCart);
ExcelUtil<MallMemberCart> util = new ExcelUtil<MallMemberCart>(MallMemberCart.class);
return util.exportExcel(list, "购物车数据");
}
/**
* 获取购物车详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberCart:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallMemberCartService.selectMallMemberCartById(id));
}
/**
* 新增购物车
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberCart:add')")
@Log(title = "购物车", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallMemberCart mallMemberCart)
{
return toAjax(mallMemberCartService.insertMallMemberCart(mallMemberCart));
}
/**
* 修改购物车
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberCart:edit')")
@Log(title = "购物车", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallMemberCart mallMemberCart)
{
return toAjax(mallMemberCartService.updateMallMemberCart(mallMemberCart));
}
/**
* 删除购物车
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberCart:remove')")
@Log(title = "购物车", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallMemberCartService.deleteMallMemberCartByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallMemberMoneyRecord;
import com.ruoyi.mall.service.IMallMemberMoneyRecordService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 会员金额记录Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallMemberMoneyRecord")
public class MallMemberMoneyRecordController extends BaseController
{
@Autowired
private IMallMemberMoneyRecordService mallMemberMoneyRecordService;
/**
* 查询会员金额记录列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberMoneyRecord:list')")
@GetMapping("/list")
public TableDataInfo list(MallMemberMoneyRecord mallMemberMoneyRecord)
{
startPage();
List<MallMemberMoneyRecord> list = mallMemberMoneyRecordService.selectMallMemberMoneyRecordList(mallMemberMoneyRecord);
return getDataTable(list);
}
/**
* 导出会员金额记录列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberMoneyRecord:export')")
@Log(title = "会员金额记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallMemberMoneyRecord mallMemberMoneyRecord)
{
List<MallMemberMoneyRecord> list = mallMemberMoneyRecordService.selectMallMemberMoneyRecordList(mallMemberMoneyRecord);
ExcelUtil<MallMemberMoneyRecord> util = new ExcelUtil<MallMemberMoneyRecord>(MallMemberMoneyRecord.class);
return util.exportExcel(list, "会员金额记录数据");
}
/**
* 获取会员金额记录详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberMoneyRecord:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallMemberMoneyRecordService.selectMallMemberMoneyRecordById(id));
}
/**
* 新增会员金额记录
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberMoneyRecord:add')")
@Log(title = "会员金额记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallMemberMoneyRecord mallMemberMoneyRecord)
{
return toAjax(mallMemberMoneyRecordService.insertMallMemberMoneyRecord(mallMemberMoneyRecord));
}
/**
* 修改会员金额记录
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberMoneyRecord:edit')")
@Log(title = "会员金额记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallMemberMoneyRecord mallMemberMoneyRecord)
{
return toAjax(mallMemberMoneyRecordService.updateMallMemberMoneyRecord(mallMemberMoneyRecord));
}
/**
* 删除会员金额记录
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberMoneyRecord:remove')")
@Log(title = "会员金额记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallMemberMoneyRecordService.deleteMallMemberMoneyRecordByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallMemberSearchHistory;
import com.ruoyi.mall.service.IMallMemberSearchHistoryService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* mallController
*
* @author ruoyi
* @date 2021-12-23
*/
@RestController
@RequestMapping("/mall/history")
public class MallMemberSearchHistoryController extends BaseController
{
@Autowired
private IMallMemberSearchHistoryService mallMemberSearchHistoryService;
/**
* 查询mall列表
*/
@PreAuthorize("@ss.hasPermi('mall:history:list')")
@GetMapping("/list")
public TableDataInfo list(MallMemberSearchHistory mallMemberSearchHistory)
{
startPage();
List<MallMemberSearchHistory> list = mallMemberSearchHistoryService.selectMallMemberSearchHistoryList(mallMemberSearchHistory);
return getDataTable(list);
}
/**
* 导出mall列表
*/
@PreAuthorize("@ss.hasPermi('mall:history:export')")
@Log(title = "mall", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallMemberSearchHistory mallMemberSearchHistory)
{
List<MallMemberSearchHistory> list = mallMemberSearchHistoryService.selectMallMemberSearchHistoryList(mallMemberSearchHistory);
ExcelUtil<MallMemberSearchHistory> util = new ExcelUtil<MallMemberSearchHistory>(MallMemberSearchHistory.class);
return util.exportExcel(list, "mall数据");
}
/**
* 获取mall详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:history:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallMemberSearchHistoryService.selectMallMemberSearchHistoryById(id));
}
/**
* 新增mall
*/
@PreAuthorize("@ss.hasPermi('mall:history:add')")
@Log(title = "mall", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallMemberSearchHistory mallMemberSearchHistory)
{
return toAjax(mallMemberSearchHistoryService.insertMallMemberSearchHistory(mallMemberSearchHistory));
}
/**
* 修改mall
*/
@PreAuthorize("@ss.hasPermi('mall:history:edit')")
@Log(title = "mall", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallMemberSearchHistory mallMemberSearchHistory)
{
return toAjax(mallMemberSearchHistoryService.updateMallMemberSearchHistory(mallMemberSearchHistory));
}
/**
* 删除mall
*/
@PreAuthorize("@ss.hasPermi('mall:history:remove')")
@Log(title = "mall", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallMemberSearchHistoryService.deleteMallMemberSearchHistoryByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallMemberUser;
import com.ruoyi.mall.service.IMallMemberUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 会员Controller
*
* @author ruoyi
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallMemberUser")
public class MallMemberUserController extends BaseController
{
@Autowired
private IMallMemberUserService mallMemberUserService;
/**
* 查询会员列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberUser:list')")
@GetMapping("/list")
public TableDataInfo list(MallMemberUser mallMemberUser)
{
startPage();
List<MallMemberUser> list = mallMemberUserService.selectMallMemberUserList(mallMemberUser);
return getDataTable(list);
}
/**
* 导出会员列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberUser:export')")
@Log(title = "会员", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallMemberUser mallMemberUser)
{
List<MallMemberUser> list = mallMemberUserService.selectMallMemberUserList(mallMemberUser);
ExcelUtil<MallMemberUser> util = new ExcelUtil<MallMemberUser>(MallMemberUser.class);
return util.exportExcel(list, "会员数据");
}
/**
* 获取会员详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberUser:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallMemberUserService.selectMallMemberUserById(id));
}
/**
* 新增会员
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberUser:add')")
@Log(title = "会员", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallMemberUser mallMemberUser)
{
return toAjax(mallMemberUserService.insertMallMemberUser(mallMemberUser));
}
/**
* 修改会员
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberUser:edit')")
@Log(title = "会员", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallMemberUser mallMemberUser)
{
return toAjax(mallMemberUserService.updateMallMemberUser(mallMemberUser));
}
/**
* 删除会员
*/
@PreAuthorize("@ss.hasPermi('mall:mallMemberUser:remove')")
@Log(title = "会员", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallMemberUserService.deleteMallMemberUserByIds(ids));
}
}
package com.ruoyi.mall.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ApiResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.mall.domain.MallOrderBack;
import com.ruoyi.mall.domain.MallOrderOrder;
import com.ruoyi.mall.service.IMallOrderBackService;
import com.ruoyi.mall.service.IMallOrderOrderService;
import com.ruoyi.web.controller.utils.XiaochengxuPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
/**
* 退款单Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallOrderBack")
public class MallOrderBackController extends BaseController
{
@Autowired
private IMallOrderBackService mallOrderBackService;
@Autowired
private IMallOrderOrderService orderOrderService;
/**
* 查询退款单列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderBack:list')")
@GetMapping("/list")
public TableDataInfo list(MallOrderBack mallOrderBack)
{
startPage();
List<MallOrderBack> list = mallOrderBackService.selectMallOrderBackList(mallOrderBack);
return getDataTable(list);
}
/**
* 导出退款单列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderBack:export')")
@Log(title = "退款单", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallOrderBack mallOrderBack)
{
List<MallOrderBack> list = mallOrderBackService.selectMallOrderBackList(mallOrderBack);
ExcelUtil<MallOrderBack> util = new ExcelUtil<MallOrderBack>(MallOrderBack.class);
return util.exportExcel(list, "退款单数据");
}
/**
* 获取退款单详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderBack:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallOrderBackService.selectMallOrderBackById(id));
}
/**
* 新增退款单
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderBack:add')")
@Log(title = "退款单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallOrderBack mallOrderBack)
{
return toAjax(mallOrderBackService.insertMallOrderBack(mallOrderBack));
}
/**
* 修改退款单
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderBack:edit')")
@Log(title = "退款单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallOrderBack mallOrderBack)
{
if ("1".equals(mallOrderBack.getStatus())){
return refundAgree(mallOrderBack);
}
if ("3".equals(mallOrderBack.getStatus())){
mallOrderBackService.updateMallOrderBack(mallOrderBack);
return AjaxResult.success("操作完成");
}
return AjaxResult.error("错误操作,只能同意或拒绝!");
}
public AjaxResult refundAgree(MallOrderBack mallOrderBack) {
MallOrderBack orderBack = mallOrderBackService.selectMallOrderBackById(mallOrderBack.getId());
if (orderBack == null) {
return AjaxResult.error("退款信息异常");
}
if (!"0".equals(orderBack.getStatus())) {
return AjaxResult.error("只有待审核状态才能退款");
}
MallOrderOrder orderOrder = orderOrderService.selectMallOrderOrderById(orderBack.getOrderId());
if (orderOrder == null) {
return AjaxResult.error("订单信息异常");
}
SortedMap<String, String> data = new TreeMap<>();
//退款到用户微信
String nonce_str = Md5Utils.getRandomStringByLength(32);
data.put("nonce_str", nonce_str);
data.put("out_trade_no", orderOrder.getOrderNo());//商户订单号
data.put("out_refund_no", orderOrder.getId().toString());//商户退款单号,一笔退款失败后重新提交,请不要更换退款单号,请使用原商户退款单号
int total_fee = Math.round(Float.valueOf(orderOrder.getPayment().multiply(new BigDecimal(100)).toString()));
data.put("total_fee", String.valueOf(Math.round(total_fee)));//支付金额,微信支付提交的金额是不能带小数点的,且是以分为单位,这边需要转成字符串类型,否则后面的签名会失败
data.put("refund_fee", String.valueOf(Math.round(total_fee)));//退款总金额,单位为分,只能为整数
String str = XiaochengxuPayService.wxXcxRefund(data);
if (str.length() > 0) {
return AjaxResult.error(str);
}
mallOrderBackService.updateMallOrderBack(mallOrderBack);
return AjaxResult.success("退款成功");
}
/**
* 删除退款单
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderBack:remove')")
@Log(title = "退款单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallOrderBackService.deleteMallOrderBackByIds(ids));
}
@PostMapping("/handleRefund")
public ApiResult handleRefund(@RequestBody Map<String, Object> params)
{
if (!params.containsKey("refundId")||StringUtils.isEmpty(params.get("refundId").toString())){
return ApiResult.error("缺少参数");
}
Boolean isAccept = orderOrderService.refundStatusRoute(Integer.parseInt("1"),params.get("refundId").toString());
if (isAccept == true) {
int status = mallOrderBackService.handleRefund(params);
return status > 0 ? ApiResult.ok("操作成功") : ApiResult.error("操作失败");
}else {
return ApiResult.error("订单异常");
}
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import java.util.Map;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallOrderComment;
import com.ruoyi.mall.service.IMallOrderCommentService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商品评论Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallOrderComment")
public class MallOrderCommentController extends BaseController
{
@Autowired
private IMallOrderCommentService mallOrderCommentService;
/**
* 查询商品评论列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderComment:list')")
@GetMapping("/list")
public TableDataInfo list(MallOrderComment mallOrderComment)
{
startPage();
List<Map<String, Object>> list = mallOrderCommentService.selectMallOrderCommentList(mallOrderComment);
return getDataTable(list);
}
/**
* 导出商品评论列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderComment:export')")
@Log(title = "商品评论", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallOrderComment mallOrderComment)
{
List<Map<String, Object>> list = mallOrderCommentService.selectMallOrderCommentList(mallOrderComment);
ExcelUtil<MallOrderComment> util = new ExcelUtil<MallOrderComment>(MallOrderComment.class);
return util.exportExcel(null, "商品评论数据");
}
/**
* 获取商品评论详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderComment:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallOrderCommentService.selectMallOrderCommentById(id));
}
/**
* 新增商品评论
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderComment:add')")
@Log(title = "商品评论", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallOrderComment mallOrderComment)
{
return toAjax(mallOrderCommentService.insertMallOrderComment(mallOrderComment));
}
/**
* 修改商品评论
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderComment:edit')")
@Log(title = "商品评论", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallOrderComment mallOrderComment)
{
return toAjax(mallOrderCommentService.updateMallOrderComment(mallOrderComment));
}
/**
* 删除商品评论
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderComment:remove')")
@Log(title = "商品评论", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallOrderCommentService.deleteMallOrderCommentByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallOrderGoods;
import com.ruoyi.mall.service.IMallOrderGoodsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 订单商品Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallOrderGoods")
public class MallOrderGoodsController extends BaseController
{
@Autowired
private IMallOrderGoodsService mallOrderGoodsService;
/**
* 查询订单商品列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderGoods:list')")
@GetMapping("/list")
public TableDataInfo list(MallOrderGoods mallOrderGoods)
{
startPage();
List<MallOrderGoods> list = mallOrderGoodsService.selectMallOrderGoodsList(mallOrderGoods);
return getDataTable(list);
}
/**
* 导出订单商品列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderGoods:export')")
@Log(title = "订单商品", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallOrderGoods mallOrderGoods)
{
List<MallOrderGoods> list = mallOrderGoodsService.selectMallOrderGoodsList(mallOrderGoods);
ExcelUtil<MallOrderGoods> util = new ExcelUtil<MallOrderGoods>(MallOrderGoods.class);
return util.exportExcel(list, "订单商品数据");
}
/**
* 获取订单商品详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderGoods:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallOrderGoodsService.selectMallOrderGoodsById(id));
}
/**
* 新增订单商品
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderGoods:add')")
@Log(title = "订单商品", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallOrderGoods mallOrderGoods)
{
return toAjax(mallOrderGoodsService.insertMallOrderGoods(mallOrderGoods));
}
/**
* 修改订单商品
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderGoods:edit')")
@Log(title = "订单商品", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallOrderGoods mallOrderGoods)
{
return toAjax(mallOrderGoodsService.updateMallOrderGoods(mallOrderGoods));
}
/**
* 删除订单商品
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderGoods:remove')")
@Log(title = "订单商品", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallOrderGoodsService.deleteMallOrderGoodsByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.math.BigDecimal;
import java.util.*;
import com.ruoyi.common.utils.ApiResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.mall.domain.MallOrderBack;
import com.ruoyi.mall.service.IMallOrderBackService;
import com.ruoyi.web.controller.utils.XiaochengxuPayService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallOrderOrder;
import com.ruoyi.mall.service.IMallOrderOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 订单Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallOrderOrder")
public class MallOrderOrderController extends BaseController
{
@Autowired
private IMallOrderOrderService mallOrderOrderService;
@Autowired
private IMallOrderBackService orderBackService;
/**
* 查询订单列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderOrder:list')")
@GetMapping("/list")
public TableDataInfo list(MallOrderOrder mallOrderOrder)
{
startPage();
List<MallOrderOrder> list = mallOrderOrderService.selectMallOrderOrderList(mallOrderOrder);
return getDataTable(list);
}
/**
* 导出订单列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderOrder:export')")
@Log(title = "订单", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallOrderOrder mallOrderOrder)
{
List<MallOrderOrder> list = mallOrderOrderService.selectMallOrderOrderList(mallOrderOrder);
ExcelUtil<MallOrderOrder> util = new ExcelUtil<MallOrderOrder>(MallOrderOrder.class);
return util.exportExcel(list, "订单数据");
}
/**
* 获取订单详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderOrder:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallOrderOrderService.selectMallOrderOrderById(id));
}
/**
* 新增订单
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderOrder:add')")
@Log(title = "订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallOrderOrder mallOrderOrder)
{
return toAjax(mallOrderOrderService.insertMallOrderOrder(mallOrderOrder));
}
/**
* 修改订单
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderOrder:edit')")
@Log(title = "订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallOrderOrder mallOrderOrder)
{
if ("6".equals(mallOrderOrder.getStatus()) || "9".equals(mallOrderOrder.getStatus())){
Map<String, Object> map = new HashMap<>();
List<MallOrderBack> list = orderBackService.selectMallOrderBackByOrderId(mallOrderOrder.getId());
MallOrderBack result = new MallOrderBack();
for (MallOrderBack orderBack: list) {
result = orderBack;
}
map.put("refundId",result.getId());
if ("6".equals(mallOrderOrder.getStatus())) {
//退款
map.put("isAccept", "1");
Map<String, Object> map1 = new HashMap<>();
map1.put("backId",result.getId().toString());
return refundAgree(map1);
}
if ("9".equals(mallOrderOrder.getStatus())) {
map.put("isAccept", "0");
}
Boolean isAccept = mallOrderOrderService.refundStatusRoute(Integer.parseInt("1"),map.get("refundId").toString());
if (isAccept == true) {
int status = orderBackService.handleRefund(map);
return status > 0 ? AjaxResult.success("操作成功") : AjaxResult.error("操作失败");
}else {
return AjaxResult.error("订单异常");
}
}
return toAjax(mallOrderOrderService.updateMallOrderOrder(mallOrderOrder));
}
/**
* 删除订单
*/
@PreAuthorize("@ss.hasPermi('mall:mallOrderOrder:remove')")
@Log(title = "订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallOrderOrderService.deleteMallOrderOrderByIds(ids));
}
/**
* 发货
*/
@PostMapping("/order/sendOrder")
public ApiResult sendOrder(@RequestBody Map<String, Object> params)
{
try {
if(!params.containsKey("shippingMark") || StringUtils.isEmpty(params.get("shippingMark").toString())
|| !params.containsKey("shippingName") || StringUtils.isEmpty(params.get("shippingName").toString()) ||
!params.containsKey("shippingCode") || StringUtils.isEmpty(params.get("shippingCode").toString()) ||
!params.containsKey("orderId") || StringUtils.isEmpty(params.get("orderId").toString())){
return ApiResult.error("缺少参数");
}
MallOrderOrder order = mallOrderOrderService.selectMallOrderOrderById(Long.parseLong(params.get("orderId").toString()));
order.setShippingMark(params.get("shippingMark").toString());
order.setShippingName(params.get("shippingName").toString());
order.setShippingCode(params.get("shippingCode").toString());
order.setConsignAt(new Date().toString());
Boolean isAccept = mallOrderOrderService.orderStatusRoute(Integer.parseInt("2"),params.get("orderId").toString());
if (isAccept == true) {
order.setStatus("2");
int status = mallOrderOrderService.updateMallOrderOrder(order);
return status > 0 ? ApiResult.ok("成功") : ApiResult.error("失败");
}else {
return ApiResult.error("订单异常");
}
} catch (Exception e) {
e.printStackTrace();
return ApiResult.error("失败");
}
}
public AjaxResult refundAgree(Map<String, Object> map) {
MallOrderBack orderBack = orderBackService.selectMallOrderBackById(Long.parseLong(map.get("backId").toString()));
if (orderBack == null) {
return AjaxResult.error("退款信息异常");
}
if (!"0".equals(orderBack.getStatus())) {
return AjaxResult.error("只有待审核状态才能退款");
}
MallOrderOrder orderOrder = mallOrderOrderService.selectMallOrderOrderById(orderBack.getOrderId());
if (orderOrder == null) {
return AjaxResult.error("订单信息异常");
}
try{
// orderBack.setStatus("1");
// orderBack.setUpdateAt(DateUtils.getTime());
// orderOrder.setStatus("6");
// SortedMap<String, String> data = new TreeMap<>();
// //退款到用户微信
// String nonce_str = Md5Utils.getRandomStringByLength(32);
// data.put("nonce_str", nonce_str);
// data.put("out_trade_no", orderOrder.getOrderNo());//商户订单号
// data.put("out_refund_no", orderOrder.getId().toString());//商户退款单号,一笔退款失败后重新提交,请不要更换退款单号,请使用原商户退款单号
// int total_fee = Math.round(Float.valueOf(orderOrder.getPayment().multiply(new BigDecimal(100)).toString()));
// data.put("total_fee", String.valueOf(Math.round(total_fee)));//支付金额,微信支付提交的金额是不能带小数点的,且是以分为单位,这边需要转成字符串类型,否则后面的签名会失败
// data.put("refund_fee", String.valueOf(Math.round(total_fee)));//退款总金额,单位为分,只能为整数
// boolean fl = XiaochengxuPayService.wxXcxRefund(data);
// if (!fl) {
// return AjaxResult.error("微信app退款异常");
// }
//
// mallOrderOrderService.updateRefundRestlt(orderBack,orderOrder);
return AjaxResult.success("退款成功");
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
}
}
package com.ruoyi.mall.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mall.domain.MallOrderPost;
import com.ruoyi.mall.service.IMallOrderPostService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 邮费设置
*/
@RestController
@RequestMapping("/mall/MallOrderPost")
public class MallOrderPostController extends BaseController {
@Resource
private IMallOrderPostService mallOrderPostService;
/**
* 查询邮费设置
* @return
*/
@GetMapping
public AjaxResult selectMallOrderPostById(){
return AjaxResult.success(mallOrderPostService.selectMallOrderPostById());
}
/**
* 修改邮费设置
*/
@PutMapping
public AjaxResult editMallOrderPost(@RequestBody MallOrderPost mallOrderPost)
{
return toAjax(mallOrderPostService.updateMallOrderPost(mallOrderPost));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallPayLog;
import com.ruoyi.mall.service.IMallPayLogService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 支付记录Controller
*
* @author ruoyi
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallPayLog")
public class MallPayLogController extends BaseController
{
@Autowired
private IMallPayLogService mallPayLogService;
/**
* 查询支付记录列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallPayLog:list')")
@GetMapping("/list")
public TableDataInfo list(MallPayLog mallPayLog)
{
startPage();
List<MallPayLog> list = mallPayLogService.selectMallPayLogList(mallPayLog);
return getDataTable(list);
}
/**
* 导出支付记录列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallPayLog:export')")
@Log(title = "支付记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallPayLog mallPayLog)
{
List<MallPayLog> list = mallPayLogService.selectMallPayLogList(mallPayLog);
ExcelUtil<MallPayLog> util = new ExcelUtil<MallPayLog>(MallPayLog.class);
return util.exportExcel(list, "支付记录数据");
}
/**
* 获取支付记录详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallPayLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return AjaxResult.success(mallPayLogService.selectMallPayLogById(id));
}
/**
* 新增支付记录
*/
@PreAuthorize("@ss.hasPermi('mall:mallPayLog:add')")
@Log(title = "支付记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallPayLog mallPayLog)
{
return toAjax(mallPayLogService.insertMallPayLog(mallPayLog));
}
/**
* 修改支付记录
*/
@PreAuthorize("@ss.hasPermi('mall:mallPayLog:edit')")
@Log(title = "支付记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallPayLog mallPayLog)
{
return toAjax(mallPayLogService.updateMallPayLog(mallPayLog));
}
/**
* 删除支付记录
*/
@PreAuthorize("@ss.hasPermi('mall:mallPayLog:remove')")
@Log(title = "支付记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(mallPayLogService.deleteMallPayLogByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallShopConfig;
import com.ruoyi.mall.service.IMallShopConfigService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 配置信息设置Controller
*
* @author ruoyi
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallShopConfig")
public class MallShopConfigController extends BaseController
{
@Autowired
private IMallShopConfigService mallShopConfigService;
/**
* 查询配置信息设置列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopConfig:list')")
@GetMapping("/list")
public TableDataInfo list(MallShopConfig mallShopConfig)
{
startPage();
List<MallShopConfig> list = mallShopConfigService.selectMallShopConfigList(mallShopConfig);
return getDataTable(list);
}
/**
* 导出配置信息设置列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopConfig:export')")
@Log(title = "配置信息设置", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallShopConfig mallShopConfig)
{
List<MallShopConfig> list = mallShopConfigService.selectMallShopConfigList(mallShopConfig);
ExcelUtil<MallShopConfig> util = new ExcelUtil<MallShopConfig>(MallShopConfig.class);
return util.exportExcel(list, "配置信息设置数据");
}
/**
* 获取配置信息设置详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopConfig:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallShopConfigService.selectMallShopConfigById(id));
}
/**
* 新增配置信息设置
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopConfig:add')")
@Log(title = "配置信息设置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallShopConfig mallShopConfig)
{
return toAjax(mallShopConfigService.insertMallShopConfig(mallShopConfig));
}
/**
* 修改配置信息设置
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopConfig:edit')")
@Log(title = "配置信息设置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallShopConfig mallShopConfig)
{
return toAjax(mallShopConfigService.updateMallShopConfig(mallShopConfig));
}
/**
* 删除配置信息设置
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopConfig:remove')")
@Log(title = "配置信息设置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallShopConfigService.deleteMallShopConfigByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallShopExpressCode;
import com.ruoyi.mall.service.IMallShopExpressCodeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 快递编码Controller
*
* @author chang
* @date 2021-11-25
*/
@RestController
@RequestMapping("/mall/mallShopExpressCode")
public class MallShopExpressCodeController extends BaseController
{
@Autowired
private IMallShopExpressCodeService mallShopExpressCodeService;
/**
* 查询快递编码列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopExpressCode:list')")
@GetMapping("/list")
public TableDataInfo list(MallShopExpressCode mallShopExpressCode)
{
startPage();
List<MallShopExpressCode> list = mallShopExpressCodeService.selectMallShopExpressCodeList(mallShopExpressCode);
return getDataTable(list);
}
/**
* 导出快递编码列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopExpressCode:export')")
@Log(title = "快递编码", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallShopExpressCode mallShopExpressCode)
{
List<MallShopExpressCode> list = mallShopExpressCodeService.selectMallShopExpressCodeList(mallShopExpressCode);
ExcelUtil<MallShopExpressCode> util = new ExcelUtil<MallShopExpressCode>(MallShopExpressCode.class);
return util.exportExcel(list, "快递编码数据");
}
/**
* 获取快递编码详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopExpressCode:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallShopExpressCodeService.selectMallShopExpressCodeById(id));
}
/**
* 新增快递编码
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopExpressCode:add')")
@Log(title = "快递编码", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallShopExpressCode mallShopExpressCode)
{
return toAjax(mallShopExpressCodeService.insertMallShopExpressCode(mallShopExpressCode));
}
/**
* 修改快递编码
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopExpressCode:edit')")
@Log(title = "快递编码", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallShopExpressCode mallShopExpressCode)
{
return toAjax(mallShopExpressCodeService.updateMallShopExpressCode(mallShopExpressCode));
}
/**
* 删除快递编码
*/
@PreAuthorize("@ss.hasPermi('mall:mallShopExpressCode:remove')")
@Log(title = "快递编码", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallShopExpressCodeService.deleteMallShopExpressCodeByIds(ids));
}
}
package com.ruoyi.mall.controller;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mall.domain.MallTarget;
import com.ruoyi.mall.service.IMallTargetService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 营销目标Controller
*
* @author ruoyi
* @date 2022-01-17
*/
@RestController
@RequestMapping("/mall/mallTarget")
public class MallTargetController extends BaseController
{
@Autowired
private IMallTargetService mallTargetService;
/**
* 查询营销目标列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallTarget:list')")
@GetMapping("/list")
public TableDataInfo list(MallTarget mallTarget)
{
startPage();
List<MallTarget> list = mallTargetService.selectMallTargetList(mallTarget);
return getDataTable(list);
}
/**
* 导出营销目标列表
*/
@PreAuthorize("@ss.hasPermi('mall:mallTarget:export')")
@Log(title = "营销目标", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(MallTarget mallTarget)
{
List<MallTarget> list = mallTargetService.selectMallTargetList(mallTarget);
ExcelUtil<MallTarget> util = new ExcelUtil<MallTarget>(MallTarget.class);
return util.exportExcel(list, "营销目标数据");
}
/**
* 获取营销目标详细信息
*/
@PreAuthorize("@ss.hasPermi('mall:mallTarget:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Integer id)
{
return AjaxResult.success(mallTargetService.selectMallTargetById(id));
}
/**
* 新增营销目标
*/
@PreAuthorize("@ss.hasPermi('mall:mallTarget:add')")
@Log(title = "营销目标", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallTarget mallTarget)
{
mallTarget.setUpdateAt(DateUtils.getTime());
return toAjax(mallTargetService.insertMallTarget(mallTarget));
}
/**
* 修改营销目标
*/
@PreAuthorize("@ss.hasPermi('mall:mallTarget:edit')")
@Log(title = "营销目标", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallTarget mallTarget)
{
mallTarget.setUpdateAt(DateUtils.getTime());
return toAjax(mallTargetService.updateMallTarget(mallTarget));
}
/**
* 删除营销目标
*/
@PreAuthorize("@ss.hasPermi('mall:mallTarget:remove')")
@Log(title = "营销目标", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Integer[] ids)
{
return toAjax(mallTargetService.deleteMallTargetByIds(ids));
}
}
package com.ruoyi.web.controller.monitor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.domain.Server;
/**
* 服务器监控
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/server")
public class ServerController
{
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Server server = new Server();
server.copyTo();
return AjaxResult.success(server);
}
}
restart.include.json=/com.alibaba.fastjson.*.jar
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Application Version: ${ruoyi.version}
Spring Boot Version: ${spring-boot.version}
////////////////////////////////////////////////////////////////////
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
////////////////////////////////////////////////////////////////////
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment