| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856 |
- package com.ssj.aijia.parents.controller;
- import com.alibaba.dubbo.config.annotation.Reference;
- import com.ssj.bean.sys.appinfo.bean.AppInfo;
- import com.ssj.framework.core.common.controller.BaseController;
- import com.ssj.framework.core.security.annotation.IgnoreSecurity;
- import com.ssj.framework.core.security.annotation.ModifySecurity;
- import com.ssj.framework.core.security.manager.TokenManager;
- import com.ssj.framework.core.util.ResponseConstant;
- import com.ssj.framework.core.util.ResponseEntity;
- import com.ssj.framework.core.util.StringUtil;
- import com.ssj.service.conch.common.service.ConchCommonService;
- import com.ssj.service.conch.conch.service.ConchDerverService;
- import com.ssj.service.conch.parents.dto.*;
- import com.ssj.service.conch.parents.request.*;
- import com.ssj.service.conch.parents.request.version4.*;
- import com.ssj.service.conch.parents.service.ParentService;
- import com.ssj.service.conch.schoolmaster.dto.CourseDateDataDto;
- import com.ssj.service.conch.schoolmaster.request.ConfirmAdjustSchoolHoursRequest;
- import com.ssj.service.conch.schoolmaster.request.TeacherCoursePlanDetailRequest;
- import com.ssj.service.conch.schoolmaster.service.SchoolService;
- import com.ssj.service.conch.zyb.request.ZuoybDayReq;
- import com.ssj.service.sys.situation.service.ILearningSituationMain;
- import com.ssj.service.sys.situation.service.LearningSituationService;
- import com.ssj.service.weixin.user.dto.AppWxUserInfo;
- import com.ssj.service.weixin.user.service.UserService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.data.domain.Pageable;
- import org.springframework.data.domain.Sort.Direction;
- import org.springframework.web.bind.annotation.*;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @author ZhangCaibao
- * @version 2018年4月13日 下午5:52:07
- * 类说明
- */
- @Api(value = "家长端相关的接口", tags = "家长端相关的接口")
- @RestController
- @RequestMapping("/api/parents/parents")
- public class ParentsController extends BaseController {
- @Reference(version = "1.0" ,timeout = 60000)
- private ParentService parentService;
- @Autowired
- private TokenManager tokenManager;
- @Reference(version = "1.0" ,timeout = 60000)
- private ConchDerverService conchDerverService;
- @Reference(version = "1.0" ,timeout = 60000)
- private ConchCommonService conchCommonService;
- @Reference(version = "1.0" ,timeout = 60000)
- private UserService userService;
- @Reference(version = "1.0" ,timeout = 60000)
- private SchoolService schoolService;
- @Reference(version = "1.0" ,timeout = 60000)
- private LearningSituationService learningSituationService;
- @ApiOperation(value = "家长端APP微信授权登录")
- @IgnoreSecurity
- @ModifySecurity
- @RequestMapping(value = "/appAuthlogin", method = RequestMethod.POST)
- public ResponseEntity appAuthlogin( @RequestBody (required=true) ParentAuthLoginReq param) {
- ResponseEntity responseEntity = null;
- try{
- responseEntity = parentService.appAuthlogin(param);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @ApiOperation(value = "APP授权保存用户的基本信息")
- @RequestMapping(value = "/saveAppUserInfo", method = RequestMethod.POST)
- public ResponseEntity saveAppUserInfo(@RequestParam(name = "accessToken") String accessToken,
- @RequestBody (required=true) AppWxUserInfo info ) {
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- if(StringUtil.isEmpty(info.getUnionid())){
- responseEntity.failure("用户unionid为空");
- return responseEntity;
- }
- if(StringUtil.isEmpty(info.getOpenid())){
- responseEntity.failure("用户openid为空");
- return responseEntity;
- }
- if(StringUtil.isEmpty(info.getNickname())){
- responseEntity.failure("用户普通用户昵称为空");
- return responseEntity;
- }
- userService.saveAppUser(accessToken, info);
- responseEntity.success("保存成功");
- } catch (Exception e) {
- responseEntity.failure(ResponseConstant.CODE_000, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- /**
- * 退出登录
- * @param accessToken
- * @return
- */
- @ApiOperation(value = "退出登录")
- @IgnoreSecurity
- @RequestMapping(value = "/logout", method = RequestMethod.POST)
- public ResponseEntity logout(@RequestParam(name = "accessToken") String accessToken) {
- tokenManager.removeToken(accessToken);
- return new ResponseEntity().success();
- }
- /**
- *===============================首页===================================
- */
- @RequestMapping(value = "/childSmarttimeList", method = RequestMethod.POST)
- @ApiOperation(value = "孩子相册", httpMethod = "POST", notes = "孩子相册")
- public ResponseEntity childSmarttimeList(@RequestParam(name = "accessToken") String accessToken, @RequestBody ChildSmarttimeListReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- Map<String, Object> params = new HashMap<String, Object>();
- params.put("vipId", req.getVipId());
- Pageable pageable = initPage(req.getPageNo(), req.getPageSize());
- Map<String, Object> result = parentService.childSmarttimeList(params, pageable);
- responseEntity.success(result, "成功");
- } catch (Exception e){
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @IgnoreSecurity
- @RequestMapping(value = "/getChildLocation", method = RequestMethod.POST)
- @ApiOperation(value = "获取孩子定位信息", httpMethod = "POST", notes = "获取孩子定位信息")
- public ResponseEntity getChildLocation(@RequestParam(name = "accessToken") String accessToken, @RequestBody VipReq req){
- ResponseEntity responseEntity;
- try{
- responseEntity = parentService.getChildLocation(req.getVipId());
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/getSayList", method = RequestMethod.POST)
- @ApiOperation(value = "爸妈说消息列表", httpMethod = "POST", notes = "爸妈说消息列表")
- public ResponseEntity getSayList(@RequestParam(name = "accessToken") String accessToken){
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- String userId = tokenManager.getUserId(accessToken);
- Map<String, Object> data = new HashMap<String, Object>() ;
- List<ParentsSayDto> dataList = parentService.getSayList(userId);
- data.put("list", dataList);
- responseEntity.success(data,"成功");
- } catch (Exception e) {
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/getMessageList", method = RequestMethod.POST)
- @ApiOperation(value = "获取消息列表", httpMethod = "POST", notes = "获取消息列表")
- public ResponseEntity getMessageList(@RequestParam(name = "accessToken") String accessToken,@RequestBody MessageReq req){
- ResponseEntity responseEntity;
- try{
- Pageable pageable = initPage(req.getPageNo(),req.getPageSize(),Direction.DESC,"created");
- responseEntity = parentService.getMessageList(req, pageable);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/getPhotoList", method = RequestMethod.POST)
- @IgnoreSecurity
- @ApiOperation(value = "首页轮播图片", httpMethod = "POST", notes = "首页轮播图片")
- public ResponseEntity getPhotoList(@RequestBody PhotoReq req){
- ResponseEntity responseEntity;
- try{
- responseEntity = parentService.getPhotoList(req.getPhoneType());
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- /**
- *==============================作业模块==================================
- */
- @RequestMapping(value = "/homeworkTask", method = RequestMethod.POST)
- @ApiOperation(value = "作业任务", httpMethod = "POST", notes = "作业任务")
- public ResponseEntity homeworkTask (@RequestParam(name = "accessToken") String accessToken, @RequestBody HomeworkTaskReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- Pageable pageable = initPage(req.getPageNo(), req.getPageSize());
- Map<String, Object> data = parentService.getHistoryTask(req.getVipId(), req.getMaxCreateTime(), pageable);
- data.put("todayTask", parentService.searchTodayHomeworkTask(req.getVipId()));
- responseEntity.success(data, "成功");
- } catch (Exception e){
- logger.error("异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/correctDetail", method = RequestMethod.POST)
- @ApiOperation(value = "单科批改详情", httpMethod = "POST", notes = "单科批改详情")
- public ResponseEntity correctDetail (@RequestParam(name = "accessToken") String accessToken, @RequestBody CorrectDetailReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- Map<String, Object> data = parentService.correctDetail(req.getVipId(), req.getSubject(), req.getDate());
- if ((Boolean)data.get("isSuccess")){
- responseEntity.success(data.get("data"), "成功");
- } else {
- responseEntity.failure(ResponseConstant.CODE_000, "失败");
- }
- } catch (Exception e){
- logger.error("异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/homeworkReport", method = RequestMethod.POST)
- @ApiOperation(value = "作业反馈报告", httpMethod = "POST", notes = "作业反馈报告")
- public ResponseEntity homeworkReport (@RequestParam(name = "accessToken") String accessToken, @RequestBody HomeworkReportReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- if (StringUtils.isNotBlank(req.getVipId()) && StringUtils.isNotBlank(req.getDate())) {
- Map<String, Object> data = parentService.findHomeworkReport(req.getVipId(), req.getDate());
- responseEntity.success(data, "成功");
- }else {
- logger.error("请求参数有误,vipId={}, date={}", req.getVipId(), req.getDate());
- responseEntity.failure(ResponseConstant.CODE_000, "请求参数有误");
- }
- } catch (Exception e){
- logger.error("异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/queryAssessment", method = RequestMethod.POST)
- @ApiOperation(value = "查询课堂评价", httpMethod = "POST", notes = "查询课堂评价")
- public ResponseEntity queryAssessment (@RequestParam(name = "accessToken") String accessToken, @RequestBody QueryAssessmentReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- Map<String, Object> data = parentService.queryAssessment(req.getVipId(), req.getDate());
- responseEntity.success(data, "成功");
- } catch (Exception e){
- logger.error("异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/assessment", method = RequestMethod.POST)
- @ApiOperation(value = "作业课堂评价提交", httpMethod = "POST", notes = "课堂评价")
- public ResponseEntity assessment (@RequestParam(name = "accessToken") String accessToken, @RequestBody AssessmentReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- parentService.submitAssessment(req);
- responseEntity.success();
- } catch (Exception e){
- logger.error("异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- /**
- *==============================学情模块==================================
- */
- @RequestMapping(value = "/learningSituationAbstract", method = RequestMethod.POST)
- @ApiOperation(value = "学情整体情况", httpMethod = "POST", notes = "学情整体情况")
- public ResponseEntity learningSituationAbstract (@RequestParam(name = "accessToken") String accessToken, @RequestBody CorrectDetailReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- LearningSituationAbstractDto data = parentService.learningSituationAbstract(req.getVipId());
- responseEntity.success(data, "成功");
- } catch (Exception e){
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/knowledgeAtlas", method = RequestMethod.POST)
- @ApiOperation(value = "知识图谱", httpMethod = "POST", notes = "知识图谱")
- public ResponseEntity knowledgeAtlas(@RequestParam(name = "accessToken") String accessToken, @RequestBody CourseHowReq req){
- ResponseEntity responseEntity = null;
- try{
- responseEntity = parentService.knowledgeAtlas(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/recent", method = RequestMethod.POST)
- @ApiOperation(value = "学习历史-当日学习任务日历", httpMethod = "POST", notes = "学习历史-当日学习任务日历")
- public ResponseEntity recent(@RequestParam(name = "accessToken") String accessToken, @RequestBody VipReq req){
- ResponseEntity responseEntity = null;
- try{
- responseEntity = parentService.recent(req.getVipId());
- } catch (Exception e){
- logger.error("7天任务异常", e);
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/calendarTrack", method = RequestMethod.POST)
- @ApiOperation(value = "学习历史-历史学习任务日历", httpMethod = "POST", notes = "学习历史-历史学习任务日历")
- public ResponseEntity calendarTrack(@RequestParam(name = "accessToken") String accessToken, @RequestBody ZuoybDayReq req){
- ResponseEntity responseEntity = null;
- try{
- responseEntity = parentService.calendarTrack(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/learningSituationDetail", method = RequestMethod.POST)
- @ApiOperation(value = "学情学科情况", httpMethod = "POST", notes = "学情学科情况")
- public ResponseEntity learningSituationDetail (@RequestParam(name = "accessToken") String accessToken, @RequestBody CorrectDetailReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- LearningSituationDetailDto data = learningSituationService.learningSituationDetail(req.getVipId(), req.getSubject());
- responseEntity.success(data, "成功");
- } catch (Exception e){
- logger.error("异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- //------------------------------------------------------------------难题模块-------------------------------------
- @RequestMapping(value = "/unAnsweredProblemList", method = RequestMethod.POST)
- @ApiOperation(value = "未解答难题列表", httpMethod = "POST", notes = "未解答难题列表")
- public ResponseEntity unAnsweredProblemList(@RequestParam(name = "accessToken") String accessToken,@RequestBody UnAnsweredProblemReq req){
- ResponseEntity responseEntity;
- try{
- Pageable pageable = initPage(req.getPageNo(), req.getPageSize());
- responseEntity = parentService.unAnsweredProblemList(req,pageable);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/answeredProblemKnowHow", method = RequestMethod.POST)
- @ApiOperation(value = "已解答难题知识点汇总", httpMethod = "POST", notes = "已解答难题知识点汇总")
- public ResponseEntity answeredProblemKnowHow(@RequestParam(name = "accessToken") String accessToken,@RequestBody ProblemKnowHowReq req){
- ResponseEntity responseEntity;
- try{
- responseEntity = parentService.answeredProblemKnowHow(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/answeredProblemList", method = RequestMethod.POST)
- @ApiOperation(value = "已解答难题列表", httpMethod = "POST", notes = "已解答难题列表")
- public ResponseEntity answeredProblemList(@RequestParam(name = "accessToken") String accessToken,@RequestBody AnsweredProblemReq req){
- ResponseEntity responseEntity;
- try{
- Pageable pageable = initPage(req.getPageNo(), req.getPageSize());
- responseEntity = parentService.answeredProblemList(req,pageable);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/answeredProblemDetail", method = RequestMethod.POST)
- @ApiOperation(value = "已解答难题详情", httpMethod = "POST", notes = "已解答难题详情")
- public ResponseEntity answeredProblemDetail(@RequestParam(name = "accessToken") String accessToken,@RequestBody FindProblemRequest req){
- ResponseEntity responseEntity;
- try{
- responseEntity = parentService.answeredProblemDetail(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/calendarAnsweredProblem", method = RequestMethod.POST)
- @ApiOperation(value = "任务日历查询某天已解答难题列表", httpMethod = "POST", notes = "任务日历查询某天已解答难题列表")
- public ResponseEntity calendarAnsweredProblem(@RequestParam(name = "accessToken") String accessToken,@RequestBody AnswdProblemOnedayReq req){
- ResponseEntity responseEntity;
- try{
- responseEntity = parentService.calendarAnsweredProblem(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- //------------------------------------------------------------------一对一模块-------------------------------------
- @RequestMapping(value = "/lessonServiceManager", method = RequestMethod.POST)
- @ApiOperation(value = "一对一学习任务", httpMethod = "POST", notes = "一对一学习任务")
- public ResponseEntity lessonServiceManager(@RequestParam(name = "accessToken") String accessToken,@RequestBody VipReq req){
- ResponseEntity responseEntity = null;
- try{
- String userId = tokenManager.getUserId(accessToken);
- responseEntity = parentService.lessonServiceManager(userId,req.getVipId());
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/applyCourseTime", method = RequestMethod.POST)
- @ModifySecurity
- @ApiOperation(value = "申请调课", httpMethod = "POST", notes = "申请调课")
- public ResponseEntity applyCourseTime(@RequestParam(name = "accessToken") String accessToken,@RequestBody ApplyCourseTimeReq req){
- ResponseEntity responseEntity = null;
- try{
- responseEntity = parentService.applyCourseTime(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/applyChangeTeacher", method = RequestMethod.POST)
- @ModifySecurity
- @ApiOperation(value = "申请换老师", httpMethod = "POST", notes = "申请换老师")
- public ResponseEntity applyChangeTeacher(@RequestParam(name = "accessToken") String accessToken,@RequestBody ApplyTeacherReq req){
- ResponseEntity responseEntity = null;
- try{
- responseEntity = parentService.applyChangeTeacher(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/confirmTeacher", method = RequestMethod.POST)
- @ModifySecurity
- @ApiOperation(value = "校长换老师后-家长确认", httpMethod = "POST", notes = "校长换老师后-家长确认")
- public ResponseEntity confirmTeacher(@RequestParam(name = "accessToken") String accessToken,@RequestBody LessonReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- responseEntity = parentService.confirmTeacher(req.getLessonServiceId());
- } catch (Exception e){
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/teacherCoursePlanDetail", method = RequestMethod.POST)
- @ApiOperation(value = "获取当前老师排课状况", httpMethod = "POST", notes = "获取当前老师排课状况")
- public ResponseEntity teacherCoursePlanDetail(@RequestParam(name = "accessToken") String accessToken,@RequestBody TeacherCoursePlanDetailRequest req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- List<Map<String, String>> result = parentService.teacherCoursePlanDetail(req);
- Map<String, Object> data = new HashMap<String, Object>();
- data.put("list", result);
- responseEntity.success(data, "成功");
- } catch (Exception e){
- logger.error("异常", e);
- }
- return responseEntity;
- }
- @RequestMapping(value = "/getStudentCourseData", method = RequestMethod.POST)
- @ApiOperation(value = "获取当前课程情况", httpMethod = "POST", notes = "获取当前课程情况")
- public ResponseEntity getStudentCourseData(@RequestParam(name = "accessToken") String accessToken,
- @RequestBody ConfirmAdjustSchoolHoursRequest request) {
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- List<CourseDateDataDto> list = schoolService.findStudentCourseData(request.getBizId(), request.getTime());
- Map<String, Object> data = new HashMap<>();
- data.put("list", list);
- responseEntity.success(data, "成功");
- } catch (Exception e) {
- logger.error("异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/getTeacherCourseTimeDetail", method = RequestMethod.POST)
- @ApiOperation(value = "获取当前老师排课状况V1", httpMethod = "POST", notes = "获取当前老师排课状况Vq")
- public ResponseEntity getTeacherCourseTimeDetail(@RequestParam(name = "accessToken") String accessToken,
- @RequestBody TeacherCoursePlanDetailRequest request) {
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- List<Map<String, String>> result = schoolService.getTeacherCourseTimeDetail(request);
- Map<String, Object> data = new HashMap<String, Object>();
- data.put("list", result);
- responseEntity.success(data, "成功");
- } catch (Exception e) {
- logger.error("异常信息", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/lessonFeedbackList", method = RequestMethod.POST)
- @ApiOperation(value = "往期反馈记录", httpMethod = "POST", notes = "往期反馈记录")
- public ResponseEntity lessonFeedbackList(@RequestParam(name = "accessToken") String accessToken,@RequestBody LessonReq req){
- ResponseEntity responseEntity;
- try{
- responseEntity = parentService.lessonFeedbackList(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/calendarLessonFeedback", method = RequestMethod.POST)
- @ApiOperation(value = "一对一任务日历反馈记录", httpMethod = "POST", notes = "一对一任务日历反馈记录")
- public ResponseEntity calendarLessonFeedback(@RequestParam(name = "accessToken") String accessToken,@RequestBody HomeworkReportReq req){
- ResponseEntity responseEntity;
- try{
- responseEntity = parentService.calendarLessonFeedback(req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/lessonFeedbackDetails", method = RequestMethod.POST)
- @ApiOperation(value = "一对一反馈报告", httpMethod = "POST", notes = "一对一反馈报告")
- public ResponseEntity lessonFeedbackDetails(@RequestParam(name = "accessToken") String accessToken,@RequestBody CourseReq req){
- ResponseEntity responseEntity;
- try{
- responseEntity = parentService.lessonFeedbackDetails(req,accessToken);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/getCourseAssessment", method = RequestMethod.POST)
- @ApiOperation(value = "一对一反馈-查看课堂评价", httpMethod = "POST", notes = "一对一反馈-查看课堂评价")
- public ResponseEntity getCourseAssessment(@RequestParam(name = "accessToken") String accessToken,@RequestBody CourseReq req){
- ResponseEntity responseEntity;
- try {
- responseEntity = parentService.getCourseAssessment(req);
- } catch (Exception e) {
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/superScholarLessonFeedbackDetails", method = RequestMethod.POST)
- @ApiOperation(value = "学霸一对一反馈报告", httpMethod = "POST", notes = "学霸一对一反馈报告")
- public ResponseEntity superScholarLessonFeedbackDetails(@RequestParam(name = "accessToken") String accessToken,@RequestBody CourseReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- if (StringUtils.isNotBlank(req.getCourseId())){
- SuperScholarFeedbackDto data = parentService.superScholar121Feedback(req.getCourseId());
- responseEntity.success(data,"成功");
- } else {
- responseEntity.failure(ResponseConstant.CODE_000, "请传输正确的课程编号");
- }
- } catch (Exception e) {
- logger.error("学霸一对一反馈报告异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/upCourseAssessment", method = RequestMethod.POST)
- @ModifySecurity
- @ApiOperation(value = "一对一反馈-课堂评价", httpMethod = "POST", notes = "一对一反馈-课堂评价")
- public ResponseEntity upCourseAssessment(@RequestParam(name = "accessToken") String accessToken,@RequestBody CourseAssessmentReq req){
- ResponseEntity responseEntity;
- try {
- responseEntity = parentService.upCourseAssessment(req);
- } catch (Exception e) {
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- //------------------------------------------------------------------我的信息-------------------------------------
- @RequestMapping(value = "/getMyInfo", method = RequestMethod.POST)
- @ApiOperation(value = "我的信息", httpMethod = "POST", notes = "我的信息")
- public ResponseEntity getMyInfo(@RequestParam(name = "accessToken") String accessToken){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- String parentId = tokenManager.getUserId(accessToken);
- ParentsInfoDto result = parentService.getMyInfo(parentId);
- responseEntity.success(result,"成功");
- } catch (Exception e){
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/getMyChildInfo", method = RequestMethod.POST)
- @ApiOperation(value = "查询孩子信息", httpMethod = "POST", notes = "查询孩子信息")
- public ResponseEntity getMyChildInfo(@RequestParam(name = "accessToken") String accessToken,@RequestBody VipReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- String userId = tokenManager.getUserId(accessToken);
- ChildDto result = parentService.getMyChildInfo(userId,req.getVipId());
- responseEntity.success(result,"成功");
- } catch (Exception e){
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/upMyChildInfo", method = RequestMethod.POST)
- @ApiOperation(value = "修改孩子信息", httpMethod = "POST", notes = "修改孩子信息")
- public ResponseEntity upMyChildInfo(@RequestParam(name = "accessToken") String accessToken,@RequestBody ChildInfoReq req){
- ResponseEntity responseEntity = new ResponseEntity();
- try{
- parentService.upMyChildInfo(req);
- responseEntity.success();
- } catch (Exception e){
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/getSchoolList", method = RequestMethod.POST)
- @ApiOperation(value = "获取学校列表", httpMethod = "POST", notes = "获取学校列表")
- public ResponseEntity getSchoolList(@RequestParam(name = "accessToken") String accessToken,@RequestBody QuerySchoolList req){
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- Map<String, Object> params = new HashMap<String, Object>();
- List<Map<String, Object>> list = parentService.getSchoolList(req);
- params.put("list", list);
- responseEntity.success(params,"获取数据成功!");
- } catch (Exception e) {
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/myOrdersInfo", method = RequestMethod.POST)
- @ApiOperation(value = "我的订单", httpMethod = "POST", notes = "我的订单")
- public ResponseEntity myOrdersInfo(@RequestParam(name = "accessToken") String accessToken,@RequestBody OrderReq req){
- ResponseEntity responseEntity = null;
- try{
- String userId = tokenManager.getUserId(accessToken);
- responseEntity = parentService.myOrdersInfo(userId,req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/payOrder", method = RequestMethod.POST)
- @ModifySecurity
- @ApiOperation(value = "我的订单-支付", httpMethod = "POST", notes = "我的订单-支付")
- public ResponseEntity payOrder(@RequestParam(name = "accessToken") String accessToken,@RequestBody PayOrderReq req){
- return parentService.payOrder(req,accessToken);
- }
- @RequestMapping(value = "/applyOrderRefund", method = RequestMethod.POST)
- @ApiOperation(value = "我的订单-发起退款", httpMethod = "POST", notes = "我的订单-发起退款")
- public ResponseEntity applyOrderRefund(@RequestParam(name = "accessToken") String accessToken,@RequestBody RefundReq req){
- ResponseEntity responseEntity = null;
- try{
- String userId = tokenManager.getUserId(accessToken);
- responseEntity = parentService.applyOrderRefund(userId, req.getOrderNo());
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/confirmOrderRefund", method = RequestMethod.POST)
- @ModifySecurity
- @ApiOperation(value = "我的订单-确定退款", httpMethod = "POST", notes = "我的订单-确定退款")
- public ResponseEntity confirmOrderRefund(@RequestParam(name = "accessToken") String accessToken,@RequestBody ConfirmRefundReq req){
- ResponseEntity responseEntity = null;
- try{
- String userId = tokenManager.getUserId(accessToken);
- responseEntity = parentService.confirmOrderRefund(userId, req);
- } catch (Exception e){
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/untieDerver", method = RequestMethod.POST)
- @ModifySecurity
- @ApiOperation(value = "解绑小塾", httpMethod = "POST", notes = "解绑小塾")
- public ResponseEntity untieDerver(@RequestParam(name = "accessToken") String accessToken,@RequestBody UntieDerverReq req){
- ResponseEntity responseEntity = null;
- try {
- responseEntity = conchDerverService.untyingParents(req.getDerver(), tokenManager.getUserId(accessToken));
- } catch (Exception e) {
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @ApiOperation(value = "解绑小塾内部专用",httpMethod = "POST")
- @IgnoreSecurity
- @ModifySecurity
- @RequestMapping(value = "/untieDerverByCeshi", method = RequestMethod.POST)
- public ResponseEntity untieDerverByCeshi(@RequestParam(name = "parentId") String parentId,
- @RequestParam(name = "derver") String derver) {
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- responseEntity =conchDerverService.untyingParents(derver, parentId);
- responseEntity.success();
- } catch (Exception e) {
- logger.error("解绑小塾异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, "解绑小塾异常");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/swipeQrCode", method = RequestMethod.POST)
- @ModifySecurity
- @ApiOperation(value = "app扫描二维码通用接口", httpMethod = "POST", notes = "app扫描二维码通用接口")
- public ResponseEntity swipeQrCode(@RequestParam(name = "accessToken") String accessToken,@RequestBody SwipeQrCodeReq req){
- ResponseEntity responseEntity = null;
- try {
- String userId = tokenManager.getUserId(accessToken);
- responseEntity = conchCommonService.swipeQrCode(userId,req);
- } catch (Exception e) {
- responseEntity = new ResponseEntity();
- responseEntity.failure(ResponseConstant.CODE_500, "服务器发生异常,请稍后重试");
- }
- return responseEntity;
- }
- @RequestMapping(value = "/version", method = RequestMethod.POST)
- @IgnoreSecurity
- @ApiOperation(value = "获取当前版本", httpMethod = "POST", notes = "获取当前版本")
- public ResponseEntity version() {
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- AppInfo appInfo = parentService.getVersion(2);
- Map<String,Object> map = new HashMap<>(16);
- if(appInfo != null){
- map.put("id",appInfo.getId());
- map.put("version",appInfo.getVersion());
- map.put("fileKey",appInfo.getFileKey());
- map.put("versionType",appInfo.getVersionType());
- map.put("issueNum",appInfo.getIssueNum());
- map.put("createTime",appInfo.getCreateTime());
- map.put("isDelete",appInfo.getIsDelete());
- map.put("needUpdate",appInfo.getNeedUpdate());
- }
- responseEntity.success(map, "成功");
- } catch (Exception e) {
- logger.error("获取当前版本异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, e.getMessage());
- }
- logger.info("version end");
- return responseEntity;
- }
- @RequestMapping(value = "/setPushRemind", method = RequestMethod.POST)
- @ApiOperation(value = "设置推送消息提醒接口", httpMethod = "POST", notes = "设置推送消息提醒接口")
- public ResponseEntity setPushRemind(@RequestParam(name = "accessToken") String accessToken,@RequestBody PushRemindReq req) {
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- String userId = tokenManager.getUserId(accessToken);
- parentService.setPushRemind(userId,req);
- responseEntity.success();
- } catch (Exception e) {
- logger.error("设置推送消息提醒接口异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, e.getMessage());
- }
- return responseEntity;
- }
- @RequestMapping(value = "/sendSms", method = RequestMethod.POST)
- @IgnoreSecurity
- @ApiOperation(value = "发送短信验证码", httpMethod = "POST", notes = "发送短信验证码")
- public ResponseEntity sendSms(@RequestBody SmsSendReq req) {
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- parentService.sendSms(req.getPhoneNumber(), req.getType());
- responseEntity.success();
- } catch (Exception e) {
- logger.error("发送短信验证码接口异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, e.getMessage());
- }
- return responseEntity;
- }
- @RequestMapping(value = "/confirmSms", method = RequestMethod.POST)
- @IgnoreSecurity
- @ApiOperation(value = "验证短信验证码", httpMethod = "POST", notes = "验证短信验证码")
- public ResponseEntity confirmSms(@RequestBody SmsConfirmReq req) {
- ResponseEntity responseEntity;
- try {
- responseEntity = parentService.confirmSms(req.getPhoneNumber(), req.getCode());
- if (responseEntity.getCode().equals("999")) {
- //清除验证码
- tokenManager.delString(req.getPhoneNumber());
- }
- return responseEntity;
- } catch (Exception e) {
- responseEntity = new ResponseEntity();
- logger.error("发送短信验证码接口异常", e);
- responseEntity.failure(ResponseConstant.CODE_500, e.getMessage());
- }
- return responseEntity;
- }
- @Reference(version = "1.0" ,timeout = 60000)
- private ILearningSituationMain learningSituationMain;
- @RequestMapping(value = "/learningSituation", method = RequestMethod.POST)
- @IgnoreSecurity
- @ApiOperation(value = "学情手动计算", httpMethod = "POST", notes = "学情手动计算")
- public ResponseEntity learningSituation(@RequestBody SmsConfirmReq req) {
- ResponseEntity responseEntity = new ResponseEntity();
- try {
- learningSituationMain.querySituation();
- responseEntity.success();
- } catch (Exception e) {
- logger.error("学情手动计算", e);
- responseEntity.failure(ResponseConstant.CODE_500, e.getMessage());
- }
- return responseEntity;
- }
- }
|