对外开放接口调整

beetlsql3-dev
陈沅 1 year ago
parent 071480c640
commit 080f7ddc7b

@ -37,4 +37,5 @@ public interface SchoolClassDao extends BaseMapper<SchoolClass> {
List<Map<String,Object>> getClassListByMajorId(String majorId);
}

@ -117,4 +117,8 @@ public interface StudentDao extends BaseMapper<Student>{
List<Map<String,Object>>getStudentInfoByClassId(String classIds);
List<Map<String,Object>>getStudentInfoByKeyword(String keyword,Long schoolId);
PageQuery<Map<String,Object>> pagedListStudentInfoByClassId(PageQuery query);
}

@ -75,43 +75,71 @@ import static com.ibeetl.jlw.web.IpAddressController.ipAddressMap;
@Transactional
public class StudentService extends CoreBaseService<Student> {
@Autowired private StudentDao studentDao;
@Autowired private SchoolClassDao schoolClassDao;
@Autowired private CoreUserRoleDao coreUserRoleDao;
@Autowired private StudentQuestionLogService studentQuestionLogService;
@Autowired private StudentQuestionLogInfoService studentQuestionLogInfoService;
@Autowired private StudentQuestionLogAnswerService studentQuestionLogAnswerService;
@Autowired private WrongQuestionService wrongQuestionService;
@Autowired
private StudentDao studentDao;
@Autowired
private SchoolClassDao schoolClassDao;
@Autowired
private CoreUserRoleDao coreUserRoleDao;
@Autowired
private StudentQuestionLogService studentQuestionLogService;
@Autowired
private StudentQuestionLogInfoService studentQuestionLogInfoService;
@Autowired
private StudentQuestionLogAnswerService studentQuestionLogAnswerService;
@Autowired
private WrongQuestionService wrongQuestionService;
@Autowired CorePlatformService platformService;
@Autowired
CorePlatformService platformService;
@Autowired UserConsoleService userConsoleService;
@Autowired
UserConsoleService userConsoleService;
@Autowired SchoolClassService schoolClassService;
@Autowired
SchoolClassService schoolClassService;
@Autowired private CompetitionService competitionService;
@Autowired private CompetitionStudentsService competitionStudentsService;
@Autowired private CompetitionTaskOneQuestionService competitionTaskOneQuestionService;
@Autowired private CompetitionTaskSecondQuestionService competitionTaskSecondQuestionService;
@Autowired private CompetitionTaskSecondQuestionStepService competitionTaskSecondQuestionStepService;
@Autowired
private CompetitionService competitionService;
@Autowired
private CompetitionStudentsService competitionStudentsService;
@Autowired
private CompetitionTaskOneQuestionService competitionTaskOneQuestionService;
@Autowired
private CompetitionTaskSecondQuestionService competitionTaskSecondQuestionService;
@Autowired
private CompetitionTaskSecondQuestionStepService competitionTaskSecondQuestionStepService;
@Autowired private ExamService examService;
@Autowired private ExamStudentsService examStudentsService;
@Autowired private ExamTaskOneQuestionService examTaskOneQuestionService;
@Autowired private ExamTaskSecondQuestionService examTaskSecondQuestionService;
@Autowired private ExamTaskSecondQuestionStepService examTaskSecondQuestionStepService;
@Autowired private ExamTaskThreeQuestionService examTaskThreeQuestionService;
@Autowired private ExamTaskThreeQuestionStepService examTaskThreeQuestionStepService;
@Autowired
private ExamService examService;
@Autowired
private ExamStudentsService examStudentsService;
@Autowired
private ExamTaskOneQuestionService examTaskOneQuestionService;
@Autowired
private ExamTaskSecondQuestionService examTaskSecondQuestionService;
@Autowired
private ExamTaskSecondQuestionStepService examTaskSecondQuestionStepService;
@Autowired
private ExamTaskThreeQuestionService examTaskThreeQuestionService;
@Autowired
private ExamTaskThreeQuestionStepService examTaskThreeQuestionStepService;
@Autowired private ResourcesQuestionService resourcesQuestionService;
@Autowired
private ResourcesQuestionService resourcesQuestionService;
@Autowired private CourseInfoService courseInfoService;
@Autowired
private CourseInfoService courseInfoService;
@Autowired private StudentDefenceLogService studentDefenceLogService;
@Autowired private StudentDefenceLogInfoService studentDefenceLogInfoService;
@Autowired private StudentDefenceLogNoteService studentDefenceLogNoteService;
@Autowired
private StudentDefenceLogService studentDefenceLogService;
@Autowired
private StudentDefenceLogInfoService studentDefenceLogInfoService;
@Autowired
private StudentDefenceLogNoteService studentDefenceLogNoteService;
@Autowired private StudentAccountAssetAllocationService studentAccountAssetAllocationService;
@Autowired
private StudentAccountAssetAllocationService studentAccountAssetAllocationService;
private final ExecutorService pool = Executors.newCachedThreadPool();
@ -129,10 +157,10 @@ public class StudentService extends CoreBaseService<Student>{
}
/**
*
* Mock
*
* @param query
* @return
*/
@ -194,6 +222,7 @@ public class StudentService extends CoreBaseService<Student>{
/**
*
*
* @param query
* @return
*/
@ -209,13 +238,14 @@ public class StudentService extends CoreBaseService<Student>{
/**
*
*
*
* <p>
*
* lastLoginTime
* onlineDuration 线
* ip IP
* ipAddress IP
*
*
* @param query
* @return
*/
@ -231,6 +261,7 @@ public class StudentService extends CoreBaseService<Student>{
/**
*
*
* @param query
* @return
*/
@ -245,6 +276,7 @@ public class StudentService extends CoreBaseService<Student>{
/**
* -
*
* @param query
* @return
*/
@ -303,7 +335,8 @@ public class StudentService extends CoreBaseService<Student>{
List<Student> studentLogList = getPracticePerformanceStatisticInfo(query);
try {
groupByCourseInfoId = studentLogList.stream().collect(Collectors.groupingBy(e -> Long.parseLong(null != e.get("courseInfoId") ? e.get("courseInfoId").toString() : "-1")));
}catch (Exception e){}
} catch (Exception e) {
}
}
if (null != groupByCourseInfoId) {
@ -373,7 +406,8 @@ public class StudentService extends CoreBaseService<Student>{
List<Student> studentLogList = getPracticeProgress(query);
try {
groupByCourseInfoId = studentLogList.stream().collect(Collectors.groupingBy(e -> Long.parseLong(null != e.get("courseInfoId") ? e.get("courseInfoId").toString() : "-1")));
}catch (Exception e){}
} catch (Exception e) {
}
}
if (null != groupByCourseInfoId) {
@ -402,7 +436,6 @@ public class StudentService extends CoreBaseService<Student>{
}
public PageQuery<Student> queryByCondition2Student(PageQuery query) {
PageQuery ret = studentDao.queryByCondition2Student(query);
queryListAfter(ret.getList());
@ -876,7 +909,8 @@ public class StudentService extends CoreBaseService<Student>{
Map<Long, List<CompetitionTaskOneQuestion>> groupByCT1QId = null;
try {
groupByCT1QId = oldCT1QuestionList.stream().collect(Collectors.groupingBy(e -> e.getCompetitionTaskOneQuestionId()));
}catch (Exception e){}
} catch (Exception e) {
}
if (null == groupByCT1QId) {
return JsonResult.failMessage("数据有误,请联系管理员");
}
@ -885,7 +919,8 @@ public class StudentService extends CoreBaseService<Student>{
Map<String, JSONObject> cT1QuestionMap = new HashMap<>();
try {
cT1QuestionMap = (JSONObject.parseObject(condition.getCT1QuestionMapJson(), HashMap.class));
} catch (Exception e) {}
} catch (Exception e) {
}
List<CompetitionTaskOneQuestion> competitionTaskOneQuestionList = new ArrayList<>();
for (Map.Entry<String, JSONObject> entry : cT1QuestionMap.entrySet()) {
@ -1074,7 +1109,8 @@ public class StudentService extends CoreBaseService<Student>{
} catch (Exception e) {
try {
studentAnswerList.add(JSONObject.parseObject(condition.getStudentAnswer(), String.class));
} catch (Exception e1) {}
} catch (Exception e1) {
}
}
//将学生答案替换到题目中
@ -1146,7 +1182,8 @@ public class StudentService extends CoreBaseService<Student>{
Map<Long, List<ExamTaskOneQuestion>> groupByET1QId = null;
try {
groupByET1QId = oldET1QuestionList.stream().collect(Collectors.groupingBy(e -> e.getExamTaskOneQuestionId()));
}catch (Exception e){}
} catch (Exception e) {
}
if (null == groupByET1QId) {
return JsonResult.failMessage("数据有误,请联系管理员");
}
@ -1155,7 +1192,8 @@ public class StudentService extends CoreBaseService<Student>{
Map<String, JSONObject> eT1QuestionMap = new HashMap<>();
try {
eT1QuestionMap = (JSONObject.parseObject(condition.getET1QuestionMapJson(), HashMap.class));
} catch (Exception e) {}
} catch (Exception e) {
}
List<ExamTaskOneQuestion> examTaskOneQuestionList = new ArrayList<>();
for (Map.Entry<String, JSONObject> entry : eT1QuestionMap.entrySet()) {
@ -1276,7 +1314,8 @@ public class StudentService extends CoreBaseService<Student>{
} catch (Exception e) {
try {
studentAnswerList.add(JSONObject.parseObject(condition.getStudentAnswer(), String.class));
} catch (Exception e1) {}
} catch (Exception e1) {
}
}
//将学生答案替换到题目中
@ -1387,7 +1426,8 @@ public class StudentService extends CoreBaseService<Student>{
} catch (Exception e) {
try {
studentAnswerList.add(JSONObject.parseObject(condition.getStudentAnswer(), String.class));
} catch (Exception e1) {}
} catch (Exception e1) {
}
}
//将学生答案替换到题目中
@ -1578,4 +1618,17 @@ public class StudentService extends CoreBaseService<Student>{
return studentDao.getStudentInfoByClassId(classId);
}
public List<Map<String, Object>> getStudentInfoByKeyword(String keyword, Long schoolId) {
return studentDao.getStudentInfoByKeyword(keyword, schoolId);
}
public PageQuery<Map<String, Object>> pagedListStudentInfoByClassId(String classIds,Integer pageNo, Integer pageSize) {
PageQuery pageQuery = new PageQuery();
pageQuery.setPageSize(pageSize);
pageQuery.setPageNumber(pageNo);
Map<String,Object> map = new HashMap<>();
map.put("classIds",classIds);
pageQuery.setParas(map);
return studentDao.pagedListStudentInfoByClassId(pageQuery);
}
}

@ -11,6 +11,7 @@ import com.ibeetl.jlw.web.query.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javafx.beans.binding.DoubleExpression;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.sql.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -796,4 +798,28 @@ public class AccountController {
public JsonResult<List<Map<String,Object>>> getClassListByMajorId(String majorId){
return JsonResult.success(schoolClassService.getClassListByMajorId(majorId));
}
@ApiOperation("根据关键字查询学生信息")
@GetMapping("getStudentByKeyword.json")
public JsonResult<List<Map<String, Object>>> getStudentByKeyword(String keyword,Integer schoolId){
return JsonResult.success(studentService.getStudentInfoByKeyword(keyword,Long.valueOf(schoolId)));
}
@ApiOperation("根据班级id分页展示学生数据")
@GetMapping("pagedListStudentByClassId.json")
public Map<String, Object> pagedListStudentByClassId(String classList,Integer page,Integer size){
if(page==null||page<1){
page=1;
}
if(size==null){
size=10;
}
PageQuery<Map<String, Object>> mapPageQuery = studentService.pagedListStudentInfoByClassId(classList,page,size);
Map<String,Object> map = new HashMap<>();
map.put("code",0);
map.put("msg","成功");
map.put("count",mapPageQuery.getTotalRow());
map.put("content",mapPageQuery);
return map;
}
}

@ -2163,3 +2163,40 @@ getStudentInfoByClassId
JOIN universities_colleges on school_class.universities_colleges_id = universities_colleges.universities_colleges_id
WHERE
student.class_id IN (#classIds#)
getStudentInfoByKeyword
===
SELECT
student.user_id AS userid,
student_id as studentid,
student_name AS NAME,
student.class_id AS classId,
school_class.class_name AS className,
student_sn AS studentNo,
universities_colleges_name as schoolName
FROM
student
JOIN school_class ON student.class_id = school_class.class_id
JOIN universities_colleges on school_class.universities_colleges_id = universities_colleges.universities_colleges_id
WHERE student.student_name like #keyword+'%'# and universities_colleges.universities_colleges_id=#schoolId#
pagedListStudentInfoByClassId
===
SELECT
@pageTag(){
student.user_id AS userid,
student_id as studentid,
student_name AS NAME,
student.class_id AS classId,
school_class.class_name AS className,
student_sn AS studentNo,
universities_colleges_name as schoolName @}
FROM
student
JOIN school_class ON student.class_id = school_class.class_id
JOIN universities_colleges on school_class.universities_colleges_id = universities_colleges.universities_colleges_id
WHERE 1=1 @if(!isEmpty(classIds)){
and find_in_set(student.class_id ,#classIds#)
@}
Loading…
Cancel
Save