| | |
| | | import cn.iocoder.yudao.module.mes.controller.admin.pd.document.vo.MesPdDocumentSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.pd.document.MesPdDocumentDO; |
| | | import cn.iocoder.yudao.module.mes.service.pd.document.MesPdDocumentService; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| | | import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | |
| | | @Resource |
| | | private AdminUserApi adminUserApi; |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建设计资料") |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得设计资料") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('mes:pd-document:query')") |
| | | public CommonResult<MesPdDocumentRespVO> getDocument(@RequestParam("id") Long id) { |
| | | MesPdDocumentDO document = documentService.getDocument(id); |
| | | if (document == null) { |
| | | return success(null); |
| | | } |
| | | return success(buildDocumentRespVOList(Collections.singletonList(document)).get(0)); |
| | | MesPdDocumentRespVO respVO = buildDocumentRespVOList(Collections.singletonList(document)).get(0); |
| | | respVO.setAttachmentList(storageAttachmentApi.listAttachments("mes_pd_document", id)); |
| | | return success(respVO); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得设计资料分页") |
| | | @PreAuthorize("@ss.hasPermission('mes:pd-document:query')") |
| | | public CommonResult<PageResult<MesPdDocumentRespVO>> getDocumentPage(@Valid MesPdDocumentPageReqVO pageReqVO) { |
| | | PageResult<MesPdDocumentDO> pageResult = documentService.getDocumentPage(pageReqVO); |
| | | return success(new PageResult<>(buildDocumentRespVOList(pageResult.getList()), pageResult.getTotal())); |