提交 1f662fd3 authored 作者: zhouzhigang's avatar zhouzhigang

--no commit message

上级 e517349f
......@@ -161,7 +161,7 @@ public interface FgBasicTeachingPlanMapper extends BaseMapper<BasicTeachingPlan>
@Select(" <script> "
+ " SELECT "
+ " p.courseDesign,p.num,p.lessonType,p.theoryClassHour,p.trainingHours,p.relationId,p.type,p.id AS lessonId,p.basicPlanId as basicPlanId, "
+ " t.majorId "
+ " t.majorId,pcr.semester,t.academicLevel "
+ " FROM "
+ " me_public_lessons p "
+ " LEFT JOIN me_basic_teaching_plan t ON p.basicPlanId = t.id "
......@@ -179,7 +179,7 @@ public interface FgBasicTeachingPlanMapper extends BaseMapper<BasicTeachingPlan>
+ " SELECT "
+ " p.courseDesign,p.num,p.lessonType,p.theoryClassHour,p.trainingHours,p.relationId,p.type, p.id AS lessonId,"
+ " CONCAT(case when p.basicPlanId is null then s.basicPlanId else p.basicPlanId end) as basicPlanId, "
+ " t.majorId "
+ " t.majorId,pcr.semester,t.academicLevel "
+ " FROM "
+ " me_public_lessons_plan_relation s "
+ " LEFT JOIN me_public_lessons p ON s.publicLessonId = p.id "
......@@ -205,7 +205,7 @@ public interface FgBasicTeachingPlanMapper extends BaseMapper<BasicTeachingPlan>
@Select(" <script> "
+ " SELECT "
+ " p.courseDesign,p.num,p.lessonType,p.theoryClassHour,p.trainingHours,p.relationId,p.type,p.id AS lessonId,p.basicPlanId as basicPlanId, "
+ " t.majorId "
+ " t.majorId,t.academicLevel,pcr.semester "
+ " FROM "
+ " me_public_lessons p "
+ " LEFT JOIN me_basic_teaching_plan t ON p.basicPlanId = t.id "
......@@ -374,4 +374,9 @@ public interface FgBasicTeachingPlanMapper extends BaseMapper<BasicTeachingPlan>
@Select(" SELECT academicLevel FROM me_basic_teaching_plan WHERE relationId = #{relationId} AND TYPE = #{type} GROUP BY academicLevel having academicLevel is not null ")
List<IdAndNameVo> getBasicList(@Param("relationId") Integer relationId,@Param("type") String type);
}
......@@ -21,6 +21,7 @@ import com.zrqx.core.util.bean.BeanUtils;
import com.zrqx.core.util.response.CallBack;
import com.zrqx.core.vo.member.department.DepartmentMemberVo;
import com.zrqx.core.vo.resource.fg.goods.phy.ResourceSearchVo;
import com.zrqx.core.vo.schoolsysuser.fg.IdAndNameVo;
import com.zrqx.core.vo.schoolsysuser.fg.biddingflow.CycleStatusAndFlowCodeVo;
import com.zrqx.core.vo.schoolsysuser.fg.book.RecommendDepartVo;
import com.zrqx.core.vo.schoolsysuser.fg.book.RecommendMajorVo;
......@@ -108,6 +109,13 @@ public class FgPublicBasicRelationServiceImpl extends BaseServiceImpl<PublicBasi
@Override
public List<FgPublicBasicRelationVo> list(BiddingCycle biddingCycle) throws Exception {
List<IdAndNameVo> basicList = fgBasicTeachingPlanMapper.getBasicList(redis.getMember().getRelationId(), redis.getMember().getType());
if(basicList != null && basicList.size() > 0) {
for (IdAndNameVo idAndNameVo : basicList) {
Integer semester = this.getSemester(idAndNameVo.getAcademicLevel(),biddingCycle);
idAndNameVo.setSemester(semester);
}
}
QueryTypeAndRelationIdForm form = new QueryTypeAndRelationIdForm();
form.setRelationId(redis.getMember().getRelationId());
form.setType("0");
......@@ -122,25 +130,33 @@ public class FgPublicBasicRelationServiceImpl extends BaseServiceImpl<PublicBasi
CallBack<DepartmentMember> query = fgMemberClient.query(redis.getMember().getRelationId());
if(query.hasEntity()){
voList = fgBasicTeachingPlanMapper.queryList(time,form);
voList.forEach(vo ->{
this.queryVo(vo,biddingCycle,query.getData().getId());
voList.stream().filter(a -> a.getSemester().equals(this.getAcr(a.getAcademicLevel(), basicList))).forEach(vo ->{
this.queryVo(vo,biddingCycle,query.getData().getId(),vo.getSemester());
});
}
}else{
voList = fgBasicTeachingPlanMapper.getList(time,form);
voList.forEach(vo ->{
this.queryVo(vo,biddingCycle,null);
voList.stream().filter(a -> a.getSemester().equals(this.getAcr(a.getAcademicLevel(), basicList))).forEach(vo ->{
this.queryVo(vo,biddingCycle,null,vo.getSemester());
});
}
}
return voList.stream().filter(vo -> vo != null).collect(Collectors.toList());
return voList;
}
private Integer getAcr(Integer acr, List<IdAndNameVo> basicList) {
return basicList.stream()
.filter(a -> acr.equals(a.getAcademicLevel()))
.findFirst()
.map(a -> a.getSemester())
.orElse(null);
}
public FgPublicBasicRelationVo queryVo(FgPublicBasicRelationVo vo,BiddingCycle biddingCycle,Integer departmentId){
public FgPublicBasicRelationVo queryVo(FgPublicBasicRelationVo vo,BiddingCycle biddingCycle,Integer departmentId,Integer semester){
vo.setCycleId(biddingCycle.getId());
BasicTeachingPlan plan = fgBasicTeachingPlanMapper.selectByPrimaryKey(vo.getBasicPlanId());
vo.setAcademicLevel(plan.getAcademicLevel());
......@@ -157,7 +173,6 @@ public class FgPublicBasicRelationServiceImpl extends BaseServiceImpl<PublicBasi
}
vo.setStudentResource(plan.getStudentResource());
//获取学期
Integer semester = this.getSemester(plan.getAcademicLevel(),biddingCycle);
vo.setSemester(semester);
//获取学期对应的教材(每门课程一个学期只能对应一本教材)
PublicBasicRelation entity =fgPublicBasicRelationMapper.query(vo.getLessonId(), semester);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论