프로젝트정보에 우선순위 항목 추가(김태경s)
powerbi 용 프로젝트 정보 view 에 우선순위 값을 0에서 필드연결 ot/휴일 근무 집계표에 미승인데이터 표시가능해지고, ot+pms 같이 표시되게함(정봉석p)
This commit is contained in:
@@ -30,7 +30,7 @@ namespace FPJ0000.JobReport_
|
||||
|
||||
//this.tbProcess.Text = FCOMMON.info.Login.process;
|
||||
if (tbProcess.SelectedIndex < 0) tbProcess.SelectedIndex = 0;
|
||||
|
||||
this.cmbApploval.SelectedIndex = 0; //default : 승인
|
||||
this.tbSd.Text = DateTime.Now.Year.ToString() + "-01";
|
||||
this.tbEd.Text = DateTime.Now.Year.ToString() + "-12";
|
||||
this.Show();
|
||||
@@ -45,12 +45,22 @@ namespace FPJ0000.JobReport_
|
||||
//var taH = new dsReportTableAdapters.HolidayLIstTableAdapter();
|
||||
//taH.Fill(this.dsReport.HolidayLIst, tbMon.Text + "%");
|
||||
|
||||
var isReqData = cmbApploval.SelectedIndex > 0;
|
||||
string prcname = tbProcess.SelectedIndex < 1 ? "%" : tbProcess.Text.Trim();
|
||||
if (radType.Checked)
|
||||
this.ta.FillByOt2(this.dsReport.jobReport, FCOMMON.info.Login.gcode, prcname, tbSd.Text, tbEd.Text);
|
||||
if (isReqData)
|
||||
{
|
||||
this.ta.FillByOtReq(this.dsReport.jobReport, FCOMMON.info.Login.gcode, prcname, tbSd.Text, tbEd.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (radType.Checked)
|
||||
this.ta.FillByOt2(this.dsReport.jobReport, FCOMMON.info.Login.gcode, prcname, tbSd.Text, tbEd.Text);
|
||||
else if (radTypePMS.Checked)
|
||||
this.ta.FillByOtPMS(this.dsReport.jobReport, FCOMMON.info.Login.gcode, prcname, tbSd.Text, tbEd.Text);
|
||||
else
|
||||
this.ta.FillByOTAll(this.dsReport.jobReport, FCOMMON.info.Login.gcode, prcname, tbSd.Text, tbEd.Text);
|
||||
}
|
||||
|
||||
this.ta.FillByOtPMS(this.dsReport.jobReport, FCOMMON.info.Login.gcode, prcname, tbSd.Text, tbEd.Text);
|
||||
|
||||
|
||||
//그리드뷰 생성
|
||||
@@ -64,7 +74,7 @@ namespace FPJ0000.JobReport_
|
||||
this.dataGridView1.Columns.Add("이름", "이름");
|
||||
this.dataGridView1.Columns.Add("사번", "사번");
|
||||
|
||||
var otTitle = radType.Checked ? "연장" : "PMS";
|
||||
//var otTitle = radType.Checked ? "연장" : "PMS";
|
||||
|
||||
//이름/년도데이터추가
|
||||
var ymlist = dsReport.jobReport.OrderBy(t => t.yymm).GroupBy(t => t.yymm);
|
||||
@@ -73,14 +83,52 @@ namespace FPJ0000.JobReport_
|
||||
var drYm = ym.FirstOrDefault();
|
||||
var basehr = int.Parse(drYm.yymm.Substring(drYm.yymm.IndexOf('(')).Replace("(", "").Replace(")", ""));
|
||||
this.dataGridView1.Columns.Add(drYm.yymm, drYm.yymm.Substring(0, 7) + "\n휴일");// + "\r\n(" + basehr.ToString() + ")");
|
||||
this.dataGridView1.Columns.Add(drYm.yymm, $"({basehr})\n{otTitle}");
|
||||
if (isReqData)
|
||||
{
|
||||
this.dataGridView1.Columns.Add(drYm.yymm, $"({basehr})\n요청");
|
||||
}
|
||||
else if (radTypeAll.Checked)
|
||||
{
|
||||
this.dataGridView1.Columns.Add(drYm.yymm, $"({basehr})\n연장");
|
||||
this.dataGridView1.Columns.Add(drYm.yymm, $"({basehr})\nPMS");
|
||||
}
|
||||
else if (radType.Checked)
|
||||
{
|
||||
this.dataGridView1.Columns.Add(drYm.yymm, $"({basehr})\n연장");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dataGridView1.Columns.Add(drYm.yymm, $"({basehr})\nPMS");
|
||||
}
|
||||
|
||||
this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 2].Tag = basehr;
|
||||
this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 1].Tag = basehr;
|
||||
this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 2].DefaultCellStyle.Format = "N1";
|
||||
this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 1].DefaultCellStyle.Format = "N1";
|
||||
if (radTypeAll.Checked)
|
||||
{
|
||||
this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 3].Tag = basehr;
|
||||
this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 3].DefaultCellStyle.Format = "N1";
|
||||
}
|
||||
}
|
||||
this.dataGridView1.Columns.Add("subtotal", "합계\n휴일");
|
||||
this.dataGridView1.Columns.Add($"subtotal", $"합계\n{otTitle}");
|
||||
if (isReqData)
|
||||
{
|
||||
this.dataGridView1.Columns.Add($"subtotal", $"합계\n요청");
|
||||
}
|
||||
else if (radTypeAll.Checked)
|
||||
{
|
||||
this.dataGridView1.Columns.Add($"subtotal", $"합계\n연장");
|
||||
this.dataGridView1.Columns.Add($"subtotal", $"합계\nPMS");
|
||||
}
|
||||
else if (radType.Checked)
|
||||
{
|
||||
this.dataGridView1.Columns.Add($"subtotal", $"합계\n연장");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dataGridView1.Columns.Add($"subtotal", $"합계\nPMS");
|
||||
}
|
||||
|
||||
//이름으로 정렬해서 데이터를 가져온다
|
||||
var namelist = this.dsReport.jobReport.OrderBy(t => t.UserProcess + t.uname).GroupBy(t => t.uname);
|
||||
@@ -93,10 +141,11 @@ namespace FPJ0000.JobReport_
|
||||
rowdata.Add(drName.uname);
|
||||
rowdata.Add(drName.uid);
|
||||
|
||||
double User_sumhlOne = 0;
|
||||
double User_sumotOne = 0;
|
||||
|
||||
|
||||
double User_sumhl = 0;
|
||||
double User_sumot = 0;
|
||||
double User_sumhlAll = 0;
|
||||
double User_sumotAll = 0;
|
||||
|
||||
List<Boolean> high = new List<bool>();
|
||||
List<Boolean> low = new List<bool>();
|
||||
@@ -128,27 +177,62 @@ namespace FPJ0000.JobReport_
|
||||
//}
|
||||
|
||||
var sumhr = userDatas.Sum(t => t.hrs);
|
||||
double sumot = 0.0;
|
||||
double sumhl = 0.0;
|
||||
if (radType.Checked)
|
||||
double sumotOne = 0.0;
|
||||
double sumhlOne = 0.0;
|
||||
|
||||
double sumotAll = 0.0;
|
||||
double sumhlAll = 0.0;
|
||||
|
||||
if (isReqData)
|
||||
{
|
||||
sumot = userDatas.Sum(t => t.ot2);
|
||||
sumhl = userDatas.Sum(t => t.holyot2);
|
||||
sumotOne = userDatas.Sum(t => t.ot);
|
||||
sumhlOne = userDatas.Sum(t => t.holyot);
|
||||
}
|
||||
else if (radType.Checked)
|
||||
{
|
||||
sumotOne = userDatas.Sum(t => t.ot2);
|
||||
sumhlOne = userDatas.Sum(t => t.holyot2);
|
||||
}
|
||||
else if (radTypePMS.Checked)
|
||||
{
|
||||
sumotOne = userDatas.Sum(t => t.otPMS);
|
||||
sumhlOne = userDatas.Sum(t => t.holyotPMS);
|
||||
}
|
||||
else
|
||||
{
|
||||
sumot = userDatas.Sum(t => t.otPMS);
|
||||
sumhl = userDatas.Sum(t => t.holyotPMS);
|
||||
sumotOne = userDatas.Sum(t => t.ot2);
|
||||
sumhlOne = userDatas.Sum(t => t.holyot2);
|
||||
|
||||
sumotAll = userDatas.Sum(t => t.otPMS);
|
||||
sumhlAll = userDatas.Sum(t => t.holyotPMS);
|
||||
}
|
||||
|
||||
User_sumhl += sumhl;
|
||||
User_sumot += sumot;
|
||||
User_sumhlOne += sumhlOne;
|
||||
User_sumotOne += sumotOne;
|
||||
if (radTypeAll.Checked)
|
||||
{
|
||||
User_sumhlAll += sumhlAll;
|
||||
User_sumotAll += sumotAll;
|
||||
}
|
||||
|
||||
|
||||
if (sumhlOne == 0.0) rowdata.Add(null);
|
||||
else rowdata.Add($"{Math.Round(sumhlOne, 1)}");
|
||||
|
||||
if (sumotOne == 0.0) rowdata.Add(null);
|
||||
else rowdata.Add($"{Math.Round(sumotOne, 1)}");
|
||||
|
||||
//전체라면 합계를 추가
|
||||
if (isReqData == false && radTypeAll.Checked)
|
||||
{
|
||||
if (sumhlAll == 0.0) rowdata.Add(null);
|
||||
else rowdata.Add($"{Math.Round(sumhlAll, 1)}");
|
||||
|
||||
if (sumotAll == 0.0) rowdata.Add(null);
|
||||
else rowdata.Add($"{Math.Round(sumotAll, 1)}");
|
||||
}
|
||||
|
||||
if (sumhl == 0.0) rowdata.Add(null);
|
||||
else rowdata.Add($"{Math.Round(sumhl,1)}");
|
||||
|
||||
if (sumot == 0.0) rowdata.Add(null);
|
||||
else rowdata.Add($"{Math.Round(sumot,1)}");
|
||||
|
||||
if (sumhr > basehr) high.Add(true);
|
||||
else high.Add(false);
|
||||
@@ -159,8 +243,16 @@ namespace FPJ0000.JobReport_
|
||||
}
|
||||
|
||||
|
||||
rowdata.Add($"{Math.Round(User_sumhl,1)}"); //합게
|
||||
rowdata.Add($"{Math.Round(User_sumot,1)}"); //합게
|
||||
rowdata.Add($"{Math.Round(User_sumhlOne, 1)}"); //합게
|
||||
rowdata.Add($"{Math.Round(User_sumotOne, 1)}"); //합게
|
||||
|
||||
if (isReqData == false && radTypeAll.Checked)
|
||||
{
|
||||
rowdata.Add($"{Math.Round(User_sumhlAll, 1)}"); //합게
|
||||
rowdata.Add($"{Math.Round(User_sumotAll, 1)}"); //합게
|
||||
}
|
||||
|
||||
|
||||
dataGridView1.Rows.Add(rowdata.ToArray());
|
||||
|
||||
//이번에 추가한 줄의 셀 컬러를 지정한다
|
||||
@@ -176,7 +268,7 @@ namespace FPJ0000.JobReport_
|
||||
}
|
||||
else
|
||||
{
|
||||
if (col.HeaderText.Contains(otTitle))
|
||||
if (col.HeaderText.Contains("요청") || col.HeaderText.Contains("연장") || col.HeaderText.Contains("PMS"))
|
||||
dataGridView1.Rows[currentrow].Cells[i].Style.BackColor = Color.Linen;// 155,82,93);
|
||||
else
|
||||
dataGridView1.Rows[currentrow].Cells[i].Style.BackColor = Color.White;
|
||||
@@ -199,7 +291,7 @@ namespace FPJ0000.JobReport_
|
||||
List<object> rowdata2 = new List<object>();
|
||||
rowdata2.Add("합계");
|
||||
rowdata2.Add(dataGridView1.Rows.Count);
|
||||
rowdata2.Add(null);
|
||||
rowdata2.Add(null); //사번
|
||||
for (int i = 0; i < this.dataGridView1.ColumnCount; i++)
|
||||
{
|
||||
var col = this.dataGridView1.Columns[i];
|
||||
@@ -235,5 +327,12 @@ namespace FPJ0000.JobReport_
|
||||
{
|
||||
dataGridView1.ExportData(string.Empty);
|
||||
}
|
||||
|
||||
private void cmbApploval_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
radType.Enabled = cmbApploval.SelectedIndex == 0;
|
||||
radTypeAll.Enabled = cmbApploval.SelectedIndex == 0;
|
||||
radTypePMS.Enabled = cmbApploval.SelectedIndex == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user