From 7d0e869bdc1dc0503eb71d3ec1b102c5d7f58ad6 Mon Sep 17 00:00:00 2001 From: "LAPTOP-0SF788NU\\admin" <3306174053@qq.com> Date: Tue, 10 Oct 2023 17:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B6=E8=A1=8C=E5=9B=9E=E5=8D=95=E5=8F=8A?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B=E5=AD=97=E6=AE=B5=E6=96=B0?= =?UTF-8?q?=E5=A2=9E,=E4=B8=8A=E4=BC=A0=E5=AE=A1=E6=89=B9=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=9B=BE=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/sqlserver/20231010JS.sql | 7 +++++ .../controller/admin/flow/FlowController.java | 30 +++++++++---------- 2 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 sql/sqlserver/20231010JS.sql diff --git a/sql/sqlserver/20231010JS.sql b/sql/sqlserver/20231010JS.sql new file mode 100644 index 00000000..c0ad56c8 --- /dev/null +++ b/sql/sqlserver/20231010JS.sql @@ -0,0 +1,7 @@ +-- 银行回单及审批流程字段新增 +ALTER TABLE archives_bank_slip ADD COLUMN `staff_id` bigint(20) NULL DEFAULT NULL COMMENT '认款员工id'; +ALTER TABLE archives_bank_slip ADD COLUMN `staff_name` varchar(64) NULL DEFAULT NULL COMMENT '认款员工名称'; +ALTER TABLE archives_bank_slip ADD COLUMN `subscription_status` varchar(64) NULL DEFAULT NULL COMMENT '认款状态 0:未认款 1 已认款'; +ALTER TABLE archives_flow ADD COLUMN `password` varchar(64) NULL DEFAULT NULL COMMENT '密码'; + + diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/flow/FlowController.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/flow/FlowController.java index de824e6c..2e2eb409 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/flow/FlowController.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/flow/FlowController.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.accounting.controller.admin.flow; +import cn.hutool.core.io.IoUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; @@ -9,6 +10,8 @@ import cn.iocoder.yudao.module.accounting.controller.admin.flow.vo.*; import cn.iocoder.yudao.module.accounting.convert.flow.FlowConvert; import cn.iocoder.yudao.module.accounting.dal.dataobject.flow.FlowDO; import cn.iocoder.yudao.module.accounting.service.flow.FlowService; +import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO; +import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.service.file.FileService; import cn.iocoder.yudao.module.setting.service.passwords.PasswordsService; import com.alibaba.druid.util.StringUtils; @@ -53,28 +56,23 @@ public class FlowController { @Operation(summary = "创建审批流程") @PreAuthorize("@ss.hasPermission('archives:flow:create')") public CommonResult createFlow(@Valid @RequestBody FlowCreateReqVO createReqVO) { + createReqVO.setFlowCode(execute()); return success(flowService.createFlow(createReqVO)); } - /** - * 账簿上传 - */ + @PostMapping("/upload") - @Operation(summary = "上传审批流程图") + @Operation(summary = "上传审批流程img") + @Parameter(name = "multipartFile", description = "文件", required = true) @PreAuthorize("@ss.hasPermission('archives:flow:create')") - public Long uploadAccountingBook(@RequestPart("multipartFile") MultipartFile multipartFile) { - FlowCreateReqVO vo = new FlowCreateReqVO(); - try { - String uri = fileService.createFile(multipartFile.getName(), multipartFile.getOriginalFilename(), multipartFile.getBytes()); - vo.setSuffix(multipartFile.getOriginalFilename()) - .setFileUrl(uri) - .setFileAp(uri) - .setFlowCode(execute()); - }catch (Exception e){ - e.printStackTrace(); - } - return flowService.createFlow(vo); + public CommonResult upload(@RequestParam("multipartFile") MultipartFile multipartFile) throws IOException { + String fileUrl = fileService.createFile(multipartFile.getOriginalFilename(), null, IoUtil.readBytes(multipartFile.getInputStream())); + FilePageReqVO pageReqVO = new FilePageReqVO(); + String lastSegment = fileUrl.substring(fileUrl.lastIndexOf("/") + 1); + pageReqVO.setPath(lastSegment); + PageResult filePage = fileService.getFilePage(pageReqVO); + return success(filePage.getList().get(0)); } /**