This commit is contained in:
jackchenyang 2024-06-11 18:02:31 +08:00
parent d76cdd2cf8
commit c7a0e91986
5 changed files with 225 additions and 192 deletions

View File

@ -250,7 +250,7 @@
</site> </site>
<site name="FineUIPro.Web(10)" id="13"> <site name="FineUIPro.Web(10)" id="13">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="E:\MyProject\ZJ_BSF\Basf_TCC7\HJGL\FineUIPro.Web" /> <virtualDirectory path="/" physicalPath="E:\湛江巴斯夫\Basf_TCC7\HJGL\FineUIPro.Web" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:13960:localhost" /> <binding protocol="http" bindingInformation="*:13960:localhost" />

Binary file not shown.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectView>ProjectFiles</ProjectView> <ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -21,7 +21,7 @@
<Items> <Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,JointComprehensive %>" <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,JointComprehensive %>"
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true" EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true"
AllowSorting="true" SortField="PipelineCode,WeldJointCode" OnSort="Grid1_Sort" AllowSorting="true" DataKeyNames="WeldJointId" SortField="PipelineCode,WeldJointCode" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" EnableCheckBoxSelect="true" EnableSummary="true" SummaryPosition="Flow"> EnableTextSelection="True" EnableCheckBoxSelect="true" EnableSummary="true" SummaryPosition="Flow">
<Toolbars> <Toolbars>

View File

@ -250,13 +250,35 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
} }
} }
//获取焊口ID集合 //批量审核
protected void btnAuditAll_Click(object sender,EventArgs e)
{
var data = this.GetDataTable();
if (string.IsNullOrEmpty(txtStarTime.Text) && string.IsNullOrEmpty(txtEndTime.Text))
{
ShowNotify("请按照日期选择要审核的日报!",MessageBoxIcon.Warning);
return;
}
List<string> ids = new List<string>();
foreach (DataRow dr in data.Rows)
{
ids.Add(dr["WeldJointId"].ToString());
}
ModifyAuditStatus(ids, 1);
this.BindGrid();
ShowNotify("批量审核成功!", MessageBoxIcon.Success);
}
//审核 //审核
protected void btnAudit_Click(object sender,EventArgs e) protected void btnAudit_Click(object sender,EventArgs e)
{ {
ModifyAuditStatus(1); var listIds = GetWeldJointIdList();
if (listIds.Count == 0)
{
ShowNotify("请选择要审核的焊接日报数据", MessageBoxIcon.Warning);
return;
}
ModifyAuditStatus(listIds,1);
this.BindGrid(); this.BindGrid();
ShowNotify("批量审核成功!", MessageBoxIcon.Success); ShowNotify("批量审核成功!", MessageBoxIcon.Success);
@ -264,7 +286,13 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
//取消审核 //取消审核
protected void btnCancel_Click(object sender, EventArgs e) protected void btnCancel_Click(object sender, EventArgs e)
{ {
ModifyAuditStatus(0); var listIds = GetWeldJointIdList();
if (listIds.Count == 0)
{
ShowNotify("请选择要取消审核的焊接日报数据", MessageBoxIcon.Warning);
return;
}
ModifyAuditStatus(listIds,0);
this.BindGrid(); this.BindGrid();
ShowNotify("批量取消审核成功!", MessageBoxIcon.Success); ShowNotify("批量取消审核成功!", MessageBoxIcon.Success);
} }
@ -289,6 +317,8 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
} }
string ReportFileName = filePath + $"焊接日报_{DateTime.Now.ToString("yyyyMMddhhmmss")}.xlsx"; string ReportFileName = filePath + $"焊接日报_{DateTime.Now.ToString("yyyyMMddhhmmss")}.xlsx";
try
{
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read); FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
XSSFWorkbook hssfworkbook = new XSSFWorkbook(file); XSSFWorkbook hssfworkbook = new XSSFWorkbook(file);
@ -470,6 +500,12 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
this.GetEmailTemplateAndSendEmail(ReportFileName); this.GetEmailTemplateAndSendEmail(ReportFileName);
File.Delete(ReportFileName); File.Delete(ReportFileName);
ShowNotify("焊接日报发送成功!", MessageBoxIcon.Success);
}
catch (Exception ex)
{
ShowNotify($"发送失败,原因:{ex.Message}", MessageBoxIcon.Error);
}
} }
protected void Window1_Close(object sender, EventArgs e) protected void Window1_Close(object sender, EventArgs e)
{ {
@ -871,19 +907,16 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
private List<string> GetWeldJointIdList() private List<string> GetWeldJointIdList()
{ {
List<string> listIds = new List<string>(); List<string> listIds = new List<string>();
for (int i = 0; i < Grid1.Rows.Count; i++) int[] selections = Grid1.SelectedRowIndexArray;
foreach (int rowIndex in selections)
{ {
AspNet.HiddenField WeldJointIdVal = Grid1.Rows[i].FindControl("hidId") as AspNet.HiddenField; string rowId = Grid1.DataKeys[rowIndex][0].ToString();
if (WeldJointIdVal != null) listIds.Add(rowId);
{
listIds.Add(WeldJointIdVal.Value);
}
} }
return listIds; return listIds;
} }
private void ModifyAuditStatus(int auditStatus) private void ModifyAuditStatus(List<string> listIds, int auditStatus)
{ {
var listIds = GetWeldJointIdList();
var result = Funs.DB.Pipeline_WeldJoint.Where(t => listIds.Contains(t.WeldJointId)).ToList(); var result = Funs.DB.Pipeline_WeldJoint.Where(t => listIds.Contains(t.WeldJointId)).ToList();
foreach (var item in result) foreach (var item in result)
{ {