From d7a83f1396425c4e47da9b95f287b26cd5bb3344 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 12 四月 2023 10:18:53 +0800 Subject: [PATCH] 后端代码整合 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java | 204 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 204 insertions(+), 0 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java new file mode 100644 index 0000000..e4a3ff1 --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java @@ -0,0 +1,204 @@ +package com.vci.ubcs.code.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.vci.ubcs.code.dto.CodeBasicSecDTO; +import com.vci.ubcs.code.entity.CodeBasicSec; +import com.vci.ubcs.code.service.ICodeBasicSecService; +import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; +import com.vci.ubcs.code.wrapper.CodeBasicSecWrapper; +import com.vci.ubcs.com.vci.starter.exception.VciBaseException; +import io.swagger.annotations.ApiOperation; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 鐮佹鍩虹淇℃伅鎺у埗鍣� + * + * @author ludc + * @date 2022-01-24 + */ +@RestController +@RequestMapping("/codeBasicSecController") +public class CodeBasicSecController { + + /** + * 鐮佹鍩虹淇℃伅 鏈嶅姟 + */ + @Autowired + private ICodeBasicSecService codeBasicSecService; + + /** + * 缂栫爜瑙勫垯 鍒嗛〉 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "鍒嗛〉", notes = "浼犲叆codeRuleVO") + public R<IPage<CodeBasicSecVO>> list(CodeBasicSec codeBasicSec, Query query) { + IPage<CodeBasicSec> pages = codeBasicSecService.page(Condition.getPage(query), Condition.getQueryWrapper(codeBasicSec)); + return R.data(CodeBasicSecWrapper.build().pageVO(pages)); + } + + /** + * 鐮佹鍩虹淇℃伅鍒楄〃 + * @param codeBasicSecVO 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑 + * @return 鐮佹鍩虹淇℃伅鏄剧ず瀵硅薄鍒楄〃 + */ + @GetMapping("/gridCodeBasicSec") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "鍒嗛〉", notes = "浼犲叆codeRuleVO") + public R<IPage<CodeBasicSecVO>> gridCodeBasicSec(CodeBasicSecVO codeBasicSecVO, Query query){ + IPage<CodeBasicSecVO> codeRuleVOIPage = codeBasicSecService.gridCodeBasicSec(Condition.getPage(query.setAscs("ordernum")),codeBasicSecVO); + return R.data(codeRuleVOIPage); + } + + /** + * 澧炲姞 鐮佹鍩虹淇℃伅 + * @param codeBasicSecDTO 鐮佹鍩虹淇℃伅鏁版嵁浼犺緭瀵硅薄 + * @return 鎵ц缁撴灉锛宻uccess涓簍rue琛ㄧず鎴愬姛锛宮sg鏄け璐ョ殑鎻愮ず淇℃伅锛宱bj鏄坊鍔犲畬鎴愬悗鐨勬樉绀哄璞� + */ + @PostMapping( "/addSave") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "澧炲姞", notes = "codeBasicSecDTO") + public R addSave(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ + boolean resBoolean = false; + try { + resBoolean = codeBasicSecService.addSave(codeBasicSecDTO); + } catch (VciBaseException e) { + return R.fail(e.getCode()); + } + return R.data(resBoolean); + } + + /* *//** + * 淇敼 鐮佹鍩虹淇℃伅 + * @param codeBasicSecDTO 鐮佹鍩虹淇℃伅鏁版嵁浼犺緭瀵硅薄 + * @return 鎵ц缁撴灉锛宻uccess涓簍rue琛ㄧず鎴愬姛锛宮sg鏄け璐ョ殑鎻愮ず淇℃伅锛宱bj鏄坊鍔犲畬鎴愬悗鐨勬樉绀哄璞� + *//* + @PutMapping("/editSave") + public R<CodeBasicSecVO> editSave(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ + CodeBasicSecVO codeBasicSecVO = null; + try { + codeBasicSecVO = codeBasicSecService.editSave(codeBasicSecDTO); + } catch (VciBaseException e) { + return R.fail(e.getCode()); + } + return R.success(codeBasicSecVO); + } + + + *//** + * 鍒犻櫎鐮佹鍩虹淇℃伅 + * @param codeBasicSecDTO 鐮佹鍩虹淇℃伅鏁版嵁浼犺緭瀵硅薄锛宱id鍜宼s闇�瑕佷紶杈� + * @return 鍒犻櫎缁撴灉鍙嶉锛氾細success锛氭垚鍔燂紝fail锛氬け璐� + *//* + @DeleteMapping( "/deleteData") + public R delCodeBasicSec(CodeBasicSecDTO codeBasicSecDTO) { + return codeBasicSecService.deleteCodeBasicSec(codeBasicSecDTO); + } + + *//** + * 涓婚敭鑾峰彇鐮佹鍩虹淇℃伅 + * @param oid 涓婚敭 + * @return 鐮佹鍩虹淇℃伅鏄剧ず瀵硅薄 + *//* + @GetMapping("/getObjectByOid") + public R<CodeBasicSecVO> getObjectByOid(String oid){ + CodeBasicSecVO codeBasicSecVO = codeBasicSecService.getObjectByOid(oid); + return BaseResult.success(codeBasicSecVO); + } + + *//** + * 涓婚敭鎵归噺鑾峰彇鐮佹鍩虹淇℃伅 + * @param oids 涓婚敭锛屽涓互閫楀彿鍒嗛殧锛屼絾鏄彈鎬ц兘褰卞搷锛屽缓璁竴娆℃煡璇笉瓒呰繃10000涓� + * @return 鐮佹鍩虹淇℃伅鏄剧ず瀵硅薄 + *//* + @GetMapping("/listDataByOids") + public R<CodeBasicSecVO> listCodeBasicSecByOids(String oids){ + Collection<CodeBasicSecVO> voCollection = codeBasicSecService.listCodeBasicSecByOids(VciBaseUtil.str2List(oids)); + R baseResult = R.success(); + baseResult.setData(voCollection); + return baseResult; + } + + + + *//** + * 鍙傜収鐮佹鍩虹淇℃伅鍒楄〃 + * @param baseQueryObject 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑 + * @return 鐮佹鍩虹淇℃伅鏄剧ず瀵硅薄鍒楄〃锛岀敓鏁堢殑鍐呭 + *//* + @GetMapping("/refDataGrid") + public R<IPage<CodeBasicSecVO>> refDataGridCodeBasicSec(BaseQueryObject baseQueryObject){ + if(baseQueryObject == null){ + baseQueryObject = new BaseQueryObject(); + } + return codeBasicSecService.refDataGridCodeBasicSec(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); + } + + *//** + * 鍙傛暟鍒嗙被鐮佹鍩虹淇℃伅鍒楄〃 + * @param baseQueryObject 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑锛屽繀椤昏鏈夌紪鐮佽鍒欑殑涓婚敭 pkCodeRule + * @return 鐮佹鐨勪俊鎭� + *//* + @GetMapping("/refDataGridClassifySec") + public R<IPage<CodeBasicSecVO>> refDataGridClassifySec(BaseQueryObject baseQueryObject){ + if(baseQueryObject == null){ + baseQueryObject = new BaseQueryObject(); + } + return codeBasicSecService.refDataGridClassifySec(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); + } + + *//** + * 鍏嬮殕鐮佹淇℃伅 + * @param codeBasicSecDTO 鐮佹鍩虹淇℃伅鏁版嵁浼犺緭瀵硅薄锛宱idArr锛氶�夋嫨婧愮爜娈典富閿殑闆嗗悎锛宲kCodeRule锛氱洰鏍囩紪鐮佽鍒欑殑涓婚敭 + * @return 鍏嬮殕缁撴灉鍙嶉锛氾細success锛氭垚鍔燂紝fail锛氬け璐� + *//* + @PostMapping("/clone") + public R cloneCodeBasicSec(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ + VciBaseUtil.alertNotNull(codeBasicSecDTO.getOidArr(),"閫夋嫨鐮佹涓婚敭"); + List<String> oidArr = VciBaseUtil.str2List(codeBasicSecDTO.getOidArr()); + if (CollectionUtils.isEmpty(oidArr)){ + return R.fail("閫夋嫨鐮佹涓婚敭涓嶈兘涓虹┖"); + } + return codeBasicSecService.cloneCodeBasicSec(oidArr,codeBasicSecDTO.getPkCodeRule()); + } + + *//** + * 鏌ヨ鐩爣鍒嗙被鐮佹鎵�鍦ㄧ殑鏍戠粨鏋� + * @param oid 鐩爣鍒嗙被鐮佹涓婚敭 + * @return 鍒嗙被鐮佹鏍戠粨鏋� + *//* + @GetMapping("/treeCodeClassifySec") + public List<Tree> gridCodeClassifySecTree (String oid){ + VciBaseUtil.alertNotNull(oid,"鍒嗙被鐮佹涓婚敭"); + return codeBasicSecService.gridCodeClassifySecTree(oid); + } + + *//** + * 涓婄Щ + * @param oid 涓婚敭 + * @return 鎵ц缁撴灉 + *//* + @PostMapping("/upOrderNum") + public R upOrderNum(String oid){ + codeBasicSecService.upOrderNum(oid); + return R.success(); + } + + *//** + * 涓嬬Щ + * @param oid 涓婚敭 + * @return 鎵ц缁撴灉 + *//* + @PostMapping("/downOrderNum") + public R downOrderNum(String oid){ + codeBasicSecService.downOrderNum(oid); + return R.success(); + }*/ + +} -- Gitblit v1.9.3