| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.code.dto.CodeClstempattrDTO; |
| | | import com.vci.ubcs.code.entity.CodeClstempattrEntity; |
| | | import com.vci.ubcs.code.service.ICodeClstempattrService; |
| | | import com.vci.ubcs.code.vo.CodeClstempattrVO; |
| | | import com.vci.ubcs.code.vo.CodeOsbtmtypeattributeVO; |
| | | import com.vci.ubcs.code.wrapper.CodeClstempattrWrapper; |
| | | 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; |
| | | |
| | | /** |
| | | * 编码库定义-模板属性 控制器 |
| | |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/CodeClstempattr") |
| | | @RequestMapping("/codeClassifyTempAttrController") |
| | | @Api(value = "编码库定义-模板属性", tags = "编码库定义-模板属性接口") |
| | | public class CodeClstempattrController extends BladeController { |
| | | |
| | | private final ICodeClstempattrService CodeClstempattrService; |
| | | private final ICodeClstempattrService codeClstempattrService; |
| | | |
| | | /** |
| | | * 编码库定义-模板属性 详情 |
| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入CodeClstempattr") |
| | | public R<CodeClstempattrVO> detail(CodeClstempattrEntity CodeClstempattr) { |
| | | CodeClstempattrEntity detail = CodeClstempattrService.getOne(Condition.getQueryWrapper(CodeClstempattr)); |
| | | CodeClstempattrEntity detail = codeClstempattrService.getOne(Condition.getQueryWrapper(CodeClstempattr)); |
| | | return R.data(CodeClstempattrWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入CodeClstempattr") |
| | | public R<IPage<CodeClstempattrVO>> list(CodeClstempattrEntity CodeClstempattr, Query query) { |
| | | IPage<CodeClstempattrEntity> pages = CodeClstempattrService.page(Condition.getPage(query), Condition.getQueryWrapper(CodeClstempattr)); |
| | | IPage<CodeClstempattrEntity> pages = codeClstempattrService.page(Condition.getPage(query), Condition.getQueryWrapper(CodeClstempattr)); |
| | | return R.data(CodeClstempattrWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入CodeClstempattr") |
| | | public R<IPage<CodeClstempattrVO>> page(CodeClstempattrVO CodeClstempattr, Query query) { |
| | | IPage<CodeClstempattrVO> pages = CodeClstempattrService.selectCodeClstempattrPage(Condition.getPage(query), CodeClstempattr); |
| | | IPage<CodeClstempattrVO> pages = codeClstempattrService.selectCodeClstempattrPage(Condition.getPage(query), CodeClstempattr); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入CodeClstempattr") |
| | | public R save(@Valid @RequestBody CodeClstempattrEntity CodeClstempattr) { |
| | | return R.status(CodeClstempattrService.save(CodeClstempattr)); |
| | | return R.status(codeClstempattrService.save(CodeClstempattr)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入CodeClstempattr") |
| | | public R update(@Valid @RequestBody CodeClstempattrEntity CodeClstempattr) { |
| | | return R.status(CodeClstempattrService.updateById(CodeClstempattr)); |
| | | return R.status(codeClstempattrService.updateById(CodeClstempattr)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入CodeClstempattr") |
| | | public R submit(@Valid @RequestBody CodeClstempattrEntity CodeClstempattr) { |
| | | return R.status(CodeClstempattrService.saveOrUpdate(CodeClstempattr)); |
| | | return R.status(codeClstempattrService.saveOrUpdate(CodeClstempattr)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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))); |
| | | return R.status(codeClstempattrService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 主题库分类的模板属性列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 主题库分类的模板属性显示对象列表 |
| | | */ |
| | | @GetMapping("/gridCodeClassifyTemplateAttr") |
| | | public DataGrid<CodeClstempattrVO> 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<CodeClstempattrVO> addSave(@RequestBody CodeClstempattrDTO codeClassifyTemplateAttrDTO){ |
| | | CodeClstempattrVO codeClassifyTemplateAttrVO = codeClstempattrService.addSave(codeClassifyTemplateAttrDTO); |
| | | return R.data(codeClassifyTemplateAttrVO); |
| | | } |
| | | |
| | | /** |
| | | * 批量保存列表数据 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @PostMapping( "/batchAddSave") |
| | | public R<List<CodeClstempattrVO>> batchAddSaves(@RequestBody List<CodeClstempattrDTO> list){ |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return R.fail("列表不能为空!"); |
| | | } |
| | | List<CodeClstempattrVO> codeClassifyTemplateAttrVOs = codeClstempattrService.batchAddSave(list); |
| | | return R.data(codeClassifyTemplateAttrVOs); |
| | | } |
| | | |
| | | /** |
| | | * 修改 主题库分类的模板属性 |
| | | * @param codeClassifyTemplateAttrDTO 主题库分类的模板属性数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public R<CodeClstempattrVO> editSave(@RequestBody CodeClstempattrDTO codeClassifyTemplateAttrDTO){ |
| | | return codeClstempattrService.editSave(codeClassifyTemplateAttrDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除主题库分类的模板属性 |
| | | * @param codeClassifyTemplateAttrDTO 主题库分类的模板属性数据传输对象,oid和ts需要传输 |
| | | * @return 删除结果反馈::success:成功,fail:失败 |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | public R delCodeClassifyTemplateAttr(@RequestBody CodeClstempattrDTO codeClassifyTemplateAttrDTO) { |
| | | return codeClstempattrService.deleteCodeClassifyTemplateAttr(codeClassifyTemplateAttrDTO); |
| | | } |
| | | |
| | | /** |
| | | * 主键获取主题库分类的模板属性 |
| | | * @param oid 主键 |
| | | * @return 主题库分类的模板属性显示对象 |
| | | */ |
| | | @GetMapping("/getObjectByOid") |
| | | public R<CodeClstempattrVO> getObjectByOid(String oid){ |
| | | CodeClstempattrVO codeClassifyTemplateAttrVO = codeClstempattrService.getObjectByOid(oid); |
| | | return R.data(codeClassifyTemplateAttrVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 主键批量获取主题库分类的模板属性 |
| | | * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个 |
| | | * @return 主题库分类的模板属性显示对象 |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public R listCodeClassifyTemplateAttrByOids(String oids){ |
| | | Collection<CodeClstempattrVO> voCollection = codeClstempattrService.listCodeClassifyTemplateAttrByOids(VciBaseUtil.str2List(oids)); |
| | | // BaseResult baseResult = BaseResult.success(); |
| | | // baseResult.setData(voCollection); |
| | | return R.data(voCollection); |
| | | } |
| | | |
| | | /** |
| | | * 参照主题库分类的模板属性列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 主题库分类的模板属性显示对象列表,生效的内容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | public DataGrid<CodeClstempattrVO> refDataGridCodeClassifyTemplateAttr(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeClstempattrService.refDataGridCodeClassifyTemplateAttr(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * 查询这个业务类型下的所有属性,排除掉这个模板已经存在的属性 |
| | | * @param baseQueryObject |
| | | * @return |
| | | */ |
| | | @GetMapping("/codeClassifyTemplateAttrByBtm") |
| | | public DataGrid<CodeOsbtmtypeattributeVO> codeClassifyTemplateAttrByBtm(BaseQueryObject baseQueryObject){ |
| | | return codeClstempattrService.codeClassifyTemplateAttrByBtm(baseQueryObject); |
| | | } |
| | | |
| | | /** |
| | | * 查询这个业务类型下、这个模板已经存在的属性 |
| | | * @param baseQueryObject |
| | | * @return |
| | | */ |
| | | @GetMapping("/codeClassifyTemplateAttrByBtmHave") |
| | | public DataGrid<CodeOsbtmtypeattributeVO> codeClassifyTemplateAttrByBtmHave(BaseQueryObject baseQueryObject){ |
| | | return codeClstempattrService.codeClassifyTemplateAttrByBtmHave(baseQueryObject); |
| | | } |
| | | |
| | | /** |
| | | * 同步到其他模板 |
| | | * @param codeClassifyAttrDTO id 英文名称 |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping( "/copyto") |
| | | public R copyto(@RequestBody CodeClstempattrDTO codeClassifyAttrDTO) { |
| | | return codeClstempattrService.copyto(codeClassifyAttrDTO); |
| | | } |
| | | |
| | | } |