할일 관리 시스템 개선 및 대시보드 UI 향상

- Todo 상태 관리 시스템 추가 (대기, 진행, 보류, 완료, 취소)
- 완료일(okdate) 자동 설정 기능 구현
- 대시보드 할일 목록에서 만료일 지난 항목 적색 배경 강조
- 휴가신청 목록에서 항목별 색상 구분 (대체=노란색, 년차=녹색, 하기=파란색)
- 휴가신청 목록 데이터 매핑 수정 (holydays, holytimes, HolyReason)
- Todo 정렬 순서 개선 (상태별 우선순위 적용)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ChiKyun Kim
2025-07-30 15:50:21 +09:00
parent 943fdb2036
commit 642c204a18
4 changed files with 518 additions and 67 deletions

View File

@@ -57,7 +57,18 @@ namespace Project.Web.Controllers
string gcode = FCOMMON.info.Login.gcode;
string uid = FCOMMON.info.Login.no;
var sql = "SELECT * FROM EETGW_Todo WHERE gcode = @gcode AND uid = @uid ORDER BY flag DESC, seqno DESC, expire ASC, wdate ASC";
var sql = @"SELECT * FROM EETGW_Todo WHERE gcode = @gcode AND uid = @uid
ORDER BY
CASE
WHEN ISNULL(status,'0') = '1' THEN 1 -- 진행
WHEN ISNULL(status,'0') = '0' THEN 2 -- 대기
WHEN ISNULL(status,'0') = '3' THEN 3 -- 보류
WHEN ISNULL(status,'0') = '5' THEN 4 -- 완료
WHEN ISNULL(status,'0') = '2' THEN 5 -- 취소
ELSE 6
END, flag DESC,
ISNULL(seqno, 0) DESC,
expire ASC";
var todos = DBM.Query<TodoModel>(sql, new { gcode = gcode, uid = uid });
return CreateJsonResponse(new
@@ -149,13 +160,35 @@ namespace Project.Web.Controllers
if (todo.seqno == null) todo.seqno = 0;
if (todo.flag == null) todo.flag = false;
if (todo.status == '\0') todo.status = '0';
// 새로 생성할 때 완료 상태면 완료일 설정
DateTime? okdateValue = null;
if (todo.status == '5')
{
okdateValue = DateTime.Now;
}
var sql = @"
INSERT INTO EETGW_Todo (gcode, uid, title, remark, flag, expire, seqno, request, wuid, wdate)
VALUES (@gcode, @uid, @title, @remark, @flag, @expire, @seqno, @request, @wuid, @wdate);
INSERT INTO EETGW_Todo (gcode, uid, title, remark, flag, expire, seqno, request, status, okdate, wuid, wdate)
VALUES (@gcode, @uid, @title, @remark, @flag, @expire, @seqno, @request, @status, @okdate, @wuid, @wdate);
SELECT SCOPE_IDENTITY();";
var newId = DBM.QuerySingle<int>(sql, todo);
var newId = DBM.QuerySingle<int>(sql, new
{
gcode = todo.gcode,
uid = todo.uid,
title = todo.title,
remark = todo.remark,
flag = todo.flag,
expire = todo.expire,
seqno = todo.seqno,
request = todo.request,
status = todo.status,
okdate = okdateValue,
wuid = todo.wuid,
wdate = todo.wdate
});
return CreateJsonResponse(new
{
@@ -210,9 +243,24 @@ namespace Project.Web.Controllers
string gcode = FCOMMON.info.Login.gcode;
string uid = FCOMMON.info.Login.no;
// 상태가 완료('5')로 변경되고 아직 완료일이 설정되지 않은 경우 완료일 설정
DateTime? okdateValue = null;
if (todo.status == '5')
{
// 기존 완료일이 있는지 확인
var existingTodo = DBM.QuerySingleOrDefault<TodoModel>(
"SELECT okdate FROM EETGW_Todo WHERE idx = @idx AND gcode = @gcode AND uid = @uid",
new { idx = todo.idx, gcode = gcode, uid = uid });
if (existingTodo?.okdate == null)
{
okdateValue = DateTime.Now;
}
}
var sql = @"
UPDATE EETGW_Todo
SET title = @title, remark = @remark, flag = @flag, expire = @expire, seqno = @seqno, request = @request
SET title = @title, remark = @remark, flag = @flag, expire = @expire, seqno = @seqno, request = @request, status = @status, okdate = @okdate
WHERE idx = @idx AND gcode = @gcode AND uid = @uid";
var affectedRows = DBM.Execute(sql, new
@@ -223,6 +271,8 @@ namespace Project.Web.Controllers
expire = todo.expire,
seqno = todo.seqno ?? 0,
request = todo.request,
status = todo.status == '\0' ? '0' : todo.status,
okdate = okdateValue,
idx = todo.idx,
gcode = gcode,
uid = uid