From 84ee37e1f485a1d3136535f9ef1c43058d9308ab Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 29 十一月 2023 11:39:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeButtonController.java | 317 +++++++++++++++++++++++++++++++++++-----------------
1 files changed, 210 insertions(+), 107 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeButtonController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeButtonController.java
index ef2c081..ee1f49f 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeButtonController.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeButtonController.java
@@ -1,136 +1,239 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 搴勯獮 (smallchill@163.com)
+ */
package com.vci.ubcs.code.controller;
-import com.vci.ubcs.code.service.CodeButtonServiceI;
-import com.vci.starter.web.pagemodel.BaseQueryObject;
-import com.vci.starter.web.pagemodel.BaseResult;
-import com.vci.starter.web.pagemodel.DataGrid;
-import com.vci.starter.web.util.VciBaseUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.vci.ubcs.code.dto.CodeButtonDTO;
+import com.vci.ubcs.code.entity.CodeButton;
+import com.vci.ubcs.code.mapper.CodeButtonMapper;
+import com.vci.ubcs.code.service.ICodeButtonService;
import com.vci.ubcs.code.vo.pagemodel.CodeButtonVO;
+import com.vci.ubcs.code.wrapper.CodeButtonWrapper;
+import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject;
+import com.vci.ubcs.starter.web.pagemodel.DataGrid;
+import com.vci.ubcs.starter.web.util.VciBaseUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import javax.validation.Valid;
import java.util.Collection;
/**
- * 涓绘暟鎹腑鐨勬寜閽墿灞曟帶鍒跺櫒
+ * 妯℃澘鎵╁睍姹� 鎺у埗鍣�
*
- * @author weidy
- * @date 2022-01-24
+ * @author yuxc
+ * @since 2023-03-29
*/
@RestController
+@AllArgsConstructor
@RequestMapping("/codeButtonController")
-public class CodeButtonController {
- /**
- * 涓绘暟鎹腑鐨勬寜閽墿灞� 鏈嶅姟
- */
- @Autowired
- private CodeButtonServiceI codeButtonService;
+@Api(value = "妯℃澘鎵╁睍姹�", tags = "妯℃澘鎵╁睍姹犳帴鍙�")
+public class CodeButtonController extends BladeController {
- /**
- * 涓绘暟鎹腑鐨勬寜閽墿灞曞垪琛�
- * @param baseQueryObject 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑
- * @return 涓绘暟鎹腑鐨勬寜閽墿灞曟樉绀哄璞″垪琛�
- */
- @GetMapping("/gridCodeButton")
- public DataGrid<CodeButtonVO> gridCodeButton(BaseQueryObject baseQueryObject){
- if(baseQueryObject == null){
- baseQueryObject = new BaseQueryObject();
- }
+ private final ICodeButtonService codeButtonService;
- return codeButtonService.gridCodeButton(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
- }
- /**
- * 澧炲姞 涓绘暟鎹腑鐨勬寜閽墿灞�
- * @param codeButtonDTO 涓绘暟鎹腑鐨勬寜閽墿灞曟暟鎹紶杈撳璞�
- * @return 鎵ц缁撴灉锛宻uccess涓簍rue琛ㄧず鎴愬姛锛宮sg鏄け璐ョ殑鎻愮ず淇℃伅锛宱bj鏄坊鍔犲畬鎴愬悗鐨勬樉绀哄璞�
- */
- @PostMapping( "/addSave")
- public BaseResult<CodeButtonVO> addSave(@RequestBody CodeButtonDTO codeButtonDTO){
- CodeButtonVO codeButtonVO = codeButtonService.addSave(codeButtonDTO);
- return BaseResult.success(codeButtonVO);
- }
+ CodeButtonMapper codeButtonMapper;
- /**
- * 淇敼 涓绘暟鎹腑鐨勬寜閽墿灞�
- * @param codeButtonDTO 涓绘暟鎹腑鐨勬寜閽墿灞曟暟鎹紶杈撳璞�
- * @return 鎵ц缁撴灉锛宻uccess涓簍rue琛ㄧず鎴愬姛锛宮sg鏄け璐ョ殑鎻愮ず淇℃伅锛宱bj鏄坊鍔犲畬鎴愬悗鐨勬樉绀哄璞�
- */
- @PutMapping("/editSave")
- public BaseResult<CodeButtonVO> editSave(@RequestBody CodeButtonDTO codeButtonDTO){
- CodeButtonVO codeButtonVO = codeButtonService.editSave(codeButtonDTO);
- return BaseResult.success(codeButtonVO);
- }
+ /**
+ * 妯℃澘鎵╁睍姹� 璇︽儏
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "璇︽儏", notes = "浼犲叆codebutton")
+ public R<CodeButtonVO> detail(CodeButton codebutton) {
+ CodeButton detail = codeButtonMapper.selectOne(Condition.getQueryWrapper(codebutton));
+ return R.data(CodeButtonWrapper.build().entityVO(detail));
+ }
+ /**
+ * 妯℃澘鎵╁睍姹� 鍒嗛〉
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "鍒嗛〉", notes = "浼犲叆codebutton")
+ public R<IPage<CodeButtonVO>> list(CodeButton codebutton, Query query) {
+ IPage<CodeButton> pages = codeButtonMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(codebutton));
+ return R.data(CodeButtonWrapper.build().pageVO(pages));
+ }
- /**
- * 鍒犻櫎涓绘暟鎹腑鐨勬寜閽墿灞�
- * @param codeButtonDTO 涓绘暟鎹腑鐨勬寜閽墿灞曟暟鎹紶杈撳璞★紝oid鍜宼s闇�瑕佷紶杈�
- * @return 鍒犻櫎缁撴灉鍙嶉锛氾細success锛氭垚鍔燂紝fail锛氬け璐�
- */
- @DeleteMapping( "/deleteData")
- public BaseResult delCodeButton( CodeButtonDTO codeButtonDTO) {
- return codeButtonService.deleteCodeButton(codeButtonDTO);
- }
+ /**
+ * 妯℃澘鎵╁睍姹� 鑷畾涔夊垎椤�
+ */
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "鍒嗛〉", notes = "浼犲叆codebutton")
+ public R<IPage<CodeButtonVO>> page(CodeButtonVO codebutton, Query query) {
+ IPage<CodeButtonVO> pages = codeButtonService.selectcodebuttonPage(Condition.getPage(query), codebutton);
+ return R.data(pages);
+ }
- /**
- * 涓婚敭鑾峰彇涓绘暟鎹腑鐨勬寜閽墿灞�
- * @param oid 涓婚敭
- * @return 涓绘暟鎹腑鐨勬寜閽墿灞曟樉绀哄璞�
- */
- @GetMapping("/getObjectByOid")
- public BaseResult<CodeButtonVO> getObjectByOid(String oid){
- CodeButtonVO codeButtonVO = codeButtonService.getObjectByOid(oid);
- return BaseResult.success(codeButtonVO);
- }
+ /**
+ * 妯℃澘鎵╁睍姹� 鏂板
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "鏂板", notes = "浼犲叆codebutton")
+ public R save(@Valid @RequestBody CodeButton codebutton) {
+ return R.status(SqlHelper.retBool(codeButtonMapper.insert(codebutton)));
+ }
- /**
- * 涓婚敭鎵归噺鑾峰彇涓绘暟鎹腑鐨勬寜閽墿灞�
- * @param oids 涓婚敭锛屽涓互閫楀彿鍒嗛殧锛屼絾鏄彈鎬ц兘褰卞搷锛屽缓璁竴娆℃煡璇笉瓒呰繃10000涓�
- * @return 涓绘暟鎹腑鐨勬寜閽墿灞曟樉绀哄璞�
- */
- @GetMapping("/listDataByOids")
- public BaseResult<CodeButtonVO> listCodeButtonByOids(String oids){
- Collection<CodeButtonVO> voCollection = codeButtonService.listCodeButtonByOids(VciBaseUtil.str2List(oids));
- BaseResult baseResult = BaseResult.success();
- baseResult.setData(voCollection);
- return baseResult;
- }
+ /**
+ * 妯℃澘鎵╁睍姹� 淇敼
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "淇敼", notes = "浼犲叆codebutton")
+ public R update(@Valid @RequestBody CodeButton codebutton) {
+ return R.status(SqlHelper.retBool(codeButtonMapper.updateById(codebutton)));
+ }
- /**
- * 鍚敤
- * @param buttonDTO 鏁版嵁浼犺緭瀵硅薄锛宱id鍜宼s闇�瑕佷紶杈�
- * @return 鍚敤缁撴灉鍙嶉锛氾細success锛氭垚鍔燂紝fail锛氬け璐�
- */
- @PostMapping("/enableData")
- public BaseResult enableOrgDuty(CodeButtonDTO buttonDTO) {
- return codeButtonService.enableCodeButton(buttonDTO);
- }
+ /**
+ * 妯℃澘鎵╁睍姹� 鏂板鎴栦慨鏀�
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "鏂板鎴栦慨鏀�", notes = "浼犲叆codebutton")
+ public R submit(@Valid @RequestBody CodeButton codebutton) {
+ if(codebutton.getOid() != null){
+ return R.status(SqlHelper.retBool(codeButtonMapper.updateById(codebutton)));
+ }
+ return R.status(SqlHelper.retBool(codeButtonMapper.insert(codebutton)));
+ }
- /**
- * 鍋滅敤
- * @param buttonDTO 鏁版嵁浼犺緭瀵硅薄锛宱id鍜宼s闇�瑕佷紶杈�
- * @return 鍋滅敤缁撴灉鍙嶉锛氾細success锛氭垚鍔燂紝fail锛氬け璐�
- */
- @PostMapping("/disableData")
- public BaseResult disableOrgDuty(CodeButtonDTO buttonDTO) {
- return codeButtonService.disableCodeButton(buttonDTO);
- }
+ /**
+ * 妯℃澘鎵╁睍姹� 鍒犻櫎
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 7)
+ @ApiOperation(value = "閫昏緫鍒犻櫎", notes = "浼犲叆ids")
+ public R remove(@ApiParam(value = "涓婚敭闆嗗悎", required = true) @RequestParam String ids) {
+// return codebuttonService.deleteCodeButton(ids);
+ return R.status(SqlHelper.retBool(codeButtonMapper.deleteBatchIds(Func.toStrList(ids))));
+ }
+ /**
+ * 涓绘暟鎹腑鐨勬寜閽墿灞曞垪琛�
+ * @param baseQueryObject 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑
+ * @return 涓绘暟鎹腑鐨勬寜閽墿灞曟樉绀哄璞″垪琛�
+ */
+ @GetMapping("/gridCodeButton")
+ public R<IPage<CodeButtonVO>> gridCodeButton(BaseQueryObject baseQueryObject){
+ if(baseQueryObject == null){
+ baseQueryObject = new BaseQueryObject();
+ }
+ return R.data(codeButtonService.gridCodeButton(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()));
+ }
+ /**
+ * 澧炲姞 涓绘暟鎹腑鐨勬寜閽墿灞�
+ * @param codeButtonDTO 涓绘暟鎹腑鐨勬寜閽墿灞曟暟鎹紶杈撳璞�
+ * @return 鎵ц缁撴灉锛宻uccess涓簍rue琛ㄧず鎴愬姛锛宮sg鏄け璐ョ殑鎻愮ず淇℃伅锛宱bj鏄坊鍔犲畬鎴愬悗鐨勬樉绀哄璞�
+ */
+ @PostMapping( "/addSave")
+ public R<CodeButtonVO> addSave(@RequestBody CodeButtonDTO codeButtonDTO){
+ CodeButtonVO codeButtonVO = codeButtonService.addSave(codeButtonDTO);
+ return R.data(codeButtonVO);
+ }
+ /**
+ * 淇敼 涓绘暟鎹腑鐨勬寜閽墿灞�
+ * @param codeButtonDTO 涓绘暟鎹腑鐨勬寜閽墿灞曟暟鎹紶杈撳璞�
+ * @return 鎵ц缁撴灉锛宻uccess涓簍rue琛ㄧず鎴愬姛锛宮sg鏄け璐ョ殑鎻愮ず淇℃伅锛宱bj鏄坊鍔犲畬鎴愬悗鐨勬樉绀哄璞�
+ */
+ @PutMapping("/editSave")
+ public R<CodeButtonVO> editSave(@RequestBody CodeButtonDTO codeButtonDTO){
+ CodeButtonVO codeButtonVO = codeButtonService.editSave(codeButtonDTO);
+ return R.data(codeButtonVO);
+ }
- /**
- * 鍙傜収涓绘暟鎹腑鐨勬寜閽墿灞曞垪琛�
- * @param baseQueryObject 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑
- * @return 涓绘暟鎹腑鐨勬寜閽墿灞曟樉绀哄璞″垪琛紝鐢熸晥鐨勫唴瀹�
- */
- @GetMapping("/refDataGrid")
- public DataGrid<CodeButtonVO> refDataGridCodeButton(BaseQueryObject baseQueryObject){
- if(baseQueryObject == null){
- baseQueryObject = new BaseQueryObject();
- }
- return codeButtonService.refDataGridCodeButton(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
- }
+ /**
+ * 鍒犻櫎涓绘暟鎹腑鐨勬寜閽墿灞�
+ * @param codeButtonDTO 涓绘暟鎹腑鐨勬寜閽墿灞曟暟鎹紶杈撳璞★紝oid鍜宼s闇�瑕佷紶杈�
+ * @return 鍒犻櫎缁撴灉鍙嶉锛氾細success锛氭垚鍔燂紝fail锛氬け璐�
+ */
+ @DeleteMapping( "/deleteData")
+ public R delCodeButton( CodeButtonDTO codeButtonDTO) {
+ return codeButtonService.deleteCodeButton(codeButtonDTO);
+ }
+
+ /**
+ * 涓婚敭鑾峰彇涓绘暟鎹腑鐨勬寜閽墿灞�
+ * @param oid 涓婚敭
+ * @return 涓绘暟鎹腑鐨勬寜閽墿灞曟樉绀哄璞�
+ */
+ @GetMapping("/getObjectByOid")
+ public R<CodeButtonVO> getObjectByOid(String oid){
+ CodeButtonVO codeButtonVO = codeButtonService.getObjectByOid(oid);
+ return R.data(codeButtonVO);
+ }
+
+ /**
+ * 涓婚敭鎵归噺鑾峰彇涓绘暟鎹腑鐨勬寜閽墿灞�
+ * @param oids 涓婚敭锛屽涓互閫楀彿鍒嗛殧锛屼絾鏄彈鎬ц兘褰卞搷锛屽缓璁竴娆℃煡璇笉瓒呰繃10000涓�
+ * @return 涓绘暟鎹腑鐨勬寜閽墿灞曟樉绀哄璞�
+ */
+ @GetMapping("/listDataByOids")
+ public R<Collection<CodeButtonVO>> listCodeButtonByOids(String oids){
+ return R.data(codeButtonService.listCodeButtonByOids(VciBaseUtil.str2List(oids)));
+ }
+
+ /**
+ * 鍙傜収涓绘暟鎹腑鐨勬寜閽墿灞曞垪琛�
+ * @param baseQueryObject 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑
+ * @return 涓绘暟鎹腑鐨勬寜閽墿灞曟樉绀哄璞″垪琛紝鐢熸晥鐨勫唴瀹�
+ */
+ @GetMapping("/refDataGrid")
+ public R<IPage<CodeButtonVO>> refDataGridCodeButton(BaseQueryObject baseQueryObject){
+ if(baseQueryObject == null){
+ baseQueryObject = new BaseQueryObject();
+ }
+ return R.data(codeButtonService.refDataGridCodeButton(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()));
+ }
+
+ /**
+ * 鍚敤
+ * @param oid 鏁版嵁浼犺緭瀵硅薄
+ * @return 鍚敤缁撴灉鍙嶉锛�
+ */
+ @PostMapping("/enableData")
+ public R enableOrgDuty(@ApiParam(value = "涓婚敭闆嗗悎", required = true) @RequestParam String oid) {
+ return codeButtonService.enableCodeButton(oid);
+ }
+
+ /**
+ * 鍋滅敤
+ * @param oid 闇�瑕佷紶杈�
+ * @return 鍋滅敤缁撴灉鍙嶉锛�
+ */
+ @PostMapping("/disableData")
+ public R disableOrgDuty(@ApiParam(value = "涓婚敭闆嗗悎", required = true) @RequestParam String oid) {
+ return codeButtonService.disableOrgDuty(oid);
+ }
}
--
Gitblit v1.9.3