You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.6 KiB
94 lines
2.6 KiB
package core.process;
|
|
|
|
import core.operation.Search;
|
|
import core.operation.Select;
|
|
import error.GExcptInit;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class C_StudentSelectTeacher extends C_Select {
|
|
String studentId;
|
|
String teacherId;
|
|
private static String buttonName ="选择老师";
|
|
private static String targetURL="/home/student-select-teacher";
|
|
private static String iconURL="../cssFile/images/select.png";
|
|
private static String info = "";
|
|
|
|
private static String table="graduation_design";
|
|
private static String fileds="student_choose_teacher_status";
|
|
|
|
|
|
public void select()throws Exception{
|
|
if(!check()) throw new GExcptInit("ID Attrs init error!");
|
|
Select select=new Select();
|
|
select.setOptions(new HashMap<>());
|
|
select.addOptions("student_id",this.getStudentId());
|
|
select.addOptions("teacher_id",this.getTeacherId());
|
|
Map<String,Object> options=select.execute(null);
|
|
updateStatus();
|
|
}
|
|
public List<Map<String,String>> search(String teacherId) throws Exception{
|
|
Search search = new Search() ;
|
|
search.setOptions(new HashMap<>());
|
|
search.addOptions("table","teacher");
|
|
List<String> fields = new ArrayList<>();
|
|
fields.add("*");
|
|
search.addOptions("field",fields);
|
|
Map<String,String> limits = new HashMap<>();
|
|
limits.put("id",teacherId);
|
|
search.addOptions("limits",limits);
|
|
search.addOptions("start",0);
|
|
search.addOptions("end",10);
|
|
Map<String, Object> options = search.execute(null);
|
|
List<String[]> result = (List<String[]>) options.get("result");
|
|
List<Map<String,String>> teachersInfo = new ArrayList<>();
|
|
core.process.Utils.formatResult(result, teachersInfo);
|
|
return teachersInfo;
|
|
}
|
|
protected boolean check() {
|
|
if(this.getStudentId()==null||this.getTeacherId()==null)
|
|
return false;
|
|
return true;
|
|
}
|
|
public String getTeacherId() {
|
|
return teacherId;
|
|
}
|
|
|
|
public void setTeacherId(String teacherId) {
|
|
this.teacherId = teacherId;
|
|
}
|
|
|
|
public String getStudentId() {
|
|
return studentId;
|
|
}
|
|
|
|
public void setStudentId(String studentId) {
|
|
this.studentId = studentId;
|
|
}
|
|
|
|
|
|
@Override
|
|
public String getInfo() {
|
|
return info;
|
|
}
|
|
|
|
@Override
|
|
public String getTargetURL() {
|
|
return targetURL;
|
|
}
|
|
|
|
@Override
|
|
public String getIconURL() {
|
|
return iconURL;
|
|
}
|
|
|
|
@Override
|
|
public String getButtonName() {
|
|
return buttonName;
|
|
}
|
|
|
|
}
|