From 533d26dae76cb5e54e84d6105f7aee42dcb9f76b Mon Sep 17 00:00:00 2001
From: CBin <497303054@qq.com>
Date: 星期三, 02 八月 2023 21:15:25 +0800
Subject: [PATCH] 接入微信支付
---
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java | 125 +++++++++++++++++++++++++++++++++++++----
1 files changed, 112 insertions(+), 13 deletions(-)
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java
index f289552..38d650c 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtConfigController.java
@@ -4,8 +4,11 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.dto.MgtBaseGetDto;
+import com.ruoyi.system.api.domain.dto.MgtClassNumDto;
import com.ruoyi.system.api.domain.dto.MgtPageDto;
import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo;
import com.ruoyi.system.domain.dto.*;
@@ -13,6 +16,7 @@
import com.ruoyi.system.service.config.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -30,7 +34,7 @@
* @Date 2023/6/6 9:14
* @Version 1.0
*/
-@Api(value = "平台端配置相关接口", tags = "平台端配置相关接口", description = "平台端配置相关接口")
+@Api(value = "管理后台配置相关接口", tags = "管理后台配置相关接口", description = "管理后台配置相关接口")
@RestController
@RequestMapping("/mgt/config")
public class MgtConfigController {
@@ -77,14 +81,30 @@
@RequestMapping(value = "/getCustomConfig", method = RequestMethod.POST)
@ApiOperation(value = "获取单个配置")
- public R<MgtCustomConfigVo> getCustomConfig(@RequestBody MgtCustomConfigDto mgtCustomConfigDto) {
+ public R<List<String>> getCustomConfig(@RequestBody MgtCustomConfigDto mgtCustomConfigDto) {
Long userId = SecurityUtils.getUserId();
mgtCustomConfigDto.setUserId(userId);
- MgtCustomConfigVo mgtCustomConfigVo = customConfigService.getCustomConfig(mgtCustomConfigDto);
+ List<String> mgtCustomConfigVo = customConfigService.getCustomConfig(mgtCustomConfigDto);
return R.ok(mgtCustomConfigVo);
}
+ @RequestMapping(value = "/getActivenessList", method = RequestMethod.POST)
+ @ApiOperation(value = "获取活跃度")
+ public R<List<MgtActivenessListVo>> getActivenessList() {
+ List<MgtActivenessListVo> activenessList = activenessService.getActivenessList();
+ return R.ok(activenessList);
+ }
+
+ @RequestMapping(value = "/getCooperation", method = RequestMethod.POST)
+ @ApiOperation(value = "获取申请合作")
+ public R<MgtCooperationGetVo> getCooperation() {
+ Long userId = SecurityUtils.getUserId();
+ MgtCooperationGetVo cooperationGetVo = cooperationService.getCooperation();
+ return R.ok(cooperationGetVo);
+ }
+
@RequestMapping(value = "/editCooperation", method = RequestMethod.POST)
+ @Log(title = "申请合作管理", businessType = BusinessType.UPDATE,operContent = "修改申请合作")
@ApiOperation(value = "修改申请合作")
public R editCooperation(@RequestBody MgtCooperationEditDto mgtCooperationEditDto) {
Long userId = SecurityUtils.getUserId();
@@ -94,6 +114,7 @@
}
@RequestMapping(value = "/editServiceMobile", method = RequestMethod.POST)
+ @Log(title = "客服电话管理", businessType = BusinessType.UPDATE,operContent = "修改客服电话")
@ApiOperation(value = "修改客服电话")
public R editServiceMobile(@RequestBody MgtServiceMobileEditDto mgtServiceMobileEditDto) {
Long userId = SecurityUtils.getUserId();
@@ -102,7 +123,18 @@
return R.ok();
}
+ @RequestMapping(value = "/editServiceCode", method = RequestMethod.POST)
+ @Log(title = "客服二维码管理", businessType = BusinessType.UPDATE,operContent = "修改客服二维码")
+ @ApiOperation(value = "修改客服二维码")
+ public R editServiceCode(@RequestBody MgtServiceCodeEditDto mgtServiceCodeEditDto) {
+ Long userId = SecurityUtils.getUserId();
+ mgtServiceCodeEditDto.setUserId(userId);
+ customConfigService.editServiceCode(mgtServiceCodeEditDto);
+ return R.ok();
+ }
+
@RequestMapping(value = "/editAgreement", method = RequestMethod.POST)
+ @Log(title = "协议管理", businessType = BusinessType.UPDATE,operContent = "修改协议")
@ApiOperation(value = "修改协议")
public R editAgreement(@RequestBody MgtAgreementEditDto mgtAgreementEditDto) {
Long userId = SecurityUtils.getUserId();
@@ -112,6 +144,7 @@
}
@RequestMapping(value = "/editBanner", method = RequestMethod.POST)
+ @Log(title = "banner管理", businessType = BusinessType.UPDATE,operContent = "修改banner")
@ApiOperation(value = "修改banner")
public R editBanner(@RequestBody MgtBannerEditDto mgtBannerEditDto) {
Long userId = SecurityUtils.getUserId();
@@ -142,6 +175,7 @@
}
@RequestMapping(value = "/deleteBanner", method = RequestMethod.POST)
+ @Log(title = "banner管理", businessType = BusinessType.DELETE,operContent = "删除banner")
@ApiOperation(value = "删除banner")
public R deleteBanner(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
Long userId = SecurityUtils.getUserId();
@@ -163,6 +197,7 @@
}
@RequestMapping(value = "/editPop", method = RequestMethod.POST)
+ @Log(title = "弹窗管理", businessType = BusinessType.UPDATE,operContent = "修改弹窗广告")
@ApiOperation(value = "修改弹窗广告")
public R editPop(@RequestBody MgtPopEditDto mgtPopEditDto) {
Long userId = SecurityUtils.getUserId();
@@ -181,6 +216,7 @@
}
@RequestMapping(value = "/deletePop", method = RequestMethod.POST)
+ @Log(title = "弹窗管理", businessType = BusinessType.DELETE,operContent = "删除弹窗广告")
@ApiOperation(value = "删除弹窗广告")
public R deletePop(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
Long userId = SecurityUtils.getUserId();
@@ -202,6 +238,7 @@
}
@RequestMapping(value = "/editQuickEntry", method = RequestMethod.POST)
+ @Log(title = "快速入口管理", businessType = BusinessType.UPDATE,operContent = "修改快速入口")
@ApiOperation(value = "修改快速入口")
public R editQuickEntry(@RequestBody MgtQuickEntryEditDto mgtQuickEntryEditDto) {
Long userId = SecurityUtils.getUserId();
@@ -220,6 +257,7 @@
}
@RequestMapping(value = "/deleteQuickEntry", method = RequestMethod.POST)
+ @Log(title = "快速入口管理", businessType = BusinessType.DELETE,operContent = "删除快速入口")
@ApiOperation(value = "删除快速入口")
public R deleteQuickEntry(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
Long userId = SecurityUtils.getUserId();
@@ -236,35 +274,40 @@
}
@RequestMapping(value = "/editOtherConfig", method = RequestMethod.POST)
+ @Log(title = "其它设置管理", businessType = BusinessType.UPDATE,operContent = "修改其它设置")
@ApiOperation(value = "修改其它设置")
- public R editOtherConfig(@RequestBody MgtOtherConfigEditDto mgtOtherConfigEditDto) {
+ public R editOtherConfig(@Validated @RequestBody MgtOtherConfigEditDto mgtOtherConfigEditDto) {
customConfigService.editOtherConfig(mgtOtherConfigEditDto);
return R.ok();
}
@RequestMapping(value = "/editShopConfig", method = RequestMethod.POST)
+ @Log(title = "其它设置管理", businessType = BusinessType.UPDATE,operContent = "修改合作商配置")
@ApiOperation(value = "修改合作商配置")
- public R editShopConfig(@RequestBody MgtShopConfigEditDto mgtShopConfigEditDto) {
+ public R editShopConfig(@Validated @RequestBody MgtShopConfigEditDto mgtShopConfigEditDto) {
customConfigService.editShopConfig(mgtShopConfigEditDto);
return R.ok();
}
@RequestMapping(value = "/editMemberConfig", method = RequestMethod.POST)
- @ApiOperation(value = "修改合作商配置")
- public R editMemberConfig(@RequestBody MgtMemberConfigEditDto mgtMemberConfigEditDto) {
+ @Log(title = "其它设置管理", businessType = BusinessType.UPDATE,operContent = "修改会员配置")
+ @ApiOperation(value = "修改会员配置")
+ public R editMemberConfig(@Validated @RequestBody MgtMemberConfigEditDto mgtMemberConfigEditDto) {
customConfigService.editMemberConfig(mgtMemberConfigEditDto);
return R.ok();
}
@RequestMapping(value = "/editAdvert", method = RequestMethod.POST)
+ @Log(title = "其它设置管理", businessType = BusinessType.UPDATE,operContent = "修改广告配置")
@ApiOperation(value = "修改广告配置")
- public R editAdvert(@RequestBody MgtAdvertEditDto mgtAdvertEditDto) {
+ public R editAdvert(@Validated @RequestBody MgtAdvertEditDto mgtAdvertEditDto) {
mgtAdvertEditDto.setUserId(SecurityUtils.getUserId());
advertService.editMgtAdvert(mgtAdvertEditDto);
return R.ok();
}
@RequestMapping(value = "/editActiveness", method = RequestMethod.POST)
+ @Log(title = "其它设置管理", businessType = BusinessType.UPDATE,operContent = "修改活跃度")
@ApiOperation(value = "修改活跃度")
public R editActiveness(@RequestBody MgtActivenessEditDto mgtActivenessEditDto) {
mgtActivenessEditDto.setUserId(SecurityUtils.getUserId());
@@ -273,6 +316,7 @@
}
@RequestMapping(value = "/deleteActiveness", method = RequestMethod.POST)
+ @Log(title = "其它设置管理", businessType = BusinessType.DELETE,operContent = "删除活跃度")
@ApiOperation(value = "删除活跃度")
public R deleteMgtActiveness(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
mgtBaseGetDto.setUserId(SecurityUtils.getUserId());
@@ -293,6 +337,7 @@
}
@RequestMapping(value = "/editClassification", method = RequestMethod.POST)
+ @Log(title = "分类管理", businessType = BusinessType.UPDATE,operContent = "修改分类")
@ApiOperation(value = "修改分类")
public R editClassification(@RequestBody MgtClassificationEditDto mgtClassificationEditDto) {
mgtClassificationEditDto.setUserId(SecurityUtils.getUserId());
@@ -301,11 +346,19 @@
}
@RequestMapping(value = "/deleteClassification", method = RequestMethod.POST)
+ @Log(title = "分类管理", businessType = BusinessType.DELETE,operContent = "删除分类")
@ApiOperation(value = "删除分类")
public R deleteClassification(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
mgtBaseGetDto.setUserId(SecurityUtils.getUserId());
sysClassificationService.deleteClassification(Long.valueOf(mgtBaseGetDto.getId()));
return R.ok();
+ }
+
+ @RequestMapping(value = "/listOperTitle", method = RequestMethod.POST)
+ @ApiOperation(value = "获取操作类型列表")
+ public R<List<String>> pageOperLog() {
+ List<String> operTitleList = customConfigService.listOperTitle();
+ return R.ok(operTitleList);
}
@RequestMapping(value = "/pageOperLog", method = RequestMethod.POST)
@@ -320,9 +373,17 @@
return R.ok(page.setRecords(mgtOperLogPageVoList));
}
+ @RequestMapping(value = "/deleteOperlog", method = RequestMethod.POST)
+ @Log(title = "日志管理", businessType = BusinessType.DELETE,operContent = "清空日志")
+ @ApiOperation(value = "清空日志")
+ public R deleteOperlog() {
+ customConfigService.deleteOperlog();
+ return R.ok();
+ }
+
@RequestMapping(value = "/exportPageOperLog", method = RequestMethod.POST)
@ApiOperation(value = "导出操作日志")
- public void exportPageOperLog(@RequestBody MgtOperLogPageDto mgtOperLogPageDto, HttpServletResponse response) {
+ public void exportPageOperLog(MgtOperLogPageDto mgtOperLogPageDto, HttpServletResponse response) {
Long userId = SecurityUtils.getUserId();
mgtOperLogPageDto.setUserId(userId);
Page<MgtOperLogPageVo> page = new Page<>();
@@ -365,6 +426,7 @@
}
@RequestMapping(value = "/editTag", method = RequestMethod.POST)
+ @Log(title = "标签管理", businessType = BusinessType.UPDATE,operContent = "修改标签")
@ApiOperation(value = "修改标签")
public R editTag(@RequestBody MgtTagEditDto mgtTagEditDto) {
mgtTagEditDto.setUserId(SecurityUtils.getUserId());
@@ -373,6 +435,7 @@
}
@RequestMapping(value = "/deleteTag", method = RequestMethod.POST)
+ @Log(title = "标签管理", businessType = BusinessType.DELETE,operContent = "删除标签")
@ApiOperation(value = "删除标签")
public R deleteTag(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
mgtBaseGetDto.setUserId(SecurityUtils.getUserId());
@@ -392,19 +455,52 @@
return R.ok(page.setRecords(mgtArticlePageVoList));
}
+ @RequestMapping(value = "/getArticle", method = RequestMethod.POST)
+ @ApiOperation(value = "获取文章")
+ public R<MgtArticleGetVo> getArticle(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
+ mgtBaseGetDto.setUserId(SecurityUtils.getUserId());
+ MgtArticleGetVo mgtArticleGetVo = articleService.getArticle(Long.valueOf(mgtBaseGetDto.getId()));
+ return R.ok(mgtArticleGetVo);
+ }
+
@RequestMapping(value = "/editArticle", method = RequestMethod.POST)
+ @Log(title = "文章管理", businessType = BusinessType.UPDATE,operContent = "修改文章")
@ApiOperation(value = "修改文章")
public R editArticle(@RequestBody MgtArticleEditDto mgtArticleEditDto) {
mgtArticleEditDto.setUserId(SecurityUtils.getUserId());
- articleService.editMgtArticle(mgtArticleEditDto);
+ Long oldClassId = articleService.editMgtArticle(mgtArticleEditDto);
+ // 创建MgtClassNumDto对象
+ MgtClassNumDto mgtClassNumDto = new MgtClassNumDto();
+ if(mgtArticleEditDto.getArticleId()!=null){
+ // 如果类别ID不为空并且文章的类别ID不为空并且类别ID不同,则设置子类别ID和新增类别ID
+ if (mgtArticleEditDto.getClassId() != null && oldClassId != null
+ && !mgtArticleEditDto.getClassId().equals(oldClassId)) {
+ mgtClassNumDto.setSubClassId(oldClassId);
+ mgtClassNumDto.setAddClassId(mgtArticleEditDto.getClassId());
+ }
+ // 如果类别ID不为空并且文章的类别ID为空,则设置新增类别ID
+ else if (mgtArticleEditDto.getClassId() != null && oldClassId == null) {
+ mgtClassNumDto.setAddClassId(mgtArticleEditDto.getClassId());
+ }
+ }else{
+ mgtClassNumDto.setAddClassId(mgtArticleEditDto.getClassId());
+ }
+ // 更新类别数量
+ sysClassificationService.changeClassNum(mgtClassNumDto);
return R.ok();
}
@RequestMapping(value = "/deleteArticle", method = RequestMethod.POST)
+ @Log(title = "文章管理", businessType = BusinessType.DELETE,operContent = "删除文章")
@ApiOperation(value = "删除文章")
public R deleteArticle(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
mgtBaseGetDto.setUserId(SecurityUtils.getUserId());
- articleService.deleteArticle(mgtBaseGetDto);
+ Long oldClassId = articleService.deleteArticle(mgtBaseGetDto);
+ if(oldClassId!=null){
+ MgtClassNumDto mgtClassNumDto = new MgtClassNumDto();
+ mgtClassNumDto.setSubClassId(oldClassId);
+ sysClassificationService.changeClassNum(mgtClassNumDto);
+ }
return R.ok();
}
@@ -419,7 +515,7 @@
@RequestMapping(value = "/listCity", method = RequestMethod.POST)
@ApiOperation(value = "获取省市列表")
public R<List<RegionVo>> listCity(){
- List<RegionVo> regionVoList = regionService.listRegionVo();
+ List<RegionVo> regionVoList = regionService.listCityVo();
return R.ok(regionVoList);
}
@@ -436,7 +532,8 @@
}
@RequestMapping(value = "/allotRecommend", method = RequestMethod.POST)
- @ApiOperation(value = "删除文章")
+ @Log(title = "分配管理", businessType = BusinessType.UPDATE,operContent = "分配推荐")
+ @ApiOperation(value = "分配推荐")
public R allotRecommend(@RequestBody MgtAllotRecommendDto mgtAllotRecommendDto) {
mgtAllotRecommendDto.setUserId(SecurityUtils.getUserId());
recommendCooperationService.allotRecommend(mgtAllotRecommendDto);
@@ -449,4 +546,6 @@
MgtBulletinBoardVo bulletinBoard = customConfigService.getBulletinBoard();
return R.ok(bulletinBoard);
}
+
+
}
--
Gitblit v1.7.1