From 81b6f1cc38a941b65f989ecdd40529f2648bdd8c Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 04 六月 2024 11:42:47 +0800
Subject: [PATCH] 班级成员管理代码生成,成员管理查询数据接口

---
 src/main/java/com/ycl/jxkg/service/impl/TaskExamCustomerAnswerImpl.java |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/ycl/jxkg/service/impl/TaskExamCustomerAnswerImpl.java b/src/main/java/com/ycl/jxkg/service/impl/TaskExamCustomerAnswerImpl.java
index e2b2a2c..71dbd38 100644
--- a/src/main/java/com/ycl/jxkg/service/impl/TaskExamCustomerAnswerImpl.java
+++ b/src/main/java/com/ycl/jxkg/service/impl/TaskExamCustomerAnswerImpl.java
@@ -1,15 +1,16 @@
 package com.ycl.jxkg.service.impl;
 
-import com.ycl.jxkg.domain.ExamPaper;
-import com.ycl.jxkg.domain.ExamPaperAnswer;
-import com.ycl.jxkg.domain.TaskExamCustomerAnswer;
-import com.ycl.jxkg.domain.TextContent;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ycl.jxkg.domain.entity.ExamPaper;
+import com.ycl.jxkg.domain.entity.ExamPaperAnswer;
+import com.ycl.jxkg.domain.entity.TaskExamCustomerAnswer;
+import com.ycl.jxkg.domain.entity.TextContent;
 import com.ycl.jxkg.domain.task.TaskItemAnswerObject;
 import com.ycl.jxkg.mapper.TaskExamCustomerAnswerMapper;
 import com.ycl.jxkg.service.TaskExamCustomerAnswerService;
 import com.ycl.jxkg.service.TextContentService;
 import com.ycl.jxkg.utils.JsonUtil;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
 import java.util.Arrays;
@@ -17,17 +18,11 @@
 import java.util.List;
 
 @Service
-public class TaskExamCustomerAnswerImpl extends BaseServiceImpl<TaskExamCustomerAnswer> implements TaskExamCustomerAnswerService {
+@RequiredArgsConstructor
+public class TaskExamCustomerAnswerImpl extends ServiceImpl<TaskExamCustomerAnswerMapper, TaskExamCustomerAnswer> implements TaskExamCustomerAnswerService {
 
     private final TaskExamCustomerAnswerMapper taskExamCustomerAnswerMapper;
     private final TextContentService textContentService;
-
-    @Autowired
-    public TaskExamCustomerAnswerImpl(TaskExamCustomerAnswerMapper taskExamCustomerAnswerMapper, TextContentService textContentService) {
-        super(taskExamCustomerAnswerMapper);
-        this.taskExamCustomerAnswerMapper = taskExamCustomerAnswerMapper;
-        this.textContentService = textContentService;
-    }
 
     @Override
     public void insertOrUpdate(ExamPaper examPaper, ExamPaperAnswer examPaperAnswer, Date now) {
@@ -45,11 +40,11 @@
             taskItemAnswerObject.setStatus(examPaperAnswer.getStatus());
             List<TaskItemAnswerObject> taskItemAnswerObjects = Arrays.asList(taskItemAnswerObject);
             TextContent textContent = textContentService.jsonConvertInsert(taskItemAnswerObjects, now, null);
-            textContentService.insertByFilter(textContent);
+            textContentService.save(textContent);
             taskExamCustomerAnswer.setTextContentId(textContent.getId());
-            insertByFilter(taskExamCustomerAnswer);
+            baseMapper.insert(taskExamCustomerAnswer);
         } else {
-            TextContent textContent = textContentService.selectById(taskExamCustomerAnswer.getTextContentId());
+            TextContent textContent = textContentService.getById(taskExamCustomerAnswer.getTextContentId());
             List<TaskItemAnswerObject> taskItemAnswerObjects = JsonUtil.toJsonListObject(textContent.getContent(), TaskItemAnswerObject.class);
             TaskItemAnswerObject taskItemAnswerObject = new TaskItemAnswerObject();
             taskItemAnswerObject.setExamPaperId(examPaperAnswer.getExamPaperId());
@@ -57,7 +52,7 @@
             taskItemAnswerObject.setStatus(examPaperAnswer.getStatus());
             taskItemAnswerObjects.add(taskItemAnswerObject);
             textContentService.jsonConvertUpdate(textContent, taskItemAnswerObjects, null);
-            textContentService.updateByIdFilter(textContent);
+            textContentService.updateById(textContent);
         }
     }
 

--
Gitblit v1.8.0