¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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.CodeClassifyTemplateDTO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyTemplate; |
| | | import com.vci.ubcs.code.enumpack.CodeClassifyTemplateLC; |
| | | import com.vci.ubcs.code.mapper.CodeClassifyTemplateMapper; |
| | | import com.vci.ubcs.code.service.ICodeClstemplateService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateVO; |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.code.wrapper.CodeClassifyTemplateWrapper; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.DataGrid; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | 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.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç æ§å¶å¨ |
| | | * |
| | | * @author yuxc |
| | | * @since 2023-04-10 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/codeClassifyTemplateController") |
| | | @Api(value = "ç¼ç åºå®ä¹-模æ¿ç®¡ç", tags = "ç¼ç åºå®ä¹-模æ¿ç®¡çæ¥å£") |
| | | public class CodeClassifyTemplateController extends BladeController { |
| | | |
| | | private final ICodeClstemplateService plCodeClstemplateService; |
| | | |
| | | CodeClassifyTemplateMapper codeClassifyTemplateMapper; |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥plCodeClstemplate") |
| | | public R<CodeClassifyTemplateVO> detail(CodeClassifyTemplate plCodeClstemplate) { |
| | | CodeClassifyTemplate detail = plCodeClstemplateService.getOne(Condition.getQueryWrapper(plCodeClstemplate)); |
| | | return R.data(CodeClassifyTemplateWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç å页,å类模æ¿å表对åºä»¥åå¹³å°çgridCodeClassifyTemplate |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥plCodeClstemplate") |
| | | public R<IPage<CodeClassifyTemplateVO>> list(CodeClassifyTemplate plCodeClstemplate, Query query) { |
| | | IPage<CodeClassifyTemplate> pages = plCodeClstemplateService.page(Condition.getPage(query), Condition.getQueryWrapper(plCodeClstemplate)); |
| | | return R.data(CodeClassifyTemplateWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç èªå®ä¹å页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥plCodeClstemplate") |
| | | public R<IPage<CodeClassifyTemplateVO>> page(CodeClassifyTemplateVO plCodeClstemplate, Query query) { |
| | | IPage<CodeClassifyTemplateVO> pages = plCodeClstemplateService.selectPlCodeClstemplatePage(Condition.getPage(query), plCodeClstemplate); |
| | | return R.data(pages); |
| | | } |
| | | /** |
| | | * å
é |
| | | * @param codeClassifyDTO |
| | | * @return oid模æ¿oid |
| | | */ |
| | | @PostMapping( "/copy") |
| | | public R copyTemplate(@RequestBody CodeClassifyTemplateDTO codeClassifyDTO) { |
| | | |
| | | return plCodeClstemplateService.copyTemplate(codeClassifyDTO); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ å类模æ¿å¯¹è±¡ |
| | | * @param codeClassifyTemplateDTO å类模æ¿å¯¹è±¡æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public R<CodeClassifyTemplateVO> editSave(@RequestBody CodeClassifyTemplateDTO codeClassifyTemplateDTO){ |
| | | return plCodeClstemplateService.editSave(codeClassifyTemplateDTO); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç æ°å¢ |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥plCodeClstemplate") |
| | | public R save(@Valid @RequestBody CodeClassifyTemplate plCodeClstemplate) { |
| | | return R.status(plCodeClstemplateService.save(plCodeClstemplate)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç ä¿®æ¹ |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥plCodeClstemplate") |
| | | public R update(@Valid @RequestBody CodeClassifyTemplate plCodeClstemplate) { |
| | | return R.status(plCodeClstemplateService.updateById(plCodeClstemplate)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç æ°å¢æä¿®æ¹ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥plCodeClstemplate") |
| | | public R submit(@Valid @RequestBody CodeClassifyTemplate plCodeClstemplate) { |
| | | return R.status(plCodeClstemplateService.saveOrUpdate(plCodeClstemplate)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç åºå®ä¹-模æ¿ç®¡ç å é¤ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(SqlHelper.retBool(codeClassifyTemplateMapper.deleteBatchIds(Func.toLongList(ids)))); |
| | | } |
| | | |
| | | /** |
| | | * å类模æ¿å¯¹è±¡æ |
| | | * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ |
| | | * @return å类模æ¿å¯¹è±¡æ¾ç¤ºæ |
| | | */ |
| | | @GetMapping("/treeCodeClassifyTemplate") |
| | | public List<Tree> treeCodeClassifyTemplate(TreeQueryObject treeQueryObject) { |
| | | return plCodeClstemplateService.treeCodeClassifyTemplate(treeQueryObject); |
| | | } |
| | | |
| | | /** |
| | | * å类模æ¿å表 |
| | | * @param baseQueryObject åºç¡æ¥è¯¢å¯¹è±¡ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @GetMapping("/gridCodeClassifyTemplate") |
| | | public DataGrid<CodeClassifyTemplateVO> gridCodeClassifyTemplate(BaseQueryObject baseQueryObject){ |
| | | |
| | | return plCodeClstemplateService.gridCodeClassifyTemplate(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ£æ¥ å类模æ¿å¯¹è±¡æ¯å¦å é¤ |
| | | * @param codeClstemplateDTO å类模æ¿å¯¹è±¡æ°æ®ä¼ è¾å¯¹è±¡ï¼å¿
é¡»è¦æoidåts屿§ |
| | | * @return æ§è¡ç»æ success为true为å¯ä»¥å é¤ï¼falseè¡¨ç¤ºææ°æ®å¼ç¨ï¼obj为true表示æä¸çº§ |
| | | */ |
| | | @PostMapping( "/checkIsCanDelete") |
| | | public R checkIsCanDelete(@RequestBody CodeClassifyTemplateDTO codeClstemplateDTO) { |
| | | |
| | | return plCodeClstemplateService.checkIsCanDelete(codeClstemplateDTO); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å类模æ¿å¯¹è±¡ |
| | | * @param codeClstemplateDTO å类模æ¿å¯¹è±¡æ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return å é¤ç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | public R delCodeClassifyTemplate(@Valid @RequestBody CodeClassifyTemplateDTO codeClstemplateDTO) { |
| | | return plCodeClstemplateService.deleteCodeClassifyTemplate(codeClstemplateDTO); |
| | | } |
| | | |
| | | /** |
| | | * 主é®è·åå类模æ¿å¯¹è±¡ |
| | | * @param oid ä¸»é® |
| | | * @return å类模æ¿å¯¹è±¡æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @GetMapping("/getObjectByOid") |
| | | public R<CodeClassifyTemplateVO> getObjectByOid(String oid){ |
| | | CodeClassifyTemplateVO codeClassifyTemplateVO = plCodeClstemplateService.getObjectByOid(oid); |
| | | return R.data(codeClassifyTemplateVO); |
| | | } |
| | | |
| | | /** |
| | | * 䏻鮿¹éè·åå类模æ¿å¯¹è±¡ |
| | | * @param oids 主é®ï¼å¤ä¸ªä»¥éå·åéï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶
è¿10000个 |
| | | * @return å类模æ¿å¯¹è±¡æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public R<Collection<CodeClassifyTemplateVO>> listCodeClassifyTemplateByOids(String oids){ |
| | | Collection<CodeClassifyTemplateVO> voCollection = plCodeClstemplateService.listCodeClassifyTemplateByOids(VciBaseUtil.str2List(oids)); |
| | | |
| | | return R.data(voCollection) ; |
| | | } |
| | | |
| | | /** |
| | | * åç
§æ å类模æ¿å¯¹è±¡ |
| | | * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ |
| | | * @return å类模æ¿å¯¹è±¡æ¾ç¤ºæ |
| | | */ |
| | | @GetMapping("/referTree") |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) { |
| | | return plCodeClstemplateService.referTree(treeQueryObject); |
| | | } |
| | | /** |
| | | * å¢å å类模æ¿å¯¹è±¡ |
| | | * @param codeClassifyTemplateDTO å类模æ¿å¯¹è±¡æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping( "/addSave") |
| | | public R<CodeClassifyTemplateVO> addSave(@RequestBody CodeClassifyTemplateDTO codeClassifyTemplateDTO){ |
| | | return plCodeClstemplateService.addSave(codeClassifyTemplateDTO); |
| | | } |
| | | |
| | | /** |
| | | * å¯ç¨ |
| | | * @param codeClstemplateDTO oid |
| | | * @return |
| | | */ |
| | | @PostMapping( "/enableData") |
| | | public R enable( CodeClassifyTemplateDTO codeClstemplateDTO) { |
| | | return plCodeClstemplateService.updateLcStatus(codeClstemplateDTO.getOid(), CodeClassifyTemplateLC.RELEASED.getValue()); |
| | | } |
| | | |
| | | /** |
| | | * åç¨ |
| | | * @param codeClassifyDTO oid |
| | | * @return |
| | | */ |
| | | @PostMapping( "/disableData") |
| | | public R disableData( CodeClassifyTemplateDTO codeClassifyDTO) { |
| | | return plCodeClstemplateService.updateLcStatus(codeClassifyDTO.getOid(),CodeClassifyTemplateLC.DISABLED.getValue()); |
| | | } |
| | | |
| | | /** |
| | | * åç¼è¾ |
| | | * @param codeClassifyDTO oid |
| | | * @return |
| | | */ |
| | | @PostMapping( "/editDate") |
| | | public R editDate( CodeClassifyTemplateDTO codeClassifyDTO) { |
| | | return plCodeClstemplateService.updateLcStatus(codeClassifyDTO.getOid(),CodeClassifyTemplateLC.EDITING.getValue()); |
| | | } |
| | | |
| | | /** |
| | | * åç |
| | | * @param codeClassifyDTO |
| | | * @return oid模æ¿oid |
| | | */ |
| | | @PostMapping( "/upgrade") |
| | | public R Upgrade(@RequestBody CodeClassifyTemplateDTO codeClassifyDTO) { |
| | | |
| | | return plCodeClstemplateService.Upgrade(codeClassifyDTO); |
| | | } |
| | | } |