20250812 修改质量事项报告

This commit is contained in:
毕文静 2025-08-12 17:05:47 +08:00
parent 50ddcb8dcf
commit 61ca5d213c
8 changed files with 941 additions and 161 deletions

View File

@ -57,6 +57,11 @@ namespace BLL
/// </summary>
public static string Role_CommonUsers = "bdb8c4fe-5082-4ce0-af5e-70f39f50ea41";
/// <summary>
/// 承包商管理角色ID
/// </summary>
public static string Role_Contractor_LeaderId = "48b2376d-421f-4b12-b5be-c0c538bfe3e9";
/// <summary>
/// 邮件配置Id
/// </summary>
@ -263,6 +268,11 @@ namespace BLL
public const string BtnConTab13View = "承包商View";
#endregion
/// <summary>
/// 质量事件报告修改全部
/// </summary>
public const string BtnModifyAll = "Modify All";
#endregion
#region

View File

@ -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();
}

View File

@ -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<SqlParameter> listStr = new List<SqlParameter>();
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
/// <summary>
/// 审批人
/// </summary>
@ -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
/// <summary>
/// 当期状态
/// </summary>
@ -697,13 +732,23 @@ namespace FineUIPro.Web.ContractorQuality
}
else
{
s = "进行中";
if (pun.Pause == true)
{
s = "已暂停";
}
else
{
s = "进行中";
}
}
}
}
return s;
}
#endregion
#endregion
#region
/// <summary>
/// 筛选
/// </summary>
@ -713,5 +758,6 @@ namespace FineUIPro.Web.ContractorQuality
{
BindGrid();
}
#endregion
}
}

View File

@ -177,8 +177,8 @@
</f:Label>
<f:Button ID="btnAttach2" Icon="TableCell" EnablePostBack="true" Text="上传" runat="server" OnClick="btnAttach2_Click">
</f:Button>
<f:Label ID="Label6" runat="server" Text="最大不超过20M" CssClass="customlabel"></f:Label>
<f:LinkButton ID="lbtnViewAttach2" runat="server" Text="查看" OnClick="lbtnViewAttach2_Click"></f:LinkButton>
<f:Label ID="Label6" runat="server" Text="最大不超过20M" CssClass="customlabel"></f:Label>
<f:LinkButton ID="lbtnViewAttach2" runat="server" Text="查看" OnClick="lbtnViewAttach2_Click"></f:LinkButton>
</Items>
</f:Panel>
</Items>
@ -246,7 +246,8 @@
<f:Form ShowBorder="false" ShowHeader="false" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items><f:DropDownList ID="drpBuyer2" runat="server" Label="采购员" LabelAlign="Right" LabelWidth="150px" EnableEdit="true"></f:DropDownList>
<Items>
<f:DropDownList ID="drpBuyer2" runat="server" Label="采购员" LabelAlign="Right" LabelWidth="150px" EnableEdit="true"></f:DropDownList>
<f:DropDownList ID="drpViolationClause2" runat="server" Label="违章条款" EnableEdit="true" LabelAlign="Right" LabelWidth="150px" EnableGroup="true"
AutoPostBack="true" OnSelectedIndexChanged="drpViolationClause2_OnSelectedIndexChanged" ShowRedStar="true" Required="true">
</f:DropDownList>
@ -273,7 +274,7 @@
</f:Label>
<f:Button ID="btnAttach3" Icon="TableCell" EnablePostBack="true" Text="上传" runat="server" OnClick="btnAttach2_Click">
</f:Button>
<f:Label ID="Label8" runat="server" Text="最大不超过20M" CssClass="customlabel"></f:Label>
<f:Label ID="Label8" runat="server" Text="最大不超过20M" CssClass="customlabel"></f:Label>
<f:LinkButton ID="lbtnAttach3" runat="server" Text="查看" OnClick="lbtnViewAttach2_Click"></f:LinkButton>
</Items>
</f:Panel>
@ -313,10 +314,41 @@
</f:GroupPanel>
</Items>
</f:FormRow>
<f:FormRow ID="frModifyDef" runat="server" Hidden="true">
<Items>
<f:TextArea ID="txtModifyDef" runat="server" Label="修改内容说明" LabelAlign="Right" LabelWidth="140px"></f:TextArea>
</Items>
</f:FormRow>
<f:FormRow ID="frModifyDefUrl" runat="server" Hidden="true">
<Items>
<f:Panel ID="Panel4" Width="500px" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server" BodyPadding="10px" >
<Items>
<f:Label ID="Label13" runat="server" Label="修改内容说明" LabelAlign="Right" LabelWidth="140px">
</f:Label>
<f:Button ID="btnModifyAttach" Icon="TableCell" EnablePostBack="true" Text="上传" runat="server" OnClick="btnModifyAttach_Click">
</f:Button>
<f:Label ID="Label14" runat="server" Text="最大不超过20M" CssClass="customlabel"></f:Label>
<f:LinkButton ID="lbtnModifyAttach" runat="server" Text="查看" OnClick="lbtnModifyAttach_Click"></f:LinkButton>
</Items>
</f:Panel>
</Items>
</f:FormRow>
<f:FormRow ID="frPassResult" runat="server" Hidden="true">
<Items>
<f:RadioButtonList ID="rblPass" runat="server" Label="最终审核结果" LabelAlign="Right" LabelWidth="140px">
<f:RadioItem Value="True" Text="通过" />
<f:RadioItem Value="False" Text="不通过" />
</f:RadioButtonList>
<f:Label ID="Label15" runat="server"></f:Label>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdModifyContent" runat="server"></f:HiddenField>
<f:HiddenField ID="hdId" runat="server"></f:HiddenField>
<f:Button ID="btnReturn" Icon="ArrowRedo" runat="server" Text="退回到上一流程" ToolTip="退回到上一流程" OnClick="btnReturn_Click" Hidden="true">
</f:Button>
@ -331,6 +363,8 @@
<f:Button ID="btnSbumit" Icon="DatabaseSave" runat="server" Text="提交" ToolTip="提交" ValidateForms="SimpleForm1"
OnClick="btnSbumit_Click" Hidden="true">
</f:Button>
<f:Button ID="btnPause" Icon="ControlPauseBlue" runat="server" Text="暂停" ToolTip="暂停" Hidden="true" OnClick="btnPause_Click"></f:Button>
<f:Button ID="btnSureModify" Icon="DatabaseSave" runat="server" Text="确认修改" ToolTip="确认修改" Hidden="true" OnClick="btnSureModify_Click"></f:Button>
</Items>
</f:Toolbar>
</Toolbars>

View File

@ -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
/// <summary>
/// 申报人填写不可编辑
/// </summary>
@ -551,6 +586,7 @@ namespace FineUIPro.Web.ContractorQuality
Label10.Enabled = false;
}
#endregion
#endregion
#region
/// <summary>
@ -577,6 +613,7 @@ namespace FineUIPro.Web.ContractorQuality
{
if (!string.IsNullOrEmpty(this.PunishmentId))
{
List<string> emialLists = new List<string>(); //承包商联系人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,194 @@ 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 == "True")
{
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 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//最终审核未通过通知
{
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);
}
}
}
}
}
#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 +1879,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)));
}
/// <summary>
/// 质量调查相关附件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttach2_Click(object sender, EventArgs e)
/// <summary>
/// 质量调查相关附件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttach2_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
{
@ -1722,6 +1902,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
/// <summary>
/// 上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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)));
}
}
/// <summary>
/// 查看
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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 +1976,155 @@ namespace FineUIPro.Web.ContractorQuality
{
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
#region
/// <summary>
/// 承包商联系人有异议线下通知主协调员,主协调员可暂停重新评估
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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);
}
}
#endregion
#region
/// <summary>
/// 确认修改
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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
}
}

View File

@ -761,6 +761,105 @@ namespace FineUIPro.Web.ContractorQuality
/// </remarks>
protected global::FineUIPro.TextBox txtBuyerReson;
/// <summary>
/// frModifyDef 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow frModifyDef;
/// <summary>
/// txtModifyDef 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtModifyDef;
/// <summary>
/// frModifyDefUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow frModifyDefUrl;
/// <summary>
/// Panel4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel4;
/// <summary>
/// Label13 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label13;
/// <summary>
/// btnModifyAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnModifyAttach;
/// <summary>
/// Label14 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label14;
/// <summary>
/// lbtnModifyAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.LinkButton lbtnModifyAttach;
/// <summary>
/// frPassResult 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow frPassResult;
/// <summary>
/// rblPass 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rblPass;
/// <summary>
/// Label15 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label15;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@ -770,6 +869,15 @@ namespace FineUIPro.Web.ContractorQuality
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdModifyContent 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdModifyContent;
/// <summary>
/// hdId 控件。
/// </summary>
@ -824,6 +932,24 @@ namespace FineUIPro.Web.ContractorQuality
/// </remarks>
protected global::FineUIPro.Button btnSbumit;
/// <summary>
/// btnPause 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPause;
/// <summary>
/// btnSureModify 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSureModify;
/// <summary>
/// Window1 控件。
/// </summary>

