From bc3b37b1622091def1f6ee4c3eb3ff79499b3466 Mon Sep 17 00:00:00 2001 From: EricsHu <hrr145632> Date: 星期一, 19 六月 2023 10:19:14 +0800 Subject: [PATCH] 数据可视化 --- src/main/java/com/qxueyou/scc/school/service/impl/ArticleService.java | 138 +++++++++++++++++++++++----------------------- 1 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/school/service/impl/ArticleService.java b/src/main/java/com/qxueyou/scc/school/service/impl/ArticleService.java index f8ae7d1..e007e9f 100644 --- a/src/main/java/com/qxueyou/scc/school/service/impl/ArticleService.java +++ b/src/main/java/com/qxueyou/scc/school/service/impl/ArticleService.java @@ -39,7 +39,7 @@ import com.qxueyou.scc.teach.subject.model.SubjectChapter; /** - * 文章实现类 + * 鏂囩珷瀹炵幇绫� * * @author zhiyong * @@ -59,7 +59,7 @@ @Autowired private ICourseWareService courseWareService; - // 缓存 + // 缂撳瓨 @SuppressWarnings("unused") private static final String CACHE_MSG_IMGS = "CACHE_MSG_IMGS_"; @SuppressWarnings("unused") @@ -71,7 +71,7 @@ private static final int ONE_DAY = 60 * 60 * 24; /** - * 查询列表数据 + * 鏌ヨ鍒楄〃鏁版嵁 * * @param type * @return @@ -87,7 +87,7 @@ } /** - * 新增或更新列表数据 + * 鏂板鎴栨洿鏂板垪琛ㄦ暟鎹� * * @param articleId * @param name @@ -98,14 +98,14 @@ public Result updateArticle(SchArticle article) { String articleId = article.getArticleId(); - if (StringUtils.isBlank(articleId)) {// 新增 + if (StringUtils.isBlank(articleId)) {// 鏂板 article.setArticleId(null); article.setClassId(ClientUtils.getClassId()); article.setOrgId(ClientUtils.getOrgId()); article.setDeleteFlag(false); TraceUtils.setCreateTrace(article); - // 序号 + // 搴忓彿 String hql = "select MAX(c.orderNum) from SchArticle c where c.deleteFlag is false and c.classId= ? "; Integer iMax = this.findUnique(hql, CollectionUtils.newList(ClientUtils.getClassId()), Integer.class); @@ -122,11 +122,11 @@ this.saveArticle(article); articleId = article.getArticleId(); - } else {// 更新 + } else {// 鏇存柊 SchArticle articleNew = this.read(SchArticle.class, articleId); - // 原上传的文件url + // 鍘熶笂浼犵殑鏂囦欢url String originUrl = articleNew.getUrl(); articleNew.setCoverPageUrl(article.getCoverPageUrl()); @@ -138,23 +138,23 @@ this.saveArticle(articleNew); - // // 删除原上传的文件 + // // 鍒犻櫎鍘熶笂浼犵殑鏂囦欢 // if(StringUtils.isNotBlank(originUrl)){ // ossService.deleteOSSFile(originUrl.substring(1)); // } } - // 保存OrgText —— 文章内容 + // 淇濆瓨OrgText 鈥斺�� 鏂囩珷鍐呭 orgTextService.doSaveOrgText(articleId, OrgText.TABLE_NAME_ARTICLE, article.getContent()); - // 删除该班级所有缓存 + // 鍒犻櫎璇ョ彮绾ф墍鏈夌紦瀛� // new CacheUtils().deleteWBProjectCacheData(); - return new Result(true, "操作成功", articleId); + return new Result(true, "鎿嶄綔鎴愬姛", articleId); } /** - * 新增或更新列表数据 机构 + * 鏂板鎴栨洿鏂板垪琛ㄦ暟鎹� 鏈烘瀯 * * @return */ @@ -163,10 +163,10 @@ public Result updateOrgArticle(SchArticle article, String collegeCourseId) { String articleId = article.getArticleId(); - // jgw 直接将文章修改为已发布 + // jgw 鐩存帴灏嗘枃绔犱慨鏀逛负宸插彂甯� article.setStatus(SchArticle.STATUS_PUBLISHED); - if (StringUtils.isBlank(articleId)) {// 新增 + if (StringUtils.isBlank(articleId)) {// 鏂板 article.setArticleId(null); article.setOrgId(ClientUtils.getOrgId()); article.setDeleteFlag(false); @@ -177,12 +177,12 @@ this.saveArticle(article); articleId = article.getArticleId(); - // 保存文章课程关联关系 + // 淇濆瓨鏂囩珷璇剧▼鍏宠仈鍏崇郴 saveSchArticleReCourse(collegeCourseId, article.getArticleId()); - } else {// 更新 + } else {// 鏇存柊 SchArticle articleNew = this.read(SchArticle.class, articleId); - // 原上传的文件url + // 鍘熶笂浼犵殑鏂囦欢url String originUrl = articleNew.getUrl(); articleNew.setCoverPageUrl(article.getCoverPageUrl()); @@ -194,23 +194,23 @@ this.saveArticle(articleNew); - // // 删除原上传的文件 + // // 鍒犻櫎鍘熶笂浼犵殑鏂囦欢 // if(StringUtils.isNotBlank(originUrl)){ // ossService.deleteOSSFile(originUrl.substring(1)); // } } - // 保存OrgText —— 文章内容 + // 淇濆瓨OrgText 鈥斺�� 鏂囩珷鍐呭 orgTextService.doSaveOrgText(articleId, OrgText.TABLE_NAME_ARTICLE, article.getContent()); - // 删除该班级所有缓存 + // 鍒犻櫎璇ョ彮绾ф墍鏈夌紦瀛� // new CacheUtils().deleteWBProjectCacheData(); - return new Result(true, "操作成功", articleId); + return new Result(true, "鎿嶄綔鎴愬姛", articleId); } /** - * 保存文章课程关联关系 + * 淇濆瓨鏂囩珷璇剧▼鍏宠仈鍏崇郴 * * @param collegeCourseId * @param articleId @@ -223,7 +223,7 @@ course.setOrgId(ClientUtils.getOrgId()); TraceUtils.setCreateTrace(course); - // 序号 + // 搴忓彿 String hql = "select MAX(c.orderNum) from SchArticleReCourse c where c.deleteFlag is false and c.collegeCourseId = ? and orgId = ? "; Integer iMax = this.findUnique(hql, CollectionUtils.newList(collegeCourseId, ClientUtils.getOrgId()), Integer.class); @@ -240,7 +240,7 @@ } /** - * 删除文章 + * 鍒犻櫎鏂囩珷 * * @param articleIds * @return @@ -249,7 +249,7 @@ public Result deleteArticle(String articleIds) { if (StringUtils.isBlank(articleIds)) { - return new Result(false, "提交数据异常"); + return new Result(false, "鎻愪氦鏁版嵁寮傚父"); } String[] aIds = articleIds.split(","); @@ -257,15 +257,15 @@ this.bulkUpdateInLoop("update SchArticle set deleteFlag=1 where articleId=?", aIds); this.bulkUpdateInLoop("update SchCourseware set deleteFlag=1 where id=?", aIds); - // 删除微商项目所有缓存 + // 鍒犻櫎寰晢椤圭洰鎵�鏈夌紦瀛� // new CacheUtils().deleteWBProjectCacheData(); - return new Result(true, "操作功能"); + return new Result(true, "鎿嶄綔鍔熻兘"); } /** * - * 查询基本信息 + * 鏌ヨ鍩烘湰淇℃伅 * * @param articleId * @return @@ -285,11 +285,11 @@ article.setCommentCount(this.findCount("from Comment where deleteFlag is false and commentObjectId = ?", CollectionUtils.newList(articleId))); article.setContent(content); - return new Result(true, "查询成功", article); + return new Result(true, "鏌ヨ鎴愬姛", article); } /** - * 查询科目文章list + * 鏌ヨ绉戠洰鏂囩珷list * * @param collegeCourseId * @return @@ -300,7 +300,7 @@ List<Object> args = new ArrayList<Object>(); String hql = ""; - // 其他 + // 鍏朵粬 if (("-" + collegeCourseId).equals(subjectId)) { hql = "select v.articleId,v.name,'','','',0,'' from SchArticle v,SchArticleReCourse r where v.collegeCourseId = ? and r.deleteFlag is false and r.articleId = v.articleId and v.deleteFlag is false and r.orgId = ? " + "and not EXISTS (select 1 from SchSubject t where t.deleteFlag is false and t.subjectId = v.subjectId)"; @@ -342,11 +342,11 @@ } /** - * 排序 + * 鎺掑簭 */ @Override public Result doitemOrder(List<String> ids, List<Integer> index) { - // 循环修改order + // 寰幆淇敼order for (int i = 0; i < ids.size(); i++) { String id = ids.get(i); if (UserInfoWrapper.ROLE_TEACHER.equals(ClientUtils.getCurrentRole()) @@ -361,14 +361,14 @@ new Object[] { id }); } - // 删除微商项目所有缓存 + // 鍒犻櫎寰晢椤圭洰鎵�鏈夌紦瀛� // new CacheUtils().deleteWBProjectCacheData(); - return new Result(true, "修改成功"); + return new Result(true, "淇敼鎴愬姛"); } /** - * 删除机构文章信息 + * 鍒犻櫎鏈烘瀯鏂囩珷淇℃伅 * * @param articleIds * @param delAll @@ -380,10 +380,10 @@ for (String articleId : articleIds) { if ((orgIds != null && orgIds.length != 0) || (classIds != null && classIds.length != 0)) { - // 删除需要回撤的讲义 + // 鍒犻櫎闇�瑕佸洖鎾ょ殑璁蹭箟 deleteAppoint(articleId, orgIds, classIds); } else { - // 删除讲义 + // 鍒犻櫎璁蹭箟 String hql = " from SchArticleReCourse where articleId = ? and deleteFlag is false and orgId = ?"; SchArticleReCourse shr = findUnique(hql, CollectionUtils.newList(articleId, ClientUtils.getOrgId()), SchArticleReCourse.class); @@ -399,7 +399,7 @@ * null){ TraceUtils.setUpdateTrace(article); article.setDeleteFlag(true); * this.saveArticle(article); } */ - // 用户选择同时删除下级讲义 + // 鐢ㄦ埛閫夋嫨鍚屾椂鍒犻櫎涓嬬骇璁蹭箟 if (delAll == 1) { deleteSub(articleId, ClientUtils.getOrgId()); } @@ -407,12 +407,12 @@ } - return new Result(true, "删除成功"); + return new Result(true, "鍒犻櫎鎴愬姛"); } private Result deleteAppoint(String articleId, String orgIds[], String classIds[]) { Map<String, Object> args = new HashMap<String, Object>(); - // 删除需要回撤的机构讲义 + // 鍒犻櫎闇�瑕佸洖鎾ょ殑鏈烘瀯璁蹭箟 if (orgIds.length != 0) { String hql = " from SchArticleReCourse where articleId = :articleId and deleteFlag is false and orgId in (:orgIds) and orgId != :currOrgId"; @@ -430,7 +430,7 @@ } } - // 删除需要回撤的班主任讲义 + // 鍒犻櫎闇�瑕佸洖鎾ょ殑鐝富浠昏涔� if (classIds.length != 0) { args = new HashMap<String, Object>(); args.put("articleId", articleId); @@ -450,7 +450,7 @@ @SuppressWarnings("unchecked") private void deleteSub(String articleId, 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 "; @@ -468,7 +468,7 @@ save(artCourse); } - // 班主任层面视频指定过后都是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()); @@ -488,7 +488,7 @@ } /** - * 下发机构文件 + * 涓嬪彂鏈烘瀯鏂囦欢 * * @param articleId * @param orgId @@ -500,9 +500,9 @@ public Result insertAppointArticle(String[] articleIds, String[] orgIds, String[] classIds, String collegeCourseId) { if (null == articleIds || articleIds.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) { @@ -511,14 +511,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 SchArticleReCourse where articleId in (:articleIds) and deleteFlag is false and orgId = :currOrgId"; argsMap = new HashMap<String, Object>(); @@ -530,10 +530,10 @@ } for (String articleId : articleIds) { - if (orgIds.length > 0) { // 指定给机构 + if (orgIds.length > 0) { // 鎸囧畾缁欐満鏋� insertAppointOrg(orgIds, articleId, collegeCourseId, orderMap); } - if (classIds.length > 0) { // 指定给班级 + if (classIds.length > 0) { // 鎸囧畾缁欑彮绾� insertAppointClass(classIds, articleId, collegeCourseId, orderMap); } } @@ -542,7 +542,7 @@ } /** - * 指定给机构 + * 鎸囧畾缁欐満鏋� * * @param orgIds * @param handoutId @@ -559,7 +559,7 @@ for (String orgId : orgIds) { orgList.add(orgId); } - // 剔除掉不符合条件的orgId + // 鍓旈櫎鎺変笉绗﹀悎鏉′欢鐨刼rgId orgList.removeAll(strings); if (orgList.isEmpty()) { return; @@ -579,7 +579,7 @@ } /** - * 指定给班级 + * 鎸囧畾缁欑彮绾� * * @param classIds * @param handoutId @@ -587,7 +587,7 @@ */ private void insertAppointClass(String classIds[], String articleId, String collegeCourseId, Map<String, Integer> orderMap) { - // 章节id + // 绔犺妭id Map<String, SubjectChapter> origChapterMap = new HashMap<String, SubjectChapter>(); SchArticle article = read(SchArticle.class, articleId); @@ -604,7 +604,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()); @@ -638,14 +638,14 @@ TraceUtils.setCreateTrace(sh); this.saveArticle(sh); - // 插入OrgText + // 鎻掑叆OrgText orgTextService.doInsertOrgText(sh.getArticleId(), OrgText.TABLE_NAME_ARTICLE, oldOrgText == null ? "" : oldOrgText.getContent()); } } /** - * 获取朋友圈 + * 鑾峰彇鏈嬪弸鍦� * * @param pager * @return @@ -710,7 +710,7 @@ } /** - * 获取消息的评论图片和文件 + * 鑾峰彇娑堟伅鐨勮瘎璁哄浘鐗囧拰鏂囦欢 * * @param objSchClassCircleMsg * @return @@ -748,7 +748,7 @@ } /** - * 点赞 + * 鐐硅禐 * * @param commentId * @return @@ -774,7 +774,7 @@ } /** - * 评论 + * 璇勮 * * @param msgId * @param content @@ -783,7 +783,7 @@ */ public Result addComment(String articleId, String content, String parentCommentId) { - // 评论表 + // 璇勮琛� Comment comment = new Comment(); comment.setCommentterId(ClientUtils.getUserId()); comment.setCommentter(ClientUtils.getUserName()); @@ -815,7 +815,7 @@ } /** - * 删除评论 + * 鍒犻櫎璇勮 * * @param msgId * @param commentId @@ -833,7 +833,7 @@ } /** - * 缓存获取评论 + * 缂撳瓨鑾峰彇璇勮 * * @param articleId * @param isUpdate @@ -856,7 +856,7 @@ } /** - * 评论列表 + * 璇勮鍒楄〃 * * @param articleId * @return @@ -866,7 +866,7 @@ } /** - * 观看进度 + * 瑙傜湅杩涘害 * * @param articleId * @param compDegree @@ -900,7 +900,7 @@ } /** - * 保存文章接口 + * 淇濆瓨鏂囩珷鎺ュ彛 * * @param article * @return @@ -927,7 +927,7 @@ this.bulkUpdate("update SchCourseware set name = ? where id = ?", new Object[] { article.getName(), article.getArticleId() }); } - // 同步课件表 + // 鍚屾璇句欢琛� if (courseware == null) { courseware = new SchCourseware(); courseware.setChapterId(article.getChapterId()); -- Gitblit v1.8.0