添加补考信息

master
pd 4 years ago
parent 243665f3ae
commit b8b04eea1e
  1. 17
      src/main/java/com/yipin/liuwanr/controller/MakeuplistController.java
  2. 12
      src/main/java/com/yipin/liuwanr/mapper/MakeuplistMapper.java
  3. 16
      src/main/java/com/yipin/liuwanr/service/MakeuplistService.java

@ -26,7 +26,6 @@ public class MakeuplistController {
/** /**
* 上传Excel文件读取数据到数据库 * 上传Excel文件读取数据到数据库
* @param file
* @return * @return
*/ */
@PostMapping("/importMakeuplist") @PostMapping("/importMakeuplist")
@ -70,7 +69,7 @@ public class MakeuplistController {
* @return * @return
*/ */
@GetMapping("/queryGetByClassName") @GetMapping("/queryGetByClassName")
Response queryGetByClassName(@RequestParam Integer staffId,@RequestParam String uploadTime,Integer uploadType) { Response queryGetByClassName(@RequestParam Integer staffId,@RequestParam String uploadTime,@RequestParam Integer uploadType,@RequestParam Integer schoolId) {
Response resp = new Response(); Response resp = new Response();
if(StringUtils.isEmpty(staffId)) { if(StringUtils.isEmpty(staffId)) {
resp.setStatus(300); resp.setStatus(300);
@ -81,8 +80,11 @@ public class MakeuplistController {
}else if(StringUtils.isEmpty(uploadType)){ }else if(StringUtils.isEmpty(uploadType)){
resp.setStatus(300); resp.setStatus(300);
resp.setMessage("文件上传选项为空"); resp.setMessage("文件上传选项为空");
}else if(StringUtils.isEmpty(schoolId)){
resp.setStatus(300);
resp.setMessage("学校信息为空");
}else { }else {
HashMap<String, Object> ret = makeuplistService.queryAllMakeuplist(staffId,uploadTime,uploadType); HashMap<String, Object> ret = makeuplistService.queryAllMakeuplist(staffId,uploadTime,uploadType,schoolId);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
@ -120,19 +122,22 @@ public class MakeuplistController {
} }
@GetMapping("/getStudent") @GetMapping("/getStudent")
Response getStudent(Integer staffId,String uploadTime,Integer uploadType){ Response getStudent(@RequestParam Integer staffId,@RequestParam String uploadTime,@RequestParam Integer uploadType,@RequestParam Integer schoolId){
Response resp = new Response(); Response resp = new Response();
if(StringUtils.isEmpty(staffId)) { if(StringUtils.isEmpty(staffId)) {
resp.setStatus(300); resp.setStatus(300);
resp.setMessage("staffId cannot be empty "); resp.setMessage(" 教师信息为空 ");
} else if(StringUtils.isEmpty(uploadTime)){ } else if(StringUtils.isEmpty(uploadTime)){
resp.setStatus(300); resp.setStatus(300);
resp.setMessage("文件上传时间为空"); resp.setMessage("文件上传时间为空");
}else if(StringUtils.isEmpty(uploadType)){ }else if(StringUtils.isEmpty(uploadType)){
resp.setStatus(300); resp.setStatus(300);
resp.setMessage("文件上传选项为空"); resp.setMessage("文件上传选项为空");
}else if(StringUtils.isEmpty(schoolId)){
resp.setStatus(300);
resp.setMessage("学校为空");
}else { }else {
HashMap<String, Object> ret = makeuplistService.getStudent(staffId,uploadTime,uploadType); HashMap<String, Object> ret = makeuplistService.getStudent(staffId,uploadTime,uploadType,schoolId);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);

@ -18,15 +18,15 @@ import org.apache.ibatis.annotations.Select;
public interface MakeuplistMapper { public interface MakeuplistMapper {
@Select("select professionalName,gradeName,className,m.studentNumber,studentName from makeuplist m,student s,class c,grade g,professional p " + @Select("select professionalName,gradeName,className,m.studentNumber,studentName from makeuplist m,student s,class c,grade g,professional p " +
"where m.studentId=s.studentId and m.classId=c.classId and c.gradeId=g.gradeId and s.professionalId=p.professionalId and m.staffId=#{staffId} and m.uploadTime=#{uploadTime}") "where m.studentId=s.studentId and m.classId=c.classId and c.gradeId=g.gradeId and s.professionalId=p.professionalId and m.staffId=#{staffId} and m.uploadTime=#{uploadTime} and m.schoolId=#{schoolId}")
List<Makeuplist> queryClassMakeuplist(@Param("staffId")Integer staffId, @Param("uploadTime")String uploadTime); List<Makeuplist> queryClassMakeuplist(@Param("staffId")Integer staffId, @Param("uploadTime")String uploadTime,@Param("schoolId") Integer schoolId);
@Select("select professionalName,gradeName,experimentalClassName,m.studentNumber,studentName from makeuplist m,student s,class c,experimental_class_ning ecn,grade g,professional p " + @Select("select professionalName,gradeName,experimentalClassName,m.studentNumber,studentName from makeuplist m,student s,class c,experimental_class_ning ecn,grade g,professional p " +
"where m.studentId=s.studentId and s.classId=c.classId and c.gradeId=g.gradeId and s.professionalId=p.professionalId and m.experimentalClassId=ecn.experimentalClassId and m.staffId=#{staffId} and m.uploadTime=#{uploadTime}") "where m.studentId=s.studentId and s.classId=c.classId and c.gradeId=g.gradeId and s.professionalId=p.professionalId and m.experimentalClassId=ecn .experimentalClassId and m.staffId=#{staffId} and m.uploadTime=#{uploadTime} and m.schoolId=#{schoolId}")
List<Makeuplist> queryExperimentalClassMakeuplist(@Param("staffId")Integer staffId, @Param("uploadTime")String uploadTime); List<Makeuplist> queryExperimentalClassMakeuplist(@Param("staffId")Integer staffId, @Param("uploadTime")String uploadTime,@Param("schoolId") Integer schoolId);
@Select("select experimentalClassId,studentId,classId from makeuplist where staffId=#{staffId} and uploadTime=#{uploadTime}") @Select("select experimentalClassId,studentId,classId from makeuplist where staffId=#{staffId} and uploadTime=#{uploadTime} and schoolId=#{schoolId}")
List<Student> getstudent(@Param("staffId")Integer staffId, @Param("uploadTime")String uploadTime); List<Student> getstudent(@Param("staffId")Integer staffId, @Param("uploadTime")String uploadTime,@Param("schoolId") Integer schoolId);
@Select("select classId,studentId from makeuplist where staffId=#{staffId} and uploadTime=#{uploadTime}") @Select("select classId,studentId from makeuplist where staffId=#{staffId} and uploadTime=#{uploadTime}")
List<Student> getClass(@Param("staffId")Integer staffId, @Param("uploadTime")String uploadTime); List<Student> getClass(@Param("staffId")Integer staffId, @Param("uploadTime")String uploadTime);

@ -36,14 +36,14 @@ public class MakeuplistService {
* @param staffId * @param staffId
* @return * @return
*/ */
public HashMap<String, Object> queryAllMakeuplist(Integer staffId,String uploadTime,Integer uploadType) { public HashMap<String, Object> queryAllMakeuplist(Integer staffId,String uploadTime,Integer uploadType,Integer schoolId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
if(uploadType.equals(0)){ if(uploadType.equals(0)){
List<Makeuplist> makeuplists=makeuplistMapper.queryExperimentalClassMakeuplist(staffId,uploadTime); List<Makeuplist> makeuplists=makeuplistMapper.queryExperimentalClassMakeuplist(staffId,uploadTime,schoolId);
resp.put("retvalue", makeuplists); resp.put("retvalue", makeuplists);
}else if(uploadType.equals(1)){ }else if(uploadType.equals(1)){
List<Makeuplist> makeuplists=makeuplistMapper.queryClassMakeuplist(staffId,uploadTime); List<Makeuplist> makeuplists=makeuplistMapper.queryClassMakeuplist(staffId,uploadTime,schoolId);
resp.put("retvalue", makeuplists); resp.put("retvalue", makeuplists);
} }
resp.put("retcode", 200); resp.put("retcode", 200);
@ -56,10 +56,10 @@ public class MakeuplistService {
return resp; return resp;
} }
public HashMap<String, Object> getStudent(Integer staffId,String uploadTime,Integer uploadType){ public HashMap<String, Object> getStudent(Integer staffId,String uploadTime,Integer uploadType,Integer schoolId){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try{ try{
resp.put("retvalue",makeuplistMapper.getstudent(staffId,uploadTime)); resp.put("retvalue",makeuplistMapper.getstudent(staffId,uploadTime,schoolId));
resp.put("retcode", 200); resp.put("retcode", 200);
}catch (RuntimeException e){ }catch (RuntimeException e){
logger.error(e.getMessage()); logger.error(e.getMessage());
@ -72,14 +72,14 @@ public class MakeuplistService {
public HashMap<String, Object> getByMakeuplist(Integer staffId,String uploadTime,Integer uploadType){ public HashMap<String, Object> getByMakeuplist(Integer staffId,String uploadTime,Integer uploadType,Integer schoolId){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try{ try{
if(uploadType.equals(0)){ if(uploadType.equals(0)){
List<Makeuplist> makeuplists=makeuplistMapper.queryExperimentalClassMakeuplist(staffId,uploadTime); List<Makeuplist> makeuplists=makeuplistMapper.queryExperimentalClassMakeuplist(staffId,uploadTime,schoolId);
resp.put("retvalue", makeuplists); resp.put("retvalue", makeuplists);
}else if(uploadType.equals(1)){ }else if(uploadType.equals(1)){
List<Makeuplist> makeuplists=makeuplistMapper.queryClassMakeuplist(staffId,uploadTime); List<Makeuplist> makeuplists=makeuplistMapper.queryClassMakeuplist(staffId,uploadTime,schoolId);
resp.put("retvalue", makeuplists); resp.put("retvalue", makeuplists);
} }
resp.put("retcode", 200); resp.put("retcode", 200);

Loading…
Cancel
Save