实验班级接口添加学校信息

master
pd 4 years ago
parent c8a44c97d0
commit 768239f6df
  1. 5
      src/main/java/com/yipin/liuwanr/Test.java
  2. 14
      src/main/java/com/yipin/liuwanr/controller/AssesmentController.java
  3. 8
      src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java
  4. 8
      src/main/java/com/yipin/liuwanr/service/AssesmentService.java

@ -5,6 +5,8 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@ -13,11 +15,12 @@ public class Test {
public static void main(String[] args) throws Exception {
//方法一
//System.out.println((new Test()).getURLContent());
System.out.println((new Test()).getURLContent());
String urlStr = "http://vip.stock.finance.sina.com.cn/quotes_service/api/json_v2.php/Market_Center.getHQNodeData?page=1&num=40&sort=symbol&asc=1&node=hs_a&symbol=&_s_r_a=init";
System.out.println((new Test()).getURLContent(urlStr));
}
public static String getURLContent() throws Exception {
String strURL = "http://vip.stock.finance.sina.com.cn/quotes_service/api/json_v2.php/Market_Center.getHQNodeData?page=1&num=40&sort=symbol&asc=1&node=hs_a&symbol=&_s_r_a=init";
URL url = new URL(strURL);

@ -250,13 +250,16 @@ public class AssesmentController {
* @return
*/
@GetMapping("/getExperimentalClass")
Response getExperimentalClass(@RequestParam Integer staffId) {
Response getExperimentalClass(@RequestParam Integer staffId,@RequestParam Integer schoolId) {
Response resp = new Response();
if(StringUtils.isEmpty(staffId)){
resp.setStatus(300);
resp.setErrmessage("教师信息为空");
}else if(StringUtils.isEmpty(schoolId)){
resp.setStatus(300);
resp.setErrmessage("学校信息为空");
} else{
HashMap<String, Object> ret = service.queryCretionTime(staffId);
HashMap<String, Object> ret = service.queryCretionTime(staffId,schoolId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
@ -276,7 +279,7 @@ public class AssesmentController {
* @return
*/
@GetMapping("/getCreationTime")
Response getCreationTime(@RequestParam String creationTime,@RequestParam Integer staffId) {
Response getCreationTime(@RequestParam String creationTime,@RequestParam Integer staffId,@RequestParam Integer schoolId) {
Response resp = new Response();
if(StringUtils.isEmpty(staffId)){
resp.setStatus(300);
@ -284,8 +287,11 @@ public class AssesmentController {
}else if(StringUtils.isEmpty(creationTime)){
resp.setStatus(300);
resp.setErrmessage("实验班级创建时间信息为空");
}else if(StringUtils.isEmpty(schoolId)){
resp.setStatus(300);
resp.setErrmessage("学校信息为空");
}else {
HashMap<String, Object> ret = service.queryCretionTime(creationTime,staffId);
HashMap<String, Object> ret = service.queryCretionTime(creationTime,staffId,schoolId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);

@ -186,8 +186,8 @@ public interface AssesmentMapper {
* @return
*/
@Select("select DISTINCT DATE_FORMAT(creationTime,'%Y') as creationTime from experimental_class_ning " +
" WHERE isdel=0 and founder=(select staffName from staff where staffId=#{staffId}) GROUP BY creationTime ORDER BY creationTime desc ")
List<ExperimentalClass> queryCreationTime(Integer staffId);
" WHERE isdel=0 and founder=(select staffName from staff where staffId=#{staffId}) and schoolId={schoolId} GROUP BY creationTime ORDER BY creationTime desc ")
List<ExperimentalClass> queryCreationTime(@Param("staffId") Integer staffId,@Param("schoolId")Integer schoolId);
/**
@ -196,13 +196,13 @@ public interface AssesmentMapper {
* @param creationTime
* @return
*/
@Select("select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime like concat('%',#{creationTime},'%') and founder=(select staffName from staff where staffId=#{staffId})")
@Select("select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime like concat('%',#{creationTime},'%') and founder=(select staffName from staff where staffId=#{staffId}) and schoolId={schoolId} ")
@Results({
@Result(id = true, column = "experimentalClassId", property = "experimentalClassId"),
@Result(column = "experimentalClassName", property = "experimentalClassName"),
@Result(column = "experimentalClassId", property = "students", many = @Many(select = "com.yipin.liuwanr.mapper.StudentMapper.getByStudents"))
})
List<ExperimentalClass> queryExperimentalClass(@Param("creationTime") String creationTime, @Param("staffId") Integer staffId);
List<ExperimentalClass> queryExperimentalClass(@Param("creationTime") String creationTime, @Param("staffId") Integer staffId,@Param("schoolId")Integer schoolId);
/**
* 考核名称创建时间结束时间教师名称考核人数实到人数

@ -318,10 +318,10 @@ public class AssesmentService {
* @param staffId教师id
* @return
*/
public HashMap<String, Object> queryCretionTime(Integer staffId) {
public HashMap<String, Object> queryCretionTime(Integer staffId,Integer schoolId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", mapper.queryCreationTime(staffId));
resp.put("retvalue", mapper.queryCreationTime(staffId,schoolId));
resp.put("retcode", 200);
} catch (Exception e) {
logger.error(e.getMessage());
@ -339,10 +339,10 @@ public class AssesmentService {
* @param cretionTime
* @return
*/
public HashMap<String, Object> queryCretionTime(String cretionTime, Integer staffId) {
public HashMap<String, Object> queryCretionTime(String cretionTime, Integer staffId,Integer schoolId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", mapper.queryExperimentalClass(cretionTime, staffId));
resp.put("retvalue", mapper.queryExperimentalClass(cretionTime, staffId,schoolId));
resp.put("retcode", 200);
} catch (Exception e) {
logger.error(e.getMessage());

Loading…
Cancel
Save