| | |
| | | private final FlowCommonService flowCommonService; |
| | | public void uploadFlowProgramFile(ProgramUploadVO uploadVO) { |
| | | |
| | | Map<String, Object> vars = runtimeService.getVariables(uploadVO.getProcessInstanceId()); |
| | | checkFilenames(uploadVO.getFiles(),flowCommonService.getProgramProperties(uploadVO.getProcessInstanceId())); |
| | | //Map<String, Object> vars = runtimeService.getVariables(uploadVO.getProcessInstanceId()); |
| | | |
| | | FlowProgramProperties progProps= flowCommonService.getProgramProperties(uploadVO.getProcessInstanceId()); |
| | | checkFilenames(uploadVO.getFiles(),progProps); |
| | | |
| | | String programName = getProgramName(progProps); |
| | | for(MultipartFile file : uploadVO.getFiles()) { |
| | | BladeFile bfile = ossTemplate.putFile(file); |
| | | |
| | | FlowProgramFile progFile = new FlowProgramFile(); |
| | | progFile.setName(file.getOriginalFilename()); |
| | | progFile.setOssName(bfile.getName()); |
| | | progFile.setProcessInstanceId(uploadVO.getProcessInstanceId()); |
| | | |
| | | progFile.setProgramName(programName); |
| | | |
| | | save(progFile); |
| | | } |
| | | // |
| | | //BladeFile bfile = ossTemplate.putFile(uploadVO.getFile()); |
| | | //String link = bfile.getLink(); |
| | |
| | | */ |
| | | } |
| | | |
| | | String getProgramName(FlowProgramProperties progProps){ |
| | | return progProps.getDrawingNo()+"-"+progProps.getProcessNo(); |
| | | } |
| | | |
| | | public void checkFilenames(MultipartFile[] files,FlowProgramProperties programProperties){ |
| | | for (MultipartFile file : files){ |
| | | checkFilename(file.getOriginalFilename(),programProperties); |