From 138ccc9fe4798e5335c49a6407e8cdc70e1ff122 Mon Sep 17 00:00:00 2001
From: yn147 <2270338776@qq.com>
Date: 星期四, 24 十一月 2022 16:06:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/java/com/qxueyou/scc/teach/res/service/impl/ResService.java |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/qxueyou/scc/teach/res/service/impl/ResService.java b/src/main/java/com/qxueyou/scc/teach/res/service/impl/ResService.java
index d142c62..0201575 100644
--- a/src/main/java/com/qxueyou/scc/teach/res/service/impl/ResService.java
+++ b/src/main/java/com/qxueyou/scc/teach/res/service/impl/ResService.java
@@ -46,7 +46,7 @@
 
     @Autowired
     private ApplicationContext appContext;
-    
+
     @Autowired
     private IClassLectureService classLectureService;
 
@@ -87,7 +87,7 @@
         res.setCoverPageUrl(coverPageUrl);
         res.setItemDestId(resItemId);
         res.setName(name);
-        res.setStatus(Res.STATUS_CONVER);
+        res.setStatus(Res.STATUS_DRAFT);
         res.setType(type);
         res.setResDirId(dirId);
         res.setRemark(remark);
@@ -109,7 +109,7 @@
             TraceUtils.setCreateTrace(res);
             res.setItemDestId(resItemId);
             res.setName(name);
-            res.setStatus(Res.STATUS_CONVER);
+            res.setStatus(Res.STATUS_DRAFT);
             res.setType(type);
             res.setLibId(dir.getLibId());
             res.setResDirId(dirId);
@@ -135,7 +135,7 @@
         res.setName(name);
         res.setCoverPageUrl(coverPageUrl);
         res.setRemark(remark);
-
+        res.setStatus(Res.STATUS_DRAFT);
         save(res);
 
         return new Result(true, "success");
@@ -258,9 +258,9 @@
         ResLib lib = this.getResLib(libType, ownerId);
 
         StringBuffer hql = new StringBuffer(
-                "from Res where deleteFlag is false and name like ? and libId=? and status=? order by updateTime desc");
+                "from Res where deleteFlag is false and name like ? and libId like ? and status=? order by updateTime desc");
 
-        List<Object> args = CollectionUtils.newList(keyword + "%", lib == null ? null : lib.getLibId(),Res.STATUS_DRAFT);
+        List<Object> args = CollectionUtils.newList(keyword + "%", lib == null ? "%" : lib.getLibId() + "%",Res.STATUS_DRAFT);
 
         if (!StringUtils.isEmpty(resType)) {
             hql.append(" and type=?");
@@ -276,9 +276,9 @@
     public int listResCountByLib(String libType, String ownerId, String text, String resType) {
         ResLib lib = this.getResLib(libType, ownerId);
 
-        StringBuffer hql = new StringBuffer("from Res where deleteFlag is false and libId=? order by updateTime desc");
+        StringBuffer hql = new StringBuffer("from Res where deleteFlag is false and libId like ? order by updateTime desc");
 
-        List<Object> args = CollectionUtils.newList(null == lib ? null : lib.getLibId());
+        List<Object> args = CollectionUtils.newList(null == lib ? "%" : lib.getLibId()+"%");
 
         if (!StringUtils.isEmpty(resType)) {
             hql.append(" and type=?");
@@ -306,8 +306,9 @@
     public Result readAccessPath(String resId, String attribute) {
 
         Res res = read(Res.class, resId);
-        
-        Object path = Res.FILE_TYPE_VIDEO.equals(res.getType())?JSONObject.parse(resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute)):CollectionUtils.newObjectMap("path", resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute));
+
+//        Object path = Res.FILE_TYPE_VIDEO.equals(res.getType())? JSONObject.parse(resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute)):CollectionUtils.newObjectMap("path", resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute));
+        Object path = Res.FILE_TYPE_VIDEO.equals(res.getType())? resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute):resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute);
         if(Res.FILE_TYPE_DOC.equals(res.getType())) {
         	 return new Result(true, "success",
                      CollectionUtils.newObjectMap("path", path, "name", res.getName(), "coverPageUrl", res.getCoverPageUrl(), "size",
@@ -316,7 +317,7 @@
         	 return new Result(true, "success",
                      CollectionUtils.newObjectMap("path", path, "name", res.getName(), "coverPageUrl", res.getCoverPageUrl(), "size", 0));
         }
-       
+
     }
 
     @Override

--
Gitblit v1.8.0