From 5b1baee9f43cb311ec8ca8ef17f195445b00bac0 Mon Sep 17 00:00:00 2001 From: yn147 <2270338776@qq.com> Date: 星期四, 11 五月 2023 14:08:59 +0800 Subject: [PATCH] 邮箱登录 --- src/main/java/com/qxueyou/scc/school/service/impl/HandoutService.java | 342 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 171 insertions(+), 171 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/school/service/impl/HandoutService.java b/src/main/java/com/qxueyou/scc/school/service/impl/HandoutService.java index d41a716..79ffb66 100644 --- a/src/main/java/com/qxueyou/scc/school/service/impl/HandoutService.java +++ b/src/main/java/com/qxueyou/scc/school/service/impl/HandoutService.java @@ -87,9 +87,9 @@ import com.jacob.com.Variant; /** - * 讲义管理服务 + * 璁蹭箟绠$悊鏈嶅姟 * - * @author 德虎 2015-1-4 + * @author 寰疯檸 2015-1-4 * */ @Service @@ -122,7 +122,7 @@ @Autowired IOrgTextService orgTextService; - // /** 极光推送替换信鸽 */ + // /** 鏋佸厜鎺ㄩ�佹浛鎹俊楦� */ // @Autowired // IJPushService jpushService; @@ -139,7 +139,7 @@ private ICourseWareService courseWareService; /** - * 依赖注入 + * 渚濊禆娉ㄥ叆 * * @param handoutDAO */ @@ -149,7 +149,7 @@ } /** - * PPT\PPTX (office文件不直接处理,发送消息,使用特定的文档处理服务器处理) PDF直接处理 + * PPT\PPTX (office鏂囦欢涓嶇洿鎺ュ鐞嗭紝鍙戦�佹秷鎭紝浣跨敤鐗瑰畾鐨勬枃妗e鐞嗘湇鍔″櫒澶勭悊) PDF鐩存帴澶勭悊 * * */ @@ -157,23 +157,23 @@ public Result insertHandout(String fullPath, String module, SchHandout handout) { File file = null; try { - // 取得当前上传文件类型:office(ppt、pptx)或者pdf,直接用后缀名来判断格式(office还是pdf) + // 鍙栧緱褰撳墠涓婁紶鏂囦欢绫诲瀷锛歰ffice(ppt銆乸ptx)鎴栬�卲df,鐩存帴鐢ㄥ悗缂�鍚嶆潵鍒ゆ柇鏍煎紡锛坥ffice杩樻槸pdf锛� String filePart[] = fullPath.split("\\."); String fileType = filePart[filePart.length - 1]; - // 1.下载到应用服务器本地 + // 1.涓嬭浇鍒板簲鐢ㄦ湇鍔″櫒鏈湴 String uuid = UUIDUtils.generateUUID(); String filePath = HandoutService.class.getClassLoader().getResource("../uploads").getPath() .concat("handout/" + uuid + "/" + uuid + "." + fileType); file = fileUploadService.doGetOssFile(fullPath, filePath, module, ClientUtils.getUserId()); - // 是否是office + // 鏄惁鏄痮ffice boolean pptFlag = false; if ("PPT".equals(fileType.toUpperCase()) || "PPTX".equals(fileType.toUpperCase())) { - // 如果有密码,返回前台提示 07+ 无打开密码有权限密码无法检测出来 + // 濡傛灉鏈夊瘑鐮侊紝杩斿洖鍓嶅彴鎻愮ず 07+ 鏃犳墦寮�瀵嗙爜鏈夋潈闄愬瘑鐮佹棤娉曟娴嬪嚭鏉� if (getDecryptFlag(file, fileType.toUpperCase())) { - return new Result(false, "导入失败:您提交的文件有密码,请上传没有密码的文件!"); + return new Result(false, "瀵煎叆澶辫触锛氭偍鎻愪氦鐨勬枃浠舵湁瀵嗙爜锛岃涓婁紶娌℃湁瀵嗙爜鐨勬枃浠讹紒"); } pptFlag = true; } @@ -190,13 +190,13 @@ this.saveHandout(handout); handout.setOriginHandoutId(handout.getHandoutId()); - // 保存OrgText —— 讲义详情 + // 淇濆瓨OrgText 鈥斺�� 璁蹭箟璇︽儏 orgTextService.doSaveOrgText(handout.getHandoutId(), OrgText.TABLE_NAME_HANDOUT, handout.getRemark()); - // 更新上传文件使用轨迹 + // 鏇存柊涓婁紶鏂囦欢浣跨敤杞ㄨ抗 fileUploadService.updateUploadTrace(fullPath, module, SysFileUploadTrace.FILE_USE, handout.getHandoutId()); - // 序号 + // 搴忓彿 String hql = "select MAX(c.orderNum) from SchHandout c where c.deleteFlag is false and c.classId = ? "; Integer iMax = this.findUnique(hql, CollectionUtils.newList(ClientUtils.getClassId()), Integer.class); @@ -208,7 +208,7 @@ handout.setOrderNum(iMax); this.saveHandout(handout); - // 标记班级有讲义 + // 鏍囪鐝骇鏈夎涔� ClsClass cls = read(ClsClass.class, ClientUtils.getClassId()); if (cls != null && cls.getHaveHandout() == ClsClass.NOT_HAVE_HANDOUT) { cls.setHaveHandout(ClsClass.HAVE_HANDOUT); @@ -219,10 +219,10 @@ result.addData("pptFlag", pptFlag); return result; } catch (Exception e) { - this.log.error("讲义转码失败" + fullPath, e); + this.log.error("璁蹭箟杞爜澶辫触" + fullPath, e); } finally { if (file != null) { - // 删除下载到应用服务器的文档 + // 鍒犻櫎涓嬭浇鍒板簲鐢ㄦ湇鍔″櫒鐨勬枃妗� fileUploadService.doDeleteTempOssFile(file.getParentFile(), module, ClientUtils.getUserId()); } } @@ -230,7 +230,7 @@ } /** - * 转码PDF发送消息 + * 杞爜PDF鍙戦�佹秷鎭� * * @param handoutId * @param fullPath @@ -268,7 +268,7 @@ } catch (Exception e) { String businessId = aliOnsConfig.getCommonTopic() + "-" + UUIDUtils.generateUUID(); String desp = "handoutId:" + handoutId + ";fullPath:" + fullPath + ";module:" + module; - log.error(businessId + " :转码PDF讲义失败:" + e, e); + log.error(businessId + " :杞爜PDF璁蹭箟澶辫触:" + e, e); } } @@ -280,15 +280,15 @@ } catch (Exception e) { String desp = "handoutId:" + handoutId + ";docPath:" + docPath + ";uploadModule:" + uploadModule; - log.error(handoutId + " :上传讲义ppt消息发送失败:" + e, e); + log.error(handoutId + " :涓婁紶璁蹭箟ppt娑堟伅鍙戦�佸け璐�:" + e, e); } } /** - * docdeal 消息队列调用,将office文件从oss下载到web server上,解析成图片,将解析后的图片传到oss上 - * 20150915:正式环境出现同一个ppt解析了两份,(消息队列处理前删除前面内容,用最新内容,这样操作,收藏的讲义可能会出现问题),已处理过不处理 - * 修改bug:ppt和jpg当前不在同一个目录下面,修改到同一个目录下面 + * docdeal 娑堟伅闃熷垪璋冪敤,灏唎ffice鏂囦欢浠巓ss涓嬭浇鍒皐eb server涓婏紝瑙f瀽鎴愬浘鐗囷紝灏嗚В鏋愬悗鐨勫浘鐗囦紶鍒皁ss涓� + * 20150915:姝e紡鐜鍑虹幇鍚屼竴涓猵pt瑙f瀽浜嗕袱浠斤紝(娑堟伅闃熷垪澶勭悊鍓嶅垹闄ゅ墠闈㈠唴瀹癸紝鐢ㄦ渶鏂板唴瀹�,杩欐牱鎿嶄綔锛屾敹钘忕殑璁蹭箟鍙兘浼氬嚭鐜伴棶棰�)锛屽凡澶勭悊杩囦笉澶勭悊 + * 淇敼bug锛歱pt鍜宩pg褰撳墠涓嶅湪鍚屼竴涓洰褰曚笅闈紝淇敼鍒板悓涓�涓洰褰曚笅闈� * * @param docPath * @param handoutId @@ -333,7 +333,7 @@ // uploadModule, userId); // 2.deal doc - // 使用新方式解析讲义,有个缺陷:上传img及数据库中handoutpage默认排序(15页ppt为例):1,10,11,12,13,14,15,2,3,4,5,6,7,8,9 + // 浣跨敤鏂版柟寮忚В鏋愯涔�,鏈変釜缂洪櫡锛氫笂浼爄mg鍙婃暟鎹簱涓環andoutpage榛樿鎺掑簭(15椤祊pt涓轰緥)锛�1,10,11,12,13锛�14,15,2,3,4,5,6,7,8,9 List<SchHandoutPage> lstPages = Collections.EMPTY_LIST; if ("PPT".equals(type)) { lstPages = this.convertPPTToJPG(objOfficeFile, docPath, handoutId); @@ -344,14 +344,14 @@ // 3.insert pages if (lstPages.isEmpty()) { - log.error("转换ppt为空:" + handoutId + "-" + docPath + "-" + userId + "-" + uploadModule); + log.error("杞崲ppt涓虹┖:" + handoutId + "-" + docPath + "-" + userId + "-" + uploadModule); // 4.modify handout status and pageCount SchHandout objHandout = this.read(SchHandout.class, handoutId); - // jgw ,直接修改为发布 + // jgw 锛岀洿鎺ヤ慨鏀逛负鍙戝竷 objHandout.setStatus(SchHandout.STATUS_FAILURE); this.saveHandout(objHandout); - return new Result(false, "office讲义转换失败"); + return new Result(false, "office璁蹭箟杞崲澶辫触"); } for (SchHandoutPage page : lstPages) { page.setHandoutId(handoutId); @@ -361,23 +361,23 @@ // 4.modify handout status and pageCount SchHandout objHandout = this.read(SchHandout.class, handoutId); objHandout.setPageCount(lstPages.size()); - // jgw ,直接修改为发布 + // jgw 锛岀洿鎺ヤ慨鏀逛负鍙戝竷 objHandout.setStatus(SchHandout.STATUS_ISSUED); - // 如果首页图片为null 并且 lstPages不为空 + // 濡傛灉棣栭〉鍥剧墖涓簄ull 骞朵笖 lstPages涓嶄负绌� if (StringUtils.isBlank(objHandout.getCoverPageUrl())) { objHandout.setCoverPageUrl(lstPages.get(0).getImgPath()); } this.saveHandout(objHandout); - // 如果是管理员上传,处理指定到别处的数据 + // 濡傛灉鏄鐞嗗憳涓婁紶锛屽鐞嗘寚瀹氬埌鍒鐨勬暟鎹� doInitClassHandout(objHandout, lstPages); log.debug("end1...docDealMsgReceiveService call insertHandoutPages success: docPath: " + docPath + " ;handoutId: " + handoutId); } catch (Exception e) { - log.error("调用docdeal服务器解析ppt失败,失败原因:" + handoutId, e); + log.error("璋冪敤docdeal鏈嶅姟鍣ㄨВ鏋恜pt澶辫触锛屽け璐ュ師鍥狅細" + handoutId, e); SchHandout objHandout = this.read(SchHandout.class, handoutId); if (null != objHandout) { objHandout.setStatus(SchHandout.STATUS_FAILURE); @@ -393,7 +393,7 @@ } /** - * PPT\PPTX (office文件不直接处理,发送消息,使用特定的文档处理服务器处理) PDF直接处理 + * PPT\PPTX (office鏂囦欢涓嶇洿鎺ュ鐞嗭紝鍙戦�佹秷鎭紝浣跨敤鐗瑰畾鐨勬枃妗e鐞嗘湇鍔″櫒澶勭悊) PDF鐩存帴澶勭悊 * * */ @@ -402,26 +402,26 @@ public Result insertOrgHandout(String fullPath, String module, SchHandout handout, String collegeCourseId) { File file = null; try { - // 取得当前上传文件类型:office(ppt、pptx)或者pdf,直接用后缀名来判断格式(office还是pdf) + // 鍙栧緱褰撳墠涓婁紶鏂囦欢绫诲瀷锛歰ffice(ppt銆乸ptx)鎴栬�卲df,鐩存帴鐢ㄥ悗缂�鍚嶆潵鍒ゆ柇鏍煎紡锛坥ffice杩樻槸pdf锛� String filePart[] = fullPath.split("\\."); String fileType = filePart[filePart.length - 1]; String rootPath = sccConfig.getResRootPath(); String outputPath = rootPath.concat(filePart[0].substring(1, filePart[0].length())); - // 1.下载到应用服务器本地 + // 1.涓嬭浇鍒板簲鐢ㄦ湇鍔″櫒鏈湴 file = fileUploadService.doGetOssFile(fullPath, "/temp/uploads/handout/" + UUIDUtils.generateUUID() + "/" + fileType + "." + fileType, module, ClientUtils.getUserId()); - // 是否是office + // 鏄惁鏄痮ffice boolean pptFlag = false; if ("PPT".equals(fileType.toUpperCase()) || "PPTX".equals(fileType.toUpperCase())) { - // 如果有密码,返回前台提示 07+ 无打开密码有权限密码无法检测出来 + // 濡傛灉鏈夊瘑鐮侊紝杩斿洖鍓嶅彴鎻愮ず 07+ 鏃犳墦寮�瀵嗙爜鏈夋潈闄愬瘑鐮佹棤娉曟娴嬪嚭鏉� if (getDecryptFlag(file, fileType.toUpperCase())) { - return new Result(false, "导入失败:您提交的文件有密码,请上传没有密码的文件!"); + return new Result(false, "瀵煎叆澶辫触锛氭偍鎻愪氦鐨勬枃浠舵湁瀵嗙爜锛岃涓婁紶娌℃湁瀵嗙爜鐨勬枃浠讹紒"); } pptFlag = true; @@ -447,26 +447,26 @@ handout.setOriginHandoutId(handout.getHandoutId()); this.saveHandout(handout); - // 保存OrgText —— 讲义详情 + // 淇濆瓨OrgText 鈥斺�� 璁蹭箟璇︽儏 orgTextService.doSaveOrgText(handout.getHandoutId(), OrgText.TABLE_NAME_HANDOUT, handout.getRemark()); - // 更新上传文件使用轨迹 + // 鏇存柊涓婁紶鏂囦欢浣跨敤杞ㄨ抗 fileUploadService.updateUploadTrace(fullPath, module, SysFileUploadTrace.FILE_USE, handout.getHandoutId()); - // 讲义和科目关联 + // 璁蹭箟鍜岀鐩叧鑱� this.insertReCourse(collegeCourseId, handout.getHandoutId()); - // 删除pdf ppt原文件,已上传至阿里与服务器 + // 鍒犻櫎pdf ppt鍘熸枃浠讹紝宸蹭笂浼犺嚦闃块噷涓庢湇鍔″櫒 // FileUtils.deleteQuietly(file); // insertAppointSelfOrg(handout.getHandoutId(),ClientUtils.getOrgId(),collegeCourseId); Result result = new Result(true); result.addData("pptFlag", pptFlag); return result; } catch (Exception e) { - this.log.error("讲义转码失败" + fullPath, e); + this.log.error("璁蹭箟杞爜澶辫触" + fullPath, e); } finally { if (file != null) { - // 删除下载到应用服务器的文档 + // 鍒犻櫎涓嬭浇鍒板簲鐢ㄦ湇鍔″櫒鐨勬枃妗� fileUploadService.doDeleteTempOssFile(file.getParentFile(), module, ClientUtils.getUserId()); } } @@ -474,7 +474,7 @@ } /** - * 编辑讲义 + * 缂栬緫璁蹭箟 */ public Result doEditHandout(SchHandout newhandout, String type) { SchHandout handout = read(SchHandout.class, newhandout.getHandoutId()); @@ -488,10 +488,10 @@ TraceUtils.setUpdateTrace(handout); this.saveHandout(handout); - // 保存OrgText —— 讲义详情 + // 淇濆瓨OrgText 鈥斺�� 璁蹭箟璇︽儏 orgTextService.doSaveOrgText(handout.getHandoutId(), OrgText.TABLE_NAME_HANDOUT, newhandout.getRemark()); - // 更新统计表讲义名字 + // 鏇存柊缁熻琛ㄨ涔夊悕瀛� updateHandoutStatisticName(handout.getHandoutId(), handout.getName()); /* @@ -525,7 +525,7 @@ * schHandout.setSubjectId(scs.getClassSubjectId()); * schHandout.setSubjectName(scs.getName()); this.saveHandout(schHandout); } * - * // 保存OrgText —— 讲义详情 orgTextService.doSaveOrgTexts(handoutIds, + * // 淇濆瓨OrgText 鈥斺�� 璁蹭箟璇︽儏 orgTextService.doSaveOrgTexts(handoutIds, * OrgText.TABLE_NAME_HANDOUT, newhandout.getRemark()); */ @@ -533,7 +533,7 @@ } /** - * 更新统计表讲义名字 + * 鏇存柊缁熻琛ㄨ涔夊悕瀛� * * @param handoutId * @param handoutName @@ -550,7 +550,7 @@ } /** - * 得到office 文档是否有密码 + * 寰楀埌office 鏂囨。鏄惁鏈夊瘑鐮� * * @param file * @param fileType @@ -568,7 +568,7 @@ } /** - * ppt 检测是否包含密码 + * ppt 妫�娴嬫槸鍚﹀寘鍚瘑鐮� * * @param file * @return @@ -586,14 +586,14 @@ HSLFSlideShow hss = new HSLFSlideShow(fs); IOUtils.closeQuietly(fs); } catch (IOException e) { - log.error("PPT: getPPTDecryptFlag IOException :" + e); + log.error("PPT: getPPTDecryptFlag IOException 锛�" + e); } catch (EncryptedPowerPointFileException e) { if ("The CurrentUserAtom specifies that the document is encrypted".equals(e.getMessage()) || "Encrypted PowerPoint files are not supported".equals(e.getMessage())) { flag = true; } } catch (Exception e) { - log.error("PPT: getPPTDecryptFlag Exception :" + e); + log.error("PPT: getPPTDecryptFlag Exception 锛�" + e); } return flag; @@ -601,7 +601,7 @@ } /** - * pptx 检测是否有密码,07+ 无打开文件密码,有编辑密码,暂时判断不出来 + * pptx 妫�娴嬫槸鍚︽湁瀵嗙爜锛�07+ 鏃犳墦寮�鏂囦欢瀵嗙爜锛屾湁缂栬緫瀵嗙爜锛屾殏鏃跺垽鏂笉鍑烘潵 * * @param file * @return @@ -623,31 +623,31 @@ } } } catch (FileNotFoundException e) { - log.error("getPPTXDecryptFlag()_获取InputStream 异常:" + e); + log.error("getPPTXDecryptFlag()_鑾峰彇InputStream 寮傚父锛�" + e); } catch (IOException e) { - log.error("getPPTXDecryptFlag()_获取POIFSFileSystem 异常:" + e); + log.error("getPPTXDecryptFlag()_鑾峰彇POIFSFileSystem 寮傚父锛�" + e); } catch (NullPointerException e) { - log.error("getPPTXDecryptFlag()_获取EncryptionInfo,07+ 异常:" + e); + log.error("getPPTXDecryptFlag()_鑾峰彇EncryptionInfo,07+ 寮傚父锛�" + e); } catch (GeneralSecurityException e) { - log.error("getPPTXDecryptFlag()_获取verifyPassword 异常:" + e); + log.error("getPPTXDecryptFlag()_鑾峰彇verifyPassword 寮傚父锛�" + e); } catch (Exception e) { - log.error("PPTX: getPPTXDecryptFlag Exception :" + e); + log.error("PPTX: getPPTXDecryptFlag Exception 锛�" + e); } return flag; } /** - * 使用jacob另存为图片,需要测试多个请求同时调用情况 1.office2013报错,但是用office2013另存為效果最好 - * 2.office2007解析不完美,字体偏粗,边上有较明显锯齿,可以用jacob調用 - * 3.office2010解析基本正常,但是较于office2013,大字体和边框会有非常少量锯齿(推荐使用) + * 浣跨敤jacob鍙﹀瓨涓哄浘鐗�,闇�瑕佹祴璇曞涓姹傚悓鏃惰皟鐢ㄦ儏鍐� 1.office2013鎶ラ敊锛屼絾鏄敤office2013鍙﹀瓨鐐烘晥鏋滄渶濂� + * 2.office2007瑙f瀽涓嶅畬缇庯紝瀛椾綋鍋忕矖锛岃竟涓婃湁杈冩槑鏄鹃敮榻�,鍙互鐢╦acob瑾跨敤 + * 3.office2010瑙f瀽鍩烘湰姝e父锛屼絾鏄緝浜巓ffice2013锛屽ぇ瀛椾綋鍜岃竟妗嗕細鏈夐潪甯稿皯閲忛敮榻匡紙鎺ㄨ崘浣跨敤锛� * - * info:服务器推荐使用office2010,jacob.jar包更新后如果支持office2013,测试哪个版本会效果更好,可以替换服务器office版本 + * info锛氭湇鍔″櫒鎺ㄨ崘浣跨敤office2010锛宩acob.jar鍖呮洿鏂板悗濡傛灉鏀寔office2013锛屾祴璇曞摢涓増鏈細鏁堟灉鏇村ソ锛屽彲浠ユ浛鎹㈡湇鍔″櫒office鐗堟湰 * * @param file - * ppt文件 + * ppt鏂囦欢 * @param docPath - * oss 存放office文件的路径 + * oss 瀛樻斁office鏂囦欢鐨勮矾寰� * @return */ @Override @@ -659,38 +659,38 @@ try { if (!file.exists()) { - throw new Exception("文件不存在!"); + throw new Exception("鏂囦欢涓嶅瓨鍦�!"); } - // 获取另存为图片时的文件 + // 鑾峰彇鍙﹀瓨涓哄浘鐗囨椂鐨勬枃浠� File imgFile = getHandoutImgPath(file.getParentFile().getPath()); - log.debug("消息调用JACOB解析ppt成功,进入解析方法,开始初始化JACOB组件!"); + log.debug("娑堟伅璋冪敤JACOB瑙f瀽ppt鎴愬姛锛岃繘鍏ヨВ鏋愭柟娉曪紝寮�濮嬪垵濮嬪寲JACOB缁勪欢锛�"); ComThread.InitSTA(); - log.debug("开始初始化JACOB组件,ComThread.InitSTA()调用成功!"); + log.debug("寮�濮嬪垵濮嬪寲JACOB缁勪欢锛孋omThread.InitSTA()璋冪敤鎴愬姛锛�"); application = new ActiveXComponent("PowerPoint.Application"); - // 默认不可见,但是大文件另存为时,会出现“ESC可取消保存”的进度框,暂时不知道如何不显示进度条 + // 榛樿涓嶅彲瑙侊紝浣嗘槸澶ф枃浠跺彟瀛樹负鏃讹紝浼氬嚭鐜扳�淓SC鍙彇娑堜繚瀛樷�濈殑杩涘害妗�,鏆傛椂涓嶇煡閬撳浣曚笉鏄剧ず杩涘害鏉� // Dispatch.put(application, "Visible", new Variant(true)); - // 打开一个现有的 Presentation 对象 + // 鎵撳紑涓�涓幇鏈夌殑 Presentation 瀵硅薄 Dispatch ppts = application.getProperty("Presentations").toDispatch(); ppt = Dispatch.call(ppts, "Open", file.getPath(), true, // ReadOnly - false, // Untitled指定文件是否有标题 - false// WithWindow指定文件是否可见 + false, // Untitled鎸囧畾鏂囦欢鏄惁鏈夋爣棰� + false// WithWindow鎸囧畾鏂囦欢鏄惁鍙 ).toDispatch(); - // 另存为图片 (17):图片类型 - // 将web服务器中的ppt另存为图片,调用ppt的另存为方法,图片格式为(幻灯片1.JPG,幻灯片2.JPG...) + // 鍙﹀瓨涓哄浘鐗� 锛�17锛夛細鍥剧墖绫诲瀷 + // 灏唚eb鏈嶅姟鍣ㄤ腑鐨刾pt鍙﹀瓨涓哄浘鐗囷紝璋冪敤ppt鐨勫彟瀛樹负鏂规硶锛屽浘鐗囨牸寮忎负锛堝够鐏墖1.JPG,骞荤伅鐗�2.JPG...锛� Dispatch.call(ppt, "SaveAs", imgFile.getPath(), new Variant(17)); - // 上传图片到oss服务器并准备需要保存到数据库的handoutpage数据 + // 涓婁紶鍥剧墖鍒皁ss鏈嶅姟鍣ㄥ苟鍑嗗闇�瑕佷繚瀛樺埌鏁版嵁搴撶殑handoutpage鏁版嵁 results = uploadImgPrepareData(imgFile, docPath, handoutId); } catch (ComFailException e) { - log.error("ComFailException解析保存ppt异常:" + e, e); + log.error("ComFailException瑙f瀽淇濆瓨ppt寮傚父锛�" + e, e); } catch (Exception e) { - log.error("Exception解析保存ppt异常:" + e, e); + log.error("Exception瑙f瀽淇濆瓨ppt寮傚父锛�" + e, e); } finally { if (ppt != null) { Dispatch.call(ppt, "Close"); @@ -705,10 +705,10 @@ } /** - * 创建另存为图片文件路径,ppt解析的图片存在ppt同级目录image文件夹下,默认命名方式为:幻灯片1.JPG + * 鍒涘缓鍙﹀瓨涓哄浘鐗囨枃浠惰矾寰�,ppt瑙f瀽鐨勫浘鐗囧瓨鍦╬pt鍚岀骇鐩綍image鏂囦欢澶逛笅锛岄粯璁ゅ懡鍚嶆柟寮忎负锛氬够鐏墖1.JPG * * @param path - * ppt上传到web服务器的路径 + * ppt涓婁紶鍒皐eb鏈嶅姟鍣ㄧ殑璺緞 * @return */ private File getHandoutImgPath(String path) { @@ -718,7 +718,7 @@ } /** - * 将解析后的图片上传到oss,并且返回需要存储到数据库的handoutpage信息 + * 灏嗚В鏋愬悗鐨勫浘鐗囦笂浼犲埌oss锛屽苟涓旇繑鍥為渶瑕佸瓨鍌ㄥ埌鏁版嵁搴撶殑handoutpage淇℃伅 * @param imgFileDir * @param docPath * @param handoutId @@ -734,7 +734,7 @@ String[] filelist = imgFileDir.list(); - // 判断是否有另存为的图片 + // 鍒ゆ柇鏄惁鏈夊彟瀛樹负鐨勫浘鐗� if (null != filelist && filelist.length > 0) { results = new ArrayList<SchHandoutPage>(filelist.length); File imgFile; @@ -748,12 +748,12 @@ for (String strFile : filelist) { // cacheService.set("handout_upload_schedule_"+handoutId, 60, // i*100f/filelist.length); - // 直接使用strPath构造imgFile,会导致获取输入流时,报错,file只给文件名,默认为工程目录,和src同级,用全路径构造 + // 鐩存帴浣跨敤strPath鏋勯�爄mgFile锛屼細瀵艰嚧鑾峰彇杈撳叆娴佹椂锛屾姤閿欙紝file鍙粰鏂囦欢鍚嶏紝榛樿涓哄伐绋嬬洰褰曪紝鍜宻rc鍚岀骇锛岀敤鍏ㄨ矾寰勬瀯閫� imgFile = new File(imgFileDir.getPath() + "/" + strFile); if (imgFile.getName().indexOf(".") != -1) { - // 图片文件名 + // 鍥剧墖鏂囦欢鍚� String imgFileName = imgFile.getName().split("\\.")[0]; - // 图片文件类型 + // 鍥剧墖鏂囦欢绫诲瀷 String imgFileType = imgFile.getName().split("\\.")[1]; if (StringUtils.isNotBlank(imgFileName) && imgFileName.length() > 3) { @@ -772,11 +772,11 @@ } } else { - log.error("jacob解析失败,无另存为的图片,image文件夹为空:" + imgFileDir.getPath()); + log.error("jacob瑙f瀽澶辫触锛屾棤鍙﹀瓨涓虹殑鍥剧墖锛宨mage鏂囦欢澶逛负绌猴細" + imgFileDir.getPath()); return Collections.EMPTY_LIST; } } else { - log.error("jacob解析失败,未生成imgFileDir文件夹"); + log.error("jacob瑙f瀽澶辫触锛屾湭鐢熸垚imgFileDir鏂囦欢澶�"); return Collections.EMPTY_LIST; } } finally { @@ -786,7 +786,7 @@ } /** - * 使用jpedal转换pdf为图片,默认格式为1.PNG、2.PNG、3.PNG + * 浣跨敤jpedal杞崲pdf涓哄浘鐗囷紝榛樿鏍煎紡涓�1.PNG銆�2.PNG銆�3.PNG * * @param * @@ -796,7 +796,7 @@ private List<SchHandoutPage> convertPDFToPNG(File file, String module, String handoutId) { // List<SchHandoutPage> results = new ArrayList<SchHandoutPage>(30); -// // 得到转换对象 +// // 寰楀埌杞崲瀵硅薄 // ConvertPagesToImages objConvert = new ConvertPagesToImages(file.getPath()); // try { // if (objConvert.openPDFFile()) { @@ -806,10 +806,10 @@ // for (int iPage = 1; iPage <= pageCount; iPage++) { // // cacheService.set("handout_upload_schedule_"+handoutId, 60, // // iPage*100f/pageCount); -// // 得到解析的每一页图片 +// // 寰楀埌瑙f瀽鐨勬瘡涓�椤靛浘鐗� // BufferedImage img = objConvert.getPageAsImage(iPage, true); // -// // 判断图片是否高大于宽 +// // 鍒ゆ柇鍥剧墖鏄惁楂樺ぇ浜庡 // int width = img.getWidth(); // int height = img.getHeight(); // BufferedImage handlerImg = null; @@ -817,7 +817,7 @@ // handlerImg = rotatePdfImg(img, 270, null); // } // -// // 上传 +// // 涓婁紶 // String destPath = "/web/res/img/school/handout/" + file.getParentFile().getName() + "/" + iPage // + ".PNG"; // String directory = webPath + "res/img/school/handout/" + file.getParentFile().getName(); @@ -836,13 +836,13 @@ // } // objConvert.closePDFfile(); // } catch (PdfException e) { -// log.error("jpedal解析pdf为图片失败:", e); +// log.error("jpedal瑙f瀽pdf涓哄浘鐗囧け璐ワ細", e); // return Collections.EMPTY_LIST; // } catch (IOException e) { -// log.error("pdf解析为图片失败:", e); +// log.error("pdf瑙f瀽涓哄浘鐗囧け璐ワ細", e); // return Collections.EMPTY_LIST; // } finally { -// // 删除下载到应用服务器的文档 +// // 鍒犻櫎涓嬭浇鍒板簲鐢ㄦ湇鍔″櫒鐨勬枃妗� // fileUploadService.doDeleteTempOssFile(file.getParentFile(), module, ClientUtils.getUserId()); // } @@ -851,11 +851,11 @@ private BufferedImage rotatePdfImg(BufferedImage image, int degree, Color bgcolor) { int degree0 = degree; - // 原始图象的宽高 + // 鍘熷鍥捐薄鐨勫楂� int iwidth = image.getWidth(); int iheight = image.getHeight(); - // 处理的宽高 + // 澶勭悊鐨勫楂� int width = 0; int height = 0; int positionX = 0; @@ -865,10 +865,10 @@ degree0 = 360 + degree0; } - // 将角度转为弧度 + // 灏嗚搴﹁浆涓哄姬搴� double ang = Math.toRadians(degree0); - // 确定旋转后的图象的高度和宽度 + // 纭畾鏃嬭浆鍚庣殑鍥捐薄鐨勯珮搴﹀拰瀹藉害 if (degree0 == 180 || degree0 == 0 || degree0 == 360) { width = iwidth; height = iheight; @@ -882,7 +882,7 @@ height = (int) (sinVal * iwidth) + (int) (cosVal * iheight); } - // 确定原点坐标 + // 纭畾鍘熺偣鍧愭爣 positionX = (width - iwidth) / 2; positionY = (height - iheight) / 2; BufferedImage rotatedImage = new BufferedImage(width, height, image.getType()); @@ -895,7 +895,7 @@ } AffineTransform at = new AffineTransform(); - // 旋转图象 + // 鏃嬭浆鍥捐薄 at.rotate(ang, width / 2, height / 2); at.translate(positionX, positionY); AffineTransformOp op = new AffineTransformOp(at, AffineTransformOp.TYPE_BICUBIC); @@ -906,7 +906,7 @@ } /** - * 新增HandoutPage对象 + * 鏂板HandoutPage瀵硅薄 * @param path * @param i * @return @@ -921,7 +921,7 @@ page.setImgPath(path0); - // 旧版本convertPPTToPNG 这里为(i + 1) convertPPTToJPG 为i + // 鏃х増鏈琧onvertPPTToPNG 杩欓噷涓猴紙i + 1锛� convertPPTToJPG 涓篿 page.setPageOrder(i); TraceUtils.setCreateTrace(page); return page; @@ -936,7 +936,7 @@ @Override public Result deleteHandouts(String[] handoutIds) { if (handoutIds.length == 0) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } for (String handoutId : handoutIds) { SchHandout interact = read(SchHandout.class, handoutId); @@ -954,10 +954,10 @@ for (String handoutId : handoutIds) { if ((orgIds != null && orgIds.length != 0) || (classIds != null && classIds.length != 0)) { - // 删除需要回撤的讲义 + // 鍒犻櫎闇�瑕佸洖鎾ょ殑璁蹭箟 deleteAppoint(handoutId, orgIds, classIds); } else { - // 删除讲义 + // 鍒犻櫎璁蹭箟 String hql = " from SchHandoutReCourse where handoutId = ? and deleteFlag is false and orgId = ?"; SchHandoutReCourse shr = findUnique(hql, CollectionUtils.newList(handoutId, ClientUtils.getOrgId()), SchHandoutReCourse.class); @@ -973,7 +973,7 @@ * null){ TraceUtils.setUpdateTrace(handout); handout.setDeleteFlag(true); * this.saveHandout(handout); } */ - // 用户选择同时删除下级讲义 + // 鐢ㄦ埛閫夋嫨鍚屾椂鍒犻櫎涓嬬骇璁蹭箟 if (delAll == 1) { deleteSub(handoutId, ClientUtils.getOrgId()); } @@ -986,7 +986,7 @@ @SuppressWarnings("unchecked") private void deleteSub(String handoutId, String currOrgId) { - // 机构层级视频是没有重新new ,查询出机构下级ID再删关联表 + // 鏈烘瀯灞傜骇瑙嗛鏄病鏈夐噸鏂皀ew 锛屾煡璇㈠嚭鏈烘瀯涓嬬骇ID鍐嶅垹鍏宠仈琛� String sql = " select oa.organization_id from organization as oa,organization ob " + " where " + " ob.ORGANIZATION_ID = ? " + " and " + " oa.org_code like CONCAT(ob.org_code,'%' ) " + " and oa.delete_flag is false and ob.delete_flag is false " + " order by oa.level,oa.org_code asc "; @@ -1004,7 +1004,7 @@ save(schHandoutReCourse); } - // 班主任层面视频指定过后都是new 出来的,通过originVideoId 可以查出所有指定过去的视频 + // 鐝富浠诲眰闈㈣棰戞寚瀹氳繃鍚庨兘鏄痭ew 鍑烘潵鐨勶紝閫氳繃originVideoId 鍙互鏌ュ嚭鎵�鏈夋寚瀹氳繃鍘荤殑瑙嗛 hql = "select classId from ClsClass where orgId in (:orgIds) and deleteFlag is false"; map = new HashMap<String, Object>(); map.put("orgIds", orgIds.toArray()); @@ -1025,7 +1025,7 @@ private Result deleteAppoint(String handoutId, String orgIds[], String classIds[]) { Map<String, Object> args = new HashMap<String, Object>(); - // 删除需要回撤的机构讲义 + // 鍒犻櫎闇�瑕佸洖鎾ょ殑鏈烘瀯璁蹭箟 if (orgIds.length != 0) { String hql = " from SchHandoutReCourse where handoutId = :handoutId and deleteFlag is false and orgId in (:orgIds) and orgId != :currOrgId"; @@ -1043,7 +1043,7 @@ } } - // 删除需要回撤的班主任讲义 + // 鍒犻櫎闇�瑕佸洖鎾ょ殑鐝富浠昏涔� if (classIds.length != 0) { args = new HashMap<String, Object>(); args.put(HANDOUT_ID, handoutId); @@ -1062,7 +1062,7 @@ } /** - * 获取讲义列表数据 + * 鑾峰彇璁蹭箟鍒楄〃鏁版嵁 * * @return */ @@ -1075,8 +1075,8 @@ String hql = ""; List<Object> agrs = new ArrayList<Object>(); agrs.add(ClientUtils.getClassId()); - // 1班主任:获取该班级(class_id)下面的讲师负责课程下的讲义; - // 2讲师:获取该讲师(teacher_id)负责课程下的讲义 + // 1鐝富浠伙細鑾峰彇璇ョ彮绾э紙class_id锛変笅闈㈢殑璁插笀璐熻矗璇剧▼涓嬬殑璁蹭箟; + // 2璁插笀锛氳幏鍙栬璁插笀锛坱eacher_id锛夎礋璐h绋嬩笅鐨勮涔� if (user != null && UserInfoWrapper.ROLE_CHARGER.equals(ClientUtils.getCurrentRole())) { hql = "select h.handoutId,h.name,h.pageCount,h.status,h.subjectId,h.subjectName, h.orderNum, h.remark " + " from SchHandout h " + " where h.deleteFlag is false " + " and h.classId = ?"; @@ -1085,7 +1085,7 @@ + " from SchHandout h " + " where h.deleteFlag is false " + " and h.classId = ?"; } if (StringUtils.isNotBlank(tid)) { - // 其他 + // 鍏朵粬 if ("-1".equals(tid)) { hql = hql.concat( " and not EXISTS (select 1 from SchClassSubject t where t.deleteFlag is false and t.classSubjectId = h.subjectId) "); @@ -1116,7 +1116,7 @@ } /** - * 获取机构讲义列表数据 + * 鑾峰彇鏈烘瀯璁蹭箟鍒楄〃鏁版嵁 * * @return */ @@ -1126,7 +1126,7 @@ List<Object[]> handoutLst = null; List<Object> args = new ArrayList<Object>(); String hql = ""; - // 其他 + // 鍏朵粬 if (("-" + collegeCourseId).equals(subjectId)) { hql = "select v.handoutId,v.name,v.pageCount,v.status,'','','',0,v.subjectId from SchHandout v,SchHandoutReCourse r where v.collegeCourseId = ? and v.deleteFlag is false and r.deleteFlag is false and r.handoutId = v.handoutId and r.orgId = ? and" + " not EXISTS (select 1 from SchSubject t where t.deleteFlag is false and t.subjectId = v.subjectId)"; @@ -1171,7 +1171,7 @@ } /** - * 指定机构讲义 + * 鎸囧畾鏈烘瀯璁蹭箟 * * @return */ @@ -1180,9 +1180,9 @@ String collegeCourseId) { if (null == handoutIds || handoutIds.length == 0) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } - // 一次性查询classId对应的orgId + // 涓�娆℃�ф煡璇lassId瀵瑰簲鐨刼rgId Map<String, Object> argsMap = new HashMap<String, Object>(); Map<String, String> classMap = new HashMap<String, String>(); if (classIds.length > 0) { @@ -1191,14 +1191,14 @@ argsMap.put("classIds", classIds); List<ClsClass> classList = findByComplexHql(hql, argsMap, ClsClass.class); - // 放入map中 KEY:classId VALUE:orgId + // 鏀惧叆map涓� KEY:classId VALUE:orgId for (ClsClass orgClass : classList) { classMap.put(orgClass.getClassId(), orgClass.getOrgId()); } } - // 一次性查出handoutId对应的handoutOrder + // 涓�娆℃�ф煡鍑篽andoutId瀵瑰簲鐨刪andoutOrder Map<String, Integer> orderMap = new HashMap<String, Integer>(); String hql = " from SchHandoutReCourse where handoutId in (:handoutIds) and deleteFlag is false and orgId = :currOrgId"; argsMap = new HashMap<String, Object>(); @@ -1210,10 +1210,10 @@ } for (String handoutId : handoutIds) { - if (orgIds.length > 0) { // 指定给机构 + if (orgIds.length > 0) { // 鎸囧畾缁欐満鏋� insertAppointOrg(orgIds, handoutId, collegeCourseId, orderMap); } - if (classIds.length > 0) { // 指定给班级 + if (classIds.length > 0) { // 鎸囧畾缁欑彮绾� insertAppointClass(classIds, handoutId, classMap, collegeCourseId, orderMap); } } @@ -1222,7 +1222,7 @@ } /** - * 指定给机构 + * 鎸囧畾缁欐満鏋� * * @param orgIds * @param handoutId @@ -1239,7 +1239,7 @@ for (String orgId : orgIds) { orgList.add(orgId); } - // 剔除掉不符合条件的orgId + // 鍓旈櫎鎺変笉绗﹀悎鏉′欢鐨刼rgId orgList.removeAll(strings); if (orgList.isEmpty()) { return; @@ -1259,7 +1259,7 @@ } /** - * 指定给班级 + * 鎸囧畾缁欑彮绾� * * @param classIds * @param handoutId @@ -1268,7 +1268,7 @@ private void insertAppointClass(String classIds[], String handoutId, Map<String, String> classMap, String collegeCourseId, Map<String, Integer> orderMap) { - // 章节id + // 绔犺妭id Map<String, SubjectChapter> origChapterMap = new HashMap<String, SubjectChapter>(); SchHandout handout = read(SchHandout.class, handoutId); @@ -1285,7 +1285,7 @@ if (classList.isEmpty()) { return; } - // 一次性查询班级ID对应的classSubjectId + // 涓�娆℃�ф煡璇㈢彮绾D瀵瑰簲鐨刢lassSubjectId hql = " from SchClassSubject where classId in(:classIds) and origSubjectId = :subjectId and deleteFlag is false"; args = new HashMap<String, Object>(); args.put("classIds", classList.toArray()); @@ -1327,7 +1327,7 @@ this.saveHandout(sh); - // 插入OrgText + // 鎻掑叆OrgText orgTextService.doInsertOrgText(sh.getHandoutId(), OrgText.TABLE_NAME_HANDOUT, oldOrgText == null ? sh.getRemark() : oldOrgText.getContent()); @@ -1343,7 +1343,7 @@ save(page); } - // 标记班级有讲义 + // 鏍囪鐝骇鏈夎涔� ClsClass cls = read(ClsClass.class, classId); if (cls != null && cls.getHaveHandout() == ClsClass.NOT_HAVE_HANDOUT) { cls.setHaveHandout(ClsClass.HAVE_HANDOUT); @@ -1364,11 +1364,11 @@ @Override public Result doStartHandouts(String handoutIds) { if (StringUtils.isEmpty(handoutIds)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } String[] handoutIdArray = handoutIds.split(","); - // 发送讲义系统通知 + // 鍙戦�佽涔夌郴缁熼�氱煡 sendSysMsg(handoutIds); for (String handoutId : handoutIdArray) { @@ -1378,7 +1378,7 @@ TraceUtils.setUpdateTrace(handout); this.saveHandout(handout); - // 推送消息给学员 + // 鎺ㄩ�佹秷鎭粰瀛﹀憳 Map<String, String> extras = new HashMap<String, String>(1); extras.put("senderId", "sys_msg"); extras.put("type", "SYS_MSG"); @@ -1391,8 +1391,8 @@ for (List<String> userIds : lstUserIdList) { - // jpushService.doJpushByUserIds(userIds, extras, "有新讲义", "发布了讲义:" + - // handout.getName(), "发布了讲义:" + handout.getName()); + // jpushService.doJpushByUserIds(userIds, extras, "鏈夋柊璁蹭箟", "鍙戝竷浜嗚涔�:" + + // handout.getName(), "鍙戝竷浜嗚涔�:" + handout.getName()); } @@ -1402,7 +1402,7 @@ } /** - * 拆分成200人一组 + * 鎷嗗垎鎴�200浜轰竴缁� * @param classId * @return */ @@ -1414,13 +1414,13 @@ // List<String> lstUserIds = userService.getUserLstByClassId(classId); List<String> lstUserIds = null; - // 小于200 直接返回 + // 灏忎簬200 鐩存帴杩斿洖 if (lstUserIds.size() < 200) { result.add(lstUserIds); return result; } - // 大于200,分批处理 + // 澶т簬200锛屽垎鎵瑰鐞� int iSize = lstUserIds.size() / 200; int iLeft = lstUserIds.size() % 200; iSize = iLeft == 0 ? iSize : iSize + 1; @@ -1431,11 +1431,11 @@ lstSplitUserIds = new ArrayList<String>(200); - // 200 个 + // 200 涓� if (i < (iSize - 1)) { lstSplitUserIds.addAll(lstUserIds.subList(i * 200, (i + 1) * 200)); } else { - // 最后剩下的,可能小于200个 + // 鏈�鍚庡墿涓嬬殑锛屽彲鑳藉皬浜�200涓� lstSplitUserIds.addAll(lstUserIds.subList(i * 200, lstUserIds.size())); } @@ -1448,7 +1448,7 @@ } /** - * 发送讲义系统消息 + * 鍙戦�佽涔夌郴缁熸秷鎭� * @param handoutIds * @return */ @@ -1463,7 +1463,7 @@ // msg.put("handoutIds", handoutIds); // try { // onsProducer.sendMsg(msg); // - // 消费类:com.qxueyou.scc.school.service.impl.HandoutSysMsgDealService + // 娑堣垂绫伙細com.qxueyou.scc.school.service.impl.HandoutSysMsgDealService // // } catch (Exception e) { // log.error("call DocdealMsgSendService fail.userId: " + @@ -1484,7 +1484,7 @@ @Override public Result doStopHandouts(String[] handoutIds) { if (handoutIds.length == 0) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } for (String handoutId : handoutIds) { SchHandout interact = read(SchHandout.class, handoutId); @@ -1497,7 +1497,7 @@ } /** - * 插入历史讲义 + * 鎻掑叆鍘嗗彶璁蹭箟 * * @param handout * @param oldHandoutId @@ -1540,7 +1540,7 @@ } /** - * 拷贝讲义 + * 鎷疯礉璁蹭箟 * @param oldHandoutId * @param subjectId * @param collegeCourseId @@ -1585,7 +1585,7 @@ saveOrUpdateAll(newHandoutPages); } - // 非班级拷贝需要关联表新增记录 + // 闈炵彮绾ф嫹璐濋渶瑕佸叧鑱旇〃鏂板璁板綍 if (StringUtils.isEmpty(ClientUtils.getClassId())) { this.insertReCourse(collegeCourseId, newHandout.getHandoutId()); } @@ -1594,13 +1594,13 @@ } /** - * 插入讲义和科目关联 + * 鎻掑叆璁蹭箟鍜岀鐩叧鑱� * * @param collegeCourseId * @param handoutId */ private void insertReCourse(String collegeCourseId, String handoutId) { - // 序号 + // 搴忓彿 String hql = "select MAX(c.orderNum) from SchHandoutReCourse c where c.deleteFlag is false and c.collegeCourseId = ? and orgId = ? "; Integer iMax = this.findUnique(hql, CollectionUtils.newList(collegeCourseId, ClientUtils.getOrgId()), Integer.class); @@ -1622,7 +1622,7 @@ } /** - * 查询讲义列表 + * 鏌ヨ璁蹭箟鍒楄〃 * * @param hql * @param args @@ -1634,21 +1634,21 @@ } /** - * 批量操作讲义收藏记录 + * 鎵归噺鎿嶄綔璁蹭箟鏀惰棌璁板綍 * * @param lstFavor * @return */ @Override public Result doOperHandoutFavorDataBatch(List<SchHandoutPageFavor> lstFavor) { - // 批量增加或者更新 + // 鎵归噺澧炲姞鎴栬�呮洿鏂� this.saveOrUpdateAll(lstFavor); return new Result(true); } /** - * 后台获取列表数据 + * 鍚庡彴鑾峰彇鍒楄〃鏁版嵁 * * @param sql * @param args @@ -1660,7 +1660,7 @@ } /** - * 查询选择班级下历史讲义 + * 鏌ヨ閫夋嫨鐝骇涓嬪巻鍙茶涔� * @param sql * @param args * @return @@ -1676,12 +1676,12 @@ List<SchHandout> handouts = this.find(hql, CollectionUtils.newList(handout.getHandoutId()), SchHandout.class); if (null == handouts || handouts.isEmpty()) { - return new Result(true, "无关联讲义"); + return new Result(true, "鏃犲叧鑱旇涔�"); } List<SchHandoutPage> allPages = new ArrayList<SchHandoutPage>(); - // 循环处理 + // 寰幆澶勭悊 for (SchHandout ho : handouts) { TraceUtils.setUpdateTrace(ho); @@ -1693,7 +1693,7 @@ this.saveHandout(ho); } - // 明细 + // 鏄庣粏 this.saveOrUpdateAll(allPages); return new Result(true); @@ -1701,7 +1701,7 @@ } /** - * 赋值所有讲义明细 + * 璧嬪�兼墍鏈夎涔夋槑缁� * * @param lstPages * @param handoutId @@ -1730,7 +1730,7 @@ } /** - * 旋转讲义图片 + * 鏃嬭浆璁蹭箟鍥剧墖 * * @param angle * @param handoutPageId @@ -1742,7 +1742,7 @@ SchHandoutPage page = this.read(SchHandoutPage.class, handoutPageId); if (null == page) { - return new Result(false, "page为空"); + return new Result(false, "page涓虹┖"); } String imgPath = page.getImgPath(); @@ -1753,7 +1753,7 @@ } if (StringUtils.isBlank(imgPath)) { - return new Result(false, "path解析出错"); + return new Result(false, "path瑙f瀽鍑洪敊"); } imgPath = imgPath.concat("@").concat(angle).concat("r"); @@ -1764,10 +1764,10 @@ } /** - * 查询讲义,模糊课程名或者讲义名 + * 鏌ヨ璁蹭箟,妯$硦璇剧▼鍚嶆垨鑰呰涔夊悕 * * @param keyWord - * 查询关键字 + * 鏌ヨ鍏抽敭瀛� * @return */ @Override @@ -1783,7 +1783,7 @@ } /** - * 更新讲义观看量 + * 鏇存柊璁蹭箟瑙傜湅閲� */ public Result updatePlayCount(String handoutId) { SchHandout sh = read(SchHandout.class, handoutId); @@ -1854,7 +1854,7 @@ save(shrd); } - // 统计表增加数据 + // 缁熻琛ㄥ鍔犳暟鎹� hql = " from SchHandoutStatistic where userId=? and classId=? and handoutId=?"; SchHandoutStatistic shs = findUnique(hql, CollectionUtils.newList(ClientUtils.getUserId(), ClientUtils.getClassId(), sh.getHandoutId()), @@ -1878,11 +1878,11 @@ CollectionUtils.newList(ClientUtils.getUserId(), ClientUtils.getClassId(), record.getHandoutId())); Set<String> set = new HashSet<String>(); - // 本次观看 + // 鏈瑙傜湅 for (String string2 : nums) { set.add(string2); } - // 数据库观看记录 + // 鏁版嵁搴撹鐪嬭褰� set.addAll(pageLst); shs.setCompDegree(new BigDecimal(set.size()).divide(new BigDecimal(record.getPageCount()), 2, @@ -1901,7 +1901,7 @@ } /** - * 讲义上传重复数据处理 + * 璁蹭箟涓婁紶閲嶅鏁版嵁澶勭悊 * * @param handoutId * @return @@ -1931,16 +1931,16 @@ } /** - * 排序 + * 鎺掑簭 * * @param ids - * 排序id + * 鎺掑簭id * @param index - * 序号 + * 搴忓彿 * @return */ public Result doOrder(List<String> ids, List<Integer> index) { - // 循环修改order + // 寰幆淇敼order CommonDAO commonDAO = this.getCommonDAO(); for (int i = 0; i < ids.size(); i++) { String handoutId = ids.get(i); @@ -1960,7 +1960,7 @@ } /** - * 保存讲义接口 + * 淇濆瓨璁蹭箟鎺ュ彛 * * @param handout * @return -- Gitblit v1.8.0