| | |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | | import org.jeecg.modules.dncFlow.entity.DispatchFile; |
| | | import org.jeecg.modules.dncFlow.service.IDispatchFileService; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.system.entity.SysParams; |
| | |
| | | @Autowired |
| | | @Lazy |
| | | private IGuideCardBatchService guideCardBatchService; |
| | | @Autowired |
| | | private IFlowMyBusinessService flowMyBusinessService; |
| | | @Autowired |
| | | private IFlowTaskService flowTaskService; |
| | | |
| | | /*备份处理*/ |
| | | @Override |
| | |
| | | ExceptionCast.cast(DocumentCode.DOC_CLASS_ERROR); |
| | | String fileName = FileUtilS.getFilenameNonSuffix(file.getOriginalFilename()); |
| | | String fileNameAll = file.getOriginalFilename(); |
| | | DocInfo en = findByAttrAndDocName(fileName, uploadRequest.getAttributionType(), uploadRequest.getAttributionId()); |
| | | List<DocInfo> docInfoList = super.getBaseMapper().findByAttrAndDocName(fileName, uploadRequest.getAttributionType(), uploadRequest.getAttributionId()); |
| | | //针对存在的处理 |
| | | if(en != null) |
| | | ExceptionCast.cast(DocumentCode.DOC_IS_EXIST); |
| | | if(docInfoList != null){ |
| | | docInfoList.forEach(item->{ |
| | | if (item.getClassificationId().equals(docClass.getClassificationId())) { |
| | | ExceptionCast.cast(DocumentCode.DOC_IS_EXIST); |
| | | } |
| | | }); |
| | | } |
| | | FileUploadResult fileUploadResult = FileUtilS.uploadFile(file); |
| | | if(fileUploadResult == null) |
| | | ExceptionCast.cast(DocumentCode.DOC_UPLOAD_ERROR); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean addDocInfoAnalysisSmwNcService(String pathFile,File fileRec){ |
| | | //todo 程序回传 |
| | | //确认解析目录 |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 文档解析 |
| | | * todo 修改创建文件关联关系,改成固定docId,去除创建DocInfo |
| | | * @param equipmentId |
| | | * @param fileRec |
| | | * @param fileNameSuffix |
| | | * @param fileNameNew |
| | | * @param filePath |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean addDocInfoRecService(String equipmentId,File fileRec,String fileNameSuffix,String fileNameNew,String filePath ) { |
| | |
| | | b = docRelativeService.deleteByDocId(id); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | //强制结束流程 删除用户的此待办任务 |
| | | List<DispatchFile> dispatchFiles=dispatchFileService.list(new QueryWrapper<DispatchFile>().eq("doc_id",id)); |
| | | if (dispatchFiles != null && !dispatchFiles.isEmpty()) { |
| | | FlowMyBusiness flowMyBusiness = flowMyBusinessService.selectByDataId(dispatchFiles.get(0).getId()); |
| | | if (flowMyBusiness != null) { |
| | | flowTaskService.end(flowMyBusiness.getProcessInstanceId(), "删除文档"); |
| | | } |
| | | } |
| | | return super.removeById(id); |
| | | } |
| | | |