123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package com.xjrsoft.module.student.service.impl;
- import cn.hutool.core.convert.Convert;
- import cn.hutool.core.util.ObjectUtil;
- import cn.hutool.core.util.StrUtil;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import com.github.yulichang.toolkit.MPJWrappers;
- import com.xjrsoft.common.utils.VoToColumnUtil;
- import com.xjrsoft.module.base.entity.BaseClass;
- import com.xjrsoft.module.base.mapper.BaseClassMapper;
- import com.xjrsoft.module.form.entity.FormHistory;
- import com.xjrsoft.module.student.entity.BaseStudentAssessmentClassRelation;
- import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
- import com.xjrsoft.module.student.mapper.BaseStudentAssessmentClassRelationMapper;
- import com.xjrsoft.module.student.service.IBaseStudentAssessmentClassRelationService;
- import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
- import com.xjrsoft.module.student.vo.BaseStudentAssessmentCategoryListVo;
- import com.xjrsoft.module.teacher.entity.XjrUser;
- import com.xjrsoft.module.teacher.mapper.XjrUserMapper;
- import lombok.AllArgsConstructor;
- import org.springframework.stereotype.Service;
- import java.util.List;
- import java.util.Map;
- import java.util.stream.Collectors;
- /**
- * @title: 学生班级巡查考核-关联班级
- * @Author fanxp
- * @Date: 2023-11-16
- * @Version 1.0
- */
- @Service
- @AllArgsConstructor
- public class BaseStudentAssessmentClassRelationServiceImpl extends ServiceImpl<BaseStudentAssessmentClassRelationMapper, BaseStudentAssessmentClassRelation> implements IBaseStudentAssessmentClassRelationService {
- private final IBaseStudentAssessmentInspectionService baseStudentAssessmentInspectionService;
- private final BaseStudentAssessmentClassRelationMapper baseStudentAssessmentClassRelationMapper;
- @Override
- public Boolean dataCache(Long dataId) {
- BaseStudentAssessmentInspection baseStudentAssessmentInspection = baseStudentAssessmentInspectionService.getById(dataId);
- List<String> classIdList = StrUtil.split(baseStudentAssessmentInspection.getClassIds(), ",");
- for (String classId : classIdList) {
- BaseStudentAssessmentClassRelation classRelation = new BaseStudentAssessmentClassRelation();
- Long classIdAsLong = Convert.toLong(classId);
- classRelation.setClassId(classIdAsLong);
- classRelation.setBaseStudentAssessmentInspectionId(dataId);
- baseStudentAssessmentClassRelationMapper.insert(classRelation);
- }
- return true;
- }
- }
|