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:
musteven 2025-04-23 13:58:22 +08:00
commit 10d180e7f2
11 changed files with 123 additions and 19 deletions

View File

@ -103,4 +103,5 @@ export default {
reviewProblem:(data)=>request.post('/problem/reviewProblem',data), reviewProblem:(data)=>request.post('/problem/reviewProblem',data),
redoReport:(data)=>request.post('/problem/redoReport',data), redoReport:(data)=>request.post('/problem/redoReport',data),
findNextReport:(data)=>request.post('/problem/findNextReport',data), findNextReport:(data)=>request.post('/problem/findNextReport',data),
findSimilardocs:(data)=>request.post('/problem/findSimilardocs',data),
} }

View File

@ -37,14 +37,14 @@
> >
查询 查询
</n-button> </n-button>
<n-checkbox <!-- <n-checkbox-->
ml-20 <!-- ml-20-->
size="medium" <!-- size="medium"-->
v-if="userStore.getRole().length > 0 && userStore.getRole().some(r => r === 'teacher')" <!-- v-if="userStore.getRole().length > 0 && userStore.getRole().some(r => r === 'teacher')"-->
v-model:checked="otherSchool" <!-- v-model:checked="otherSchool"-->
@update:checked="handleCheckedChange"> <!-- @update:checked="handleCheckedChange">-->
其它学校班级 <!-- 其它学校班级-->
</n-checkbox> <!-- </n-checkbox>-->
</n-form-item> </n-form-item>
</n-form> </n-form>
</div> </div>

View File

