20250213 承包商报告

This commit is contained in:
毕文静 2025-02-13 10:06:57 +08:00
parent e7fda0a3f8
commit 03025b4f69
7 changed files with 396 additions and 208 deletions

View File

@ -12,6 +12,7 @@ using System.Linq;
using Model; using Model;
using BLL.Common; using BLL.Common;
using FineUIPro.Web.common; using FineUIPro.Web.common;
using Org.BouncyCastle.Bcpg.OpenPgp;
namespace FineUIPro.Web.Evaluation namespace FineUIPro.Web.Evaluation
{ {
@ -350,6 +351,15 @@ namespace FineUIPro.Web.Evaluation
styleDate.BorderRight = BorderStyle.Thin; styleDate.BorderRight = BorderStyle.Thin;
styleDate.SetFont(cs_content_Font); styleDate.SetFont(cs_content_Font);
XSSFFont cs_content_FontBlod = (XSSFFont)hssfworkbook.CreateFont(); //创建字体
cs_content_FontBlod.FontName = "Arial";//字体
cs_content_FontBlod.FontHeightInPoints = 14; //字体大小
cs_content_FontBlod.IsBold = true;
ICellStyle styleBlod = hssfworkbook.CreateCellStyle();
styleBlod.VerticalAlignment = VerticalAlignment.Center;
styleBlod.Alignment = HorizontalAlignment.Center;
styleBlod.SetFont(cs_content_FontBlod);
string txtNo = "£"; string txtNo = "£";
var eva = Funs.DB.View_Contractor_Evaluation.FirstOrDefault(x => x.ID.ToString() == Grid1.SelectedRowID); var eva = Funs.DB.View_Contractor_Evaluation.FirstOrDefault(x => x.ID.ToString() == Grid1.SelectedRowID);
@ -389,7 +399,7 @@ namespace FineUIPro.Web.Evaluation
if (reportModel.GetRow(8).GetCell(2) == null) reportModel.GetRow(8).CreateCell(2); if (reportModel.GetRow(8).GetCell(2) == null) reportModel.GetRow(8).CreateCell(2);
reportModel.GetRow(8).GetCell(2).SetCellValue(eva.Spending_commitment != null ? eva.Spending_commitment.ToString() : ""); reportModel.GetRow(8).GetCell(2).SetCellValue(eva.Spending_commitment != null ? eva.Spending_commitment.ToString() : "");
if (reportModel.GetRow(8).GetCell(4) == null) reportModel.GetRow(8).CreateCell(4); if (reportModel.GetRow(8).GetCell(4) == null) reportModel.GetRow(8).CreateCell(4);
reportModel.GetRow(8).GetCell(4).SetCellValue(eva.Forecasted != null ? eva.Forecasted.ToString() : ""); reportModel.GetRow(8).GetCell(4).SetCellValue(eva.Forecasted.ToString());
if (reportModel.GetRow(8).GetCell(6) == null) reportModel.GetRow(8).CreateCell(6); if (reportModel.GetRow(8).GetCell(6) == null) reportModel.GetRow(8).CreateCell(6);
reportModel.GetRow(8).GetCell(6).SetCellValue(eva.Total != null ? eva.Total.ToString() : ""); reportModel.GetRow(8).GetCell(6).SetCellValue(eva.Total != null ? eva.Total.ToString() : "");
if (reportModel.GetRow(8).GetCell(8) == null) reportModel.GetRow(8).CreateCell(8); if (reportModel.GetRow(8).GetCell(8) == null) reportModel.GetRow(8).CreateCell(8);
@ -415,6 +425,119 @@ namespace FineUIPro.Web.Evaluation
DateTime startTime = DateTime.Parse(startDate.Year + "-" + startDate.Month + "-01"); DateTime startTime = DateTime.Parse(startDate.Year + "-" + startDate.Month + "-01");
DateTime endTime = DateTime.Parse(DateTime.Now.Year + "-" + DateTime.Now.Month + "-13"); DateTime endTime = DateTime.Parse(DateTime.Now.Year + "-" + DateTime.Now.Month + "-13");
//绩效评估最终计算是每月12日如果每月12日导出那么此上月的数据的报告分数不显示
if (DateTime.Now.Day <= 12)
{
DateTime dtime = DateTime.Now.AddMonths(-2);
endTime = DateTime.Parse(dtime.Year + "-" + dtime.Month + "-13");
}
else
{
DateTime dtime = DateTime.Now.AddMonths(-1);
endTime = DateTime.Parse(dtime.Year + "-" + dtime.Month + "-13");
}
int s = 0;
if (eva.IfExtend=="Y")//续签合同
{
List<SqlParameter> yearToDateParam = new List<SqlParameter>();
yearToDateParam.Add(new SqlParameter("@StartTime", startTime));
yearToDateParam.Add(new SqlParameter("@EndTime", endTime));
yearToDateParam.Add(new SqlParameter("@FoNo", eva.FO_NO));
SqlParameter[] yearToDateParList = yearToDateParam.ToArray();
var sesDataTable = SQLHelper.GetDataTableRunProc("Sp_ContractorEvaluation", yearToDateParList);
//上一轮合同
var fo = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(eva.FO_NO);
if (fo != null)
{
if (!string.IsNullOrEmpty(fo.PreviousFO))
{
List<SqlParameter> yearToDateParam2 = new List<SqlParameter>();
yearToDateParam2.Add(new SqlParameter("@StartTime", startTime));
yearToDateParam2.Add(new SqlParameter("@EndTime", endTime));
yearToDateParam2.Add(new SqlParameter("@FoNo", fo.PreviousFO));
SqlParameter[] yearToDateParList2 = yearToDateParam2.ToArray();
var sesDataTable2 = SQLHelper.GetDataTableRunProc("Sp_ContractorEvaluation", yearToDateParList2);
sesDataTable.Merge(sesDataTable2);//上一轮合同合并到续签合同中
}
}
var sesDataScore = JsonConvert.DeserializeObject<List<YearToDateModel>>(JsonConvert.SerializeObject(sesDataTable));
// 15行
if (reportModel.GetRow(14) == null) reportModel.CreateRow(14);
if (reportModel.GetRow(15) == null) reportModel.CreateRow(15);
if (reportModel.GetRow(16) == null) reportModel.CreateRow(16);
if (reportModel.GetRow(17) == null) reportModel.CreateRow(17);
if (reportModel.GetRow(18) == null) reportModel.CreateRow(18);
if (reportModel.GetRow(19) == null) reportModel.CreateRow(19);
if (reportModel.GetRow(20) == null) reportModel.CreateRow(20);
if (reportModel.GetRow(21) == null) reportModel.CreateRow(21);
if (reportModel.GetRow(22) == null) reportModel.CreateRow(22);
if (reportModel.GetRow(23) == null) reportModel.CreateRow(23);
if (reportModel.GetRow(24) == null) reportModel.CreateRow(24);
if (reportModel.GetRow(25) == null) reportModel.CreateRow(25);
for (int j = 0; j < 24; j++)
{
var curDate = DateTime.Parse("" + startDate.Year + "-" + startDate.Month + "-01").AddMonths(j);
if (j >= 0 && j < 12)
{
if (reportModel.GetRow(14 + j).GetCell(0) == null) reportModel.GetRow(14 + j).CreateCell(0);
reportModel.GetRow(14 + j).GetCell(0).SetCellValue(curDate.ToString("yyyy-MM"));
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
{
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
reportModel.GetRow(14 + j).GetCell(2).SetCellValue(yearNums);
//本期合同字体加粗
var sesFo = sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).FO_NO;
if (sesFo == eva.FO_NO)
{
reportModel.GetRow(14 + j).GetCell(2).CellStyle = styleBlod;
}
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{
s++;
}
}
else
{
reportModel.GetRow(14 + j).GetCell(2).SetCellValue("");
}
}
else
{
if (reportModel.GetRow(14 + j - 12).GetCell(3) == null) reportModel.GetRow(14 + j - 12).CreateCell(3);
reportModel.GetRow(14 + j - 12).GetCell(3).SetCellValue(curDate.ToString("yyyy-MM"));
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
{
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
reportModel.GetRow(14 + j - 12).GetCell(4).SetCellValue(yearNums);
//本期合同字体加粗
var sesFo = sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).FO_NO;
if (sesFo == eva.FO_NO)
{
reportModel.GetRow(14 + j - 12).GetCell(4).CellStyle = styleBlod;
}
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{
s++;
}
}
else
{
reportModel.GetRow(14 + j - 12).GetCell(4).SetCellValue("");
}
}
}
}
else
{
List<SqlParameter> yearToDateParam = new List<SqlParameter>(); List<SqlParameter> yearToDateParam = new List<SqlParameter>();
yearToDateParam.Add(new SqlParameter("@StartTime", startTime)); yearToDateParam.Add(new SqlParameter("@StartTime", startTime));
yearToDateParam.Add(new SqlParameter("@EndTime", endTime)); yearToDateParam.Add(new SqlParameter("@EndTime", endTime));
@ -437,46 +560,47 @@ namespace FineUIPro.Web.Evaluation
if (reportModel.GetRow(23) == null) reportModel.CreateRow(23); if (reportModel.GetRow(23) == null) reportModel.CreateRow(23);
if (reportModel.GetRow(24) == null) reportModel.CreateRow(24); if (reportModel.GetRow(24) == null) reportModel.CreateRow(24);
if (reportModel.GetRow(25) == null) reportModel.CreateRow(25); if (reportModel.GetRow(25) == null) reportModel.CreateRow(25);
int s = 0;
for (int j = 0; j < 24; j++)
{
var curDate = DateTime.Parse("" + startDate.Year + "-" + startDate.Month + "-01").AddMonths(j);
if (j >= 0 && j < 12)
{
if (reportModel.GetRow(14 + j).GetCell(0) == null) reportModel.GetRow(14 + j).CreateCell(0);
reportModel.GetRow(14 + j).GetCell(0).SetCellValue(curDate.ToString("yyyy-MM"));
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0) for (int j = 0; j < 24; j++)
{
var curDate = DateTime.Parse("" + startDate.Year + "-" + startDate.Month + "-01").AddMonths(j);
if (j >= 0 && j < 12)
{ {
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##"); if (reportModel.GetRow(14 + j).GetCell(0) == null) reportModel.GetRow(14 + j).CreateCell(0);
reportModel.GetRow(14 + j).GetCell(2).SetCellValue(yearNums); reportModel.GetRow(14 + j).GetCell(0).SetCellValue(curDate.ToString("yyyy-MM"));
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
{ {
s++; var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
reportModel.GetRow(14 + j).GetCell(2).SetCellValue(yearNums);
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{
s++;
}
}
else
{
reportModel.GetRow(14 + j).GetCell(2).SetCellValue("");
} }
} }
else else
{ {
reportModel.GetRow(14 + j).GetCell(2).SetCellValue(""); if (reportModel.GetRow(14 + j - 12).GetCell(3) == null) reportModel.GetRow(14 + j - 12).CreateCell(3);
} reportModel.GetRow(14 + j - 12).GetCell(3).SetCellValue(curDate.ToString("yyyy-MM"));
}
else
{
if (reportModel.GetRow(14 + j - 12).GetCell(3) == null) reportModel.GetRow(14 + j - 12).CreateCell(3);
reportModel.GetRow(14 + j - 12).GetCell(3).SetCellValue(curDate.ToString("yyyy-MM"));
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0) if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
{
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
reportModel.GetRow(14 + j - 12).GetCell(4).SetCellValue(yearNums);
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{ {
s++; var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
reportModel.GetRow(14 + j - 12).GetCell(4).SetCellValue(yearNums);
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{
s++;
}
}
else
{
reportModel.GetRow(14 + j - 12).GetCell(4).SetCellValue("");
} }
}
else
{
reportModel.GetRow(14 + j - 12).GetCell(4).SetCellValue("");
} }
} }
} }
@ -514,22 +638,29 @@ namespace FineUIPro.Web.Evaluation
if (reportModel.GetRow(40).GetCell(3) == null) reportModel.GetRow(40).CreateCell(3); if (reportModel.GetRow(40).GetCell(3) == null) reportModel.GetRow(40).CreateCell(3);
reportModel.GetRow(40).GetCell(3).SetCellValue(eva.OthersNum.ToString());//其他 reportModel.GetRow(40).GetCell(3).SetCellValue(eva.OthersNum.ToString());//其他
//43行 //43行
decimal? technicalBonusMalus = Funs.GetNewDecimal(eva.TechnicalBonusMalus); decimal? technicalBonusMalus = eva.TechnicalBonusMalus.HasValue ? Convert.ToDecimal(eva.TechnicalBonusMalus) : 0;
if (reportModel.GetRow(42).GetCell(3) == null) reportModel.GetRow(42).CreateCell(3); if (reportModel.GetRow(42).GetCell(3) == null) reportModel.GetRow(42).CreateCell(3);
reportModel.GetRow(42).GetCell(3).SetCellValue(technicalBonusMalus.ToString());//技术加值/减值 reportModel.GetRow(42).GetCell(3).SetCellValue(technicalBonusMalus.ToString()+"%");//技术减值
//44行 //44行
decimal? safetyBonus = Funs.GetNewDecimal(eva.SafetyBonus); decimal? safetyBonus = 0;
safetyBonus = Funs.GetNewDecimal(eva.SafetyBonus);
if (safetyBonus == null)
{
safetyBonus = 0;
}
if (reportModel.GetRow(43).GetCell(3) == null) reportModel.GetRow(43).CreateCell(3); if (reportModel.GetRow(43).GetCell(3) == null) reportModel.GetRow(43).CreateCell(3);
reportModel.GetRow(43).GetCell(3).SetCellValue(safetyBonus.ToString());//安全业绩加值 reportModel.GetRow(43).GetCell(3).SetCellValue(safetyBonus.HasValue ? safetyBonus.ToString() + "%" : "0");//安全业绩加值
//45行 //45行
decimal? totalSocre = technicalBonusMalus + safetyBonus;
if (reportModel.GetRow(44).GetCell(3) == null) reportModel.GetRow(44).CreateCell(3); if (reportModel.GetRow(44).GetCell(3) == null) reportModel.GetRow(44).CreateCell(3);
reportModel.GetRow(44).GetCell(3).SetCellValue((technicalBonusMalus + safetyBonus).ToString());//Total Score (Technical and Safety) reportModel.GetRow(44).GetCell(3).SetCellValue(totalSocre.HasValue ? totalSocre.ToString() + "%" : "");//Total Score (Technical and Safety)
//48行 //48行
string proposed = string.Empty;
string rs = string.Empty; string rs = string.Empty;
if (s >= 3 && eva.NCRTimes >= 3) if (s >= 3 && eva.NCRTimes >= 3)
{ {
rs = "序号1该合同累计3次月度评估低于60分, 不得参与下轮合同</br>序号2该合同累计三个NCR提前终止合同且不得参与下轮合同"; rs = "序号1该合同累计3次月度评估低于60分, 不得参与下轮合同\r\n序号2该合同累计三个NCR提前终止合同且不得参与下轮合同";
} }
else if (s >= 3) else if (s >= 3)
{ {
@ -539,9 +670,16 @@ namespace FineUIPro.Web.Evaluation
{ {
rs = "序号1该合同累计三个NCR提前终止合同且不得参与下轮合同"; rs = "序号1该合同累计三个NCR提前终止合同且不得参与下轮合同";
} }
if (!string.IsNullOrEmpty(eva.Proposed))
{
proposed = rs + "\r\n" + eva.Proposed;
}
else
{
proposed = rs;
}
if (reportModel.GetRow(47).GetCell(0) == null) reportModel.GetRow(47).CreateCell(0); if (reportModel.GetRow(47).GetCell(0) == null) reportModel.GetRow(47).CreateCell(0);
reportModel.GetRow(47).GetCell(0).SetCellValue(rs);//合同管理小组对该承包商在本合同期表现的评价 reportModel.GetRow(47).GetCell(0).SetCellValue(proposed);//合同管理小组对该承包商在本合同期表现的评价
//if (reportModel.GetRow(21).GetCell(6) == null) reportModel.GetRow(21).CreateCell(6); //if (reportModel.GetRow(21).GetCell(6) == null) reportModel.GetRow(21).CreateCell(6);
@ -825,7 +963,6 @@ namespace FineUIPro.Web.Evaluation
Response.WriteFile(filet.FullName); Response.WriteFile(filet.FullName);
// 停止页面的执行 // 停止页面的执行
Response.End(); Response.End();
} }
#endregion #endregion

