From 1b8120cacac0037fcb1f8ae747c2f54eb735368b Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 09 五月 2023 18:50:51 +0800
Subject: [PATCH] 代码整合

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeButtonController.java |  160 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 160 insertions(+), 0 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
new file mode 100644
index 0000000..ddf9b95
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeButtonController.java
@@ -0,0 +1,160 @@
+/*
+ *      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.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 yuxc
+ * @since 2023-03-29
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/codeButtonController")
+@Api(value = "妯℃澘鎵╁睍姹�", tags = "妯℃澘鎵╁睍姹犳帴鍙�")
+public class CodeButtonController extends BladeController {
+
+	private final ICodeButtonService codeButtonService;
+
+	/**
+	 * 涓绘暟鎹腑鐨勬寜閽墿灞曞垪琛�
+	 * @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 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