@ -8,9 +8,16 @@
</n-button> </n-button>
<n-button type="primary" size="small" <n-button type="primary" size="small"
@click="onBack" style="--n-width: @click="onBack" style="--n-width:
70px;margin-left:15px ;padding: 0 0"> 50px;margin-left:15px
;padding: 0 0">
打回 打回
</n-button> </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"--> <!-- <n-button type="primary" size="small"-->
<!-- @click="addTime"--> <!-- @click="addTime"-->
<!-- style="&#45;&#45;n-width: 50px;margin-left:15px">--> <!-- style="&#45;&#45;n-width: 50px;margin-left:15px">-->
@ -34,7 +41,7 @@
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
const emit = const emit =
defineEmits(['clickReview','clickBack','clickAddTime']) defineEmits(['clickReview','clickBack','clickSimilardocs'])
const showModal=ref(false) const showModal=ref(false)
const onBack = ()=>{ const onBack = ()=>{
@ -43,6 +50,9 @@ const onBack = ()=>{
const onReview = ()=>{ const onReview = ()=>{
emit('clickReview') emit('clickReview')
} }
const onSimilardocs = ()=>{
emit('clickSimilardocs')
}
// const onDelete = ()=>{ // const onDelete = ()=>{
// emit('clickDelete') // emit('clickDelete')
// } // }

View File

@ -177,7 +177,7 @@ const updateColumns=()=>{
{ {
key: 'studentNo', key: 'studentNo',
title: '学号', title: '学号',
width: '160', width: '120',
align:'center', align:'center',
}, },
{ {
@ -195,25 +195,39 @@ const updateColumns=()=>{
{ {
key: 'submissionStatus', key: 'submissionStatus',
title: '状态', title: '状态',
width: '150', width: '100',
align:'center', align:'center',
}, },
{ {
key: 'finalScore', key: 'finalScore',
title: '成绩', title: '成绩',
width: '170', width: '100',
align:'center',
},
{
key: 'simularity',
title: '相似度',
width: '100',
align:'center',
},
{
key: 'similardocs',
title: '相似文章',
width: '150',
align:'center', align:'center',
}, },
{ {
key: 'actions', key: 'actions',
title: '操作', title: '操作',
width: '250', width: '250',
align:'center',
render(row) { render(row) {
return h( return h(
ProblemStudentAction, ProblemStudentAction,
{onClickReview: () => {onClickReview: () =>
onReview(row), onReview(row),
onClickBack: () => onBack(row) onClickBack: () => onBack(row),
onClickSimilardocs:()=>onSimilardocs(row)
} }
); );
} }
@ -231,6 +245,8 @@ const studentInfoValue = ref({
submitTime:[], submitTime:[],
submissionStatus:'', submissionStatus:'',
score:0, score:0,
simularity:'',
similardocs:'',
pageNum:paginationReactive.page, pageNum:paginationReactive.page,
pageSize:paginationReactive.pageSize pageSize:paginationReactive.pageSize
}); });
@ -268,6 +284,41 @@ studentInfoValue.value.pageNum=currentPage
loading.value = false; 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 onPasswordClass = async (classId)=>{
// const {id} = classId // const {id} = classId
const id=1 const id=1
@ -309,6 +360,7 @@ const onBack=async (studentId)=>{
// await router.push({name: 'AdminProblemList'}) // await router.push({name: 'AdminProblemList'})
} }
} }
const onDeleteClass = async (classId)=>{ const onDeleteClass = async (classId)=>{
try { try {
await api.remove({ids:classId.username}) await api.remove({ids:classId.username})

View File

@ -332,6 +332,13 @@ public class ProblemController {
return RespBean.ok("获取分数列表成功!", return RespBean.ok("获取分数列表成功!",
scoreList); scoreList);
} }
@PostMapping("findSimilardocs")
public RespBean findSimilardocs(@RequestBody PMStudentSubmit pmStudentSubmit){
List<SubmitReport> submitReports=
problemServiceI.findSimilardocs(pmStudentSubmit);
return RespBean.ok("获取分数列表成功!",
submitReports.get(0));
}
@PostMapping("findProblemReview") @PostMapping("findProblemReview")
public RespBean findProblemReview(@RequestBody PMReviewMessage pmReviewMessage){ public RespBean findProblemReview(@RequestBody PMReviewMessage pmReviewMessage){
PMReviewMessage reviewMessage= PMReviewMessage reviewMessage=

View File

@ -16,6 +16,7 @@ public interface SubmitReportDaoI extends BaseDaoI<SubmitReport> {
public int redoReport(PMReviewMessage pmReviewMessage); public int redoReport(PMReviewMessage pmReviewMessage);
public List<Object[]> findProblemReview(PMReviewMessage pmReviewMessage); public List<Object[]> findProblemReview(PMReviewMessage pmReviewMessage);
public List<Object[]> findScoreList(PMStudentSubmit pmStudentSubmit); public List<Object[]> findScoreList(PMStudentSubmit pmStudentSubmit);
public List<SubmitReport> findSimilardocs(PMStudentSubmit pmStudentSubmit);
public List<Integer> findNextId(int problemId); public List<Integer> findNextId(int problemId);

View File

@ -5,6 +5,7 @@ import com.example.aes.problem.model.PMReviewMessage;
import com.example.aes.problem.model.PMStudentSubmit; import com.example.aes.problem.model.PMStudentSubmit;
import com.example.aes.problem.model.SubmitReport; import com.example.aes.problem.model.SubmitReport;
import com.example.aes.user.dao.impl.BaseDaoImpl; import com.example.aes.user.dao.impl.BaseDaoImpl;
import com.example.aes.user.model.Course;
import org.hibernate.Query; import org.hibernate.Query;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
@ -41,7 +42,8 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
"and " + "and " +
"pp.problemId " + "pp.problemId " +
"=:problemId" + "=:problemId" +
" and sr.problemId=:problemId" + " and (sr.problemId=:problemId " +
"or sr.problemId is null)" +
" and sr" + " and sr" +
".submissionTime is null and " + ".submissionTime is null and " +
"u.studentNo like :studentNo " + "u.studentNo like :studentNo " +
@ -62,7 +64,6 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
return query.getResultList(); return query.getResultList();
} }
@Override @Override
public int updateAddTime(LocalDateTime addTime, int problemId, int studentId) { public int updateAddTime(LocalDateTime addTime, int problemId, int studentId) {
String hql = "UPDATE SubmitReport sr SET" + String hql = "UPDATE SubmitReport sr SET" +
@ -77,7 +78,6 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
int num = q.executeUpdate(); int num = q.executeUpdate();
return num; return num;
} }
@Override @Override
public int editScoreAndComment(PMReviewMessage pmReviewMessage) { public int editScoreAndComment(PMReviewMessage pmReviewMessage) {
Float score = pmReviewMessage.getScore(); Float score = pmReviewMessage.getScore();
@ -132,7 +132,8 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
"sr.submissionStatus," + "sr.submissionStatus," +
" COALESCE(sr.score," + " COALESCE(sr.score," +
" sr.autoscore) " + " sr.autoscore) " +
"AS finalScore ,u.id " + "AS finalScore ,u.id,sr" +
".simularity,sr.similardocs " +
"FROM Classstudents cs left " + "FROM Classstudents cs left " +
"join Users u on cs" + "join Users u on cs" +
".userId=u.id " + ".userId=u.id " +
@ -206,7 +207,12 @@ public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements Su
query.setParameter("problemId", problemId); query.setParameter("problemId", problemId);
return query.getResultList(); 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 @Override
public List<Object[]> findProblemReview(PMReviewMessage pmReviewMessage) { public List<Object[]> findProblemReview(PMReviewMessage pmReviewMessage) {
int studentId = pmReviewMessage.getStudentId(); int studentId = pmReviewMessage.getStudentId();

View File

@ -22,4 +22,6 @@ public class PMStudentSubmit {
private int pageNum; private int pageNum;
private int pageSize; private int pageSize;
private float finalScore; private float finalScore;
private float simularity;
private String similardocs;
} }

View File

@ -478,6 +478,10 @@ public int redoReport(PMReviewMessage pmReviewMessage){
}return scoreList; }return scoreList;
} }
@Override @Override
public List<SubmitReport> findSimilardocs(PMStudentSubmit pmStudentSubmit){
return studentSubmitDao.findSimilardocs(pmStudentSubmit);
}
@Override
public int findNextId(int problemId){ public int findNextId(int problemId){
List<Integer> nextList= List<Integer> nextList=
studentSubmitDao.findNextId(problemId); studentSubmitDao.findNextId(problemId);
@ -600,6 +604,9 @@ public int redoReport(PMReviewMessage pmReviewMessage){
pmStudentSubmit.setChineseName((String) p[0]); pmStudentSubmit.setChineseName((String) p[0]);
pmStudentSubmit.setStudentNo((String) p[1]); pmStudentSubmit.setStudentNo((String) p[1]);
pmStudentSubmit.setReadTime((LocalDateTime) p[2]); pmStudentSubmit.setReadTime((LocalDateTime) p[2]);
if(p[2]==null)
pmStudentSubmit.setSubmissionStatus("未领取");
else
pmStudentSubmit.setSubmissionStatus((String) p[3]); pmStudentSubmit.setSubmissionStatus((String) p[3]);
pmStudentSubmit.setId((int) p[4]); pmStudentSubmit.setId((int) p[4]);
pmStudentSubmitList.add(pmStudentSubmit); pmStudentSubmitList.add(pmStudentSubmit);
@ -619,6 +626,8 @@ public int redoReport(PMReviewMessage pmReviewMessage){
pmStudentSubmit.setSubmissionStatus((String) p[3]); pmStudentSubmit.setSubmissionStatus((String) p[3]);
pmStudentSubmit.setFinalScore((float) p[4]); pmStudentSubmit.setFinalScore((float) p[4]);
pmStudentSubmit.setId((int) p[5]); pmStudentSubmit.setId((int) p[5]);
pmStudentSubmit.setSimularity((float) p[6]);
pmStudentSubmit.setSimilardocs((String) p[7]);
pmStudentSubmitList.add(pmStudentSubmit); pmStudentSubmitList.add(pmStudentSubmit);
} }

View File

@ -54,6 +54,7 @@ public interface ProblemServiceI {
public int editScoreAndComment(PMReviewMessage pmReviewMessage); public int editScoreAndComment(PMReviewMessage pmReviewMessage);
public int redoReport(PMReviewMessage pmReviewMessage); public int redoReport(PMReviewMessage pmReviewMessage);
public List<Float> findScoreList(PMStudentSubmit pmStudentSubmit); public List<Float> findScoreList(PMStudentSubmit pmStudentSubmit);
public List<SubmitReport> findSimilardocs(PMStudentSubmit pmStudentSubmit);
public int findNextId(int problemId); public int findNextId(int problemId);
public boolean saveSubmitInfoToProps(SubmitReport submitReport);//学生保存报告(保存,之前未保存过) public boolean saveSubmitInfoToProps(SubmitReport submitReport);//学生保存报告(保存,之前未保存过)

View File

@ -233,6 +233,21 @@ public class AdminusersController {
assistant.setClassIds(classIds); assistant.setClassIds(classIds);
return RespBean.ok("查询用户成功", assistant); 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") @PostMapping("/editAssistant")
public RespBean editAssistant(@RequestBody PMAdminusers pmadminusers, HttpServletRequest request) // 自该助教信息 public RespBean editAssistant(@RequestBody PMAdminusers pmadminusers, HttpServletRequest request) // 自该助教信息
{ {