From 11f925fdce0f58d1f321f3a13a3f3e84221c6912 Mon Sep 17 00:00:00 2001
From: futian.liu <liufutianyoo@163.com>
Date: 星期一, 13 十一月 2023 09:27:14 +0800
Subject: [PATCH] 整理代码

---
 consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java |   46 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java b/consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java
index e3c74d9..a9747e1 100644
--- a/consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java
+++ b/consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java
@@ -11,11 +11,15 @@
 import com.walker.db.page.GenericPager;
 import com.walker.infrastructure.utils.StringUtils;
 import com.walker.web.ResponseValue;
+import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * @Description 鐗╁搧妯℃澘
@@ -49,7 +53,9 @@
         }
 
         int result = this.baseGoodsTemplateService.add(param, this.getCurrentUser());
-        if (result > 0) return ResponseValue.success(1);
+        if (result > 0) {
+            return ResponseValue.success(1);
+        }
         return ResponseValue.error("鏂板澶辫触锛�");
     }
 
@@ -70,6 +76,7 @@
 
     /**
      * 鏍规嵁鐗╁搧id鏌ヨ鐗╁搧璇︽儏
+     *
      * @author 鍗㈠簡闃�
      * @date 2023/9/26
      */
@@ -79,7 +86,9 @@
             return ResponseValue.error("鐗╁搧id涓虹┖");
         }
         BaseGoodsTemplateVo vo = this.baseGoodsTemplateService.getById(id);
-        if (vo == null) return ResponseValue.error("鏌ヨ澶辫触锛�");
+        if (vo == null) {
+            return ResponseValue.error("鏌ヨ澶辫触锛�");
+        }
         return ResponseValue.success("鏌ヨ鎴愬姛!", vo);
     }
 
@@ -104,6 +113,7 @@
 
     /**
      * 淇敼鐘舵��
+     *
      * @author 鍗㈠簡闃�
      * @date 2023/10/25
      */
@@ -129,13 +139,13 @@
         if (goodsTemplate.getId() == null) {
             return ResponseValue.error("鐗╁搧id涓虹┖");
         }
-        int num = this.baseGoodsTemplateService.updateById(goodsTemplate,this.getCurrentUser());
+        int num = this.baseGoodsTemplateService.updateById(goodsTemplate, this.getCurrentUser());
 
         return num > 0 ? ResponseValue.success(1) : ResponseValue.error("鍒犻櫎澶辫触锛�");
     }
 
     /**
-     * @Description  鏌ヨ浠撳簱绫诲瀷(鏁版嵁瀛楀吀)
+     * @Description 鏌ヨ浠撳簱绫诲瀷(鏁版嵁瀛楀吀)
      * @Author 鍗㈠簡闃�
      * @Date 2023/10/30
      */
@@ -145,6 +155,28 @@
         return ResponseValue.success(list);
     }
 
+    /**
+     * @Description 鏍规嵁鍒嗙被id鏌ヨ鐗╁搧妯℃澘
+     * @Author 鍗㈠簡闃�
+     * @Date 2023/10/30
+     */
+    @GetMapping("/selectByCategoryId")
+    public ResponseValue queryByCategoryId(Long categoryId) {
+        List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.queryByCategoryId(categoryId);
+        return ResponseValue.success(list);
+    }
+
+    @GetMapping("/query/goodsTemplate")
+    public ResponseValue queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId) {
+//        if (agencyId == null) {
+//            return ResponseValue.error("鏈烘瀯id涓虹┖");
+//        }
+        List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.queryGoodsTemplateByCategoryId(agencyId, categoryId);
+        if (list == null) {
+            return ResponseValue.error("鏌ヨ澶辫触锛�");
+        }
+        return ResponseValue.success("鏌ヨ鎴愬姛!", list);
+    }
 
 
 }

--
Gitblit v1.9.1