From 2a18aa23af725352a8c434f6f9311de9e4d0b855 Mon Sep 17 00:00:00 2001 From: yundouzou <15581300976@163.com> Date: Fri, 22 Dec 2023 13:11:14 +0800 Subject: [PATCH] service --- IAdminService.java | 130 +++++++++++++ IDormManageService.java | 47 +++++ ILoginService.java | 10 + IStudentService.java | 25 +++ impl/AdminServiceImpl.java | 316 +++++++++++++++++++++++++++++++ impl/IDormManageServiceImpl.java | 108 +++++++++++ impl/IStudentServiceImpl.java | 75 ++++++++ impl/LoginServiceImpl.java | 34 ++++ 8 files changed, 745 insertions(+) create mode 100644 IAdminService.java create mode 100644 IDormManageService.java create mode 100644 ILoginService.java create mode 100644 IStudentService.java create mode 100644 impl/AdminServiceImpl.java create mode 100644 impl/IDormManageServiceImpl.java create mode 100644 impl/IStudentServiceImpl.java create mode 100644 impl/LoginServiceImpl.java diff --git a/IAdminService.java b/IAdminService.java new file mode 100644 index 0000000..ab7b86e --- /dev/null +++ b/IAdminService.java @@ -0,0 +1,130 @@ +package com.cya.service; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.cya.entity.Admin; +import com.cya.entity.DormBuild; +import com.cya.entity.DormManage; +import com.cya.entity.Notice; +import com.cya.entity.PageResult; +import com.cya.entity.PunchClock; +import com.cya.entity.PunchClockRecord; +import com.cya.entity.Record; +import com.cya.entity.Student; + +public interface IAdminService { + + /*-------------------------宿管---------------------------*/ + + public PageResult getDormManage(int pageNum, int pageSize,String filter,String key); + + public void addDormManage(DormManage dormManage); + + public DormManage getDormMangerById(int dormManId); + + public void updataDormManageById(DormManage dormManage); + + public void deleteDormManageById(Integer dormManId); + + /*-------------------------宿管---------------------------*/ + + /*-------------------------学生---------------------------*/ + + public PageResult getStudentManage(int pageNum, int pageSize,String filter,String key); + + public void addStudentManage(Student student); + + public Student getStudentMangerById(int studentId); + + public void updataStudentManageById(Student student); + + public void studentManagerDeleteById(int studentId); + + /*-------------------------学生---------------------------*/ + + + + /*-------------------------宿舍楼---------------------------*/ + + public PageResult getBuildManage(int pageNum, int pageSize,String filter,String key); + + public void addBuildManage(DormBuild dormBuild); + + public DormBuild getBuildMangerById(int dormBuildId); + + public void updataBuildManageById(DormBuild dormBuild); + + public void buildManagerDeleteById(Integer dormBuildId); + + public List getDormMangerByBuildId(Integer dormBuildId); + + public List getDormManage2(); + + public void addDormManageToBuild(Integer dormBuildId,Integer dormManId); + + public void removeaDormManageToBuild(Integer dormManId); + + /*-------------------------宿舍楼---------------------------*/ + + + + /*-------------------------考勤---------------------------*/ + + public PageResult getRecordManage(int pageNum, int pageSize,String filter,String key); + + public void recordManagerDeleteById(Integer recordId); + /*-------------------------考勤---------------------------*/ + + + /*-------------------------公告---------------------------*/ + + public PageResult getNoticeManage(Integer pageNum,Integer pageSize,String filter, String key); + + public void addNoticeManage(Notice notice); + + public Notice getNoticeMangerById(Integer noticeId); + + public void updataNoticeManageById(Notice notice); + + public void noticeManagerDeleteById(Integer noticeId); + + /*-------------------------公告---------------------------*/ + + /*-------------------------我的---------------------------*/ + + public Admin getMyMsgById(Integer adminId); + + public void updateMyMsgById(Admin admin); + + public void updatePsd(Admin admin); + + /*-------------------------我的---------------------------*/ + + + + /*-------------------------打卡---------------------------*/ + + public PageResult getPunchClockManage(int pageNum, int pageSize,String filter,String key); + + public void addPunchClockManageMsg(PunchClock punchClock); + + public PunchClock getPunchClockMangerById(String id); + + public void updataPunchClockManageMsgById(PunchClock punchClock); + + public void punchClockManagerDeleteById(String id); + + public List getStudentMsg(); + + public void insertIntoPunchClockRecord(PunchClockRecord punchClockRecord); + + public void updateIntoPunchClockRecordById(PunchClock punchClock); + + public void deletePunchClockRecordById(String id); + + /*-------------------------打卡---------------------------*/ + + +} diff --git a/IDormManageService.java b/IDormManageService.java new file mode 100644 index 0000000..2f725b1 --- /dev/null +++ b/IDormManageService.java @@ -0,0 +1,47 @@ +package com.cya.service; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.cya.entity.Admin; +import com.cya.entity.DormManage; +import com.cya.entity.Notice; +import com.cya.entity.PageResult; +import com.cya.entity.Record; +import com.cya.entity.Student; + +public interface IDormManageService { + + public PageResult getStudentMsgByBuildId(int pageNum, int pageSize,String filter,String key,Integer dormBuildId); + + public void studentMsgDeleteById(int studentId); + + public PageResult getRecordMsg(int pageNum, int pageSize,String filter,String key,Integer dormBuildId); + + public Record getRecordById(int recordId); + + public void updataRecordMsg(Record record); + + public void addRecordMsg(Record record); + + public void recordManagerDeleteById1(Integer recordId); + +/*-------------------------我的---------------------------*/ + + public DormManage dorm_getMyMsgById(Integer dormManId); + + public void dorm_updateMyMsgById(DormManage dormManage); + + public void dorm_updatePsd(DormManage dormManage); + + /*-------------------------我的---------------------------*/ + + public List getNoticeAll(); + + /*-------------------------打卡---------------------------*/ + + public PageResult getPunchClockRecordMsgByDormBuildId(int pageNum, int pageSize,String filter,String key,Integer dormBuildId); + + /*-------------------------打卡---------------------------*/ +} diff --git a/ILoginService.java b/ILoginService.java new file mode 100644 index 0000000..18ae5ea --- /dev/null +++ b/ILoginService.java @@ -0,0 +1,10 @@ +package com.cya.service; + +import java.util.List; + +import com.cya.entity.Login; + +public interface ILoginService { + + public List login(Login login); +} diff --git a/IStudentService.java b/IStudentService.java new file mode 100644 index 0000000..4b87e0d --- /dev/null +++ b/IStudentService.java @@ -0,0 +1,25 @@ +package com.cya.service; + +import org.apache.ibatis.annotations.Param; + +import com.cya.entity.PageResult; +import com.cya.entity.PunchClockRecord; +import com.cya.entity.Student; + +public interface IStudentService { + + public PageResult getRecordMMsgByStuNum(Integer pageNum,Integer pageSize,String filter, String key,String studentNumber); + + public Student student_getMyMsgById(Integer studentId); + + public void student_updateMyMsgById(Student student); + + public void student_updatePsd(Student student); + + public PageResult getPunchClockRecordMsgByStuNum(Integer pageNum,Integer pageSize,String filter, String key,String studentNumber); + + public PunchClockRecord getPunckColcokRecordById(Integer id); + + public void updataPunchClockRecordMsg(PunchClockRecord punchClockRecord); + +} diff --git a/impl/AdminServiceImpl.java b/impl/AdminServiceImpl.java new file mode 100644 index 0000000..96b119f --- /dev/null +++ b/impl/AdminServiceImpl.java @@ -0,0 +1,316 @@ +package com.cya.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.cya.entity.Admin; +import com.cya.entity.DormBuild; +import com.cya.entity.DormManage; +import com.cya.entity.Notice; +import com.cya.entity.PageResult; +import com.cya.entity.PunchClock; +import com.cya.entity.PunchClockRecord; +import com.cya.entity.Record; +import com.cya.entity.Student; +import com.cya.mapper.IAdminMapper; +import com.cya.service.IAdminService; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; + +@Service +public class AdminServiceImpl implements IAdminService{ + + @Autowired + private IAdminMapper adminMapperImpl; + + /*-------------------------宿管---------------------------*/ + + @Override + public PageResult getDormManage(int pageNum, int pageSize,String filter,String key) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListdormManageList= adminMapperImpl.getDormManage(filter,key); + Page page=(Page) dormManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public void addDormManage(DormManage dormManage) { + // TODO Auto-generated method stub + adminMapperImpl.addDormManage(dormManage); + } + + @Override + public DormManage getDormMangerById(int dormManId) { + // TODO Auto-generated method stub + return adminMapperImpl.getDormMangerById(dormManId); + } + + @Override + public void updataDormManageById(DormManage dormManage) { + // TODO Auto-generated method stub + adminMapperImpl.updataDormManageById(dormManage); + } + + @Override + public void deleteDormManageById(Integer dormManId) { + // TODO Auto-generated method stub + adminMapperImpl.deleteDormManageById(dormManId); + } + + /*-------------------------宿管---------------------------*/ + + + /*-------------------------学生---------------------------*/ + + //获取学生信息 + @Override + public PageResult getStudentManage(int pageNum, int pageSize, String filter, String key) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListstudentManageList= adminMapperImpl.getStudentManage(filter, key); + Page page=(Page) studentManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public void addStudentManage(Student student) { + // TODO Auto-generated method stub + adminMapperImpl.addStudentManage(student); + } + + @Override + public Student getStudentMangerById(int studentId) { + // TODO Auto-generated method stub + return adminMapperImpl.getStudentMangerById(studentId); + } + + @Override + public void updataStudentManageById(Student student) { + // TODO Auto-generated method stub + adminMapperImpl.updataStudentManageById(student); + } + + @Override + public void studentManagerDeleteById(int studentId) { + // TODO Auto-generated method stub + adminMapperImpl.studentManagerDeleteById(studentId); + } + + /*-------------------------学生---------------------------*/ + + + /*-------------------------宿舍楼---------------------------*/ + + @Override + public PageResult getBuildManage(int pageNum, int pageSize, String filter, String key) { + // TODO Auto-generated method stub + + PageHelper.startPage(pageNum, pageSize); + ListbuildList= adminMapperImpl.getBuildManage(filter, key); + Page page=(Page) buildList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public void addBuildManage(DormBuild dormBuild) { + // TODO Auto-generated method stub + adminMapperImpl.addBuildManage(dormBuild); + } + + @Override + public DormBuild getBuildMangerById(int dormBuildId) { + // TODO Auto-generated method stub + return adminMapperImpl.getBuildMangerById(dormBuildId); + } + + @Override + public void updataBuildManageById(DormBuild dormBuild) { + // TODO Auto-generated method stub + adminMapperImpl.updataBuildManageById(dormBuild); + } + + @Override + public void buildManagerDeleteById(Integer dormBuildId) { + // TODO Auto-generated method stub + adminMapperImpl.buildManagerDeleteById(dormBuildId); + } + + @Override + public List getDormMangerByBuildId(Integer dormBuildId) { + // TODO Auto-generated method stub + return adminMapperImpl.getDormMangerByBuildId(dormBuildId); + } + + @Override + public List getDormManage2() { + // TODO Auto-generated method stub + return adminMapperImpl.getDormManage2(); + } + + @Override + public void addDormManageToBuild(Integer dormBuildId, Integer dormManId) { + // TODO Auto-generated method stub + adminMapperImpl.addDormManageToBuild(dormBuildId, dormManId); + } + + @Override + public void removeaDormManageToBuild(Integer dormManId) { + // TODO Auto-generated method stub + adminMapperImpl.removeaDormManageToBuild(dormManId); + } + + /*-------------------------宿舍楼---------------------------*/ + + + /*-------------------------考勤---------------------------*/ + + @Override + public PageResult getRecordManage(int pageNum, int pageSize, String filter, String key) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListrecordManageList= adminMapperImpl.getRecordManage(filter, key); + Page page=(Page) recordManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public void recordManagerDeleteById(Integer recordId) { + // TODO Auto-generated method stub + adminMapperImpl.recordManagerDeleteById(recordId); + } + + + /*-------------------------考勤---------------------------*/ + + + + /*-------------------------公告---------------------------*/ + + @Override + public PageResult getNoticeManage(Integer pageNum,Integer pageSize,String filter, String key) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListnoticeManageList= adminMapperImpl.getNoticeManage(filter, key); + Page page=(Page) noticeManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public void addNoticeManage(Notice notice) { + // TODO Auto-generated method stub + adminMapperImpl.addNoticeManage(notice); + } + + @Override + public Notice getNoticeMangerById(Integer noticeId) { + // TODO Auto-generated method stub + return adminMapperImpl.getNoticeMangerById(noticeId); + } + + @Override + public void updataNoticeManageById(Notice notice) { + // TODO Auto-generated method stub + adminMapperImpl.updataNoticeManageById(notice); + } + + @Override + public void noticeManagerDeleteById(Integer noticeId) { + // TODO Auto-generated method stub + adminMapperImpl.noticeManagerDeleteById(noticeId); + } + + + + /*-------------------------公告---------------------------*/ + + + /*-------------------------我的---------------------------*/ + + @Override + public Admin getMyMsgById(Integer adminId) { + // TODO Auto-generated method stub + return adminMapperImpl.getMyMsgById(adminId); + } + + @Override + public void updateMyMsgById(Admin admin) { + // TODO Auto-generated method stub + adminMapperImpl.updateMyMsgById(admin); + } + + @Override + public void updatePsd(Admin admin) { + // TODO Auto-generated method stub + adminMapperImpl.updatePsd(admin); + } + + + + /*-------------------------我的---------------------------*/ + + + /*-------------------------打卡---------------------------*/ + + @Override + public PageResult getPunchClockManage(int pageNum, int pageSize, String filter, String key) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListpunchClockManageList= adminMapperImpl.getPunchClockManage(filter, key); + Page page=(Page) punchClockManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public void addPunchClockManageMsg(PunchClock punchClock) { + // TODO Auto-generated method stub + adminMapperImpl.addPunchClockManageMsg(punchClock); + } + + @Override + public PunchClock getPunchClockMangerById(String id) { + // TODO Auto-generated method stub + return adminMapperImpl.getPunchClockMangerById(id); + } + + @Override + public void updataPunchClockManageMsgById(PunchClock punchClock) { + // TODO Auto-generated method stub + adminMapperImpl.updataPunchClockManageMsgById(punchClock); + } + + @Override + public void punchClockManagerDeleteById(String id) { + // TODO Auto-generated method stub + adminMapperImpl.punchClockManagerDeleteById(id); + } + + @Override + public List getStudentMsg() { + // TODO Auto-generated method stub + return adminMapperImpl.getStudentMsg(); + } + + @Override + public void insertIntoPunchClockRecord(PunchClockRecord punchClockRecord) { + // TODO Auto-generated method stub + adminMapperImpl.insertIntoPunchClockRecord(punchClockRecord); + } + + @Override + public void updateIntoPunchClockRecordById(PunchClock punchClock) { + // TODO Auto-generated method stub + adminMapperImpl.updateIntoPunchClockRecordById(punchClock); + } + + @Override + public void deletePunchClockRecordById(String id) { + // TODO Auto-generated method stub + adminMapperImpl.deletePunchClockRecordById(id); + } + + /*-------------------------打卡---------------------------*/ + +} diff --git a/impl/IDormManageServiceImpl.java b/impl/IDormManageServiceImpl.java new file mode 100644 index 0000000..3c8aa90 --- /dev/null +++ b/impl/IDormManageServiceImpl.java @@ -0,0 +1,108 @@ +package com.cya.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.cya.entity.Admin; +import com.cya.entity.DormManage; +import com.cya.entity.Notice; +import com.cya.entity.PageResult; +import com.cya.entity.PunchClockRecord; +import com.cya.entity.Record; +import com.cya.entity.Student; +import com.cya.mapper.IDormManageMapper; +import com.cya.service.IDormManageService; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; + +@Service +public class IDormManageServiceImpl implements IDormManageService{ + + @Autowired + private IDormManageMapper dormManageMapperImpl; + + @Override + public PageResult getStudentMsgByBuildId(int pageNum, int pageSize, String filter, String key, Integer dormBuildId) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListstudentsManageList= dormManageMapperImpl.getStudentMsgByBuildId(filter, key, dormBuildId); + Page page=(Page) studentsManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public void studentMsgDeleteById(int studentId) { + // TODO Auto-generated method stub + dormManageMapperImpl.studentMsgDeleteById(studentId); + } + + @Override + public PageResult getRecordMsg(int pageNum, int pageSize, String filter, String key, Integer dormBuildId) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListrecordMsgList= dormManageMapperImpl.getRecordMsg(filter, key, dormBuildId); + Page page=(Page) recordMsgList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public Record getRecordById(int recordId) { + // TODO Auto-generated method stub + return dormManageMapperImpl.getRecordById(recordId); + } + + @Override + public void updataRecordMsg(Record record) { + // TODO Auto-generated method stub + dormManageMapperImpl.updataRecordMsg(record); + } + + @Override + public void addRecordMsg(Record record) { + // TODO Auto-generated method stub + dormManageMapperImpl.addRecordMsg(record); + } + + @Override + public void recordManagerDeleteById1(Integer recordId) { + // TODO Auto-generated method stub + dormManageMapperImpl.recordManagerDeleteById1(recordId); + } + + @Override + public DormManage dorm_getMyMsgById(Integer dormManId) { + // TODO Auto-generated method stub + return dormManageMapperImpl.dorm_getMyMsgById(dormManId); + } + + @Override + public void dorm_updateMyMsgById(DormManage dormManage) { + // TODO Auto-generated method stub + dormManageMapperImpl.dorm_updateMyMsgById(dormManage); + } + + @Override + public void dorm_updatePsd(DormManage dormManage) { + // TODO Auto-generated method stub + dormManageMapperImpl.dorm_updatePsd(dormManage); + } + + @Override + public List getNoticeAll() { + // TODO Auto-generated method stub + return dormManageMapperImpl.getNoticeAll(); + } + + @Override + public PageResult getPunchClockRecordMsgByDormBuildId(int pageNum, int pageSize, String filter, String key, + Integer dormBuildId) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListpunchClockRecordManageList= dormManageMapperImpl.getPunchClockRecordMsgByDormBuildId(filter, key, dormBuildId); + Page page=(Page) punchClockRecordManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + +} diff --git a/impl/IStudentServiceImpl.java b/impl/IStudentServiceImpl.java new file mode 100644 index 0000000..e9f90ec --- /dev/null +++ b/impl/IStudentServiceImpl.java @@ -0,0 +1,75 @@ +package com.cya.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.cya.entity.PageResult; +import com.cya.entity.PunchClockRecord; +import com.cya.entity.Record; +import com.cya.entity.Student; +import com.cya.mapper.IStudentMapper; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; + +@Service +public class IStudentServiceImpl implements com.cya.service.IStudentService { + + @Autowired + private IStudentMapper studentMapperImpl; + + @Override + public Student student_getMyMsgById(Integer studentId) { + // TODO Auto-generated method stub + return studentMapperImpl.student_getMyMsgById(studentId); + } + + @Override + public void student_updateMyMsgById(Student student) { + // TODO Auto-generated method stub + studentMapperImpl.student_updateMyMsgById(student); + } + + @Override + public void student_updatePsd(Student student) { + // TODO Auto-generated method stub + studentMapperImpl.student_updatePsd(student); + } + + @Override + public PageResult getRecordMMsgByStuNum(Integer pageNum, Integer pageSize, String filter, String key, + String studentNumber) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListstudentsManageList= studentMapperImpl.getRecordMsgByStuNum(filter, key, studentNumber); + Page page=(Page) studentsManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public PageResult getPunchClockRecordMsgByStuNum(Integer pageNum, Integer pageSize, String filter, String key, + String studentNumber) { + // TODO Auto-generated method stub + PageHelper.startPage(pageNum, pageSize); + ListpunchClockRecordManageList= studentMapperImpl.getPunchClockRecordMsgByStuNum(filter, key, studentNumber); + Page page=(Page) punchClockRecordManageList; + return new PageResult(page.getTotal(), page.getResult()); + } + + @Override + public PunchClockRecord getPunckColcokRecordById(Integer id) { + // TODO Auto-generated method stub + return studentMapperImpl.getPunckColcokRecordById(id); + } + + @Override + public void updataPunchClockRecordMsg(PunchClockRecord punchClockRecord) { + // TODO Auto-generated method stub + studentMapperImpl.updataPunchClockRecordMsg(punchClockRecord); + } + + + + +} diff --git a/impl/LoginServiceImpl.java b/impl/LoginServiceImpl.java new file mode 100644 index 0000000..46fb337 --- /dev/null +++ b/impl/LoginServiceImpl.java @@ -0,0 +1,34 @@ +package com.cya.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.cya.entity.Login; +import com.cya.mapper.ILoginMapper; +import com.cya.service.ILoginService; + +@Service +public class LoginServiceImpl implements ILoginService { + + @Autowired + private ILoginMapper loginMapperImpl; + + @Override + public List login(Login login) { + List list=null; + // TODO Auto-generated method stub + if(login.getRole().trim().equals("admin")) { + list= loginMapperImpl.loginToAdmin(login); + } + if(login.getRole().trim().equals("dormManager")) { + list= loginMapperImpl.loginToDormManage(login); + } + if(login.getRole().trim().equals("student")) { + list= loginMapperImpl.loginToStudent(login); + } + return list; + } + +}