实现后台对未交作业人员的查询

This commit is contained in:
F嘉阳
2018-02-22 22:05:56 +08:00
parent 355c1c171f
commit 3abbd49f65
9 changed files with 119 additions and 11 deletions

View File

@@ -99,9 +99,9 @@ public class DataController {
}
@GetMapping("/home/findStudentInCourseFile")
public List<VUserfile> findStudentInCourseFile(
public List<TbStudentlist> findStudentInCourseFile(
@RequestParam(value = "Folder") String Folder,@RequestParam(value = "CourseName") String CourseName){
List<VUserfile> files = vUserfileService.findByWorkFolderAndCourseName(Folder,CourseName);
List<TbStudentlist> files = vUserfileService.findStudentNoByWorkFolderAndCourseName(Folder,CourseName);
if (files!=null){
return files;
}

View File

@@ -0,0 +1,48 @@
package com.fjy.spring.domain;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class TbStudentlist {
@Id
private Integer listid;
private String colstudentno;
private String colrealname;
private String sex;
public Integer getListid() {
return listid;
}
public void setListid(Integer listid) {
this.listid = listid;
}
public String getColstudentno() {
return colstudentno;
}
public void setColstudentno(String colstudentno) {
this.colstudentno = colstudentno;
}
public String getColrealname() {
return colrealname;
}
public void setColrealname(String colrealname) {
this.colrealname = colrealname;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
}

View File

@@ -6,7 +6,7 @@ import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
/*@Configuration*/
public class WebAppConfig implements WebMvcConfigurer {
/**

View File

@@ -4,7 +4,6 @@ import com.fjy.spring.domain.TbFile;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface TbFileRepository extends JpaRepository<TbFile,Integer>{
public List<TbFile> findByColfilename(String name);

View File

@@ -1,12 +1,17 @@
package com.fjy.spring.repository;
import com.fjy.spring.domain.TbStudentlist;
import com.fjy.spring.domain.VUserfile;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface VUserfileRepository extends JpaRepository<VUserfile,Integer> {
public List<VUserfile> findByWorkFolderAndCourseName(String workFolder,String courseName);
@Query(value = "SELECT l FROM TbStudentlist l WHERE l.colstudentno NOT IN ( SELECT colstudentno FROM VUserfile f WHERE f.workFolder = ?1 AND f.courseName = ?2 )")
public List<TbStudentlist> findStudentNoByWorkFolderAndCourseName(String workFolder, String courseName);
}

View File

@@ -1,6 +1,7 @@
package com.fjy.spring.service;
import com.fjy.spring.domain.TbFile;
import com.fjy.spring.domain.VUserfile;
import com.fjy.spring.repository.TbFileRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

View File

@@ -1,5 +1,6 @@
package com.fjy.spring.service;
import com.fjy.spring.domain.TbStudentlist;
import com.fjy.spring.domain.VUserfile;
import com.fjy.spring.repository.VUserfileRepository;
import org.springframework.beans.factory.annotation.Autowired;
@@ -15,4 +16,8 @@ public class VUserfileService {
public List<VUserfile> findByWorkFolderAndCourseName(String workFolder, String courseName) {
return vUserfileRepository.findByWorkFolderAndCourseName(workFolder, courseName);
}
public List<TbStudentlist> findStudentNoByWorkFolderAndCourseName(String workFolder, String courseName){
return vUserfileRepository.findStudentNoByWorkFolderAndCourseName(workFolder,courseName);
}
}

View File

@@ -1,6 +1,9 @@
var Main = {
data() {
return {
restaurants: [],
state1: '',
state2: '',
activeIndex: '1',
formInline: {
user: '',
@@ -61,8 +64,40 @@ var Main = {
}
})
},
handleSelect(key, keyPath) {
console.log(key, keyPath);
querySearch(queryString, cb) {
var restaurants = this.restaurants;
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
// 调用 callback 返回建议列表的数据
cb(results);
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
loadAll() {
return [
{ "value": "三全鲜食(北新泾店)", "address": "长宁区新渔路144号" },
{ "value": "Hot honey 首尔炸鸡(仙霞路)", "address": "上海市长宁区淞虹路661号" },
{ "value": "南拳妈妈龙虾盖浇饭", "address": "普陀区金沙江路1699号鑫乐惠美食广场A13" }
];
},
querySearchAsync(queryString, cb) {
var restaurants = this.restaurants;
var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
cb(results);
}, 1000 * Math.random());
},
createStateFilter(queryString) {
return (state) => {
return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
handleSelect(item) {
console.log(item);
},
ClickToJump(targe){
window.location.href="http://localhost:8080/cms/home/" + targe;
@@ -83,6 +118,20 @@ var Main = {
onSubmit() {
console.log('submit!');
}
},
mounted() {
/*this.restaurants = this.loadAll();*/
this.restaurants=this.$nextTick(() => {
var that = this;
axios.get('http://localhost:8080/cms/home/findvcourse')
.then(function (response) {
console.log(response.data);
that.logData = response.data;
})
.catch(function (error) {
console.log(error);
});
})
}
}
var Ctor = Vue.extend(Main)

View File

@@ -47,13 +47,14 @@
<h4>添加课程</h4>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="课程名">
<el-input v-model="formInline.user" placeholder="课程名"></el-input>
<el-autocomplete class="inline-input" v-model="state1"
:fetch-suggestions="querySearchAsync" placeholder="课程名"
@select="handleSelect"></el-autocomplete>
</el-form-item>
<el-form-item label="教师名">
<el-select v-model="formInline.region" placeholder="教师名">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
<el-autocomplete class="inline-input" v-model="state2"
:fetch-suggestions="querySearchAsync" placeholder="教师名"
@select="handleSelect"></el-autocomplete>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">添加</el-button>