From 664184af3e070dee665ee736caffa0297804975f Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Tue, 18 Mar 2025 11:46:02 +0800
Subject: [PATCH] perf(mall): 移除会员利润计算中的异步执行
---
src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java | 145 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 138 insertions(+), 7 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java b/src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java
index 5baf213..33ed194 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/AdminMallGoodsCategoryController.java
@@ -5,18 +5,19 @@
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.mall.entity.MallGoodsCategory;
-import cc.mrbird.febs.mall.entity.MallMember;
+import cc.mrbird.febs.mall.entity.MallStore;
+import cc.mrbird.febs.mall.entity.MallStoreItem;
import cc.mrbird.febs.mall.service.IAdminMallGoodsCategoryService;
-import cc.mrbird.febs.system.entity.Role;
+import cc.mrbird.febs.mall.service.IApiMallGoodsCategoryService;
+import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryTreeVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
import java.util.Map;
@Slf4j
@@ -27,6 +28,88 @@
public class AdminMallGoodsCategoryController extends BaseController {
private final IAdminMallGoodsCategoryService goodsCategoryService;
+ private final IApiMallGoodsCategoryService mallGoodsCategoryService;
+
+ /**
+ * 机器列表
+ */
+ @GetMapping("storeItemList")
+ public FebsResponse storeItemList(MallStoreItem mallStoreItem, QueryRequest request) {
+ Map<String, Object> data = getDataTable(goodsCategoryService.storeItemList(mallStoreItem, request));
+ return new FebsResponse().success().data(data);
+ }
+
+ /**
+ * 机器-选择
+ */
+ @GetMapping("storeItem/tree")
+ @ControllerEndpoint(exceptionMessage = "获取分类失败")
+ public FebsResponse getStore(){
+ return new FebsResponse().success().data(goodsCategoryService.getStore());
+ }
+
+ /**
+ * 机器-新增
+ */
+ @PostMapping("addStoreItem")
+ @ControllerEndpoint(operation = "机器-新增", exceptionMessage = "操作失败")
+ public FebsResponse addStoreItem(@Valid MallStoreItem mallStoreItem) {
+ return goodsCategoryService.addStoreItem(mallStoreItem);
+ }
+
+ /**
+ * 机器-编辑
+ */
+ @PostMapping("updateStoreItem")
+ @ControllerEndpoint(operation = "机器-编辑", exceptionMessage = "操作失败")
+ public FebsResponse updateStoreItem(@Valid MallStoreItem mallStoreItem) {
+ return goodsCategoryService.updateStoreItem(mallStoreItem);
+ }
+
+ /**
+ * 机器-删除
+ */
+ @GetMapping("delStoreItem/{id}")
+ @ControllerEndpoint(operation = "机器-删除", exceptionMessage = "操作失败")
+ public FebsResponse delStoreItem(@NotNull(message = "{required}") @PathVariable Long id) {
+ return goodsCategoryService.delStoreItem(id);
+ }
+
+ /**
+ * 店铺列表
+ */
+ @GetMapping("storeList")
+ public FebsResponse storeList(MallStore mallStore, QueryRequest request) {
+ Map<String, Object> data = getDataTable(goodsCategoryService.storeList(mallStore, request));
+ return new FebsResponse().success().data(data);
+ }
+
+ /**
+ * 店铺-新增
+ */
+ @PostMapping("addStore")
+ @ControllerEndpoint(operation = "店铺-新增", exceptionMessage = "操作失败")
+ public FebsResponse addStore(@Valid MallStore mallStore) {
+ return goodsCategoryService.addStore(mallStore);
+ }
+
+ /**
+ * 店铺-编辑
+ */
+ @PostMapping("updateStore")
+ @ControllerEndpoint(operation = "店铺-编辑", exceptionMessage = "操作失败")
+ public FebsResponse updateStore(@Valid MallStore mallStore) {
+ return goodsCategoryService.updateStore(mallStore);
+ }
+
+ /**
+ * 店铺-删除
+ */
+ @GetMapping("delStore/{id}")
+ @ControllerEndpoint(operation = "店铺-删除", exceptionMessage = "操作失败")
+ public FebsResponse delStore(@NotNull(message = "{required}") @PathVariable Long id) {
+ return goodsCategoryService.delStore(id);
+ }
/**
* 商品分类列表
@@ -45,12 +128,60 @@
return new FebsResponse().success().data(goodsCategoryService.getCategorys(mallGoodsCategory));
}
+ @GetMapping(value = "/categoryTree")
+ public FebsResponse categoryTree() {
+ return new FebsResponse().success().data(mallGoodsCategoryService.findAllCategoryList());
+ }
+
+ @GetMapping(value = "/addressMYXL")
+ public FebsResponse addressMYXL() {
+ return new FebsResponse().success().data(mallGoodsCategoryService.findAllAddressList());
+ }
+
+ /**
+ * 商品分类-选择
+ */
+ @GetMapping("categorys/tree")
+ @ControllerEndpoint(exceptionMessage = "获取分类失败")
+ public List<AdminMallGoodsCategoryTreeVo> getParentCategorys(){
+ return goodsCategoryService.getParentCategorys();
+ }
+
+ /**
+ * 商品分类-全部选择
+ */
+ @GetMapping("categorys/allTree")
+ @ControllerEndpoint(exceptionMessage = "获取分类失败")
+ public List<AdminMallGoodsCategoryTreeVo> getAllCategorys(){
+ return goodsCategoryService.getAllCategorys();
+ }
+
/**
* 商品分类-新增
*/
@PostMapping("addCategory")
- @ControllerEndpoint(operation = " 商品分类-新增", exceptionMessage = "新增失败")
+ @ControllerEndpoint(operation = " 商品分类-新增", exceptionMessage = "操作失败")
public FebsResponse addCategory(@Valid MallGoodsCategory mallGoodsCategory) {
return goodsCategoryService.addCategory(mallGoodsCategory);
}
+
+ /**
+ * 商品分类-编辑
+ */
+ @PostMapping("updateCategory")
+ @ControllerEndpoint(operation = " 商品分类-编辑", exceptionMessage = "操作失败")
+ public FebsResponse updateCategory(@Valid MallGoodsCategory mallGoodsCategory) {
+ return goodsCategoryService.updateCategory(mallGoodsCategory);
+ }
+
+ /**
+ * 商品分类-删除
+ */
+ @GetMapping("delCategary/{id}")
+ @ControllerEndpoint(operation = " 商品分类-删除", exceptionMessage = "操作失败")
+ public FebsResponse delCategary(@NotNull(message = "{required}") @PathVariable Long id) {
+ return goodsCategoryService.delCategary(id);
+ }
+
+
}
--
Gitblit v1.9.1