View File

@ -5,7 +5,6 @@
<head runat="server"> <head runat="server">
<title>项目经理编辑器</title> <title>项目经理编辑器</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" /> <link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<%--<script src="../Controls/My97DatePicker/WdatePicker.js" type="text/javascript"></script>--%>
</head> </head>
<body> <body>
<form id="_form1" runat="server"> <form id="_form1" runat="server">
@ -266,7 +265,7 @@
<Rows> <Rows>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtSafetyBonus" runat="server" Label="Bonus of Safety Performance</br>安全业绩加分值" LabelWidth="240px"></f:TextBox> <f:NumberBox ID="txtSafetyBonus" runat="server" Label="Bonus of Safety Performance</br>安全业绩加分值%" LabelWidth="240px" NoNegative="true"></f:NumberBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
</Rows> </Rows>
@ -298,7 +297,7 @@
<Rows> <Rows>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtTechnicalBonus" runat="server" Label="Technical Bonus and Malus</br>技术加值及减值" LabelWidth="240px" Readonly="true"></f:TextBox> <f:TextBox ID="txtTechnicalBonus" runat="server" Label="Technical malus</br>技术减值(%" LabelWidth="240px" Readonly="true"></f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
</Rows> </Rows>

View File

@ -8,6 +8,7 @@ using System.Web.UI.WebControls;
using System.Data; using System.Data;
using System.Data.SqlClient; using System.Data.SqlClient;
using BLL; using BLL;
using System.Drawing;
namespace FineUIPro.Web.Evaluation namespace FineUIPro.Web.Evaluation
{ {
@ -118,11 +119,9 @@ namespace FineUIPro.Web.Evaluation
} }
// 框架合同信息 // 框架合同信息
txtSpending_commitment.Text = foview.First().Spending_commitment.ToString(); txtSpending_commitment.Text = foview.First().Spending_commitment.ToString();
if (foview.First().Forecasted.HasValue) txtForecasted.Text = foview.First().Forecasted.ToString();
{
txtForecasted.Text = foview.First().Forecasted.ToString();
}
txtTotal.Text = foview.First().Total.ToString(); txtTotal.Text = foview.First().Total.ToString();
txtYearAvg.Text = foview.First().YearAvg.ToString(); txtYearAvg.Text = foview.First().YearAvg.ToString();
txtFo.Text = foview.First().FO_NO; txtFo.Text = foview.First().FO_NO;
@ -160,9 +159,9 @@ namespace FineUIPro.Web.Evaluation
cbPriceLevel.SelectedValueArray = new string[] { foview.First().PriceLevel }; cbPriceLevel.SelectedValueArray = new string[] { foview.First().PriceLevel };
} }
txtEnumeration.Text = foview.First().Enumeration; txtEnumeration.Text = foview.First().Enumeration;
numInquiryTime.Text = foview.First().InterviewTimes.ToString(); numInquiryTime.Text = foview.First().InterviewTimes.ToString();//约谈
numNCRTime.Text = foview.First().NCRTimes.ToString(); numNCRTime.Text = foview.First().NCRTimes.ToString();//NCR
numWorkRe.Text = foview.First().RectificationTimes.ToString(); numWorkRe.Text = foview.First().RectificationTimes.ToString();//停工整改
txtGreenTimes.Text = foview.First().GreenTimes.ToString(); txtGreenTimes.Text = foview.First().GreenTimes.ToString();
txtYellowGreenTimes.Text = foview.First().YellowGreenTimes.ToString(); txtYellowGreenTimes.Text = foview.First().YellowGreenTimes.ToString();
txtYellowTimes.Text = foview.First().YellowTimes.ToString(); txtYellowTimes.Text = foview.First().YellowTimes.ToString();
@ -172,124 +171,119 @@ namespace FineUIPro.Web.Evaluation
{ {
cbNotAudit.Checked = true; cbNotAudit.Checked = true;
} }
// 主协调人
//if (foview.First().IsInquiry.HasValue)
//{
// if (foview.First().IsInquiry == true)
// {
// cbInquiry.SelectedValueArray = new string[] { "True" };
// }
// else
// {
// cbInquiry.SelectedValueArray = new string[] { "False" };
// }
//}
//if (foview.First().InquiryNum.HasValue)
//{
// numInquiryTime.Text = foview.First().InquiryNum.ToString();
//}
//if (foview.First().NCRIsReview.HasValue)
//{
// if (foview.First().NCRIsReview == true)
// {
// cbNCR.SelectedValueArray = new string[] { "True" };
// }
// else
// {
// cbNCR.SelectedValueArray = new string[] { "False" };
// }
//}
//if (foview.First().NCRReviewNum.HasValue)
//{
// numNCRTime.Text = foview.First().NCRReviewNum.ToString();
//}
//if (!string.IsNullOrEmpty(foview.First().AuditResult))
//{
// cbAuditResult.SelectedValueArray = new string[] { foview.First().AuditResult };
//}
//if (foview.First().BoQIsAudit.HasValue)
//{
// if (foview.First().BoQIsAudit == true)
// {
// cbBoQIsAudit.SelectedValueArray = new string[] { "True" };
// }
// else
// {
// cbBoQIsAudit.SelectedValueArray = new string[] { "False" };
// }
//}
//txtBoQ.Text = foview.First().BoQAuditComments;
//if (foview.First().IsOthers.HasValue)
//{
// if (foview.First().IsOthers == true)
// {
// cbIsOthers.SelectedValueArray = new string[] { "True" };
// }
// else
// {
// cbIsOthers.SelectedValueArray = new string[] { "False" };
// }
//}
//if (foview.First().OthersNum.HasValue)
//{
numOthers.Text = foview.First().OthersNum.ToString(); numOthers.Text = foview.First().OthersNum.ToString();
//} txtTechnicalBonus.Text = foview.First().TechnicalBonusMalus.ToString();
////txtOtherDef.Text = foview.First().OtherDef; if (!string.IsNullOrEmpty(foview.First().SafetyBonus))
txtTechnicalBonus.Text = foview.First().TechnicalBonusMalus; {
txtSafetyBonus.Text = foview.First().SafetyBonus; txtSafetyBonus.Text = Funs.GetNewDecimalOrZero(foview.First().SafetyBonus).ToString();
}
} }
else else
{ {
} }
int s = 0;
DateTime startDate = DateTime.Now.AddMonths(-23); DateTime startDate = DateTime.Now.AddMonths(-23);
DateTime startTime = DateTime.Parse(startDate.Year + "-" + startDate.Month + "-01"); DateTime startTime = DateTime.Parse(startDate.Year + "-" + startDate.Month + "-01");
DateTime endTime = DateTime.Parse(DateTime.Now.Year + "-" + DateTime.Now.Month + "-13"); DateTime endTime = DateTime.Parse(DateTime.Now.Year + "-" + DateTime.Now.Month + "-13");
//绩效评估最终计算是每月12日如果每月12日导出那么此上月的数据的报告分数不显示
List<SqlParameter> yearToDateParam = new List<SqlParameter>(); if (DateTime.Now.Day <= 12)
yearToDateParam.Add(new SqlParameter("@StartTime", startTime));
yearToDateParam.Add(new SqlParameter("@EndTime", endTime));
yearToDateParam.Add(new SqlParameter("@FoNo", foNo));
SqlParameter[] yearToDateParList = yearToDateParam.ToArray();
var sesDataTable = SQLHelper.GetDataTableRunProc("Sp_ContractorEvaluation", yearToDateParList);
var sesDataScore = JsonConvert.DeserializeObject<List<YearToDateModel>>(JsonConvert.SerializeObject(sesDataTable));
//var sesFoDataScore = sesDataScore.Where(p => p.FO_NO == foNo).ToList();
string strSql = "SELECT * FROM dbo.YearsScore";
DataTable dt = SQLHelper.GetDataTableRunText(strSql, null);
Grid1.DataSource = dt;
Grid1.DataBind();
int s = 0;
for (int j = 0; j < 24; j++)
{ {
var curDate = DateTime.Parse("" + startDate.Year + "-" + startDate.Month + "-01").AddMonths(j); DateTime dtime = DateTime.Now.AddMonths(-2);
endTime = DateTime.Parse(dtime.Year + "-" + dtime.Month + "-13");
}
else
{
DateTime dtime = DateTime.Now.AddMonths(-1);
endTime = DateTime.Parse(dtime.Year + "-" + dtime.Month + "-13");
}
if (j >= 0 && j < 12) if (cbIfExtend.Checked)//续签合同如果2年数据跨域两个合同期本合同周期的评分使用加粗字体
{
List<SqlParameter> yearToDateParam = new List<SqlParameter>();
yearToDateParam.Add(new SqlParameter("@StartTime", startTime));
yearToDateParam.Add(new SqlParameter("@EndTime", endTime));
yearToDateParam.Add(new SqlParameter("@FoNo", foNo));
SqlParameter[] yearToDateParList = yearToDateParam.ToArray();
var sesDataTable = SQLHelper.GetDataTableRunProc("Sp_ContractorEvaluation", yearToDateParList);
//上一轮合同
var fo = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(foNo);
if (fo != null)
{ {
Grid1.Rows[0].Values[j + 1] = curDate.ToString("yyyy-MM"); if (!string.IsNullOrEmpty(fo.PreviousFO))
if (j == 0)
{ {
Grid1.Rows[0].Values[j] = "1st Year"; List<SqlParameter> yearToDateParam2 = new List<SqlParameter>();
Grid1.Rows[1].Values[j] = ""; yearToDateParam2.Add(new SqlParameter("@StartTime", startTime));
Grid1.Rows[2].Values[j] = "2st Year"; yearToDateParam2.Add(new SqlParameter("@EndTime", endTime));
Grid1.Rows[3].Values[j] = ""; yearToDateParam2.Add(new SqlParameter("@FoNo", fo.PreviousFO));
SqlParameter[] yearToDateParList2 = yearToDateParam2.ToArray();
var sesDataTable2 = SQLHelper.GetDataTableRunProc("Sp_ContractorEvaluation", yearToDateParList2);
sesDataTable.Merge(sesDataTable2);
} }
else }
var sesDataScore = JsonConvert.DeserializeObject<List<YearToDateModel>>(JsonConvert.SerializeObject(sesDataTable));
string strSql = "SELECT * FROM dbo.YearsScore";
DataTable dt = SQLHelper.GetDataTableRunText(strSql, null);
Grid1.DataSource = dt;
Grid1.DataBind();
for (int j = 0; j < 24; j++)
{
var curDate = DateTime.Parse("" + startDate.Year + "-" + startDate.Month + "-01").AddMonths(j);
if (j >= 0 && j < 12)
{ {
Grid1.Rows[0].Values[j + 1] = curDate.ToString("yyyy-MM");
if (j == 0)
{
Grid1.Rows[0].Values[j] = "1st Year";
Grid1.Rows[1].Values[j] = "";
Grid1.Rows[2].Values[j] = "2st Year";
Grid1.Rows[3].Values[j] = "";
}
else
{
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
{
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
Grid1.Rows[1].Values[j + 1] = yearNums;
//设置字体加粗
var sesFo = sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).FO_NO;
if (sesFo == foNo)
{
Grid1.Rows[1].Values[j + 1] = "<font style='font-weight: bold'>" + yearNums + "</font>";
}
//记录小于60分的次数
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{
s++;
}
}
else
{
Grid1.Rows[1].Values[j + 1] = "";
}
}
}
if (j >= 12 && j < 24)
{
Grid1.Rows[2].Values[j - 11] = curDate.ToString("yyyy-MM");
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0) if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
{ {
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##"); var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
Grid1.Rows[1].Values[j + 1] = yearNums; Grid1.Rows[3].Values[j - 11] = yearNums;
//本期合同字体加粗
var sesFo = sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).FO_NO;
if (sesFo == foNo)
{
Grid1.Rows[3].Values[j - 11] = "<font style='font-weight: bold'>" + yearNums + "</font>";
}
//记录小于60的次数
if (Funs.GetNewDecimalOrZero(yearNums) < 60) if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{ {
s++; s++;
@ -297,33 +291,84 @@ namespace FineUIPro.Web.Evaluation
} }
else else
{ {
Grid1.Rows[1].Values[j + 1] = ""; Grid1.Rows[3].Values[j - 11] = "";
} }
} }
} }
if (j >= 12 && j < 24) }
else
{
List<SqlParameter> yearToDateParam = new List<SqlParameter>();
yearToDateParam.Add(new SqlParameter("@StartTime", startTime));
yearToDateParam.Add(new SqlParameter("@EndTime", endTime));
yearToDateParam.Add(new SqlParameter("@FoNo", foNo));
SqlParameter[] yearToDateParList = yearToDateParam.ToArray();
var sesDataTable = SQLHelper.GetDataTableRunProc("Sp_ContractorEvaluation", yearToDateParList);
var sesDataScore = JsonConvert.DeserializeObject<List<YearToDateModel>>(JsonConvert.SerializeObject(sesDataTable));
string strSql = "SELECT * FROM dbo.YearsScore";
DataTable dt = SQLHelper.GetDataTableRunText(strSql, null);
Grid1.DataSource = dt;
Grid1.DataBind();
for (int j = 0; j < 24; j++)
{ {
Grid1.Rows[2].Values[j - 11] = curDate.ToString("yyyy-MM"); var curDate = DateTime.Parse("" + startDate.Year + "-" + startDate.Month + "-01").AddMonths(j);
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
if (j >= 0 && j < 12)
{ {
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##"); Grid1.Rows[0].Values[j + 1] = curDate.ToString("yyyy-MM");
Grid1.Rows[3].Values[j - 11] = yearNums; if (j == 0)
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{ {
s++; Grid1.Rows[0].Values[j] = "1st Year";
Grid1.Rows[1].Values[j] = "";
Grid1.Rows[2].Values[j] = "2st Year";
Grid1.Rows[3].Values[j] = "";
} }
else
{
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
{
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
Grid1.Rows[1].Values[j + 1] = yearNums;
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{
s++;
}
}
else
{
Grid1.Rows[1].Values[j + 1] = "";
}
}
} }
else if (j >= 12 && j < 24)
{ {
Grid1.Rows[3].Values[j - 11] = ""; Grid1.Rows[2].Values[j - 11] = curDate.ToString("yyyy-MM");
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
{
var yearNums = float.Parse(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore).ToString("0.##");
Grid1.Rows[3].Values[j - 11] = yearNums;
if (Funs.GetNewDecimalOrZero(yearNums) < 60)
{
s++;
}
}
else
{
Grid1.Rows[3].Values[j - 11] = "";
}
} }
} }
} }
string rs = string.Empty; string rs = string.Empty;
if (s >= 3 && foview.First().NCRTimes >= 3) if (s >= 3 && foview.First().NCRTimes >= 3)
{ {
rs = "序号1该合同累计3次月度评估低于60分, 不得参与下轮合同</br>序号2该合同累计三个NCR提前终止合同且不得参与下轮合同"; rs = "序号1该合同累计3次月度评估低于60分, 不得参与下轮合同\r\n序号2该合同累计三个NCR提前终止合同且不得参与下轮合同";
} }
else if (s >= 3) else if (s >= 3)
{ {
@ -333,7 +378,14 @@ namespace FineUIPro.Web.Evaluation
{ {
rs = "序号1该合同累计三个NCR提前终止合同且不得参与下轮合同"; rs = "序号1该合同累计三个NCR提前终止合同且不得参与下轮合同";
} }
txtProposed.Text = rs;//foview.First().Proposed; if (!string.IsNullOrEmpty(foview.First().Proposed))
{
txtProposed.Text = rs + "\r\n" + foview.First().Proposed;
}
else
{
txtProposed.Text = rs;
}
} }
} }
@ -422,15 +474,15 @@ namespace FineUIPro.Web.Evaluation
newFo.TechnicalBonus = txtTechnicalBonus.Text.Trim(); newFo.TechnicalBonus = txtTechnicalBonus.Text.Trim();
var role = BLL.Sys_RoleService.GetRole(CurrUser.RoleId); var role = BLL.Sys_RoleService.GetRole(CurrUser.RoleId);
if (txtSafetyBonus.Text != string.Empty) //if (txtSafetyBonus.Text != string.Empty)
{ //{
newFo.SafetyBonus = txtSafetyBonus.Text.Trim(); newFo.SafetyBonus = txtSafetyBonus.Text.Trim();
} //}
else if (role != null && role.RoleName.Contains("CTS/S")) //else if (role != null && role.RoleName.Contains("CTS/S"))
{ //{
Alert.ShowInTop("若无加减分,请填写无!", MessageBoxIcon.Warning); // Alert.ShowInTop("若无加减分,请填写无!", MessageBoxIcon.Warning);
return; // return;
} //}
newFo.Proposed= txtProposed.Text.Trim(); newFo.Proposed= txtProposed.Text.Trim();

