master
zhiyong.ning 5 years ago
parent 0b096e02d2
commit 61296d8ad4
  1. 80
      src/main/java/com/yipin/liuwanr/controller/StaffController.java
  2. 127
      src/main/java/com/yipin/liuwanr/controller/StudentController.java
  3. 4
      src/main/java/com/yipin/liuwanr/controller/UserController.java
  4. 6
      src/main/java/com/yipin/liuwanr/entity/ContractInformation.java
  5. 21
      src/main/java/com/yipin/liuwanr/mapper/StaffMapper.java
  6. 18
      src/main/java/com/yipin/liuwanr/mapper/StudentMapper.java
  7. 17
      src/main/java/com/yipin/liuwanr/mapper/UserMapper.java
  8. 16
      src/main/java/com/yipin/liuwanr/service/StaffService.java
  9. 9
      src/main/java/com/yipin/liuwanr/service/StudentService.java
  10. 32
      src/main/java/com/yipin/liuwanr/service/UserService.java

@ -98,18 +98,23 @@ public class StaffController {
* 查询员工
*/
@GetMapping("/queryStaff")
Response queryCustomer(@RequestParam String nameAndNumber,String staffProfessionalArchitectureIds,Integer pageNo,Integer pageSize,String staffGradeIds) {
Response queryCustomer(@RequestParam Integer schoolId,String nameAndNumber,String staffProfessionalArchitectureIds,Integer pageNo,Integer pageSize,String staffGradeIds) {
Response resp = new Response();
Staff staff = new Staff();
if (nameAndNumber!=null&&nameAndNumber!="") {
staff.setNameAndNumber(nameAndNumber);
}
if (staffProfessionalArchitectureIds!=null&&staffProfessionalArchitectureIds!="") {
staff.setStaffProfessionalArchitectureIds(staffProfessionalArchitectureIds);
}
if (staffGradeIds!=null&&staffGradeIds!="") {
staff.setStaffGradeIds(staffGradeIds);
}
if (schoolId==null){
resp.setStatus(300);
resp.setErrmessage("学校id为空,查询失败!");
}else {
if (nameAndNumber!=null&&nameAndNumber!="") {
staff.setNameAndNumber(nameAndNumber);
}
if (staffProfessionalArchitectureIds!=null&&staffProfessionalArchitectureIds!="") {
staff.setStaffProfessionalArchitectureIds(staffProfessionalArchitectureIds);
}
if (staffGradeIds!=null&&staffGradeIds!="") {
staff.setStaffGradeIds(staffGradeIds);
}
staff.setSchoolId(schoolId);
HashMap<String, Object> ret = staffService.queryStaff(staff,pageNo,pageSize);
int status = (int) ret.get("retcode");
if (200 == status) {
@ -119,6 +124,7 @@ public class StaffController {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
@ -149,20 +155,30 @@ public class StaffController {
* 删除员工
*/
@PostMapping("/deleteStaff")
Response deleteStaff(@RequestBody List<Integer> staffId) {
Response deleteStaff(@RequestBody List<Staff> staffList) {
Response resp = new Response();
if (staffId==null) {
resp.setStatus(300);
resp.setErrmessage("Parameter Invalid");
} else {
HashMap<String, Object> ret = staffService.deleteStaff(staffId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
int size = staffList.size();
for(int i=0;i<size;i++) {
Staff staff = staffList.get(i);
Integer staffId = staff.getStaffId();
String phone = staff.getPhone();
if (staffId==null) {
resp.setStatus(300);
resp.setErrmessage("员工id为空,删除失败!");
}else if (phone == null ||phone == ""){
resp.setStatus(300);
resp.setErrmessage("员工电话为空,删除失败!");
}
else {
HashMap<String, Object> ret = staffService.deleteStaff(staffId,phone);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
}
return resp;
@ -172,13 +188,21 @@ public class StaffController {
* 更新员工
*/
@PostMapping("/updateStaff")
Response updateStaff(@RequestBody Staff staff) {
Response updateStaff(@RequestBody UserVO vo) {
Response resp = new Response();
if (staff==null) {
Staff staff = vo.getStaff();
Integer staffId = staff.getStaffId();
UserM user = vo.getUser();
String phone = user.getPhone();
if (staffId==null) {
resp.setStatus(300);
resp.setErrmessage("Parameter Invalid");
} else {
HashMap<String, Object> ret = staffService.updateStaff(staff);
resp.setErrmessage("员工id为空,修改失败!");
}else if (phone==null||phone==""){
resp.setStatus(300);
resp.setErrmessage("电话为空,修改失败!");
}
else {
HashMap<String, Object> ret = staffService.updateStaff(vo);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);

@ -1,27 +1,21 @@
package com.yipin.liuwanr.controller;
import java.util.HashMap;
import java.util.List;
import com.yipin.liuwanr.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.yipin.liuwanr.entity.Response;
import com.yipin.liuwanr.entity.Student;
import com.yipin.liuwanr.entity.UserM;
import com.yipin.liuwanr.helper.RedisHelper;
import com.yipin.liuwanr.service.StudentService;
import com.yipin.liuwanr.service.UserService;
import com.yipin.liuwanr.vo.UserVO;
import org.apache.kafka.common.protocol.types.Field;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/student")
@ -105,29 +99,35 @@ public class StudentController {
* 查询学生
*/
@GetMapping("/queryStudent")
Response queryStudent(@RequestParam String searchContent,Integer pageNo,Integer pageSize,String professionalIds,String gradeIds,String classIds) {
Response queryStudent(@RequestParam Integer schoolId,String searchContent,Integer pageNo,Integer pageSize,String professionalIds,String gradeIds,String classIds) {
Response resp = new Response();
Student student = new Student();
if (searchContent!=null&&searchContent!="") {
student.setSearchContent(searchContent);
}
if (professionalIds!=null&&professionalIds!="") {
student.setProfessionalIds(professionalIds);
}
if (gradeIds!=null&&gradeIds!="") {
student.setGradeIds(gradeIds);
}
if (classIds!=null&&classIds!="") {
student.setClassIds(classIds);
}
HashMap<String, Object> ret = studentService.queryStudent(student,pageNo,pageSize);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
if (schoolId==null){
resp.setStatus(300);
resp.setErrmessage("学校id为空,查询失败!");
}else{
if (searchContent!=null&&searchContent!="") {
student.setSearchContent(searchContent);
}
if (professionalIds!=null&&professionalIds!="") {
student.setProfessionalIds(professionalIds);
}
if (gradeIds!=null&&gradeIds!="") {
student.setGradeIds(gradeIds);
}
if (classIds!=null&&classIds!="") {
student.setClassIds(classIds);
}
student.setSchoolId(schoolId);
HashMap<String, Object> ret = studentService.queryStudent(student,pageNo,pageSize);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
@ -140,7 +140,7 @@ public class StudentController {
Response resp = new Response();
if (studentId==null) {
resp.setStatus(300);
resp.setErrmessage("Parameter Invalid");
resp.setErrmessage("学生id为空,查询失败!");
}else {
HashMap<String, Object> ret = studentService.queryStudentDetails(studentId);
int status = (int) ret.get("retcode");
@ -159,20 +159,30 @@ public class StudentController {
* 删除学生
*/
@PostMapping("/deleteStudent")
Response deleteStudent(@RequestBody List<Integer> studentId) {
Response deleteStudent(@RequestBody List<Student> studentList) {
Response resp = new Response();
if (studentId==null) {
resp.setStatus(300);
resp.setErrmessage("Parameter Invalid");
} else {
HashMap<String, Object> ret = studentService.deleteStudent(studentId);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
int size = studentList.size();
for (int i=0;i<size;i++){
Student student = studentList.get(i);
Integer studentId = student.getStudentId();
String phone = student.getPhone();
if (studentId==null) {
resp.setStatus(300);
resp.setErrmessage("学生id为空,删除失败!");
}else if (phone == null || phone == ""){
resp.setStatus(300);
resp.setErrmessage("学生电话为空,删除失败!");
}
else {
HashMap<String, Object> ret = studentService.deleteStudent(studentId,phone);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
}
return resp;
@ -182,13 +192,20 @@ public class StudentController {
* 更新学生
*/
@PostMapping("/updateStudent")
Response updateStudent(@RequestBody Student student) {
Response updateStudent(@RequestBody UserVO vo) {
Response resp = new Response();
if (student==null) {
Student student = vo.getStudent();
UserM user = vo.getUser();
Integer studentId = student.getStudentId();
String phone = user.getPhone();
if (studentId==null) {
resp.setStatus(300);
resp.setErrmessage("Parameter Invalid");
resp.setErrmessage("学生id为空,修改失败!");
}else if (phone==null||phone==""){
resp.setStatus(300);
resp.setErrmessage("电话为空,修改失败!");
} else {
HashMap<String, Object> ret = studentService.updateStudent(student);
HashMap<String, Object> ret = studentService.updateStudent(vo);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);

@ -346,7 +346,7 @@ public class UserController {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
if (roleId ==3){
HashMap<String, Object> sta = staffService.updateStaff(staff);
HashMap<String, Object> sta = userService.updateStaff(staff);
int staStatus = (int) sta.get("retcode");
if (200 == status) {
resp.setStatus(staStatus);
@ -358,7 +358,7 @@ public class UserController {
}
}
if (roleId ==4){
HashMap<String, Object> stu = studentService.updateStudent(student);
HashMap<String, Object> stu = userService.updateStudent(student);
int stuStatus = (int) stu.get("retcode");
if (200 == status) {
resp.setStatus(stuStatus);

@ -8,7 +8,7 @@ public class ContractInformation {
//合同编号
private String contractInformationNumber;
//合同金额
private int contractInformationSum;
private String contractInformationSum;
//合同文件链接
private String contractInformationLink;
//绑定订单id
@ -38,10 +38,10 @@ public class ContractInformation {
public void setContractInformationNumber(String contractInformationNumber) {
this.contractInformationNumber = contractInformationNumber;
}
public int getContractInformationSum() {
public String getContractInformationSum() {
return contractInformationSum;
}
public void setContractInformationSum(int contractInformationSum) {
public void setContractInformationSum(String contractInformationSum) {
this.contractInformationSum = contractInformationSum;
}
public String getContractInformationLink() {

@ -16,7 +16,7 @@ public interface StaffMapper {
void addStaff(Staff staff);
@Select({"<script>",
"SELECT sta.uniqueIdentificationAccount,sta.staffId,sta.staffName,sta.staffWorkNumber,sta.phone,sta.email,sta.logNumber,sta.lastTimeOfLanding,sta.staffGradeId,sta.staffProfessionalArchitectureId,sta.roleId,gra.staffGradeName,pro.staffProfessionalArchitectureName from staff sta,staff_grade gra,staff_professional_architecture pro where sta.isdel = 0 and sta.staffGradeId = gra.staffGradeId and pro.staffProfessionalArchitectureId = sta.staffProfessionalArchitectureId and sta.roleId != 1 and sta.roleId !=2",
"SELECT sta.uniqueIdentificationAccount,sta.staffId,sta.staffName,sta.staffWorkNumber,sta.phone,sta.email,sta.logNumber,sta.lastTimeOfLanding,sta.staffGradeId,sta.staffProfessionalArchitectureId,sta.roleId,gra.staffGradeName,pro.staffProfessionalArchitectureName from staff sta,staff_grade gra,staff_professional_architecture pro where sta.isdel = 0 and sta.staffGradeId = gra.staffGradeId and pro.staffProfessionalArchitectureId = sta.staffProfessionalArchitectureId and sta.roleId != 1 and sta.roleId !=2 and sta.schoolId = #{schoolId}",
// " <if test='nameAndNumber!=null'> and sta.staffName like CONCAT('%',#{nameAndNumber},'%') or sta.staffWorkNumber like CONCAT('%',#{nameAndNumber},'%') GROUP BY sta.staffId</if>",
" <if test='nameAndNumber!=null'> and sta.staffName like CONCAT('%',#{nameAndNumber},'%')</if>",
" <if test='staffProfessionalArchitectureIds!=null'>and FIND_IN_SET(sta.staffProfessionalArchitectureId,#{staffProfessionalArchitectureIds})</if>",
@ -25,12 +25,14 @@ public interface StaffMapper {
List<Staff> queryStaff(Staff staff);
@Update({"<script>",
"UPDATE staff SET isdel = 1 where staffId in "
+ "<foreach collection = 'list' item='c' open='(' separator=',' close=')'>"
+ " #{c}"
+ "</foreach>",
"UPDATE staff SET isdel = 1 where staffId = #{staffId}",
"</script> "})
void deleteStaff(@Param("staffId")List<Integer> staffId);
void deleteStaff(Integer staffId);
@Update({"<script>",
"UPDATE user SET isdel = 1 where phone = #{phone}",
"</script> "})
void deleteUser(String phone);
@Select({"<script>",
"SELECT staffId,staffName,staffWorkNumber,phone,email,logNumber,lastTimeOfLanding,staffGradeId,staffProfessionalArchitectureId,roleId,uniqueIdentificationAccount,schoolId from staff where isdel = 0 and staffId = #{staffId}",
@ -53,10 +55,15 @@ public interface StaffMapper {
"</script> " })
List<UserM> queryStaffDetailsU(Integer staffId);
//修改员工
@Update("UPDATE staff SET staffName = #{staffName},staffWorkNumber = #{staffWorkNumber},phone = #{phone},email = #{email},staffProfessionalArchitectureId = #{staffProfessionalArchitectureId},"
+ "staffProfessionalArchitectureId = #{staffProfessionalArchitectureId},staffGradeId = #{staffGradeId},roleId = #{roleId} where staffId = #{staffId}")
void updateStaff(Staff staff);
//修改用户
@Update("UPDATE user SET phone = #{phone},name = #{name},userAccount = #{userAccount},workNumber = #{workNumber},provinceId = #{provinceId},cityId = #{cityId},email = #{email},schoolId = #{schoolId},uniqueIdentificationAccount = #{uniqueIdentificationAccount},disciplineId = #{disciplineId},professionalClassId = #{professionalClassId},professionalId = #{professionalId} where phone = #{phone}")
void updateUser(UserM user);
/**
* 得到所有未删除的部门信息
* @return

@ -19,7 +19,7 @@ public interface StudentMapper {
//查询学生
@Select({ "<script>",
"SELECT cla.className,t.loginNumber,t.lastLoginTime,t.uniqueIdentificationAccount,t.studentId,t.studentName,t.studentNumber,t.phone,t.email,t.roleId,t.schoolId,t.professionalId,t.gradeId,t.classId,t.experimentalClassId,(SELECT GROUP_CONCAT(c.experimentalClassName) FROM experimental_class_ning c WHERE FIND_IN_SET(c.experimentalClassId,t.experimentalClassId)) AS experimentName FROM student t,class cla WHERE t.isdel =0 and t.classId = cla.classId",
"SELECT cla.className,t.loginNumber,t.lastLoginTime,t.uniqueIdentificationAccount,t.studentId,t.studentName,t.studentNumber,t.phone,t.email,t.roleId,t.schoolId,t.professionalId,t.gradeId,t.classId,t.experimentalClassId,(SELECT GROUP_CONCAT(c.experimentalClassName) FROM experimental_class_ning c WHERE FIND_IN_SET(c.experimentalClassId,t.experimentalClassId)) AS experimentName FROM student t,class cla WHERE t.isdel =0 and t.classId = cla.classId and t.schoolId=#{schoolId}",
" <if test='searchContent!=null'> and t.studentName like CONCAT('%',#{searchContent},'%') or t.studentNumber like CONCAT('%',#{searchContent},'%')</if>",
" <if test='professionalIds!=null'> and FIND_IN_SET(t.professionalId,#{professionalIds})</if>",
" <if test='gradeIds!=null'> and FIND_IN_SET(t.gradeId,#{gradeIds}) </if>",
@ -30,10 +30,16 @@ public interface StudentMapper {
List<Student> getByStudents(Integer experimentalClassId);
//删除学生
@Update({ "<script>", "UPDATE student SET isdel = 1 where studentId in "
+ "<foreach collection = 'list' item='c' open='(' separator=',' close=')'>" + " #{c}" + "</foreach>",
@Update({ "<script>",
"UPDATE student SET isdel = 1 where studentId = #{studentId} ",
"</script> " })
void deleteStudent(@Param("studentId") List<Integer> studentId);
void deleteStudent(Integer studentId);
//删除用户
@Update({ "<script>",
"UPDATE user SET isdel = 1 where phone = #{phone} ",
"</script> " })
void deleteUser(String phone);
//查询学生详情
@Select({ "<script>",
@ -62,6 +68,10 @@ public interface StudentMapper {
+ ",schoolId = #{schoolId},professionalId = #{professionalId},gradeId = #{gradeId},classId = #{classId} where studentId = #{studentId}")
void updateStudent(Student student);
//修改用户
@Update("UPDATE user SET phone = #{phone},name = #{name},userAccount = #{userAccount},workNumber = #{workNumber},provinceId = #{provinceId},cityId = #{cityId},email = #{email},schoolId = #{schoolId},uniqueIdentificationAccount = #{uniqueIdentificationAccount} where phone = #{phone}")
void updateUser(UserM user);
//——————————————————————全承珠
// 查询出选中学生的考核状态
@Select({ "<script>",

@ -145,22 +145,31 @@ public interface UserMapper {
"</script>" })
void deleteStudent(UserM user);
//修改用户
@Update("UPDATE user SET name = #{name},sex = #{sex},documentType = #{documentType},countries = #{countries},educationDegree = #{educationDegree},"
+ "IDNumber = #{IDNumber},accountRole = #{accountRole},provinceId = #{provinceId},subjectsTaught = #{subjectsTaught},cityId = #{cityId},"
+ "phone = #{phone},teachingProfessional = #{teachingProfessional},WeChatID = #{WeChatID},dateBirth = #{dateBirth},email = #{email},schoolId = #{schoolId},disciplineId = #{disciplineId},professionalId = #{professionalId},professionalClassId = #{professionalClassId} where userId = #{userId}")
void updateUser(UserM user);
@Update("UPDATE user SET name = #{name},sex = #{sex},documentType = #{documentType},countries = #{countries},educationDegree = #{educationDegree},"
+ "IDNumber = #{IDNumber},accountRole = #{accountRole},provinceId = #{provinceId},subjectsTaught = #{subjectsTaught},cityId = #{cityId},"
+ "phone = #{phone},teachingProfessional = #{teachingProfessional},WeChatID = #{WeChatID},dateBirth = #{dateBirth},email = #{email},schoolId = #{schoolId},disciplineId = #{disciplineId},professionalId = #{professionalId},professionalClassId = #{professionalClassId} where userId = #{userId}")
//修改员工
@Update("UPDATE staff SET staffName = #{staffName},staffWorkNumber = #{staffWorkNumber},phone = #{phone},email = #{email},staffProfessionalArchitectureId = #{staffProfessionalArchitectureId},"
+ "staffProfessionalArchitectureId = #{staffProfessionalArchitectureId},staffGradeId = #{staffGradeId},roleId = #{roleId} where phone = #{phone}")
void updateStaff(Staff staff);
//修改学生
@Update("UPDATE student SET studentName = #{studentName},studentNumber = #{studentNumber},phone = #{phone},email = #{email},roleId = #{roleId}"
+ ",schoolId = #{schoolId},professionalId = #{professionalId},gradeId = #{gradeId},classId = #{classId} where phone = #{phone}")
void updateStudent(Student student);
//登陆
@Select("SELECT u.* from user u where isdel=0 and phone = #{phone} and password = #{password}")
UserM logins(UserM user);
//查询用户手机
@Select("SELECT u.* from user u where isdel=0 and phone = #{phone}")
List<UserM> queryPhone(String phone);
//查询用户详情
@Select({"<script>",
"SELECT u.*,schoolName from user u,school s where u.isdel = 0 and u.schoolId = s.schoolId and u.userId = #{userId}",
"</script> "})

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.yipin.liuwanr.vo.UserVO;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -142,15 +143,16 @@ public class StaffService {
return resp;
}
public HashMap<String, Object> deleteStaff(List<Integer> staffId){
public HashMap<String, Object> deleteStaff(Integer staffId,String phone){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
staffMapper.deleteStaff(staffId);
staffMapper.deleteUser(phone);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
resp.put("retvalue", "删除员工失败!");
return resp;
}
return resp;
@ -169,16 +171,20 @@ public class StaffService {
}
return resp;
}
public HashMap<String, Object> updateStaff(Staff staff){
//修改员工
public HashMap<String, Object> updateStaff(UserVO vo){
HashMap<String, Object> resp = new HashMap<String, Object>();
Staff staff = vo.getStaff();
UserM user = vo.getUser();
try {
staffMapper.updateStaff(staff);
staffMapper.updateUser(user);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
resp.put("retvalue", "修改员工失败!");
return resp;
}
return resp;

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.yipin.liuwanr.vo.UserVO;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -80,10 +81,11 @@ public class StudentService {
return resp;
}
public HashMap<String, Object> deleteStudent(List<Integer> studentId) {
public HashMap<String, Object> deleteStudent(Integer studentId,String phone) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
studentMapper.deleteStudent(studentId);
studentMapper.deleteUser(phone);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
@ -108,10 +110,13 @@ public class StudentService {
return resp;
}
public HashMap<String, Object> updateStudent(Student student) {
public HashMap<String, Object> updateStudent(UserVO vo) {
HashMap<String, Object> resp = new HashMap<String, Object>();
Student student = vo.getStudent();
UserM user = vo.getUser();
try {
studentMapper.updateStudent(student);
studentMapper.updateUser(user);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());

@ -231,6 +231,38 @@ public class UserService {
return resp;
}
//更新用户
@Transactional
public HashMap<String, Object> updateStudent(Student student){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
userMapper.updateStudent(student);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "更新学生失败!");
throw new RuntimeException();
}
return resp;
}
//更新用户
@Transactional
public HashMap<String, Object> updateStaff(Staff staff){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
userMapper.updateStaff(staff);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "更新员工失败!");
throw new RuntimeException();
}
return resp;
}
//登陆
public HashMap<String, Object> logins(UserM userM){
HashMap<String, Object> resp = new HashMap<String, Object>();

Loading…
Cancel
Save