BaseStudentAssessmentClassRelationServiceImpl.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package com.xjrsoft.module.student.service.impl;
  2. import cn.hutool.core.convert.Convert;
  3. import cn.hutool.core.util.ObjectUtil;
  4. import cn.hutool.core.util.StrUtil;
  5. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  6. import com.github.yulichang.toolkit.MPJWrappers;
  7. import com.xjrsoft.common.utils.VoToColumnUtil;
  8. import com.xjrsoft.module.base.entity.BaseClass;
  9. import com.xjrsoft.module.base.mapper.BaseClassMapper;
  10. import com.xjrsoft.module.form.entity.FormHistory;
  11. import com.xjrsoft.module.student.entity.BaseStudentAssessmentClassRelation;
  12. import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
  13. import com.xjrsoft.module.student.mapper.BaseStudentAssessmentClassRelationMapper;
  14. import com.xjrsoft.module.student.service.IBaseStudentAssessmentClassRelationService;
  15. import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
  16. import com.xjrsoft.module.student.vo.BaseStudentAssessmentCategoryListVo;
  17. import com.xjrsoft.module.teacher.entity.XjrUser;
  18. import com.xjrsoft.module.teacher.mapper.XjrUserMapper;
  19. import lombok.AllArgsConstructor;
  20. import org.springframework.stereotype.Service;
  21. import java.util.List;
  22. import java.util.Map;
  23. import java.util.stream.Collectors;
  24. /**
  25. * @title: 学生班级巡查考核-关联班级
  26. * @Author fanxp
  27. * @Date: 2023-11-16
  28. * @Version 1.0
  29. */
  30. @Service
  31. @AllArgsConstructor
  32. public class BaseStudentAssessmentClassRelationServiceImpl extends ServiceImpl<BaseStudentAssessmentClassRelationMapper, BaseStudentAssessmentClassRelation> implements IBaseStudentAssessmentClassRelationService {
  33. private final IBaseStudentAssessmentInspectionService baseStudentAssessmentInspectionService;
  34. private final BaseStudentAssessmentClassRelationMapper baseStudentAssessmentClassRelationMapper;
  35. @Override
  36. public Boolean dataCache(Long dataId) {
  37. BaseStudentAssessmentInspection baseStudentAssessmentInspection = baseStudentAssessmentInspectionService.getById(dataId);
  38. List<String> classIdList = StrUtil.split(baseStudentAssessmentInspection.getClassIds(), ",");
  39. for (String classId : classIdList) {
  40. BaseStudentAssessmentClassRelation classRelation = new BaseStudentAssessmentClassRelation();
  41. Long classIdAsLong = Convert.toLong(classId);
  42. classRelation.setClassId(classIdAsLong);
  43. classRelation.setBaseStudentAssessmentInspectionId(dataId);
  44. baseStudentAssessmentClassRelationMapper.insert(classRelation);
  45. }
  46. return true;
  47. }
  48. }