feat: TBM 모바일 시스템 + 작업 분할/이동 + 권한 통합
TBM 시스템: - 4단계 워크플로우 (draft→세부편집→완료→작업보고) - 모바일 전용 TBM 페이지 (tbm-mobile.html) + 3단계 생성 위자드 - 작업자 작업 분할 (work_hours + split_seq) - 작업자 이동 보내기/빼오기 (tbm_transfers 테이블) - 생성 시 중복 배정 방지 (당일 배정 현황 조회) - 데스크탑 TBM 페이지 세부편집 기능 추가 작업보고서: - 모바일 전용 작업보고서 페이지 (report-create-mobile.html) - TBM에서 사전 등록된 work_hours 자동 반영 권한 시스템: - tkuser user_page_permissions 테이블과 system1 페이지 접근 연동 - pageAccessRoutes를 userRoutes보다 먼저 등록 (라우트 우선순위 수정) - TKUSER_DEFAULT_ACCESS 폴백 추가 (개인→부서→기본값 3단계) - 권한 캐시키 갱신 (userPageAccess_v2) 기타: - app-init.js 캐시 버스팅 (v=5) - iOS Safari touch-action: manipulation 적용 - KST 타임존 날짜 버그 수정 (toISOString UTC 이슈) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* TBM 팀 배정에 근태 유형 컬럼 추가
|
||||
* - attendance_type: 근태유형 (overtime/regular/annual/half/quarter/early)
|
||||
* - attendance_hours: 추가시간(overtime) 또는 실제근무시간(early)
|
||||
*
|
||||
* @since 2026-02-24
|
||||
*/
|
||||
|
||||
exports.up = function(knex) {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
ADD COLUMN attendance_type ENUM('overtime','regular','annual','half','quarter','early')
|
||||
DEFAULT NULL
|
||||
COMMENT '근태유형',
|
||||
ADD COLUMN attendance_hours DECIMAL(4,1) DEFAULT NULL
|
||||
COMMENT '추가시간(overtime) 또는 실제근무시간(early)'
|
||||
`);
|
||||
};
|
||||
|
||||
exports.down = function(knex) {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
DROP COLUMN attendance_type,
|
||||
DROP COLUMN attendance_hours
|
||||
`);
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* TBM 팀 배정에 작업시간 컬럼 추가
|
||||
* - work_hours: 작업시간 (NULL=종일 8h, 값=해당 시간만)
|
||||
*
|
||||
* @since 2026-02-25
|
||||
*/
|
||||
|
||||
exports.up = function(knex) {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
ADD COLUMN work_hours DECIMAL(4,1) DEFAULT NULL
|
||||
COMMENT 'NULL=종일(8h), 값 있으면 해당 시간만'
|
||||
`);
|
||||
};
|
||||
|
||||
exports.down = function(knex) {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
DROP COLUMN work_hours
|
||||
`);
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* TBM 작업자 이동 로그 테이블 생성
|
||||
* - 작업자를 다른 TBM 세션으로 보내기/빼오기 기록
|
||||
*
|
||||
* @since 2026-02-25
|
||||
*/
|
||||
|
||||
exports.up = function(knex) {
|
||||
return knex.raw(`
|
||||
CREATE TABLE tbm_transfers (
|
||||
transfer_id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
transfer_date DATE NOT NULL,
|
||||
worker_id INT NOT NULL,
|
||||
source_session_id INT UNSIGNED NOT NULL,
|
||||
dest_session_id INT UNSIGNED NOT NULL,
|
||||
hours DECIMAL(4,1) NOT NULL,
|
||||
transfer_type ENUM('send','pull') NOT NULL,
|
||||
initiated_by INT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
INDEX idx_date (transfer_date),
|
||||
INDEX idx_worker (worker_id, transfer_date)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
||||
`);
|
||||
};
|
||||
|
||||
exports.down = function(knex) {
|
||||
return knex.raw(`DROP TABLE IF EXISTS tbm_transfers`);
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
// 20260225000003_add_split_seq.js
|
||||
// 같은 작업자가 같은 세션에서 여러 분할 항목을 가질 수 있도록 split_seq 추가
|
||||
|
||||
exports.up = function(knex) {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
ADD COLUMN split_seq INT UNSIGNED DEFAULT 0 AFTER work_hours
|
||||
`).then(() => {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
DROP INDEX tbm_team_assignments_session_id_worker_id_unique
|
||||
`);
|
||||
}).then(() => {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
ADD UNIQUE INDEX uniq_session_worker_seq (session_id, worker_id, split_seq)
|
||||
`);
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function(knex) {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
DROP INDEX uniq_session_worker_seq
|
||||
`).then(() => {
|
||||
return knex.raw(`
|
||||
DELETE t1 FROM tbm_team_assignments t1
|
||||
INNER JOIN tbm_team_assignments t2
|
||||
WHERE t1.assignment_id > t2.assignment_id
|
||||
AND t1.session_id = t2.session_id
|
||||
AND t1.worker_id = t2.worker_id
|
||||
`);
|
||||
}).then(() => {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments
|
||||
ADD UNIQUE INDEX tbm_team_assignments_session_id_worker_id_unique (session_id, worker_id)
|
||||
`);
|
||||
}).then(() => {
|
||||
return knex.raw(`
|
||||
ALTER TABLE tbm_team_assignments DROP COLUMN split_seq
|
||||
`);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user