Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # AES/src/main/java/com/example/aes/problem/dao/impl/SubmitReportDaoImpl.java # AES/src/main/java/com/example/aes/problem/model/SubmitReport.java
This commit is contained in:
commit
10d180e7f2
|
|
@ -103,4 +103,5 @@ export default {
|
|||
reviewProblem:(data)=>request.post('/problem/reviewProblem',data),
|
||||
redoReport:(data)=>request.post('/problem/redoReport',data),
|
||||
findNextReport:(data)=>request.post('/problem/findNextReport',data),
|
||||
findSimilardocs:(data)=>request.post('/problem/findSimilardocs',data),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,14 +37,14 @@
|
|||
>
|
||||
查询
|
||||
</n-button>
|
||||
<n-checkbox
|
||||
ml-20
|
||||
size="medium"
|
||||
v-if="userStore.getRole().length > 0 && userStore.getRole().some(r => r === 'teacher')"
|
||||
v-model:checked="otherSchool"
|
||||
@update:checked="handleCheckedChange">
|
||||
其它学校班级
|
||||
</n-checkbox>
|
||||
<!-- <n-checkbox-->
|
||||
<!-- ml-20-->
|
||||
<!-- size="medium"-->
|
||||
<!-- v-if="userStore.getRole().length > 0 && userStore.getRole().some(r => r === 'teacher')"-->
|
||||
<!-- v-model:checked="otherSchool"-->
|
||||
<!-- @update:checked="handleCheckedChange">-->
|
||||
<!-- 其它学校班级-->
|
||||
<!-- </n-checkbox>-->
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,9 +8,16 @@
|
|||
</n-button>
|
||||
<n-button type="primary" size="small"
|
||||
@click="onBack" style="--n-width:
|
||||
70px;margin-left:15px ;padding: 0 0">
|
||||
50px;margin-left:15px
|
||||
;padding: 0 0">
|
||||
打回
|
||||
</n-button>
|
||||
<n-button type="primary" size="small"
|
||||
@click="onSimilardocs" style="--n-width:
|
||||
100px;margin-left:15px ;padding:
|
||||
0 0">
|
||||
查看相似文章
|
||||
</n-button>
|
||||
<!-- <n-button type="primary" size="small"-->
|
||||
<!-- @click="addTime"-->
|
||||
<!-- style="--n-width: 50px;margin-left:15px">-->
|
||||
|
|
@ -34,7 +41,7 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
const emit =
|
||||
defineEmits(['clickReview','clickBack','clickAddTime'])
|
||||
defineEmits(['clickReview','clickBack','clickSimilardocs'])
|
||||
const showModal=ref(false)
|
||||
|
||||
const onBack = ()=>{
|
||||
|
|
@ -43,6 +50,9 @@ const onBack = ()=>{
|
|||
const onReview = ()=>{
|
||||
emit('clickReview')
|
||||
}
|
||||
const onSimilardocs = ()=>{
|
||||
emit('clickSimilardocs')
|
||||
}
|
||||
// const onDelete = ()=>{
|
||||
// emit('clickDelete')
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ const updateColumns=()=>{
|
|||
{
|
||||
key: 'studentNo',
|
||||
title: '学号',
|
||||
width: '160',
|
||||
width: '120',
|
||||
align:'center',
|
||||
},
|
||||
{
|
||||
|
|
@ -195,25 +195,39 @@ const updateColumns=()=>{
|
|||
{
|
||||
key: 'submissionStatus',
|
||||
title: '状态',
|
||||
width: '150',
|
||||
width: '100',
|
||||
align:'center',
|
||||
},
|
||||
{
|
||||
key: 'finalScore',
|
||||
title: '成绩',
|
||||
width: '170',
|
||||
width: '100',
|
||||
align:'center',
|
||||
},
|
||||
{
|
||||
key: 'simularity',
|
||||
title: '相似度',
|
||||
width: '100',
|
||||
align:'center',
|
||||
},
|
||||
{
|
||||
key: 'similardocs',
|
||||
title: '相似文章',
|
||||
width: '150',
|
||||
align:'center',
|
||||
},
|
||||
{
|
||||
key: 'actions',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
align:'center',
|
||||
render(row) {
|
||||
return h(
|
||||
ProblemStudentAction,
|
||||
{onClickReview: () =>
|
||||
onReview(row),
|
||||
onClickBack: () => onBack(row)
|
||||
onClickBack: () => onBack(row),
|
||||
onClickSimilardocs:()=>onSimilardocs(row)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -231,6 +245,8 @@ const studentInfoValue = ref({
|
|||
submitTime:[],
|
||||
submissionStatus:'',
|
||||
score:0,
|
||||
simularity:'',
|
||||
similardocs:'',
|
||||
pageNum:paginationReactive.page,
|
||||
pageSize:paginationReactive.pageSize
|
||||
});
|
||||
|
|
@ -268,6 +284,41 @@ studentInfoValue.value.pageNum=currentPage
|
|||
loading.value = false;
|
||||
}
|
||||
}
|
||||
const onSimilardocs = async(studentId) =>{
|
||||
const {id} = studentId
|
||||
const res1=await api.findSimilardocs({
|
||||
studentId:id,
|
||||
problemId:problemId
|
||||
})
|
||||
studentInfoValue.value=res1.data
|
||||
try {
|
||||
const res = await api.downloadAttachment({
|
||||
fileName: studentInfoValue.value.similardocs
|
||||
})
|
||||
const contentDisposition = res.headers["content-disposition"]
|
||||
let original_fileName = ""
|
||||
if(contentDisposition) {
|
||||
const uri = res.headers["content-disposition"].split("=")[1]
|
||||
original_fileName = window.decodeURI(uri)
|
||||
}
|
||||
const blob = new Blob([res.data], {type: "application/vnd.ms-excel"});
|
||||
if(window.navigator && window.navigator.msSaveOrOpenBlob) {
|
||||
const fileName = original_fileName;
|
||||
window.navigator.msSaveOrOpenBlob(blob, fileName);
|
||||
} else{
|
||||
const fileName = original_fileName;
|
||||
const elink = document.createElement('a')
|
||||
document.body.appendChild(elink)
|
||||
elink.download= fileName;
|
||||
elink.style.display ="none"
|
||||
elink.href = window.URL.createObjectURL(blob)
|
||||
elink.click()
|
||||
window.URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
const onPasswordClass = async (classId)=>{
|
||||
// const {id} = classId
|
||||
const id=1
|
||||
|
|
@ -309,6 +360,7 @@ const onBack=async (studentId)=>{
|
|||
// await router.push({name: 'AdminProblemList'})
|
||||
}
|
||||
}
|
||||
|
||||
const onDeleteClass = async (classId)=>{
|
||||
try {
|
||||
await api.remove({ids:classId.username})
|
||||
|
|
|
|||
|
|
@ -332,6 +332,13 @@ public class ProblemController {
|
|||
return RespBean.ok("获取分数列表成功!",
|
||||
scoreList);
|
||||
}
|
||||
@PostMapping("findSimilardocs")
|
||||
public RespBean findSimilardocs(@RequestBody PMStudentSubmit pmStudentSubmit){
|
||||
List<SubmitReport> submitReports=
|
||||
problemServiceI.findSimilardocs(pmStudentSubmit);
|
||||
return RespBean.ok("获取分数列表成功!",
|
||||
submitReports.get(0));
|
||||
}
|
||||
@PostMapping("findProblemReview")
|
||||
public RespBean findProblemReview(@RequestBody PMReviewMessage pmReviewMessage){
|
||||
PMReviewMessage reviewMessage=
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public interface SubmitReportDaoI extends BaseDaoI<SubmitReport> {
|
|||
public int redoReport(PMReviewMessage pmReviewMessage);
|
||||
public List<Object[]> findProblemReview(PMReviewMessage pmReviewMessage);
|
||||
public List<Object[]> findScoreList(PMStudentSubmit pmStudentSubmit);
|
||||
public List<SubmitReport> findSimilardocs(PMStudentSubmit pmStudentSubmit);
|
||||
public List<Integer> findNextId(int problemId);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.example.aes.problem.model.PMReviewMessage;
|
|||
import com.example.aes.problem.model.PMStudentSubmit;
|
||||
import com.example.aes.problem.model.SubmitReport;
|
||||
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
||||
import com.example.aes.user.model.Course;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
|
|
@ -41,7 +42,8 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
|
|||
"and " +
|
||||
"pp.problemId " +
|
||||
"=:problemId" +
|
||||
" and sr.problemId=:problemId" +
|
||||
" and (sr.problemId=:problemId " +
|
||||
"or sr.problemId is null)" +
|
||||
" and sr" +
|
||||
".submissionTime is null and " +
|
||||
"u.studentNo like :studentNo " +
|
||||
|
|
@ -62,7 +64,6 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
|
|||
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAddTime(LocalDateTime addTime, int problemId, int studentId) {
|
||||
String hql = "UPDATE SubmitReport sr SET" +
|
||||
|
|
@ -77,7 +78,6 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
|
|||
int num = q.executeUpdate();
|
||||
return num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int editScoreAndComment(PMReviewMessage pmReviewMessage) {
|
||||
Float score = pmReviewMessage.getScore();
|
||||
|
|
@ -132,7 +132,8 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
|
|||
"sr.submissionStatus," +
|
||||
" COALESCE(sr.score," +
|
||||
" sr.autoscore) " +
|
||||
"AS finalScore ,u.id " +
|
||||
"AS finalScore ,u.id,sr" +
|
||||
".simularity,sr.similardocs " +
|
||||
"FROM Classstudents cs left " +
|
||||
"join Users u on cs" +
|
||||
".userId=u.id " +
|
||||
|
|
@ -206,7 +207,12 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
|
|||
query.setParameter("problemId", problemId);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubmitReport> findSimilardocs(PMStudentSubmit pmStudentSubmit){
|
||||
String hql = "from SubmitReport where " +
|
||||
"studentId="+pmStudentSubmit.getStudentId()+" and problemId="+pmStudentSubmit.getProblemId();
|
||||
return this.find(hql);
|
||||
}
|
||||
@Override
|
||||
public List<Object[]> findProblemReview(PMReviewMessage pmReviewMessage) {
|
||||
int studentId = pmReviewMessage.getStudentId();
|
||||
|
|
|
|||
|
|
@ -22,4 +22,6 @@ public class PMStudentSubmit {
|
|||
private int pageNum;
|
||||
private int pageSize;
|
||||
private float finalScore;
|
||||
private float simularity;
|
||||
private String similardocs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -478,6 +478,10 @@ public int redoReport(PMReviewMessage pmReviewMessage){
|
|||
}return scoreList;
|
||||
}
|
||||
@Override
|
||||
public List<SubmitReport> findSimilardocs(PMStudentSubmit pmStudentSubmit){
|
||||
return studentSubmitDao.findSimilardocs(pmStudentSubmit);
|
||||
}
|
||||
@Override
|
||||
public int findNextId(int problemId){
|
||||
List<Integer> nextList=
|
||||
studentSubmitDao.findNextId(problemId);
|
||||
|
|
@ -600,6 +604,9 @@ public int redoReport(PMReviewMessage pmReviewMessage){
|
|||
pmStudentSubmit.setChineseName((String) p[0]);
|
||||
pmStudentSubmit.setStudentNo((String) p[1]);
|
||||
pmStudentSubmit.setReadTime((LocalDateTime) p[2]);
|
||||
if(p[2]==null)
|
||||
pmStudentSubmit.setSubmissionStatus("未领取");
|
||||
else
|
||||
pmStudentSubmit.setSubmissionStatus((String) p[3]);
|
||||
pmStudentSubmit.setId((int) p[4]);
|
||||
pmStudentSubmitList.add(pmStudentSubmit);
|
||||
|
|
@ -619,6 +626,8 @@ public int redoReport(PMReviewMessage pmReviewMessage){
|
|||
pmStudentSubmit.setSubmissionStatus((String) p[3]);
|
||||
pmStudentSubmit.setFinalScore((float) p[4]);
|
||||
pmStudentSubmit.setId((int) p[5]);
|
||||
pmStudentSubmit.setSimularity((float) p[6]);
|
||||
pmStudentSubmit.setSimilardocs((String) p[7]);
|
||||
pmStudentSubmitList.add(pmStudentSubmit);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public interface ProblemServiceI {
|
|||
public int editScoreAndComment(PMReviewMessage pmReviewMessage);
|
||||
public int redoReport(PMReviewMessage pmReviewMessage);
|
||||
public List<Float> findScoreList(PMStudentSubmit pmStudentSubmit);
|
||||
public List<SubmitReport> findSimilardocs(PMStudentSubmit pmStudentSubmit);
|
||||
public int findNextId(int problemId);
|
||||
|
||||
public boolean saveSubmitInfoToProps(SubmitReport submitReport);//学生保存报告(保存,之前未保存过)
|
||||
|
|
|
|||
|
|
@ -233,6 +233,21 @@ public class AdminusersController {
|
|||
assistant.setClassIds(classIds);
|
||||
return RespBean.ok("查询用户成功", assistant);
|
||||
}
|
||||
// 根据当前登录的教师id获取教师名和用户级别
|
||||
@PostMapping("/getTeacherInfo")
|
||||
public RespBean getTeacherInfo(HttpServletRequest request){
|
||||
DecodeToken decodeToken = new DecodeToken(request);
|
||||
String role = decodeToken.getRole();
|
||||
String teacherId = decodeToken.getUserId();
|
||||
|
||||
// 根据教师id查询教师名字
|
||||
PMAdminusers pmAdminusers = adminusersServiceI.getAdminuserById(Integer.parseInt(teacherId));
|
||||
if(pmAdminusers!=null)
|
||||
return RespBean.ok("获取教师信息成功", pmAdminusers);
|
||||
else
|
||||
return RespBean.ok("没有当前教师信息");
|
||||
}
|
||||
|
||||
@PostMapping("/editAssistant")
|
||||
public RespBean editAssistant(@RequestBody PMAdminusers pmadminusers, HttpServletRequest request) // 自该助教信息
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue