Ver código fonte

Merge branch 'zx_saas_0422' of http://git.dayaedu.com/yonge/mec into dev

zouxuan 1 ano atrás
pai
commit
14a26ee07b

+ 3 - 4
mec-application/src/main/java/com/ym/mec/student/controller/SmsCodeController.java

@@ -34,13 +34,12 @@ public class SmsCodeController extends BaseController {
     @Autowired
     private RedissonClient redissonClient;
 
-    /*@ApiOperation(value = "发送登录短信验证码")
+    @ApiOperation(value = "发送登录短信验证码")
     @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String")
     @PostMapping(value = "/sendSms")
     public Object sendLoginVerifyCode(String mobile) throws Exception {
-        smsCodeService.sendValidCode(mobile);
-        return succeed();
-    }*/
+        throw new BizException("你所使用的不是最新版本,请更新后使用");
+    }
 
     @ApiOperation(value = "发送登录短信验证码")
     @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),

+ 3 - 4
mec-application/src/main/java/com/ym/mec/teacher/controller/SmsCodeController.java

@@ -34,13 +34,12 @@ public class SmsCodeController extends BaseController {
     @Autowired
     private RedissonClient redissonClient;
 
-    /*@ApiOperation(value = "发送登录短信验证码")
+    @ApiOperation(value = "发送登录短信验证码")
     @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String")
     @PostMapping(value = "/sendSms")
     public Object sendLoginVerifyCode(String mobile) throws Exception {
-        smsCodeService.sendValidCode(mobile);
-        return succeed();
-    }*/
+        throw new BizException("你所使用的不是最新版本,请更新后使用");
+    }
 
     @ApiOperation(value = "发送登录短信验证码")
     @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),

+ 6 - 0
mec-application/src/main/java/com/ym/mec/web/controller/AppVersionInfoController.java

@@ -47,6 +47,9 @@ public class AppVersionInfoController extends BaseController {
 			if("2.0.9".equals(appVersionInfo.getVersion()) && "android-education".equals(appVersionInfo.getPlatform())){
 				AppVersionInfoBak appVersionInfoBak = JSONObject.parseObject(JSONObject.toJSONString(appVersionInfo),AppVersionInfoBak.class);
 				appVersionInfoBak.setDownloadUrl(new String(appVersionInfo.getDownloadUrl()));
+				if (StringUtils.isEmpty(localVersion)) {
+					appVersionInfoBak.setIsForceUpdate(true);
+				}
 				return succeed(appVersionInfoBak);
 			}
 			//如果应用版本跨多个版本时若其中任何一个版本有强制更新,返回字段标记为强制更新
@@ -57,6 +60,9 @@ public class AppVersionInfoController extends BaseController {
 					appVersionInfo.setIsForceUpdate(true);
 				}
 			}
+			if (StringUtils.isEmpty(localVersion)) {
+				appVersionInfo.setIsForceUpdate(true);
+			}
 			return succeed(appVersionInfo);
 		}
 		return failed();

+ 3 - 4
mec-application/src/main/java/com/ym/mec/web/controller/SmsCodeController.java

@@ -34,13 +34,12 @@ public class SmsCodeController extends BaseController {
     @Autowired
     private RedissonClient redissonClient;
 
-    /*@ApiOperation(value = "发送登录短信验证码")
+    @ApiOperation(value = "发送登录短信验证码")
     @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String")
     @PostMapping(value = "/sendSms")
     public Object sendLoginVerifyCode(String mobile) throws Exception {
-        smsCodeService.sendValidCode(mobile);
-        return succeed();
-    }*/
+        throw new BizException("你所使用的不是最新版本,请更新后使用");
+    }
 
     @ApiOperation(value = "发送登录短信验证码")
     @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),

+ 52 - 0
mec-application/src/main/java/com/ym/mec/web/controller/education/EduCooperationOrganController.java

