From 901aded0c3281c5f43e9f866127027b92b1b6075 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 17:30:03 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xboe/school/study/service/impl/StudyServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 4e642137..4454ffe5 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -195,7 +195,9 @@ public class StudyServiceImpl implements IStudyService{ " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"'" + " )"; + log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); + log.info("资源完成情况未开始人数"+list); List item = new ArrayList<>(); for (Object[] objs : list) { String sql2 = "select id, course_id, content_name, aname from boe_study_course_item where `status` !=2 and `status` !=9 and course_id = '" + courseId + "' and content_id = '"+contentId +"'"; @@ -208,6 +210,7 @@ public class StudyServiceImpl implements IStudyService{ item.add(sc); } } + log.info("资源完成情况未开始人员"+item); PageList pageList = new PageList<>(item); return pageList; } @@ -223,7 +226,9 @@ public class StudyServiceImpl implements IStudyService{ " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"'" + " )) a group by a.id"; + log.info("资源完成情况全部sql"+sql2); List list = scDao.sqlFindList(sql2); + log.info("资源完成情况人数"+list); List item = new ArrayList<>(); for (Object[] objs : list) { StudyCourseItem sc = new StudyCourseItem(); @@ -232,6 +237,7 @@ public class StudyServiceImpl implements IStudyService{ sc.setAname(objs[3].toString()); item.add(sc); } + log.info("资源完成情况人员"+item); PageList pageList = new PageList<>(item); return pageList; From 4c6480b428d6d4e664ed55e1982e99a453eb4dbe Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 17:56:59 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/study/service/impl/StudyServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 4454ffe5..dd8cc113 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -190,10 +190,10 @@ public class StudyServiceImpl implements IStudyService{ return scItemDao.findPage(query.builder()); }else if (status == 1) { String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname from boe_study_course bsc " + - " where bsc.course_id = '"+courseId+"' and bsc.id != (" + + " where bsc.course_id = '"+courseId+"' and bsc.id not in (" + " select bsc.id from boe_study_course bsc " + " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + - " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"'" + + " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + " )"; log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); @@ -217,15 +217,15 @@ public class StudyServiceImpl implements IStudyService{ } String sql2 = "select * from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status from boe_study_course bsc left join " + "boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + - "where bsc.`status` in (2,9) and bsc.course_id = '"+ courseId+"' " + + "where bsc.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id" + "UNION ALL " + " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " + " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " + - " where bsc.course_id = '"+courseId+"' and bsc.id != (" + + " where bsc.course_id = '"+courseId+"' and bsc.id not in (" + " select bsc.id from boe_study_course bsc " + " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + - " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"'" + - " )) a group by a.id"; + " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + + " )group by bsc.id) a group by a.id"; log.info("资源完成情况全部sql"+sql2); List list = scDao.sqlFindList(sql2); log.info("资源完成情况人数"+list); From 650107aea1497f683352fcd5ed68daa799c09daa Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 18:17:39 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xboe/school/study/service/impl/StudyServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index dd8cc113..c8d53e20 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -190,7 +190,7 @@ public class StudyServiceImpl implements IStudyService{ return scItemDao.findPage(query.builder()); }else if (status == 1) { String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname from boe_study_course bsc " + - " where bsc.course_id = '"+courseId+"' and bsc.id not in (" + + " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select bsc.id from boe_study_course bsc " + " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + @@ -200,7 +200,7 @@ public class StudyServiceImpl implements IStudyService{ log.info("资源完成情况未开始人数"+list); List item = new ArrayList<>(); for (Object[] objs : list) { - String sql2 = "select id, course_id, content_name, aname from boe_study_course_item where `status` !=2 and `status` !=9 and course_id = '" + courseId + "' and content_id = '"+contentId +"'"; + String sql2 = "select id, course_id, content_name, aname from boe_study_course_item where `status` !=2 and `status` !=9 and course_id = '" + courseId + "' and content_id = '"+contentId +"' group by id,course_id,content_id"; List itemList = scItemDao.sqlFindList(sql2);// 执行查询 if (itemList.isEmpty()) { StudyCourseItem sc = new StudyCourseItem(); @@ -217,8 +217,8 @@ public class StudyServiceImpl implements IStudyService{ } String sql2 = "select * from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status from boe_study_course bsc left join " + "boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + - "where bsc.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id" + - "UNION ALL " + + "where bsc.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id " + + " UNION ALL " + " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " + " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " + " where bsc.course_id = '"+courseId+"' and bsc.id not in (" + From 338a709ebc545d587893ee43dedf0870d6b25b87 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 18:36:47 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xboe/school/study/service/impl/StudyServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index c8d53e20..f1838802 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -191,16 +191,15 @@ public class StudyServiceImpl implements IStudyService{ }else if (status == 1) { String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname from boe_study_course bsc " + " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + - " select bsc.id from boe_study_course bsc " + - " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + - " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + + " select item.study_id from boe_study_course_item item " + + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + " )"; log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况未开始人数"+list); List item = new ArrayList<>(); + String sql2 = "select id, course_id, content_name, aname from boe_study_course_item where `status` !=2 and `status` !=9 and course_id = '" + courseId + "' and content_id = '"+contentId +"' group by id,course_id,content_id"; for (Object[] objs : list) { - String sql2 = "select id, course_id, content_name, aname from boe_study_course_item where `status` !=2 and `status` !=9 and course_id = '" + courseId + "' and content_id = '"+contentId +"' group by id,course_id,content_id"; List itemList = scItemDao.sqlFindList(sql2);// 执行查询 if (itemList.isEmpty()) { StudyCourseItem sc = new StudyCourseItem(); @@ -225,7 +224,7 @@ public class StudyServiceImpl implements IStudyService{ " select bsc.id from boe_study_course bsc " + " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + - " )group by bsc.id) a group by a.id"; + " )group by bsc.id) a group by a.id limit "+pageIndex+","+pageSize +""; log.info("资源完成情况全部sql"+sql2); List list = scDao.sqlFindList(sql2); log.info("资源完成情况人数"+list); From 30f8d363fa8eda9d022cd1b26be3fc12a06a515d Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 18:42:32 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/school/study/service/impl/StudyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index f1838802..da70ebd8 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -193,7 +193,7 @@ public class StudyServiceImpl implements IStudyService{ " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + - " )"; + " ) group by bsc.id"; log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况未开始人数"+list); From 7e1e32a70ef347bb094a2ec451c68cc3d4169f0c Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 18:45:12 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/study/service/impl/StudyServiceImpl.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index da70ebd8..c918698b 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -189,7 +189,7 @@ public class StudyServiceImpl implements IStudyService{ query.addFilter(FieldFilters.eq("status",9)); return scItemDao.findPage(query.builder()); }else if (status == 1) { - String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname from boe_study_course bsc " + + String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + @@ -198,16 +198,12 @@ public class StudyServiceImpl implements IStudyService{ List list = scDao.sqlFindList(sql); log.info("资源完成情况未开始人数"+list); List item = new ArrayList<>(); - String sql2 = "select id, course_id, content_name, aname from boe_study_course_item where `status` !=2 and `status` !=9 and course_id = '" + courseId + "' and content_id = '"+contentId +"' group by id,course_id,content_id"; for (Object[] objs : list) { - List itemList = scItemDao.sqlFindList(sql2);// 执行查询 - if (itemList.isEmpty()) { StudyCourseItem sc = new StudyCourseItem(); - sc.setProgress(0); - sc.setStatus(1); + sc.setProgress(Integer.valueOf(objs[5].toString())); + sc.setStatus(Integer.valueOf(objs[6].toString())); sc.setAname(objs[3].toString()); item.add(sc); - } } log.info("资源完成情况未开始人员"+item); PageList pageList = new PageList<>(item); From d0b1894c14034d047fd204e8caf097650ae23091 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 18:58:35 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../study/service/impl/StudyServiceImpl.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index c918698b..e2d4cb54 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -189,24 +189,25 @@ public class StudyServiceImpl implements IStudyService{ query.addFilter(FieldFilters.eq("status",9)); return scItemDao.findPage(query.builder()); }else if (status == 1) { - String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + + String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " + + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + " ) group by bsc.id"; log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); - log.info("资源完成情况未开始人数"+list); + log.info("资源完成情况人数"+list); List item = new ArrayList<>(); for (Object[] objs : list) { - StudyCourseItem sc = new StudyCourseItem(); - sc.setProgress(Integer.valueOf(objs[5].toString())); - sc.setStatus(Integer.valueOf(objs[6].toString())); - sc.setAname(objs[3].toString()); - item.add(sc); + StudyCourseItem sc = new StudyCourseItem(); + sc.setProgress(Integer.valueOf(objs[5].toString())); + sc.setStatus(Integer.valueOf(objs[6].toString())); + sc.setAname(objs[3].toString()); + item.add(sc); } - log.info("资源完成情况未开始人员"+item); - PageList pageList = new PageList<>(item); + log.info("资源完成情况人员"+item); + PageList pageList = new PageList<>(item,pageSize); return pageList; } } @@ -220,7 +221,7 @@ public class StudyServiceImpl implements IStudyService{ " select bsc.id from boe_study_course bsc " + " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + - " )group by bsc.id) a group by a.id limit "+pageIndex+","+pageSize +""; + " )group by bsc.id) a group by a.id"; log.info("资源完成情况全部sql"+sql2); List list = scDao.sqlFindList(sql2); log.info("资源完成情况人数"+list); @@ -233,7 +234,7 @@ public class StudyServiceImpl implements IStudyService{ item.add(sc); } log.info("资源完成情况人员"+item); - PageList pageList = new PageList<>(item); + PageList pageList = new PageList<>(item, pageSize); return pageList; } From 74f37b008d6affa05d140828345bee511a787f84 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 19:00:14 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/school/study/service/impl/StudyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index e2d4cb54..c1b09442 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -189,7 +189,7 @@ public class StudyServiceImpl implements IStudyService{ query.addFilter(FieldFilters.eq("status",9)); return scItemDao.findPage(query.builder()); }else if (status == 1) { - String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " + + String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + From c97cd3daabcfbec0792af2a310c7699323e25f00 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 20:24:17 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../study/service/impl/StudyServiceImpl.java | 71 ++++++++++++++----- 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index c1b09442..cf5b51e6 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -184,12 +184,21 @@ public class StudyServiceImpl implements IStudyService{ if(status!=null) { if(status==3) { query.addFilter(FieldFilters.eq("status", 2)); + query.addGroupBy("studyId"); return scItemDao.findPage(query.builder()); }else if(status==2){ query.addFilter(FieldFilters.eq("status",9)); + query.addGroupBy("studyId"); return scItemDao.findPage(query.builder()); }else if (status == 1) { String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + + " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + + " select item.study_id from boe_study_course_item item " + + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + + " ) group by bsc.id limit "+ pageIndex+","+ pageSize+";"; + + String sql2 = "select count(*) from boe_study_course bsc " + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + @@ -207,34 +216,62 @@ public class StudyServiceImpl implements IStudyService{ item.add(sc); } log.info("资源完成情况人员"+item); - PageList pageList = new PageList<>(item,pageSize); + PageList pageList = new PageList<>(item); return pageList; } } - String sql2 = "select * from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status from boe_study_course bsc left join " + - "boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + - "where bsc.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id " + - " UNION ALL " + - " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " + - " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " + - " where bsc.course_id = '"+courseId+"' and bsc.id not in (" + - " select bsc.id from boe_study_course bsc " + - " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + - " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + - " )group by bsc.id) a group by a.id"; - log.info("资源完成情况全部sql"+sql2); - List list = scDao.sqlFindList(sql2); +// String sql = "select * from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status from boe_study_course bsc left join " + +// "boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + +// "where bsc.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id " + +// " UNION ALL " + +// " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " + +// " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " + +// " where bsc.course_id = '"+courseId+"' and bsc.id not in (" + +// " select bsc.id from boe_study_course bsc " + +// " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + +// " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + +// " )group by bsc.id) a group by a.id limit "+ pageIndex+","+ pageSize+";"; + +// String sql2 = "select count(*) from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status from boe_study_course bsc left join " + +// "boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + +// "where bsc.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id " + +// " UNION ALL " + +// " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " + +// " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " + +// " where bsc.course_id = '"+courseId+"' and bsc.id not in (" + +// " select bsc.id from boe_study_course bsc " + +// " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + +// " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + +// " )group by bsc.id) a group by a.id"; + String sql = "select a.id,a.course_id,a.course_name,a.aname,ifnull(b.finish_time,0) as finish_time,ifnull(b.progress,0) as progress,ifnull(b.status,0) as status " + + " from (select id,course_id,course_name,aname,0,1 from boe_study_course where course_id = ‘"+courseId+"')a " + + " left join" + + " (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.finish_time,item.progress,item.status" + + " from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id" + + " where bsc.course_id = '"+courseId +"' and item.content_id = '"+ contentId+"' group by bsc.id)b group by a.id"; + String sql2 = "select count(*) as status " + + " from (select id,course_id,course_name,aname,0,1 from boe_study_course where course_id = ‘"+courseId+"')a " + + " left join" + + " (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.finish_time,item.progress,item.status" + + " from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id" + + " where bsc.course_id = '"+courseId +"' and item.content_id = '"+ contentId+"' group by bsc.id)b group by a.id"; + log.info("资源完成情况全部sql"+sql); + List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); List item = new ArrayList<>(); for (Object[] objs : list) { StudyCourseItem sc = new StudyCourseItem(); - sc.setProgress(Integer.valueOf(objs[4].toString())); - sc.setStatus(Integer.valueOf(objs[5].toString())); + sc.setFinishTime(LocalDateTime.parse(objs[4].toString())); + sc.setProgress(Integer.valueOf(objs[5].toString())); + sc.setStatus(Integer.valueOf(objs[6].toString())); sc.setAname(objs[3].toString()); item.add(sc); } log.info("资源完成情况人员"+item); - PageList pageList = new PageList<>(item, pageSize); + PageList pageList = new PageList<>(item); + pageList.setCount(Integer.parseInt(sql2)); + pageList.setPageSize(pageSize); + pageList.setList(item); return pageList; } From e4f845fddebb382a5e1eea174992a606842e99b6 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 20:36:28 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/study/service/impl/StudyServiceImpl.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index cf5b51e6..22a65aa2 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -196,7 +196,7 @@ public class StudyServiceImpl implements IStudyService{ " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + - " ) group by bsc.id limit "+ pageIndex+","+ pageSize+";"; + " ) group by bsc.id"; String sql2 = "select count(*) from boe_study_course bsc " + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + @@ -243,18 +243,23 @@ public class StudyServiceImpl implements IStudyService{ // " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + // " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + // " )group by bsc.id) a group by a.id"; - String sql = "select a.id,a.course_id,a.course_name,a.aname,ifnull(b.finish_time,0) as finish_time,ifnull(b.progress,0) as progress,ifnull(b.status,0) as status " + + String sql = "select a.id,a.course_id,a.course_name,a.aname," + + " IFNULL(b.finish_time,0) as finish_time,IFNULL(b.progress,0) as progress,IFNULL(b.status,1) as status " + " from (select id,course_id,course_name,aname,0,1 from boe_study_course where course_id = ‘"+courseId+"')a " + " left join" + " (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.finish_time,item.progress,item.status" + " from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id" + - " where bsc.course_id = '"+courseId +"' and item.content_id = '"+ contentId+"' group by bsc.id)b group by a.id"; + " where bsc.course_id = '"+courseId +"' and item.content_id = '"+contentId+"' group by bsc.id)b " + + " on a.course_id = b.course_id and a.id = b.id" + + " group by a.id"; String sql2 = "select count(*) as status " + " from (select id,course_id,course_name,aname,0,1 from boe_study_course where course_id = ‘"+courseId+"')a " + " left join" + " (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.finish_time,item.progress,item.status" + " from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id" + - " where bsc.course_id = '"+courseId +"' and item.content_id = '"+ contentId+"' group by bsc.id)b group by a.id"; + " where bsc.course_id = '"+courseId +"' and item.content_id = '"+ contentId+"' group by bsc.id)b " + + " on a.course_id = b.course_id and a.id = b.id" + + " group by a.id"; log.info("资源完成情况全部sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); From e6f4affa2159c6bef94280cb0ccd7701bfa21706 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 20:51:55 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../study/service/impl/StudyServiceImpl.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 22a65aa2..22cb9484 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -196,7 +196,7 @@ public class StudyServiceImpl implements IStudyService{ " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + - " ) group by bsc.id"; + " ) group by bsc.id limit "+ pageIndex+","+ pageSize+";"; String sql2 = "select count(*) from boe_study_course bsc " + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + @@ -217,6 +217,9 @@ public class StudyServiceImpl implements IStudyService{ } log.info("资源完成情况人员"+item); PageList pageList = new PageList<>(item); + pageList.setCount(Integer.parseInt(sql2)); + pageList.setPageSize(pageSize); + pageList.setList(item); return pageList; } } @@ -243,23 +246,23 @@ public class StudyServiceImpl implements IStudyService{ // " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + // " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + // " )group by bsc.id) a group by a.id"; - String sql = "select a.id,a.course_id,a.course_name,a.aname," + - " IFNULL(b.finish_time,0) as finish_time,IFNULL(b.progress,0) as progress,IFNULL(b.status,1) as status " + - " from (select id,course_id,course_name,aname,0,1 from boe_study_course where course_id = ‘"+courseId+"')a " + - " left join" + - " (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.finish_time,item.progress,item.status" + - " from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id" + - " where bsc.course_id = '"+courseId +"' and item.content_id = '"+contentId+"' group by bsc.id)b " + - " on a.course_id = b.course_id and a.id = b.id" + - " group by a.id"; - String sql2 = "select count(*) as status " + - " from (select id,course_id,course_name,aname,0,1 from boe_study_course where course_id = ‘"+courseId+"')a " + - " left join" + - " (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.finish_time,item.progress,item.status" + - " from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id" + - " where bsc.course_id = '"+courseId +"' and item.content_id = '"+ contentId+"' group by bsc.id)b " + - " on a.course_id = b.course_id and a.id = b.id" + - " group by a.id"; + String sql = "select a.id, a.course_id, a.course_name, a.aname, " + + "IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " + + "left join " + + "(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " + + "from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + + "where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' group by bsc.id) b " + + "on a.course_id = b.course_id and a.id = b.id " + + "group by a.id"; + String sql2 = "select count(*) " + + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " + + "left join " + + "(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " + + "from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + + "where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' group by bsc.id) b " + + "on a.course_id = b.course_id and a.id = b.id " + + "group by a.id"; log.info("资源完成情况全部sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); From 885b203dd6b4fc1217d2b93ce844a666d93dcb79 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 21:17:35 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../study/service/impl/StudyServiceImpl.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 22cb9484..3afdf805 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -2,6 +2,7 @@ package com.xboe.school.study.service.impl; import java.math.BigInteger; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -198,12 +199,12 @@ public class StudyServiceImpl implements IStudyService{ " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + " ) group by bsc.id limit "+ pageIndex+","+ pageSize+";"; - String sql2 = "select count(*) from boe_study_course bsc " + + String sql2 = "select count(*) as total from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + - " ) group by bsc.id"; + " ) group by bsc.id) as total;"; log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); @@ -255,21 +256,24 @@ public class StudyServiceImpl implements IStudyService{ "where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' group by bsc.id) b " + "on a.course_id = b.course_id and a.id = b.id " + "group by a.id"; - String sql2 = "select count(*) " + + String sql2 = "select count(*) as total from (select a.id, a.course_id, a.course_name, a.aname, " + + "IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " + "left join " + "(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " + "from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + "where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' group by bsc.id) b " + "on a.course_id = b.course_id and a.id = b.id " + - "group by a.id"; + "group by a.id) as total"; log.info("资源完成情况全部sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); List item = new ArrayList<>(); for (Object[] objs : list) { StudyCourseItem sc = new StudyCourseItem(); - sc.setFinishTime(LocalDateTime.parse(objs[4].toString())); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + LocalDateTime finishTime = LocalDateTime.parse(objs[4].toString(), formatter); + sc.setFinishTime(finishTime); sc.setProgress(Integer.valueOf(objs[5].toString())); sc.setStatus(Integer.valueOf(objs[6].toString())); sc.setAname(objs[3].toString()); From 3ec7f587b3aaf185071ad08c15d94a472b347add Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 21:36:23 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../study/service/impl/StudyServiceImpl.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 3afdf805..d3804e63 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -208,6 +208,7 @@ public class StudyServiceImpl implements IStudyService{ log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); + int totalCount = scDao.count(sql2); List item = new ArrayList<>(); for (Object[] objs : list) { StudyCourseItem sc = new StudyCourseItem(); @@ -218,7 +219,7 @@ public class StudyServiceImpl implements IStudyService{ } log.info("资源完成情况人员"+item); PageList pageList = new PageList<>(item); - pageList.setCount(Integer.parseInt(sql2)); + pageList.setCount(totalCount); pageList.setPageSize(pageSize); pageList.setList(item); return pageList; @@ -248,7 +249,7 @@ public class StudyServiceImpl implements IStudyService{ // " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + // " )group by bsc.id) a group by a.id"; String sql = "select a.id, a.course_id, a.course_name, a.aname, " + - "IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + + "IFNULL(b.finish_time, null) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " + "left join " + "(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " + @@ -268,12 +269,14 @@ public class StudyServiceImpl implements IStudyService{ log.info("资源完成情况全部sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); + int totalCount = scDao.count(sql2); List item = new ArrayList<>(); for (Object[] objs : list) { StudyCourseItem sc = new StudyCourseItem(); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - LocalDateTime finishTime = LocalDateTime.parse(objs[4].toString(), formatter); - sc.setFinishTime(finishTime); + if (!"0".equals(objs[4].toString())) { + LocalDateTime finishTime = LocalDateTime.parse(objs[4].toString()); + sc.setFinishTime(finishTime); + } sc.setProgress(Integer.valueOf(objs[5].toString())); sc.setStatus(Integer.valueOf(objs[6].toString())); sc.setAname(objs[3].toString()); @@ -281,7 +284,7 @@ public class StudyServiceImpl implements IStudyService{ } log.info("资源完成情况人员"+item); PageList pageList = new PageList<>(item); - pageList.setCount(Integer.parseInt(sql2)); + pageList.setCount(totalCount); pageList.setPageSize(pageSize); pageList.setList(item); return pageList; From 50942a9435c21a7654b0d24064b071ab5e31524a Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 21:50:40 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xboe/school/study/service/impl/StudyServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index d3804e63..11731bb0 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -204,11 +204,11 @@ public class StudyServiceImpl implements IStudyService{ " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + - " ) group by bsc.id) as total;"; + " ) group by bsc.id) as total"; log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); - int totalCount = scDao.count(sql2); + int totalCount = scDao.sqlCount(sql2); List item = new ArrayList<>(); for (Object[] objs : list) { StudyCourseItem sc = new StudyCourseItem(); @@ -249,7 +249,7 @@ public class StudyServiceImpl implements IStudyService{ // " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + // " )group by bsc.id) a group by a.id"; String sql = "select a.id, a.course_id, a.course_name, a.aname, " + - "IFNULL(b.finish_time, null) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + + "IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " + "left join " + "(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " + @@ -269,7 +269,7 @@ public class StudyServiceImpl implements IStudyService{ log.info("资源完成情况全部sql"+sql); List list = scDao.sqlFindList(sql); log.info("资源完成情况人数"+list); - int totalCount = scDao.count(sql2); + int totalCount = scDao.sqlCount(sql2); List item = new ArrayList<>(); for (Object[] objs : list) { StudyCourseItem sc = new StudyCourseItem(); From 5890f1b8004f6d547bba7f7804d2a973be5d2534 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 22:04:37 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/study/service/impl/StudyServiceImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 11731bb0..16fa2805 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -184,12 +184,11 @@ public class StudyServiceImpl implements IStudyService{ } if(status!=null) { if(status==3) { - query.addFilter(FieldFilters.eq("status", 2)); - query.addGroupBy("studyId"); + query.addFilter(FieldFilters.gt("progress", 0)); + query.addFilter(FieldFilters.eq("progress", 100)); return scItemDao.findPage(query.builder()); }else if(status==2){ - query.addFilter(FieldFilters.eq("status",9)); - query.addGroupBy("studyId"); + query.addFilter(FieldFilters.eq("progress",100)); return scItemDao.findPage(query.builder()); }else if (status == 1) { String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + @@ -249,14 +248,14 @@ public class StudyServiceImpl implements IStudyService{ // " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + // " )group by bsc.id) a group by a.id"; String sql = "select a.id, a.course_id, a.course_name, a.aname, " + - "IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + + "IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " + "left join " + "(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " + "from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + "where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' group by bsc.id) b " + "on a.course_id = b.course_id and a.id = b.id " + - "group by a.id"; + "group by a.id limit "+ pageIndex+","+ pageSize+";"; String sql2 = "select count(*) as total from (select a.id, a.course_id, a.course_name, a.aname, " + "IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " + From 2f8163b0a37a36446845e87c3a306eaac28ac226 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 22:10:47 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/school/study/service/impl/StudyServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 16fa2805..e3691a29 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -185,7 +185,7 @@ public class StudyServiceImpl implements IStudyService{ if(status!=null) { if(status==3) { query.addFilter(FieldFilters.gt("progress", 0)); - query.addFilter(FieldFilters.eq("progress", 100)); + query.addFilter(FieldFilters.lt("progress", 100)); return scItemDao.findPage(query.builder()); }else if(status==2){ query.addFilter(FieldFilters.eq("progress",100)); @@ -273,7 +273,8 @@ public class StudyServiceImpl implements IStudyService{ for (Object[] objs : list) { StudyCourseItem sc = new StudyCourseItem(); if (!"0".equals(objs[4].toString())) { - LocalDateTime finishTime = LocalDateTime.parse(objs[4].toString()); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + LocalDateTime finishTime = LocalDateTime.parse(objs[4].toString(), formatter); sc.setFinishTime(finishTime); } sc.setProgress(Integer.valueOf(objs[5].toString())); From 072ee2503782aa61900c7387987abaa9c566c388 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 22:15:44 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/school/study/service/impl/StudyServiceImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index e3691a29..3880ab13 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -184,11 +184,10 @@ public class StudyServiceImpl implements IStudyService{ } if(status!=null) { if(status==3) { - query.addFilter(FieldFilters.gt("progress", 0)); - query.addFilter(FieldFilters.lt("progress", 100)); + query.addFilter(FieldFilters.gt("status", 2)); return scItemDao.findPage(query.builder()); }else if(status==2){ - query.addFilter(FieldFilters.eq("progress",100)); + query.addFilter(FieldFilters.eq("status",9)); return scItemDao.findPage(query.builder()); }else if (status == 1) { String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + From 4687b353ebd826a6ee5611ea14c31bb99f03f7e9 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 26 Jul 2024 22:19:59 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/school/study/service/impl/StudyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 3880ab13..27b33f44 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -184,7 +184,7 @@ public class StudyServiceImpl implements IStudyService{ } if(status!=null) { if(status==3) { - query.addFilter(FieldFilters.gt("status", 2)); + query.addFilter(FieldFilters.eq("status", 2)); return scItemDao.findPage(query.builder()); }else if(status==2){ query.addFilter(FieldFilters.eq("status",9)); From 687cd24de316cc816bcd53a3e42da88720cfd508 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Mon, 29 Jul 2024 09:34:40 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xboe/school/study/service/impl/StudyServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 27b33f44..0534e358 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -182,6 +182,7 @@ public class StudyServiceImpl implements IStudyService{ if(StringUtils.isNotBlank(name)) { query.addFilter(FieldFilters.eq("aname", name)); } + int pageIndex2 = pageIndex-1; if(status!=null) { if(status==3) { query.addFilter(FieldFilters.eq("status", 2)); @@ -195,7 +196,7 @@ public class StudyServiceImpl implements IStudyService{ " where bsc.course_id = '"+courseId+"' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" + - " ) group by bsc.id limit "+ pageIndex+","+ pageSize+";"; + " ) group by bsc.id limit "+ pageIndex2+","+ pageSize+";"; String sql2 = "select count(*) as total from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + @@ -246,6 +247,7 @@ public class StudyServiceImpl implements IStudyService{ // " left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + // " where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by bsc.id" + // " )group by bsc.id) a group by a.id"; + String sql = "select a.id, a.course_id, a.course_name, a.aname, " + "IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " + @@ -254,7 +256,7 @@ public class StudyServiceImpl implements IStudyService{ "from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " + "where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' group by bsc.id) b " + "on a.course_id = b.course_id and a.id = b.id " + - "group by a.id limit "+ pageIndex+","+ pageSize+";"; + "group by a.id limit "+ pageIndex2+","+ pageSize+";"; String sql2 = "select count(*) as total from (select a.id, a.course_id, a.course_name, a.aname, " + "IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " + "from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " +