diff --git a/CreateModel.bat b/CreateModel.bat index 55640a5..115b938 100644 --- a/CreateModel.bat +++ b/CreateModel.bat @@ -27,7 +27,7 @@ REM -------------- @echo. @call "%VS100COMNTOOLS%"vsvars32.bat -SqlMetal /views /server:.\SQL2016 /database:FCLDB /code:%Model_ROOT%\Model.cs /namespace:Model +SqlMetal /views /server:.\SQL2022 /database:FCLDB /code:%Model_ROOT%\Model.cs /namespace:Model @ECHO Íê³É pause diff --git a/FCL/BLL/BaseInfo/DepartService.cs b/FCL/BLL/BaseInfo/DepartService.cs index 17d0fe9..b123c16 100644 --- a/FCL/BLL/BaseInfo/DepartService.cs +++ b/FCL/BLL/BaseInfo/DepartService.cs @@ -56,6 +56,7 @@ namespace BLL newDepart.DepartName = depart.DepartName; newDepart.Remark = depart.Remark; newDepart.DepartLeader = depart.DepartLeader; + newDepart.DelegatedRepresentative = depart.DelegatedRepresentative; Funs.DB.Base_Depart.InsertOnSubmit(newDepart); Funs.DB.SubmitChanges(); } @@ -73,6 +74,7 @@ namespace BLL newDepart.DepartName = depart.DepartName; newDepart.Remark = depart.Remark; newDepart.DepartLeader = depart.DepartLeader; + newDepart.DelegatedRepresentative = depart.DelegatedRepresentative; Funs.DB.SubmitChanges(); } } diff --git a/FCL/BLL/BaseInfo/ViolationClauseService.cs b/FCL/BLL/BaseInfo/ViolationClauseService.cs index e3e0349..149d023 100644 --- a/FCL/BLL/BaseInfo/ViolationClauseService.cs +++ b/FCL/BLL/BaseInfo/ViolationClauseService.cs @@ -17,7 +17,7 @@ namespace BLL public static List GetSupViolationClause() { - return Funs.DB.EMC_ViolationClause.Where(e => e.SupViolationClause == null).ToList(); + return Funs.DB.EMC_ViolationClause.Where(e => e.SupViolationClause == null).OrderBy(e => e.SortIndex).ToList(); } /// diff --git a/FCL/BLL/Common/Const.cs b/FCL/BLL/Common/Const.cs index fc72436..c754923 100644 --- a/FCL/BLL/Common/Const.cs +++ b/FCL/BLL/Common/Const.cs @@ -57,6 +57,11 @@ namespace BLL /// public static string Role_CommonUsers = "bdb8c4fe-5082-4ce0-af5e-70f39f50ea41"; + /// + /// 承包商管ç†è§’色ID + /// + public static string Role_Contractor_LeaderId = "48b2376d-421f-4b12-b5be-c0c538bfe3e9"; + /// /// 邮件é…ç½®Id /// @@ -263,6 +268,11 @@ namespace BLL public const string BtnConTab13View = "承包商View"; #endregion + /// + /// è´¨é‡äº‹ä»¶æŠ¥å‘Šä¿®æ”¹å…¨éƒ¨ + /// + public const string BtnModifyAll = "Modify All"; + #endregion #region åˆå§‹åŒ–上传路径 diff --git a/FCL/BLL/SES/PunishmentService.cs b/FCL/BLL/SES/PunishmentService.cs index c56d9e1..c2452c6 100644 --- a/FCL/BLL/SES/PunishmentService.cs +++ b/FCL/BLL/SES/PunishmentService.cs @@ -130,6 +130,7 @@ namespace BLL newPunishment.MainCoordinatorEndDate = punishment.MainCoordinatorEndDate; newPunishment.UserDepStartDate = punishment.UserDepStartDate; newPunishment.UserDepEndDate = punishment.UserDepEndDate; + newPunishment.Pause = punishment.Pause; Funs.DB.SubmitChanges(); } diff --git a/FCL/BLL/SES/SESRelatedDataService.cs b/FCL/BLL/SES/SESRelatedDataService.cs index 39734da..68d733f 100644 --- a/FCL/BLL/SES/SESRelatedDataService.cs +++ b/FCL/BLL/SES/SESRelatedDataService.cs @@ -226,7 +226,7 @@ namespace BLL } /// - /// æ ¹æ®æ‰¿åŒ…商IDèŽ·å–æœªå…³é—­çš„FO + /// æ ¹æ®æ‰¿åŒ…商IDèŽ·å–æœªå…³é—­çš„且有效的åŠè¿‡æœŸä¸€å¹´åˆåŒ /// /// /// @@ -235,7 +235,12 @@ namespace BLL { dropName.DataValueField = "FO_NO"; dropName.DataTextField = "FO_NO"; - dropName.DataSource = (from x in Funs.DB.FC_SESRelatedData where x.Contractor == ContractorId && x.FC_Status != "Closed" orderby x.FO_NO select x.FO_NO).Distinct(); + dropName.DataSource = (from x in Funs.DB.FC_SESRelatedData + where x.Contractor == ContractorId + && x.FC_Status != "Closed" + && x.Expire_Date.Value.AddYears(1) >= DateTime.Now + orderby x.FO_NO + select x.FO_NO).Distinct(); dropName.DataBind(); if (isShowPlease) { diff --git a/FCL/BLL/SysManage/Sys_UserService.cs b/FCL/BLL/SysManage/Sys_UserService.cs index 9a3bbcb..6ea4f4a 100644 --- a/FCL/BLL/SysManage/Sys_UserService.cs +++ b/FCL/BLL/SysManage/Sys_UserService.cs @@ -350,7 +350,7 @@ namespace BLL /// public static List GetUserViewList() { - return (from x in Funs.DB.View_Sys_Users where x.IsPost == true orderby x.DepartName, x.UserName select x).ToList(); + return (from x in Funs.DB.View_Sys_Users orderby x.DepartName, x.UserName select x).ToList(); } /// diff --git a/FCL/FineUIPro.Web/BaseInfo/Department.aspx b/FCL/FineUIPro.Web/BaseInfo/Department.aspx index 87455bc..f2a0094 100644 --- a/FCL/FineUIPro.Web/BaseInfo/Department.aspx +++ b/FCL/FineUIPro.Web/BaseInfo/Department.aspx @@ -42,6 +42,9 @@ + + @@ -77,6 +80,7 @@ runat="server" LabelAlign="right" LabelWidth="140px"> + @@ -117,7 +121,7 @@ function reloadGrid() { __doPostBack(null, 'reloadGrid'); - } + } diff --git a/FCL/FineUIPro.Web/BaseInfo/Department.aspx.cs b/FCL/FineUIPro.Web/BaseInfo/Department.aspx.cs index 955bad8..5773af5 100644 --- a/FCL/FineUIPro.Web/BaseInfo/Department.aspx.cs +++ b/FCL/FineUIPro.Web/BaseInfo/Department.aspx.cs @@ -1,6 +1,7 @@ using BLL; using BLL.Common; using Model; +using Org.BouncyCastle.Tls.Crypto; using System; using System.Collections.Generic; using System.Data; @@ -23,14 +24,21 @@ namespace FineUIPro.Web.BaseInfo if (!IsPostBack) { GetButtonPower();//按钮æƒé™ - + //部门领导 drpDepartLeader.DataTextField = "UserName"; drpDepartLeader.DataValueField = "UserId"; this.drpDepartLeader.DataSource = BLL.Sys_UserService.GetUserList(); this.drpDepartLeader.DataBind(); Funs.FineUIPleaseSelect(this.drpDepartLeader); this.drpDepartLeader.SelectedIndex = 0; - + //部门代ç†äºº + drpDelegatedRepresentative.DataTextField = "UserName"; + drpDelegatedRepresentative.DataValueField = "UserId"; + this.drpDelegatedRepresentative.DataSource = BLL.Sys_UserService.GetUserList(); + this.drpDelegatedRepresentative.DataBind(); + Funs.FineUIPleaseSelect(this.drpDelegatedRepresentative); + this.drpDelegatedRepresentative.SelectedIndex = 0; + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); // 绑定表格 BindGrid(); @@ -42,9 +50,10 @@ namespace FineUIPro.Web.BaseInfo /// private void BindGrid() { - string strSql = @"SELECT dep.DepartId,dep.DepartCode,dep.DepartName,dep.DepartLeader,u.UserName + string strSql = @"SELECT dep.DepartId,dep.DepartCode,dep.DepartName,dep.DepartLeader,u.UserName,dep.DelegatedRepresentative,r.UserName as DelegatedRepresentativeName FROM dbo.Base_Depart AS dep LEFT JOIN dbo.Sys_User AS u ON u.UserId = dep.DepartLeader + LEFT JOIN dbo.Sys_User AS r ON r.UserId = dep.DelegatedRepresentative Where 1=1"; // 2.获å–当å‰åˆ†é¡µæ•°æ® List listStr = new List(); @@ -99,13 +108,11 @@ namespace FineUIPro.Web.BaseInfo /// protected void btnDelete_Click(object sender, EventArgs e) { - BLL.DepartService.DeleteDepartById(hfFormID.Text); BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Delete department"); // 釿–°ç»‘定表格,并模拟点击[新增按钮] BindGrid(); //PageContext.RegisterStartupScript("onNewButtonClick();"); - } /// /// å³é”®åˆ é™¤äº‹ä»¶ @@ -170,6 +177,18 @@ namespace FineUIPro.Web.BaseInfo { this.drpDepartLeader.SelectedValue = depart.DepartLeader; } + else + { + this.drpDepartLeader.SelectedIndex = 0; + } + if (!string.IsNullOrEmpty(depart.DelegatedRepresentative)) + { + this.drpDelegatedRepresentative.SelectedValue = depart.DelegatedRepresentative; + } + else + { + this.drpDelegatedRepresentative.SelectedIndex = 0; + } hfFormID.Text = Id; this.btnDelete.Enabled = true; } @@ -197,6 +216,10 @@ namespace FineUIPro.Web.BaseInfo { depart.DepartLeader = this.drpDepartLeader.SelectedValue; } + if (this.drpDelegatedRepresentative.SelectedValue!=BLL.Const._Null) + { + depart.DelegatedRepresentative = this.drpDelegatedRepresentative.SelectedValue; + } if (string.IsNullOrEmpty(strRowID)) { depart.DepartId = SQLHelper.GetNewID(typeof(Model.Base_Depart)); @@ -264,6 +287,7 @@ namespace FineUIPro.Web.BaseInfo this.txtDepartCode.Text = string.Empty; this.txtDepartName.Text = string.Empty; this.drpDepartLeader.SelectedValue = Const._Null; + this.drpDelegatedRepresentative.SelectedValue= Const._Null; this.txtRemark.Text = string.Empty; this.btnDelete.Enabled = false; } @@ -397,7 +421,6 @@ namespace FineUIPro.Web.BaseInfo { errorInfos += (i + 2) + "Line, [Manager] cannot be empty!
"; } - depList.Add(d); #endregion } diff --git a/FCL/FineUIPro.Web/BaseInfo/Department.aspx.designer.cs b/FCL/FineUIPro.Web/BaseInfo/Department.aspx.designer.cs index 8911c26..8b6aba7 100644 --- a/FCL/FineUIPro.Web/BaseInfo/Department.aspx.designer.cs +++ b/FCL/FineUIPro.Web/BaseInfo/Department.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.BaseInfo { - - - public partial class Department { - +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class Department + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// txtDepCode 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.TextBox txtDepCode; - + /// /// ToolbarFill2 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill2; - + /// /// fuAttachUrl 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.FileUpload fuAttachUrl; - + /// /// hdFileName 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.HiddenField hdFileName; - + /// /// btnImport 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Button btnImport; - + /// /// btnDownLoad 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Button btnDownLoad; - + /// /// ToolbarSeparator1 控件。 /// @@ -119,7 +121,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -128,7 +130,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -137,7 +139,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// SimpleForm1 控件。 /// @@ -146,7 +148,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.SimpleForm SimpleForm1; - + /// /// hfFormID 控件。 /// @@ -155,7 +157,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.HiddenField hfFormID; - + /// /// txtDepartCode 控件。 /// @@ -164,7 +166,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.TextBox txtDepartCode; - + /// /// txtDepartName 控件。 /// @@ -173,7 +175,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.TextBox txtDepartName; - + /// /// drpDepartLeader 控件。 /// @@ -182,7 +184,16 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.DropDownList drpDepartLeader; - + + /// + /// drpDelegatedRepresentative 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.DropDownList drpDelegatedRepresentative; + /// /// txtRemark 控件。 /// @@ -191,7 +202,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.TextArea txtRemark; - + /// /// Toolbar1 控件。 /// @@ -200,7 +211,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// btnNew 控件。 /// @@ -209,7 +220,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// btnDelete 控件。 /// @@ -218,7 +229,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Button btnDelete; - + /// /// ToolbarFill1 控件。 /// @@ -227,7 +238,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnSave 控件。 /// @@ -236,7 +247,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Button btnSave; - + /// /// Menu1 控件。 /// @@ -245,7 +256,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuEdit 控件。 /// @@ -254,7 +265,7 @@ namespace FineUIPro.Web.BaseInfo { /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - + /// /// btnMenuDelete 控件。 /// diff --git a/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigation.aspx.cs b/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigation.aspx.cs index 59dec68..17bea4b 100644 --- a/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigation.aspx.cs +++ b/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigation.aspx.cs @@ -50,6 +50,7 @@ namespace FineUIPro.Web.ContractorQuality left join Sys_User as u on u.UserId = p.Violation_Inspector left join Base_Depart as d on d.DepartId = u.DepartId left join Sys_User as du on du.UserId = d.DepartLeader + left join FC_SESRelatedData fo on fo.FO_NO = p.FO_NO where Flag='2' "; List listStr = new List(); var role = BLL.Sys_RoleService.GetRole(CurrUser.RoleId); @@ -72,7 +73,7 @@ namespace FineUIPro.Web.ContractorQuality var user = BLL.Sys_UserService.GetUsersByUserId(this.CurrUser.UserId); if (user != null) { - strSql += " and p.PunishmentId in (select PunishmentId from EMC_PunishmentAudit where (AuditMan='" + user.DepartId + "' or AuditMan='" + this.CurrUser.UserId + "') and AuditDate is null)"; + strSql += " and p.PunishmentId in (select PunishmentId from EMC_PunishmentAudit where ((AuditMan='" + user.DepartId + "' or AuditMan='" + this.CurrUser.UserId + "') and AuditDate is null) or (p.States='3' and p.MainCoordinatorEndDate is not null and p.UserDepStartDate is null and fo.Main_Coordinator='" + this.CurrUser.UserId + "'))"; } } } @@ -207,14 +208,32 @@ namespace FineUIPro.Web.ContractorQuality var user = BLL.Sys_UserService.GetUsersByUserId(this.CurrUser.UserId); if (user != null) { - if (pun.IsFrame == true && user.DepartId == pun.UserDep) + if ((pun.MainCoordinatorEndDate.HasValue && pun.MainCoordinatorEndDate.Value.AddDays(3) < DateTime.Now) || pun.UserDepStartDate.HasValue) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("IncidentInvestigationEdit.aspx?punishmentId={0}", rowID, "编辑 - "))); + if (pun.IsFrame == true && user.DepartId == pun.UserDep) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("IncidentInvestigationEdit.aspx?punishmentId={0}", rowID, "编辑 - "))); + } + else + { + var depart = BLL.DepartService.GetDepartNameById(pun.UserDep); + ShowAlert("æ‚¨ä¸æ˜¯" + depart + "部门用户,ä¸èƒ½æ“作ï¼", MessageBoxIcon.Warning); + } } else { - var depart = BLL.DepartService.GetDepartNameById(pun.UserDep); - ShowAlert("æ‚¨ä¸æ˜¯" + depart + "部门用户,ä¸èƒ½æ“作ï¼", MessageBoxIcon.Warning); + Model.FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(pun.FO_NO); + if (fc != null) + { + if (this.CurrUser.UserId == fc.Main_Coordinator || this.CurrUser.RoleId == BLL.Const.Role_Contractor_LeaderId)//当å‰ç”¨æˆ·ç­‰äºŽä¸»å调员 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("IncidentInvestigationEdit.aspx?punishmentId={0}", rowID, "编辑 - "))); + } + else + { + ShowAlert("æ‚¨ä¸æ˜¯" + BLL.Sys_UserService.GetUserNameByUserId(fc.Main_Coordinator) + ",ä¸èƒ½æ“作ï¼", MessageBoxIcon.Warning); + } + } } } } @@ -614,6 +633,8 @@ namespace FineUIPro.Web.ContractorQuality } #endregion + #region æ ¼å¼åŒ–字符串 + #region 审批人 /// /// 审批人 /// @@ -655,7 +676,19 @@ namespace FineUIPro.Web.ContractorQuality } else if (pun.States == "3" && pun.IsFrame == true) { - name = BLL.DepartService.GetDepartNameById(pun.UserDep); + //承包商è”系人有异议或3天未有动作 + if ((pun.MainCoordinatorEndDate.HasValue && pun.MainCoordinatorEndDate.Value.AddDays(3) < DateTime.Now) || pun.UserDepStartDate.HasValue) + { + name = BLL.DepartService.GetDepartNameById(pun.UserDep); + } + else + { + Model.FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(pun.FO_NO); + if (fc != null) + { + name = BLL.Sys_UserService.GetUserNameByUserId(fc.Main_Coordinator); + } + } } else if (pun.States == "4" && pun.IsFrame == true) { @@ -669,7 +702,9 @@ namespace FineUIPro.Web.ContractorQuality } return name; } + #endregion + #region çŠ¶æ€ /// /// å½“æœŸçŠ¶æ€ /// @@ -697,13 +732,23 @@ namespace FineUIPro.Web.ContractorQuality } else { - s = "进行中"; + if (pun.Pause == true) + { + s = "已暂åœ"; + } + else + { + s = "进行中"; + } } } } return s; } + #endregion + #endregion + #region 筛选 /// /// 筛选 /// @@ -713,5 +758,6 @@ namespace FineUIPro.Web.ContractorQuality { BindGrid(); } + #endregion } } \ No newline at end of file diff --git a/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx b/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx index ce4d93e..0fe1dca 100644 --- a/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx +++ b/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx @@ -177,8 +177,8 @@ - - + + @@ -246,7 +246,8 @@ - + + @@ -273,7 +274,7 @@ - + @@ -313,10 +314,41 @@ + + + + + + @@ -331,6 +363,8 @@ + + diff --git a/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx.cs b/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx.cs index 6b68960..273b0a7 100644 --- a/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx.cs +++ b/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx.cs @@ -1,7 +1,9 @@ using BLL; using BLL.Common; +using NPOI.POIFS.Crypt.Dsig; using Org.BouncyCastle.Bcpg.OpenPgp; using System; +using System.Collections.Generic; using System.Collections.Specialized; using System.Drawing; using System.Linq; @@ -69,7 +71,6 @@ namespace FineUIPro.Web.ContractorQuality this.PunishmentId = Request.Params["punishmentId"]; if (!string.IsNullOrEmpty(this.PunishmentId)) { - var att1 = from x in Funs.DB.AttachFile where x.ToKeyId == this.PunishmentId + "#1" select x; if (att1.Count() == 0) { @@ -107,6 +108,9 @@ namespace FineUIPro.Web.ContractorQuality GroupPanel3.Hidden = false; GroupPanel4.Hidden = false; GroupPanel5.Hidden = false; + frModifyDef.Hidden = false; + frModifyDefUrl.Hidden = false; + //frPassResult.Hidden = false; var audit = BLL.PunishmentAuditService.GetAuditBypunishmentIdAndAuditMan(this.PunishmentId, this.CurrUser.UserId); if (pun.IsPass == false && audit != null) @@ -308,15 +312,44 @@ namespace FineUIPro.Web.ContractorQuality } else if (pun.States == "3" && pun.IsFrame == true)//用户部门填写 { - //GroupPanel1.Enabled = false; - GroupPanel1Enabled(); GroupPanel2.Hidden = false; - GroupPanel2.Enabled = false; - //GroupPanel3.Enabled = false; - GroupPanel3Enabled(); GroupPanel3.Hidden = false; GroupPanel4.Hidden = false; this.btnSbumit.Hidden = false; + //用户部门æ“作å‰ä¸»åè°ƒå‘˜å¯æš‚åœ + Model.FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(pun.FO_NO); + if (fc != null) + { + if (this.CurrUser.UserId == fc.Main_Coordinator)//当å‰ç”¨æˆ·ç­‰äºŽä¸»å调员 + { + Panel4.Hidden = false; + if (pun.MainCoordinatorEndDate.HasValue && pun.MainCoordinatorEndDate.Value.AddDays(3) >= DateTime.Now) + { + this.btnPause.Hidden = false; + //this.btnSave.Hidden = true; + //this.btnSbumit.Hidden = true; + this.GroupPanel4.Hidden = true; + } + if (pun.Pause == true) + { + this.btnPause.Hidden = true; + this.frPassResult.Hidden = false; + } + } + // 承包商管ç†è§’色å¯ç¼–辑æäº¤åŽçš„申报人填写ã€SSR填写ã€ä¸»å调员填写内容 + if (this.CurrUser.RoleId == BLL.Const.Role_Contractor_LeaderId) + { + GroupPanel1.Enabled = true; + GroupPanel2.Enabled = true; + GroupPanel3.Enabled = true; + GroupPanel4.Hidden = true; + frModifyDef.Hidden = false; + frModifyDefUrl.Hidden = false; + this.btnSave.Hidden = true; + this.btnSbumit.Hidden = true; + this.btnSureModify.Hidden = false; + } + } } else if (pun.States == "4" && pun.IsFrame == true)//åˆåŒç®¡ç†å‘˜å¡«å†™ { @@ -490,7 +523,9 @@ namespace FineUIPro.Web.ContractorQuality this.txtIndividualSESReason.Text = pun.IndividualSESReason; this.txtSESReson.Text = pun.SESReason; this.txtBuyerReson.Text = pun.BuyerReson; - #endregion + this.hdModifyContent.Text = pun.ModifyContent; + this.txtModifyDef.Text = pun.ModifyContent; + #endregion } } else @@ -500,7 +535,7 @@ namespace FineUIPro.Web.ContractorQuality } } } - + #region ä¸å¯ç¼–辑 /// /// 申报人填写ä¸å¯ç¼–辑 /// @@ -551,6 +586,7 @@ namespace FineUIPro.Web.ContractorQuality Label10.Enabled = false; } #endregion + #endregion #region ä¿å­˜ã€æäº¤ /// @@ -577,6 +613,7 @@ namespace FineUIPro.Web.ContractorQuality { if (!string.IsNullOrEmpty(this.PunishmentId)) { + List emialLists = new List(); //承包商è”系人Email var pun = BLL.PunishmentService.GetPunishmentById(this.PunishmentId); if (pun != null) { @@ -596,6 +633,10 @@ namespace FineUIPro.Web.ContractorQuality { pun.ContractAdmin = this.drpContractAdmin.SelectedValue; } + if (!string.IsNullOrEmpty(fc.Email)) + { + emialLists.Add(fc.Email);//承包商è”系人Email + } } else { @@ -759,7 +800,7 @@ namespace FineUIPro.Web.ContractorQuality { pun.States = "3";//主å调员æäº¤ pun.MainCoordinatorEndDate = DateTime.Now;//主å调员审批时间 - pun.UserDepStartDate = DateTime.Now;//用户部门审批到达时间 + //pun.UserDepStartDate = DateTime.Now;//用户部门审批到达时间 var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, this.CurrUser.UserId); if (updateAudit != null) @@ -769,14 +810,14 @@ namespace FineUIPro.Web.ContractorQuality updateAudit.IsPass = true; BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit); } + //通知承包商è”系人,有3天å馈时间,若3å¤©åŽæœªå¤„ç†ï¼Œè¿›å…¥ä¸‹ä¸€å®¡æ‰¹ï¼Œå¦åˆ™æš‚åœé‡æ–°è¯„ä¼° + //Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit(); + //audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit)); + //audit.PunishmentId = this.PunishmentId; + //audit.AuditMan = pun.UserDep; + //BLL.PunishmentAuditService.AddPunishmentAudit(audit); - Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit(); - audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit)); - audit.PunishmentId = this.PunishmentId; - audit.AuditMan = pun.UserDep; - BLL.PunishmentAuditService.AddPunishmentAudit(audit); - - #region 主å调员审批通过邮件:å‘é€ç»™éƒ¨é—¨ç»ç†ï¼ŒæŠ„逿µç¨‹ç»åŠžäºº + #region 主å调员通过-通知承包商è”系人 Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId); if (pops == null) { @@ -786,44 +827,76 @@ namespace FineUIPro.Web.ContractorQuality string[] mailCC = null; string resultMessage = ""; - var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主å调员填写完æˆåŽå®¡æ‰¹é€šè¿‡é€šçŸ¥")); + var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("承包商è”系人通知")); if (emailTemplate.Count() > 0) { - string departLeader = string.Empty; - var depart = BLL.DepartService.GetDepartById(drpUserDep.SelectedValue); - if (depart != null) - { - departLeader = depart.DepartLeader; - } - if (!string.IsNullOrEmpty(departLeader)) - { - var userTo = from x in Funs.DB.Sys_User - where x.UserId.Contains(departLeader) && x.Email != null && x.Email != "" - select x; - if (userTo != null) - { - mailTo = userTo.Select(x => x.Email).ToArray(); - } - } - - var userCc = from x in Funs.DB.View_EMail_UserTo - where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector)) - && x.Email != null && x.Email != "" - select x; - if (userCc != null) - { - mailCC = userCc.Select(x => x.Email).Distinct().ToArray(); - } + //var userTo = from x in Funs.DB.Sys_User + // where x.RoleId == BLL.Const.Role_Contractor_LeaderId && x.Email != null && x.Email != "" + // select x; + //if (userTo != null) + //{ + // mailTo = userTo.Select(x => x.Email).ToArray(); + //} + mailTo = emialLists.ToArray(); if (mailTo.Length > 0) { NameValueCollection myPram = new NameValueCollection(); myPram.Add("å‘现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : ""); myPram.Add("ä½ç½®", pun.Location); myPram.Add("è´¨é‡äº‹ä»¶æè¿°", pun.Description); - MailHelper.SendPunishSesMail(pops, myPram, "主å调员填写完æˆåŽå®¡æ‰¹é€šè¿‡é€šçŸ¥", mailTo, mailCC, out resultMessage); + MailHelper.SendPunishSesMail(pops, myPram, "承包商è”系人通知", mailTo, mailCC, out resultMessage); } } #endregion + + #region 主å调员审批通过邮件:å‘é€ç»™éƒ¨é—¨ç»ç†ï¼ŒæŠ„逿µç¨‹ç»åŠžäºº + //Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId); + //if (pops == null) + //{ + // return; + //} + //string[] mailTo = null; + //string[] mailCC = null; + //string resultMessage = ""; + + //var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主å调员填写完æˆåŽå®¡æ‰¹é€šè¿‡é€šçŸ¥")); + //if (emailTemplate.Count() > 0) + //{ + // string departLeader = string.Empty; + // var depart = BLL.DepartService.GetDepartById(drpUserDep.SelectedValue); + // if (depart != null) + // { + // departLeader = depart.DepartLeader; + // } + // if (!string.IsNullOrEmpty(departLeader)) + // { + // var userTo = from x in Funs.DB.Sys_User + // where x.UserId.Contains(departLeader) && x.Email != null && x.Email != "" + // select x; + // if (userTo != null) + // { + // mailTo = userTo.Select(x => x.Email).ToArray(); + // } + // } + + // var userCc = from x in Funs.DB.View_EMail_UserTo + // where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector)) + // && x.Email != null && x.Email != "" + // select x; + // if (userCc != null) + // { + // mailCC = userCc.Select(x => x.Email).Distinct().ToArray(); + // } + // if (mailTo.Length > 0) + // { + // NameValueCollection myPram = new NameValueCollection(); + // myPram.Add("å‘现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : ""); + // myPram.Add("ä½ç½®", pun.Location); + // myPram.Add("è´¨é‡äº‹ä»¶æè¿°", pun.Description); + // MailHelper.SendPunishSesMail(pops, myPram, "主å调员填写完æˆåŽå®¡æ‰¹é€šè¿‡é€šçŸ¥", mailTo, mailCC, out resultMessage); + // } + //} + #endregion } } else //éžæ¡†æž¶åˆåŒ @@ -974,87 +1047,220 @@ namespace FineUIPro.Web.ContractorQuality } else if (pun.States == "3")//用户部门æäº¤ { - if (!string.IsNullOrEmpty(this.txtIndividualSES.Text.Trim())) + var user = BLL.Sys_UserService.GetUsersByUserId(this.CurrUser.UserId); + if (user != null) { - pun.ViolationRelatedSes = this.txtIndividualSES.Text.Trim(); - } - else - { - if (!string.IsNullOrEmpty(this.txtIndividualSESReason.Text.Trim())) + if (user.DepartId == pun.UserDep) { - pun.IndividualSESReason = this.txtIndividualSESReason.Text.Trim(); + if (!string.IsNullOrEmpty(this.txtIndividualSES.Text.Trim())) + { + pun.ViolationRelatedSes = this.txtIndividualSES.Text.Trim(); + } + else + { + if (!string.IsNullOrEmpty(this.txtIndividualSESReason.Text.Trim())) + { + pun.IndividualSESReason = this.txtIndividualSESReason.Text.Trim(); + } + else + { + Alert.ShowInTop("如ä¸å¡«å†™ï¼Œè¯·æè¿°åŽŸå› ï¼", MessageBoxIcon.Warning); + return; + } + } + if (type == BLL.Const.BtnSubmit) + { + pun.States = "4";//用户部门æäº¤ + pun.UserDepEndDate = DateTime.Now;//用户部门审批时间 + + var u = BLL.Sys_UserService.GetUsersByUserId(this.CurrUser.UserId); + if (u != null) + { + var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, u.DepartId); + if (updateAudit != null) + { + updateAudit.AuditMan = this.CurrUser.UserId; + updateAudit.AuditDate = DateTime.Now; + updateAudit.IsPass = true; + BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit); + } + } + + Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit(); + audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit)); + audit.PunishmentId = this.PunishmentId; + audit.AuditMan = pun.ContractAdmin; + BLL.PunishmentAuditService.AddPunishmentAudit(audit); + + #region 用户部门填写åŽå®¡æ‰¹é‚®ä»¶ï¼šå‘é€ç»™åˆåŒç®¡ç†å‘˜ï¼ŒæŠ„é€ç»™æµç¨‹ç»åŠžäºº + Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId); + if (pops == null) + { + return; + } + string[] mailTo = null; + string[] mailCC = null; + string resultMessage = ""; + + var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("用户部门填写åŽå®¡æ ¸é€šçŸ¥")); + if (emailTemplate.Count() > 0) + { + var userTo = from x in Funs.DB.Sys_User + where x.UserId.Contains(this.drpContractAdmin.SelectedValue) + && x.Email != null && x.Email != "" + select x; + if (userTo != null) + { + mailTo = userTo.Select(x => x.Email).ToArray(); + } + + var userCc = from x in Funs.DB.View_EMail_UserTo + where (x.PunishmentId == this.PunishmentId && x.AuditDate != null) + || (x.UserId.Contains(pun.Violation_Inspector)) + && x.Email != null && x.Email != "" + select x; + if (userCc != null) + { + mailCC = userCc.Select(x => x.Email).Distinct().ToArray(); + } + if (mailTo.Length > 0) + { + NameValueCollection myPram = new NameValueCollection(); + myPram.Add("å‘现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : ""); + myPram.Add("ä½ç½®", pun.Location); + myPram.Add("è´¨é‡äº‹ä»¶æè¿°", pun.Description); + MailHelper.SendPunishSesMail(pops, myPram, "用户部门填写åŽå®¡æ ¸é€šçŸ¥", mailTo, mailCC, out resultMessage); + } + } + #endregion + } } else { - Alert.ShowInTop("如ä¸å¡«å†™ï¼Œè¯·æè¿°åŽŸå› ï¼", MessageBoxIcon.Warning); - return; - } - } - if (type == BLL.Const.BtnSubmit) - { - pun.States = "4";//用户部门æäº¤ - pun.UserDepEndDate = DateTime.Now;//用户部门审批时间 - - var u = BLL.Sys_UserService.GetUsersByUserId(this.CurrUser.UserId); - if (u != null) - { - var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, u.DepartId); - if (updateAudit != null) + #region 最终审核通过,å‘é€ç»™ç”¨æˆ·éƒ¨é—¨åŠžç†,未通过å‘é€ç»™æ‰€æœ‰ç»åŠžäºº + Model.View_FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataViewByFO(pun.FO_NO); + if (fc != null) { - updateAudit.AuditMan = this.CurrUser.UserId; - updateAudit.AuditDate = DateTime.Now; - updateAudit.IsPass = true; - BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit); + if (this.CurrUser.UserId == fc.Main_CoordinatorId && type == BLL.Const.BtnSubmit) + { + if (rblPass.SelectedValue == "False") + { + //最终审核未通过通知 + pun.States = "7";//å·²æ‹’ç» + + Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId); + if (pops == null) + { + return; + } + string[] mailTo = null; + //string[] mailCC = null; + string resultMessage = ""; + + var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主å调员填写完æˆåŽå®¡æ‰¹æœªé€šè¿‡é€šçŸ¥")); + if (emailTemplate.Count() > 0) + { + var userTo = from x in Funs.DB.View_EMail_UserTo + where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector)) + && x.Email != null && x.Email != "" + select x; + if (userTo != null) + { + mailTo = userTo.Select(x => x.Email).Distinct().ToArray(); + } + if (mailTo.Length > 0) + { + NameValueCollection myPram = new NameValueCollection(); + myPram.Add("å‘现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : ""); + myPram.Add("ä½ç½®", pun.Location); + myPram.Add("è´¨é‡äº‹ä»¶æè¿°", pun.Description); + MailHelper.SendPunishSesMail(pops, myPram, "主å调员填写完æˆåŽå®¡æ‰¹æœªé€šè¿‡é€šçŸ¥", mailTo, null, out resultMessage); + } + } + } + else + { + pun.UserDepStartDate = DateTime.Now;//用户部门审批到达时间 + pun.Pause = false;//å¦‚æžœå®¡æ ¸é€šè¿‡ï¼Œå–æ¶ˆæš‚åœ + + #region 主å调员审批通过邮件:如果部门有部门代ç†äººï¼Œå‘é€ç»™éƒ¨é—¨ä»£ç†äººï¼ŒæŠ„é€ç»™éƒ¨é—¨ç»ç†åŠæµç¨‹ç»åŠžäººï¼›å¦‚æžœæ²¡æœ‰éƒ¨é—¨ä»£ç†äººï¼Œå‘é€ç»™éƒ¨é—¨ç»ç†ï¼ŒæŠ„é€ç»™æµç¨‹ç»åŠžäºº + Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId); + if (pops == null) + { + return; + } + string[] mailTo = null; + string[] mailCC = null; + string resultMessage = ""; + + var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主å调员填写完æˆåŽå®¡æ‰¹é€šè¿‡é€šçŸ¥")); + if (emailTemplate.Count() > 0) + { + string delegatedRepresentative = string.Empty;//部门代ç†äºº + string departmentLeader = string.Empty;//部门ç»ç† + var depart = BLL.DepartService.GetDepartById(drpUserDep.SelectedValue); + if (depart != null) + { + delegatedRepresentative = depart.DelegatedRepresentative; + departmentLeader = depart.DepartLeader; + } + if (!string.IsNullOrEmpty(delegatedRepresentative)) + { + var userTo = from x in Funs.DB.Sys_User + where x.UserId.Contains(delegatedRepresentative) && x.Email != null && x.Email != "" + select x; + if (userTo != null) + { + mailTo = userTo.Select(x => x.Email).ToArray(); + } + + var userCc = from x in Funs.DB.View_EMail_UserTo + where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector) || x.UserId.Contains(departmentLeader)) + && x.Email != null && x.Email != "" + select x; + if (userCc != null) + { + mailCC = userCc.Select(x => x.Email).Distinct().ToArray(); + } + } + else + { + if(!string.IsNullOrEmpty(departmentLeader)) + { + var userTo = from x in Funs.DB.Sys_User + where x.UserId.Contains(departmentLeader) && x.Email != null && x.Email != "" + select x; + if (userTo != null) + { + mailTo = userTo.Select(x => x.Email).ToArray(); + } + } + + var userCc = from x in Funs.DB.View_EMail_UserTo + where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector)) + && x.Email != null && x.Email != "" + select x; + if (userCc != null) + { + mailCC = userCc.Select(x => x.Email).Distinct().ToArray(); + } + } + + if (mailTo.Length > 0) + { + NameValueCollection myPram = new NameValueCollection(); + myPram.Add("å‘现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : ""); + myPram.Add("ä½ç½®", pun.Location); + myPram.Add("è´¨é‡äº‹ä»¶æè¿°", pun.Description); + MailHelper.SendPunishSesMail(pops, myPram, "主å调员填写完æˆåŽå®¡æ‰¹é€šè¿‡é€šçŸ¥", mailTo, mailCC, out resultMessage); + } + } + #endregion + } + } } + #endregion } - - Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit(); - audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit)); - audit.PunishmentId = this.PunishmentId; - audit.AuditMan = pun.ContractAdmin; - BLL.PunishmentAuditService.AddPunishmentAudit(audit); - - #region 用户部门填写åŽå®¡æ‰¹é‚®ä»¶ï¼šå‘é€ç»™åˆåŒç®¡ç†å‘˜ï¼ŒæŠ„é€ç»™æµç¨‹ç»åŠžäºº - Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId); - if (pops == null) - { - return; - } - string[] mailTo = null; - string[] mailCC = null; - string resultMessage = ""; - - var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("用户部门填写åŽå®¡æ ¸é€šçŸ¥")); - if (emailTemplate.Count() > 0) - { - var userTo = from x in Funs.DB.Sys_User - where x.UserId.Contains(this.drpContractAdmin.SelectedValue) - && x.Email != null && x.Email != "" - select x; - if (userTo != null) - { - mailTo = userTo.Select(x => x.Email).ToArray(); - } - - var userCc = from x in Funs.DB.View_EMail_UserTo - where (x.PunishmentId == this.PunishmentId && x.AuditDate != null) - || (x.UserId.Contains(pun.Violation_Inspector)) - && x.Email != null && x.Email != "" - select x; - if (userCc != null) - { - mailCC = userCc.Select(x => x.Email).Distinct().ToArray(); - } - if (mailTo.Length > 0) - { - NameValueCollection myPram = new NameValueCollection(); - myPram.Add("å‘现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : ""); - myPram.Add("ä½ç½®", pun.Location); - myPram.Add("è´¨é‡äº‹ä»¶æè¿°", pun.Description); - MailHelper.SendPunishSesMail(pops, myPram, "用户部门填写åŽå®¡æ ¸é€šçŸ¥", mailTo, mailCC, out resultMessage); - } - } - #endregion } } else if (pun.States == "4")//åˆåŒç®¡ç†å‘˜ @@ -1699,12 +1905,12 @@ namespace FineUIPro.Web.ContractorQuality PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=view&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}&strParam=1", this.hdId.Text, BLL.Const.IncidentInvestigationMenuId))); } - /// - /// è´¨é‡è°ƒæŸ¥ç›¸å…³é™„ä»¶ - /// - /// - /// - protected void btnAttach2_Click(object sender, EventArgs e) + /// + /// è´¨é‡è°ƒæŸ¥ç›¸å…³é™„ä»¶ + /// + /// + /// + protected void btnAttach2_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录 { @@ -1722,6 +1928,31 @@ namespace FineUIPro.Web.ContractorQuality { PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=view&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}&strParam=2", this.PunishmentId, BLL.Const.IncidentInvestigationMenuId))); } + + #region 修改内容说明附件 + /// + /// 上传 + /// + /// + /// + protected void btnModifyAttach_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.hdId.Text)) + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=edit&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}&strParam=3", this.PunishmentId, BLL.Const.IncidentInvestigationMenuId))); + } + } + + /// + /// 查看 + /// + /// + /// + protected void lbtnModifyAttach_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=view&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}&strParam=3", this.PunishmentId, BLL.Const.IncidentInvestigationMenuId))); + } + #endregion #endregion #region æ‹’ç» @@ -1771,8 +2002,156 @@ namespace FineUIPro.Web.ContractorQuality { PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } + #endregion + #region æš‚åœ + /// + /// 承包商è”系人有异议线下通知主å调员,主åè°ƒå‘˜å¯æš‚åœé‡æ–°è¯„ä¼° + /// + /// + /// + protected void btnPause_Click(object sender, EventArgs e) + { + var pun = BLL.PunishmentService.GetPunishmentById(this.PunishmentId); + if (pun != null) + { + pun.Pause = true; + pun.PauseDate = DateTime.Now; + Funs.DB.SubmitChanges(); + ShowNotify("已暂åœï¼Œè¯·è”åˆå‘èµ·äººåŠæ‰¿åŒ…商调查审核ï¼", MessageBoxIcon.Information); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + } + #endregion + #region ä¿å­˜ä¿®æ”¹ + /// + /// 确认修改 + /// + /// + /// + protected void btnSureModify_Click(object sender, EventArgs e) + { + string con = string.Empty; + if (!string.IsNullOrEmpty(this.PunishmentId)) + { + var pun = BLL.PunishmentService.GetPunishmentById(this.PunishmentId); + if (pun != null) + { + if (pun.States == "3" && !pun.UserDepStartDate.HasValue && rblSeType.SelectedValue == "1") + { + Model.View_FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataViewByFO(pun.FO_NO); + if (fc != null) + { + #region 承包商管ç†è§’色å¯ä¿®æ”¹ç”¨æˆ·éƒ¨é—¨å‰çš„æ‰€æœ‰å†…容 + if (this.CurrUser.RoleId == BLL.Const.Role_Contractor_LeaderId) + { + if (pun.PunishDate.Value.ToShortDateString() != Funs.GetNewDateTime(this.txtPunishDate.Text.Trim()).Value.ToShortDateString()) + { + con += "å‘现日期由ã€" + string.Format("{0:yyyy-MM-dd}", pun.PunishDate) + "】改为ã€" + string.Format("{0:yyyy-MM-dd}", Funs.GetNewDateTime(this.txtPunishDate.Text.Trim())) + "】;"; + pun.PunishDate = Funs.GetNewDateTime(this.txtPunishDate.Text.Trim()); + } + if (pun.Location != this.txtLocation.Text.Trim()) + { + con += "ä½ç½®ç”±ã€" + pun.Location + "】改为ã€" + this.txtLocation.Text.Trim() + "】;"; + pun.Location = this.txtLocation.Text.Trim(); + } + if (pun.Description != this.txtDescription.Text.Trim()) + { + con += "è´¨é‡äº‹ä»¶æè¿°ç”±ã€" + pun.Description + "】改为ã€" + this.txtDescription.Text.Trim() + "】;"; + pun.Description = this.txtDescription.Text.Trim(); + } + if (pun.MIContractor != this.txtMIContractor.Text.Trim()) + { + con += "å¯èƒ½æ¶‰åŠçš„æ‰¿åŒ…商由ã€" + pun.MIContractor + "】改为ã€" + this.txtMIContractor.Text.Trim() + "】;"; + pun.MIContractor = this.txtMIContractor.Text.Trim(); + } + if (pun.SeType != this.rblSeType.SelectedValue) + { + con += "类型由ã€" + pun.SeType == "1" ? "æœåŠ¡" : "物资" + "】改为ã€" + this.rblSeType.SelectedValue == "1" ? "æœåŠ¡" : "物资" + "】;"; + pun.SeType = this.rblSeType.SelectedValue; + } + if (pun.FO_NO != this.txtFO_No.Text.Trim()) + { + con += "åˆåŒå·ç”±ã€" + pun.FO_NO + "】改为ã€" + this.txtFO_No.Text.Trim() + "】;"; + pun.FO_NO = this.txtFO_No.Text.Trim(); + } + if (pun.Contractor != this.txtContractor.Text.Trim()) + { + con += "æ¶‰åŠæ‰¿åŒ…商由ã€" + pun.Contractor + "】改为ã€" + this.txtContractor.Text.Trim() + "】;"; + pun.Contractor = this.txtContractor.Text.Trim(); + } + if (pun.ContractAdmin != this.drpContractAdmin.SelectedValue) + { + if (this.drpContractAdmin.SelectedValue != BLL.Const._Null) + { + con += "åˆåŒç®¡ç†å‘˜ç”±ã€" + Sys_UserService.GetUserNameByUserId(pun.Contractor) + "】改为ã€" + Sys_UserService.GetUserNameByUserId(this.drpContractAdmin.SelectedValue) + "】;"; + pun.ContractAdmin = this.drpContractAdmin.SelectedValue; + } + } + if (pun.ContractRequester != this.drpContractRequester.SelectedValue) + { + if (this.drpContractRequester.SelectedValue != BLL.Const._Null) + { + con += "åˆåŒéœ€æ±‚人由ã€" + Sys_UserService.GetUserNameByUserId(pun.ContractRequester) + "】改为ã€" + Sys_UserService.GetUserNameByUserId(this.drpContractRequester.SelectedValue) + "】;"; + pun.ContractRequester = this.drpContractRequester.SelectedValue; + } + } + //if (pun.ContractRequesterDep != txtContractRequesterDep.Text.Trim()) + //{ + // con += "需求人部门由" + pun.ContractRequesterDep + "改为" + txtContractRequesterDep.Text.Trim() + "ï¼›"; + // pun.ContractRequester = this.drpContractRequester.SelectedValue; + //} + //if (pun.Buyer != this.drpBuyer.SelectedValue) + //{ + // con += "采购员由" + Sys_UserService.GetUserNameByUserId(pun.Buyer) + "改为" + Sys_UserService.GetUserNameByUserId(this.drpBuyer.SelectedValue) + "ï¼›"; + // pun.ContractRequester = this.drpContractRequester.SelectedValue; + //} + if (pun.ViolationDegree != this.drpViolationDegree.SelectedValue) + { + if (this.drpViolationDegree.SelectedValue != BLL.Const._Null) + { + con += "è¿ç« æ¡æ¬¾ç”±ã€" + BLL.ViolationClauseService.GetViolationClause(pun.ViolationDegree).ClauseDef + "】改为ã€" + BLL.ViolationClauseService.GetViolationClause(this.drpViolationDegree.SelectedValue).ClauseDef + "】;"; + pun.ViolationDegree = this.drpViolationDegree.SelectedValue; + } + } + if (pun.Company != Funs.GetNewDecimal(this.txtCompany.Text.Trim())) + { + con += "è¿ç« æ‰£æ¬¾ï¼ˆå…¬å¸ï¼‰ç”±ã€" + pun.Company + "】改为ã€" + Funs.GetNewDecimal(this.txtCompany.Text.Trim()) + "】;"; + pun.Company = Funs.GetNewDecimal(this.txtCompany.Text.Trim()); + } + if (pun.IndividualPerson != this.txtIndividualPerson.Text.Trim()) + { + con += "è¿ç« äººå‘˜ç”±ã€" + pun.IndividualPerson + "】改为ã€" + this.txtIndividualPerson.Text.Trim() + "】;"; + pun.IndividualPerson = this.txtIndividualPerson.Text.Trim(); + } + if (pun.Individual != Funs.GetNewDecimal(this.txtIndividual.Text.Trim())) + { + con += "è¿ç« æ‰£æ¬¾ï¼ˆä¸ªäººï¼‰ç”±ã€" + pun.Individual + "】改为ã€" + Funs.GetNewDecimal(this.txtIndividual.Text.Trim()) + "】;"; + pun.Individual = Funs.GetNewDecimal(this.txtIndividual.Text.Trim()); + } + if (pun.UserDep != this.drpUserDep.SelectedValue) + { + if (this.drpUserDep.SelectedValue != BLL.Const._Null) + { + con += "用户部门由ã€" + DepartService.GetDepartNameById(pun.UserDep) + "】改为ã€" + DepartService.GetDepartNameById(this.drpUserDep.SelectedValue) + "】;"; + pun.UserDep = this.drpUserDep.SelectedValue; + } + } + this.txtModifyDef.Text = this.hdModifyContent.Text + con; + pun.ModifyContent = this.txtModifyDef.Text.Trim(); + pun.Modifyer = this.CurrUser.UserId; + pun.ModifyDate = DateTime.Now; + Funs.DB.SubmitChanges(); + ShowNotify("修改æˆåŠŸï¼", MessageBoxIcon.Success); + } + #endregion + } + } + } + } + } + #endregion } } \ No newline at end of file diff --git a/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx.designer.cs b/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx.designer.cs index 50b947b..6bd08a3 100644 --- a/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx.designer.cs +++ b/FCL/FineUIPro.Web/ContractorQuality/IncidentInvestigationEdit.aspx.designer.cs @@ -761,6 +761,105 @@ namespace FineUIPro.Web.ContractorQuality /// protected global::FineUIPro.TextBox txtBuyerReson; + /// + /// frModifyDef 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.FormRow frModifyDef; + + /// + /// txtModifyDef 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.TextArea txtModifyDef; + + /// + /// frModifyDefUrl 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.FormRow frModifyDefUrl; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// Label13 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.Label Label13; + + /// + /// btnModifyAttach 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.Button btnModifyAttach; + + /// + /// Label14 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.Label Label14; + + /// + /// lbtnModifyAttach 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.LinkButton lbtnModifyAttach; + + /// + /// frPassResult 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.FormRow frPassResult; + + /// + /// rblPass 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.RadioButtonList rblPass; + + /// + /// Label15 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.Label Label15; + /// /// Toolbar1 控件。 /// @@ -770,6 +869,15 @@ namespace FineUIPro.Web.ContractorQuality /// protected global::FineUIPro.Toolbar Toolbar1; + /// + /// hdModifyContent 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.HiddenField hdModifyContent; + /// /// hdId 控件。 /// @@ -824,6 +932,24 @@ namespace FineUIPro.Web.ContractorQuality /// protected global::FineUIPro.Button btnSbumit; + /// + /// btnPause 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.Button btnPause; + + /// + /// btnSureModify 控件。 + /// + /// + /// 自动生æˆçš„字段。 + /// è‹¥è¦è¿›è¡Œä¿®æ”¹ï¼Œè¯·å°†å­—段声明从设计器文件移到代ç éšè—文件。 + /// + protected global::FineUIPro.Button btnSureModify; + /// /// Window1 控件。 /// diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs index c0ebab3..a55ff03 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.cs @@ -791,7 +791,7 @@ namespace FineUIPro.Web.Evaluation fsModel.Timely = homelyModel.Timely; } } - else if (fotype.Trim() == "TAR") + else if (fotype.Trim().Contains("TAR")) { if (tar_homelyModel != null && tar_homelyModel.Timely != null) { @@ -834,6 +834,7 @@ namespace FineUIPro.Web.Evaluation if (punish != null) { punish.IsUserEvaluated = true; + //punish.IsUserEvaluatedTime = DateTime.Now; Funs.DB.SubmitChanges(); } @@ -914,7 +915,7 @@ namespace FineUIPro.Web.Evaluation fsModel.Timely = homelyModel.Timely; } } - else if (fotype.Trim() == "TAR") + else if (fotype.Trim().Contains("TAR")) { if (tar_homelyModel != null && tar_homelyModel.Timely != null) { @@ -965,6 +966,7 @@ namespace FineUIPro.Web.Evaluation if (punish != null) { punish.IsDepEvaluated = true; + //punish.IsDepEvaluatedTime = DateTime.Now; Funs.DB.SubmitChanges(); } } @@ -1303,7 +1305,7 @@ namespace FineUIPro.Web.Evaluation fsModel.Timely = homelyModel.Timely; } } - else if (fotype.Trim() == "TAR") + else if (fotype.Trim().Contains("TAR")) { if (tar_homelyModel != null && tar_homelyModel.Timely != null) { @@ -1387,7 +1389,7 @@ namespace FineUIPro.Web.Evaluation fsModel.Timely = homelyModel.Timely; } } - else if (fotype.Trim() == "TAR") + else if (fotype.Trim().Contains("TAR")) { if (tar_homelyModel != null && tar_homelyModel.Timely != null) { diff --git a/FCL/FineUIPro.Web/Evaluation/PerformanceReport.aspx.cs b/FCL/FineUIPro.Web/Evaluation/PerformanceReport.aspx.cs index 3afe246..d75b85f 100644 --- a/FCL/FineUIPro.Web/Evaluation/PerformanceReport.aspx.cs +++ b/FCL/FineUIPro.Web/Evaluation/PerformanceReport.aspx.cs @@ -2120,6 +2120,8 @@ namespace FineUIPro.Web.Evaluation ws.GetRow(rowIndex).GetCell(24).SetCellValue(p.SES_No); if (ws.GetRow(rowIndex).GetCell(25) == null) ws.GetRow(rowIndex).CreateCell(25); ws.GetRow(rowIndex).GetCell(25).SetCellValue(p.CompletionDate != null ? p.CompletionDate.Value.ToString("yyyy/MM/dd") : ""); + if (ws.GetRow(rowIndex).GetCell(26) == null) ws.GetRow(rowIndex).CreateCell(26); + ws.GetRow(rowIndex).GetCell(26).SetCellValue(p.CreateDate != null ? p.CreateDate.Value.ToString("yyyy/MM/dd") : ""); if ((int)(90 * (rowIndex) / totalNum) > percent) { @@ -2244,6 +2246,8 @@ namespace FineUIPro.Web.Evaluation wsCm.GetRow(rowIndex).GetCell(14).SetCellValue(p.User_Representative); if (wsCm.GetRow(rowIndex).GetCell(15) == null) wsCm.GetRow(rowIndex).CreateCell(15); wsCm.GetRow(rowIndex).GetCell(15).SetCellValue(p.BycDept); + if (wsCm.GetRow(rowIndex).GetCell(16) == null) wsCm.GetRow(rowIndex).CreateCell(16); + wsCm.GetRow(rowIndex).GetCell(16).SetCellValue(p.UploadDate != null ? p.UploadDate.Value.ToString("yyyy/MM/dd") : ""); if ((int)((90 * (rowIndex + punishCount )) / totalNum) > percent) { @@ -2910,6 +2914,8 @@ namespace FineUIPro.Web.Evaluation ws.GetRow(rowIndex).GetCell(24).SetCellValue(p.SES_No); if (ws.GetRow(rowIndex).GetCell(25) == null) ws.GetRow(rowIndex).CreateCell(25); ws.GetRow(rowIndex).GetCell(25).SetCellValue(p.CompletionDate != null ? p.CompletionDate.Value.ToString("yyyy/MM/dd") : ""); + if (ws.GetRow(rowIndex).GetCell(26) == null) ws.GetRow(rowIndex).CreateCell(26); + ws.GetRow(rowIndex).GetCell(26).SetCellValue(p.CreateDate != null ? p.CreateDate.Value.ToString("yyyy/MM/dd") : ""); if ((int)(90 * (rowIndex) / totalNum) > percent) { @@ -3034,6 +3040,8 @@ namespace FineUIPro.Web.Evaluation wsCm.GetRow(rowIndex).GetCell(14).SetCellValue(p.User_Representative); if (wsCm.GetRow(rowIndex).GetCell(15) == null) wsCm.GetRow(rowIndex).CreateCell(15); wsCm.GetRow(rowIndex).GetCell(15).SetCellValue(p.BycDept); + if (wsCm.GetRow(rowIndex).GetCell(16) == null) wsCm.GetRow(rowIndex).CreateCell(16); + wsCm.GetRow(rowIndex).GetCell(16).SetCellValue(p.UploadDate != null ? p.UploadDate.Value.ToString("yyyy/MM/dd") : ""); if ((int)((90 * (rowIndex + punishCount)) / totalNum) > percent) { diff --git a/FCL/FineUIPro.Web/Evaluation/SafetyEvaluation.aspx.cs b/FCL/FineUIPro.Web/Evaluation/SafetyEvaluation.aspx.cs index e1d6b19..9b39ae3 100644 --- a/FCL/FineUIPro.Web/Evaluation/SafetyEvaluation.aspx.cs +++ b/FCL/FineUIPro.Web/Evaluation/SafetyEvaluation.aspx.cs @@ -835,6 +835,7 @@ namespace FineUIPro.Web.Evaluation if (punish != null) { punish.IsUserEvaluated = true; + punish.IsUserEvaluatedTime = DateTime.Now; Funs.DB.SubmitChanges(); } } @@ -964,6 +965,7 @@ namespace FineUIPro.Web.Evaluation if (punish != null) { punish.IsDepEvaluated = true; + punish.IsDepEvaluatedTime = DateTime.Now; Funs.DB.SubmitChanges(); } } diff --git a/FCL/FineUIPro.Web/File/Excel/Performance Report_CN.xlsx b/FCL/FineUIPro.Web/File/Excel/Performance Report_CN.xlsx index 6674422..633534f 100644 Binary files a/FCL/FineUIPro.Web/File/Excel/Performance Report_CN.xlsx and b/FCL/FineUIPro.Web/File/Excel/Performance Report_CN.xlsx differ diff --git a/FCL/FineUIPro.Web/File/Excel/Performance Report_EN.xlsx b/FCL/FineUIPro.Web/File/Excel/Performance Report_EN.xlsx index 2b05bd7..c883dc1 100644 Binary files a/FCL/FineUIPro.Web/File/Excel/Performance Report_EN.xlsx and b/FCL/FineUIPro.Web/File/Excel/Performance Report_EN.xlsx differ diff --git a/FCL/FineUIPro.Web/Global.asax.cs b/FCL/FineUIPro.Web/Global.asax.cs index ed1ee52..55825f5 100644 --- a/FCL/FineUIPro.Web/Global.asax.cs +++ b/FCL/FineUIPro.Web/Global.asax.cs @@ -15,6 +15,7 @@ using FineUIPro.Web.common; using Model; using NPOI.SS.Formula.Functions; + using Newtonsoft.Json; public class Global : System.Web.HttpApplication { @@ -25,7 +26,7 @@ protected void Application_Start(object sender, EventArgs e) { - + Application["OnlineUserCount"] = 0; try { @@ -45,9 +46,8 @@ AppDomain.Unload(AppDomain.CurrentDomain); } - //æ¯æœˆï¼ˆ2,5,8,10)邮件自动å‘é€ç»™SSRæäº¤äººå‘˜å’Œä¸»å调人åŠåˆåŒå‘˜ï¼Œç”¨æˆ·ä»£è¡¨ç­‰è¯„ä»· - if ((DateTime.Now.Day == 2 || DateTime.Now.Day == 5 || DateTime.Now.Day == 8 || DateTime.Now.Day == 10)) + if ((DateTime.Now.Day == 2 || DateTime.Now.Day == 5 || DateTime.Now.Day == 8 || DateTime.Now.Day == 10) && DateTime.Now.Hour == 8) { System.Timers.Timer aTimer = new System.Timers.Timer(); aTimer.Elapsed += new System.Timers.ElapsedEventHandler(aTimer_Elapsed); @@ -55,20 +55,20 @@ aTimer.Interval = 1000 * 60 * 60; aTimer.Enabled = true; aTimer.Start(); - } + //自动填写评价 if (DateTime.Now.Day == 12) { System.Timers.Timer aTimer = new System.Timers.Timer(); aTimer.Elapsed += new System.Timers.ElapsedEventHandler(aTimer_AutoFill); //30分钟执行一次 - aTimer.Interval = 1800000; + aTimer.Interval = 1000 * 60 * 30; aTimer.Enabled = true; aTimer.Start(); - } + // 过期æç¤º //var foList = from x in Funs.DB.FC_SESRelatedData // where x.Expire_Date != null @@ -83,7 +83,7 @@ aTimer.Interval = 1000 * 60 * 60; aTimer.Enabled = true; aTimer.Start(); - + } // 框架承包商评估表的填写邮件通知 @@ -91,7 +91,7 @@ { System.Timers.Timer aTimer = new System.Timers.Timer(); aTimer.Elapsed += new System.Timers.ElapsedEventHandler(aTimer_FC_AutoSend); - //4å°æ—¶æ‰§è¡Œä¸€æ¬¡ + //1å°æ—¶æ‰§è¡Œä¸€æ¬¡ aTimer.Interval = 1000 * 60 * 60; aTimer.Enabled = true; aTimer.Start(); @@ -102,9 +102,9 @@ { System.Timers.Timer fcTimer = new System.Timers.Timer(); fcTimer.Elapsed += new System.Timers.ElapsedEventHandler(FC_AutoStatus); - //120分钟执行一次 + //60分钟执行一次 fcTimer.Interval = 1000 * 60 * 60; - fcTimer.Enabled = true; + fcTimer.Enabled = true; fcTimer.Start(); } @@ -187,6 +187,28 @@ fcTimer.Enabled = true; fcTimer.Start(); } + + //åˆåŒç»©æ•ˆè¿è§„å¤„ç† + if (DateTime.Now.Hour == 10) + { + System.Timers.Timer fcTimer = new System.Timers.Timer(); + fcTimer.Elapsed += new System.Timers.ElapsedEventHandler(queTimer_ViolationHandling); + //1å°æ—¶æ‰§è¡Œä¸€æ¬¡ + fcTimer.Interval = 1000 * 60 * 60; + fcTimer.Enabled = true; + fcTimer.Start(); + } + + //承包商报告主å调员æäº¤åŽé€šçŸ¥æ‰¿åŒ…商è”系人,若无异议或3天未æ“作,å‘é€é‚®ä»¶ç»™ç”¨æˆ·éƒ¨é—¨ç»ç† + if (DateTime.Now.Hour == 10) + { + System.Timers.Timer fcTimer = new System.Timers.Timer(); + fcTimer.Elapsed += new System.Timers.ElapsedEventHandler(PunTimer_PunishmentTimer); + //1å°æ—¶æ‰§è¡Œä¸€æ¬¡ + fcTimer.Interval = 1000 * 60 * 60; + fcTimer.Enabled = true; + fcTimer.Start(); + } } private void queTimer_AutoSendOne(object sender, System.Timers.ElapsedEventArgs e) @@ -230,7 +252,7 @@ userName = contractAdmin.First().UserName; departId = contractAdmin.First().DepartId; } - + var depart = BLL.DepartService.GetDepartById(departId); if (depart != null) { @@ -309,9 +331,9 @@ if (que.QueType == "3") { var cts = 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 == "CTS/S") - select x; + join y in Funs.DB.Sys_Role on x.RoleId equals y.RoleId + where x.Email != null && x.Email != "" && (y.RoleName == "CTS/S") + select x; if (cts.Count() > 0) { mailTo = cts.Select(x => x.Email).ToArray(); @@ -424,12 +446,12 @@ myCol.Add("Contractor_En", contractor.Contractor); myCol.Add("Expire_En", que.LimitEndDate.Value.ToShortDateString()); - + myCol.Add("ContractNo", fo.FO_NO); - myCol.Add("Contractor", (contractor.ContractorCN != null && contractor.ContractorCN!="") ? contractor.ContractorCN : contractor.Contractor); + myCol.Add("Contractor", (contractor.ContractorCN != null && contractor.ContractorCN != "") ? contractor.ContractorCN : contractor.Contractor); myCol.Add("QuaName", que.QueName); myCol.Add("Expire", que.LimitEndDate.Value.ToShortDateString()); - + mailBody = TemplateHelper.BulidByFile2(templetpath, myCol); string mailName = EmailTemplate.Select(p => p.EmailName).FirstOrDefault(); @@ -470,7 +492,7 @@ } string[] mailTo = null; string mailBody = string.Empty; - + string mailSubject = string.Empty; string mailPriority = string.Empty; string[] mailCC = null; @@ -706,13 +728,13 @@ } private void aTimer_AutoSend(object sender, System.Timers.ElapsedEventArgs e) - { + { // 过期æç¤º,30天范围 - var foList = from x in Funs.DB.FC_SESRelatedData where x.Expire_Date != null + var foList = from x in Funs.DB.FC_SESRelatedData where x.Expire_Date != null && x.Expire_Date.Value.AddMonths(-6).AddDays(-7).Date <= DateTime.Now.Date && x.Expire_Date.Value.AddMonths(-5).AddDays(-7).Date >= DateTime.Now.Date select x; - if (foList.Count() > 0) + if (foList.Count() > 0) { foreach (var fo in foList) { @@ -800,7 +822,7 @@ var cost = from x in Funs.DB.Sys_User join y in Funs.DB.Sys_Role on x.RoleId equals y.RoleId join z in Funs.DB.Base_Depart on x.DepartId equals z.DepartId - where (y.RoleName == "Cost Engineer Leader" || y.RoleName == "Contractor_Leader" || z.DepartCode== "CT/K") && x.Email != null && x.Email != "" + where (y.RoleName == "Cost Engineer Leader" || y.RoleName == "Contractor_Leader" || z.DepartCode == "CT/K") && x.Email != null && x.Email != "" select x; if (cost.Count() > 0) { @@ -829,8 +851,8 @@ 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" || x.UserId== deparatLeader || y.RoleName == "CGP Director" || (y.RoleName== "CT Director" && x.DepartId== departId)) + where x.Email != null && x.Email != "" + && (y.RoleName == "CTE/D Manager" || x.UserId == deparatLeader || y.RoleName == "CGP Director" || (y.RoleName == "CT Director" && x.DepartId == departId)) select x; mailTo = userList.Select(x => x.Email).ToArray(); @@ -838,7 +860,7 @@ //var nowDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00"); //&& p.CreateTime.Value >= nowDate - var email = Funs.DB.SendEmail.Where(p => p.EmailStatus == "å‘逿ˆåŠŸ" + 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) @@ -889,7 +911,7 @@ string resultMessage = ""; string departId = string.Empty; - + var discipline = BLL.DisciplineService.GetDisciplineById(fo.DisciplineId); //string disc = discipline.Discipline; //if (!string.IsNullOrEmpty(discipline.DisciplineCN)) @@ -905,7 +927,7 @@ var buyer = from x in Funs.DB.Sys_User where x.UserId == fo.BuyerId && x.Email != null && x.Email != "" select x; if (buyer.Count() > 0) { - userList.Add(buyer.First()); + 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) @@ -917,7 +939,7 @@ { userList.Add(userRepresentative.First()); } - + //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 != "" @@ -975,6 +997,7 @@ } #endregion + #region æ¯æœˆï¼ˆ2,5,8,10)邮件自动å‘é€ç»™SSRæäº¤äººå‘˜å’Œä¸»å调人åŠåˆåŒå‘˜ï¼Œç”¨æˆ·ä»£è¡¨ç­‰è¯„ä»· /// /// æ¯æœˆï¼ˆ2,5,8,10)邮件自动å‘é€ç»™SSRæäº¤äººå‘˜å’Œä¸»å调人åŠåˆåŒå‘˜ï¼Œç”¨æˆ·ä»£è¡¨ç­‰è¯„ä»· /// @@ -1082,7 +1105,7 @@ { mailCC = mailCCLs.Where(p => !string.IsNullOrEmpty(p)).ToArray(); } - + } // 总监 @@ -1090,7 +1113,7 @@ var mailToDirector = from x in Funs.DB.Sys_User join y in Funs.DB.Base_Depart on x.DepartId equals y.DepartId where departCode.Contains(y.DepartCode) && x.RoleId == Const.Role_DirectorId select x; - if (DateTime.Now.Day == 11 && mailToDirector.Count() > 0) + if (DateTime.Now.Day == 10 && mailToDirector.Count() > 0) { var mailccLs = new List(); // 部门ç»ç† @@ -1156,7 +1179,7 @@ join y in Funs.DB.Base_Depart on x.DepartId equals y.DepartId where departCode.Contains(y.DepartCode) && x.RoleId == Const.Role_DirectorId select x; - if (DateTime.Now.Day == 11 && mailToDirector.Count() > 0) + if (DateTime.Now.Day == 10 && mailToDirector.Count() > 0) { var mailccLs = new List(); // 部门ç»ç† @@ -1181,7 +1204,9 @@ } } } + #endregion + #region 自动填写评价 /// /// 自动填写评价 /// @@ -1360,6 +1385,7 @@ Funs.DB.SubmitChanges(); } } + #endregion private void FC_AutoStatus(object sender, System.Timers.ElapsedEventArgs e) { @@ -1422,7 +1448,7 @@ catch (Exception ex) { ErrLogInfo.WriteLog($"执行当å‰sql:{strSql}错误:{ex.Message},当å‰ID={d.ID},当å‰status={status}"); - //记录日志到数æ®ä¸­ã€‚ + //记录日志到数æ®ä¸­ã€‚ } } } @@ -1577,6 +1603,265 @@ } #endregion + #region åˆåŒç»©æ•ˆè¿è§„å¤„ç† + /// + /// åˆåŒç»©æ•ˆè§„æ ¼å¤„ç† + /// + /// + /// + private void queTimer_ViolationHandling(object sender, System.Timers.ElapsedEventArgs e) + { + var foData = (from x in Funs.DB.FC_SESRelatedData where x.FO_NO== "4988606499" && x.FC_Status != "Closed" select x).ToList(); + if (foData.Count() > 0) + { + foreach (var fo in foData) + { + string Contract_Admin = BLL.Sys_UserService.GetUserNameByUserId(fo.Contract_Admin);//åˆåŒç®¡ç†å‘˜ + string Contractor = BLL.ContractorService.GetContractorById(fo.Contractor).ContractorCN;//承包商 + List userList = new List(); + EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId); + if (pops == null) + { + return; + } + string[] mailTo = null; + string mailSubject = string.Empty; + string mailBody = string.Empty; + string mailPriority = string.Empty; + string[] mailCC = null; + string resultMessage = ""; + string userName = string.Empty; + + string violation_type = string.Empty;//è¿è§„类型 + string consequence_action = string.Empty;//处ç†ç»“æžœ + //零容å¿è¿ç«  + var punishments = (from x in Funs.DB.EMC_Punishment where x.FO_NO == fo.FO_NO && x.Flag == "1" && x.ViolationDegree == "3" select x).ToList(); + if (punishments.Count == 1) //一次零容å¿è¿ç« ï¼šçº¦è°ˆ + { + violation_type = "一次零容å¿è¿ç« "; + consequence_action = "约谈"; + } + else if (punishments.Count == 3)//三次零容å¿è¿ç« ï¼šNCR + { + violation_type = "三次零容å¿è¿ç« "; + consequence_action = "NCR"; + } + + 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"); + List yearToDateParam = new List(); + yearToDateParam.Add(new SqlParameter("@StartTime", startTime)); + yearToDateParam.Add(new SqlParameter("@EndTime", endTime)); + yearToDateParam.Add(new SqlParameter("@FoNo", fo.FO_NO)); + SqlParameter[] yearToDateParList = yearToDateParam.ToArray(); + var sesDataTable = SQLHelper.GetDataTableRunProc("Sp_ContractorEvaluation", yearToDateParList); + + int s = 0; + for (int i = 0; i < sesDataTable.Rows.Count; i++) + { + decimal sumScore = Convert.ToDecimal(sesDataTable.Rows[i]["SumScore"]); + if (sumScore < 60) + { + s++; + } + } + if (s >= 3) + { + violation_type = "累计三次月度评估低于60分"; + consequence_action = "ä¸å¾—å‚与下轮åˆåŒ"; + } + else + { + decimal? score = (from x in Funs.DB.FC_Score where x.Contract_No == fo.FO_NO select x).Sum(x => x.Score1 + x.Score2 + x.Score3 + x.Score4 + x.Score5 + x.Score6); + if (s == 2 || score < 12) + { + violation_type = "累计两次月度评估低于60分或安全评估低于12分"; + consequence_action = "约谈"; + } + } + + var ncrs = (from x in Funs.DB.FC_ContractManagement where x.FC_ID == fo.ID && x.FileTypeId == "6" select x).ToList(); + if (ncrs.Count == 3) + { + violation_type = "三次NCR"; + consequence_action = "æå‰ç»ˆæ­¢åˆåŒï¼Œä¸å¾—å‚与下轮åˆåŒ"; + } + + if (!string.IsNullOrEmpty(violation_type) && !string.IsNullOrEmpty(consequence_action)) + { + //å‘é€å¯¹åº”åˆåŒç®¡ç†å‘˜ + 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) + { + mailTo = contractAdmin.Select(x => x.Email).ToArray(); + userName = contractAdmin.First().UserName; + } + //æŠ„é€ + 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; + if (cc.Count() > 0) + { + foreach (var c in cc) + { + userList.Add(c); + } + } + mailCC = userList.Select(x => x.Email).ToArray(); + + + if (mailTo == null || mailTo.Length == 0) return; + var email = Funs.DB.SendEmail.Where(p => p.EmailStatus == "å‘逿ˆåŠŸ" + && p.EmailTile.Contains("åˆåŒç»©æ•ˆè¿è§„处ç†") + && p.EmailTile.Contains(fo.FO_NO) && mailTo.Contains(p.EmailURL)); + if (email.Count() > 0) + { + var emailurl = email.Select(p => p.EmailURL).ToList(); + mailTo = mailTo.Where(p => !emailurl.Contains(p)).ToArray(); + } + 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(); + myCol.Add("ContractAdmin", Contract_Admin);//åˆåŒç®¡ç†å‘˜ + myCol.Add("contract_number", fo.FO_NO);//åˆåŒå· + myCol.Add("Contractor_name", Contractor);//承包商åç§° + myCol.Add("Contractor_contact", fo.MainHead);//承包商负责人 + myCol.Add("violation type", violation_type);//è¿è§„类型 + myCol.Add("consequence_action", consequence_action);//处ç†åŽæžœ + + mailBody = TemplateHelper.BulidByFile2(templetpath, myCol); + + string mailName = EmailTemplate.Select(p => p.EmailName).FirstOrDefault(); + NameValueCollection myCol1 = new NameValueCollection(); + myCol1.Add("contract_number", fo.FO_NO); + myCol1.Add("violation type", violation_type); + mailSubject = TemplateHelper.BulidByFile2(mailName, myCol1); + + var sendMail = from x in Funs.DB.SendEmail where x.EmailTile == mailSubject && (mailTo.Contains(x.EmailURL) || mailCC.Contains(x.EmailURL)) select x; + if (sendMail.Count() == 0) + { + MailHelper.SendNetMail2(pops, pops.EmailYx, mailTo, mailSubject, mailBody, mailPriority, mailCC, null, out resultMessage); + } + } + } + } + } + } + #endregion + + # region 承包商报告主å调员æäº¤åŽé€šçŸ¥æ‰¿åŒ…商è”系人,若无异议或3天未æ“作,å‘é€é‚®ä»¶ç»™ç”¨æˆ·éƒ¨é—¨ï¼ˆæœ‰éƒ¨é—¨ä»£ç†äººå‘é€ç»™éƒ¨é—¨ä»£ç†äººæŠ„é€ç»™éƒ¨é—¨ç»ç†ï¼Œæ— éƒ¨é—¨ä»£ç†äººå‘é€åˆ™å‘é€ç»™éƒ¨é—¨ç»ç†ï¼‰ + /// + /// 承包商报告主å调员æäº¤åŽé€šçŸ¥æ‰¿åŒ…商è”系人,若无异议或3天未æ“作,å‘é€é‚®ä»¶ç»™ç”¨æˆ·éƒ¨é—¨ï¼ˆæœ‰éƒ¨é—¨ä»£ç†äººå‘é€ç»™éƒ¨é—¨ä»£ç†äººæŠ„é€ç»™éƒ¨é—¨ç»ç†ï¼Œæ— éƒ¨é—¨ä»£ç†äººå‘é€åˆ™å‘é€ç»™éƒ¨é—¨ç»ç†ï¼‰ + /// + /// + /// + private void PunTimer_PunishmentTimer(object sender, System.Timers.ElapsedEventArgs e) + { + var punishments = (from x in Funs.DB.EMC_Punishment + where x.Flag == "2" && x.States == "3" && x.SeType == "1" + && (x.Pause == false || x.Pause == null) && x.MainCoordinatorEndDate.Value.AddDays(3) < DateTime.Now + orderby x.CreateDate descending + select x).ToList(); + if (punishments.Count() > 0) + { + foreach (var pun in punishments) + { + var audit = BLL.PunishmentAuditService.GetAuditByAuditMan(pun.PunishmentId, pun.UserDep); + if (audit == null) + { + //新增用户部门æ“作æµç¨‹ + Model.EMC_PunishmentAudit newAudit = new EMC_PunishmentAudit(); + newAudit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit)); + newAudit.PunishmentId = pun.PunishmentId; + newAudit.AuditMan = pun.UserDep; + BLL.PunishmentAuditService.AddPunishmentAudit(newAudit); + } + + List userList = new List(); + EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId); + if (pops == null) + { + return; + } + string[] mailTo = null; + string mailSubject = string.Empty; + string mailBody = string.Empty; + string mailPriority = string.Empty; + string[] mailCC = null; + string resultMessage = ""; + string departLeader = string.Empty; + string delegatedRepresentative = string.Empty; + + var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主å调员填写完æˆåŽå®¡æ‰¹é€šè¿‡é€šçŸ¥")); + if (emailTemplate.Count() > 0) + { + var depart = BLL.DepartService.GetDepartById(pun.UserDep); + if (depart != null) + { + departLeader = depart.DepartLeader; + delegatedRepresentative = depart.DelegatedRepresentative; + } + if (!string.IsNullOrEmpty(delegatedRepresentative)) + { + var userTo = from x in Funs.DB.Sys_User + where x.UserId.Contains(delegatedRepresentative) && x.Email != null && x.Email != "" + select x; + if (userTo != null) + { + mailTo = userTo.Select(x => x.Email).ToArray(); + } + + var userCc = from x in Funs.DB.View_EMail_UserTo + where ((x.PunishmentId == pun.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector) || x.UserId.Contains(departLeader)) + && x.Email != null && x.Email != "" + select x; + if (userCc != null) + { + mailCC = userCc.Select(x => x.Email).Distinct().ToArray(); + } + } + else + { + if (!string.IsNullOrEmpty(departLeader)) + { + var userTo = from x in Funs.DB.Sys_User + where x.UserId.Contains(departLeader) && x.Email != null && x.Email != "" + select x; + if (userTo != null) + { + mailTo = userTo.Select(x => x.Email).ToArray(); + } + } + + var userCc = from x in Funs.DB.View_EMail_UserTo + where ((x.PunishmentId == pun.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector)) + && x.Email != null && x.Email != "" + select x; + if (userCc != null) + { + mailCC = userCc.Select(x => x.Email).Distinct().ToArray(); + } + } + + if (mailTo.Length > 0) + { + NameValueCollection myPram = new NameValueCollection(); + myPram.Add("å‘现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : ""); + myPram.Add("ä½ç½®", pun.Location); + myPram.Add("è´¨é‡äº‹ä»¶æè¿°", pun.Description); + MailHelper.SendPunishSesMail(pops, myPram, "主å调员填写完æˆåŽå®¡æ‰¹é€šè¿‡é€šçŸ¥", mailTo, mailCC, out resultMessage); + } + } + } + } + } + #endregion + private void Sync_HR(object sender, System.Timers.ElapsedEventArgs e) { //è°ƒç”¨æŽ¥å£ diff --git a/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs b/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs index 03fe229..26ca83b 100644 --- a/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs +++ b/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs @@ -55,16 +55,16 @@ namespace FineUIPro.Web.SES } // BLL.SESRelatedDataService.InitFONoDropDownList(this.drpFO_No, true);//åˆåŒå· - //BLL.ContractorService.InitDropDownList(drpContractor, true); //承包商; - var contractorLists = from x in Funs.DB.FC_SESRelatedData - join y in Funs.DB.Base_Contractor on x.Contractor equals y.ContractorId - where x.Expire_Date.Value.AddYears(1) >= DateTime.Now - select new { y.ContractorId, Contractor = y.Contractor + y.ContractorCN }; - this.drpContractor.DataTextField = "Contractor"; - this.drpContractor.DataValueField = "ContractorId"; - this.drpContractor.DataSource = contractorLists.Distinct(); - this.drpContractor.DataBind(); - Funs.FineUIPleaseSelect(this.drpContractor); + BLL.ContractorService.InitDropDownList(drpContractor, true); //承包商; + //var contractorLists = from x in Funs.DB.FC_SESRelatedData + // join y in Funs.DB.Base_Contractor on x.Contractor equals y.ContractorId + // where x.Expire_Date.Value.AddYears(1) >= DateTime.Now + // select new { y.ContractorId, Contractor = y.Contractor + y.ContractorCN }; + //this.drpContractor.DataTextField = "Contractor"; + //this.drpContractor.DataValueField = "ContractorId"; + //this.drpContractor.DataSource = contractorLists.Distinct(); + //this.drpContractor.DataBind(); + //Funs.FineUIPleaseSelect(this.drpContractor); BLL.DepartService.InitDepartToWhere(this.drpBYC_RU, true);//BYC负责部门 BLL.Sys_UserService.InitUserDropDownList(this.drpViolationInspector, true);//è¿ç« æ£€æŸ¥äºº diff --git a/FCL/FineUIPro.Web/SES/SESRelatedDataContractManage2.aspx.cs b/FCL/FineUIPro.Web/SES/SESRelatedDataContractManage2.aspx.cs index 4077bce..f09ee10 100644 --- a/FCL/FineUIPro.Web/SES/SESRelatedDataContractManage2.aspx.cs +++ b/FCL/FineUIPro.Web/SES/SESRelatedDataContractManage2.aspx.cs @@ -238,7 +238,7 @@ namespace FineUIPro.Web.SES { totalSupp += item.SupplementedBudget; } - this.txtTotalBudget.Text = (Funs.GetNewIntOrZero(txtInitialBudget.Text.Trim()) + totalSupp + Funs.GetNewDecimalOrZero(this.txtSupplementedBudget.Text.Trim())).ToString(); + this.txtTotalBudget.Text = (Funs.GetNewDecimalOrZero(txtInitialBudget.Text.Trim()) + totalSupp + Funs.GetNewDecimalOrZero(this.txtSupplementedBudget.Text.Trim())).ToString(); } } } diff --git a/FCL/Model/Model.cs b/FCL/Model/Model.cs index 29b3122..3b814be 100644 --- a/FCL/Model/Model.cs +++ b/FCL/Model/Model.cs @@ -1739,6 +1739,8 @@ namespace Model private string _DepartLeader; + private string _DelegatedRepresentative; + private EntitySet _EMC_CTSalesContracts; private EntitySet _Depart; @@ -1763,6 +1765,8 @@ namespace Model partial void OnRemarkChanged(); partial void OnDepartLeaderChanging(string value); partial void OnDepartLeaderChanged(); + partial void OnDelegatedRepresentativeChanging(string value); + partial void OnDelegatedRepresentativeChanged(); #endregion public Base_Depart() @@ -1875,6 +1879,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DelegatedRepresentative", DbType="NVarChar(50)")] + public string DelegatedRepresentative + { + get + { + return this._DelegatedRepresentative; + } + set + { + if ((this._DelegatedRepresentative != value)) + { + this.OnDelegatedRepresentativeChanging(value); + this.SendPropertyChanging(); + this._DelegatedRepresentative = value; + this.SendPropertyChanged("DelegatedRepresentative"); + this.OnDelegatedRepresentativeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_EMC_CTSalesContracts_Base_Depart", Storage="_EMC_CTSalesContracts", ThisKey="DepartId", OtherKey="DeptOfRevenue", DeleteRule="NO ACTION")] public EntitySet EMC_CTSalesContracts { @@ -9916,6 +9940,8 @@ namespace Model private string _BuyerReson; + private string _SSRAdminId; + private System.Nullable _SSRStaratDate; private System.Nullable _SSREndDate; @@ -9928,7 +9954,19 @@ namespace Model private System.Nullable _UserDepEndDate; - private string _SSRAdminId; + private System.Nullable _Pause; + + private System.Nullable _PauseDate; + + private string _ModifyContent; + + private string _Modifyer; + + private System.Nullable _ModifyDate; + + private System.Nullable _IsUserEvaluatedTime; + + private System.Nullable _IsDepEvaluatedTime; private EntityRef _Base_Depart; @@ -10042,6 +10080,8 @@ namespace Model partial void OnSESReasonChanged(); partial void OnBuyerResonChanging(string value); partial void OnBuyerResonChanged(); + partial void OnSSRAdminIdChanging(string value); + partial void OnSSRAdminIdChanged(); partial void OnSSRStaratDateChanging(System.Nullable value); partial void OnSSRStaratDateChanged(); partial void OnSSREndDateChanging(System.Nullable value); @@ -10054,8 +10094,20 @@ namespace Model partial void OnUserDepStartDateChanged(); partial void OnUserDepEndDateChanging(System.Nullable value); partial void OnUserDepEndDateChanged(); - partial void OnSSRAdminIdChanging(string value); - partial void OnSSRAdminIdChanged(); + partial void OnPauseChanging(System.Nullable value); + partial void OnPauseChanged(); + partial void OnPauseDateChanging(System.Nullable value); + partial void OnPauseDateChanged(); + partial void OnModifyContentChanging(string value); + partial void OnModifyContentChanged(); + partial void OnModifyerChanging(string value); + partial void OnModifyerChanged(); + partial void OnModifyDateChanging(System.Nullable value); + partial void OnModifyDateChanged(); + partial void OnIsUserEvaluatedTimeChanging(System.Nullable value); + partial void OnIsUserEvaluatedTimeChanged(); + partial void OnIsDepEvaluatedTimeChanging(System.Nullable value); + partial void OnIsDepEvaluatedTimeChanged(); #endregion public EMC_Punishment() @@ -11094,6 +11146,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SSRAdminId", DbType="NVarChar(50)")] + public string SSRAdminId + { + get + { + return this._SSRAdminId; + } + set + { + if ((this._SSRAdminId != value)) + { + this.OnSSRAdminIdChanging(value); + this.SendPropertyChanging(); + this._SSRAdminId = value; + this.SendPropertyChanged("SSRAdminId"); + this.OnSSRAdminIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SSRStaratDate", DbType="DateTime")] public System.Nullable SSRStaratDate { @@ -11214,22 +11286,142 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SSRAdminId", DbType="NVarChar(50)")] - public string SSRAdminId + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Pause", DbType="Bit")] + public System.Nullable Pause { get { - return this._SSRAdminId; + return this._Pause; } set { - if ((this._SSRAdminId != value)) + if ((this._Pause != value)) { - this.OnSSRAdminIdChanging(value); + this.OnPauseChanging(value); this.SendPropertyChanging(); - this._SSRAdminId = value; - this.SendPropertyChanged("SSRAdminId"); - this.OnSSRAdminIdChanged(); + this._Pause = value; + this.SendPropertyChanged("Pause"); + this.OnPauseChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PauseDate", DbType="DateTime")] + public System.Nullable PauseDate + { + get + { + return this._PauseDate; + } + set + { + if ((this._PauseDate != value)) + { + this.OnPauseDateChanging(value); + this.SendPropertyChanging(); + this._PauseDate = value; + this.SendPropertyChanged("PauseDate"); + this.OnPauseDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ModifyContent", DbType="NVarChar(2000)")] + public string ModifyContent + { + get + { + return this._ModifyContent; + } + set + { + if ((this._ModifyContent != value)) + { + this.OnModifyContentChanging(value); + this.SendPropertyChanging(); + this._ModifyContent = value; + this.SendPropertyChanged("ModifyContent"); + this.OnModifyContentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Modifyer", DbType="NVarChar(50)")] + public string Modifyer + { + get + { + return this._Modifyer; + } + set + { + if ((this._Modifyer != value)) + { + this.OnModifyerChanging(value); + this.SendPropertyChanging(); + this._Modifyer = value; + this.SendPropertyChanged("Modifyer"); + this.OnModifyerChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ModifyDate", DbType="DateTime")] + public System.Nullable ModifyDate + { + get + { + return this._ModifyDate; + } + set + { + if ((this._ModifyDate != value)) + { + this.OnModifyDateChanging(value); + this.SendPropertyChanging(); + this._ModifyDate = value; + this.SendPropertyChanged("ModifyDate"); + this.OnModifyDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUserEvaluatedTime", DbType="DateTime")] + public System.Nullable IsUserEvaluatedTime + { + get + { + return this._IsUserEvaluatedTime; + } + set + { + if ((this._IsUserEvaluatedTime != value)) + { + this.OnIsUserEvaluatedTimeChanging(value); + this.SendPropertyChanging(); + this._IsUserEvaluatedTime = value; + this.SendPropertyChanged("IsUserEvaluatedTime"); + this.OnIsUserEvaluatedTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsDepEvaluatedTime", DbType="DateTime")] + public System.Nullable IsDepEvaluatedTime + { + get + { + return this._IsDepEvaluatedTime; + } + set + { + if ((this._IsDepEvaluatedTime != value)) + { + this.OnIsDepEvaluatedTimeChanging(value); + this.SendPropertyChanging(); + this._IsDepEvaluatedTime = value; + this.SendPropertyChanged("IsDepEvaluatedTime"); + this.OnIsDepEvaluatedTimeChanged(); } } } @@ -33778,6 +33970,8 @@ namespace Model private string _FileType; + private System.Nullable _UploadDate; + public View_FC_ContractManagement() { } @@ -34037,6 +34231,22 @@ namespace Model } } } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UploadDate", DbType="DateTime")] + public System.Nullable UploadDate + { + get + { + return this._UploadDate; + } + set + { + if ((this._UploadDate != value)) + { + this._UploadDate = value; + } + } + } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_FC_ContractManagementLists")] @@ -38579,7 +38789,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserName", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserName", DbType="NVarChar(60)")] public string UserName { get