@@ -0,0 +1,52 @@
+package com.ym.mec.web.controller.education;
+
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.page.CooperationOrganQueryInfo;
+import com.ym.mec.biz.service.CooperationOrganService;
+import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@RequestMapping("${app-config.url.web:}/eduCooperationOrgan")
+@Api(tags = "合作单位(教学点)服务")
+@RestController
+public class EduCooperationOrganController extends BaseController {
+
+    @Resource
+    private CooperationOrganService cooperationOrganService;
+    @Resource
+    private OrganizationService organizationService;
+
+    @ApiOperation(value = "分页查询合作单位(教学点)列表")
+    @GetMapping("/queryPage")
+    public HttpResponseResult<PageInfo<CooperationOrgan>> queryPage(CooperationOrganQueryInfo queryInfo) {
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+        return succeed(cooperationOrganService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "根据分部获取合作单位(教学点)列表")
+    @GetMapping("/queryByOrganId")
+    public HttpResponseResult<List<CooperationOrgan>> queryByOrganId(String organId, Boolean enable) {
+        return succeed(cooperationOrganService.queryByOrganId(organId,enable));
+    }
+
+    @ApiOperation(value = "合作单位的乐团")
+    @GetMapping("/musicGroupPage")
+    public HttpResponseResult<List<MusicGroup>> musicGroupPage(@RequestHeader Integer coopId) {
+        if (coopId == null) {
+            return succeed();
+        }
+        return succeed(cooperationOrganService.musicGroupPage(coopId));
+    }
+}

+ 79 - 0
mec-application/src/main/java/com/ym/mec/web/controller/school/SchoolStudentHomeworkController.java

@@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.StudentAttendance;
 import com.ym.mec.biz.dal.entity.StudentCourseHomework;
+import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.ELessonTrainingType;
 import com.ym.mec.biz.dal.page.LessonExaminationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentLessonExaminationQueryDto;
@@ -23,6 +24,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
 import java.util.stream.Collectors;
@@ -46,6 +48,10 @@ public class SchoolStudentHomeworkController extends BaseController {
     private StudentAttendanceService studentAttendanceService;
     @Resource
     private MusicGroupDao musicGroupDao;
+    @Resource
+    private SubjectService subjectService;
+    @Resource
+    private CourseHomeworkService courseHomeworkService;
     @ApiOperation(value = "获取教师有服务指标的课程列表")
     @PostMapping("/queryHomework")
     public HttpResponseResult<PageInfo<CourseHomeworkWrapper.CourseHomeworkList>>
@@ -85,6 +91,27 @@ public class SchoolStudentHomeworkController extends BaseController {
         return succeed(lessonExaminationService.queryPage(queryInfo));
     }
 
+    @ApiOperation(value = "获取单个进度评测")
+    @GetMapping("getOneLessonExamination")
+    public HttpResponseResult<LessonExaminationResultDto> queryPage(Long lessonExaminationId) {
+        LessonExaminationQueryInfo queryInfo = new LessonExaminationQueryInfo();
+        queryInfo.setLessonExaminationId(lessonExaminationId);
+        LessonExaminationResultDto resultDto = lessonExaminationService.queryPage(queryInfo).getRows().get(0);
+        return succeed(resultDto);
+    }
+
+    @ApiOperation(value = "获取进度评测学员列表")
+    @PostMapping("queryLessonExaminationPage")
+    public HttpResponseResult<PageInfo<StudentLessonExaminationDto>> queryLessonExaminationPage(@RequestBody StudentLessonExaminationQueryInfo queryInfo) {
+        return succeed(studentLessonExaminationService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "获取学员评测详情列表")
+    @PostMapping("queryStudentLessonExaminationDetail")
+    public HttpResponseResult<List<StudentLessonExaminationDetailDto>> queryStudentLessonExaminationDetail(@RequestBody StudentLessonExaminationQueryDto query) {
+        return succeed(studentLessonExaminationDetailService.queryAll(query));
+    }
+
     @ApiOperation(value = "学员请假列表")
     @PostMapping("queryStudentLeave")
     public HttpResponseResult<PageInfo<CourseHomeworkWrapper.StudentLeaveResult>>
@@ -143,5 +170,57 @@ public class SchoolStudentHomeworkController extends BaseController {
             return succeed(studentCourseHomeworkService.findExtracurricularExercisesDetailPublicV2(courseScheduleId, userId, type));
         }
     }
+
+    @ApiOperation(value = "根据课程计划获取需要交作业的学生声部-公用")
+    @PostMapping("/findCourseStudentsSubjectPublic/v2")
+    public HttpResponseResult<List<Subject>> findCourseStudentsSubjectPublicV2(@Validated @RequestBody StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query){
+        List<StudentCourseHomework> studentCourseHomeworkByCourseV2;
+        if(ELessonTrainingType.HOMEWORK.equals(query.getType())){
+            if (Objects.isNull(query.getCourseScheduleId())) {
+                throw new BizException("请指定课程");
+            }
+            studentCourseHomeworkByCourseV2 = studentCourseHomeworkService.findStudentCourseHomeworkByCourseV2(
+                    query);
+        }else{
+            studentCourseHomeworkByCourseV2 = studentCourseHomeworkService.findExtraExerciseStudentsV2(query);
+        }
+
+        if (org.springframework.util.CollectionUtils.isEmpty(studentCourseHomeworkByCourseV2)) {
+            return succeed(new ArrayList<>());
+        }
+        // 获取声部
+        List<Integer> collect = studentCourseHomeworkByCourseV2.stream().map(StudentCourseHomework::getSubjectId).collect(
+                Collectors.toList());
+
+        return succeed(subjectService.findBySubjectByIdList(collect));
+
+    }
+
+    @ApiOperation(value = "获取作业详情")
+    @GetMapping(value = "/findCourseHomeworkDetail")
+    public HttpResponseResult<CourseHomeworkWrapper.CourseHomeworkList> findCourseHomeworkDetail(Integer courseScheduleId){
+        return succeed(courseHomeworkService.findCourseHomeworkDetail(courseScheduleId));
+    }
+
+    @ApiOperation(value = "根据课程计划获取需要交作业的学生统计")
+    @PostMapping("/findCourseStudentsPublicSubject/v2")
+    public HttpResponseResult<CourseHomeworkWrapper.StudentHomeworkRecordStat> findCourseStudentsPublicSubjectV2(@Validated @RequestBody StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query){
+        List<StudentCourseHomework> list;
+        if(ELessonTrainingType.HOMEWORK.equals(query.getType())){
+            if (Objects.isNull(query.getCourseScheduleId())) {
+                throw new BizException("请指定课程");
+            }
+            list =  (studentCourseHomeworkService.findStudentCourseHomeworkByCourseV2(query));
+        }else{
+            list =  (studentCourseHomeworkService.findExtraExerciseStudentsV2(query));
+        }
+
+        CourseHomeworkWrapper.StudentHomeworkRecordStat stat = new CourseHomeworkWrapper.StudentHomeworkRecordStat();
+        stat.setAllNum(list.size());
+        stat.setFinishNum((int) list.stream().filter(StudentCourseHomework::getFinishFlag).count());
+        stat.setUnFinishNum(stat.getAllNum()-stat.getFinishNum());
+        stat.setStudentCourseHomeworkList(list);
+        return succeed(stat);
+    }
 }
 

+ 4 - 4
mec-common/common-core/src/main/java/com/ym/mec/common/redis/config/RedisConfig.java

@@ -18,7 +18,7 @@ import java.io.Serializable;
 @Configuration
 public class RedisConfig {
 
-	/*@Value("${spring.redis.host}")
+	@Value("${spring.redis.host}")
 	private String host;
 
 	@Value("${spring.redis.port}")
@@ -56,9 +56,9 @@ public class RedisConfig {
 		redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
 		redisTemplate.setConnectionFactory(jedisConnectionFactory());
 		return redisTemplate;
-	}*/
+	}
 
-	@Bean
+	/*@Bean
 	public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
 		// 定义redis模板
 		RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
@@ -72,6 +72,6 @@ public class RedisConfig {
 		redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
 		redisTemplate.afterPropertiesSet();
 		return redisTemplate;
-	}
+	}*/
 
 }