Basf_FCL/FCL/FineUIPro.Web/Evaluation/ContractorEvaluation.aspx.cs

1103 lines
59 KiB
C#
Raw Normal View History

2024-05-08 10:17:02 +08:00
using BLL;
using NPOI.XSSF.UserModel;
using NPOI.SS.UserModel;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using Model;
using BLL.Common;
using FineUIPro.Web.common;
2025-02-13 10:06:57 +08:00
using Org.BouncyCastle.Bcpg.OpenPgp;
2024-05-08 10:17:02 +08:00
namespace FineUIPro.Web.Evaluation
{
public partial class ContractorEvaluation : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();
BindGrid();
}
}
private void BindGrid()
{
string strSql = @"SELECT * from View_Contractor_Evaluation WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(txtFO_NO.Text.Trim()))
{
strSql += " AND FO_NO LIKE @FO_NO";
listStr.Add(new SqlParameter("@FO_NO", "%" + this.txtFO_NO.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table.DefaultView;
Grid1.DataBind();
}
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
protected void Grid1_RowSelect(object sender, GridRowSelectEventArgs e)
{
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
{
GetButtonPower();
var depart = BLL.DepartService.GetDepartById(CurrUser.DepartId);
string rowId = this.Grid1.SelectedRowID;
var sESRelatedData = BLL.SESRelatedDataService.GetSESRelatedDataById(rowId);
if (sESRelatedData != null)
{
if (CurrUser.UserId == Const.GlyId || CurrUser.UserId == sESRelatedData.Main_Coordinator || CurrUser.UserId == sESRelatedData.BuyerId || (depart != null && depart.DepartCode.Contains("CT/K")))
{
btnEdit.Hidden = false;
this.Grid1.EnableRowDoubleClickEvent = true;
}
else
{
btnEdit.Hidden = true;
this.Grid1.EnableRowDoubleClickEvent = false;
}
}
}
}
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Text_TextChanged(object sender, EventArgs e)
{
BindGrid();
}
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
protected void btnEdit_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInParent("Please select at least one record!");
return;
}
string Id = Grid1.SelectedRowID;
var fo = BLL.SESRelatedDataService.GetSESRelatedDataById(Id);
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContractorEvaluationEdit.aspx?foNo={0}", fo.FO_NO, "编辑 - ")));
}
#region
/// <summary>
/// 过期提醒邮件发送
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSendEmail_Click(object sender, EventArgs e)
{
bool IsComplite = false;
string errorMsg = string.Empty;
string compMsg = string.Empty;
// 过期提示,30天范围
var foList = from x in Funs.DB.FC_SESRelatedData
where x.Expire_Date != null
2024-06-04 14:03:46 +08:00
&& x.Expire_Date.Value.AddMonths(-6).AddDays(-7).Date <= DateTime.Now.Date
2024-05-08 10:17:02 +08:00
&& x.Expire_Date.Value.Date >= DateTime.Now.Date
select x;
if (foList.Count() > 0)
{
foreach (var fo in foList)
{
List<Model.Sys_User> userList = new List<Sys_User>();
EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
if (pops == null)
{
return;
}
string[] mailTo = null;
string mailBody = string.Empty;
string mailAttch = string.Empty;
string mailCode = string.Empty;
string mailPriority = string.Empty;
string[] mailCC = null;
string resultMessage = "";
string departId = string.Empty;
var discipline = BLL.DisciplineService.GetDisciplineById(fo.DisciplineId);
//string disc = discipline.Discipline;
//if (!string.IsNullOrEmpty(discipline.DisciplineCN))
//{
// disc = disc + " " + discipline.DisciplineCN;
//}
var contractAdmin = from x in Funs.DB.Sys_User where x.UserId == fo.Contract_Admin && x.Email != null && x.Email != "" select x;
if (contractAdmin.Count() > 0)
{
userList.Add(contractAdmin.First());
}
var buyer = from x in Funs.DB.Sys_User where x.UserName == fo.Buyer && x.Email != null && x.Email != "" select x;
if (buyer.Count() > 0)
{
userList.Add(buyer.First());
}
var mainCoor = from x in Funs.DB.Sys_User where x.UserId == fo.Main_Coordinator && x.Email != null && x.Email != "" select x;
if (mainCoor.Count() > 0)
{
userList.Add(mainCoor.First());
}
var userRepresentative = from x in Funs.DB.Sys_User where x.UserId == fo.User_Representative && x.Email != null && x.Email != "" select x;
if (userRepresentative.Count() > 0)
{
userList.Add(userRepresentative.First());
}
2024-05-16 10:17:34 +08:00
// CT/K部门去掉
//var ctk = from x in Funs.DB.Sys_User
// join z in Funs.DB.Base_Depart on x.DepartId equals z.DepartId
// where z.DepartCode == "CT/K" && x.Email != null && x.Email != ""
// select x;
//if (ctk.Count() > 0)
//{
// foreach (var c in ctk)
// {
// userList.Add(c);
// }
//}
2024-05-08 10:17:02 +08:00
var ctss = from x in Funs.DB.Sys_User
join y in Funs.DB.Sys_Role on x.RoleId equals y.RoleId
where y.RoleName == "CTS/S" && x.Email != null && x.Email != ""
select x;
if (ctss.Count() > 0)
{
foreach (var c in ctss)
{
userList.Add(c);
}
}
var cc = from x in Funs.DB.Sys_User
join y in Funs.DB.Sys_Role on x.RoleId equals y.RoleId
where x.Email != null && x.Email != ""
&& (y.RoleName == "CTE/D Manager" || y.RoleName == "Cost Engineer Leader" || y.RoleName == "Contractor_Leader")
select x;
mailTo = userList.Select(x => x.Email).Distinct().ToArray();
mailCC = cc.Select(x => x.Email).ToArray();
var email = Funs.DB.SendEmail.Where(p => p.EmailStatus == "发送成功"
&& p.EmailTile.Contains("框架合同评估表") && p.EmailTile.Contains(discipline.Discipline.Replace("\r\n", ""))
&& p.EmailTile.Contains(fo.FO_NO) && mailTo.Contains(p.EmailURL)).ToList();
if (email.Count > 0)
{
var emailurl = email.Select(p => p.EmailURL).ToList();
mailTo = mailTo.Where(p => !emailurl.Contains(p)).ToArray();
}
//if (mailTo == null || mailTo.Length == 0) return;
if (mailTo != null && mailTo.Length > 0)
{
var EmailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("框架合同评估"));
if (EmailTemplate.Count() > 0)
{
string templetpath = EmailTemplate.Select(p => p.EmailContext).FirstOrDefault();
NameValueCollection myCol = new NameValueCollection();
mailBody = TemplateHelper.BulidByFile2(templetpath, myCol);
IsComplite = MailHelper.SendNetMail1(pops, pops.EmailYx, mailTo, fo.FO_NO + "-" + discipline.Discipline.Replace("\r\n", "") + " 框架合同评估表填写通知", mailBody, mailAttch, mailCode, mailPriority, mailCC, null, out resultMessage);
if (IsComplite)
{
compMsg = compMsg + "合同:" + fo.FO_NO + ",专业:" + discipline.Discipline.Replace("\r\n", "") + ",框架合同评估表填写通知邮件发送成功!";
}
else
{
errorMsg = errorMsg + "合同:" + fo.FO_NO + ",专业:" + discipline.Discipline.Replace("\r\n", "") + ",框架合同评估表填写通知邮件发送失败!";
}
}
}
}
if (compMsg == string.Empty && errorMsg == string.Empty)
{
Alert.ShowInParent("框架合同评估表填写通知邮件已发送!");
}
else
{
Alert.ShowInParent(compMsg + errorMsg);
}
}
else
{
Alert.ShowInParent("无框架合同评估表填写通知邮件需发送!");
return;
}
}
#endregion
#region
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnExport_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
//模板文件
string TempletFileName = rootPath + "承包商评估表.xlsx";
//导出文件
string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
string ReportFileName = filePath + "out.xlsx";
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
XSSFWorkbook hssfworkbook = new XSSFWorkbook(file);
#region FC_List
XSSFSheet reportModel = (XSSFSheet)hssfworkbook.GetSheet("Sheet1");
IDataFormat dataformat = hssfworkbook.CreateDataFormat();
ICellStyle styleQfw = hssfworkbook.CreateCellStyle();
styleQfw.DataFormat = dataformat.GetFormat("#,##0.00");
ICellStyle styleTime = hssfworkbook.CreateCellStyle();
styleTime.DataFormat = dataformat.GetFormat("yyyy/m/d HH:mm:ss");
XSSFFont content_Font = (XSSFFont)hssfworkbook.CreateFont(); //创建字体
content_Font.FontName = "Wingdings 2";//字体
content_Font.FontHeightInPoints = 11; //字体大小
2025-02-14 09:41:39 +08:00
XSSFFont contentArial_Font = (XSSFFont)hssfworkbook.CreateFont(); //创建字体
contentArial_Font.FontName = "Arial";//字体
contentArial_Font.FontHeightInPoints = 11; //字体大小
ICellStyle styleArialFont = hssfworkbook.CreateCellStyle();
styleArialFont.VerticalAlignment = VerticalAlignment.Center;
styleArialFont.SetFont(contentArial_Font);
XSSFFont contentNoAduit_Font = (XSSFFont)hssfworkbook.CreateFont(); //创建字体
contentNoAduit_Font.FontName = "Arial";//字体
contentNoAduit_Font.FontHeightInPoints = 11; //字体大小
ICellStyle styleNoAduitFont = hssfworkbook.CreateCellStyle();
styleNoAduitFont.VerticalAlignment = VerticalAlignment.Center;
styleNoAduitFont.Alignment = HorizontalAlignment.Right;
styleNoAduitFont.SetFont(contentNoAduit_Font);
2024-05-08 10:17:02 +08:00
XSSFFont cs_content_Font = (XSSFFont)hssfworkbook.CreateFont(); //创建字体
cs_content_Font.FontName = "宋体";//字体
cs_content_Font.FontHeightInPoints = 8; //字体大小
ICellStyle styleDate = hssfworkbook.CreateCellStyle();
styleDate.DataFormat = dataformat.GetFormat("yyyy/m/d");
styleDate.VerticalAlignment= VerticalAlignment.Center;
styleDate.Alignment= HorizontalAlignment.Center;
styleDate.BorderTop = BorderStyle.Thin;
styleDate.BorderRight = BorderStyle.Thin;
styleDate.SetFont(cs_content_Font);
2025-02-13 10:06:57 +08:00
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);
2024-05-08 10:17:02 +08:00
string txtNo = "£";
var eva = Funs.DB.View_Contractor_Evaluation.FirstOrDefault(x => x.ID.ToString() == Grid1.SelectedRowID);
if (eva != null)
{
//4行
if (reportModel.GetRow(3) == null) reportModel.CreateRow(3);
if (reportModel.GetRow(3).GetCell(2) == null) reportModel.GetRow(3).CreateCell(2);
reportModel.GetRow(3).GetCell(2).SetCellValue(eva.Discipline);
2024-09-18 10:36:26 +08:00
//6行
if (reportModel.GetRow(5) == null) reportModel.CreateRow(5);
if (reportModel.GetRow(5).GetCell(2) == null) reportModel.GetRow(5).CreateCell(2);
reportModel.GetRow(5).GetCell(2).SetCellValue(eva.FO_NO);
if (reportModel.GetRow(5).GetCell(6) == null) reportModel.GetRow(5).CreateCell(6);
2024-05-08 10:17:02 +08:00
if (eva.Validate_Date.HasValue)
{
2024-09-18 10:36:26 +08:00
reportModel.GetRow(5).GetCell(6).SetCellValue(eva.Validate_Date.Value.ToString("yyyy/MM/dd"));
2024-05-08 10:17:02 +08:00
//reportModel.GetRow(6).GetCell(6).CellStyle = styleDate;
}
2024-09-18 10:36:26 +08:00
if (reportModel.GetRow(5).GetCell(8) == null) reportModel.GetRow(5).CreateCell(8);
2024-05-08 10:17:02 +08:00
if (eva.Expire_Date.HasValue)
{
2024-09-18 10:36:26 +08:00
reportModel.GetRow(5).GetCell(8).SetCellValue(eva.Expire_Date.Value.ToString("yyyy/MM/dd"));
2024-05-08 10:17:02 +08:00
//reportModel.GetRow(6).GetCell(8).CellStyle = styleDate;
}
2024-09-18 10:36:26 +08:00
//7行
if (reportModel.GetRow(6) == null) reportModel.CreateRow(6);
if (reportModel.GetRow(6).GetCell(2) == null) reportModel.GetRow(6).CreateCell(2);
reportModel.GetRow(6).GetCell(2).SetCellValue(eva.Contractor);
if (reportModel.GetRow(6).GetCell(8) == null) reportModel.GetRow(6).CreateCell(8);
reportModel.GetRow(6).GetCell(8).SetCellValue(eva.VolumeAllocation);
2024-05-08 10:17:02 +08:00
//9行
if (reportModel.GetRow(8) == null) reportModel.CreateRow(8);
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() : "");
if (reportModel.GetRow(8).GetCell(4) == null) reportModel.GetRow(8).CreateCell(4);
2025-02-13 10:06:57 +08:00
reportModel.GetRow(8).GetCell(4).SetCellValue(eva.Forecasted.ToString());
2024-05-08 10:17:02 +08:00
if (reportModel.GetRow(8).GetCell(6) == null) reportModel.GetRow(8).CreateCell(6);
reportModel.GetRow(8).GetCell(6).SetCellValue(eva.Total != null ? eva.Total.ToString() : "");
if (reportModel.GetRow(8).GetCell(8) == null) reportModel.GetRow(8).CreateCell(8);
reportModel.GetRow(8).GetCell(8).SetCellValue(eva.YearAvg != null ? eva.YearAvg.ToString() : "");
2025-01-22 14:30:40 +08:00
//10行
if (reportModel.GetRow(9) == null) reportModel.CreateRow(9);
if (reportModel.GetRow(9).GetCell(2) == null) reportModel.GetRow(9).CreateCell(2);
reportModel.GetRow(9).GetCell(2).SetCellValue(eva.IfExtend);//是否为续签合同
if (reportModel.GetRow(9).GetCell(4) == null) reportModel.GetRow(9).CreateCell(4);
reportModel.GetRow(9).GetCell(4).SetCellValue(eva.PreviousFO);//续签前合同
var previous = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(eva.PreviousFO);
if (previous != null)
{
if (reportModel.GetRow(9).GetCell(6) == null) reportModel.GetRow(9).CreateCell(6);
reportModel.GetRow(9).GetCell(6).SetCellValue(previous.Validate_Date.HasValue ? string.Format("{0:yyyy-MM-dd}", previous.Validate_Date) : "");//合同生效日
if (reportModel.GetRow(9).GetCell(8) == null) reportModel.GetRow(9).CreateCell(8);
reportModel.GetRow(9).GetCell(8).SetCellValue(previous.Expire_Date.HasValue ? string.Format("{0:yyyy-MM-dd}", previous.Expire_Date) : "");//合同结束日
2025-02-13 14:47:54 +08:00
}
2025-01-22 14:30:40 +08:00
2024-05-08 10:17:02 +08:00
// 左边列表
2025-02-13 14:47:54 +08:00
int s = 0;
2024-05-08 10:17:02 +08:00
DateTime startDate = DateTime.Now.AddMonths(-23);
DateTime startTime = DateTime.Parse(startDate.Year + "-" + startDate.Month + "-01");
DateTime endTime = DateTime.Parse(DateTime.Now.Year + "-" + DateTime.Now.Month + "-13");
2025-02-13 10:06:57 +08:00
//绩效评估最终计算是每月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");
}
2025-02-14 09:41:39 +08:00
if (eva.IfExtend == "Y")//续签合同
2025-02-13 10:06:57 +08:00
{
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);
2025-02-14 09:41:39 +08:00
2025-02-13 10:06:57 +08:00
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
2025-02-14 09:41:39 +08:00
{
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 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);
2025-02-13 10:06:57 +08:00
for (int j = 0; j < 24; j++)
2024-05-08 10:17:02 +08:00
{
2025-02-13 10:06:57 +08:00
var curDate = DateTime.Parse("" + startDate.Year + "-" + startDate.Month + "-01").AddMonths(j);
if (j >= 0 && j < 12)
2024-05-08 10:17:02 +08:00
{
2025-02-13 10:06:57 +08:00
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)
2025-01-22 14:30:40 +08:00
{
2025-02-13 10:06:57 +08:00
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("");
2025-01-22 14:30:40 +08:00
}
2024-05-08 10:17:02 +08:00
}
else
{
2025-02-13 10:06:57 +08:00
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"));
2024-05-08 10:17:02 +08:00
2025-02-13 10:06:57 +08:00
if (sesDataScore.Count(p => p.dataMonth == curDate.ToString("yyyy-MM")) > 0 && Funs.GetNewDecimal(sesDataScore.FirstOrDefault(p => p.dataMonth == curDate.ToString("yyyy-MM")).SumScore) > 0)
2025-01-22 14:30:40 +08:00
{
2025-02-13 10:06:57 +08:00
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("");
2025-01-22 14:30:40 +08:00
}
2024-05-08 10:17:02 +08:00
}
}
}
2025-01-22 14:30:40 +08:00
if (reportModel.GetRow(13).GetCell(5) == null) reportModel.GetRow(13).CreateCell(5);
2025-02-13 14:47:54 +08:00
reportModel.GetRow(13).GetCell(5).SetCellValue(eva.Enumeration);//有无其他潜在承包商政府类OEM若有请列举
2024-05-08 10:17:02 +08:00
if (reportModel.GetRow(17).GetCell(6) == null) reportModel.GetRow(17).CreateCell(6);
2025-02-13 14:47:54 +08:00
reportModel.GetRow(17).GetCell(6).SetCellValue(eva.PriceEvaluation1);//参照1
2025-01-22 14:30:40 +08:00
if (reportModel.GetRow(18).GetCell(6) == null) reportModel.GetRow(18).CreateCell(6);
2025-02-13 14:47:54 +08:00
reportModel.GetRow(18).GetCell(6).SetCellValue(eva.PriceEvaluation2);//参照2
2025-02-14 09:41:39 +08:00
2025-02-13 14:47:54 +08:00
//价格水平
if (reportModel.GetRow(21).GetCell(6) == null) reportModel.GetRow(21).CreateCell(6);
2025-02-14 09:41:39 +08:00
//很高
if (eva.PriceLevel == "1")
{
reportModel.GetRow(21).GetCell(6).SetCellValue("☑");
reportModel.GetRow(21).GetCell(6).CellStyle = styleArialFont;
}
else
{
reportModel.GetRow(21).GetCell(6).SetCellValue(txtNo);
reportModel.GetRow(21).GetCell(6).CellStyle.SetFont(content_Font);
}
2025-02-13 14:47:54 +08:00
if (reportModel.GetRow(22).GetCell(6) == null) reportModel.GetRow(22).CreateCell(6);
2025-02-14 09:41:39 +08:00
//较高
if (eva.PriceLevel == "2")
{
reportModel.GetRow(22).GetCell(6).SetCellValue("☑");
reportModel.GetRow(22).GetCell(6).CellStyle = styleArialFont;
}
else
{
reportModel.GetRow(22).GetCell(6).SetCellValue(txtNo);
reportModel.GetRow(22).GetCell(6).CellStyle.SetFont(content_Font);
}
2025-02-13 14:47:54 +08:00
if (reportModel.GetRow(23).GetCell(6) == null) reportModel.GetRow(23).CreateCell(6);
2025-02-14 09:41:39 +08:00
//适宜
if (eva.PriceLevel == "3")
{
reportModel.GetRow(23).GetCell(6).SetCellValue("☑");
reportModel.GetRow(23).GetCell(6).CellStyle = styleArialFont;
}
else
{
reportModel.GetRow(23).GetCell(6).SetCellValue(txtNo);
reportModel.GetRow(23).GetCell(6).CellStyle.SetFont(content_Font);
}
2025-02-13 14:47:54 +08:00
if (reportModel.GetRow(24).GetCell(6) == null) reportModel.GetRow(24).CreateCell(6);
2025-02-14 09:41:39 +08:00
//较低
if (eva.PriceLevel == "4")
{
reportModel.GetRow(24).GetCell(6).SetCellValue("☑");
reportModel.GetRow(24).GetCell(6).CellStyle = styleArialFont;
}
else
{
reportModel.GetRow(24).GetCell(6).SetCellValue(txtNo);
reportModel.GetRow(24).GetCell(6).CellStyle.SetFont(content_Font);
}
2025-02-13 14:47:54 +08:00
if (reportModel.GetRow(25).GetCell(6) == null) reportModel.GetRow(25).CreateCell(6);
2025-02-14 09:41:39 +08:00
//很低
if (eva.PriceLevel == "5")
{
reportModel.GetRow(25).GetCell(6).SetCellValue("☑");
reportModel.GetRow(25).GetCell(6).CellStyle = styleArialFont;
}
else
{
reportModel.GetRow(25).GetCell(6).SetCellValue(txtNo);
reportModel.GetRow(25).GetCell(6).CellStyle.SetFont(content_Font);
}
2025-01-22 14:30:40 +08:00
if (reportModel.GetRow(27).GetCell(2) == null) reportModel.GetRow(27).CreateCell(2);
reportModel.GetRow(27).GetCell(2).SetCellValue(eva.InterviewTimes.ToString());//约谈次数
if (reportModel.GetRow(27).GetCell(5) == null) reportModel.GetRow(27).CreateCell(5);
2025-02-13 14:47:54 +08:00
reportModel.GetRow(27).GetCell(5).SetCellValue(eva.ReviewOfFC);//原合同竞标/续签过程回顾
2025-01-22 14:30:40 +08:00
if (reportModel.GetRow(30).GetCell(2) == null) reportModel.GetRow(30).CreateCell(2);
reportModel.GetRow(30).GetCell(2).SetCellValue(eva.NCRTimes.ToString());//NCR次数
if (reportModel.GetRow(33).GetCell(2) == null) reportModel.GetRow(33).CreateCell(2);
reportModel.GetRow(33).GetCell(2).SetCellValue(eva.RectificationTimes.ToString());//停工整改次数
//框架合同EHSQ审计结果
if (reportModel.GetRow(36).GetCell(2) == null) reportModel.GetRow(36).CreateCell(2);
reportModel.GetRow(36).GetCell(2).SetCellValue(eva.GreenTimes.ToString());//绿区次数
if (reportModel.GetRow(36).GetCell(4) == null) reportModel.GetRow(36).CreateCell(4);
reportModel.GetRow(36).GetCell(4).SetCellValue(eva.YellowGreenTimes.ToString());//黄绿区次数
if (reportModel.GetRow(37).GetCell(2) == null) reportModel.GetRow(37).CreateCell(2);
reportModel.GetRow(37).GetCell(2).SetCellValue(eva.YellowTimes.ToString());//黄区次数
if (reportModel.GetRow(37).GetCell(4) == null) reportModel.GetRow(37).CreateCell(4);
reportModel.GetRow(37).GetCell(4).SetCellValue(eva.RedYellowTimes.ToString());//红黄区次数
if (reportModel.GetRow(38).GetCell(2) == null) reportModel.GetRow(38).CreateCell(2);
reportModel.GetRow(38).GetCell(2).SetCellValue(eva.RedTimes.ToString());//红区次数
if (reportModel.GetRow(38).GetCell(3) == null) reportModel.GetRow(38).CreateCell(3);
2025-02-14 09:41:39 +08:00
//不在审计清单
if (eva.NotAudit == "√")
{
reportModel.GetRow(38).GetCell(3).SetCellValue("☑");
reportModel.GetRow(38).GetCell(3).CellStyle = styleNoAduitFont;
}
else
{
reportModel.GetRow(38).GetCell(3).SetCellValue(txtNo);
reportModel.GetRow(38).GetCell(3).CellStyle.SetFont(content_Font);
}
2025-01-22 14:30:40 +08:00
//41行
if (reportModel.GetRow(40).GetCell(3) == null) reportModel.GetRow(40).CreateCell(3);
reportModel.GetRow(40).GetCell(3).SetCellValue(eva.OthersNum.ToString());//其他
//43行
2025-02-13 14:47:54 +08:00
decimal? technicalBonusMalus = eva.TechnicalBonusMalus.HasValue ? Convert.ToDecimal(eva.TechnicalBonusMalus.Value.ToString("0.0")) : 0;
2025-01-22 14:30:40 +08:00
if (reportModel.GetRow(42).GetCell(3) == null) reportModel.GetRow(42).CreateCell(3);
2025-02-13 10:06:57 +08:00
reportModel.GetRow(42).GetCell(3).SetCellValue(technicalBonusMalus.ToString()+"%");//技术减值
2025-01-22 14:30:40 +08:00
//44行
2025-02-13 10:06:57 +08:00
decimal? safetyBonus = 0;
safetyBonus = Funs.GetNewDecimal(eva.SafetyBonus);
if (safetyBonus == null)
{
safetyBonus = 0;
}
2025-01-22 14:30:40 +08:00
if (reportModel.GetRow(43).GetCell(3) == null) reportModel.GetRow(43).CreateCell(3);
2025-02-13 14:47:54 +08:00
reportModel.GetRow(43).GetCell(3).SetCellValue(safetyBonus.HasValue ? safetyBonus.Value.ToString("0.0") + "%" : "0");//安全业绩加值
2025-02-13 10:06:57 +08:00
//45行
decimal? totalSocre = technicalBonusMalus + safetyBonus;
2025-01-22 14:30:40 +08:00
if (reportModel.GetRow(44).GetCell(3) == null) reportModel.GetRow(44).CreateCell(3);
2025-02-13 10:06:57 +08:00
reportModel.GetRow(44).GetCell(3).SetCellValue(totalSocre.HasValue ? totalSocre.ToString() + "%" : "");//Total Score (Technical and Safety)
2025-01-22 14:30:40 +08:00
//48行
2025-02-13 10:06:57 +08:00
string proposed = string.Empty;
2025-01-22 14:30:40 +08:00
string rs = string.Empty;
if (s >= 3 && eva.NCRTimes >= 3)
2024-05-08 10:17:02 +08:00
{
2025-02-13 10:06:57 +08:00
rs = "序号1该合同累计3次月度评估低于60分, 不得参与下轮合同\r\n序号2该合同累计三个NCR提前终止合同且不得参与下轮合同";
2024-05-08 10:17:02 +08:00
}
2025-01-22 14:30:40 +08:00
else if (s >= 3)
2024-05-08 10:17:02 +08:00
{
2025-01-22 14:30:40 +08:00
rs = "序号1该合同累计3次月度评估低于60分, 不得参与下轮合同";
2024-05-08 10:17:02 +08:00
}
2025-01-22 14:30:40 +08:00
else if (eva.NCRTimes >= 3)
2024-05-08 10:17:02 +08:00
{
2025-01-22 14:30:40 +08:00
rs = "序号1该合同累计三个NCR提前终止合同且不得参与下轮合同";
2024-05-08 10:17:02 +08:00
}
2025-02-13 14:47:54 +08:00
if (!string.IsNullOrEmpty(eva.Proposed) && !string.IsNullOrEmpty(rs))
2025-02-13 10:06:57 +08:00
{
proposed = rs + "\r\n" + eva.Proposed;
}
2025-02-13 14:47:54 +08:00
else if (!string.IsNullOrEmpty(eva.Proposed) && string.IsNullOrEmpty(rs))
{
proposed = eva.Proposed;
}
2025-02-13 10:06:57 +08:00
else
{
proposed = rs;
}
2025-01-22 14:30:40 +08:00
if (reportModel.GetRow(47).GetCell(0) == null) reportModel.GetRow(47).CreateCell(0);
2025-02-13 10:06:57 +08:00
reportModel.GetRow(47).GetCell(0).SetCellValue(proposed);//合同管理小组对该承包商在本合同期表现的评价
2024-05-08 10:17:02 +08:00
2025-01-22 14:30:40 +08:00
//if (reportModel.GetRow(21).GetCell(6) == null) reportModel.GetRow(21).CreateCell(6);
//if (reportModel.GetRow(22).GetCell(6) == null) reportModel.GetRow(22).CreateCell(6);
//if (reportModel.GetRow(23).GetCell(6) == null) reportModel.GetRow(23).CreateCell(6);
//if (reportModel.GetRow(24).GetCell(6) == null) reportModel.GetRow(24).CreateCell(6);
//if (reportModel.GetRow(25).GetCell(6) == null) reportModel.GetRow(25).CreateCell(6);
2024-05-08 10:17:02 +08:00
2025-01-22 14:30:40 +08:00
//string priceLevel = string.Empty;
//if (eva.PriceLevel == "1")
//{
// reportModel.GetRow(22).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(22).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(23).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(23).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(24).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(24).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(25).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(25).GetCell(6).CellStyle.SetFont(content_Font);
//}
//if (eva.PriceLevel == "2")
//{
// reportModel.GetRow(20).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(20).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(22).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(22).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(23).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(23).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(24).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(24).GetCell(6).CellStyle.SetFont(content_Font);
//}
//if (eva.PriceLevel == "3")
//{
// reportModel.GetRow(21).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(21).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(20).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(20).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(23).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(23).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(24).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(24).GetCell(6).CellStyle.SetFont(content_Font);
//}
//if (eva.PriceLevel == "4")
//{
// reportModel.GetRow(21).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(21).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(22).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(22).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(20).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(20).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(24).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(24).GetCell(6).CellStyle.SetFont(content_Font);
//}
//if (eva.PriceLevel == "5")
//{
// reportModel.GetRow(21).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(21).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(22).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(22).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(23).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(23).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(20).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(20).GetCell(6).CellStyle.SetFont(content_Font);
//}
//if (string.IsNullOrEmpty(eva.PriceLevel))
//{
// reportModel.GetRow(20).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(20).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(21).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(21).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(22).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(22).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(23).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(23).GetCell(6).CellStyle.SetFont(content_Font);
// reportModel.GetRow(24).GetCell(6).SetCellValue(txtNo);
// reportModel.GetRow(24).GetCell(6).CellStyle.SetFont(content_Font);
//}
2024-05-08 10:17:02 +08:00
2025-01-22 14:30:40 +08:00
// 28
//if (reportModel.GetRow(26) == null) reportModel.CreateRow(26);
//if (reportModel.GetRow(27) == null) reportModel.CreateRow(27);
//if (reportModel.GetRow(28) == null) reportModel.CreateRow(28);
//if (reportModel.GetRow(29) == null) reportModel.CreateRow(29);
//if (reportModel.GetRow(31) == null) reportModel.CreateRow(31);
//if (reportModel.GetRow(32) == null) reportModel.CreateRow(32);
//if (reportModel.GetRow(33) == null) reportModel.CreateRow(33);
//if (reportModel.GetRow(34) == null) reportModel.CreateRow(34);
//if (reportModel.GetRow(35) == null) reportModel.CreateRow(35);
//if (reportModel.GetRow(36) == null) reportModel.CreateRow(36);
//if (reportModel.GetRow(37) == null) reportModel.CreateRow(37);
//if (reportModel.GetRow(38) == null) reportModel.CreateRow(38);
//if (reportModel.GetRow(39) == null) reportModel.CreateRow(39);
//if (reportModel.GetRow(42) == null) reportModel.CreateRow(42);
//if (reportModel.GetRow(26).GetCell(5) == null) reportModel.GetRow(26).CreateCell(5);
//reportModel.GetRow(26).GetCell(5).SetCellValue(eva.ReviewOfFC);
//if (eva.IsInquiry == true)
//{
// reportModel.GetRow(27).GetCell(1).SetCellValue(eva.InquiryNum != null ? eva.InquiryNum.Value.ToString() : "0");
// reportModel.GetRow(26).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(26).GetCell(2).CellStyle.SetFont(content_Font);
//}
//else if (eva.IsInquiry == false)
//{
// reportModel.GetRow(27).GetCell(1).SetCellValue("");
// reportModel.GetRow(26).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(26).GetCell(0).CellStyle.SetFont(content_Font);
//}
//else
//{
// reportModel.GetRow(26).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(26).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(26).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(26).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (eva.NCRIsReview == true)
//{
// reportModel.GetRow(30).GetCell(1).SetCellValue(eva.NCRReviewNum != null ? eva.NCRReviewNum.Value.ToString() : "0");
// reportModel.GetRow(29).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(29).GetCell(2).CellStyle.SetFont(content_Font);
//}
//else if (eva.NCRIsReview == false)
//{
// reportModel.GetRow(30).GetCell(1).SetCellValue("");
// reportModel.GetRow(29).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(29).GetCell(0).CellStyle.SetFont(content_Font);
//}
//else
//{
// reportModel.GetRow(29).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(29).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(29).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(29).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (eva.AuditResult == "1")
//{
// reportModel.GetRow(32).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (eva.AuditResult == "2")
//{
// reportModel.GetRow(32).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (eva.AuditResult == "3")
//{
// reportModel.GetRow(32).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(32).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (eva.AuditResult == "4")
//{
// reportModel.GetRow(32).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(32).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (eva.AuditResult == "5")
//{
// reportModel.GetRow(32).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(32).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (eva.AuditResult == "6")
//{
// reportModel.GetRow(32).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(32).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(0).CellStyle.SetFont(content_Font);
//}
//if (string.IsNullOrEmpty(eva.AuditResult))
//{
// reportModel.GetRow(32).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(32).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(32).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(33).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(33).GetCell(2).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(34).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(34).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (eva.IsOthers == true)
//{
// reportModel.GetRow(37).GetCell(1).SetCellValue(eva.OtherDef);
// reportModel.GetRow(36).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(36).GetCell(2).CellStyle.SetFont(content_Font);
//}
//else if (eva.IsOthers == false)
//{
// reportModel.GetRow(36).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(36).GetCell(0).CellStyle.SetFont(content_Font);
//}
//else
//{
// reportModel.GetRow(36).GetCell(0).SetCellValue(txtNo);
// reportModel.GetRow(36).GetCell(0).CellStyle.SetFont(content_Font);
// reportModel.GetRow(36).GetCell(2).SetCellValue(txtNo);
// reportModel.GetRow(36).GetCell(2).CellStyle.SetFont(content_Font);
//}
//if (reportModel.GetRow(38).GetCell(3) == null) reportModel.GetRow(38).CreateCell(3);
//reportModel.GetRow(38).GetCell(3).SetCellValue(eva.TechnicalBonus);
//if (reportModel.GetRow(39).GetCell(3) == null) reportModel.GetRow(39).CreateCell(3);
//reportModel.GetRow(39).GetCell(3).SetCellValue(eva.SafetyBonus);
//reportModel.GetRow(42).GetCell(0).SetCellValue(eva.Proposed);
2024-05-08 10:17:02 +08:00
}
#endregion
reportModel.ForceFormulaRecalculation = true;
using (FileStream filess = File.OpenWrite(ReportFileName))
{
hssfworkbook.Write(filess);
}
FileInfo filet = new FileInfo(ReportFileName);
Response.Clear();
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF8;
// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
Response.AddHeader("Content-Disposition", "attachment; filename=承包商评估表_" + Server.UrlEncode(DateTime.Now.ToString("yyyyMMddhhmmss") + ".xlsx"));
// 添加头信息,指定文件大小,让浏览器能够显示下载进度
Response.AddHeader("Content-Length", filet.Length.ToString());
// 指定返回的是一个不能被客户端读取的流,必须被下载
Response.ContentType = "application/ms-excel";
// 把文件流发送到客户端
2025-02-13 10:06:57 +08:00
Response.WriteFile(filet.FullName);
2024-05-08 10:17:02 +08:00
// 停止页面的执行
Response.End();
}
#endregion
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
btnEdit_Click(null, null);
}
#region
/// <summary>
/// 实体
/// </summary>
public class YearToDateModel
{
public string FO_NO { get; set; } = string.Empty;
public string dataMonth { get; set; } = string.Empty;
public string SumScore { get; set; } = string.Empty;
}
#endregion
#region
/// <summary>
/// 菜单按钮权限
/// </summary>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.ContractorEvaluationMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnOut))
{
this.btnExport.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnSend))
{
this.btnSendEmail.Hidden = false;
}
}
}
#endregion
}
}