From 332c012e7336f2996c4fe5c8c110d00713c1bde2 Mon Sep 17 00:00:00 2001 From: haoyahui <2032914783@qq.com> Date: 星期六, 11 十一月 2023 18:51:33 +0800 Subject: [PATCH] 采购单,采购明细,库存管理,出入库,调拨管理,库存盘点 --- consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java | 43 +++++++++++++++++++++++++++++++------------ 1 files changed, 31 insertions(+), 12 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 416ea13..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 */ @@ -146,18 +156,27 @@ } /** - * @Description 鏍规嵁鍒嗙被id鏌ヨ鐗╁搧妯℃澘 + * @Description 鏍规嵁鍒嗙被id鏌ヨ鐗╁搧妯℃澘 * @Author 鍗㈠簡闃� * @Date 2023/10/30 */ @GetMapping("/selectByCategoryId") - public ResponseValue querybyCategoryId(Long categoryId) { - List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.querybyCategoryId(categoryId); + 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