|
|
@ -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);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|