Spring 기반 그룹웨어를 만들었습니다.
제가 맡은 부분은 사원 등록 조회 수정 삭제
비품 예약 , 기간연장, 반납
회의실 예약, 취소, 삭제 기능을 구현 하였습니다.
DataTable API : https://datatables.net/
07. 회의실 예약
controller
//회의실 1
@RequestMapping("insertMeetingA.me")
public String insertMeetingA(@RequestParam("empId") String empId, MeetingRoom mr,
HttpServletRequest request,
Model model) {
meetingRoomService.insertMeetingA(mr);
ArrayList<MeetingRoom> mroom = meetingRoomService.reservedMeeting(empId);
model.addAttribute("mroom", mroom);
return "member/myPage";
}
//회의실 2
@RequestMapping("insertMeetingB.me")
public String insertMeetingB(@RequestParam("empId") String empId, MeetingRoom mr,
HttpServletRequest request,
Model model) {
meetingRoomService.insertMeetingB(mr);
ArrayList<MeetingRoom> mroom = meetingRoomService.reservedMeeting(empId);
model.addAttribute("mroom", mroom);
return "member/myPage";
}
//회의실 3
@RequestMapping("insertMeetingC.me")
public String insertMeetingC(@RequestParam("empId") String empId, MeetingRoom mr,
HttpServletRequest request,
Model model) {
meetingRoomService.insertMeetingC(mr);
ArrayList<MeetingRoom> mroom = meetingRoomService.reservedMeeting(empId);
model.addAttribute("mroom", mroom);
return "member/myPage";
}
//회의실 4
@RequestMapping("insertMeetingD.me")
public String insertMeetingD(@RequestParam("empId") String empId, MeetingRoom mr,
HttpServletRequest request,
Model model) {
meetingRoomService.insertMeetingD(mr);
ArrayList<MeetingRoom> mroom = meetingRoomService.reservedMeeting(empId);
model.addAttribute("mroom", mroom);
return "member/myPage";
}
시간은 1시간 보다 이상일때, 연속으로 입력된 시간 값을 다시 콤마 구분자로 쿼리에서 구분해
여러행으로 출력한다.
Mapper
<select id="reservedMeeting" parameterType="MeetingRoom" resultMap="MrResultSet">
<![CDATA[
SELECT distinct MR_NO,
REGEXP_SUBSTR(STR, '[^,]+', 1, LEVEL) AS STR
FROM (SELECT MR_NO, TIME AS STR
FROM MEETING_ROOM WHERE EMP_ID = #{empId} AND STATUS ='Y' )
CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(STR, '[^,]+'))+1
ORDER BY MR_NO ASC
]]>
</select>
08. 회의실 취소
controller
//회의실 1 삭제
@RequestMapping("cancelMeetingA.ca")
public String cancelMeetingA(@RequestParam("empId") String empId, MeetingRoom mr, HttpServletRequest request, Model model) {
meetingRoomService.cancelMeetingA(mr);
ArrayList<MeetingRoom> mroom = meetingRoomService.reservedMeeting(empId);
model.addAttribute("mroom", mroom);
return "member/myPage";
}
//회의실 2 삭제
@RequestMapping("cancelMeetingB.ca")
public String cancelMeetingB(@RequestParam("empId") String empId, MeetingRoom mr, HttpServletRequest request, Model model) {
meetingRoomService.cancelMeetingB(mr);
ArrayList<MeetingRoom> mroom = meetingRoomService.reservedMeeting(empId);
model.addAttribute("mroom", mroom);
return "member/myPage";
}
//회의실 3 삭제
@RequestMapping("cancelMeetingC.ca")
public String cancelMeetingC(@RequestParam("empId") String empId, MeetingRoom mr, HttpServletRequest request, Model model) {
meetingRoomService.cancelMeetingC(mr);
ArrayList<MeetingRoom> mroom = meetingRoomService.reservedMeeting(empId);
model.addAttribute("mroom", mroom);
return "member/myPage";
}
//회의실 4 삭제
@RequestMapping("cancelMeetingD.ca")
public String cancelMeetingD(@RequestParam("empId") String empId, MeetingRoom mr, HttpServletRequest request, Model model) {
meetingRoomService.cancelMeetingD(mr);
ArrayList<MeetingRoom> mroom = meetingRoomService.reservedMeeting(empId);
model.addAttribute("mroom", mroom);
return "member/myPage";
}
09. 회의실 초기화
controller
//관리자 초기화 회의시
@RequestMapping("reset.me")
public String resetA(TimeTable_A a, TimeTable_B b, TimeTable_C c, TimeTable_D d,
MeetingRoom mroom, HttpServletRequest request, Model model) {
ArrayList<TimeTable_A> TimeTableA = meetingRoomService.selectTimeTableA();
ArrayList<TimeTable_B> TimeTableB = meetingRoomService.selectTimeTableB();
ArrayList<TimeTable_C> TimeTableC = meetingRoomService.selectTimeTableC();
ArrayList<TimeTable_D> TimeTableD = meetingRoomService.selectTimeTableD();
model.addAttribute("TimeTableA", TimeTableA);
model.addAttribute("TimeTableB", TimeTableB);
model.addAttribute("TimeTableC", TimeTableC);
model.addAttribute("TimeTableD", TimeTableD);
meetingRoomService.resetAll(mroom);
meetingRoomService.reset(a);
meetingRoomService.reset(b);
meetingRoomService.reset(c);
meetingRoomService.reset(d);
return "redirect:meetingRoom.me";
}
Mapper
<update id="cancelMeetingD" parameterType="String">
UPDATE TIMETABLE_D SET STATUS = 'Y'
WHERE TIME = #{time}
</update>
<update id="resetA" parameterType="TimeTable_A" >
UPDATE TIMETABLE_A SET STATUS ='Y'
</update>
<update id="resetB" parameterType="TimeTable_B" >
UPDATE TIMETABLE_B SET STATUS ='Y'
</update>
<update id="resetC" parameterType="TimeTable_C" >
UPDATE TIMETABLE_C SET STATUS ='Y'
</update>
<update id="resetD" parameterType="TimeTable_D" >
UPDATE TIMETABLE_D SET STATUS ='Y'
</update>
<update id="resetAll" parameterType="MeetingRoom" >
UPDATE MEETING_ROOM SET STATUS ='N'
</update>
'파이널 프로젝트' 카테고리의 다른 글
X-nags 그룹웨어 (0) | 2021.12.01 |
---|---|
X-nags 그룹웨어 (0) | 2021.12.01 |
X-nags 그룹웨어 (0) | 2021.11.29 |