大数据与最优化研究所 hai 1 ano
pai
achega
b7aa054aa7

+ 7 - 5
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

@@ -40,10 +40,7 @@ import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.textbook.dto.*;
 import com.xjrsoft.module.textbook.entity.*;
 import com.xjrsoft.module.textbook.mapper.*;
-import com.xjrsoft.module.textbook.service.ITextbookService;
-import com.xjrsoft.module.textbook.service.ITextbookWarehouseRecordService;
-import com.xjrsoft.module.textbook.service.IWfExerciseBookService;
-import com.xjrsoft.module.textbook.service.IWfTextbookSubscriptionService;
+import com.xjrsoft.module.textbook.service.*;
 import com.xjrsoft.module.textbook.vo.*;
 import lombok.AllArgsConstructor;
 import org.apache.poi.ss.usermodel.BorderStyle;
@@ -96,6 +93,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
 
     private final BaseSemesterMapper baseSemesterMapper;
 
+    private final ITextbookCoreAttributeService textbookCoreAttributeService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -836,7 +834,6 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
             TextbookCoreAttribute textbookCoreAttribute = new TextbookCoreAttribute();
             BeanUtils.copyProperties(textbookImportDto, textbookCoreAttribute);
 
-
             Textbook textbook = new Textbook();
             BeanUtils.copyProperties(textbookImportDto, textbook);
 
@@ -902,6 +899,8 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
 
             Textbook oldTextbook = this.getOne(textbookLambdaQueryWrapper);
 
+
+
             // 已经存在,更新数据
             if (oldTextbook != null) {
                 // 更新教材数据
@@ -923,6 +922,9 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                     }});
                 }
             } else {
+                textbookCoreAttributeService.save(textbookCoreAttribute);
+
+                textbook.setTextbookCoreAttributeId(textbookCoreAttribute.getId());
                 // 插入教材数据
                 textbookTextbookMapper.insert(textbook);