From 49aab7446349ed4dab1390ac93aae49f61a3b168 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 2 Aug 2024 13:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=A4=9A=E6=AC=A1=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=8F=90=E4=BA=A4=E6=8A=A5=E9=94=99=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../study/service/impl/StudyHomeWorkServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyHomeWorkServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyHomeWorkServiceImpl.java index 0ce54bc5..39463f2d 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyHomeWorkServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyHomeWorkServiceImpl.java @@ -41,8 +41,8 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{ //完成处理,判断是否已存在 Object obj=scItemDao.findField("id", FieldFilters.eq("studyId", homework.getStudyId()), FieldFilters.eq("contentId", homework.getContentId())); - StudyCourseItem sci=new StudyCourseItem(); if(obj==null) { + StudyCourseItem sci=new StudyCourseItem(); LocalDateTime ldt=LocalDateTime.now(); sci.setStudyId(homework.getStudyId()); sci.setContentId(homework.getContentId()); @@ -68,7 +68,13 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{ //dao.save(homework); //设置id。然后进行悠 homework.setId(obj.toString()); - homework.setStudyItemId(sci.getId()); + String sql = "select id,content_id,course_id,hw_name,study_id,study_item_id from boe_study_homework where content_id = '"+homework.getContentId()+"' and study_id = '"+homework.getStudyId()+"' and course_id = '"+homework.getCourseId()+"'";; + if (!sql.isEmpty()) { + List list = dao.sqlFindList(sql); + for (Object[] objs : list) { + homework.setStudyItemId(objs[5].toString()); + } + } dao.update(homework); } }