|
|
@@ -24,6 +24,9 @@ import com.xjrsoft.module.base.service.IBaseClassroomService;
|
|
|
import com.xjrsoft.module.base.service.IBaseMajorSetService;
|
|
|
import com.xjrsoft.module.organization.entity.User;
|
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
|
+import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
+import com.xjrsoft.module.system.entity.DictionaryItem;
|
|
|
+import com.xjrsoft.module.system.mapper.DictionarydetailMapper;
|
|
|
import com.xjrsoft.module.teacher.entity.BaseTeacher;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -51,6 +54,7 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
|
|
|
private final IBaseClassroomService classroomService;
|
|
|
private final IUserService userService;
|
|
|
private final IBaseMajorSetService majorSetService;
|
|
|
+ private final DictionarydetailMapper detailMapper;
|
|
|
@Override
|
|
|
public Boolean add(BandingTaskClass bandingTaskClass) {
|
|
|
bandingTaskClass.setCreateDate(new Date());
|
|
|
@@ -146,8 +150,14 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
|
|
|
for (BaseMajorSet majorSet : majorSetList) {
|
|
|
majorSetMap.put(majorSet.getName(), majorSet.getId());
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ List<DictionaryDetail> classType = detailMapper.selectJoinList(DictionaryDetail.class,
|
|
|
+ new MPJLambdaWrapper<DictionaryDetail>()
|
|
|
+ .select(DictionaryDetail::getId)
|
|
|
+ .select(DictionaryDetail.class, x -> VoToColumnUtil.fieldsToColumns(DictionaryDetail.class).contains(x.getProperty()))
|
|
|
+ .innerJoin(DictionaryItem.class, DictionaryItem::getId, DictionaryDetail::getItemId)
|
|
|
+ .eq(DictionaryItem::getCode, "class_type")
|
|
|
+ );
|
|
|
+ Map<String, String> classTypeMap = classType.stream().collect(Collectors.toMap(DictionaryDetail::getName, DictionaryDetail::getCode));
|
|
|
List<BandingTaskClass> classList = new ArrayList<>();
|
|
|
Date createDate = new Date();
|
|
|
for (Map<Integer, Object> taskClass : excelDataList) {
|
|
|
@@ -159,10 +169,13 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
|
|
|
setNumber(Integer.parseInt(taskClass.get(2).toString()));
|
|
|
setClassroomId(classroomMap.get(taskClass.get(4).toString()));
|
|
|
if(taskClass.get(5) != null){
|
|
|
- setIsOrderClass(YesOrNoEnum.getCode(taskClass.get(5).toString()));
|
|
|
+ setClassType(classTypeMap.get(taskClass.get(5).toString()));
|
|
|
}
|
|
|
if(taskClass.get(6) != null){
|
|
|
- setSortCode(Integer.parseInt(taskClass.get(6).toString()));
|
|
|
+ setIsOrderClass(YesOrNoEnum.getCode(taskClass.get(6).toString()));
|
|
|
+ }
|
|
|
+ if(taskClass.get(7) != null){
|
|
|
+ setSortCode(Integer.parseInt(taskClass.get(7).toString()));
|
|
|
}
|
|
|
setTeacherId(userMap.get(taskClass.get(3).toString()));
|
|
|
}});
|