¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.code.dto.CodeClassifyTemplateAttrDTO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyTemplateAttr; |
| | | import com.vci.ubcs.code.service.ICodeClassifyTemplateAttrService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateAttrVO; |
| | | import com.vci.ubcs.code.wrapper.CodeClassifyTemplateAttrWrapper; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | 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.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿å±æ§ æ§å¶å¨ |
| | | * |
| | | * @author yuxc |
| | | * @since 2023-04-19 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/codeClassifyTempAttrController") |
| | | @Api(value = "ç¼ç åºå®ä¹-模æ¿å±æ§", tags = "ç¼ç åºå®ä¹-模æ¿å±æ§æ¥å£") |
| | | public class CodeClassifyTemplateAttrController extends BladeController { |
| | | |
| | | private final ICodeClassifyTemplateAttrService CodeClstempattrService; |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿å±æ§ 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥CodeClstempattr") |
| | | public R<CodeClassifyTemplateAttrVO> detail(CodeClassifyTemplateAttr CodeClstempattr) { |
| | | CodeClassifyTemplateAttr detail = CodeClstempattrService.getOne(Condition.getQueryWrapper(CodeClstempattr)); |
| | | return R.data(CodeClassifyTemplateAttrWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿å±æ§ å页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥CodeClstempattr") |
| | | public R<IPage<CodeClassifyTemplateAttrVO>> list(CodeClassifyTemplateAttr CodeClstempattr, Query query) { |
| | | IPage<CodeClassifyTemplateAttr> pages = CodeClstempattrService.page(Condition.getPage(query), Condition.getQueryWrapper(CodeClstempattr)); |
| | | return R.data(CodeClassifyTemplateAttrWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿å±æ§ èªå®ä¹å页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥CodeClstempattr") |
| | | public R<IPage<CodeClassifyTemplateAttrVO>> page(CodeClassifyTemplateAttrVO CodeClstempattr, Query query) { |
| | | IPage<CodeClassifyTemplateAttrVO> pages = CodeClstempattrService.selectCodeClstempattrPage(Condition.getPage(query), CodeClstempattr); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿å±æ§ æ°å¢ |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥CodeClstempattr") |
| | | public R save(@Valid @RequestBody CodeClassifyTemplateAttr CodeClstempattr) { |
| | | return R.status(CodeClstempattrService.save(CodeClstempattr)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿å±æ§ ä¿®æ¹ |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥CodeClstempattr") |
| | | public R update(@Valid @RequestBody CodeClassifyTemplateAttr CodeClstempattr) { |
| | | return R.status(CodeClstempattrService.updateById(CodeClstempattr)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿å±æ§ æ°å¢æä¿®æ¹ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥CodeClstempattr") |
| | | public R submit(@Valid @RequestBody CodeClassifyTemplateAttr CodeClstempattr) { |
| | | return R.status(CodeClstempattrService.saveOrUpdate(CodeClstempattr)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿å±æ§ å é¤ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(CodeClstempattrService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 主é¢åºåç±»çæ¨¡æ¿å±æ§å表 |
| | | * @param baseQueryObject åºç¡æ¥è¯¢å¯¹è±¡ï¼å
嫿¥è¯¢æ¡ä»¶ï¼åé¡µï¼æåºç |
| | | * @return 主é¢åºåç±»çæ¨¡æ¿å±æ§æ¾ç¤ºå¯¹è±¡å表 |
| | | */ |
| | | @GetMapping("/gridCodeClassifyTemplateAttr") |
| | | public DataGrid<CodeClassifyTemplateAttrVO> gridCodeClassifyTemplateAttr(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | String tenantId = AuthUtil.getTenantId().toString(); |
| | | Map<String, String> conditionMap = baseQueryObject.getConditionMap(); |
| | | /*if(Func.isNotEmpty(tenantId)){ |
| | | conditionMap.put("TENANT_ID",tenantId); |
| | | }*/ |
| | | return CodeClstempattrService.gridCodeClassifyTemplateAttr(conditionMap,baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * å¢å 主é¢åºåç±»çæ¨¡æ¿å±æ§ |
| | | * @param codeClassifyTemplateAttrDTO 主é¢åºåç±»çæ¨¡æ¿å±æ§æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping( "/addSave") |
| | | public R<CodeClassifyTemplateAttrVO> addSave(@RequestBody CodeClassifyTemplateAttrDTO codeClassifyTemplateAttrDTO){ |
| | | CodeClassifyTemplateAttrVO codeClassifyTemplateAttrVO = CodeClstempattrService.addSave(codeClassifyTemplateAttrDTO); |
| | | return R.data(codeClassifyTemplateAttrVO); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éä¿ååè¡¨æ°æ® |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @PostMapping( "/batchAddSave") |
| | | public R<List<CodeClassifyTemplateAttrVO>> batchAddSaves(@RequestBody List<CodeClassifyTemplateAttrDTO> list){ |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return R.fail("å表ä¸è½ä¸ºç©º!"); |
| | | } |
| | | List<CodeClassifyTemplateAttrVO> codeClassifyTemplateAttrVOs = CodeClstempattrService.batchAddSave(list); |
| | | return R.data(codeClassifyTemplateAttrVOs); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ ä¸»é¢åºåç±»çæ¨¡æ¿å±æ§ |
| | | * @param codeClassifyTemplateAttrDTO 主é¢åºåç±»çæ¨¡æ¿å±æ§æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public R<CodeClassifyTemplateAttrVO> editSave(@RequestBody CodeClassifyTemplateAttrDTO codeClassifyTemplateAttrDTO){ |
| | | return CodeClstempattrService.editSave(codeClassifyTemplateAttrDTO); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¸»é¢åºåç±»çæ¨¡æ¿å±æ§ |
| | | * @param codeClassifyTemplateAttrDTO 主é¢åºåç±»çæ¨¡æ¿å±æ§æ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | public R delCodeClassifyTemplateAttr(@RequestBody CodeClassifyTemplateAttrDTO codeClassifyTemplateAttrDTO) { |
| | | return CodeClstempattrService.deleteCodeClassifyTemplateAttr(codeClassifyTemplateAttrDTO); |
| | | } |
| | | |
| | | /** |
| | | * 主é®è·å主é¢åºåç±»çæ¨¡æ¿å±æ§ |
| | | * @param oid ä¸»é® |
| | | * @return 主é¢åºåç±»çæ¨¡æ¿å±æ§æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @GetMapping("/getObjectByOid") |
| | | public R<CodeClassifyTemplateAttrVO> getObjectByOid(String oid){ |
| | | CodeClassifyTemplateAttrVO codeClassifyTemplateAttrVO = CodeClstempattrService.getObjectByOid(oid); |
| | | return R.data(codeClassifyTemplateAttrVO); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·å主é¢åºåç±»çæ¨¡æ¿å±æ§ |
| | | * @param oids 主é®ï¼å¤ä¸ªä»¥éå·åéï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return 主é¢åºåç±»çæ¨¡æ¿å±æ§æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public R listCodeClassifyTemplateAttrByOids(String oids){ |
| | | Collection<CodeClassifyTemplateAttrVO> voCollection = CodeClstempattrService.listCodeClassifyTemplateAttrByOids(VciBaseUtil.str2List(oids)); |
| | | // BaseResult baseResult = BaseResult.success(); |
| | | // baseResult.setData(voCollection); |
| | | return R.data(voCollection); |
| | | } |
| | | |
| | | /** |
| | | * åç
§ä¸»é¢åºåç±»çæ¨¡æ¿å±æ§å表 |
| | | * @param baseQueryObject åºç¡æ¥è¯¢å¯¹è±¡ï¼å
嫿¥è¯¢æ¡ä»¶ï¼åé¡µï¼æåºç |
| | | * @return 主é¢åºåç±»çæ¨¡æ¿å±æ§æ¾ç¤ºå¯¹è±¡å表ï¼çæçå
容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | public IPage<CodeClassifyTemplateAttrVO> refDataGridCodeClassifyTemplateAttr(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return CodeClstempattrService.refDataGridCodeClassifyTemplateAttr(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è¿ä¸ªä¸å¡ç±»åä¸çææå±æ§,æé¤æè¿ä¸ªæ¨¡æ¿å·²ç»åå¨ç屿§ |
| | | * @param baseQueryObject |
| | | * @return |
| | | */ |
| | | @GetMapping("/codeClassifyTemplateAttrByBtm") |
| | | public DataGrid<BtmTypeAttributeVO> codeClassifyTemplateAttrByBtm(BaseQueryObject baseQueryObject){ |
| | | return CodeClstempattrService.codeClassifyTemplateAttrByBtm(baseQueryObject); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è¿ä¸ªä¸å¡ç±»åä¸ãè¿ä¸ªæ¨¡æ¿å·²ç»åå¨ç屿§ |
| | | * @param baseQueryObject |
| | | * @return |
| | | */ |
| | | @GetMapping("/codeClassifyTemplateAttrByBtmHave") |
| | | public DataGrid<BtmTypeAttributeVO> codeClassifyTemplateAttrByBtmHave(BaseQueryObject baseQueryObject){ |
| | | return CodeClstempattrService.codeClassifyTemplateAttrByBtmHave(baseQueryObject); |
| | | } |
| | | |
| | | /** |
| | | * 忥å°å
¶ä»æ¨¡æ¿ |
| | | * @param codeClassifyAttrDTO id è±æåç§° |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @PostMapping( "/copyto") |
| | | public R copyto(@RequestBody CodeClassifyTemplateAttrDTO codeClassifyAttrDTO) { |
| | | return CodeClstempattrService.copyto(codeClassifyAttrDTO); |
| | | } |
| | | |
| | | |
| | | } |