From 8f24fea6ef79a68bbda4991bd9bd7a60402ad033 Mon Sep 17 00:00:00 2001 From: haoyahui <2032914783@qq.com> Date: 星期四, 09 十一月 2023 18:16:03 +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..5e00c1a 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 getByAgencyId(Long agencyId) { + if (agencyId == null) { + return ResponseValue.error("鏈烘瀯id涓虹┖"); + } + List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.queryByAgencyId(agencyId); + if (list == null) { + return ResponseValue.error("鏌ヨ澶辫触锛�"); + } + return ResponseValue.success("鏌ヨ鎴愬姛!", list); + } } -- Gitblit v1.9.1