master
zhiyong.ning 4 years ago
parent 28813f6e57
commit f6638674a2
  1. 23
      src/main/java/com/yipin/liuwanr/controller/StaffProfessionalArchitectureController.java
  2. 46
      src/main/java/com/yipin/liuwanr/controller/UserController.java
  3. 16
      src/main/java/com/yipin/liuwanr/entity/Student.java
  4. 4
      src/main/java/com/yipin/liuwanr/mapper/StaffProfessionalArchitectureMapper.java
  5. 2
      src/main/java/com/yipin/liuwanr/mapper/StudentMapper.java
  6. 6
      src/main/java/com/yipin/liuwanr/mapper/UserMapper.java
  7. 14
      src/main/java/com/yipin/liuwanr/service/StaffProfessionalArchitectureService.java
  8. 3
      src/main/java/com/yipin/liuwanr/service/StaffService.java
  9. 34
      src/main/java/com/yipin/liuwanr/service/UserService.java

@ -146,4 +146,27 @@ public class StaffProfessionalArchitectureController {
}
return resp;
}
/**
* 查询员工专业架构名称
*/
@GetMapping("/queryStaffPAN")
Response queryStaffPAN(@RequestParam String name) {
Response resp = new Response();
if (name == null) {
resp.setStatus(300);
resp.setMessage("专业组织架构名称为空!");
}else {
HashMap<String, Object> ret = staffProfessionalArchitectureService.queryStaffPAN(name);
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;
}
}

@ -510,4 +510,50 @@ public class UserController {
}
return resp;
}
/**
* 查询账号是否存在
*/
@GetMapping("/queryAccountIsExist")
Response queryAccountIsExist(@RequestParam String userAccount) {
Response resp = new Response();
if (userAccount==null) {
resp.setStatus(300);
resp.setErrmessage("账号为空!");
}else {
HashMap<String, Object> ret = userService.queryAccountIsExist(userAccount);
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;
}
/**
* 查询学号工号是否存在
*/
@GetMapping("/queryWorkNumberIsExist")
Response queryWorkNumberIsExist(@RequestParam String workNumber) {
Response resp = new Response();
if (workNumber==null) {
resp.setStatus(300);
resp.setErrmessage("账号为空!");
}else {
HashMap<String, Object> ret = userService.queryWorkNumberIsExist(workNumber);
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;
}
}

@ -22,8 +22,6 @@ public class Student {
private Integer gradeId;
//绑定班级ID
private Integer classId;
//用户密码
private String studentPassword;
//外部实体实验班级名称
private String experimentalClassName;
//外部实体实验班级ID
@ -56,7 +54,15 @@ public class Student {
private String lastLoginTime;
//考勤统计
private String attendance;
//学生专业组织架构名称
private String stuProfessionalArchitectureName;
public String getStuProfessionalArchitectureName() {
return stuProfessionalArchitectureName;
}
public void setStuProfessionalArchitectureName(String stuProfessionalArchitectureName) {
this.stuProfessionalArchitectureName = stuProfessionalArchitectureName;
}
public String getAttendance() {
return attendance;
}
@ -195,12 +201,6 @@ public class Student {
public void setClassId(Integer classId) {
this.classId = classId;
}
public String getStudentPassword() {
return studentPassword;
}
public void setStudentPassword(String studentPassword) {
this.studentPassword = studentPassword;
}
public String getExperimentalClassName() {
return experimentalClassName;
}

@ -21,6 +21,10 @@ public interface StaffProfessionalArchitectureMapper {
"</script> "})
List<StaffProfessionalArchitecture> queryStaffProfessionalArchitecture(Integer schoolId);
@Select("SELECT staffProfessionalArchitectureId,staffProfessionalArchitectureName,schoolId from staff_professional_architecture where isdel = 0 and staffProfessionalArchitectureName = #{staffProfessionalArchitectureName}")
List<StaffProfessionalArchitecture> queryStaffPAN(String staffProfessionalArchitectureName);
@Update("UPDATE staff_professional_architecture SET isdel = 1 where staffProfessionalArchitectureId = #{staffProfessionalArchitectureId}")
void deleteStaffProfessionalArchitecture(Integer staffProfessionalArchitectureId);

@ -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 and t.schoolId=#{schoolId}",
"SELECT stu.stuProfessionalArchitectureName,g.gradeName,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,grade g,stu_professional_architecture stu WHERE t.isdel =0 and t.classId = cla.classId and t.gradeId = g.gradeId and t.professionalId = stu.stuProfessionalArchitectureId 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>",

@ -253,7 +253,13 @@ public interface UserMapper {
@Update({ "UPDATE staff SET logNumber=logNumber+1, lastTimeOfLanding=now() WHERE phone=#{phone}"})
void updateStaffLogInNumber(UserM user);
//查询账号是否存在
@Select("SELECT userId,userAccount from user where isdel = 0 and userAccount = #{userAccount}")
List<UserM> queryAccountIsExist(String userAccount);
//查询学号、工号是否存在
@Select("SELECT userId,workNumber from user where isdel = 0 and workNumber = #{workNumber}")
List<UserM> queryWorkNumberIsExist(String workNumber);
//========全承珠
@Select("select userId,password,accountRole,logInNumber,workNumber,phone,uniqueIdentificationAccount,schoolId from user "

@ -61,6 +61,20 @@ public class StaffProfessionalArchitectureService {
return resp;
}
public HashMap<String, Object> queryStaffPAN(String name){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", staffProfessionalArchitectureMapper.queryStaffPAN(name));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
return resp;
}
public HashMap<String, Object> deleteStaffProfessionalArchitecture(Integer staffProfessionalArchitectureId){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {

@ -113,6 +113,7 @@ public class StaffService {
return resp;
}
//查询员工
public HashMap<String, Object> queryStaff(Staff staff,Integer pageNo,Integer pageSize){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
@ -143,6 +144,7 @@ public class StaffService {
return resp;
}
//删除员工
public HashMap<String, Object> deleteStaff(Integer staffId,String phone){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
@ -158,6 +160,7 @@ public class StaffService {
return resp;
}
//查询员工详情
public HashMap<String, Object> queryStaffDetails(Integer staffId){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {

@ -231,7 +231,7 @@ public class UserService {
return resp;
}
//更新用户
//更新学生
@Transactional
public HashMap<String, Object> updateStudent(Student student){
HashMap<String, Object> resp = new HashMap<String, Object>();
@ -247,7 +247,7 @@ public class UserService {
return resp;
}
//更新用户
//更新员工
@Transactional
public HashMap<String, Object> updateStaff(Staff staff){
HashMap<String, Object> resp = new HashMap<String, Object>();
@ -393,4 +393,34 @@ public class UserService {
}
return resp;
}
//查询账号是否存在
public HashMap<String, Object> queryAccountIsExist(String userAccount){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", userMapper.queryAccountIsExist(userAccount));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
return resp;
}
//查询学号、工号是否存在
public HashMap<String, Object> queryWorkNumberIsExist(String workNumber){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", userMapper.queryWorkNumberIsExist(workNumber));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
return resp;
}
}

Loading…
Cancel
Save