修复用户城市bug

master
zhiyong.ning 4 years ago
parent fdc8a892a9
commit 44c35d8a31
  1. 83
      src/main/java/com/yipin/liuwanr/controller/CourseController.java
  2. 7
      src/main/java/com/yipin/liuwanr/controller/CustomerController.java
  3. 48
      src/main/java/com/yipin/liuwanr/controller/StaffController.java
  4. 44
      src/main/java/com/yipin/liuwanr/controller/StudentController.java
  5. 136
      src/main/java/com/yipin/liuwanr/controller/UserController.java
  6. 14
      src/main/java/com/yipin/liuwanr/entity/Course.java
  7. 20
      src/main/java/com/yipin/liuwanr/entity/CoursePermissions.java
  8. 4
      src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java
  9. 14
      src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java
  10. 6
      src/main/java/com/yipin/liuwanr/mapper/StudentMapper.java
  11. 36
      src/main/java/com/yipin/liuwanr/mapper/UserMapper.java
  12. 30
      src/main/java/com/yipin/liuwanr/service/CourseService.java
  13. 79
      src/main/java/com/yipin/liuwanr/service/UserService.java
  14. 61
      src/main/java/com/yipin/liuwanr/vo/UserVO.java

@ -41,33 +41,52 @@ public class CourseController {
Response resp = new Response(); Response resp = new Response();
Course course = vo.getCourse(); Course course = vo.getCourse();
List<ServiceConfig> serviceConfigList = vo.getServiceConfigList(); List<ServiceConfig> serviceConfigList = vo.getServiceConfigList();
if (course.getCourseName()==null||course.getCourseName().length()<=0) { //课程名称
String courseName = course.getCourseName();
//课程类型
Integer courseType = course.getCourseType();
//学科类型id
Integer disciplineId = course.getDisciplineId();
//专业类id
Integer professionalClassId = course.getProfessionalClassId();
//专业id
Integer professionalId = course.getProfessionalId();
//市场价格
double marketPrice = course.getMarketPrice();
Double price =new Double(marketPrice);
//课程简介
String CourseIntroduction = course.getCourseIntroduction();
//教学目标
String TeachingGoal = course.getTeachingGoal();
//绑定系统id
String SystemId = course.getSystemId();
if (courseName==null||courseName=="") {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("Course Name Is Null!"); resp.setErrmessage("课程名称为空!");
}else if(course.getCourseType()==null){ }else if(courseType==null){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("Course Type Is Null!"); resp.setErrmessage("课程类型为空!");
}else if(course.getDisciplineId()==null){ }else if(course.getDisciplineId()==null){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("DisciplineId Type Is Null!"); resp.setErrmessage("学科类别为空!");
}else if(course.getProfessionalClassId()==null){ }else if(professionalClassId==null){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("ProfessionalId Class Is Null!"); resp.setErrmessage("专业类为空!");
}else if(course.getProfessionalId()==null){ }else if(professionalId==null){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("ProfessionalId Is Null!"); resp.setErrmessage("专业为空!");
}else if(course.getMarketPrice()==null||course.getMarketPrice().length()<=0){ }else if(price==null){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("Market Price Is Null!"); resp.setErrmessage("市场价格为空!");
}else if(course.getCourseIntroduction()==null||course.getCourseIntroduction().length()<=0){ }else if(CourseIntroduction==null||CourseIntroduction==""){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("Course Introduction Is Null!"); resp.setErrmessage("课程简介为空!");
}else if(course.getTeachingGoal()==null||course.getTeachingGoal().length()<=0){ }else if(TeachingGoal==null||TeachingGoal==""){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("Teaching Goal Is Null!"); resp.setErrmessage("教学目标为空!");
}else if(course.getSystemId()==null||course.getSystemId()==""){ }else if(SystemId==null||SystemId==""){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("SystemId Is Null!"); resp.setErrmessage("绑定系统id为空!");
}else { }else {
HashMap<String, Object> ret = courseService.addCourse(course); HashMap<String, Object> ret = courseService.addCourse(course);
Integer courseId = (Integer) ret.get("retvalue"); Integer courseId = (Integer) ret.get("retvalue");
@ -81,8 +100,11 @@ public class CourseController {
HashMap<String, Object> retPC = courseService.addCoursePC(serviceConfigList); HashMap<String, Object> retPC = courseService.addCoursePC(serviceConfigList);
int statusPC = (int) retPC.get("retcode"); int statusPC = (int) retPC.get("retcode");
if (statusPC == 200) { if (statusPC == 200) {
resp.setStatus(status); resp.setStatus(statusPC);
resp.setMessage(ret.get("retvalue")); resp.setMessage(retPC.get("retvalue"));
}else{
resp.setStatus(statusPC);
resp.setErrmessage(retPC.get("retvalue").toString());
} }
} else { } else {
resp.setStatus(status); resp.setStatus(status);
@ -92,6 +114,29 @@ public class CourseController {
return resp; return resp;
} }
/**
* 查询课程名称是否存在
*/
@GetMapping("/queryCourseNameIsExists")
Response queryCourseNameIsExists(@RequestParam String courseName) {
Response resp = new Response();
if (courseName==null||courseName=="") {
resp.setStatus(300);
resp.setErrmessage("课程名称为空!");
}else {
HashMap<String, Object> ret = courseService.queryCourseNameIsExists(courseName);
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;
}
/** /**
* 查询课程 * 查询课程
*/ */

@ -194,11 +194,7 @@ public class CustomerController {
resp.setErrmessage("学校不能为空!"); resp.setErrmessage("学校不能为空!");
}else { }else {
HashMap<String, Object> ret = customerService.queryCustomerIsExists(schoolId); HashMap<String, Object> ret = customerService.queryCustomerIsExists(schoolId);
if (ret.isEmpty()) { int status = (int) ret.get("retcode");
resp.setStatus(300);
resp.setErrmessage("该客户已存在!");
}else {
int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
@ -207,7 +203,6 @@ public class CustomerController {
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
} }
}
return resp; return resp;
} }
/** /**

@ -3,7 +3,9 @@ package com.yipin.liuwanr.controller;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import com.yipin.liuwanr.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -58,36 +60,48 @@ public class StaffController {
/** /**
* 添加员工 * 添加员工
*/ */
@Transactional
@PostMapping("/addStaff") @PostMapping("/addStaff")
Response addCustomer(@RequestBody Staff staff) { Response addCustomer(@RequestBody UserVO vo) {
Response resp = new Response(); Response resp = new Response();
UserM user = new UserM(); Staff staff = vo.getStaff();
user.setPassword("huoran123"); UserM user = vo.getUser();
user.setWorkNumber(staff.getStaffWorkNumber()); // user.setPassword("huoran123");
user.setUserAccount(staff.getStaffWorkNumber()); // user.setWorkNumber(staff.getStaffWorkNumber());
user.setAccountRole(3); // user.setUserAccount(staff.getStaffWorkNumber());
user.setName(staff.getStaffName()); // user.setAccountRole(3);
user.setPhone(staff.getPhone()); // user.setName(staff.getStaffName());
user.setEmail(staff.getEmail()); // user.setPhone(staff.getPhone());
user.setSchoolId(staff.getSchoolId()); // user.setEmail(staff.getEmail());
Long startTs = System.currentTimeMillis(); // 当前时间戳 // user.setSchoolId(staff.getSchoolId());
String uniqueIdentificationAccount = startTs+""; // Long startTs = System.currentTimeMillis(); // 当前时间戳
user.setUniqueIdentificationAccount(uniqueIdentificationAccount); // String uniqueIdentificationAccount = startTs+"";
staff.setUniqueIdentificationAccount(uniqueIdentificationAccount); // user.setUniqueIdentificationAccount(uniqueIdentificationAccount);
user.setUniqueIdentificationAccount(staff.getUniqueIdentificationAccount()); // staff.setUniqueIdentificationAccount(uniqueIdentificationAccount);
// user.setUniqueIdentificationAccount(staff.getUniqueIdentificationAccount());
if (staff.getPhone()==null) { if (staff.getPhone()==null) {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("Parameter Invalid"); resp.setErrmessage("电话为空添加失败!");
} else { } else {
HashMap<String, Object> ret = staffService.addStaff(staff); HashMap<String, Object> ret = staffService.addStaff(staff);
HashMap<String, Object> ret1 = userService.addUser(user);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
HashMap<String, Object> ret1 = userService.addUser(user);
int status1 = (int) ret1.get("retcode");
if (status1 == 200){
resp.setStatus(status1);
resp.setMessage(ret1.get("retvalue"));
}else{
resp.setStatus(status1);
resp.setErrmessage(ret1.get("retvalue").toString());
throw new RuntimeException();
}
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
throw new RuntimeException();
} }
} }
return resp; return resp;

@ -3,7 +3,9 @@ package com.yipin.liuwanr.controller;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import com.yipin.liuwanr.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -65,35 +67,47 @@ public class StudentController {
/** /**
* 添加学生 * 添加学生
*/ */
@Transactional
@PostMapping("/addStudent") @PostMapping("/addStudent")
Response addStudent(@RequestBody Student student) { Response addStudent(@RequestBody UserVO vo) {
Response resp = new Response(); Response resp = new Response();
UserM user = new UserM(); Student student = vo.getStudent();
user.setPassword("huoran123"); UserM user = vo.getUser();
user.setPassword(student.getStudentPassword()); // user.setPassword("huoran123");
user.setUserAccount(student.getStudentNumber()); // user.setPassword(student.getStudentPassword());
user.setAccountRole(4); // user.setUserAccount(student.getStudentNumber());
user.setName(student.getStudentName()); // user.setAccountRole(4);
user.setPhone(student.getPhone()); // user.setName(student.getStudentName());
user.setEmail(student.getEmail()); // user.setPhone(student.getPhone());
user.setWorkNumber(student.getStudentNumber()); // user.setEmail(student.getEmail());
Long startTs = System.currentTimeMillis(); // 当前时间戳 // user.setWorkNumber(student.getStudentNumber());
String uniqueIdentificationAccount = startTs+""; // Long startTs = System.currentTimeMillis(); // 当前时间戳
user.setUniqueIdentificationAccount(uniqueIdentificationAccount); // String uniqueIdentificationAccount = startTs+"";
student.setUniqueIdentificationAccount(uniqueIdentificationAccount); // user.setUniqueIdentificationAccount(uniqueIdentificationAccount);
// student.setUniqueIdentificationAccount(uniqueIdentificationAccount);
if (student.getPhone()==null) { if (student.getPhone()==null) {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("Parameter Invalid"); resp.setErrmessage("Parameter Invalid");
} else { } else {
HashMap<String, Object> ret = studentService.addStudent(student); HashMap<String, Object> ret = studentService.addStudent(student);
HashMap<String, Object> ret1 = userService.addUser(user);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
HashMap<String, Object> ret1 = userService.addUser(user);
int status1 = (int)ret.get("retcode");
if (status1 == 200){
resp.setStatus(status1);
resp.setMessage(ret1.get("retvalue"));
}else {
resp.setStatus(status1);
resp.setErrmessage(ret1.get("retvalue").toString());
throw new RuntimeException();
}
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
throw new RuntimeException();
} }
} }
return resp; return resp;

@ -1,27 +1,22 @@
package com.yipin.liuwanr.controller; package com.yipin.liuwanr.controller;
import java.util.HashMap; import com.yipin.liuwanr.entity.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestHeader;
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.Response;
import com.yipin.liuwanr.entity.User;
import com.yipin.liuwanr.entity.UserM;
import com.yipin.liuwanr.helper.PushHelper; import com.yipin.liuwanr.helper.PushHelper;
import com.yipin.liuwanr.helper.RandomUtil; import com.yipin.liuwanr.helper.RandomUtil;
import com.yipin.liuwanr.helper.RedisHelper; import com.yipin.liuwanr.helper.RedisHelper;
import com.yipin.liuwanr.service.StaffService;
import com.yipin.liuwanr.service.StudentService;
import com.yipin.liuwanr.service.UserService; import com.yipin.liuwanr.service.UserService;
import com.yipin.liuwanr.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
@RestController @RestController
@RequestMapping("/user") @RequestMapping("/user")
@ -30,6 +25,12 @@ public class UserController {
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired
private StudentService studentService;
@Autowired
private StaffService staffService;
@Autowired @Autowired
RedisHelper redisHelper; RedisHelper redisHelper;
@ -96,12 +97,42 @@ public class UserController {
return resp; return resp;
} }
/**
* 查询电话
*/
@GetMapping("/queryPhone")
Response queryPhone(@RequestParam String phone) {
Response resp = new Response();
if (phone==null||phone=="") {//前台传来的值是否为空
resp.setStatus(300);
resp.setErrmessage("手机号为空!查询失败!");
}else {
HashMap<String, Object> ret = userService.queryPhone(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;
}
/** /**
* 添加用户 * 添加用户
*/ */
@Transactional
@PostMapping("/addUser") @PostMapping("/addUser")
Response addUser(@RequestBody UserM user) { Response addUser(@RequestBody UserVO vo) {
Response resp = new Response(); Response resp = new Response();
//用户实体
UserM user = vo.getUser();
//学生实体
Student student = vo.getStudent();
//员工实体
Staff staff = vo.getStaff();
//用户手机号 //用户手机号
String phone = user.getPhone(); String phone = user.getPhone();
//用户名称 //用户名称
@ -133,21 +164,39 @@ public class UserController {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("学校不能为空!"); resp.setErrmessage("学校不能为空!");
}else { }else {
HashMap<String, Object> ret1 = userService.queryPhone(phone); if (accountRole == 4){
int status1 = (int) ret1.get("retcode"); HashMap<String, Object> stu = studentService.addStudent(student);
if (status1==200){ int status = (int) stu.get("retcode");
HashMap<String, Object> ret = userService.addUser(user); if (status == 200){
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(stu.get("retvalue"));
} else { }else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(stu.get("retvalue").toString());
throw new RuntimeException();
} }
}else{ }
resp.setStatus(status1); if(accountRole == 3){
resp.setErrmessage(ret1.get("retvalue").toString()); HashMap<String, Object> sta = staffService.addStaff(staff);
int status = (int) sta.get("retcode");
if (status == 200){
resp.setStatus(status);
resp.setMessage(sta.get("retvalue"));
}else {
resp.setStatus(status);
resp.setErrmessage(sta.get("retvalue").toString());
throw new RuntimeException();
}
}
HashMap<String, Object> ret = userService.addUser(user);
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());
throw new RuntimeException();
} }
} }
return resp; return resp;
@ -358,4 +407,31 @@ public class UserController {
} }
return resp; return resp;
} }
/**
* 用户模块查询客户
*/
@GetMapping("/queryCustomer")
Response queryCustomer(@RequestParam Integer cityId,Integer provinceId) {
Response resp = new Response();
if(provinceId == null){
resp.setStatus(300);
resp.setErrmessage("省份id为空!查询失败!");
}else if (cityId==null) {
resp.setStatus(300);
resp.setErrmessage("城市id为空!查询失败!");
}else {
HashMap<String, Object> ret = userService.queryCustomer(cityId,provinceId);
resp.setStatus(200);
resp.setErrmessage("查询成功!");
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;
}
} }

