master
zhiyong.ning 4 years ago
parent 243665f3ae
commit 9265783950
  1. 20
      src/main/java/com/yipin/liuwanr/controller/AssesmentController.java
  2. 4
      src/main/java/com/yipin/liuwanr/controller/ExperimentalClassController.java
  3. 8
      src/main/java/com/yipin/liuwanr/entity/Customer.java
  4. 10
      src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java
  5. 8
      src/main/java/com/yipin/liuwanr/mapper/CustomerMapper.java
  6. 2
      src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java
  7. 2
      src/main/java/com/yipin/liuwanr/mapper/UserMapper.java
  8. 10
      src/main/java/com/yipin/liuwanr/service/AssesmentService.java
  9. 10
      src/main/java/com/yipin/liuwanr/service/ExperimentalClassService.java

@ -246,17 +246,17 @@ public class AssesmentController {
/**
* 查询实验班级一级栏目
* @param staffId
* @param schoolId
* @return
*/
@GetMapping("/getExperimentalClass")
Response getExperimentalClass(@RequestParam Integer staffId) {
Response getExperimentalClass(@RequestParam Integer schoolId) {
Response resp = new Response();
if(StringUtils.isEmpty(staffId)){
if(StringUtils.isEmpty(schoolId)){
resp.setStatus(300);
resp.setErrmessage("教师信息为空");
resp.setErrmessage("学校为空!");
}else{
HashMap<String, Object> ret = service.queryCretionTime(staffId);
HashMap<String, Object> ret = service.queryCretionTime(schoolId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
@ -271,21 +271,21 @@ public class AssesmentController {
/**
* 查询实验班级名称以及班级一下的学生
* 二级查询实验班级名称以及班级一下的学生
* @param creationTime
* @return
*/
@GetMapping("/getCreationTime")
Response getCreationTime(@RequestParam String creationTime,@RequestParam Integer staffId) {
Response getCreationTime(@RequestParam String creationTime,@RequestParam Integer schoolId) {
Response resp = new Response();
if(StringUtils.isEmpty(staffId)){
if(StringUtils.isEmpty(schoolId)){
resp.setStatus(300);
resp.setErrmessage("教师信息为空");
resp.setErrmessage("学校为空!");
}else if(StringUtils.isEmpty(creationTime)){
resp.setStatus(300);
resp.setErrmessage("实验班级创建时间信息为空");
}else {
HashMap<String, Object> ret = service.queryCretionTime(creationTime,staffId);
HashMap<String, Object> ret = service.queryCretionTime(creationTime,schoolId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);

@ -114,7 +114,7 @@ public class ExperimentalClassController {
Response resp = new Response();
if (studentList.isEmpty()) {
resp.setStatus(300);
resp.setErrmessage("Parameter Invalid");
resp.setErrmessage("参数为空!");
}else {
HashMap<String, Object> ret = classService.experimentClassAddStudent(studentList);
int status = (int) ret.get("retcode");
@ -298,7 +298,7 @@ public class ExperimentalClassController {
Integer experimentalClassId = experimentalClass.getExperimentalClassId();
int size = studentList.size();
for (int i = 0; i < size; i++) {
studentList.get(i).setIntExperimentalClassId(experimentalClassId);
studentList.get(i).setExperimentalClassId(experimentalClassId+"");
}
int status = (int) ret.get("retcode");
if (200 == status) {

@ -24,6 +24,8 @@ public class Customer {
private Integer customerType;
//到期时间
private String stopTime;
//创建时间
private String creationTime;
//邮件
private String email;
//绑定学校ID
@ -49,6 +51,12 @@ public class Customer {
//学校层次
private Integer level;
public String getCreationTime() {
return creationTime;
}
public void setCreationTime(String creationTime) {
this.creationTime = creationTime;
}
public String getIndustryClassName() {
return industryClassName;
}

@ -172,11 +172,11 @@ public interface AssesmentMapper {
/**
* 查询实验班级一级标题创建时间
* @param staffId
* @param schoolId
* @return
*/
@Select("select 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<String> queryCreationTime(Integer staffId);
@Select("select creationTime from experimental_class_ning WHERE isdel=0 and schoolId = #{schoolId} GROUP BY creationTime ORDER BY creationTime desc")
List<ExperimentalClass> queryCreationTime(Integer schoolId);
/**
@ -184,13 +184,13 @@ public interface AssesmentMapper {
* @param creationTime
* @return
*/
@Select("select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime=#{creationTime} and founder=(select staffName from staff where staffId=#{staffId})")
@Select("select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime=#{creationTime} 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.queryStudent") )
})
List<ExperimentalClass> queryExperimentalClass(@Param("creationTime") String creationTime,@Param("staffId") Integer staffId);
List<ExperimentalClass> queryExperimentalClass(@Param("creationTime") String creationTime,@Param("schoolId") Integer schoolId);

@ -20,8 +20,8 @@ import com.yipin.liuwanr.vo.CustomerVO;
public interface CustomerMapper {
@Insert("INSERT INTO customer(countries,industry,provinceId,adminName,adminPhone,cityId,customerType,stopTime,email,isdel,schoolId,industryClassId,industryId,customerName)"
+ "VALUES(#{countries},#{industry},#{provinceId},#{adminName},#{adminPhone},#{cityId},#{customerType},#{stopTime},#{email},0,#{schoolId},#{industryClassId},#{industryId},#{customerName})")
@Insert("INSERT INTO customer(countries,industry,provinceId,adminName,adminPhone,cityId,customerType,stopTime,email,isdel,schoolId,industryClassId,industryId,customerName,creationTime)"
+ "VALUES(#{countries},#{industry},#{provinceId},#{adminName},#{adminPhone},#{cityId},#{customerType},#{stopTime},#{email},0,#{schoolId},#{industryClassId},#{industryId},#{customerName},now())")
void addCustomer(Customer customer);
@Insert("INSERT INTO user(countries,provinceId,cityId,accountRole,creationTime,phone,password,email,isdel"
@ -34,8 +34,8 @@ public interface CustomerMapper {
" <if test='countries!=null'>and c.countries = #{countries} </if>",
" <if test='provinceId!=null'>and c.provinceId = #{provinceId} </if>",
" <if test='cityId!=null'>and c.cityId = #{cityId} </if>",
" <if test='searchContent!=null'> and c.customerName like CONCAT('%',#{searchContent},'%') or c.adminName like CONCAT('%',#{searchContent},'%') or c.adminPhone like CONCAT('%',#{searchContent},'%')</if>",
"GROUP BY c.customerId",
" <if test='searchContent!=null'> AND CONCAT(c.customerName, c.adminName, c.adminPhone) LIKE CONCAT('%',#{searchContent},'%')</if>",
"GROUP BY c.customerId order by c.creationTime desc",
"</script> "})
List<Customer> queryCustomer(Customer customer);

@ -17,7 +17,7 @@ import com.yipin.liuwanr.entity.Student;
public interface ExperimentalClassMapper {
@Insert("INSERT INTO experimental_class_student(studentId,experimentalClassId)"
+ "VALUES(#{studentId},#{intExperimentalClassId})")
+ "VALUES(#{studentId},#{experimentalClassId})")
void experimentClassAddStudent(Student student);
@Delete("DELETE from experimental_class_student where studentId = #{studentId} and experimentalClassId = #{experimentalClassId}")

@ -120,7 +120,7 @@ public interface UserMapper {
" <if test='schoolId!=null'>and u.schoolId = #{schoolId} </if>",
" <if test='cityId!=null and cityId !=\"\" '>and u.cityId = #{cityId} </if>",
" <if test='accountRole!=null and accountRole !=\"\" '>and u.accountRole = #{accountRole} </if>",
" <if test='searchContent!=null and searchContent !=\"\" '>and u.name like CONCAT('%',#{searchContent},'%') </if>",
" <if test='searchContent!=null and searchContent !=\"\" '> AND CONCAT(u.name, s.schoolName) LIKE CONCAT('%',#{searchContent},'%')</if>",
" <if test='month==3'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)</if>",
" <if test='month==6'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)</if>",
" <if test='month==9'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 9 MONTH)</if>",

@ -300,13 +300,13 @@ public class AssesmentService {
/**
* 查询实验班级一级栏目
*
* @param staffId教师id
* @param schoolId学校id
* @return
*/
public HashMap<String, Object> queryCretionTime(Integer staffId) {
public HashMap<String, Object> queryCretionTime(Integer schoolId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", mapper.queryCreationTime(staffId));
resp.put("retvalue", mapper.queryCreationTime(schoolId));
resp.put("retcode", 200);
} catch (Exception e) {
logger.error(e.getMessage());
@ -324,10 +324,10 @@ public class AssesmentService {
* @param cretionTime
* @return
*/
public HashMap<String, Object> queryCretionTime(String cretionTime, Integer staffId) {
public HashMap<String, Object> queryCretionTime(String cretionTime, Integer schoolId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", mapper.queryExperimentalClass(cretionTime, staffId));
resp.put("retvalue", mapper.queryExperimentalClass(cretionTime, schoolId));
resp.put("retcode", 200);
} catch (Exception e) {
logger.error(e.getMessage());

@ -35,9 +35,19 @@ public class ExperimentalClassService {
try {
for (int i = 0; i < size; i++) {
Student student = studentList.get(i);
Integer studentId = student.getStudentId();
String experimentalClassId = student.getExperimentalClassId();
if (studentId == null){
resp.put("retcode", 300);
resp.put("retvalue", "学生为空!");
}else if (experimentalClassId==null||experimentalClassId==""){
resp.put("retcode", 300);
resp.put("retvalue", "实验班级为空!");
}else{
experimentalClassMapper.experimentClassAddStudent(student);
resp.put("retcode", 200);
}
}
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);

Loading…
Cancel
Save