From 8ce1dcfe07de7dcfd397a0af02689653da0981eb Mon Sep 17 00:00:00 2001 From: futian.liu <liufutianyoo@163.com> Date: 星期五, 22 十二月 2023 13:49:16 +0800 Subject: [PATCH] 部门分发时,修改正确的预警库存 --- consum-base/src/main/java/com/consum/base/controller/BaseGoodsModelsController.java | 54 +++++++++++++++++++++--------------------------------- 1 files changed, 21 insertions(+), 33 deletions(-) diff --git a/consum-base/src/main/java/com/consum/base/controller/BaseGoodsModelsController.java b/consum-base/src/main/java/com/consum/base/controller/BaseGoodsModelsController.java index f84a751..d21c7ea 100644 --- a/consum-base/src/main/java/com/consum/base/controller/BaseGoodsModelsController.java +++ b/consum-base/src/main/java/com/consum/base/controller/BaseGoodsModelsController.java @@ -1,5 +1,14 @@ package com.consum.base.controller; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +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.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + import com.consum.base.BaseController; import com.consum.base.core.utils.CommonUtil; import com.consum.base.service.BaseGoodsModelsService; @@ -8,19 +17,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.web.bind.annotation.DeleteMapping; -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 io.swagger.annotations.Api; /** * @Description 瑙勬牸鍨嬪彿 * @Author 鍗㈠簡闃� * @Date 2023/10/25 */ +@Api(value = "瑙勬牸鍨嬪彿", tags = "瑙勬牸鍨嬪彿") @RestController @RequestMapping("/pc/base/goods/models") public class BaseGoodsModelsController extends BaseController { @@ -58,22 +63,26 @@ CommonUtil.copyProperties(models, param2); models = param2; - if (models.getGoodsTemplatesId() == null || StringUtils.isEmpty(models.getModelName()) || StringUtils.isEmpty(models.getUnit()) || models.getStates() == null) { + if (models.getGoodsTemplatesId() == null || StringUtils.isEmpty(models.getModelName()) + || StringUtils.isEmpty(models.getUnit()) || models.getStates() == null) { return ResponseValue.error("鍙傛暟閿欒"); } - //鍒ゆ柇鍚屼竴鐗╁搧妯℃澘id涓嬬殑 瑙勬牸鍨嬪彿鍚嶇О鏄惁閲嶅 + // 鍒ゆ柇鍚屼竴鐗╁搧妯℃澘id涓嬬殑 瑙勬牸鍨嬪彿鍚嶇О鏄惁閲嶅 BaseGoodsModels baseGoodsModels = this.baseGoodsModelsService.getByModelNameAndGoodsTemplatesId(models); if (baseGoodsModels != null) { return ResponseValue.error("瑙勬牸鍨嬪彿鍚嶇О宸插瓨鍦�"); } int result = this.baseGoodsModelsService.add(models); - if (result > 0) return ResponseValue.success(1); + if (result > 0) { + return ResponseValue.success(); + } return ResponseValue.error("鏂板澶辫触锛�"); } /** * 淇敼鐘舵�� + * * @author 鍗㈠簡闃� * @date 2023/10/25 */ @@ -112,38 +121,17 @@ return num > 0 ? ResponseValue.success(1) : ResponseValue.error("鍒犻櫎澶辫触锛�"); } - /** - * @Description 鏍规嵁鐗╁搧id鏌ヨ瑙勬牸鍨嬪彿 - * @Author 鍗㈠簡闃� - * @Date 2023/10/30 - */ - @GetMapping("/selectByGoodsTemplatesId") - public ResponseValue queryByGoodsTemplatesId(Long goodsTemplatesId) { - List<BaseGoodsModels> list = this.baseGoodsModelsService.queryByGoodsTemplatesId(goodsTemplatesId); - return ResponseValue.success(list); - } - @GetMapping("query/goodsModel") public ResponseValue queryGoodsModelByGoodsTemplatesId(Long goodsTemplatesId) { -// S_user_core currentUser = this.getCurrentUser(); -// if (currentUser == null) { -// return ResponseValue.error("鐧诲綍鐢ㄦ埛淇℃伅涓嶅瓨鍦�"); -// } -// if (goodsTemplatesId == null) { -// return ResponseValue.error("鐗╁搧id涓嶅瓨鍦�"); -// } - BaseGoodsModels baseGoodsModels = new BaseGoodsModels(); - baseGoodsModels.setGoodsTemplatesId(goodsTemplatesId); - List<BaseGoodsModels> result = this.baseGoodsModelsService.select(baseGoodsModels); + List<BaseGoodsModels> result = baseGoodsModelsService.queryGoodsModelByGoodsTemplatesId(goodsTemplatesId); return ResponseValue.success(result); } @GetMapping("queryGoodsModelInfo") public ResponseValue queryGoodsModelInfo(Long baseGoodsModelsId) { - if (baseGoodsModelsId== null){ + if (baseGoodsModelsId == null) { return ResponseValue.error("鍙傛暟涓嶈兘涓虹┖锛�"); } return ResponseValue.success(baseGoodsModelsService.queryGoodsModelInfo(baseGoodsModelsId)); } } - -- Gitblit v1.9.1