From 5112320c542900d9e79bbc0938b195a43e3fc255 Mon Sep 17 00:00:00 2001 From: futian.liu <liufutianyoo@163.com> Date: 星期四, 23 十一月 2023 17:34:54 +0800 Subject: [PATCH] --部门物品分发 --- consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 deletions(-) diff --git a/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java b/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java index ca157b1..343c47b 100644 --- a/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java +++ b/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java @@ -5,20 +5,23 @@ import com.consum.base.pojo.ProjectTreeResult; import com.consum.base.service.BaseCategoryServiceImpl; import com.consum.base.service.BaseGoodsTemplateServiceImpl; -import com.consum.base.util.FinSysTenantUtils; import com.consum.model.po.BaseCategory; -import com.consum.model.po.FinSysTenant; -import com.consum.model.po.FinSysTenantUser; import com.iplatform.model.po.S_user_core; import com.walker.db.page.GenericPager; import com.walker.infrastructure.tree.TreeNode; import com.walker.infrastructure.utils.StringUtils; import com.walker.web.ResponseValue; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; - -import java.util.*; +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 鐗╁搧鍒嗙被 @@ -42,13 +45,13 @@ private long defaultParentId = 0L; /** - * @Description 鑾峰彇鍒嗙被鏍� + * @Description 鑾峰彇鍒嗙被鏍� * @Author 鍗㈠簡闃� * @Date 2023/10/30 */ @GetMapping("/select/tree") public ResponseValue tree(String categoryName) { - List<ProjectTreeResult> tree = this.baseCategoryService.tree(categoryName); + List<ProjectTreeResult> tree = this.baseCategoryService.tree(); return ResponseValue.success(tree); } @@ -72,7 +75,9 @@ } int result = this.baseCategoryService.add(param, this.getCurrentUser()); - if (result > 0) return ResponseValue.success(1); + if (result > 0) { + return ResponseValue.success(1); + } return ResponseValue.error("鏂板澶辫触锛�"); } @@ -90,6 +95,7 @@ GenericPager<BaseCategory> pager = this.baseCategoryService.queryBaseCategoryList(param); return ResponseValue.success(pager); } + /** * @Description 缂栬緫 @@ -119,6 +125,7 @@ /** * 淇敼鐘舵�� + * * @author 鍗㈠簡闃� * @date 2023/10/23 */ @@ -148,13 +155,14 @@ if (baseCategory.getId() == null) { return ResponseValue.error("鍒嗙被id涓虹┖"); } - int num = this.baseCategoryService.updateById(baseCategory,this.getCurrentUser()); + int num = this.baseCategoryService.updateById(baseCategory, this.getCurrentUser()); return num > 0 ? ResponseValue.success(1) : ResponseValue.error("鍒犻櫎澶辫触锛�"); } /** * 鏍规嵁鐗╁搧id鏌ヨ鑺傜偣璇︽儏 + * * @author 鍗㈠簡闃� * @Date 2023/10/23 */ @@ -164,7 +172,9 @@ return ResponseValue.error("鍒嗙被id涓虹┖"); } BaseCategory baseCategory = this.baseCategoryService.getById(id); - if (baseCategory == null) return ResponseValue.error("鏌ヨ澶辫触锛�"); + if (baseCategory == null) { + return ResponseValue.error("鏌ヨ澶辫触锛�"); + } return ResponseValue.success("鏌ヨ鎴愬姛!", baseCategory); } -- Gitblit v1.9.1