作业列表的修改设置完成,作业提交情况的查询完成
This commit is contained in:
parent
d14d16fd37
commit
4ee3589ed0
|
|
@ -87,4 +87,7 @@ export default {
|
||||||
editProblem:(data) => request.post('/problem/editProblem', data),
|
editProblem:(data) => request.post('/problem/editProblem', data),
|
||||||
deleteProblem:(data) => request.post('/problem/deleteProblem', data),
|
deleteProblem:(data) => request.post('/problem/deleteProblem', data),
|
||||||
findAllProblemByCourseIdAndClassId:(data)=>request.post('/problem/findAllProblemByCourseIdAndClassId',data),
|
findAllProblemByCourseIdAndClassId:(data)=>request.post('/problem/findAllProblemByCourseIdAndClassId',data),
|
||||||
|
findPostProblem:(data)=>request.post('/problem/findPostProblem',data),
|
||||||
|
updateSetup:(data)=>request.post('/problem/updateSetup',data),
|
||||||
|
findStudentSubmit:(data)=>request.post('/problem/findStudentSubmit',data),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ import { useRoute, useRouter } from 'vue-router'
|
||||||
const rules=ref(null)
|
const rules=ref(null)
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
const {problemId, history } = route.query
|
||||||
const ProblemInfoRef = ref(null)
|
const ProblemInfoRef = ref(null)
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const ScoringRubricList =
|
const ScoringRubricList =
|
||||||
|
|
@ -66,7 +68,7 @@ let columns = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
const queryByPage = async (currentPage)=>{
|
const queryByPage = async ()=>{
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await
|
const res = await
|
||||||
|
|
@ -113,6 +115,7 @@ const onChangePage = (page) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
|
path.value = router.currentRoute.value.fullPath
|
||||||
queryByPage()
|
queryByPage()
|
||||||
})
|
})
|
||||||
watch(route, () => {
|
watch(route, () => {
|
||||||
|
|
|
||||||
|
|
@ -5,104 +5,127 @@
|
||||||
<n-form
|
<n-form
|
||||||
ref="problemInfoRef"
|
ref="problemInfoRef"
|
||||||
:model="problemInfoValue"
|
:model="problemInfoValue"
|
||||||
:rules="problemAddRules"
|
:rules="problemPostRules"
|
||||||
label-placement="left"
|
label-placement="left"
|
||||||
label-align="right"
|
label-align="right"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
:show-require-mark="false"
|
:show-require-mark="false"
|
||||||
>
|
>
|
||||||
<div class="exam-name-div">
|
|
||||||
<n-h2
|
|
||||||
class="show-problem-name">
|
|
||||||
{{ problemName }}
|
|
||||||
</n-h2>
|
|
||||||
<!-- <div class="grid md:grid-cols-2 md:gap-x-30">-->
|
|
||||||
<!-- <n-form-item label="发放对象:" path="class">-->
|
|
||||||
<!-- <n-button type="primary" size="small"-->
|
|
||||||
<!-- @click="onAdd"-->
|
|
||||||
<!-- style="margin-left: 5px">-->
|
|
||||||
<!-- 添加对象</n-button>-->
|
|
||||||
<!-- </n-form-item>-->
|
|
||||||
|
|
||||||
<!-- </div>-->
|
<!-- <div class="grid md:grid-cols-2 md:gap-x-30">-->
|
||||||
<div class="grid md:grid-cols-3 md:gap-x-30">
|
<!-- <n-form-item-->
|
||||||
<n-form-item label="有效时段:"
|
<!-- style='margin-left: 30px;margin-bottom: -10px'><n-h2>-->
|
||||||
path="timeFrom">
|
<!-- {{problemInfoValue.title}}-->
|
||||||
<n-date-picker
|
<!-- </n-h2></n-form-item></div>-->
|
||||||
v-model:formatted-value="problemInfoValue.timeFrom"
|
<div class="grid md:grid-cols-3 md:gap-x-30">
|
||||||
style="width: 350px"
|
<n-form-item label="有效时段:">
|
||||||
type="datetime"
|
<n-date-picker
|
||||||
input-readonly
|
v-model:formatted-value="problemInfoValue.startTime"
|
||||||
placeholder="请选择开始时间"
|
style="width: 350px"
|
||||||
format="yyyy-MM-dd HH:mm"
|
type="datetime"
|
||||||
update-value-on-close
|
input-readonly
|
||||||
:actions="['confirm']"
|
placeholder="请选择开始时间"
|
||||||
/>
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
</n-form-item>
|
update-value-on-close
|
||||||
<n-form-item label="到:" path="timeTo">
|
:actions="['confirm']"
|
||||||
<n-date-picker
|
/>
|
||||||
v-model:formatted-value="problemInfoValue.timeTo"
|
</n-form-item>
|
||||||
style="width: 300px"
|
<n-form-item label="到:">
|
||||||
type="datetime"
|
<n-date-picker
|
||||||
input-readonly
|
v-model:formatted-value="problemInfoValue.endTime"
|
||||||
placeholder="请选择结束时间"
|
style="width: 300px"
|
||||||
format="yyyy-MM-dd HH:mm"
|
type="datetime"
|
||||||
update-value-on-close
|
input-readonly
|
||||||
:actions="['confirm']"
|
placeholder="请选择结束时间"
|
||||||
/>
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
</n-form-item>
|
update-value-on-close
|
||||||
</div>
|
:actions="['confirm']"
|
||||||
<div class="grid md:grid-cols-4 md:gap-x-30">
|
/>
|
||||||
<n-form-item label="允许补交:"
|
</n-form-item>
|
||||||
path="allow">
|
</div>
|
||||||
<n-checkbox
|
<div style="display: flex">
|
||||||
v-model:checked="problemInfoValue.allow"
|
<!-- <n-form-item label="发放对象:" path="class">-->
|
||||||
@update="allow"
|
<!-- <n-button type="primary" size="small"-->
|
||||||
></n-checkbox>
|
<!-- @click="onAddClass=!onAddClass"-->
|
||||||
</n-form-item>
|
<!-- style="margin-left: 5px">-->
|
||||||
</div> <div flex>
|
<!-- 添加对象 </n-button>-->
|
||||||
<n-form-item style='margin-left: 30px'>
|
<!-- </n-form-item>-->
|
||||||
|
<n-form-item label="允许补交:"
|
||||||
|
path="allow">
|
||||||
|
<n-checkbox
|
||||||
|
v-model:checked="problemInfoValue.allow"
|
||||||
|
></n-checkbox>
|
||||||
|
</n-form-item>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div flex>
|
||||||
|
<n-form-item style="margin-left: 30px">
|
||||||
<n-button type="primary"
|
<n-button type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click="submit">确定
|
@click="updateSetup"
|
||||||
|
>确定
|
||||||
</n-button></n-form-item>
|
</n-button></n-form-item>
|
||||||
<n-form-item style='margin-left: 20px'>
|
<n-form-item style="margin-left: 10px">
|
||||||
<n-button type="primary"
|
<n-button type="primary"
|
||||||
size="small" @click="cancel">取消
|
size="small" @click="cancel" style='margin-left:
|
||||||
</n-button>
|
20px'>取消
|
||||||
</n-form-item></div>
|
</n-button></n-form-item>
|
||||||
|
</div>
|
||||||
</div></n-form>
|
<div flex>
|
||||||
|
</div>
|
||||||
|
<div class="grid md:grid-cols-2 md:gap-x-30">
|
||||||
|
<n-form-item>
|
||||||
|
<view-classes-post v-if='onAddClass'
|
||||||
|
@clickAdd="handleAdd"
|
||||||
|
></view-classes-post></n-form-item>
|
||||||
|
</div>
|
||||||
|
</n-form>
|
||||||
</div>
|
</div>
|
||||||
</CommonPage>
|
</CommonPage>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {useRouter} from "vue-router";
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import api from "@/api/admin";
|
import api from "@/api/admin";
|
||||||
import { useTagsStore } from '@/store'
|
import { useTagsStore } from '@/store'
|
||||||
import StandardsList
|
import ViewClassesPost
|
||||||
from '@/views/admin/problem/components/StandardList.vue'
|
from '@/views/admin/problem/components/view-classes-post.vue'
|
||||||
import RichTextEditor
|
|
||||||
from '@/components/common/RichTextEditor.vue'
|
|
||||||
const tagsStore = useTagsStore()
|
const tagsStore = useTagsStore()
|
||||||
const path=ref('')
|
const path=ref('')
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const rules=ref(null)
|
const rules=ref(null)
|
||||||
|
const route = useRoute()
|
||||||
|
const loading = ref(true)
|
||||||
|
const {problemId,classId, history } = route.query
|
||||||
const problemInfoValue = ref({
|
const problemInfoValue = ref({
|
||||||
name: '',
|
title: '',
|
||||||
timeFrom: [],
|
startTime: [],
|
||||||
timeTo: [],
|
endTime: [],
|
||||||
allow:true
|
allow:false
|
||||||
});
|
});
|
||||||
const problemInfoRef = ref(null)
|
const problemInfoRef = ref(null)
|
||||||
const descEditorHeight = ref('160px')
|
const descEditorHeight = ref('160px')
|
||||||
const problemName = ref('作业标题')
|
const problemName = ref('作业标题')
|
||||||
const cancel = ()=>{
|
const cancel = ()=>{
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
router.push({path: 'problem-list'})
|
// router.push({path: 'problem-list'})
|
||||||
|
}
|
||||||
|
const updateSetup =async ()=>{
|
||||||
|
try {
|
||||||
|
await api.updateSetup({
|
||||||
|
...problemInfoValue.value,
|
||||||
|
classId:classId,
|
||||||
|
problemId:problemId
|
||||||
|
})
|
||||||
|
$message.success("修改作业设置成功")
|
||||||
|
tagsStore.removeTag(path.value)
|
||||||
|
} catch (err) {
|
||||||
|
tagsStore.removeTag(path.value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const onAdd = ()=>{
|
const onAdd = ()=>{
|
||||||
router.push({name: 'AdminProblemPostClass'})
|
router.push({name: 'AdminProblemPostClass'})
|
||||||
|
|
@ -124,7 +147,21 @@ const submit =async ()=>{
|
||||||
$message.error("作业名称不能为空")
|
$message.error("作业名称不能为空")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const queryByPage = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res = await api.findPostProblem({
|
||||||
|
problemId:problemId,
|
||||||
|
classId:classId
|
||||||
|
})
|
||||||
|
problemInfoValue.value=res.data
|
||||||
|
} catch (err) {
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
path.value=router.currentRoute.value.fullPath
|
path.value=router.currentRoute.value.fullPath
|
||||||
|
queryByPage()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
:label-width="60" >
|
:label-width="60" >
|
||||||
<div style="display: flex;margin-top:
|
<div style="display: flex;margin-top:
|
||||||
25px">
|
25px">
|
||||||
<div v-if="userStore.getRole().length>0 && userStore.getRole().some((r)=>r==='admin')">
|
|
||||||
<div
|
<div
|
||||||
style="display: flex;align-items: flex-start">
|
style="display: flex;align-items: flex-start">
|
||||||
<n-form-item label="班级:"
|
<n-form-item label="班级:"
|
||||||
|
|
@ -44,7 +43,6 @@
|
||||||
已结束
|
已结束
|
||||||
</label></div>
|
</label></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</n-form>
|
</n-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -245,18 +243,19 @@ const onAssistantProblem = async (problemid)=>{
|
||||||
await router.push({name: 'AdminProblemAssistant', params: {clId: id}})
|
await router.push({name: 'AdminProblemAssistant', params: {clId: id}})
|
||||||
}
|
}
|
||||||
const onEditProblem = async (problemid)=>{
|
const onEditProblem = async (problemid)=>{
|
||||||
// const {id} = problemid
|
const {id} = problemid
|
||||||
const id=1
|
|
||||||
await router.push({name:
|
await router.push({name:
|
||||||
'AdminProblemEditSetup',
|
'AdminProblemEditSetup',
|
||||||
params: {clId: id}})
|
query:
|
||||||
|
{classId:ProblemInfoValue.value.classId,problemId:
|
||||||
|
id}})
|
||||||
}
|
}
|
||||||
const onReviewProblem = async (problemid)=>{
|
const onReviewProblem = async (problemid)=>{
|
||||||
// const {id} = problemid
|
const {id} = problemid
|
||||||
const id=1
|
|
||||||
await router.push({name:
|
await router.push({name:
|
||||||
'AdminProblemStudent',
|
'AdminProblemStudent',
|
||||||
params: {clId: id}})
|
query:
|
||||||
|
{classId:ProblemInfoValue.value.classId,problemId:id}})
|
||||||
}
|
}
|
||||||
// const search=async ()=>{
|
// const search=async ()=>{
|
||||||
// // ProblemInfoRef.value?.validate(async (errors) => {
|
// // ProblemInfoRef.value?.validate(async (errors) => {
|
||||||
|
|
@ -330,15 +329,9 @@ const onChangePage = (page) => {
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
queryByPage(paginationReactive.page)
|
queryByPage(paginationReactive.page)
|
||||||
})
|
})
|
||||||
watch(
|
// watch(route, () => {
|
||||||
()=>router.currentRoute.value.fullPath,
|
// filterData()
|
||||||
()=>{
|
// })
|
||||||
if
|
|
||||||
(router.currentRoute.value.fullPath==='/admin/problem/problem-list') {
|
|
||||||
queryByPage(paginationReactive.page)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<n-h3
|
<n-h3
|
||||||
class="show-problem-name">
|
class="show-problem-name">
|
||||||
{{ problemName }}
|
{{ problem.title }}
|
||||||
</n-h3>
|
</n-h3>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -28,25 +28,16 @@
|
||||||
<label>
|
<label>
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
value="yijiao"
|
value="yijiao"
|
||||||
v-model="selectedStatus" @change="updateColumns"/>
|
v-model="selectedStatus" @change="filterData"/>
|
||||||
已交
|
已交
|
||||||
</label><label>
|
</label><label>
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
value="weijiao"
|
value="weijiao"
|
||||||
v-model="selectedStatus" @change="updateColumns" />
|
v-model="selectedStatus" @change="filterData" />
|
||||||
未交
|
未交
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <n-form-item label="学校:" class="flex-item" style="margin-left: -30px">-->
|
|
||||||
<!-- <n-select-->
|
|
||||||
<!-- v-model:value="studentInfoValue.schoolId"-->
|
|
||||||
<!-- :options="options"-->
|
|
||||||
<!-- filterable-->
|
|
||||||
<!-- placeholder=""-->
|
|
||||||
<!-- style="min-width: 140px"></n-select>-->
|
|
||||||
<!-- </n-form-item>-->
|
|
||||||
<n-form-item label="学号:" path="name" class="flex-item">
|
<n-form-item label="学号:" path="name" class="flex-item">
|
||||||
<n-input v-model:value="studentInfoValue.studentNo"
|
<n-input v-model:value="studentInfoValue.studentNo"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
|
|
@ -55,11 +46,6 @@
|
||||||
<n-form-item label="姓名:" class="flex-item" style="margin-left: 0px">
|
<n-form-item label="姓名:" class="flex-item" style="margin-left: 0px">
|
||||||
<n-input v-model:value="studentInfoValue.chineseName" style="min-width: 80px" placeholder=""></n-input>
|
<n-input v-model:value="studentInfoValue.chineseName" style="min-width: 80px" placeholder=""></n-input>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<!-- <n-form-item label="用户名:" class="flex-item">-->
|
|
||||||
<!-- <n-input v-model:value="studentInfoValue.stu_userName"-->
|
|
||||||
<!-- placeholder=""-->
|
|
||||||
<!-- style="min-width: 80px; width: 140px;"></n-input>-->
|
|
||||||
<!-- </n-form-item>-->
|
|
||||||
<n-form-item style="margin-left: 10px">
|
<n-form-item style="margin-left: 10px">
|
||||||
<n-button type="primary" @click="search">自定义查询</n-button>
|
<n-button type="primary" @click="search">自定义查询</n-button>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
@ -67,8 +53,6 @@
|
||||||
style='justify-content: flex-end'>
|
style='justify-content: flex-end'>
|
||||||
<n-form-item
|
<n-form-item
|
||||||
v-if="selectedStatus==='weijiao'" style='margin-left: 10px;margin-right: 20px'>
|
v-if="selectedStatus==='weijiao'" style='margin-left: 10px;margin-right: 20px'>
|
||||||
<!-- <n-button type="primary"-->
|
|
||||||
<!-- style="margin-right: 10px" @click="addTime">加时</n-button>-->
|
|
||||||
<n-button type="primary" style="margin-right: 10px" @click="exportUnsubmitted">导出未交名单</n-button>
|
<n-button type="primary" style="margin-right: 10px" @click="exportUnsubmitted">导出未交名单</n-button>
|
||||||
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
@ -89,7 +73,7 @@
|
||||||
:single-line="false"
|
:single-line="false"
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="studentList"
|
:data="filteredData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="paginationReactive"
|
:pagination="paginationReactive"
|
||||||
:row-key="rowKey"
|
:row-key="rowKey"
|
||||||
|
|
@ -108,18 +92,26 @@ import api from "@/api/admin";
|
||||||
import ProblemStudentAction
|
import ProblemStudentAction
|
||||||
from '@/views/admin/problem/components/problem-student-action.vue'
|
from '@/views/admin/problem/components/problem-student-action.vue'
|
||||||
import {formatDateTime} from '@/utils';
|
import {formatDateTime} from '@/utils';
|
||||||
|
import ProblemStudentAction2
|
||||||
|
from '@/views/admin/problem/components/problem-student-action2.vue'
|
||||||
|
import { NDataTable } from 'naive-ui'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const rules=ref(null)
|
const rules=ref(null)
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const options=ref([])
|
const options=ref([])
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const problemName =
|
const problem =
|
||||||
ref('作业标题')
|
ref({
|
||||||
|
title:''
|
||||||
|
})
|
||||||
const selectedStatus=ref('yijiao')
|
const selectedStatus=ref('yijiao')
|
||||||
|
const filteredData =ref([])
|
||||||
|
const submitList =
|
||||||
|
ref([])
|
||||||
const studentList =
|
const studentList =
|
||||||
reactive([{studentNo:"211310509",chineseName:"张三",submitDate:"2025-02-11",readDate:"2025-02-11",status:"待批",status1:"已查看",score:"89"}])
|
reactive([])
|
||||||
const filteredStudentList=ref(studentList)
|
const filteredStudentList=ref(studentList)
|
||||||
const {clId} = route.params
|
const { classId,problemId, history } = route.query
|
||||||
const paginationReactive = reactive({
|
const paginationReactive = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 50,
|
pageSize: 50,
|
||||||
|
|
@ -129,7 +121,7 @@ const paginationReactive = reactive({
|
||||||
return `总共 ${itemCount} 条`
|
return `总共 ${itemCount} 条`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const columns=ref()
|
const columns=ref([])
|
||||||
const updateColumns=()=>{
|
const updateColumns=()=>{
|
||||||
if(selectedStatus.value==='weijiao'){
|
if(selectedStatus.value==='weijiao'){
|
||||||
columns.value = [
|
columns.value = [
|
||||||
|
|
@ -149,14 +141,10 @@ const updateColumns=()=>{
|
||||||
key: 'readTime',
|
key: 'readTime',
|
||||||
title: '领取时间',
|
title: '领取时间',
|
||||||
width: '100',
|
width: '100',
|
||||||
align:'center',
|
align:'center'
|
||||||
render: (row) => {
|
|
||||||
return
|
|
||||||
row["readTime"]=formatDateTime(row["readTime"]);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'status1',
|
key: 'submissionStatus',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
width: '300',
|
width: '300',
|
||||||
},
|
},
|
||||||
|
|
@ -194,20 +182,16 @@ const updateColumns=()=>{
|
||||||
key: 'submitTime',
|
key: 'submitTime',
|
||||||
title: '提交时间',
|
title: '提交时间',
|
||||||
width: '160',
|
width: '160',
|
||||||
align:'center',
|
align:'center'
|
||||||
render: (row) => {
|
|
||||||
return
|
|
||||||
row["submitTime"]=formatDateTime(row["submitTime"]);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'status',
|
key: 'submissionStatus',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
width: '150',
|
width: '150',
|
||||||
align:'center',
|
align:'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'score',
|
key: 'finalScore',
|
||||||
title: '成绩',
|
title: '成绩',
|
||||||
width: '170',
|
width: '170',
|
||||||
align:'center',
|
align:'center',
|
||||||
|
|
@ -228,85 +212,54 @@ const updateColumns=()=>{
|
||||||
}]
|
}]
|
||||||
|
|
||||||
}
|
}
|
||||||
filterData(); // 更新过滤数据
|
// filterData(); // 更新过滤数据
|
||||||
}
|
}
|
||||||
// 根据 selectedStatus 过滤数据
|
// 根据 selectedStatus 过滤数据
|
||||||
const filterData = () => {
|
|
||||||
if (selectedStatus.value) {
|
|
||||||
filteredStudentList.value = studentList.filter(item =>
|
|
||||||
item.status === selectedStatus.value);
|
|
||||||
} else {
|
|
||||||
filteredStudentList.value = studentList; // 显示所有数据
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const studentInfoValue = ref({
|
const studentInfoValue = ref({
|
||||||
userId:'',
|
studentId:'',
|
||||||
studentNo:'',
|
studentNo:'',
|
||||||
chineseName:'',
|
chineseName:'',
|
||||||
stu_userName:'',
|
readTime:[],
|
||||||
schoolId:0,
|
submitTime:[],
|
||||||
|
submissionStatus:'',
|
||||||
|
score:0,
|
||||||
pageNum:paginationReactive.page,
|
pageNum:paginationReactive.page,
|
||||||
pageSize:paginationReactive.pageSize
|
pageSize:paginationReactive.pageSize
|
||||||
});
|
});
|
||||||
|
const filterData =() => {
|
||||||
|
queryByPage(paginationReactive.page)
|
||||||
|
updateColumns()
|
||||||
|
}
|
||||||
const queryByPage = async (currentPage)=>{
|
const queryByPage = async (currentPage)=>{
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
|
studentInfoValue.value.pageNum=currentPage
|
||||||
|
studentInfoValue.value.pageSize=paginationReactive.pageSize
|
||||||
try {
|
try {
|
||||||
const res1=await api.findAllShoolsInAdminusers()
|
const res1=await
|
||||||
const list1=res1.data
|
api.findProblemById({id:problemId});
|
||||||
const transformedDatas=list1.map(item => ({
|
problem.value=res1.data
|
||||||
label: item.name,
|
const res = await
|
||||||
value: item.id,
|
api.findStudentSubmit(
|
||||||
}));
|
{
|
||||||
transformedDatas.unshift({
|
...studentInfoValue.value,
|
||||||
label: '全部',
|
classId:classId,
|
||||||
value: 0,
|
problemId:problemId,
|
||||||
});
|
selectedStatus:selectedStatus.value
|
||||||
options.value=transformedDatas;
|
|
||||||
studentInfoValue.value.pageNum=currentPage
|
|
||||||
studentInfoValue.value.pageSize=paginationReactive.pageSize
|
|
||||||
const res = await api.findStudentsByCondition({
|
|
||||||
pageNum: paginationReactive.page,
|
|
||||||
pageSize:paginationReactive.pageSize,
|
|
||||||
studentNo:studentInfoValue.value.studentNo,
|
|
||||||
chineseName:studentInfoValue.value.chineseName,
|
|
||||||
stu_userName:studentInfoValue.value.stu_userName,
|
|
||||||
schoolId:studentInfoValue.value.schoolId
|
|
||||||
})
|
|
||||||
if (res.message==='获取学生信息为空'){
|
|
||||||
studentList.value=[]
|
|
||||||
paginationReactive.page = 1
|
|
||||||
paginationReactive.pageSize = 10
|
|
||||||
paginationReactive.itemCount = 0
|
|
||||||
$message.success('获取学生信息为空')
|
|
||||||
}else {
|
|
||||||
const {pageNum, pageSize, total, list} = res.data
|
|
||||||
paginationReactive.page = pageNum
|
|
||||||
paginationReactive.pageSize = pageSize
|
|
||||||
paginationReactive.itemCount = total
|
|
||||||
const count=(paginationReactive.page-1)*paginationReactive.pageSize
|
|
||||||
studentList.value = list.map((item,i)=>{
|
|
||||||
if (item.username===''||item.username===null){
|
|
||||||
item.username='请学生注册'
|
|
||||||
}
|
}
|
||||||
return {
|
);
|
||||||
...item,
|
const {pageNum, pageSize, total, list} = res.data
|
||||||
stId: count + i + 1,
|
paginationReactive.page = pageNum
|
||||||
};
|
paginationReactive.pageSize = pageSize
|
||||||
})
|
paginationReactive.itemCount = total
|
||||||
}
|
studentList.value =
|
||||||
|
list.map((item,i)=>{return item;})
|
||||||
|
filteredData.value=studentList.value
|
||||||
|
// console.log(res.data)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
}finally{
|
} finally {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const selectYijiao=()=>{
|
|
||||||
selectedStatus.value='yijiao'
|
|
||||||
console.log(selectedStatus.value)
|
|
||||||
}
|
|
||||||
const selectWeijiao=()=>{
|
|
||||||
selectedStatus.value='weijiao'
|
|
||||||
console.log(selectedStatus.value)
|
|
||||||
}
|
|
||||||
const onPasswordClass = async (classId)=>{
|
const onPasswordClass = async (classId)=>{
|
||||||
// const {id} = classId
|
// const {id} = classId
|
||||||
const id=1
|
const id=1
|
||||||
|
|
@ -342,7 +295,7 @@ const onDeleteClass = async (classId)=>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const search=async ()=>{
|
const search=async ()=>{
|
||||||
queryByPage(1)
|
await queryByPage(paginationReactive.page)
|
||||||
}
|
}
|
||||||
const handleSearchSchool = async (query) => {
|
const handleSearchSchool = async (query) => {
|
||||||
const res = await api.getSchoolByschoolName({
|
const res = await api.getSchoolByschoolName({
|
||||||
|
|
@ -370,16 +323,11 @@ const rowKey = (rowData) => {
|
||||||
}
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
queryByPage(paginationReactive.page)
|
queryByPage(paginationReactive.page)
|
||||||
updateColumns();
|
updateColumns()
|
||||||
|
})
|
||||||
|
watch(route, () => {
|
||||||
|
filterData()
|
||||||
})
|
})
|
||||||
watch(
|
|
||||||
()=>router.currentRoute.value.fullPath,
|
|
||||||
()=>{
|
|
||||||
if (router.currentRoute.value.fullPath==='/admin/student/student-list') {
|
|
||||||
queryByPage(paginationReactive.page)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.two-line-description {
|
.two-line-description {
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,14 @@ import com.example.aes.global.model.DecodeToken;
|
||||||
import com.example.aes.global.model.RespBean;
|
import com.example.aes.global.model.RespBean;
|
||||||
import com.example.aes.problem.model.*;
|
import com.example.aes.problem.model.*;
|
||||||
import com.example.aes.problem.service.ProblemServiceI;
|
import com.example.aes.problem.service.ProblemServiceI;
|
||||||
import com.example.aes.user.model.*;
|
import com.example.aes.user.model.Classstudents;
|
||||||
import com.example.aes.user.service.ClassesServiceI;
|
import com.example.aes.user.service.ClassesServiceI;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.example.aes.user.model.DataGrid;
|
import com.example.aes.user.model.DataGrid;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.swing.event.ListDataEvent;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -170,6 +168,26 @@ public class ProblemController {
|
||||||
return RespBean.ok("查询作业标题成功",
|
return RespBean.ok("查询作业标题成功",
|
||||||
problems.get(0));
|
problems.get(0));
|
||||||
|
|
||||||
|
}
|
||||||
|
@PostMapping("/findPostProblem")
|
||||||
|
public RespBean findPostProblem(@RequestBody PMPostProblem pmPostProblem){
|
||||||
|
List<PostProblem> postProblems=problemServiceI.findPostProblem(pmPostProblem.getProblemId(),pmPostProblem.getClassId());
|
||||||
|
List<PMPostProblem>pmPostProblems=
|
||||||
|
new ArrayList<>();
|
||||||
|
for(PostProblem postProblem:postProblems){
|
||||||
|
PMPostProblem pmPostProblem1=
|
||||||
|
new PMPostProblem();
|
||||||
|
if(postProblem.getAllow()==0)
|
||||||
|
pmPostProblem1.setAllow(false);
|
||||||
|
else pmPostProblem1.setAllow(true);
|
||||||
|
pmPostProblem1.setStartTime(postProblem.getStartTime());
|
||||||
|
pmPostProblem1.setEndTime(postProblem.getEndTime());
|
||||||
|
pmPostProblems.add(pmPostProblem1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return RespBean.ok("查询作业标题成功",
|
||||||
|
pmPostProblems.get(0));
|
||||||
|
|
||||||
}
|
}
|
||||||
@PostMapping("/postProblem")
|
@PostMapping("/postProblem")
|
||||||
public RespBean postProblem(@RequestBody PMPostProblem pmPostProblem){
|
public RespBean postProblem(@RequestBody PMPostProblem pmPostProblem){
|
||||||
|
|
@ -181,6 +199,15 @@ public class ProblemController {
|
||||||
return RespBean.ok("发布作业成功");
|
return RespBean.ok("发布作业成功");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@PostMapping("/updateSetup")
|
||||||
|
public RespBean updateSetup(@RequestBody PMPostProblem pmPostProblem){
|
||||||
|
int num =
|
||||||
|
problemServiceI.editPostProblem(pmPostProblem.getClassId(),pmPostProblem.getProblemId(),pmPostProblem.getStartTime(),pmPostProblem.getEndTime(),pmPostProblem.getAllow());
|
||||||
|
if(num == 1)
|
||||||
|
return RespBean.ok("修改课程名称成功");
|
||||||
|
else
|
||||||
|
return RespBean.error("修改课程名称失败");
|
||||||
|
}
|
||||||
//获取作业列表
|
//获取作业列表
|
||||||
@GetMapping("/getExamList")
|
@GetMapping("/getExamList")
|
||||||
public RespBean getExamList(Integer pageNum,Integer pageSize, HttpServletRequest request) {
|
public RespBean getExamList(Integer pageNum,Integer pageSize, HttpServletRequest request) {
|
||||||
|
|
@ -210,6 +237,16 @@ public class ProblemController {
|
||||||
return RespBean.error("获取作业列表失败!");
|
return RespBean.error("获取作业列表失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@PostMapping("findStudentSubmit")
|
||||||
|
public RespBean findStudentSubmit(@RequestBody PMStudentSubmit pmStudentSubmit){
|
||||||
|
DataGrid dataGrid;
|
||||||
|
if(pmStudentSubmit.getSelectedStatus().equals("weijiao"))
|
||||||
|
dataGrid=
|
||||||
|
problemServiceI.findWeijiaoList(pmStudentSubmit);
|
||||||
|
else dataGrid=
|
||||||
|
problemServiceI.findYijiaoList(pmStudentSubmit);
|
||||||
|
return RespBean.ok("获取学生提交报告列表成功!",
|
||||||
|
dataGrid);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,15 @@ import com.example.aes.problem.model.PMPostProblem;
|
||||||
import com.example.aes.problem.model.PostProblem;
|
import com.example.aes.problem.model.PostProblem;
|
||||||
import com.example.aes.user.dao.BaseDaoI;
|
import com.example.aes.user.dao.BaseDaoI;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface PostProblemDaoI extends BaseDaoI<PostProblem> {
|
public interface PostProblemDaoI extends BaseDaoI<PostProblem> {
|
||||||
public void postProblem(PMPostProblem pmPostProblem, Integer classId);
|
public void postProblem(PMPostProblem pmPostProblem, Integer classId);
|
||||||
public long getPostProblemNum(int courseId,
|
public long getPostProblemNum(int courseId,
|
||||||
int classId);
|
int classId);
|
||||||
|
public List<PostProblem> findPostProblem(int problemId,
|
||||||
|
int classId);
|
||||||
|
public int editPostProblem(int classId,
|
||||||
|
int problemId,LocalDateTime startTime, LocalDateTime endTime,int allow);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,11 @@ package com.example.aes.problem.dao;
|
||||||
|
|
||||||
|
|
||||||
import com.example.aes.problem.model.PMProblem;
|
import com.example.aes.problem.model.PMProblem;
|
||||||
import com.example.aes.problem.model.PMScoringRubric;
|
|
||||||
import com.example.aes.problem.model.Problem;
|
import com.example.aes.problem.model.Problem;
|
||||||
import com.example.aes.user.dao.BaseDaoI;
|
import com.example.aes.user.dao.BaseDaoI;
|
||||||
import com.example.aes.user.model.Classstudents;
|
|
||||||
import com.example.aes.user.model.Course;
|
|
||||||
import com.example.aes.user.model.DataGrid;
|
|
||||||
import com.example.aes.user.model.PMCourse;
|
|
||||||
|
|
||||||
|
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
|
|
||||||
public interface ProblemDaoI extends BaseDaoI<Problem> {
|
public interface ProblemDaoI extends BaseDaoI<Problem> {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.example.aes.problem.dao;
|
||||||
|
|
||||||
|
import com.example.aes.problem.model.PMStudentSubmit;
|
||||||
|
import com.example.aes.problem.model.SubmitReport;
|
||||||
|
import com.example.aes.user.dao.BaseDaoI;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface SubmitReportDaoI extends BaseDaoI<SubmitReport> {
|
||||||
|
public List<Object[]> findWeijiaoList(PMStudentSubmit pmStudentSubmit);
|
||||||
|
public List<Object[]> findYijiaoList(PMStudentSubmit pmStudentSubmit);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -4,8 +4,13 @@ import com.example.aes.problem.dao.PostProblemDaoI;
|
||||||
import com.example.aes.problem.model.PMPostProblem;
|
import com.example.aes.problem.model.PMPostProblem;
|
||||||
import com.example.aes.problem.model.PostProblem;
|
import com.example.aes.problem.model.PostProblem;
|
||||||
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Repository("PostProblemDao")
|
@Repository("PostProblemDao")
|
||||||
public class PostProblemDaoImpl extends BaseDaoImpl<PostProblem> implements PostProblemDaoI {
|
public class PostProblemDaoImpl extends BaseDaoImpl<PostProblem> implements PostProblemDaoI {
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -29,4 +34,30 @@ public class PostProblemDaoImpl extends BaseDaoImpl<PostProblem> implements Post
|
||||||
long count=this.count(hql);
|
long count=this.count(hql);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public List<PostProblem> findPostProblem(int problemId,
|
||||||
|
int classId){
|
||||||
|
String hql=
|
||||||
|
"from PostProblem where " +
|
||||||
|
"problemId="+problemId+
|
||||||
|
" and classId="+classId;
|
||||||
|
return this.find(hql);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int editPostProblem(int classId,
|
||||||
|
int problemId,LocalDateTime startTime, LocalDateTime endTime, int allow){
|
||||||
|
// 构建参数化更新语句
|
||||||
|
String hql= "UPDATE PostProblem p SET p" +
|
||||||
|
".startTime = :startTime, p.endTime = :endTime, p.allow = :allow "
|
||||||
|
+ "WHERE p.classId = :classId AND p.problemId = :problemId";
|
||||||
|
Query q = this.getCurrentSession().createQuery(hql);
|
||||||
|
q.setParameter("startTime",startTime);
|
||||||
|
q.setParameter("endTime",endTime);
|
||||||
|
q.setParameter("allow",allow);
|
||||||
|
q.setParameter("classId",classId);
|
||||||
|
q.setParameter("problemId",problemId);
|
||||||
|
int num = q.executeUpdate();
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,16 @@
|
||||||
package com.example.aes.problem.dao.impl;
|
package com.example.aes.problem.dao.impl;
|
||||||
|
|
||||||
import cn.hutool.poi.excel.cell.CellSetter;
|
|
||||||
import com.example.aes.problem.dao.ProblemDaoI;
|
import com.example.aes.problem.dao.ProblemDaoI;
|
||||||
import com.example.aes.problem.model.PMProblem;
|
import com.example.aes.problem.model.PMProblem;
|
||||||
import com.example.aes.problem.model.PMScoringRubric;
|
|
||||||
import com.example.aes.problem.model.Problem;
|
import com.example.aes.problem.model.Problem;
|
||||||
import com.example.aes.user.dao.BaseDaoI;
|
|
||||||
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
||||||
import com.example.aes.user.model.Classstudents;
|
|
||||||
import com.example.aes.user.model.Course;
|
|
||||||
import com.example.aes.user.model.PMCourse;
|
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.security.core.parameters.P;
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
@Repository("ProblemDao")
|
@Repository("ProblemDao")
|
||||||
public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
|
|
@ -139,25 +131,12 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
public List<Object[]> getProblemsByPage(Integer courseId, Integer classId,String selectedStatus,
|
public List<Object[]> getProblemsByPage(Integer courseId, Integer classId,String selectedStatus,
|
||||||
int page,
|
int page,
|
||||||
int rows){
|
int rows){
|
||||||
String hql=new String();
|
String hql;
|
||||||
if(selectedStatus.equals("")){
|
if (selectedStatus.equals("not_started")) {
|
||||||
hql = "SELECT p.id as id, p.title as title, pp.startTime as startTime, pp.endTime as endTime," +
|
|
||||||
"COUNT(CASE WHEN sr.score IS NULL AND sr.autoscore IS NOT NULL THEN 1 END) AS daipi," +
|
|
||||||
"COUNT(CASE WHEN sr.submissionTime IS NOT NULL THEN 1 END) AS yijiao, " +
|
|
||||||
"COUNT(CASE WHEN sr.submissionTime IS NULL THEN 1 END) AS weijiao " +
|
|
||||||
"FROM Problem p " +
|
|
||||||
"INNER JOIN PostProblem pp ON p.id = pp.problemId " +
|
|
||||||
"LEFT JOIN SubmitReport sr ON " +
|
|
||||||
"p.id = sr.problemId " +
|
|
||||||
"WHERE pp.classId =:classId "+
|
|
||||||
"AND p.courseId =:courseId "+
|
|
||||||
"GROUP BY p.id, p.title, pp" +
|
|
||||||
".startTime, pp.endTime";}
|
|
||||||
else if (selectedStatus.equals("not_started")) {
|
|
||||||
hql = "SELECT p.id as id, p.title as title, pp.startTime as startTime, pp.endTime as endTime, " +
|
hql = "SELECT p.id as id, p.title as title, pp.startTime as startTime, pp.endTime as endTime, " +
|
||||||
"COUNT(CASE WHEN sr.score IS NULL AND sr.autoscore IS NOT NULL THEN 1 END) AS daipi, " +
|
"COUNT(CASE WHEN sr.score IS NULL AND sr.autoscore IS NOT NULL THEN 1 END) AS daipi, " +
|
||||||
"COUNT(CASE WHEN sr.submissionTime IS NOT NULL THEN 1 END) AS yijiao, " +
|
"COUNT(CASE WHEN sr.submissionTime IS NOT NULL THEN 1 END) AS yijiao " +
|
||||||
"COUNT(CASE WHEN sr.submissionTime IS NULL THEN 1 END) AS weijiao " +
|
// "COUNT(CASE WHEN sr.submissionTime IS NULL THEN 1 END) AS weijiao " +
|
||||||
"FROM Problem p " +
|
"FROM Problem p " +
|
||||||
"INNER JOIN PostProblem pp ON p.id = pp.problemId " +
|
"INNER JOIN PostProblem pp ON p.id = pp.problemId " +
|
||||||
"LEFT JOIN SubmitReport sr ON " +
|
"LEFT JOIN SubmitReport sr ON " +
|
||||||
|
|
@ -171,8 +150,8 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
} else if (selectedStatus.equals("in_progress")) {
|
} else if (selectedStatus.equals("in_progress")) {
|
||||||
hql = "SELECT p.id as id, p.title as title, pp.startTime as startTime, pp.endTime as endTime, " +
|
hql = "SELECT p.id as id, p.title as title, pp.startTime as startTime, pp.endTime as endTime, " +
|
||||||
"COUNT(CASE WHEN sr.score IS NULL AND sr.autoscore IS NOT NULL THEN 1 END) AS daipi, " +
|
"COUNT(CASE WHEN sr.score IS NULL AND sr.autoscore IS NOT NULL THEN 1 END) AS daipi, " +
|
||||||
"COUNT(CASE WHEN sr.submissionTime IS NOT NULL THEN 1 END) AS yijiao, " +
|
"COUNT(CASE WHEN sr.submissionTime IS NOT NULL THEN 1 END) AS yijiao " +
|
||||||
"COUNT(CASE WHEN sr.submissionTime IS NULL THEN 1 END) AS weijiao " +
|
// "COUNT(CASE WHEN sr.submissionTime IS NULL THEN 1 END) AS weijiao " +
|
||||||
"FROM Problem p " +
|
"FROM Problem p " +
|
||||||
"INNER JOIN PostProblem pp ON p.id = pp.problemId " +
|
"INNER JOIN PostProblem pp ON p.id = pp.problemId " +
|
||||||
"LEFT JOIN SubmitReport sr ON " +
|
"LEFT JOIN SubmitReport sr ON " +
|
||||||
|
|
@ -183,11 +162,11 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
"and NOW()<=pp.endTime " +
|
"and NOW()<=pp.endTime " +
|
||||||
"GROUP BY p.id, p.title, pp" +
|
"GROUP BY p.id, p.title, pp" +
|
||||||
".startTime, pp.endTime";
|
".startTime, pp.endTime";
|
||||||
}else{
|
}else if(selectedStatus.equals("completed")){
|
||||||
hql = "SELECT p.id as id, p.title as title, pp.startTime as startTime, pp.endTime as endTime, " +
|
hql = "SELECT p.id as id, p.title as title, pp.startTime as startTime, pp.endTime as endTime, " +
|
||||||
"COUNT(CASE WHEN sr.score IS NULL AND sr.autoscore IS NOT NULL THEN 1 END) AS daipi, " +
|
"COUNT(CASE WHEN sr.score IS NULL AND sr.autoscore IS NOT NULL THEN 1 END) AS daipi, " +
|
||||||
"COUNT(CASE WHEN sr.submissionTime IS NOT NULL THEN 1 END) AS yijiao, " +
|
"COUNT(CASE WHEN sr.submissionTime IS NOT NULL THEN 1 END) AS yijiao " +
|
||||||
"COUNT(CASE WHEN sr.submissionTime IS NULL THEN 1 END) AS weijiao " +
|
// "COUNT(CASE WHEN sr.submissionTime IS NULL THEN 1 END) AS weijiao " +
|
||||||
"FROM Problem p " +
|
"FROM Problem p " +
|
||||||
"INNER JOIN PostProblem pp ON p.id = pp.problemId " +
|
"INNER JOIN PostProblem pp ON p.id = pp.problemId " +
|
||||||
"LEFT JOIN SubmitReport sr ON " +
|
"LEFT JOIN SubmitReport sr ON " +
|
||||||
|
|
@ -197,9 +176,21 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
"AND NOW() > endTime " +
|
"AND NOW() > endTime " +
|
||||||
"GROUP BY p.id, p.title, pp" +
|
"GROUP BY p.id, p.title, pp" +
|
||||||
".startTime, pp.endTime";
|
".startTime, pp.endTime";
|
||||||
}
|
}else{
|
||||||
Session session =this.getCurrentSession();
|
hql = "SELECT p.id as id, p.title as title, pp.startTime as startTime, pp.endTime as endTime," +
|
||||||
Query<Object[]> query = session.createQuery(hql, Object[].class);
|
"COUNT(CASE WHEN sr.score IS NULL AND sr.autoscore IS NOT NULL THEN 1 END) AS daipi," +
|
||||||
|
"COUNT(CASE WHEN sr" +
|
||||||
|
".submissionTime IS NOT NULL THEN 1 END) AS yijiao " +
|
||||||
|
"FROM Problem p " +
|
||||||
|
"INNER JOIN PostProblem pp ON p.id = pp.problemId " +
|
||||||
|
"LEFT JOIN SubmitReport sr ON " +
|
||||||
|
"p.id = sr.problemId " +
|
||||||
|
"WHERE pp.classId =:classId "+
|
||||||
|
"AND p.courseId =:courseId "+
|
||||||
|
"GROUP BY p.id, p.title, pp" +
|
||||||
|
".startTime, pp.endTime";}
|
||||||
|
Query<Object[]> query =
|
||||||
|
this.getCurrentSession().createQuery(hql,Object[].class);
|
||||||
query.setParameter("classId", classId);
|
query.setParameter("classId", classId);
|
||||||
query.setParameter("courseId", courseId);
|
query.setParameter("courseId", courseId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.example.aes.problem.dao.impl;
|
||||||
|
|
||||||
|
import com.example.aes.problem.dao.SubmitReportDaoI;
|
||||||
|
import com.example.aes.problem.model.PMStudentSubmit;
|
||||||
|
import com.example.aes.problem.model.SubmitReport;
|
||||||
|
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
||||||
|
import org.hibernate.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository("SubmitReportDao")
|
||||||
|
public class SubmitReportDaoImpl extends BaseDaoImpl<SubmitReport> implements SubmitReportDaoI {
|
||||||
|
@Override
|
||||||
|
public List<Object[]> findWeijiaoList(PMStudentSubmit pmStudentSubmit){
|
||||||
|
int classId= pmStudentSubmit.getClassId();
|
||||||
|
int problemId= pmStudentSubmit.getProblemId();
|
||||||
|
String studentNo=
|
||||||
|
'%'+pmStudentSubmit.getStudentNo()+'%';
|
||||||
|
String chineseName=
|
||||||
|
'%'+pmStudentSubmit.getChineseName()+'%';
|
||||||
|
String hql="SELECT u.chineseName," +
|
||||||
|
"u.studentNo, sr" +
|
||||||
|
".readTime," +
|
||||||
|
"sr.submissionStatus " +
|
||||||
|
"FROM Classstudents cs left " +
|
||||||
|
"join Users u on cs" +
|
||||||
|
".userId=u.id "+
|
||||||
|
"left join PostProblem pp on cs" +
|
||||||
|
".classId=pp.classId "+
|
||||||
|
"left JOIN"+
|
||||||
|
" SubmitReport sr ON " +
|
||||||
|
"sr" +
|
||||||
|
".studentId=u.id"+
|
||||||
|
" WHERE cs.classId=:classId " +
|
||||||
|
"and " +
|
||||||
|
"pp.problemId " +
|
||||||
|
"=:problemId" +
|
||||||
|
" and sr" +
|
||||||
|
".submissionTime is null and " +
|
||||||
|
"u.studentNo like :studentNo " +
|
||||||
|
"and u" +
|
||||||
|
".chineseName like :chineseName";
|
||||||
|
Query<Object[]> query =
|
||||||
|
this.getCurrentSession().createQuery(hql,Object[].class);
|
||||||
|
query.setParameter("classId", classId);
|
||||||
|
query.setParameter("problemId", problemId);
|
||||||
|
query.setParameter("studentNo",studentNo);
|
||||||
|
query.setParameter("chineseName",
|
||||||
|
chineseName);
|
||||||
|
int page= pmStudentSubmit.getPageNum();
|
||||||
|
int rows= pmStudentSubmit.getPageSize();
|
||||||
|
// 设置分页
|
||||||
|
query.setFirstResult((page - 1) * rows); // 计算起始行
|
||||||
|
query.setMaxResults(rows); // 设置每页行数
|
||||||
|
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public List<Object[]> findYijiaoList(PMStudentSubmit pmStudentSubmit){
|
||||||
|
int classId= pmStudentSubmit.getClassId();
|
||||||
|
int problemId= pmStudentSubmit.getProblemId();
|
||||||
|
String studentNo=
|
||||||
|
'%'+pmStudentSubmit.getStudentNo()+'%';
|
||||||
|
String chineseName=
|
||||||
|
'%'+pmStudentSubmit.getChineseName()+'%';
|
||||||
|
String hql="SELECT u.chineseName," +
|
||||||
|
"u.studentNo, sr" +
|
||||||
|
".submissionTime," +
|
||||||
|
"sr.submissionStatus," +
|
||||||
|
" COALESCE(sr.score," +
|
||||||
|
" sr.autoscore) " +
|
||||||
|
"AS finalScore " +
|
||||||
|
"FROM Classstudents cs left " +
|
||||||
|
"join Users u on cs" +
|
||||||
|
".userId=u.id "+
|
||||||
|
"left join PostProblem pp on cs" +
|
||||||
|
".classId=pp.classId "+
|
||||||
|
"left JOIN"+
|
||||||
|
" SubmitReport sr ON " +
|
||||||
|
"sr" +
|
||||||
|
".studentId=u.id"+
|
||||||
|
" WHERE cs.classId=:classId " +
|
||||||
|
"and " +
|
||||||
|
"pp.problemId " +
|
||||||
|
"=:problemId" +
|
||||||
|
" and sr" +
|
||||||
|
".submissionTime is not null " +
|
||||||
|
"and " +
|
||||||
|
"u.studentNo like :studentNo " +
|
||||||
|
"and u" +
|
||||||
|
".chineseName like :chineseName";
|
||||||
|
Query<Object[]> query =
|
||||||
|
this.getCurrentSession().createQuery(hql,Object[].class);
|
||||||
|
query.setParameter("classId", classId);
|
||||||
|
query.setParameter("problemId", problemId);
|
||||||
|
query.setParameter("studentNo",studentNo);
|
||||||
|
query.setParameter("chineseName",
|
||||||
|
chineseName);
|
||||||
|
int page= pmStudentSubmit.getPageNum();
|
||||||
|
int rows= pmStudentSubmit.getPageSize();
|
||||||
|
// 设置分页
|
||||||
|
query.setFirstResult((page - 1) * rows); // 计算起始行
|
||||||
|
query.setMaxResults(rows); // 设置每页行数
|
||||||
|
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -11,6 +11,8 @@ import java.util.List;
|
||||||
public class PMPostProblem{
|
public class PMPostProblem{
|
||||||
private int id;
|
private int id;
|
||||||
private int adminuserId;
|
private int adminuserId;
|
||||||
|
private int problemId;
|
||||||
|
private int classId;
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime startTime;
|
private LocalDateTime startTime;
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.example.aes.problem.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PMStudentSubmit {
|
||||||
|
private String chineseName;
|
||||||
|
private String studentNo;
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime readTime;
|
||||||
|
private String submissionStatus;
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime submitTime;
|
||||||
|
private int problemId;
|
||||||
|
private int classId;
|
||||||
|
private int studentId;
|
||||||
|
private String selectedStatus;
|
||||||
|
private int pageNum;
|
||||||
|
private int pageSize;
|
||||||
|
private float finalScore;
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import com.example.aes.problem.dao.*;
|
||||||
import com.example.aes.problem.model.*;
|
import com.example.aes.problem.model.*;
|
||||||
import com.example.aes.problem.service.ProblemServiceI;
|
import com.example.aes.problem.service.ProblemServiceI;
|
||||||
import com.example.aes.user.dao.AdminusersDaoI;
|
import com.example.aes.user.dao.AdminusersDaoI;
|
||||||
|
import com.example.aes.user.dao.ClassesDaoI;
|
||||||
import com.example.aes.user.model.DataGrid;
|
import com.example.aes.user.model.DataGrid;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -17,8 +18,14 @@ public class ProblemServiceImpl implements ProblemServiceI {
|
||||||
private ProblemDaoI problemDao;
|
private ProblemDaoI problemDao;
|
||||||
private ScoringRubricDaoI scoringRubricDao;
|
private ScoringRubricDaoI scoringRubricDao;
|
||||||
private ScoringStandardDaoI scoringStandardDao;
|
private ScoringStandardDaoI scoringStandardDao;
|
||||||
|
private SubmitReportDaoI studentSubmitDao;
|
||||||
private AdminusersDaoI adminusersDao;
|
private AdminusersDaoI adminusersDao;
|
||||||
private PostProblemDaoI postProblemDao;
|
private PostProblemDaoI postProblemDao;
|
||||||
|
private ClassesDaoI classesDao;
|
||||||
|
@Autowired
|
||||||
|
public void setClassesDao(ClassesDaoI classesDao) {
|
||||||
|
this.classesDao = classesDao;
|
||||||
|
}
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setPostProblemDao(PostProblemDaoI postProblemDao) {
|
public void setPostProblemDao(PostProblemDaoI postProblemDao) {
|
||||||
this.postProblemDao = postProblemDao;
|
this.postProblemDao = postProblemDao;
|
||||||
|
|
@ -70,12 +77,10 @@ public class ProblemServiceImpl implements ProblemServiceI {
|
||||||
return uScoringRubricList;
|
return uScoringRubricList;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
}
|
||||||
@Override
|
@Override
|
||||||
public List<ScoringStandard> findStandardIdNoProblemId(){
|
public List<ScoringStandard> findStandardIdNoProblemId(){
|
||||||
List<ScoringStandard> scoringStandardList=scoringStandardDao.getStandardIdNoProblemIdDesc();
|
return scoringStandardDao.getStandardIdNoProblemIdDesc();
|
||||||
|
|
||||||
return scoringStandardList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -211,18 +216,21 @@ changeModel2(pmProblems,theProblemList);
|
||||||
List<Object[]> theProblemList;
|
List<Object[]> theProblemList;
|
||||||
totalLines= (int) postProblemDao.getPostProblemNum(pmProblem.getCourseId(),pmProblem.getClassId());
|
totalLines= (int) postProblemDao.getPostProblemNum(pmProblem.getCourseId(),pmProblem.getClassId());
|
||||||
int page= pmProblem.getPageNum();
|
int page= pmProblem.getPageNum();
|
||||||
|
|
||||||
|
int studentNum=
|
||||||
|
classesDao.findClassById(pmProblem.getClassId()).get(0).getStudentNum();
|
||||||
|
theProblemList=
|
||||||
|
problemDao.getProblemsByPage(pmProblem.getCourseId(),pmProblem.getClassId(),pmProblem.getSelectedStatus(),pmProblem.getPageNum(), pmProblem.getPageSize());
|
||||||
|
// totalLines=theProblemList.size();
|
||||||
if ((page-1)*pmProblem.getPageSize()>=totalLines){
|
if ((page-1)*pmProblem.getPageSize()>=totalLines){
|
||||||
pmProblem.setPageNum(1);
|
pmProblem.setPageNum(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
theProblemList=
|
|
||||||
problemDao.getProblemsByPage(pmProblem.getCourseId(),pmProblem.getClassId(),pmProblem.getSelectedStatus(),pmProblem.getPageNum(), pmProblem.getPageSize());
|
|
||||||
if (theProblemList== null) {
|
if (theProblemList== null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
List<PMProblem> pmProblems=new ArrayList<>();
|
List<PMProblem> pmProblems=new ArrayList<>();
|
||||||
changeModel3(pmProblems,
|
changeModel3(pmProblems,
|
||||||
theProblemList);
|
theProblemList,studentNum);
|
||||||
dg.setTotal(totalLines);
|
dg.setTotal(totalLines);
|
||||||
dg.setPageSize(pmProblem.getPageSize());
|
dg.setPageSize(pmProblem.getPageSize());
|
||||||
dg.setTotalPages((long) (Math.ceil((double) dg.getTotal() / (double) dg.getPageSize())));
|
dg.setTotalPages((long) (Math.ceil((double) dg.getTotal() / (double) dg.getPageSize())));
|
||||||
|
|
@ -242,6 +250,98 @@ changeModel2(pmProblems,theProblemList);
|
||||||
return problems;
|
return problems;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public List<PostProblem> findPostProblem(int problemId,int classId){
|
||||||
|
List<PostProblem> postProblems=
|
||||||
|
postProblemDao.findPostProblem(problemId,classId);
|
||||||
|
return postProblems;
|
||||||
|
}
|
||||||
|
@Autowired
|
||||||
|
public void setStudentSubmitDao(SubmitReportDaoI studentSubmitDao) {
|
||||||
|
this.studentSubmitDao = studentSubmitDao;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataGrid findWeijiaoList(PMStudentSubmit pmStudentSubmit){
|
||||||
|
DataGrid dg = new DataGrid();
|
||||||
|
int totalLines;
|
||||||
|
List<Object[]> theSubmitList;
|
||||||
|
// totalLines=
|
||||||
|
// (int) studentSubmitDao.getStudentSubmitNum(pmStudentSubmit.getProblemId(),pmStudentSubmit.getClassId());
|
||||||
|
int page= pmStudentSubmit.getPageNum();
|
||||||
|
|
||||||
|
// int studentNum=
|
||||||
|
// classesDao.findClassById(pmProblem.getClassId()).get(0).getStudentNum();
|
||||||
|
theSubmitList=
|
||||||
|
studentSubmitDao.findWeijiaoList(pmStudentSubmit);
|
||||||
|
// problemDao.getProblemsByPage(pmProblem.getCourseId(),pmProblem.getClassId(),pmProblem.getSelectedStatus(),pmProblem.getPageNum(), pmProblem.getPageSize());
|
||||||
|
totalLines= theSubmitList.size();
|
||||||
|
if ((page-1)*pmStudentSubmit.getPageSize()>=totalLines){
|
||||||
|
pmStudentSubmit.setPageNum(1);
|
||||||
|
}
|
||||||
|
if (theSubmitList== null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
List<PMStudentSubmit> pmStudentSubmitList=
|
||||||
|
new ArrayList<>();
|
||||||
|
changeModel4(pmStudentSubmitList,
|
||||||
|
theSubmitList);
|
||||||
|
dg.setTotal(totalLines);
|
||||||
|
dg.setPageSize(pmStudentSubmit.getPageSize());
|
||||||
|
dg.setTotalPages((long) (Math.ceil((double) dg.getTotal() / (double) dg.getPageSize())));
|
||||||
|
// // 设置当前显示第几页
|
||||||
|
dg.setPageNum(pmStudentSubmit.getPageNum());
|
||||||
|
// // 设置当前页的数据行数量
|
||||||
|
dg.setCurrentPageLineNum(pmStudentSubmitList.size());
|
||||||
|
// // 设置当前页的所有数据行
|
||||||
|
dg.setList(pmStudentSubmitList);
|
||||||
|
return dg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public DataGrid findYijiaoList(PMStudentSubmit pmStudentSubmit){
|
||||||
|
DataGrid dg = new DataGrid();
|
||||||
|
int totalLines;
|
||||||
|
List<Object[]> theSubmitList;
|
||||||
|
// totalLines=
|
||||||
|
// (int) studentSubmitDao.getStudentSubmitNum(pmStudentSubmit.getProblemId(),pmStudentSubmit.getClassId());
|
||||||
|
int page= pmStudentSubmit.getPageNum();
|
||||||
|
|
||||||
|
// int studentNum=
|
||||||
|
// classesDao.findClassById(pmProblem.getClassId()).get(0).getStudentNum();
|
||||||
|
theSubmitList=
|
||||||
|
studentSubmitDao.findYijiaoList(pmStudentSubmit);
|
||||||
|
// problemDao.getProblemsByPage(pmProblem.getCourseId(),pmProblem.getClassId(),pmProblem.getSelectedStatus(),pmProblem.getPageNum(), pmProblem.getPageSize());
|
||||||
|
totalLines= theSubmitList.size();
|
||||||
|
if ((page-1)*pmStudentSubmit.getPageSize()>=totalLines){
|
||||||
|
pmStudentSubmit.setPageNum(1);
|
||||||
|
}
|
||||||
|
if (theSubmitList== null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
List<PMStudentSubmit> pmStudentSubmitList=
|
||||||
|
new ArrayList<>();
|
||||||
|
changeModel5(pmStudentSubmitList,
|
||||||
|
theSubmitList);
|
||||||
|
dg.setTotal(totalLines);
|
||||||
|
dg.setPageSize(pmStudentSubmit.getPageSize());
|
||||||
|
dg.setTotalPages((long) (Math.ceil((double) dg.getTotal() / (double) dg.getPageSize())));
|
||||||
|
// // 设置当前显示第几页
|
||||||
|
dg.setPageNum(pmStudentSubmit.getPageNum());
|
||||||
|
// // 设置当前页的数据行数量
|
||||||
|
dg.setCurrentPageLineNum(pmStudentSubmitList.size());
|
||||||
|
// // 设置当前页的所有数据行
|
||||||
|
dg.setList(pmStudentSubmitList);
|
||||||
|
return dg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int editPostProblem(int classId,
|
||||||
|
int problemId,LocalDateTime startTime,LocalDateTime endTime,boolean allow){
|
||||||
|
int n=0;
|
||||||
|
if(allow==true)n=1;
|
||||||
|
return postProblemDao.editPostProblem(classId,problemId,startTime,endTime,n);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public void postProblem(PMPostProblem pmPostProblem, Integer classId){
|
public void postProblem(PMPostProblem pmPostProblem, Integer classId){
|
||||||
postProblemDao.postProblem(pmPostProblem,classId);
|
postProblemDao.postProblem(pmPostProblem,classId);
|
||||||
}
|
}
|
||||||
|
|
@ -284,7 +384,7 @@ changeModel2(pmProblems,theProblemList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void changeModel3(List<PMProblem> pmp,
|
private void changeModel3(List<PMProblem> pmp,
|
||||||
List<Object[]> pmp2) {
|
List<Object[]> pmp2,int studentNum) {
|
||||||
if (pmp2 != null && pmp2.size() > 0) {
|
if (pmp2 != null && pmp2.size() > 0) {
|
||||||
for (Object[] p2 : pmp2) {
|
for (Object[] p2 : pmp2) {
|
||||||
PMProblem pmProblem=new PMProblem();
|
PMProblem pmProblem=new PMProblem();
|
||||||
|
|
@ -294,7 +394,8 @@ changeModel2(pmProblems,theProblemList);
|
||||||
pmProblem.setEndTime((LocalDateTime) p2[3]);
|
pmProblem.setEndTime((LocalDateTime) p2[3]);
|
||||||
pmProblem.setDaipi((Long) p2[4]);
|
pmProblem.setDaipi((Long) p2[4]);
|
||||||
pmProblem.setYijiao((Long) p2[5]);
|
pmProblem.setYijiao((Long) p2[5]);
|
||||||
pmProblem.setWeijiao((Long) p2[6]);
|
// pmProblem.setWeijiao((Long) p2[6]);
|
||||||
|
pmProblem.setWeijiao(studentNum-(Long)p2[5]);
|
||||||
String timeRange=
|
String timeRange=
|
||||||
pmProblem.getStartTime()+"~"+pmProblem.getEndTime();
|
pmProblem.getStartTime()+"~"+pmProblem.getEndTime();
|
||||||
pmProblem.setTimeRange(timeRange.replace("T", " "));
|
pmProblem.setTimeRange(timeRange.replace("T", " "));
|
||||||
|
|
@ -303,4 +404,35 @@ changeModel2(pmProblems,theProblemList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void changeModel4(List<PMStudentSubmit> pmStudentSubmitList,
|
||||||
|
List<Object[]> pmObject) {
|
||||||
|
if (pmObject != null && pmObject.size() > 0) {
|
||||||
|
for (Object[] p : pmObject) {
|
||||||
|
PMStudentSubmit pmStudentSubmit=
|
||||||
|
new PMStudentSubmit();
|
||||||
|
pmStudentSubmit.setChineseName((String) p[0]);
|
||||||
|
pmStudentSubmit.setStudentNo((String) p[1]);
|
||||||
|
pmStudentSubmit.setReadTime((LocalDateTime) p[2]);
|
||||||
|
pmStudentSubmit.setSubmissionStatus((String) p[3]);
|
||||||
|
pmStudentSubmitList.add(pmStudentSubmit);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void changeModel5(List<PMStudentSubmit> pmStudentSubmitList,
|
||||||
|
List<Object[]> pmObject) {
|
||||||
|
if (pmObject != null && pmObject.size() > 0) {
|
||||||
|
for (Object[] p : pmObject) {
|
||||||
|
PMStudentSubmit pmStudentSubmit=
|
||||||
|
new PMStudentSubmit();
|
||||||
|
pmStudentSubmit.setChineseName((String) p[0]);
|
||||||
|
pmStudentSubmit.setStudentNo((String) p[1]);
|
||||||
|
pmStudentSubmit.setSubmitTime((LocalDateTime) p[2]);
|
||||||
|
pmStudentSubmit.setSubmissionStatus((String) p[3]);
|
||||||
|
pmStudentSubmit.setFinalScore((float) p[4]);
|
||||||
|
pmStudentSubmitList.add(pmStudentSubmit);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.example.aes.problem.model.*;
|
||||||
import com.example.aes.user.model.*;
|
import com.example.aes.user.model.*;
|
||||||
|
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ProblemServiceI {
|
public interface ProblemServiceI {
|
||||||
|
|
@ -34,5 +35,10 @@ public interface ProblemServiceI {
|
||||||
public List<Problem> findProblemById(int id);
|
public List<Problem> findProblemById(int id);
|
||||||
public void postProblem(PMPostProblem pmPostProblem, Integer classId);
|
public void postProblem(PMPostProblem pmPostProblem, Integer classId);
|
||||||
public void deleteProblem(Integer id);
|
public void deleteProblem(Integer id);
|
||||||
|
public List<PostProblem> findPostProblem(int problemId,int classId);
|
||||||
|
public int editPostProblem( int classId,
|
||||||
|
int problemId,
|
||||||
|
LocalDateTime startTime,LocalDateTime endTime,boolean allow);
|
||||||
|
public DataGrid findWeijiaoList(PMStudentSubmit pmStudentSubmit);
|
||||||
|
public DataGrid findYijiaoList(PMStudentSubmit pmStudentSubmit);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ package com.example.aes.user.dao;
|
||||||
import com.example.aes.user.model.*;
|
import com.example.aes.user.model.*;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface ClassesDaoI extends BaseDaoI<Classes> {
|
public interface ClassesDaoI extends BaseDaoI<Classes> {
|
||||||
|
|
||||||
|
|
@ -48,4 +46,5 @@ public interface ClassesDaoI extends BaseDaoI<Classes> {
|
||||||
String className, int teacherId);
|
String className, int teacherId);
|
||||||
public List<Classstudents>findClassIdByStudentId(int studentId);//根据班级id查找学生id
|
public List<Classstudents>findClassIdByStudentId(int studentId);//根据班级id查找学生id
|
||||||
public List<Classes> findClassByCourseId(int courseId);
|
public List<Classes> findClassByCourseId(int courseId);
|
||||||
|
public List<Classes> findClassById(int classId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,11 @@ package com.example.aes.user.dao.impl;
|
||||||
|
|
||||||
import com.example.aes.user.dao.*;
|
import com.example.aes.user.dao.*;
|
||||||
import com.example.aes.user.model.*;
|
import com.example.aes.user.model.*;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Repository("classesDao")
|
@Repository("classesDao")
|
||||||
|
|
@ -570,6 +568,12 @@ public class ClassesDaoImpl extends BaseDaoImpl<Classes> implements ClassesDaoI
|
||||||
"courseId="+courseId;
|
"courseId="+courseId;
|
||||||
return this.find(hql);
|
return this.find(hql);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public List<Classes> findClassById(int classId){
|
||||||
|
String hql = "from Classes where " +
|
||||||
|
"id="+classId;
|
||||||
|
return this.find(hql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,64 +1,24 @@
|
||||||
package com.example.aes.user.model;
|
package com.example.aes.user.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classstudents entity. @author MyEclipse Persistence Tools
|
* Classstudents entity. @author MyEclipse Persistence Tools
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "studentclass")
|
@Table(name = "studentclass",catalog = "aes")
|
||||||
public class Classstudents implements java.io.Serializable {
|
public class Classstudents implements java.io.Serializable {
|
||||||
|
|
||||||
// Fields
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 8050828329203855066L;
|
|
||||||
private Integer id;
|
|
||||||
private Integer classId;
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
/** default constructor */
|
|
||||||
public Classstudents() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/** full constructor */
|
|
||||||
public Classstudents(Integer classId, Integer userId) {
|
|
||||||
this.classId = classId;
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Property accessors
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@Column(name = "id", unique = true, nullable = false)
|
@Column(name = "id", unique = true, nullable = false)
|
||||||
public Integer getId() {
|
private Integer id;
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Column(name = "classId", nullable = false)
|
|
||||||
public Integer getClassId() {
|
|
||||||
return this.classId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassId(Integer classId) {
|
|
||||||
this.classId = classId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Column(name = "userId", nullable = false)
|
|
||||||
public Integer getUserId() {
|
|
||||||
return this.userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Integer userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@Column(name = "userId")
|
||||||
|
private Integer userId;
|
||||||
|
@Column(name = "classId")
|
||||||
|
private Integer classId;
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,6 @@ package com.example.aes.user.service;
|
||||||
|
|
||||||
import com.example.aes.user.model.*;
|
import com.example.aes.user.model.*;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ClassesServiceI {
|
public interface ClassesServiceI {
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,10 @@ import com.example.aes.user.dao.ClassesDaoI;
|
||||||
import com.example.aes.user.dao.ClassstudentsDaoI;
|
import com.example.aes.user.dao.ClassstudentsDaoI;
|
||||||
import com.example.aes.user.model.*;
|
import com.example.aes.user.model.*;
|
||||||
import com.example.aes.user.service.ClassesServiceI;
|
import com.example.aes.user.service.ClassesServiceI;
|
||||||
import org.hibernate.Query;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue