修改对接签到异常问题

main
whb 3 months ago
parent 7b5654945b
commit debba582f7

@ -23,7 +23,7 @@ public class TokenProvider {
private final static String SECRET = "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAghgsx+OLLThi7c+/HgCaRla8n+/QLHt++uscoK22dMeaVa3WJvRb5C5qtHGzj9V74pI96JpxdWWCN3Zr1QtanQIDAQABAkB2fWRUD1jVMBVS+rPctLnPNPMKTRdzXGv0SC5D3tRfGZqdcfsmZg8hzBVndHxngmwZS73d+hPjofcdefDDnXq1AiEAz/r1AMF7fweN70mbKgBJuTja37puJMsH2Szwrvb5jlcCIQCgIaLZ5d9J7OomL0NwH8ghba/xgBEpKzErfGbFnTfeKwIgc8ptczFFV1DWZb2eJIEqinOr79l0jwl2YiQSD+cyw1sCIHqxCvv1Wx5jPgy/zeYNE+Q5DMP3Ii7u/x+Yk436JiI9AiEAio84hFm44YTUuV7YCYsbyvnCn/vtcAaqZlczbeHlP1I=";
private final static long EXP_TIME = 1000 * 60 * 60 * 1;
private final static String SECRET_ZHIYUN = "zy_zx_mnjy_fp76ckwuczzmb67w0a8x0";
private final static String SECRET_ZHIYUN = "zy_szmy_mnjy_fp76ckwuczzmb67w0a8x0";
private final static String CURRENT_TO_ZHIYUN = "jVzvfoZU_eFN0CJcFARg0K6DlzTLa7oMWB7lV_y2s7bkv2Bem0281wEwlJp5afhsmM-Ynwvh3mAUTpwblGEz1A";

@ -1,5 +1,7 @@
package com.sztzjy.trade.controller.stu;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.dto.DigitalTextbooksAddDTO;
import com.sztzjy.trade.service.DigitalTextbooksService;
@ -19,6 +21,7 @@ import java.util.List;
* @date 2024-12-26 11:18
*/
@Api(tags = "数字教材")
@ApiSupport(author = "fangqi", order = 1)
@RequestMapping("api/books")
@RestController
@Validated
@ -35,6 +38,7 @@ public class DigitalTextbooksController {
@ApiOperation("目录展示")
@GetMapping("/contentShow")
@AnonymousAccess
@ApiOperationSupport(author = "whb")
public ResultEntity contentShow(String schoolId) {
return digitalTextbooksService.contentShow(schoolId) ;
@ -48,6 +52,7 @@ public class DigitalTextbooksController {
@ApiOperation("内容展示")
@GetMapping("/knowInfoShow")
@AnonymousAccess
@ApiOperationSupport(author = "whb")
public ResultEntity knowInfoShow(String schoolId) {
return digitalTextbooksService.knowInfoShow(schoolId) ;
@ -61,6 +66,7 @@ public class DigitalTextbooksController {
@ApiOperation("添加目录")
@PostMapping("/addContent")
@AnonymousAccess
@ApiOperationSupport(author = "whb")
public ResultEntity addContent(@Valid @RequestBody List<DigitalTextbooksAddDTO> dto) {
return digitalTextbooksService.addContent(dto) ;
@ -70,6 +76,16 @@ public class DigitalTextbooksController {
// @ApiOperation("编辑文章")
// @PostMapping("/editContent")
// @AnonymousAccess
// public ResultEntity editContent(@Valid @RequestBody List<DigitalTextbooksAddDTO> dto) {
//
// return digitalTextbooksService.addContent(dto) ;
//
// }
}

@ -29,12 +29,12 @@ public class StuKnowledgeTrainingController {
@AnonymousAccess
@PostMapping("/expermentByAutoSave")
@ApiOperation("实训任务自动保存")
public ResultEntity expermentByAutoSave(@RequestBody StuTaskPracticeRecord stuTaskPracticeRecord) {
return service.expermentByAutoSave(stuTaskPracticeRecord);
}
// @AnonymousAccess
// @PostMapping("/expermentByAutoSave")
// @ApiOperation("实训任务自动保存")
// public ResultEntity expermentByAutoSave(@RequestBody StuTaskPracticeRecord stuTaskPracticeRecord) {
// return service.expermentByAutoSave(stuTaskPracticeRecord);
// }

@ -27,7 +27,7 @@ import java.util.List;
//教师端成绩总览
@RestController
@RequestMapping("/api/tch/generalView")
@Api("课程成绩")
@Api(tags = "课程成绩")
public class TchGeneralViewController {
@Autowired
TchGeneralViewService tchGeneralViewService;

@ -44,9 +44,9 @@ public class TchPublicNoticeController {
@ApiOperation("课程内查询已发布公告")
@AnonymousAccess
@GetMapping("/publicNoticeByCourse")
public ResultEntity publicNoticeByCourse(@ApiParam("课程ID")String courseId,@ApiParam("学校ID")String schoolId){
public ResultEntity publicNoticeByCourse(@ApiParam("课程ID")String courseId,@ApiParam("学校ID")String schoolId,Integer page ,Integer size){
return tchPublicNoticeService.publicNoticeByCourse(courseId,schoolId);
return tchPublicNoticeService.publicNoticeByCourse(courseId,schoolId,page,size);
}

@ -1,5 +1,6 @@
package com.sztzjy.trade.controller.tch;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.dto.TchEndSignDTO;
import com.sztzjy.trade.entity.dto.TchManualSignDTO;
@ -12,10 +13,12 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
@ -26,6 +29,7 @@ import java.util.Date;
@RequestMapping("api/tch/signInfo")
@RestController
@Api(tags = "签到")
@Validated
public class TchSignInfoController {
@ -44,6 +48,7 @@ public class TchSignInfoController {
@PostMapping("/add")
@ApiOperation("教师端-发起签到(统一签到接口,根据类型验证)")
@AnonymousAccess
@ApiOperationSupport(author = "wanghaobo")
public ResultEntity addDo(@Valid @RequestBody TeacherOpenCourseStudentSigninSettingDTO teacherOpenCourseStudentSigninSettingDTO) {
if (null == teacherOpenCourseStudentSigninSettingDTO.getTeacherOpenCourseStudentSigninSettingStatus()) {
@ -169,6 +174,17 @@ public class TchSignInfoController {
}
//查询所有签到信息 根据课程ID班级id,分页展示
@GetMapping("/absenceUpdateBy")
@ApiOperation("缺勤理由设置")
@AnonymousAccess
public ResultEntity absenceUpdateBy(Long teacherOpenCourseStudentSigninLogId, @NotNull @ApiParam("缺勤理由")String absenceReason) {
return teacherOpenCourseStudentSigninService.absenceUpdateBy(teacherOpenCourseStudentSigninLogId, absenceReason);
}
}

@ -2,9 +2,11 @@ package com.sztzjy.trade.entity;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.format.annotation.DateTimeFormat;
/**
*
@ -30,6 +32,8 @@ public class TextbookContentsChapterInfo {
private Integer resourceId;
@ApiModelProperty(notes = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date createTime;
@ApiModelProperty(notes = "修改时间")

@ -4,8 +4,10 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/**
* -
@ -33,6 +35,8 @@ public class TextbookContentsInfo {
@ApiModelProperty(notes = "教材id")
private String textbookId;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
@ApiModelProperty(notes = "创建时间")
private Date createTime;

@ -2,7 +2,10 @@ package com.sztzjy.trade.entity;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
/**
*
*
@ -26,6 +29,8 @@ public class TextbookContentsResourcesInfo {
private String description;
@ApiModelProperty(notes = "上传时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date uploadedAt;
@ApiModelProperty(notes = "学校ID")

@ -34,8 +34,6 @@ public class DigitalTextbooksAddDTO {
private Integer chapterLevel;
@ApiModelProperty(notes = "父章节ID如果是子章节则引用父章节ID")
@Min(value = 1, message = "章节ID必须大于0")
@NotNull
private Integer parentChapterId;
@ApiModelProperty(notes = "学校ID")

@ -1,5 +1,6 @@
package com.sztzjy.trade.entity.dto;
import com.sztzjy.trade.entity.StuTaskPracticeRecord;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -14,22 +15,36 @@ import java.util.List;
@Data
public class StuExpermentSubmitDTO {
@ApiModelProperty(notes = "任务细节列表")
private List<StuTaskDetailDTO> taskList;
@ApiModelProperty(notes = "用户ID")
@NotBlank
private String userId;
@ApiModelProperty(notes ="学号")
private String studentId;
@ApiModelProperty(notes ="姓名")
private String name;
@ApiModelProperty(notes ="班级名称")
private String className;
@ApiModelProperty(notes ="班级ID")
private String classId;
@ApiModelProperty(notes ="学校ID")
private String schoolId;
@ApiModelProperty(notes ="模块")
private String module;
@ApiModelProperty(notes = "正确次数")
private Integer correctCount;
@ApiModelProperty(notes ="项目")
private String project;
@ApiModelProperty(notes ="做题数据")
private StuTaskPracticeRecord stuTaskPracticeRecord;
@ApiModelProperty(notes = "错误次数")
private Integer errorCount;
}

@ -35,7 +35,6 @@ public class StuSignDTO {
String type;
@ApiModelProperty("验证码")
@NotNull
String value;

@ -10,7 +10,13 @@ import lombok.Data;
@Data
public class StuTaskDetailDTO {
@ApiModelProperty(notes = "任务序号")
private String taskNumber;
@ApiModelProperty(notes = "任务名称")
private String taskName;
@ApiModelProperty(notes = "错误次数")
private Integer errorCount;
}

@ -26,6 +26,8 @@ public class TeacherSigninSettingDTO {
@ApiModelProperty("班级ID集合")
private String schoolClassIds;
@ApiModelProperty("班级名称")
private String className;
@ApiModelProperty("签到方式 (数据字典 student_signin_type)")
private String teacherOpenCourseStudentSigninSettingType;

@ -24,7 +24,7 @@ public interface TchPublicNoticeService {
* @return
*/
ResultEntity publicNoticeByCourse(String courseId, String schoolId);
ResultEntity publicNoticeByCourse(String courseId, String schoolId,Integer page ,Integer size);
/**
*

@ -69,4 +69,7 @@ public interface TeacherOpenCourseStudentSigninService {
//导出
void importListInfo(HttpServletResponse response,String studentId, String type, String classId, Integer page, Integer size, Date signTime, Integer signInfo, String missInfo, Long signId, String classIds);
//缺勤理由设置
ResultEntity absenceUpdateBy(Long teacherOpenCourseStudentSigninLogId, String absenceReason);
}

@ -329,6 +329,7 @@ public class DigitalTextbooksServiceImpl implements DigitalTextbooksService {
textbookContentsInfoMapper.insertSelective(textbookContentsInfo);
});
info();
knowInfoShowByDigital(dto.get(0).getSchoolId());

@ -93,6 +93,11 @@ public class StuExpermentTrainingServiceImpl implements StuExpermentTrainingServ
//更新
stuTaskPracticeRecord.setId(practiceRecord.getId());
stuTaskPracticeRecordMapper.updateByPrimaryKeySelective(stuTaskPracticeRecord);
taskPracticeRecordList.forEach(item->{
if (practiceRecord.getId() == item.getId()) {
item.setSubState(1);
}
});
} else {
return new ResultEntity<>(HttpStatus.OK, "提交成功", 2);
}
@ -100,14 +105,16 @@ public class StuExpermentTrainingServiceImpl implements StuExpermentTrainingServ
}
Double schedule = scheduleInfo(taskPracticeRecordList);
List<StuTaskPracticeRecord> practiceRecordList = taskPracticeRecordList.stream().filter(item -> item.getSubState() == 1).collect(Collectors.toList());
//进度表
Double schedule = scheduleInfo(practiceRecordList);
//分数写进得分详情表
scoreDetail(stuTaskPracticeRecord, schedule);
return new ResultEntity<>(HttpStatus.OK, "提交成功");
}
//完成进度计算

@ -228,8 +228,6 @@ public class StuSignInfoServiceImpl implements StuSignInfoService {
teacherOpenCourseStudentSigninLogMapper.insertSelective(studentSigninLog);
//签到记录
StuLearningRecordExample stuLearningRecordExample = new StuLearningRecordExample();
stuLearningRecordExample.createCriteria().andUserIdEqualTo(stuSignDTO.getUserId());

@ -4,6 +4,8 @@ package com.sztzjy.trade.service.impl;/**
*/
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.dto.StuPublicNoticeByReadInfoDTO;
import com.sztzjy.trade.entity.dto.TchPublicNoticeDTO;
@ -157,7 +159,9 @@ public class TchPublicNoticeServiceImpl implements TchPublicNoticeService {
*/
@Override
public ResultEntity publicNoticeByCourse(String courseId, String schoolId) {
public ResultEntity publicNoticeByCourse(String courseId, String schoolId,Integer page ,Integer size) {
PageHelper.startPage(page,size);
TchPublicNoticeCourseExample example = new TchPublicNoticeCourseExample();
example.createCriteria().andCourseIdEqualTo(courseId).andSchoolIdEqualTo(schoolId);
@ -188,6 +192,9 @@ public class TchPublicNoticeServiceImpl implements TchPublicNoticeService {
return s2.getCreateTime().compareTo(s1.getCreateTime());
}
});
return new ResultEntity<>(HttpStatus.OK,publicNoticeArrayList);
PageInfo pageInfo = new PageInfo(publicNoticeArrayList);
return new ResultEntity<>(HttpStatus.OK,pageInfo);
}
}

@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
public class TeacherOpenCourseStudentSigninServiceImpl implements TeacherOpenCourseStudentSigninService {
@ -443,6 +444,8 @@ public class TeacherOpenCourseStudentSigninServiceImpl implements TeacherOpenCou
teacherSigninSettingDTO.setSignCount(countByClass - missSizeManual);
teacherSigninSettingDTO.setMissStudent(missSizeManual);
teacherSigninSettingDTO.setTotalAttendRate(roundedResult);
teacherSigninSettingDTO.setClassName(classString(teacherSigninSettingDTO.getSchoolClassIds()));
teacherSigninSettingDTOS.add(teacherSigninSettingDTO);
@ -485,7 +488,7 @@ public class TeacherOpenCourseStudentSigninServiceImpl implements TeacherOpenCou
totalAttendRate = +roundedResult;
teacherSigninSettingDTO.setTotalAttendRate(roundedResult);
teacherSigninSettingDTO.setClassName(classString(teacherSigninSettingDTO.getSchoolClassIds()));
teacherSigninSettingDTOS.add(teacherSigninSettingDTO);
} else {
@ -499,7 +502,7 @@ public class TeacherOpenCourseStudentSigninServiceImpl implements TeacherOpenCou
teacherSigninSettingDTO.setTotalAttendRate(0.0);
teacherSigninSettingDTO.setSum(countByClass);
teacherSigninSettingDTO.setClassName(classString(teacherSigninSettingDTO.getSchoolClassIds()));
teacherSigninSettingDTOS.add(teacherSigninSettingDTO);
}
@ -517,6 +520,21 @@ public class TeacherOpenCourseStudentSigninServiceImpl implements TeacherOpenCou
}
//查询班级数据
public String classString(String str) {
String[] strings = str.split(",");
StuUserExample stuUserExample = new StuUserExample();
stuUserExample.createCriteria().andClassIdIn(Arrays.asList(strings));
List<StuUser> stuUserList = stuUserMapper.selectByExample(stuUserExample);
Stream<String> distinct = stuUserList.stream().map(StuUser::getClassName).distinct();
StringBuilder stringBuilder = new StringBuilder();
distinct.forEach(stuUser -> {
stringBuilder.append(stuUser+",");
});
return stringBuilder.toString();
}
//班级下拉框
@Override
public ResultEntity getClassListByNameOrSchoolId(String schoolId, String studentId,
@ -700,6 +718,23 @@ public class TeacherOpenCourseStudentSigninServiceImpl implements TeacherOpenCou
}
}
//缺勤理由设置
@Override
public ResultEntity absenceUpdateBy(Long teacherOpenCourseStudentSigninLogId, String absenceReason) {
TeacherOpenCourseStudentSigninLog teacherOpenCourseStudentSigninLog =
teacherOpenCourseStudentSigninLogMapper.selectByPrimaryKey(teacherOpenCourseStudentSigninLogId);
teacherOpenCourseStudentSigninLog.setTeacherOpenCourseStudentSigninLogRemark(absenceReason);
teacherOpenCourseStudentSigninLogMapper.updateByPrimaryKeySelective(teacherOpenCourseStudentSigninLog);
return new ResultEntity<>(HttpStatus.OK);
}
//实际数据结果集
private List<StuImportExcelDTO> resultList(String studentId, String type, String classId, Integer page, Integer size, Date signTime,

Loading…
Cancel
Save