View File

@ -435,7 +435,7 @@ namespace FineUIPro.Web.Evaluation
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtSafetyBonus; protected global::FineUIPro.NumberBox txtSafetyBonus;
/// <summary> /// <summary>
/// GroupPanel6 控件。 /// GroupPanel6 控件。

View File

@ -20545,10 +20545,10 @@ namespace Model
private string _ShowViolationDegree; private string _ShowViolationDegree;
private string _Deleted;
private string _Blocked; private string _Blocked;
private string _Deleted;
public FC_SESReportView() public FC_SESReportView()
{ {
} }
@ -20889,22 +20889,6 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="VarChar(10)")]
public string Deleted
{
get
{
return this._Deleted;
}
set
{
if ((this._Deleted != value))
{
this._Deleted = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Blocked", DbType="VarChar(10)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Blocked", DbType="VarChar(10)")]
public string Blocked public string Blocked
{ {
@ -20920,6 +20904,22 @@ namespace Model
} }
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="VarChar(10)")]
public string Deleted
{
get
{
return this._Deleted;
}
set
{
if ((this._Deleted != value))
{
this._Deleted = value;
}
}
}
} }
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.FC_SignedContracts")] [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.FC_SignedContracts")]
@ -27718,7 +27718,7 @@ namespace Model
private string _VolumeAllocation; private string _VolumeAllocation;
private System.Nullable<decimal> _Forecasted; private decimal _Forecasted;
private string _ReviewOfFC; private string _ReviewOfFC;
@ -27752,11 +27752,11 @@ namespace Model
private string _Proposed; private string _Proposed;
private int _InterviewTimes; private System.Nullable<int> _InterviewTimes;
private int _NCRTimes; private System.Nullable<int> _NCRTimes;
private int _RectificationTimes; private System.Nullable<int> _RectificationTimes;
private int _GreenTimes; private int _GreenTimes;
@ -27774,7 +27774,7 @@ namespace Model
private string _PreviousFO; private string _PreviousFO;
private string _TechnicalBonusMalus; private System.Nullable<decimal> _TechnicalBonusMalus;
private System.Nullable<decimal> _Total; private System.Nullable<decimal> _Total;
@ -28056,8 +28056,8 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Forecasted", DbType="Decimal(18,2)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Forecasted", DbType="Decimal(18,2) NOT NULL")]
public System.Nullable<decimal> Forecasted public decimal Forecasted
{ {
get get
{ {
@ -28328,8 +28328,8 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterviewTimes", DbType="Int NOT NULL")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InterviewTimes", DbType="Int")]
public int InterviewTimes public System.Nullable<int> InterviewTimes
{ {
get get
{ {
@ -28344,8 +28344,8 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NCRTimes", DbType="Int NOT NULL")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NCRTimes", DbType="Int")]
public int NCRTimes public System.Nullable<int> NCRTimes
{ {
get get
{ {
@ -28360,8 +28360,8 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationTimes", DbType="Int NOT NULL")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationTimes", DbType="Int")]
public int RectificationTimes public System.Nullable<int> RectificationTimes
{ {
get get
{ {
@ -28504,8 +28504,8 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TechnicalBonusMalus", DbType="VarChar(51)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TechnicalBonusMalus", DbType="Decimal(20,3)")]
public string TechnicalBonusMalus public System.Nullable<decimal> TechnicalBonusMalus
{ {
get get
{ {