| | |
| | | /* |
| | | * 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.CodeTemplatePhaseServiceI; |
| | | 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.vci.ubcs.code.dto.CodeTemplatePhaseDTO; |
| | | import com.vci.ubcs.code.service.ICodeTempphaseService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateAttrVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeTemplatePhaseVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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 lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Collection; |
| | | |
| | | |
| | | /** |
| | | * 模板阶段控制器 |
| | | * 编码库定义-模板阶段 控制器 |
| | | * |
| | | * @author weidy |
| | | * @date 2022-01-24 |
| | | * @author ludc |
| | | * @since 2023-05-07 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/codeTempPhaseController") |
| | | public class CodeTemplatePhaseController { |
| | | /** |
| | | * 模板阶段 服务 |
| | | */ |
| | | @Autowired |
| | | private CodeTemplatePhaseServiceI codeTemplatePhaseService; |
| | | @Api(value = "编码库定义-模板阶段", tags = "编码库定义-模板阶段接口") |
| | | public class CodeTemplatePhaseController extends BladeController { |
| | | |
| | | /** |
| | | * 模板阶段列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 模板阶段显示对象列表 |
| | | */ |
| | | @GetMapping("/gridCodeTemplatePhase") |
| | | public DataGrid<CodeTemplatePhaseVO> gridCodeTemplatePhase(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeTemplatePhaseService.gridCodeTemplatePhase(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | /** |
| | | * 增加 模板阶段 |
| | | * @param codeTemplatePhaseDTO 模板阶段数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PostMapping( "/addSave") |
| | | public BaseResult<CodeTemplatePhaseVO> addSave(@RequestBody CodeTemplatePhaseDTO codeTemplatePhaseDTO){ |
| | | CodeTemplatePhaseVO codeTemplatePhaseVO = codeTemplatePhaseService.addSave(codeTemplatePhaseDTO); |
| | | return BaseResult.success(codeTemplatePhaseVO); |
| | | } |
| | | /** |
| | | * 模板阶段 服务 |
| | | */ |
| | | private final ICodeTempphaseService codeTemplatePhaseService; |
| | | |
| | | /** |
| | | * 修改 模板阶段 |
| | | * @param codeTemplatePhaseDTO 模板阶段数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public BaseResult<CodeTemplatePhaseVO> editSave(@RequestBody CodeTemplatePhaseDTO codeTemplatePhaseDTO){ |
| | | CodeTemplatePhaseVO codeTemplatePhaseVO = codeTemplatePhaseService.editSave(codeTemplatePhaseDTO); |
| | | return BaseResult.success(codeTemplatePhaseVO); |
| | | } |
| | | /** |
| | | * 模板阶段列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 模板阶段显示对象列表 |
| | | */ |
| | | @GetMapping("/gridCodeTemplatePhase") |
| | | public R<IPage<CodeTemplatePhaseVO>> gridCodeTemplatePhase(BaseQueryObject baseQueryObject){ |
| | | return R.data(codeTemplatePhaseService.gridCodeTemplatePhase(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper())); |
| | | } |
| | | |
| | | /** |
| | | * 增加 模板阶段 |
| | | * @param codeTemplatePhaseDTO 模板阶段数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PostMapping( "/addSave") |
| | | public R<CodeTemplatePhaseVO> addSave(@Valid @RequestBody CodeTemplatePhaseDTO codeTemplatePhaseDTO){ |
| | | return R.data(codeTemplatePhaseService.addSave(codeTemplatePhaseDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 删除模板阶段 |
| | | * @param codeTemplatePhaseDTO 模板阶段数据传输对象,oid和ts需要传输 |
| | | * @return 删除结果反馈::success:成功,fail:失败 |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | public BaseResult delCodeTemplatePhase( CodeTemplatePhaseDTO codeTemplatePhaseDTO) { |
| | | return codeTemplatePhaseService.deleteCodeTemplatePhase(codeTemplatePhaseDTO); |
| | | } |
| | | /** |
| | | * 修改 模板阶段 |
| | | * @param codeTemplatePhaseDTO 模板阶段数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public R<CodeTemplatePhaseVO> editSave(@Valid @RequestBody CodeTemplatePhaseDTO codeTemplatePhaseDTO){ |
| | | return R.data(codeTemplatePhaseService.editSave(codeTemplatePhaseDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 主键获取模板阶段 |
| | | * @param oid 主键 |
| | | * @return 模板阶段显示对象 |
| | | */ |
| | | @GetMapping("/getObjectByOid") |
| | | public BaseResult<CodeTemplatePhaseVO> getObjectByOid(String oid){ |
| | | CodeTemplatePhaseVO codeTemplatePhaseVO = codeTemplatePhaseService.getObjectByOid(oid); |
| | | return BaseResult.success(codeTemplatePhaseVO); |
| | | } |
| | | /** |
| | | * 删除模板阶段 |
| | | * @param codeTemplatePhaseDTO 模板阶段数据传输对象,oid和ts需要传输 |
| | | * @return 删除结果反馈::success:成功,fail:失败 |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | public R delCodeTemplatePhase(@Valid @RequestBody CodeTemplatePhaseDTO codeTemplatePhaseDTO) { |
| | | return codeTemplatePhaseService.deleteCodeTemplatePhase(codeTemplatePhaseDTO); |
| | | } |
| | | |
| | | /** |
| | | * 主键批量获取模板阶段 |
| | | * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个 |
| | | * @return 模板阶段显示对象 |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public BaseResult<CodeTemplatePhaseVO> listCodeTemplatePhaseByOids(String oids){ |
| | | Collection<CodeTemplatePhaseVO> voCollection = codeTemplatePhaseService.listCodeTemplatePhaseByOids(VciBaseUtil.str2List(oids)); |
| | | BaseResult baseResult = BaseResult.success(); |
| | | baseResult.setData(voCollection); |
| | | return baseResult; |
| | | } |
| | | /** |
| | | * 主键获取模板阶段 |
| | | * @param oid 主键 |
| | | * @return 模板阶段显示对象 |
| | | */ |
| | | @GetMapping("/getObjectByOid") |
| | | public R<CodeTemplatePhaseVO> getObjectByOid(String oid){ |
| | | CodeTemplatePhaseVO codeTemplatePhaseVO = codeTemplatePhaseService.getObjectByOid(oid); |
| | | return R.data(codeTemplatePhaseVO); |
| | | } |
| | | |
| | | /** |
| | | * 主键批量获取模板阶段 |
| | | * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个 |
| | | * @return 模板阶段显示对象 |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public R<Collection<CodeTemplatePhaseVO>> listCodeTemplatePhaseByOids(String oids){ |
| | | Collection<CodeTemplatePhaseVO> voCollection = codeTemplatePhaseService.listCodeTemplatePhaseByOids(VciBaseUtil.str2List(oids)); |
| | | return R.data(voCollection); |
| | | } |
| | | |
| | | /** |
| | | * 参照模板阶段列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 模板阶段显示对象列表,生效的内容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | public IPage<CodeTemplatePhaseVO> refDataGridCodeTemplatePhase(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeTemplatePhaseService.refDataGridCodeTemplatePhase(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * 参照模板阶段列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 模板阶段显示对象列表,生效的内容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | public DataGrid<CodeTemplatePhaseVO> refDataGridCodeTemplatePhase(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeTemplatePhaseService.refDataGridCodeTemplatePhase(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | /** |
| | | * 获取阶段中没有使用的模板属性 |
| | | * @param baseQueryObject 查询对象,必须要有模板的主键(classifyTemplateOid),否则不能确定属性 |
| | | * @return 属性的信息 |
| | | */ |
| | | @GetMapping("/gridUnUsedAttribute") |
| | | public R<IPage<CodeClassifyTemplateAttrVO>> gridUnUsedAttribute(BaseQueryObject baseQueryObject){ |
| | | return R.data(codeTemplatePhaseService.gridUnUsedAttribute(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper())); |
| | | } |
| | | |
| | | /** |
| | | * 获取阶段中没有使用的模板属性 |
| | | * @param baseQueryObject 查询对象,必须要有模板的主键(classifyTemplateOid),否则不能确定属性 |
| | | * @return 属性的信息 |
| | | */ |
| | | @GetMapping("/gridUnUsedAttribute") |
| | | public DataGrid<CodeClassifyTemplateAttrVO> gridUnUsedAttribute(BaseQueryObject baseQueryObject){ |
| | | return codeTemplatePhaseService.gridUnUsedAttribute(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * 获取阶段中使用的模板属性 |
| | | * @param baseQueryObject 查询对象,必须要阶段的主键(codePhaseOid) |
| | | * @return 属性的信息 |
| | | */ |
| | | @GetMapping("/gridUsedAttribute") |
| | | public DataGrid<CodeClassifyTemplateAttrVO> gridUsedAttribute(BaseQueryObject baseQueryObject){ |
| | | return codeTemplatePhaseService.gridUsedAttribute(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * 获取阶段中使用的模板属性 |
| | | * @param baseQueryObject 查询对象,必须要阶段的主键(codePhaseOid) |
| | | * @return 属性的信息 |
| | | */ |
| | | @GetMapping("/gridUsedAttribute") |
| | | public R<IPage<CodeClassifyTemplateAttrVO>> gridUsedAttribute(BaseQueryObject baseQueryObject){ |
| | | return R.data(codeTemplatePhaseService.gridUsedAttribute(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper())); |
| | | } |
| | | |
| | | } |