근태(Holyday) API 추가 및 일별/업무형태별 집계 다이얼로그 구현, OT 시작/종료시간 필드 추가
This commit is contained in:
@@ -99,10 +99,10 @@ namespace Project.Web
|
||||
{
|
||||
try
|
||||
{
|
||||
// 뷰에서 기본 정보 조회, 원본 테이블에서 jobgrp, tag 추가 조회
|
||||
// 뷰에서 기본 정보 조회, 원본 테이블에서 jobgrp, tag, otStart, otEnd 추가 조회
|
||||
var sql = @"SELECT v.idx, v.pidx, v.pdate, v.id, v.name, v.type, v.svalue, v.hrs, v.ot,
|
||||
v.requestpart, v.package, v.userprocess, v.status, v.projectName, v.description,
|
||||
v.ww, v.otpms, v.process, j.jobgrp, j.tag
|
||||
v.ww, v.otpms, v.process, j.jobgrp, j.tag, j.otStart, j.otEnd
|
||||
FROM vJobReportForUser v WITH (nolock)
|
||||
INNER JOIN JobReport j WITH (nolock) ON v.idx = j.idx
|
||||
WHERE v.idx = @idx AND v.gcode = @gcode";
|
||||
@@ -141,7 +141,8 @@ namespace Project.Web
|
||||
/// 업무일지 추가 (JobReport 테이블)
|
||||
/// </summary>
|
||||
public string Jobreport_Add(string pdate, string projectName, int pidx, string requestpart, string package,
|
||||
string type, string process, string status, string description, double hrs, double ot, string jobgrp, string tag)
|
||||
string type, string process, string status, string description, double hrs, double ot, string jobgrp, string tag,
|
||||
string otStart, string otEnd)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -153,9 +154,9 @@ namespace Project.Web
|
||||
}
|
||||
|
||||
var sql = @"INSERT INTO JobReport (gcode, uid, pdate, projectName, requestpart, package,
|
||||
type, process, status, description, hrs, ot, jobgrp, tag, wuid, wdate, pidx)
|
||||
type, process, status, description, hrs, ot, jobgrp, tag, wuid, wdate, pidx, otStart, otEnd)
|
||||
VALUES (@gcode, @uid, @pdate, @projectName, @requestpart, @package,
|
||||
@type, @process, @status, @description, @hrs, @ot, @jobgrp, @tag, @wuid, GETDATE(), @pidx);
|
||||
@type, @process, @status, @description, @hrs, @ot, @jobgrp, @tag, @wuid, GETDATE(), @pidx, @otStart, @otEnd);
|
||||
SELECT SCOPE_IDENTITY();";
|
||||
|
||||
var cs = Properties.Settings.Default.gwcs;
|
||||
@@ -178,6 +179,20 @@ namespace Project.Web
|
||||
cmd.Parameters.AddWithValue("@jobgrp", jobgrp ?? "");
|
||||
cmd.Parameters.AddWithValue("@tag", tag ?? "");
|
||||
cmd.Parameters.AddWithValue("@wuid", info.Login.no);
|
||||
|
||||
// otStart, otEnd 처리 (HH:mm 형식을 datetime으로 변환)
|
||||
if (!string.IsNullOrEmpty(otStart) && !string.IsNullOrEmpty(otEnd))
|
||||
{
|
||||
var otStartDateTime = DateTime.Parse($"{pdate} {otStart}:00");
|
||||
var otEndDateTime = DateTime.Parse($"{pdate} {otEnd}:00");
|
||||
cmd.Parameters.AddWithValue("@otStart", otStartDateTime);
|
||||
cmd.Parameters.AddWithValue("@otEnd", otEndDateTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@otStart", DBNull.Value);
|
||||
cmd.Parameters.AddWithValue("@otEnd", DBNull.Value);
|
||||
}
|
||||
|
||||
cn.Open();
|
||||
var newId = Convert.ToInt32(cmd.ExecuteScalar());
|
||||
@@ -194,7 +209,8 @@ namespace Project.Web
|
||||
/// 업무일지 수정 (JobReport 테이블)
|
||||
/// </summary>
|
||||
public string Jobreport_Edit(int idx, string pdate, string projectName, int pidx, string requestpart, string package,
|
||||
string type, string process, string status, string description, double hrs, double ot, string jobgrp, string tag)
|
||||
string type, string process, string status, string description, double hrs, double ot, string jobgrp, string tag,
|
||||
string otStart, string otEnd)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -231,7 +247,7 @@ namespace Project.Web
|
||||
pdate = @pdate, projectName = @projectName, pidx = @pidx, requestpart = @requestpart,
|
||||
package = @package, type = @type, process = @process, status = @status,
|
||||
description = @description, hrs = @hrs, ot = @ot, jobgrp = @jobgrp, tag = @tag,
|
||||
wuid = @wuid, wdate = GETDATE()
|
||||
otStart = @otStart, otEnd = @otEnd, wuid = @wuid, wdate = GETDATE()
|
||||
WHERE idx = @idx AND gcode = @gcode";
|
||||
|
||||
var cs = Properties.Settings.Default.gwcs;
|
||||
@@ -254,6 +270,20 @@ namespace Project.Web
|
||||
cmd.Parameters.AddWithValue("@jobgrp", jobgrp ?? "");
|
||||
cmd.Parameters.AddWithValue("@tag", tag ?? "");
|
||||
cmd.Parameters.AddWithValue("@wuid", info.Login.no);
|
||||
|
||||
// otStart, otEnd 처리 (HH:mm 형식을 datetime으로 변환)
|
||||
if (!string.IsNullOrEmpty(otStart) && !string.IsNullOrEmpty(otEnd))
|
||||
{
|
||||
var otStartDateTime = DateTime.Parse($"{pdate} {otStart}:00");
|
||||
var otEndDateTime = DateTime.Parse($"{pdate} {otEnd}:00");
|
||||
cmd.Parameters.AddWithValue("@otStart", otStartDateTime);
|
||||
cmd.Parameters.AddWithValue("@otEnd", otEndDateTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@otStart", DBNull.Value);
|
||||
cmd.Parameters.AddWithValue("@otEnd", DBNull.Value);
|
||||
}
|
||||
|
||||
cn.Open();
|
||||
var result = cmd.ExecuteNonQuery();
|
||||
|
||||
Reference in New Issue
Block a user