| | |
| | | List<Material> list=mapper.getMaterialLimit(subCode,subName,subModel); |
| | | String fileDirName = FileDirPath.getFileDirName(); |
| | | int flag=0; |
| | | // 需要统计附件状态 存在未锁定的附件:1 无附件或者附件全部锁定:0 |
| | | // 返回是否存在附件 |
| | | if(list!=null&&list.size()>0){ |
| | | for (Material m:list) { |
| | | if(m.getFileUrl()!=null&&!m.getFileUrl().isEmpty()){ |
| | |
| | | flag=0; |
| | | }else{ |
| | | String[] fileNames = file.list();//获取该文件夹下的所有文件以及目录的名字 |
| | | if(fileNames.length==m.getAttachLocks().size()){ |
| | | flag=0; |
| | | }else{ |
| | | if(fileNames.length>0){ |
| | | flag=1; |
| | | }else{ |
| | | flag=0; |
| | | } |
| | | m.setAttachFileList(fileNames); |
| | | } |
| | | } |
| | | m.setAttachFlag(flag); |
| | | m.setHasAttachFlag(flag); |
| | | } |
| | | } |
| | | PageInfo pageInfo=new PageInfo(list); |
| | |
| | | List<String> currentFileList = new LinkedList<>(); |
| | | List<String> uploadingFileList = new LinkedList<>(); |
| | | |
| | | String dirPathDB = "doc_file" + File.separator + "material" + File.separator + material.getId() + "-"+ material.getSubCode() + "-" + material.getSubModel(); |
| | | String dirPath = CommonUtil.getRootFile() + "material" + File.separator + material.getId() + "-"+ material.getSubCode() + "-" + material.getSubModel(); |
| | | String subModel = material.getSubModel(); |
| | | subModel = MaterialSpecialCharUtil.transfer(subModel); |
| | | String dirPathDB = "doc_file" + File.separator + "material" + File.separator + material.getId() + "-"+ material.getSubCode() + "-" + subModel; |
| | | String dirPath = CommonUtil.getRootFile() + "material" + File.separator + material.getId() + "-"+ material.getSubCode() + "-" + subModel; |
| | | File dirFile = new File(dirPath); |
| | | |
| | | Date now = new Date(); |
| | |
| | | public Response updatePicOrDwg(MultipartFile multipartFile, Material material) throws IOException { |
| | | List<String> currentFileList = new LinkedList<>(); |
| | | List<String> uploadingFileList = new LinkedList<>(); |
| | | |
| | | String dirPathDB = "doc_file" + File.separator + "material" + File.separator + material.getSubCode() + "-" + material.getSubModel(); |
| | | String dirPath = CommonUtil.getRootFile() + "material" + File.separator + material.getSubCode() + "-" + material.getSubModel(); |
| | | String subModel = material.getSubModel(); |
| | | subModel = MaterialSpecialCharUtil.transfer(subModel); |
| | | String dirPathDB = "doc_file" + File.separator + "material" + File.separator + material.getSubCode() + "-" + subModel; |
| | | String dirPath = CommonUtil.getRootFile() + "material" + File.separator + material.getSubCode() + "-" + subModel; |
| | | File dirFile = new File(dirPath); |
| | | |
| | | Date now = new Date(); |