| | |
| | | |
| | | 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.CodeClstempattrWrapper; |
| | | 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 org.springblade.core.mp.support.Query; |
| | | 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; |
| | | |
| | | /** |
| | | * 编码库定义-模板属性 控制器 |
| | |
| | | @ApiOperation(value = "详情", notes = "传入CodeClstempattr") |
| | | public R<CodeClassifyTemplateAttrVO> detail(CodeClassifyTemplateAttr CodeClstempattr) { |
| | | CodeClassifyTemplateAttr detail = CodeClstempattrService.getOne(Condition.getQueryWrapper(CodeClstempattr)); |
| | | return R.data(CodeClstempattrWrapper.build().entityVO(detail)); |
| | | return R.data(CodeClassifyTemplateAttrWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * 编码库定义-模板属性 分页 |
| | |
| | | @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(CodeClstempattrWrapper.build().pageVO(pages)); |
| | | return R.data(CodeClassifyTemplateAttrWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 主题库分类的模板属性列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 主题库分类的模板属性显示对象列表 |
| | | */ |
| | | @GetMapping("/gridCodeClassifyTemplateAttr") |
| | | public DataGrid<CodeClassifyTemplateAttrVO> gridCodeClassifyTemplateAttr(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return CodeClstempattrService.gridCodeClassifyTemplateAttr(baseQueryObject.getConditionMap(),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); |
| | | } |
| | | |
| | | |
| | | } |