Merge remote-tracking branch 'origin/main'

new
JiilingLee 1 year ago
commit fb32fbf24b

@ -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 '';

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.accounting.controller.admin.flow; 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.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; 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.convert.flow.FlowConvert;
import cn.iocoder.yudao.module.accounting.dal.dataobject.flow.FlowDO; import cn.iocoder.yudao.module.accounting.dal.dataobject.flow.FlowDO;
import cn.iocoder.yudao.module.accounting.service.flow.FlowService; 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.infra.service.file.FileService;
import cn.iocoder.yudao.module.setting.service.passwords.PasswordsService; import cn.iocoder.yudao.module.setting.service.passwords.PasswordsService;
import com.alibaba.druid.util.StringUtils; import com.alibaba.druid.util.StringUtils;
@ -53,28 +56,23 @@ public class FlowController {
@Operation(summary = "创建审批流程") @Operation(summary = "创建审批流程")
@PreAuthorize("@ss.hasPermission('archives:flow:create')") @PreAuthorize("@ss.hasPermission('archives:flow:create')")
public CommonResult<Long> createFlow(@Valid @RequestBody FlowCreateReqVO createReqVO) { public CommonResult<Long> createFlow(@Valid @RequestBody FlowCreateReqVO createReqVO) {
createReqVO.setFlowCode(execute());
return success(flowService.createFlow(createReqVO)); return success(flowService.createFlow(createReqVO));
} }
/**
* 簿
*/
@PostMapping("/upload") @PostMapping("/upload")
@Operation(summary = "上传审批流程图") @Operation(summary = "上传审批流程img")
@Parameter(name = "multipartFile", description = "文件", required = true)
@PreAuthorize("@ss.hasPermission('archives:flow:create')") @PreAuthorize("@ss.hasPermission('archives:flow:create')")
public Long uploadAccountingBook(@RequestPart("multipartFile") MultipartFile multipartFile) { public CommonResult<FileDO> upload(@RequestParam("multipartFile") MultipartFile multipartFile) throws IOException {
FlowCreateReqVO vo = new FlowCreateReqVO(); String fileUrl = fileService.createFile(multipartFile.getOriginalFilename(), null, IoUtil.readBytes(multipartFile.getInputStream()));
try { FilePageReqVO pageReqVO = new FilePageReqVO();
String uri = fileService.createFile(multipartFile.getName(), multipartFile.getOriginalFilename(), multipartFile.getBytes()); String lastSegment = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
vo.setSuffix(multipartFile.getOriginalFilename()) pageReqVO.setPath(lastSegment);
.setFileUrl(uri) PageResult<FileDO> filePage = fileService.getFilePage(pageReqVO);
.setFileAp(uri) return success(filePage.getList().get(0));
.setFlowCode(execute());
}catch (Exception e){
e.printStackTrace();
}
return flowService.createFlow(vo);
} }
/** /**

Loading…
Cancel
Save