View File

@ -48,15 +48,14 @@
//每月25810邮件自动发送给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);
//60分钟执行一次
aTimer.Interval = 1000 * 60 * 60;
//30分钟执行一次
aTimer.Interval = 1000 * 60 * 30;
aTimer.Enabled = true;
aTimer.Start();
}
//自动填写评价
if (DateTime.Now.Day == 12)
@ -64,7 +63,7 @@
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();
@ -199,6 +198,17 @@
fcTimer.Enabled = true;
fcTimer.Start();
}
//承包商报告主协调员提交后通知承包商联系人若无异议或3天未操作发送邮件给用户部门经理
if (DateTime.Now.Hour == 9)
{
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)
@ -242,7 +252,7 @@
userName = contractAdmin.First().UserName;
departId = contractAdmin.First().DepartId;
}
var depart = BLL.DepartService.GetDepartById(departId);
if (depart != null)
{
@ -321,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();
@ -436,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();
@ -482,7 +492,7 @@
}
string[] mailTo = null;
string mailBody = string.Empty;
string mailSubject = string.Empty;
string mailPriority = string.Empty;
string[] mailCC = null;
@ -718,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)
{
@ -812,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)
{
@ -841,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();
@ -850,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)
@ -901,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))
@ -917,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)
@ -929,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 != ""
@ -987,6 +997,7 @@
}
#endregion
#region 25810SSR提交人员和主协调人及合同员
/// <summary>
/// 每月25810邮件自动发送给SSR提交人员和主协调人及合同员用户代表等评价
/// </summary>
@ -1094,7 +1105,7 @@
{
mailCC = mailCCLs.Where(p => !string.IsNullOrEmpty(p)).ToArray();
}
}
// 总监
@ -1102,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<string>();
// 部门经理
@ -1168,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<string>();
// 部门经理
@ -1193,6 +1204,7 @@
}
}
}
#endregion
#region
/// <summary>
@ -1436,7 +1448,7 @@
catch (Exception ex)
{
ErrLogInfo.WriteLog($"执行当前sql:{strSql}错误:{ex.Message},当前ID={d.ID},当前status={status}");
//记录日志到数据中。
//记录日志到数据中。
}
}
}
@ -1738,6 +1750,85 @@
}
#endregion
# region 3
/// <summary>
/// 承包商报告主协调员提交后通知承包商联系人若无异议或3天未操作发送邮件给用户部门经理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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)
{
//新增用户部门操作流程
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<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 mailSubject = string.Empty;
string mailBody = string.Empty;
string mailPriority = string.Empty;
string[] mailCC = null;
string resultMessage = "";
string departLeader = 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;
}
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)
{
//调用接口

View File

@ -9930,6 +9930,16 @@ namespace Model
private System.Nullable<System.DateTime> _UserDepEndDate;
private System.Nullable<bool> _Pause;
private System.Nullable<System.DateTime> _PauseDate;
private string _ModifyContent;
private string _Modifyer;
private System.Nullable<System.DateTime> _ModifyDate;
private EntityRef<Base_Depart> _Base_Depart;
private EntityRef<Sys_User> _Sys_User;
@ -10056,6 +10066,16 @@ namespace Model
partial void OnUserDepStartDateChanged();
partial void OnUserDepEndDateChanging(System.Nullable<System.DateTime> value);
partial void OnUserDepEndDateChanged();
partial void OnPauseChanging(System.Nullable<bool> value);
partial void OnPauseChanged();
partial void OnPauseDateChanging(System.Nullable<System.DateTime> 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<System.DateTime> value);
partial void OnModifyDateChanged();
#endregion
public EMC_Punishment()
@ -11234,6 +11254,106 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Pause", DbType="Bit")]
public System.Nullable<bool> Pause
{
get
{
return this._Pause;
}
set
{
if ((this._Pause != value))
{
this.OnPauseChanging(value);
this.SendPropertyChanging();
this._Pause = value;
this.SendPropertyChanged("Pause");
this.OnPauseChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PauseDate", DbType="DateTime")]
public System.Nullable<System.DateTime> 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<System.DateTime> 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.AssociationAttribute(Name="FK_EMC_Punishment_Base_Depart", Storage="_Base_Depart", ThisKey="BYC_RU", OtherKey="DepartId", IsForeignKey=true)]
public Base_Depart Base_Depart
{
@ -38597,7 +38717,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