@ -16,7 +16,7 @@ public class Course {
//预计课时 //预计课时
private Integer courseHours; private Integer courseHours;
//市场价格 //市场价格
private String marketPrice; private double marketPrice;
//课程简介 //课程简介
private String courseIntroduction; private String courseIntroduction;
//教学目标 //教学目标
@ -98,12 +98,6 @@ public class Course {
public void setCourseHours(Integer courseHours) { public void setCourseHours(Integer courseHours) {
this.courseHours = courseHours; this.courseHours = courseHours;
} }
public String getMarketPrice() {
return marketPrice;
}
public void setMarketPrice(String marketPrice) {
this.marketPrice = marketPrice;
}
public String getCourseIntroduction() { public String getCourseIntroduction() {
return courseIntroduction; return courseIntroduction;
} }
@ -122,4 +116,10 @@ public class Course {
public void setSearchContent(String searchContent) { public void setSearchContent(String searchContent) {
this.searchContent = searchContent; this.searchContent = searchContent;
} }
public double getMarketPrice() {
return marketPrice;
}
public void setMarketPrice(double marketPrice) {
this.marketPrice = marketPrice;
}
} }

@ -8,9 +8,9 @@ public class CoursePermissions {
//使用期限 //使用期限
private Integer usePeriod; private Integer usePeriod;
//市场价 //市场价
private String marketPrice; private double marketPrice;
//交易价格 //交易价格
private Integer transactionPrice; private double transactionPrice;
//折扣率 //折扣率
private Integer discount; private Integer discount;
//绑定端口地址id //绑定端口地址id
@ -26,6 +26,12 @@ public class CoursePermissions {
//到期时间 //到期时间
private String expirationTime; private String expirationTime;
public double getTransactionPrice() {
return transactionPrice;
}
public void setTransactionPrice(double transactionPrice) {
this.transactionPrice = transactionPrice;
}
public String getExpirationTime() { public String getExpirationTime() {
return expirationTime; return expirationTime;
} }
@ -50,18 +56,12 @@ public class CoursePermissions {
public void setUsePeriod(Integer usePeriod) { public void setUsePeriod(Integer usePeriod) {
this.usePeriod = usePeriod; this.usePeriod = usePeriod;
} }
public String getMarketPrice() { public double getMarketPrice() {
return marketPrice; return marketPrice;
} }
public void setMarketPrice(String marketPrice) { public void setMarketPrice(double marketPrice) {
this.marketPrice = marketPrice; this.marketPrice = marketPrice;
} }
public Integer getTransactionPrice() {
return transactionPrice;
}
public void setTransactionPrice(Integer transactionPrice) {
this.transactionPrice = transactionPrice;
}
public Integer getDiscount() { public Integer getDiscount() {
return discount; return discount;
} }

@ -93,7 +93,7 @@ public interface AssesmentMapper {
* *
* @param assesment * @param assesment
*/ */
@Update("update assessment set assesmentName=#{assesmentName},releaseType=#{releaseType},creationTime=#{creationTime},endTime=#{endTime},timesum=#{timesum},assessmentSize=#{assessmentSize},assessmentNumber=#{assessmentNumber}" @Update("update assessment set assesmentName=#{assesmentName},releaseType=#{releaseType},creationTime=#{creationTime},endTime=#{endTime},timesum=#{timesum},assessmentSize=#{assessmentSize},assessmentNumber=#{assessmentNumber},"
+ "experimentId=#{experimentId},assesmentState=#{assesmentState},classId=#{classId},experimentalClassId=#{experimentalClassId} where id=#{id}") + "experimentId=#{experimentId},assesmentState=#{assesmentState},classId=#{classId},experimentalClassId=#{experimentalClassId} where id=#{id}")
void updateAssesment(Assesment assesment); void updateAssesment(Assesment assesment);
@ -197,7 +197,7 @@ public interface AssesmentMapper {
* @param creationTime * @param creationTime
* @return * @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}) and schoolId={schoolId} ") @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({ @Results({
@Result(id = true, column = "experimentalClassId", property = "experimentalClassId"), @Result(id = true, column = "experimentalClassId", property = "experimentalClassId"),
@Result(column = "experimentalClassName", property = "experimentalClassName"), @Result(column = "experimentalClassName", property = "experimentalClassName"),

@ -71,6 +71,11 @@ public interface CourseMapper {
}) })
List<CourseVO> queryCourseDetails(Integer courseId); List<CourseVO> queryCourseDetails(Integer courseId);
@Select({"<script>",
"SELECT courseId,courseName from course where isdel = 0 and courseName = #{courseName}",
"</script> "})
List<Course> queryCourseNameIsExists(String courseName);
@Select({"<script>", @Select({"<script>",
"SELECT courseId,courseName,courseType,disciplineId,professionalClassId,professionalId,courseHours,marketPrice,courseIntroduction,teachingGoal,systemId,isShelves from course where isdel = 0 and courseId = #{courseId}", "SELECT courseId,courseName,courseType,disciplineId,professionalClassId,professionalId,courseHours,marketPrice,courseIntroduction,teachingGoal,systemId,isShelves from course where isdel = 0 and courseId = #{courseId}",
"</script> "}) "</script> "})
@ -86,6 +91,7 @@ public interface CourseMapper {
"</script> "}) "</script> "})
Order queryOrderDetailsO(Integer orderId); Order queryOrderDetailsO(Integer orderId);
//删除课程
@Update({"<script>", @Update({"<script>",
"UPDATE course SET isdel = 1 where courseId in " "UPDATE course SET isdel = 1 where courseId in "
+ "<foreach collection = 'list' item='c' open='(' separator=',' close=')'>" + "<foreach collection = 'list' item='c' open='(' separator=',' close=')'>"
@ -94,26 +100,32 @@ public interface CourseMapper {
"</script> "}) "</script> "})
void deleteCourse(@Param("courseId")List<Integer> courseId); void deleteCourse(@Param("courseId")List<Integer> courseId);
//修改课程
@Update("UPDATE course SET courseName = #{courseName},courseType = #{courseType},disciplineId = #{disciplineId},professionalClassId = #{professionalClassId},professionalId = #{professionalId}," @Update("UPDATE course SET courseName = #{courseName},courseType = #{courseType},disciplineId = #{disciplineId},professionalClassId = #{professionalClassId},professionalId = #{professionalId},"
+ "courseHours = #{courseHours},marketPrice = #{marketPrice},courseIntroduction = #{courseIntroduction},teachingGoal = #{teachingGoal},systemId = #{systemId} where courseId = #{courseId}") + "courseHours = #{courseHours},marketPrice = #{marketPrice},courseIntroduction = #{courseIntroduction},teachingGoal = #{teachingGoal},systemId = #{systemId} where courseId = #{courseId}")
void updateCourse(Course course); void updateCourse(Course course);
//修改课程实训配置
@Update("UPDATE hr_course_tc SET systemId = #{systemId},projectId = #{projectId},isShow = #{isShow} where courseId = #{courseId} and systemId = #{systemId} and projectId = #{projectId}") @Update("UPDATE hr_course_tc SET systemId = #{systemId},projectId = #{projectId},isShow = #{isShow} where courseId = #{courseId} and systemId = #{systemId} and projectId = #{projectId}")
void updateCoursePC(ServiceConfig serviceConfig); void updateCoursePC(ServiceConfig serviceConfig);
//删除课程实训配置
@Delete("Delete FROM hr_course_tc where courseId = #{courseId}") @Delete("Delete FROM hr_course_tc where courseId = #{courseId}")
void deleteCoursePC(Integer courseId); void deleteCoursePC(Integer courseId);
//查询课程学科
@Select({"<script>", @Select({"<script>",
"SELECT disciplineId,disciplineName,disciplineLevelId from discipline", "SELECT disciplineId,disciplineName,disciplineLevelId from discipline",
"</script> "}) "</script> "})
List<Discipline> queryCourseDiscipline(); List<Discipline> queryCourseDiscipline();
//查询课程专业类
@Select({"<script>", @Select({"<script>",
"SELECT professionalClassId,professionalClassName,disciplineId from professional_class where disciplineId = #{disciplineId}", "SELECT professionalClassId,professionalClassName,disciplineId from professional_class where disciplineId = #{disciplineId}",
"</script> "}) "</script> "})
List<ProfessionalClass> queryCourseProfessionalClass(Integer disciplineId); List<ProfessionalClass> queryCourseProfessionalClass(Integer disciplineId);
//查询课程专业
@Select({"<script>", @Select({"<script>",
"SELECT professionalId,professionalName,professionalClassId from professional where professionalClassId = #{professionalClassId}", "SELECT professionalId,professionalName,professionalClassId from professional where professionalClassId = #{professionalClassId}",
"</script> "}) "</script> "})
@ -174,7 +186,7 @@ public interface CourseMapper {
//查询配置 //查询配置
@Select({"<script>", @Select({"<script>",
"SELECT sc.systemId,sc.systemName,pm.projectId,pm.projectName FROM service_config sc,hr_project_management pm WHERE pm.systemId = sc.systemId and FIND_IN_SET(sc.systemId,#{systemId})", "SELECT sc.systemId,sc.systemName,pm.projectId,pm.projectName FROM service_config sc,hr_project_management pm WHERE pm.systemId = sc.systemId and FIND_IN_SET(sc.systemId,#{systemId}) and pm.projectPermissions = 0 and pm.isdel = 0",
"</script> "}) "</script> "})
List<ServiceConfig> queryConfig(String systemId); List<ServiceConfig> queryConfig(String systemId);

@ -13,10 +13,12 @@ import io.lettuce.core.dynamic.annotation.Param;
public interface StudentMapper { public interface StudentMapper {
//添加学生
@Insert("INSERT INTO student(studentName,studentNumber,phone,email,roleId,schoolId,professionalId,gradeId,classId,isdel,uniqueIdentificationAccount)" @Insert("INSERT INTO student(studentName,studentNumber,phone,email,roleId,schoolId,professionalId,gradeId,classId,isdel,uniqueIdentificationAccount)"
+ "VALUES(#{studentName},#{studentNumber},#{phone},#{email},#{roleId},#{schoolId},#{professionalId},#{gradeId},#{classId},0,#{uniqueIdentificationAccount})") + "VALUES(#{studentName},#{studentNumber},#{phone},#{email},#{roleId},#{schoolId},#{professionalId},#{gradeId},#{classId},0,#{uniqueIdentificationAccount})")
void addStudent(Student student); void addStudent(Student student);
//查询学生
@Select({ "<script>", @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",
" <if test='searchContent!=null'> and t.studentName like CONCAT('%',#{searchContent},'%') or t.studentNumber like CONCAT('%',#{searchContent},'%')</if>", " <if test='searchContent!=null'> and t.studentName like CONCAT('%',#{searchContent},'%') or t.studentNumber like CONCAT('%',#{searchContent},'%')</if>",
@ -28,17 +30,19 @@ public interface StudentMapper {
@Select("select s.studentId,studentName from experimental_class_student ecs left join student s on ecs.studentId=s.studentId where ecs.experimentalClassId=#{experimentalClassId} ") @Select("select s.studentId,studentName from experimental_class_student ecs left join student s on ecs.studentId=s.studentId where ecs.experimentalClassId=#{experimentalClassId} ")
List<Student> getByStudents(Integer experimentalClassId); List<Student> getByStudents(Integer experimentalClassId);
//删除学生
@Update({ "<script>", "UPDATE student SET isdel = 1 where studentId in " @Update({ "<script>", "UPDATE student SET isdel = 1 where studentId in "
+ "<foreach collection = 'list' item='c' open='(' separator=',' close=')'>" + " #{c}" + "</foreach>", + "<foreach collection = 'list' item='c' open='(' separator=',' close=')'>" + " #{c}" + "</foreach>",
"</script> " }) "</script> " })
void deleteStudent(@Param("studentId") List<Integer> studentId); void deleteStudent(@Param("studentId") List<Integer> studentId);
//查询学生详情
@Select({ "<script>", @Select({ "<script>",
"SELECT uniqueIdentificationAccount,studentName,studentNumber,phone,email,roleId,schoolId,professionalId,gradeId,classId from student where isdel = 0 and studentId = #{studentId}", "SELECT uniqueIdentificationAccount,studentName,studentNumber,phone,email,roleId,schoolId,professionalId,gradeId,classId from student where isdel = 0 and studentId = #{studentId}",
"</script> " }) "</script> " })
List<Student> queryStudentDetails(Integer studentId); List<Student> queryStudentDetails(Integer studentId);
//修改学生
@Update("UPDATE student SET studentName = #{studentName},studentWorkNumber = #{studentWorkNumber},phone = #{phone},email = #{email},roleId = #{roleId}" @Update("UPDATE student SET studentName = #{studentName},studentWorkNumber = #{studentWorkNumber},phone = #{phone},email = #{email},roleId = #{roleId}"
+ ",schoolId = #{schoolId},professionalId = #{professionalId},gradeId = #{gradeId},classId = #{classId} where studentId = #{studentId}") + ",schoolId = #{schoolId},professionalId = #{professionalId},gradeId = #{gradeId},classId = #{classId} where studentId = #{studentId}")
void updateStudent(Student student); void updateStudent(Student student);

@ -1,21 +1,10 @@
package com.yipin.liuwanr.mapper; package com.yipin.liuwanr.mapper;
import java.util.List; import com.yipin.liuwanr.entity.*;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.mapping.FetchType; import org.apache.ibatis.mapping.FetchType;
import com.yipin.liuwanr.entity.Config; import java.util.List;
import com.yipin.liuwanr.entity.Demo;
import com.yipin.liuwanr.entity.User;
import com.yipin.liuwanr.entity.UserM;
import org.apache.ibatis.annotations.Param;
public interface UserMapper { public interface UserMapper {
@ -108,10 +97,20 @@ public interface UserMapper {
+ "#{settlement},#{open},#{high},#{low},#{volume},#{amount},#{ticktime},#{per},#{pb},#{mktcap},#{nmc},#{turnoverratio}) ") + "#{settlement},#{open},#{high},#{low},#{volume},#{amount},#{ticktime},#{per},#{pb},#{mktcap},#{nmc},#{turnoverratio}) ")
void insertDemo(Demo demo); void insertDemo(Demo demo);
@Insert("INSERT INTO user(name,password,sex,documentType,countries,educationDegree,IDNumber,accountRole,provinceId,subjectsTaught,cityId,phone,teachingProfessional,WeChatID,dateBirth,email,creationTime,isdel,schoolId,uniqueIdentificationAccount,disciplineId,professionalClassId,professionalId)" @Insert("INSERT INTO user(name,password,sex,documentType,countries,educationDegree,IDNumber,accountRole,provinceId,subjectsTaught,cityId,phone,teachingProfessional,WeChatID,dateBirth,email,creationTime,isdel,schoolId,uniqueIdentificationAccount,disciplineId,professionalClassId,professionalId,userAccount,workNumber)"
+ " VALUES(#{name},#{password},#{sex},#{documentType},#{countries},#{educationDegree},#{IDNumber},#{accountRole},#{provinceId},#{subjectsTaught},#{cityId},#{phone},#{teachingProfessional},#{WeChatID},#{dateBirth},#{email},now(),0,#{schoolId},#{uniqueIdentificationAccount},#{disciplineId},#{professionalClassId},#{professionalId})") + " VALUES(#{name},#{password},#{sex},#{documentType},#{countries},#{educationDegree},#{IDNumber},#{accountRole},#{provinceId},#{subjectsTaught},#{cityId},#{phone},#{teachingProfessional},#{WeChatID},#{dateBirth},#{email},now(),0,#{schoolId},#{uniqueIdentificationAccount},#{disciplineId},#{professionalClassId},#{professionalId},#{userAccount},#{workNumber})")
void addUser(UserM user); void addUser(UserM user);
// //添加学生
// @Insert("INSERT INTO student(name,password,sex,documentType,countries,educationDegree,IDNumber,accountRole,provinceId,subjectsTaught,cityId,phone,teachingProfessional,WeChatID,dateBirth,email,creationTime,isdel,schoolId,uniqueIdentificationAccount,disciplineId,professionalClassId,professionalId)"
// + " VALUES(#{name},#{password},#{sex},#{documentType},#{countries},#{educationDegree},#{IDNumber},#{accountRole},#{provinceId},#{subjectsTaught},#{cityId},#{phone},#{teachingProfessional},#{WeChatID},#{dateBirth},#{email},now(),0,#{schoolId},#{uniqueIdentificationAccount},#{disciplineId},#{professionalClassId},#{professionalId})")
// void addStudent(Student student);
//
// //添加员工
// @Insert("INSERT INTO staff(name,password,sex,documentType,countries,educationDegree,IDNumber,accountRole,provinceId,subjectsTaught,cityId,phone,teachingProfessional,WeChatID,dateBirth,email,creationTime,isdel,schoolId,uniqueIdentificationAccount,disciplineId,professionalClassId,professionalId)"
// + " VALUES(#{name},#{password},#{sex},#{documentType},#{countries},#{educationDegree},#{IDNumber},#{accountRole},#{provinceId},#{subjectsTaught},#{cityId},#{phone},#{teachingProfessional},#{WeChatID},#{dateBirth},#{email},now(),0,#{schoolId},#{uniqueIdentificationAccount},#{disciplineId},#{professionalClassId},#{professionalId})")
// void addStaff(Staff staff);
// @Select("SELECT * from user where isdel = 1 and countries = #{countries} and provinces = #{provinces} and city = #{city}") // @Select("SELECT * from user where isdel = 1 and countries = #{countries} and provinces = #{provinces} and city = #{city}")
@Select({"<script>", @Select({"<script>",
"SELECT u.*,s.schoolName,p.provinceName,c.cityName from user u,school s,province p,city c where u.isdel = 0 and p.provinceId = u.provinceId and p.provinceId = c.provinceId and u.cityId = c.cityId and u.schoolId = s.schoolId", "SELECT u.*,s.schoolName,p.provinceName,c.cityName from user u,school s,province p,city c where u.isdel = 0 and p.provinceId = u.provinceId and p.provinceId = c.provinceId and u.cityId = c.cityId and u.schoolId = s.schoolId",
@ -155,6 +154,11 @@ public interface UserMapper {
"</script> "}) "</script> "})
List<UserM> queryUserDetails(Integer userId); List<UserM> queryUserDetails(Integer userId);
@Select({"<script>",
"SELECT customerId,customerName,schoolId FROM customer where isdel = 0 and provinceId = #{provinceId} and cityId = #{cityId}",
"</script> "})
List<Customer> queryCustomer(Integer cityId,Integer provinceId);
/** /**
* 批量插入用户 * 批量插入用户
* @param user * @param user

@ -114,7 +114,22 @@ public class CourseService {
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "查询课程详情失败!");
return resp;
}
return resp;
}
//查询课程名称是否存在
public HashMap<String, Object> queryCourseNameIsExists(String courseName){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", courseMapper.queryCourseNameIsExists(courseName));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "查询课程名称失败!");
return resp; return resp;
} }
return resp; return resp;
@ -145,12 +160,13 @@ public class CourseService {
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "查询课程详情课程权限失败!");
return resp; return resp;
} }
return resp; return resp;
} }
//删除课程
public HashMap<String, Object> deleteCourse(List<Integer> courseId){ public HashMap<String, Object> deleteCourse(List<Integer> courseId){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
@ -159,12 +175,12 @@ public class CourseService {
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "删除课程失败!");
return resp; return resp;
} }
return resp; return resp;
} }
//更新课程
public HashMap<String, Object> updateCourse(Course course){ public HashMap<String, Object> updateCourse(Course course){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
@ -173,12 +189,12 @@ public class CourseService {
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "更新课程失败!");
return resp; return resp;
} }
return resp; return resp;
} }
//修改课程实训配置
public HashMap<String, Object> updateCoursePC(ServiceConfig serviceConfig){ public HashMap<String, Object> updateCoursePC(ServiceConfig serviceConfig){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
@ -187,7 +203,7 @@ public class CourseService {
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "更新失败");
return resp; return resp;
} }
return resp; return resp;

@ -9,6 +9,7 @@ import java.util.List;
import com.yipin.liuwanr.entity.*; import com.yipin.liuwanr.entity.*;
import com.yipin.liuwanr.mapper.StaffMapper; import com.yipin.liuwanr.mapper.StaffMapper;
import com.yipin.liuwanr.mapper.StudentMapper; import com.yipin.liuwanr.mapper.StudentMapper;
import com.yipin.liuwanr.entity.*;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -106,25 +107,22 @@ public class UserService {
return result; return result;
} }
public HashMap<String, Object> queryPhone(String phone) { //查询手机号
public HashMap<String, Object>queryPhone(String phone) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
resp.put("retvalue", userMapper.queryPhone(phone)); resp.put("retvalue", userMapper.queryPhone(phone));
if (resp.get("retvalue")==null) { resp.put("retcode", 200);
resp.put("retcode", 200);
}else {
resp.put("retcode", 300);
resp.put("retvalue", "新增失败,账号已存在!");
}
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "查询手机号失败!");
return resp; return resp;
} }
return resp; return resp;
} }
//添加用户
public HashMap<String, Object> addUser(UserM user){ public HashMap<String, Object> addUser(UserM user){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
@ -142,6 +140,7 @@ public class UserService {
return resp; return resp;
} }
//查询用户
public HashMap<String, Object> queryUser(UserM user,Integer pageNo,Integer pageSize){ public HashMap<String, Object> queryUser(UserM user,Integer pageNo,Integer pageSize){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
@ -172,6 +171,7 @@ public class UserService {
return resp; return resp;
} }
//删除用户
public HashMap<String, Object> deleteUser(UserM user){ public HashMap<String, Object> deleteUser(UserM user){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
@ -186,6 +186,7 @@ public class UserService {
return resp; return resp;
} }
//更新用户
public HashMap<String, Object> updateUser(UserM user){ public HashMap<String, Object> updateUser(UserM user){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
@ -200,36 +201,14 @@ public class UserService {
return resp; return resp;
} }
// public HashMap<String, Object> logins(UserM user){ //登陆
////
//// HashMap<String, Object> resp = new HashMap<String, Object>();
//// try {
//// resp.put("retvalue", userMapper.logins(user));
//// if (resp.get("retvalue")==null) {
//// resp.put("retcode", 300);
//// resp.put("retvalue", "登录失败,账号密码有误或不存在!");
//// }else {
//// resp.put("retcode", 200);
//// }
//// } catch (RuntimeException e) {
//// logger.error(e.getMessage());
//// resp.put("retcode", 500);
//// resp.put("retvalue", "登录异常,请稍后再试!");
//// return resp;
//// }
//// return resp;
//// }
public HashMap<String, Object> logins(UserM userM){ public HashMap<String, Object> logins(UserM userM){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
List<Object> obj=new ArrayList<>(); HashMap<String, Object> obj = new HashMap<String, Object>();
String param=userM.getPhone(); Student student;
String password=userM.getPassword(); Staff staff;
Student student;
Staff staff;
try { try {
UserM user=userMapper.loginsQ(param,password); UserM user=userMapper.logins(userM);
if(user!=null) { if(user!=null) {
int loginNumber=user.getLogInNumber()+1; int loginNumber=user.getLogInNumber()+1;
Integer userId=user.getUserId(); Integer userId=user.getUserId();
@ -238,39 +217,39 @@ public class UserService {
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String lastTime=sd.format(date); String lastTime=sd.format(date);
if(user.getAccountRole().equals(4)) { if(user.getAccountRole().equals(4)) {
student=studentMapper.queryStudentQ(user); student=studentMapper.queryStudentQ(user);
if(student!=null) { if(student!=null) {
Integer studentId=student.getStudentId(); Integer studentId=student.getStudentId();
studentMapper.updateStudentQ(lastTime,loginNumber, studentId); studentMapper.updateStudentQ(lastTime,loginNumber, studentId);
obj.add(student); obj.put("student",student);
} }
}else if(user.getAccountRole().equals(3)) { }else if(user.getAccountRole().equals(3)) {
staff=staffMapper.queryStaffQ(user); staff =staffMapper.queryStaffQ(user);
if(staff!=null) { if(staff!=null) {
Integer staffId=staff.getStaffId(); Integer staffId=staff.getStaffId();
staffMapper.updateStaffQ(lastTime,loginNumber, staffId); staffMapper.updateStaffQ(lastTime,loginNumber, staffId);
obj.add(staff); obj.put("staff",staff);
} }
} }
user.setPassword(null); user.setPassword(null);
obj.add(user); obj.put("user",user);
userMapper.updateUserQ(lastTime,loginNumber, userId); userMapper.updateUserQ(lastTime,loginNumber, userId);
resp.put("retcode", 200); resp.put("retcode", 200);
resp.put("retvalue", obj); resp.put("retvalue", obj);
}else { }else {
resp.put("retcode", 300); resp.put("retcode", 300);
resp.put("retvalue", "Login failed"); resp.put("retvalue", "登录失败,账号密码有误或不存在!");
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "登录异常,请稍后再试!");
return resp; return resp;
} }
return resp; return resp;
} }
//查询用户详情
public HashMap<String, Object> queryUserDetails(Integer userId){ public HashMap<String, Object> queryUserDetails(Integer userId){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
@ -285,6 +264,20 @@ public class UserService {
return resp; return resp;
} }
//查询客户
public HashMap<String, Object> queryCustomer(Integer cityId,Integer provinceId){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", userMapper.queryCustomer(cityId,provinceId));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "查询客户失败!");
return resp;
}
return resp;
}
//修改用户头像 //修改用户头像
public HashMap<String, Object> uploadUserAvatars(MultipartFile file,Integer userId){ public HashMap<String, Object> uploadUserAvatars(MultipartFile file,Integer userId){

@ -0,0 +1,61 @@
package com.yipin.liuwanr.vo;
import com.yipin.liuwanr.entity.Staff;
import com.yipin.liuwanr.entity.Student;
import com.yipin.liuwanr.entity.UserM;
import java.util.List;
/**
* 用户信息实体
* @author Ning
*
*/
public class UserVO {
//用户
private UserM user;
//学生
private Student student;
//员工
private Staff staff;
private List<UserM> userList;
private List<Student> studentList;
private List<Staff> staffList;
public UserM getUser() {
return user;
}
public void setUser(UserM user) {
this.user = user;
}
public Student getStudent() {
return student;
}
public void setStudent(Student student) {
this.student = student;
}
public Staff getStaff() {
return staff;
}
public void setStaff(Staff staff) {
this.staff = staff;
}
public List<UserM> getUserList() {
return userList;
}
public void setUserList(List<UserM> userList) {
this.userList = userList;
}
public List<Student> getStudentList() {
return studentList;
}
public void setStudentList(List<Student> studentList) {
this.studentList = studentList;
}
public List<Staff> getStaffList() {
return staffList;
}
public void setStaffList(List<Staff> staffList) {
this.staffList = staffList;
}
}
Loading…
Cancel
Save