This commit is contained in:
汪青 2024-06-11 22:37:50 +08:00
commit 2e11514758
46 changed files with 2507 additions and 308 deletions

14
.gitignore vendored
View File

@ -5737,3 +5737,17 @@ HJGLPackFile/版本日志/HJGLDB_2024.05.02.sql
/HJGL/WebApi/ErrLog.txt
/HJGL/Model/Model.cs
/CreateModel.bat
/DataBase/版本日志
/DataBase/hjglDB_7_2024.05.31(本机).bak
/DataBase/hjglDB_7_2024.05.31-1.rar
*.bak
/DataBase/hjglDB_7_2024.05.30.rar
/DataBase/hjglDB_7_2024.05.28.rar
/DataBase/hjglDB_7_2024.05.28.bak
/DataBase/hjglDB_7_2024.05.26-01.rar
/HJGLPackFile/版本日志
/DataBase/hjglDB_7_2024.05.26-01.rar
/DataBase/hjglDB_7_2024.05.26-01.rar
/DataBase/hjglDB_7_2024.05.28.rar
/DataBase/hjglDB_7_2024.05.28.bak
/DataBase/hjglDB_7_2024.05.26-01.rar

View File

@ -25,9 +25,9 @@ REM --------------
@echo 设置.net控制台环境
@echo.
@call "%VS150%"
@call "%VS100COMNTOOLS%"vsvars32.bat
SqlMetal /views /server:. /database:HJGLDB_ZJBSF /code:%Model_ROOT%\Model.cs /namespace:Model
SqlMetal /views /server:.\SQL2016 /database:HJGLDB_ZJBSF /code:%Model_ROOT%\Model.cs /namespace:Model
@ECHO 完成
pause

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -162,7 +162,7 @@
</site>
<site name="WebApi" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="E:\湛江巴斯夫\Basf_TCC7\HJGL\WebApi" />
<virtualDirectory path="/" physicalPath="E:\MyProject\ZJ_BSF\Basf_TCC7\HJGL\WebApi" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:3862:localhost" />

Binary file not shown.

View File

@ -179,6 +179,7 @@
<Compile Include="WeldingProcess\TrustManage\Batch_PointBatchItemService.cs" />
<Compile Include="WeldingProcess\TrustManage\Batch_PointBatchService.cs" />
<Compile Include="WeldingProcess\WelderTest\WelderTestService.cs" />
<Compile Include="WeldingProcess\WeldingManage\DailyReportCompleteService.cs" />
<Compile Include="WeldingProcess\WeldingManage\Pipeline_PipelineDetectionTypeService.cs" />
<Compile Include="WeldingProcess\WeldingManage\Pipeline_PipelineService.cs" />
<Compile Include="WeldingProcess\WeldingManage\Pipeline_WeldingDailyService.cs" />

View File

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

View File

@ -332,8 +332,12 @@ namespace BLL
/// </summary>
public const string WelderManageMenuId = "1908E4C9-4A63-4A6C-6666-DA4910C2A8C7";
/// <summary>
/// 焊工资质
/// </summary>
public const string Welder_QualifiedProjectMenuId = "2F21257A-8CC4-4712-A954-A7F690CC68C5";
public const string WelderTestInfoMenuId = "BB114B9B-E10D-4C96-AD12-C36CAA08E4D2";
/// <summary>
/// 单位信息
/// </summary>
@ -534,12 +538,29 @@ namespace BLL
/// </summary>
public const string HJGL_PreWeldReportMenuId = "8D92CA4E-F267-4175-9152-56F095668FC9";
/// <summary>
/// 日报完成情况
/// </summary>
public const string DailyReportCompleteMenuId = "948B01F1-27B4-49DF-9315-C42BB7BBE7AF";
#endregion
#region PMI
/// <summary>
/// PMI委托
/// </summary>
public const string PMIDelegationMenuId = "49DFB8F3-B370-4028-9748-864A420347E1";
public const string PMIDelegationId = "A6FB44C3-0920-4F77-862F-D814FD5E5D23";
/// <summary>
/// PMI检测录入
/// </summary>
public const string PMIDetectionEntryMenuId = "DB9BE665-0F6A-46E0-8FFF-3D95ADD76B9E";
/// <summary>
/// PMI检测报告
/// </summary>
public const string PMIDetectionReportMenuId = "6250390B-2F37-4E8A-8724-5FCE877F60DA";
#endregion

View File

@ -1,9 +1,13 @@
using BLL;
using Model;
using Org.BouncyCastle.Bcpg.OpenPgp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Web;
using System.Web.Mail;
namespace FineUIPro.Web.common
{
public class MailHelper
@ -123,6 +127,15 @@ namespace FineUIPro.Web.common
if(mailCC!=null &&mailCC.Length>0)
mail.Cc = string.Join(",", mailCC);
if (!string.IsNullOrEmpty(mailAttch))
{
string[] arr = mailAttch.Split(',');
for (int i = 0; i < arr.Length; i++)
{
mail.Attachments.Add(new System.Web.Mail.MailAttachment(@arr[i]));
}
}
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", ps.EmailYx);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", ps.EmailPass);

View File

@ -84,24 +84,6 @@ namespace BLL
return (from x in Funs.DB.Welder_TeamGroup orderby x.TeamGroupCode select x).ToList();
}
/// <summary>
/// 班组下拉选择项
/// </summary>
/// <param name="dropName"></param>
/// <param name="isShowPlease"></param>
/// <param name="itemText"></param>
public static void InitTeamGroupDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease,string itemText)
{
dropName.DataValueField = "TeamGroupId";
dropName.DataTextField = "TeamGroupName";
dropName.DataSource = GetTeamGroupList();
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName,itemText);
}
}
/// <summary>
/// 获取班组下拉选择项
/// </summary>

View File

@ -0,0 +1,94 @@
using Model;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public partial class DailyReportCompleteService
{
/// <summary>
/// 获取日报完成信息
/// </summary>
/// <param name="completeId">Id</param>
/// <returns></returns>
public static Model.Pipeline_DailyReportComplete GetDailyReportComplete(string completeId)
{
return Funs.DB.Pipeline_DailyReportComplete.FirstOrDefault(x => x.DailyReportCompleteId == completeId);
}
/// <summary>
/// 增加日报完成信息
/// </summary>
/// <param name="complete"></param>
public static void AddDailyReportComplete(Model.Pipeline_DailyReportComplete complete)
{
Model.HJGLDB db = Funs.DB;
Model.Pipeline_DailyReportComplete newR = new Model.Pipeline_DailyReportComplete();
newR.DailyReportCompleteId = complete.DailyReportCompleteId;
newR.ProjectId =complete.ProjectId;
newR.UnitId = complete.UnitId;
newR.ReportMan = complete.ReportMan;
newR.TeamGroupId =complete.TeamGroupId;
newR.DailyReportDate = complete.DailyReportDate;
newR.IsComplete = complete.IsComplete;
db.Pipeline_DailyReportComplete.InsertOnSubmit(newR);
db.SubmitChanges();
}
/// <summary>
/// 修改日报完成信息
/// </summary>
/// <param name="complete"></param>
public static void UpdateDailyReportComplete(Model.Pipeline_DailyReportComplete complete)
{
Model.HJGLDB db = Funs.DB;
Model.Pipeline_DailyReportComplete newR = db.Pipeline_DailyReportComplete.First(e => e.DailyReportCompleteId == complete.DailyReportCompleteId);
newR.ProjectId = complete.ProjectId;
newR.UnitId = complete.UnitId;
newR.ReportMan = complete.ReportMan;
newR.TeamGroupId = complete.TeamGroupId;
newR.DailyReportDate = complete.DailyReportDate;
newR.IsComplete = complete.IsComplete;
db.SubmitChanges();
}
/// <summary>
/// 删除日报完成信息
/// </summary>
/// <param name="completeId"></param>
public static void DeleteDailyReportComplete(string completeId)
{
Model.HJGLDB db = Funs.DB;
Model.Pipeline_DailyReportComplete delR = db.Pipeline_DailyReportComplete.First(e => e.DailyReportCompleteId == completeId);
db.Pipeline_DailyReportComplete.DeleteOnSubmit(delR);
db.SubmitChanges();
}
/// <summary>
/// 是否存在日报完成信息
/// </summary>
/// <param name="projectId"></param>
/// <param name="completeId"></param>
/// <param name="teamGroup"></param>
/// <param name="reportDate"></param>
/// <returns>是否存在</returns>
public static bool IsExistDailyReportComplete(string projectId , string completeId, string teamGroup, DateTime reportDate)
{
bool isExist = false;
var role = Funs.DB.Pipeline_DailyReportComplete.FirstOrDefault(x => x.ProjectId == projectId && x.TeamGroupId==teamGroup && x.DailyReportDate== reportDate && x.DailyReportCompleteId != completeId);
if (role != null)
{
isExist = true;
}
return isExist;
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -1262,6 +1262,8 @@
<Content Include="WeldingProcess\TrustManage\TrustBatchManage.aspx" />
<Content Include="WeldingProcess\TrustManage\TrustBatchOut.aspx" />
<Content Include="WeldingProcess\TrustManage\TrustBatchSelect.aspx" />
<Content Include="WeldingProcess\WeldingManage\DailyReportComplete.aspx" />
<Content Include="WeldingProcess\WeldingManage\DailyReportCompleteEdit.aspx" />
<Content Include="WeldingProcess\WeldingManage\JointInfo.aspx" />
<Content Include="WeldingProcess\WeldingManage\JointInfoBatchEdit.aspx" />
<Content Include="WeldingProcess\WeldingManage\JointInfoCopy.aspx" />
@ -1272,6 +1274,7 @@
<Content Include="WeldingProcess\WeldingManage\PipelineManageEdit.aspx" />
<Content Include="WeldingProcess\WeldingManage\PipelineShowColumn.aspx" />
<Content Include="WeldingProcess\WeldingManage\PreWeldReportAudit.aspx" />
<Content Include="WeldingProcess\WeldingManage\SuperQueWelding.aspx" />
<Content Include="WeldingProcess\WeldingManage\WeldReport.aspx" />
<Content Include="WeldingProcess\WeldingManage\WeldReportEdit.aspx" />
<Content Include="WeldingProcess\WeldingManage\WeldReportItemEdit.aspx" />
@ -5615,6 +5618,20 @@
<Compile Include="WeldingProcess\TrustManage\TrustBatchSelect.aspx.designer.cs">
<DependentUpon>TrustBatchSelect.aspx</DependentUpon>
</Compile>
<Compile Include="WeldingProcess\WeldingManage\DailyReportComplete.aspx.cs">
<DependentUpon>DailyReportComplete.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WeldingProcess\WeldingManage\DailyReportComplete.aspx.designer.cs">
<DependentUpon>DailyReportComplete.aspx</DependentUpon>
</Compile>
<Compile Include="WeldingProcess\WeldingManage\DailyReportCompleteEdit.aspx.cs">
<DependentUpon>DailyReportCompleteEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WeldingProcess\WeldingManage\DailyReportCompleteEdit.aspx.designer.cs">
<DependentUpon>DailyReportCompleteEdit.aspx</DependentUpon>
</Compile>
<Compile Include="WeldingProcess\WeldingManage\GetWdldingDailyItem.ashx.cs">
<DependentUpon>GetWdldingDailyItem.ashx</DependentUpon>
</Compile>
@ -5688,6 +5705,13 @@
<Compile Include="WeldingProcess\WeldingManage\PreWeldReportAudit.aspx.designer.cs">
<DependentUpon>PreWeldReportAudit.aspx</DependentUpon>
</Compile>
<Compile Include="WeldingProcess\WeldingManage\SuperQueWelding.aspx.cs">
<DependentUpon>SuperQueWelding.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WeldingProcess\WeldingManage\SuperQueWelding.aspx.designer.cs">
<DependentUpon>SuperQueWelding.aspx</DependentUpon>
</Compile>
<Compile Include="WeldingProcess\WeldingManage\WeldReport.aspx.cs">
<DependentUpon>WeldReport.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5903,7 +5927,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BLL\BLL.csproj">
<Project>{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}</Project>
<Project>{bbc7282a-9e2b-4bd6-9c6d-333cefc6f332}</Project>
<Name>BLL</Name>
</ProjectReference>
<ProjectReference Include="..\Model\Model.csproj">

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
<ProjectView>ShowAllFiles</ProjectView>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />

View File

@ -9,7 +9,7 @@
<section name="FineUIPro" type="FineUIPro.ConfigSection, FineUIPro" requirePermission="false"/>
</configSections>
<connectionStrings>
<add name="HJGLDBConnectionString" connectionString="Data Source=.;Initial Catalog=HJGLDB_ZJBSF;uid=sa;pwd=Sh@nghai9;"/>
<add name="HJGLDBConnectionString" connectionString="Data Source=.\sql2016;Initial Catalog=HJGLDB_ZJBSF;uid=sa;pwd=1111;"/>
<!--<add name="HJGLDBConnectionString" connectionString="Data Source=.;Initial Catalog=HJGLDB;Integrated Security=True"
providerName="System.Data.SqlClient" />-->
</connectionStrings>

View File

@ -187,7 +187,7 @@ namespace FineUIPro.Web.WelderManage
#region
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.Welder_QualifiedProjectMenuId, BLL.Const.BtnModify))
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.WelderTestInfoMenuId, BLL.Const.BtnModify))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
@ -210,7 +210,7 @@ namespace FineUIPro.Web.WelderManage
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.Welder_QualifiedProjectMenuId, Const.BtnDelete))
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.WelderTestInfoMenuId, Const.BtnDelete))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
@ -319,100 +319,107 @@ namespace FineUIPro.Web.WelderManage
protected void btnImport_Click(object sender, EventArgs e)
{
string message = string.Empty;
errorInfos = string.Empty;
try
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.WelderTestInfoMenuId, Const.BtnIn))
{
if (this.fileUpload.HasFile == false)
string message = string.Empty;
errorInfos = string.Empty;
try
{
ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning);
return;
}
string IsXls = Path.GetExtension(this.fileUpload.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls" && IsXls != ".xlsx")
{
ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning);
return;
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
if (!Directory.Exists(initFullPath))
{
Directory.CreateDirectory(initFullPath);
}
//指定上传文件名称
this.hidFileName.Text = BLL.Funs.GetNewFileName() + IsXls;
//上传文件路径
string filePath = initFullPath + this.hidFileName.Text;
//文件上传服务器
this.fileUpload.PostedFile.SaveAs(filePath);
//文件上传服务器后的名称
string fileName = rootPath + initPath + this.hidFileName.Text;
//读取Excel
DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out errorInfos, true);
//验证Excel读取是否有误
if (!string.IsNullOrEmpty(errorInfos))
{
ShowNotify(errorInfos, MessageBoxIcon.Warning);
return;
}
DataTable dt = ds.Tables[0];
if (dt.Rows.Count > 0)
{
List<Model.Welder_TestInfo> listData = new List<Model.Welder_TestInfo>();
var validate = ValidateImportFileds(dt);
if(validate!=null && validate.Count > 0)
if (this.fileUpload.HasFile == false)
{
Cache["errLog"] = validate;
//提示错误信息
PageContext.RegisterStartupScript(Window2.GetShowReference("WelderTestInfoImportError.aspx"));
ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning);
return;
}
string IsXls = Path.GetExtension(this.fileUpload.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls" && IsXls != ".xlsx")
{
ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning);
return;
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
if (!Directory.Exists(initFullPath))
{
Directory.CreateDirectory(initFullPath);
}
//指定上传文件名称
this.hidFileName.Text = BLL.Funs.GetNewFileName() + IsXls;
//上传文件路径
string filePath = initFullPath + this.hidFileName.Text;
//文件上传服务器
this.fileUpload.PostedFile.SaveAs(filePath);
//文件上传服务器后的名称
string fileName = rootPath + initPath + this.hidFileName.Text;
//读取Excel
DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out errorInfos, true);
//验证Excel读取是否有误
if (!string.IsNullOrEmpty(errorInfos))
{
ShowNotify(errorInfos, MessageBoxIcon.Warning);
return;
}
DataTable dt = ds.Tables[0];
if (dt.Rows.Count > 0)
{
List<Model.Welder_TestInfo> listData = new List<Model.Welder_TestInfo>();
var validate = ValidateImportFileds(dt);
if (validate != null && validate.Count > 0)
{
Cache["errLog"] = validate;
//提示错误信息
PageContext.RegisterStartupScript(Window2.GetShowReference("WelderTestInfoImportError.aspx"));
}
else
{
foreach (DataRow dr in dt.Rows)
{
Model.Welder_TestInfo model = new Model.Welder_TestInfo();
string welderCode = dr[0].ToString();
string weldMethod = dr[1].ToString();
string weldMeatrail = dr[2].ToString();
string isPass = dr[3].ToString();
string testDate = dr[4].ToString();
string remark = dr[5].ToString();
var welderId = Funs.DB.Welder_Welder.FirstOrDefault(t => t.WelderCode == welderCode)?.WelderId;
var methodId = Funs.DB.Base_WeldingMethod.FirstOrDefault(t => t.WeldingMethodCode == weldMethod)?.WeldingMethodId;
var materId = Funs.DB.Base_Material.FirstOrDefault(t => t.MaterialCode == weldMeatrail)?.MaterialId;
model.Id = SQLHelper.GetNewID(typeof(Model.Welder_TestInfo));
model.WeldMethodId = methodId;
model.MaterialId = materId;
model.IsPass = isPass == "是" ? true : false;
model.ProjectId = this.CurrUser.LoginProjectId;
model.WelderId = welderId;
model.CreatedDate = DateTime.Parse(testDate);
model.Remark = remark;
listData.Add(model);
}
}
if (listData.Count > 0)
{
Funs.DB.Welder_TestInfo.InsertAllOnSubmit(listData);
Funs.DB.SubmitChanges();
ShowNotify("导入成功", MessageBoxIcon.Success);
this.BindGrid();
}
}
else
{
foreach (DataRow dr in dt.Rows)
{
Model.Welder_TestInfo model = new Model.Welder_TestInfo();
string welderCode = dr[0].ToString();
string weldMethod = dr[1].ToString();
string weldMeatrail = dr[2].ToString();
string isPass = dr[3].ToString();
string testDate = dr[4].ToString();
string remark = dr[5].ToString();
var welderId = Funs.DB.Welder_Welder.FirstOrDefault(t => t.WelderCode == welderCode)?.WelderId;
var methodId = Funs.DB.Base_WeldingMethod.FirstOrDefault(t => t.WeldingMethodCode == weldMethod)?.WeldingMethodId;
var materId = Funs.DB.Base_Material.FirstOrDefault(t => t.MaterialCode == weldMeatrail)?.MaterialId;
model.Id = SQLHelper.GetNewID(typeof(Model.Welder_TestInfo));
model.WeldMethodId= methodId;
model.MaterialId= materId;
model.IsPass = isPass == "是" ? true : false;
model.ProjectId = this.CurrUser.LoginProjectId;
model.WelderId= welderId;
model.CreatedDate = DateTime.Parse(testDate);
model.Remark = remark;
listData.Add(model);
}
ShowAlert("没有数据!", MessageBoxIcon.Warning);
return;
}
if(listData.Count > 0)
{
Funs.DB.Welder_TestInfo.InsertAllOnSubmit(listData);
Funs.DB.SubmitChanges();
ShowNotify("导入成功", MessageBoxIcon.Success);
this.BindGrid();
}
}
else
catch (Exception ex)
{
ShowAlert("没有数据!", MessageBoxIcon.Warning);
return;
ShowAlert("'" + ex.Message + "'", MessageBoxIcon.Warning);
}
}
catch (Exception ex)
else
{
ShowAlert("'" + ex.Message + "'", MessageBoxIcon.Warning);
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
@ -485,7 +492,7 @@ namespace FineUIPro.Web.WelderManage
/// <param name="e"></param>
protected void btnAdd_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.Welder_QualifiedProjectMenuId, Const.BtnAdd))
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.WelderTestInfoMenuId, Const.BtnAdd))
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{

View File

@ -485,7 +485,7 @@ namespace FineUIPro.Web.CheckManage
if (ndtItem != string.Empty)
{
var q = BLL.Batch_NDEItemService.GetNDEItemById(ndtItem);
if (q.PassFilm != q.TotalFilm && q.SubmitDate.HasValue)
if ((q.PassFilm != q.TotalFilm || q.Remark.Contains("修磨") || q.Remark.Contains("异物")) && q.SubmitDate.HasValue)
{
string window = String.Format("RepairNotice.aspx?NDEItemID={0}", ndtItem, "返修通知单");
PageContext.RegisterStartupScript(WindowRepair.GetShowReference(window));

View File

@ -210,7 +210,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
if (repairRecord != null && !string.IsNullOrEmpty(repairRecord.RepairRecordCode))
{
// 取返修单后4位
code4 = repairRecord.RepairRecordCode.Substring(repairRecord.RepairRecordCode.Length - 4);
code4 = repairRecord.RepairRecordCode.Substring(repairRecord.RepairRecordCode.Length - 5);
// 取返修单后2位
code2 = repairRecord.RepairRecordCode.Substring(repairRecord.RepairRecordCode.Length - 2);
}
@ -245,7 +245,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@DetectionTypeId", repairRecord.DetectionTypeId));
// 如果是第二次返修不加载扩透口
if (!code4.Contains("K1") && code2 == "R2")
if (!code4.Contains("EX1") && code2 == "R2")
{
listStr.Add(new SqlParameter("@ProjectId", "0"));
}
@ -263,7 +263,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
}
else
{
if (ndtItem.JudgeGrade == "修磨" || ndtItem.JudgeGrade == "异物")
if (ndtItem.Remark.Contains("修磨") || ndtItem.Remark.Contains("异物"))
{
listStr.Add(new SqlParameter("@ProjectId", "0"));
}
@ -724,7 +724,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
if (code != null && !string.IsNullOrEmpty(code.RepairRecordCode))
{
// 取返修单后4位
string code4 = code.RepairRecordCode.Substring(code.RepairRecordCode.Length - 4);
string code4 = code.RepairRecordCode.Substring(code.RepairRecordCode.Length - 5);
// 取返修单后2位
string code2 = code.RepairRecordCode.Substring(code.RepairRecordCode.Length - 2);
if (code2 == "R1")
@ -749,7 +749,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
}
else
{
if (code4.Contains("K1") && code2 == "R2")
if (code4.Contains("EX1") && code2 == "R2")
{
Grid1.SelectAllRows();
}

View File

@ -81,7 +81,10 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
{
newItem.RepairRecordCode = q.TrustBatchCode + "-" + q.WeldJointCode + "P1";
}
else if (q.Remark.Contains("异物"))
{
newItem.RepairRecordCode = q.TrustBatchCode + "-" + q.WeldJointCode + "S1";
}
else
{
newItem.RepairRecordCode = q.TrustBatchCode + "-" + q.WeldJointCode + "R1";

View File

@ -277,7 +277,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDelegationId, Const.BtnAdd))
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDelegationMenuId, Const.BtnAdd))
{
this.SetTextTemp();
string window = String.Format("PMIDelegationEdit.aspx?PMIDelegationId={0}", string.Empty, "新增 - ") ;
@ -327,7 +327,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDelegationId, Const.BtnDelete))
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDelegationMenuId, Const.BtnDelete))
{
var trustManage =Funs.DB.PMI_Delegation.FirstOrDefault (t=>t.Id==this.PMIDelegationId);
if (trustManage != null)
@ -384,6 +384,18 @@ namespace FineUIPro.Web.WeldingProcess.PMI
#endregion
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private bool GetButtonPower(string button)
{
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DailyReportCompleteMenuId, button);
}
#endregion
}
}

View File

@ -191,7 +191,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDelegationId, Const.BtnSave))
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDelegationMenuId, Const.BtnSave))
{
try

View File

@ -50,7 +50,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
}
if (this.drpIsALl.SelectedValue=="报警")
{
query = query.Where(t=>(t.RateBys<=2 && t.PMIBySNum<=2) || (t.RateByf<=2 && t.PMIByFNum<=2));
query = query.Where(t=>(t.RateBys<=2 || t.PMIBySNum<=2) || (t.RateByf<=2 || t.PMIByFNum<=2));
}
if (!string.IsNullOrEmpty(this.txtPipelineCode.Text))
{
@ -98,7 +98,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
itemLable.Text = rates.ToString() + "%";
int PMIByFNum = Convert.ToInt32(labPMIByFNum.Text);
labRateByf.Text = ratef.ToString() + "%";
if ((rates <= 2 && PMIBySNum <= 2) || (ratef <= 2 && PMIByFNum <= 2))
if ((rates <= 2 || PMIBySNum <= 2) || (ratef <= 2 || PMIByFNum <= 2))
{
e.RowCssClass = "color1";
}

View File

@ -330,11 +330,11 @@ namespace FineUIPro.Web.WeldingProcess.PMI
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
//if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.BItemEndCheckMenuId, Const.BtnSave))
//{
// ShowNotify("您没有这个权限,请与管理员联系!");
// return;
//}
if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDetectionEntryMenuId, Const.BtnSave))
{
ShowNotify("您没有这个权限,请与管理员联系!");
return;
}
if (Grid1.GetModifiedData().Count > 0)
{

View File

@ -118,7 +118,7 @@
runat="server" OnClick="btnbtnOpenResetPoint_Click">
</f:Button>
<f:Button ID="btnClear" Text="手动关闭批" ToolTip="手动关闭批" Icon="ArrowOutLonger" runat="server"
ConfirmText="确定要手动关闭批吗?" OnClick="btnbtnClear_Click">
ConfirmText="确定要手动关闭批的待处理状态吗?" OnClick="btnbtnClear_Click">
</f:Button>
<f:Button ID="btnSelectExpandPoint" Text="重新选择扩口" ToolTip="重新选择扩口" Icon="ArrowRefresh"
runat="server" OnClick="btnSelectExpandPoint_Click" Hidden="true">

View File

@ -855,7 +855,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
}
/// <summary>
/// 手动结束批(暂不用)
/// 手动结束批
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@ -863,24 +863,32 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnClearBatch))
{
string info = "该批次已关闭!";
var point = BLL.Batch_PointBatchService.GetPointBatchById(this.PointBatchId);
if (point != null && !point.EndDate.HasValue)
string info = "该批次待处理状态的焊口已关闭!";
var pointItemList = (from x in Funs.DB.Batch_PointBatchItem where x.PointBatchId == this.PointBatchId && (x.IsCompletedPoint == null || x.IsCompletedPoint == false) select x).ToList();
foreach (var item in pointItemList)
{
var q = Funs.DB.Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchId == PointBatchId && x.PointState == "1");
if (q != null)
{
BLL.Batch_PointBatchService.UpdatePointBatch(PointBatchId, System.DateTime.Now);
this.txtEndDate.Text = point.EndDate.Value.ToShortDateString();
this.txtState.Text = "批关闭";
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnClearBatch, this.PointBatchId);
}
else
{
info = "该批次未点口,请手动点口后再结束批!";
}
item.IsCompletedPoint = true;
}
Funs.DB.SubmitChanges();
//var point = BLL.Batch_PointBatchService.GetPointBatchById(this.PointBatchId);
//if (point != null && !point.EndDate.HasValue)
//{
// var q = Funs.DB.Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchId == PointBatchId && x.PointState == "1");
// if (q != null)
// {
// BLL.Batch_PointBatchService.UpdatePointBatch(PointBatchId, System.DateTime.Now);
// this.txtEndDate.Text = point.EndDate.Value.ToShortDateString();
// this.txtState.Text = "批关闭";
// BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnClearBatch, this.PointBatchId);
// }
// else
// {
// info = "该批次未点口,请手动点口后再结束批!";
// }
//}
Alert.ShowInTop(info);
BindGrid();
}
else
{

View File

@ -558,6 +558,14 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
pointItem.JLAudit = Const.GlyId;
Funs.DB.SubmitChanges();
}
// 导入后该批次里所有口都关闭
var pointItemList = (from x in Funs.DB.Batch_PointBatchItem where x.PointBatchId == newBatchTrust.TopointBatch && (x.IsCompletedPoint == null || x.IsCompletedPoint == false) select x).ToList();
foreach (var item in pointItemList)
{
item.IsCompletedPoint = true;
}
Funs.DB.SubmitChanges();
}
ShowNotify("导入成功!", MessageBoxIcon.Success);

View File

@ -0,0 +1,94 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DailyReportComplete.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.WeldingManage.DailyReportComplete" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>日报完成情况</title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="日报完成情况" DataIDField="DailyReportCompleteId"
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true"
AllowSorting="true" OnSort="Grid1_Sort" DataKeyNames="DailyReportCompleteId"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpTeamGroup" runat="server" Label="施工班组"
LabelAlign="Right" Width="280px">
</f:DropDownList>
<f:Button ID="BtnAnalyse" Text="查询" Icon="ChartPie"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="<%$ Resources:Lan,Add %>" Icon="Add" EnablePostBack="true"
runat="server" OnClick="btnNew_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField HeaderText="单位代码" ColumnID="UnitCode" DataField="UnitCode" Width="150"></f:RenderField>
<f:RenderField HeaderText="施工班组" ColumnID="TeamGroupName" DataField="TeamGroupName" Width="180"></f:RenderField>
<f:RenderField HeaderText="日报日期" ColumnID="DailyReportDate" DataField="DailyReportDate" Width="200"></f:RenderField>
<f:RenderField HeaderText="填报人" ColumnID="ReportMan" DataField="ReportMan" Width="150"></f:RenderField>
<f:CheckBoxField Width="160px" RenderAsStaticField="true" TextAlign="Center" DataField="IsComplete" HeaderText="是否完成" />
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="<%$ Resources:Lan,PopForm %>" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="self" EnableResize="true" runat="server" OnClose="Window1_Close"
IsModal="true" Width="700px" Height="360px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" Icon="BulletEdit" EnablePostBack="true"
runat="server" Text="<%$ Resources:Lan,Edit %>">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
Icon="Delete" ConfirmText="<%$ Resources:Lan,DeleteReminder %>" ConfirmTarget="Top"
runat="server" Text="<%$ Resources:Lan,Delete %>">
</f:MenuButton>
<f:MenuButton ID="btnMenuView" OnClick="btnMenuView_Click" Icon="Find" EnablePostBack="true"
runat="server" Text="<%$ Resources:Lan,View %>">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -0,0 +1,250 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNet = System.Web.UI.WebControls;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace FineUIPro.Web.WeldingProcess.WeldingManage
{
public partial class DailyReportComplete : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
var teamGroup = BLL.Welder_TeamGroupService.GetAllTeamGroupList(CurrUser.LoginProjectId, "");
drpTeamGroup.DataValueField = "Value";
drpTeamGroup.DataTextField = "Text";
drpTeamGroup.DataSource = teamGroup;
drpTeamGroup.DataBind();
Funs.FineUIPleaseSelect(drpTeamGroup, "");
this.BindGrid();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT daily.DailyReportCompleteId,unit.UnitCode,team.TeamGroupName,
daily.DailyReportDate,daily.IsComplete,u.UserName AS ReportMan
FROM dbo.Pipeline_DailyReportComplete daily
LEFT JOIN dbo.Welder_TeamGroup team ON team.TeamGroupId = daily.TeamGroupId
LEFT JOIN dbo.Base_Unit unit ON unit.UnitId = daily.UnitId
LEFT JOIN dbo.Sys_User u ON u.UserId=daily.ReportMan
WHERE 1=1";
List<SqlParameter> parms = new List<SqlParameter>();
if (this.drpTeamGroup.SelectedValue != "" && this.drpTeamGroup.SelectedValue!=Const._Null)
{
strSql += " and daily.TeamGroupId = @TeamGroupId ";
parms.Add(new SqlParameter("@TeamGroupId", this.drpTeamGroup.SelectedValue));
}
strSql += " ORDER BY daily.DailyReportDate DESC ";
SqlParameter[] parameter = parms.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = dt.Rows.Count;
var table = this.GetPagedDataTable(Grid1, dt);
Grid1.DataSource = table;
Grid1.DataBind();
}
/// <summary>
/// 改变索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <summary>
/// 分页下拉选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 统计
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
BindGrid();
}
#region
/// <summary>
/// 增加按钮事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
if (GetButtonPower(Const.BtnAdd))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DailyReportCompleteEdit.aspx", "新增 - ")));
}
else
{
Alert.ShowInTop(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
return;
}
}
#endregion
#region //
/// <summary>
/// 编辑
/// </summary>
private void EditData()
{
if (GetButtonPower(BLL.Const.BtnModify))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInParent(Resources.Lan.SelectLeastOneRecord);
return;
}
string Id = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DailyReportCompleteEdit.aspx?completeId={0}", Id, "编辑 - ")));
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
}
}
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
EditData();
}
/// <summary>
/// 右键编辑事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
this.EditData();
}
protected void btnMenuView_Click(object sender, EventArgs e)
{
if (GetButtonPower(BLL.Const.BtnSee))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DailyReportCompleteEdit.aspx?completeId={0}", Grid1.SelectedRowID, "查看 - ")));
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
return;
}
}
/// <summary>
/// 批量删除数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (GetButtonPower(BLL.Const.BtnDelete))
{
string strShowNotify = string.Empty;
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
BLL.DailyReportCompleteService.DeleteDailyReportComplete(rowID);
BLL.Sys_LogService.AddLog(Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.DailyReportCompleteMenuId, Const.BtnDelete, rowID);
}
}
if (!string.IsNullOrEmpty(strShowNotify))
{
Alert.ShowInTop(strShowNotify, MessageBoxIcon.Warning);
}
else
{
BindGrid();
ShowNotify(Resources.Lan.DeletedSuccessfully, MessageBoxIcon.Success);
}
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private bool GetButtonPower(string button)
{
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DailyReportCompleteMenuId, button);
}
#endregion
#endregion
}
}

View File

@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.WeldingManage
{
public partial class DailyReportComplete
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// drpTeamGroup 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpTeamGroup;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
/// <summary>
/// btnMenuView 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuView;
}
}

View File

@ -0,0 +1,60 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DailyReportCompleteEdit.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.WeldingManage.DailyReportCompleteEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:DropDownList ID="drpUnit" runat="server" Label="单位名称">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtReportMan" runat="server" Label="填报人" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpTeamGroup" runat="server" Label="施工班组" Required="true" ShowRedStar="true">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker ID="txtDailyReportDate" runat="server" Label="日报日期" Required="true" ShowRedStar="true"></f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:CheckBox ID="chkIsComplete" runat="server" Text="是否完成">
</f:CheckBox>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="提交数据" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
</body>
</html>

View File

@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
namespace FineUIPro.Web.WeldingProcess.WeldingManage
{
public partial class DailyReportCompleteEdit : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
string completeId = Request.Params["completeId"];
BLL.Base_UnitService.InitUnitDropDownList(this.drpUnit, false, BLL.Const.UnitType_5, Resources.Lan.PleaseSelect);//单位
var teamGroup = BLL.Welder_TeamGroupService.GetAllTeamGroupList(CurrUser.LoginProjectId, "");
drpTeamGroup.DataValueField = "Value";
drpTeamGroup.DataTextField = "Text";
drpTeamGroup.DataSource = teamGroup;
drpTeamGroup.DataBind();
Funs.FineUIPleaseSelect(drpTeamGroup, "");
if (!string.IsNullOrEmpty(completeId))
{
var daily = BLL.DailyReportCompleteService.GetDailyReportComplete(completeId);
if (daily != null)
{
var user = BLL.Sys_UserService.GetUsersByUserId(daily.ReportMan);
drpUnit.SelectedValue = daily.UnitId;
if (user != null)
{
txtReportMan.Text = user.UserName;
}
else
{
txtReportMan.Text = this.CurrUser.UserName;
}
drpTeamGroup.SelectedValue = daily.TeamGroupId;
if (daily.DailyReportDate.HasValue)
{
this.txtDailyReportDate.Text = string.Format("{0:yyyy-MM-dd}", daily.DailyReportDate);
}
if (daily.IsComplete == true)
{
chkIsComplete.Checked = true;
}
else
{
chkIsComplete.Checked = false;
}
}
else
{
txtReportMan.Text = this.CurrUser.UserName;
}
}
}
}
/// <summary>
/// 加载页面
/// </summary>
private void LoadData()
{
btnClose.OnClientClick = ActiveWindow.GetHideReference();
}
/// <summary>
/// 提交按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.DailyReportCompleteMenuId, Const.BtnSave))
{
string completeId = Request.Params["completeId"];
if (drpTeamGroup.SelectedValue == null || drpTeamGroup.SelectedValue == "")
{
Alert.ShowInParent("施工班组不能为空!");
return;
}
string param = completeId != null ? completeId.ToString() : "";
if (BLL.DailyReportCompleteService.IsExistDailyReportComplete(this.CurrUser.LoginProjectId, param, drpTeamGroup.SelectedValue,Convert.ToDateTime(txtDailyReportDate.Text).Date))
{
Alert.ShowInParent("该施工班组这天的日报情况已存在!");
return;
}
else
{
Model.Pipeline_DailyReportComplete newR = new Model.Pipeline_DailyReportComplete();
newR.ProjectId = this.CurrUser.LoginProjectId;
newR.UnitId = drpUnit.SelectedValue;
newR.ReportMan=this.CurrUser.UserId;
newR.TeamGroupId = drpTeamGroup.SelectedValue;
newR.DailyReportDate=Convert.ToDateTime(txtDailyReportDate.Text).Date;
newR.IsComplete=chkIsComplete.Checked;
if (this.chkIsComplete.Checked)
{
newR.IsComplete = true;
}
else
{
newR.IsComplete = false;
}
if (string.IsNullOrEmpty(completeId))
{
string newKeyID = SQLHelper.GetNewID(typeof(Model.Pipeline_DailyReportComplete));
newR.DailyReportCompleteId = newKeyID;
BLL.DailyReportCompleteService.AddDailyReportComplete(newR);
BLL.Sys_LogService.AddLog(Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.DailyReportCompleteMenuId, Const.BtnAdd, newKeyID);
}
else
{
newR.DailyReportCompleteId = completeId;
BLL.DailyReportCompleteService.UpdateDailyReportComplete(newR);
BLL.Sys_LogService.AddLog(Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.DailyReportCompleteMenuId, Const.BtnModify, completeId);
}
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!");
}
}
}
}

View File

@ -0,0 +1,116 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.WeldingManage
{
public partial class DailyReportCompleteEdit
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// drpUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnit;
/// <summary>
/// txtReportMan 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtReportMan;
/// <summary>
/// drpTeamGroup 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpTeamGroup;
/// <summary>
/// txtDailyReportDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtDailyReportDate;
/// <summary>
/// chkIsComplete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox chkIsComplete;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
}
}

View File

@ -0,0 +1,133 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SuperQueWelding.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.WeldingManage.SuperQueWelding" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style>
.f-grid-row-summary .f-grid-cell-inner {
font-weight: bold;
color: red;
}
</style>
<title>超资质焊接预警</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="超资质焊接预警"
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true"
AllowSorting="true" SortField="PipelineCode,WeldJointCode" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" EnableSummary="true" SummaryPosition="Flow">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:RadioButtonList ID="rbWarn" runat="server" Width="120px">
<f:RadioItem Text="全部" Value="0" Selected="true" />
<f:RadioItem Text="预警" Value="1" />
</f:RadioButtonList>
<f:TextBox ID="txtPipeLineCode" runat="server" Label="管线号" LabelAlign="Right"
LabelWidth="90px" Width="260px"></f:TextBox>
<f:DatePicker runat="server" Label="焊接日期" ID="txtStarTime" LabelAlign="Right"
LabelWidth="90px" Width="210px">
</f:DatePicker>
<f:Label ID="Label1" runat="server" Text="<%$ Resources:Lan,To %>">
</f:Label>
<f:DatePicker runat="server" ID="txtEndTime" LabelAlign="Right" LabelWidth="80px"
Width="110px">
</f:DatePicker>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="BtnAnalyse" Text="查询" Icon="ChartPie"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:Button ID="btnExtract" Text="提取数据" Icon="ChartPie"
runat="server" OnClick="BtnExtract_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfNumber" HeaderText="序号<br>S/N"
Width="70px" HeaderTextAlign="Center" TextAlign="Center">
<ItemTemplate>
<asp:Label ID="labNumber" runat="server" Text=' <%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1%>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField HeaderText="区域号" ColumnID="WorkAreaCode"
DataField="WorkAreaCode" SortField="WorkAreaCode" FieldType="String" HeaderTextAlign="Center"
Width="180px">
</f:RenderField>
<f:RenderField HeaderText="管线号" ColumnID="PipelineCode"
DataField="PipelineCode" SortField="PipelineCode" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊口号" ColumnID="WeldJointCode"
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="材质1" ColumnID="MaterialCode1"
DataField="MaterialCode1" SortField="MaterialCode1" FieldType="String"
HeaderTextAlign="Center" Width="150px">
</f:RenderField>
<f:RenderField HeaderText="材质2" ColumnID="MaterialCode2"
DataField="MaterialCode2" SortField="MaterialCode2" FieldType="String"
HeaderTextAlign="Center" Width="150px">
</f:RenderField>
<f:RenderField HeaderText="焊接形式" ColumnID="WeldTypeCode"
DataField="WeldTypeCode" SortField="WeldTypeCode" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊接位置" ColumnID="WeldingLocationCode"
DataField="WeldingLocationCode" FieldType="String" HeaderTextAlign="Center"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="焊接方法<br>Weld Process" ColumnID="WeldingMethodName"
DataField="WeldingMethodName" SortField="WeldingMethodName" FieldType="String"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="寸径" ColumnID="Size" DataField="Size"
SortField="Size" FieldType="String" HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="规格" ColumnID="Specification" DataField="Specification"
SortField="Specification" FieldType="String" HeaderTextAlign="Center" Width="130px">
</f:RenderField>
<f:RenderField HeaderText="打底焊工号" ColumnID="BackingWelderCode"
DataField="BackingWelderCode" SortField="BackingWelderCode" FieldType="String"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="盖面焊工号" ColumnID="CoverWelderCode"
DataField="CoverWelderCode" SortField="CoverWelderCode" FieldType="String"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊接日期<br>Welding Date" ColumnID="WeldingDate"
DataField="WeldingDate" SortField="WeldingDate" FieldType="String" HeaderTextAlign="Center"
Width="170px">
</f:RenderField>
<f:RenderCheckField Width="80px" ColumnID="IsSuperQueWelding" DataField="IsSuperQueWelding" HeaderText="是否超资质" EnableColumnEdit="false">
</f:RenderCheckField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

View File

@ -0,0 +1,142 @@
using BLL;
using NPOI.XSSF.UserModel;
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using Newtonsoft.Json.Linq;
using BorderStyle = NPOI.SS.UserModel.BorderStyle;
namespace FineUIPro.Web.WeldingProcess.WeldingManage
{
public partial class SuperQueWelding : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid();
}
}
private void BindGrid()
{
DataTable tb = GetDataTable();
this.Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
/// <summary>
/// 数据表
/// </summary>
private DataTable GetDataTable()
{
string strSql = @"SELECT weldJoint.WeldJointId,weldJoint.ProjectId,WorkArea.WorkAreaId,
WorkArea.WorkAreaCode,pipeline.SingleNumber,pipeline.PipelineCode,weldJoint.WeldJointCode,
weldType.WeldTypeCode,wl.WeldingLocationCode,weldJoint.Size,weldJoint.Thickness,
weldJoint.Specification,mat1.MaterialCode AS MaterialCode1,mat2.MaterialCode AS MaterialCode2,
WeldMethod.WeldingMethodName,cw.WelderCode AS CoverWelderCode,fw.WelderCode AS BackingWelderCode,
weldJoint.BackingWelderId,weldJoint.CoverWelderId,weldingDaily.WeldingDate,
weldJoint.IsSuperQueWelding
FROM Pipeline_WeldJoint AS weldJoint
LEFT JOIN Pipeline_Pipeline AS pipeline ON pipeline.PipelineId = weldJoint.PipelineId
LEFT JOIN Project_WorkArea AS WorkArea ON WorkArea.WorkAreaId = pipeline.WorkAreaId
LEFT JOIN Base_Material AS mat1 ON mat1.MaterialId = weldJoint.Material1Id
LEFT JOIN Base_Material AS mat2 ON mat2.MaterialId = weldJoint.Material2Id
LEFT JOIN Base_WeldingMethod AS WeldMethod ON WeldMethod.WeldingMethodId = weldJoint.WeldingMethodId
LEFT JOIN dbo.Base_WeldType weldType ON weldType.WeldTypeId = weldJoint.WeldTypeId
LEFT JOIN dbo.Base_WeldingLocation wl ON wl.WeldingLocationId = weldJoint.WeldingLocationId
LEFT JOIN Pipeline_WeldingDaily AS weldingDaily ON weldingDaily.WeldingDailyId = weldJoint.WeldingDailyId
left join Welder_Welder AS fw on weldJoint.BackingWelderId = fw.WelderId
left join Welder_Welder AS cw on weldJoint.CoverWelderId = cw.WelderId
WHERE weldJoint.WeldingDailyId IS NOT NULL AND weldJoint.ProjectId=@projectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(txtPipeLineCode.Text))
{
strSql += " AND pipeline.PipelineCode LIKE @PipelineCode";
listStr.Add(new SqlParameter("@PipelineCode", "%" + this.txtPipeLineCode.Text.Trim() + "%"));
}
if (rbWarn.SelectedValue != "0")
{
strSql += " AND weldJoint.IsSuperQueWelding=1";
}
if (txtStarTime.Text != "")
{
strSql += " AND weldingDaily.WeldingDate> = @WeldingStartDate";
listStr.Add(new SqlParameter("@WeldingStartDate", txtStarTime.Text.Trim()));
}
if (txtEndTime.Text != "")
{
strSql += " AND weldingDaily.WeldingDate< = @WeldingEndDate";
listStr.Add(new SqlParameter("@WeldingEndDate", txtEndTime.Text.Trim()));
}
strSql += " ORDER BY pipeline.PipelineCode,WeldJointCode";
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
return dt;
}
#region
/// <summary>
/// 统计
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
BindGrid();
}
protected void BtnExtract_Click(object sender, EventArgs e)
{
DataTable dt = GetDataTable();
}
#endregion
#region
/// <summary>
/// 改变索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <summary>
/// 分页下拉选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
this.BindGrid();
}
#endregion
}
}

View File

@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.WeldingManage
{
public partial class SuperQueWelding
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// rbWarn 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbWarn;
/// <summary>
/// txtPipeLineCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipeLineCode;
/// <summary>
/// txtStarTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStarTime;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// txtEndTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// btnExtract 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnExtract;
/// <summary>
/// labNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label labNumber;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
}
}

View File

@ -73,15 +73,17 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
Grid1.DataSource = table;
Grid1.DataBind();
var distinctPipelineCode = tb.AsEnumerable().GroupBy(row => row.Field<string>("PipelineCode")).Select(group => group.First());
var distinctPipelineCode = tb.AsEnumerable().GroupBy(row => row.Field<string>("PipelineId")).Select(group => group.First());
var distinctSingleNumber = tb.AsEnumerable().GroupBy(row => row.Field<string>("SingleNumber")).Select(group => group.First());
var backingWelder = tb.AsEnumerable().Where(row => row.Field<string>("BackingWelderCode")!=null).GroupBy(row => row.Field<string>("BackingWelderCode")).Select(group => group.First());
var coverWelder = tb.AsEnumerable().Where(row => row.Field<string>("CoverWelderCode")!= null).GroupBy(row => row.Field<string>("CoverWelderCode")).Select(group => group.First());
var jotNum = from x in tb.AsEnumerable()
group x by new { pipe = x.Field<string>("PipelineCode"), jot = x.Field<string>("WeldJointCode"), Size = x.Field<string>("JOT_Size") }
group x by new { pipe = x.Field<string>("PipelineId"), jot = x.Field<string>("WeldJointCode"), Size = x.Field<string>("JOT_Size") }
into g
select new { pipe=g.Key.pipe,jot=g.Key.jot, Size=g.Key.Size };
JObject summary = new JObject();
summary.Add("tfNumber", "合计");
summary.Add("SingleNumber", distinctSingleNumber.Count().ToString());
summary.Add("PipelineCode", distinctPipelineCode.Count().ToString());
summary.Add("WeldJointCode", jotNum.Count());
summary.Add("JOT_Size", jotNum.Sum(x=>Convert.ToDouble(x.Size)));
@ -387,11 +389,12 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
rowIndex++;
}
var distinctPipelineCode = tb.AsEnumerable().GroupBy(row => row.Field<string>("PipelineCode")).Select(group => group.First());
var distinctPipelineCode = tb.AsEnumerable().GroupBy(row => row.Field<string>("PipelineId")).Select(group => group.First());
var distinctSingleNumber = tb.AsEnumerable().GroupBy(row => row.Field<string>("SingleNumber")).Select(group => group.First());
var backingWelder = tb.AsEnumerable().GroupBy(row => row.Field<string>("BackingWelderCode")).Select(group => group.First());
var coverWelder = tb.AsEnumerable().GroupBy(row => row.Field<string>("CoverWelderCode")).Select(group => group.First());
var jotNum = from x in tb.AsEnumerable()
group x by new { pipe = x.Field<string>("PipelineCode"), jot = x.Field<string>("WeldJointCode"), Size = x.Field<string>("JOT_Size") }
group x by new { pipe = x.Field<string>("PipelineId"), jot = x.Field<string>("WeldJointCode"), Size = x.Field<string>("JOT_Size") }
into g
select new { pipe = g.Key.pipe, jot = g.Key.jot, Size = g.Key.Size };
@ -401,6 +404,11 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
reportModel.GetRow(rowIndex).GetCell(0).SetCellValue("合计:");
reportModel.GetRow(rowIndex).GetCell(0).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
//单线图号
if (reportModel.GetRow(rowIndex).GetCell(4) == null) reportModel.GetRow(rowIndex).CreateCell(4);
reportModel.GetRow(rowIndex).GetCell(4).SetCellValue(distinctSingleNumber.Count().ToString());
reportModel.GetRow(rowIndex).GetCell(4).CellStyle.SetFont(cs_content_Font);
//管线号
if (reportModel.GetRow(rowIndex).GetCell(5) == null) reportModel.GetRow(rowIndex).CreateCell(5);
reportModel.GetRow(rowIndex).GetCell(5).SetCellValue(distinctPipelineCode.Count().ToString());

View File

@ -9,164 +9,186 @@
font-weight: bold;
color: red;
}
</style>
</style>
<title>焊接日报导出</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,JointComprehensive %>"
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true"
AllowSorting="true" SortField="PipelineCode,WeldJointCode" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" EnableSummary="true" SummaryPosition="Flow">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpInstallation" runat="server" Label="<%$ Resources:Lan,InstallationCode %>" AutoPostBack="true"
LabelAlign="Right" Width="180px" LabelWidth="80px" OnSelectedIndexChanged="drpInstallation_OnSelectedIndexChanged">
</f:DropDownList>
<f:DropDownList ID="drpWorkAreaId" runat="server" Label="<%$ Resources:Lan,Area %>"
LabelAlign="Right" Width="180px" LabelWidth="80px" >
</f:DropDownList>
<f:DropDownList ID="drpUnit" runat="server" Label="施工单位" LabelAlign="Right" Width="220px" EmptyText="请选择施工单位"
LabelWidth="90px">
</f:DropDownList>
<f:DropDownList ID="drpTeamGroup" runat="server" Label="班组" EnableCheckBoxSelect="true" EnableMultiSelect="true"
LabelAlign="Right" Width="240px" LabelWidth="80px">
</f:DropDownList>
<f:DatePicker runat="server" Label="焊接日期" ID="txtStarTime" LabelAlign="Right"
LabelWidth="90px" Width="210px">
</f:DatePicker>
<f:Label ID="Label1" runat="server" Text="<%$ Resources:Lan,To %>">
</f:Label>
<f:DatePicker runat="server" ID="txtEndTime" LabelAlign="Right" LabelWidth="80px"
Width="110px">
</f:DatePicker>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="BtnAnalyse" Text="<%$ Resources:Lan,Statistics %>" Icon="ChartPie"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="<%$ Resources:Lan,Export %>"
Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfNumber" HeaderText="序号<br>S/N"
Width="70px" HeaderTextAlign="Center" TextAlign="Center">
<ItemTemplate>
<asp:Label ID="labNumber" runat="server" Text=' <%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1%>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField HeaderText="管线号-页码<br>LineNo.-PageNo." ColumnID="SingleNumber"
DataField="SingleNumber" SortField="SingleNumber" FieldType="String" HeaderTextAlign="Center"
Width="180px">
</f:RenderField>
<f:RenderField HeaderText="图纸版本<br>Drawing Rev" ColumnID="DrawingsNum"
DataField="DrawingsNum" SortField="DrawingsNum" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊口号<br>Joint No." ColumnID="WeldJointCode"
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊接形式<br>JointType" ColumnID="WeldTypeCode"
DataField="WeldTypeCode" SortField="WeldTypeCode" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊接位置<br>Welding Location" ColumnID="WeldingLocationCode"
DataField="WeldingLocationCode" FieldType="String" HeaderTextAlign="Center"
Width="100px">
</f:RenderField>
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,JointComprehensive %>"
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true"
AllowSorting="true" DataKeyNames="WeldJointId" SortField="PipelineCode,WeldJointCode" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" EnableCheckBoxSelect="true" EnableSummary="true" SummaryPosition="Flow">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpInstallation" runat="server" Label="<%$ Resources:Lan,InstallationCode %>" AutoPostBack="true"
LabelAlign="Right" Width="180px" LabelWidth="80px" OnSelectedIndexChanged="drpInstallation_OnSelectedIndexChanged">
</f:DropDownList>
<f:DropDownList ID="drpWorkAreaId" runat="server" Label="<%$ Resources:Lan,Area %>"
LabelAlign="Right" Width="180px" LabelWidth="80px">
</f:DropDownList>
<f:RenderField HeaderText="寸径<br>Inch" ColumnID="Size" DataField="Size"
SortField="Size" FieldType="String" HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="规格<br>Size" ColumnID="Specification" DataField="Specification"
SortField="Specification" FieldType="String" HeaderTextAlign="Center" Width="130px">
</f:RenderField>
<f:RenderField HeaderText="焊工号<br>Welder No." ColumnID="WelderCode"
DataField="WelderCode" SortField="WelderCode" FieldType="String"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="组对部件<br>Part(1)" ColumnID="ComponentsName1"
DataField="ComponentsName1" SortField="ComponentsName1" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="组件1材质<br>Material(1)" ColumnID="MaterialCode1"
DataField="MaterialCode1" SortField="MaterialCode1" FieldType="String" HeaderTextAlign="Center"
Width="150px">
</f:RenderField>
<f:RenderField HeaderText="组件1炉批号<br>Heat No.(1)" ColumnID="HeartNo1" DataField="HeartNo1"
SortField="HeartNo1" FieldType="String" HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:DropDownList ID="drpUnit" runat="server" Label="施工单位" LabelAlign="Right" Width="240px" EmptyText="请选择施工单位"
LabelWidth="90px">
</f:DropDownList>
<f:DropDownList ID="drpTeamGroup" runat="server" Label="班组" EnableCheckBoxSelect="true" EnableMultiSelect="true"
LabelAlign="Right" Width="160px" LabelWidth="80px">
</f:DropDownList>
<f:DropDownList ID="drpAudit" runat="server" Label="审核状态" LabelWidth="80" Width="160" EmptyText="请选择">
<f:ListItem Value="全部" Text="全部" />
<f:ListItem Value="未审核" Text="未审核" />
<f:ListItem Value="已审核" Text="已审核" />
</f:DropDownList>
<f:DatePicker runat="server" Label="焊接日期" ID="txtStarTime" LabelAlign="Right"
LabelWidth="90px" Width="210px">
</f:DatePicker>
<f:Label ID="Label1" runat="server" Text="<%$ Resources:Lan,To %>">
</f:Label>
<f:DatePicker runat="server" ID="txtEndTime" LabelAlign="Right" LabelWidth="80px"
Width="110px">
</f:DatePicker>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:RenderField HeaderText="组对部件<br>Part(2)" ColumnID="ComponentsName2"
DataField="ComponentsName2" SortField="ComponentsName2" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="组件2材质<br>Material(2)" ColumnID="MaterialCode2"
DataField="MaterialCode2" SortField="MaterialCode2" FieldType="String" HeaderTextAlign="Center"
Width="150px">
</f:RenderField>
<f:RenderField HeaderText="组件2炉批号<br>Heat No.(2)" ColumnID="HeartNo2" DataField="HeartNo2"
SortField="HeartNo2" FieldType="String" HeaderTextAlign="Center" Width="120px">
</f:RenderField>
</Items>
</f:Toolbar>
</Toolbars>
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:Button ID="BtnAnalyse" Text="<%$ Resources:Lan,Statistics %>" Icon="ChartPie"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:Button ID="btnAuditAll" runat="server" Text="批量审核" ConfirmText="确定要批量审核吗?" ConfirmTarget="Top" OnClick="btnAuditAll_Click" Icon="Accept"></f:Button>
<f:Button ID="btnAudit" runat="server" Text="审核" ConfirmText="确定要审核这些日报吗?" ConfirmTarget="Top" OnClick="btnAudit_Click" Icon="Accept"></f:Button>
<f:Button ID="btnCancel" runat="server" Text="取消审核" ConfirmText="确定要取消审核这些日报吗?" ConfirmTarget="Top" OnClick="btnCancel_Click" Icon="Cancel"></f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="<%$ Resources:Lan,Export %>"
Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
<f:Button ID="btnSendEmail" runat="server" Text="发送日报" OnClick="btnSendEmail_Click"></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfNumber" HeaderText="序号<br>S/N"
Width="70px" HeaderTextAlign="Center" TextAlign="Center">
<ItemTemplate>
<asp:HiddenField ID="hidId" runat="server" Value='<%#Eval("WeldJointId") %>' />
<asp:Label ID="labNumber" runat="server" Text=' <%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1%>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField ColumnID="AuditStatus" runat="server" DataField="AuditStatus" Width="100" TextAlign="Center" HeaderText="审核状态"></f:RenderField>
<f:RenderField HeaderText="管线号-页码<br>LineNo.-PageNo." ColumnID="SingleNumber"
DataField="SingleNumber" SortField="SingleNumber" FieldType="String" HeaderTextAlign="Center"
Width="180px">
</f:RenderField>
<f:RenderField HeaderText="图纸版本<br>Drawing Rev" ColumnID="DrawingsNum"
DataField="DrawingsNum" SortField="DrawingsNum" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊口号<br>Joint No." ColumnID="WeldJointCode"
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊接形式<br>JointType" ColumnID="WeldTypeCode"
DataField="WeldTypeCode" SortField="WeldTypeCode" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊接位置<br>Welding Location" ColumnID="WeldingLocationCode"
DataField="WeldingLocationCode" FieldType="String" HeaderTextAlign="Center"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="焊接方法<br>Weld Process" ColumnID="WeldingMethodName"
DataField="WeldingMethodName" SortField="WeldingMethodName" FieldType="String"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<%--<f:RenderField HeaderText="焊材牌号<br>Weld Material" ColumnID="WeldMaterial"
<f:RenderField HeaderText="寸径<br>Inch" ColumnID="Size" DataField="Size"
SortField="Size" FieldType="String" HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="规格<br>Size" ColumnID="Specification" DataField="Specification"
SortField="Specification" FieldType="String" HeaderTextAlign="Center" Width="130px">
</f:RenderField>
<f:RenderField HeaderText="焊工号<br>Welder No." ColumnID="WelderCode"
DataField="WelderCode" SortField="WelderCode" FieldType="String"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="组对部件<br>Part(1)" ColumnID="ComponentsName1"
DataField="ComponentsName1" SortField="ComponentsName1" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="组件1材质<br>Material(1)" ColumnID="MaterialCode1"
DataField="MaterialCode1" SortField="MaterialCode1" FieldType="String" HeaderTextAlign="Center"
Width="150px">
</f:RenderField>
<f:RenderField HeaderText="组件1炉批号<br>Heat No.(1)" ColumnID="HeartNo1" DataField="HeartNo1"
SortField="HeartNo1" FieldType="String" HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="组对部件<br>Part(2)" ColumnID="ComponentsName2"
DataField="ComponentsName2" SortField="ComponentsName2" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="组件2材质<br>Material(2)" ColumnID="MaterialCode2"
DataField="MaterialCode2" SortField="MaterialCode2" FieldType="String" HeaderTextAlign="Center"
Width="150px">
</f:RenderField>
<f:RenderField HeaderText="组件2炉批号<br>Heat No.(2)" ColumnID="HeartNo2" DataField="HeartNo2"
SortField="HeartNo2" FieldType="String" HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="焊接方法<br>Weld Process" ColumnID="WeldingMethodName"
DataField="WeldingMethodName" SortField="WeldingMethodName" FieldType="String"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<%--<f:RenderField HeaderText="焊材牌号<br>Weld Material" ColumnID="WeldMaterial"
DataField="WeldMaterial" SortField="WeldMaterial" FieldType="String"
HeaderTextAlign="Center" Width="150px">
</f:RenderField>--%>
<f:TemplateField Width="150px" HeaderText="焊材牌号<br>Weld Material"
HeaderTextAlign="Center" SortField="WeldMaterial">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# ConvertWeldMaterial(Eval("WeldMaterial")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField Width="150px" HeaderText="焊材牌号<br>Weld Material"
HeaderTextAlign="Center" SortField="WeldMaterial">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# ConvertWeldMaterial(Eval("WeldMaterial")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField HeaderText="探伤比例<br>RT %" ColumnID="DetectionRateCode"
DataField="DetectionRateCode" SortField="DetectionRateCode" FieldType="String" HeaderTextAlign="Center"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="焊接日期<br>Welding Date" ColumnID="WeldingDate"
DataField="WeldingDate" SortField="WeldingDate" FieldType="String" HeaderTextAlign="Center"
Width="170px">
</f:RenderField>
<f:RenderField HeaderText="备注<br>Remark" ColumnID="Remark"
DataField="Remark" SortField="Remark" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:RenderField HeaderText="探伤比例<br>RT %" ColumnID="DetectionRateCode"
DataField="DetectionRateCode" SortField="DetectionRateCode" FieldType="String" HeaderTextAlign="Center"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="焊接日期<br>Welding Date" ColumnID="WeldingDate"
DataField="WeldingDate" SortField="WeldingDate" FieldType="String" HeaderTextAlign="Center"
Width="170px">
</f:RenderField>
<f:RenderField HeaderText="备注<br>Remark" ColumnID="Remark"
DataField="Remark" SortField="Remark" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="发送焊接日报" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="1200px" Height="460px">
</f:Window>
</form>
</body>
</html>

View File

@ -10,8 +10,11 @@ using System.IO;
using System.Linq;
using Newtonsoft.Json.Linq;
using BorderStyle = NPOI.SS.UserModel.BorderStyle;
using System.ServiceModel.Activation;
using AspNet = System.Web.UI.WebControls;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using FineUIPro.Web.common;
using System.Web;
namespace FineUIPro.Web.WeldingProcess.WeldingReport
{
@ -46,6 +49,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
private DataTable GetDataTable()
{
string strSql = @"SELECT weldJoint.WeldJointId,weldJoint.ProjectId,ins.InstallationCode,unit.UnitName,pipeline.PipelineCode,
(case weldJoint.AuditStatus when 1 then '' else '' end ) as AuditStatus,weldJoint.PipelineId,
(CASE WHEN weldJoint.PageNum IS NOT NULL AND weldJoint.PageNum<>'' THEN pipeline.SingleNumber+'-'+weldJoint.PageNum ELSE pipeline.SingleNumber END) AS SingleNumber,
pipeline.DrawingsNum,CONVERT(NVARCHAR(10),weldingDaily.WeldingDate,120) AS WeldingDate,rate.DetectionRateCode,weldJoint.WeldJointCode,
CAST(ISNULL(weldJoint.Size,0) AS REAL) AS Size,(CAST(ISNULL(weldJoint.Thickness,0) AS REAL)) AS Thickness,weldJoint.Specification,
@ -82,14 +86,13 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
{
strSql += " AND pipeline.InstallationId = @InstallationId";
listStr.Add(new SqlParameter("@InstallationId", this.drpInstallation.SelectedValue));
//string[] pipeList = drpPipeLine.SelectedValueArray;
//string pipeLineIds = string.Join(",", pipeList);
//listStr.Add(new SqlParameter("@pipelineIds", pipeLineIds));
}
//else
//{
// listStr.Add(new SqlParameter("@pipelineIds", null));
//}
if (drpAudit.SelectedValue!= Const._Null && drpAudit.SelectedValue != "全部")
{
int status = drpAudit.SelectedValue == "已审核" ? 1 : 0;
strSql += " AND weldJoint.AuditStatus=@AuditStatus";
listStr.Add(new SqlParameter("@AuditStatus", status));
}
if (this.drpWorkAreaId.SelectedValue != Const._Null && this.drpWorkAreaId.SelectedValue != null)
{
strSql += " AND pipeline.WorkAreaId = @WorkAreaId";
@ -124,6 +127,80 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
return dt;
}
private DataTable GetDataTableAuditStatus()
{
string strSql = @"SELECT weldJoint.WeldJointId,weldJoint.ProjectId,ins.InstallationCode,unit.UnitName,pipeline.PipelineCode,
(case weldJoint.AuditStatus when 1 then '' else '' end ) as AuditStatus,weldJoint.PipelineId,
(CASE WHEN weldJoint.PageNum IS NOT NULL AND weldJoint.PageNum<>'' THEN pipeline.SingleNumber+'-'+weldJoint.PageNum ELSE pipeline.SingleNumber END) AS SingleNumber,
pipeline.DrawingsNum,CONVERT(NVARCHAR(10),weldingDaily.WeldingDate,120) AS WeldingDate,rate.DetectionRateCode,weldJoint.WeldJointCode,
CAST(ISNULL(weldJoint.Size,0) AS REAL) AS Size,(CAST(ISNULL(weldJoint.Thickness,0) AS REAL)) AS Thickness,weldJoint.Specification,
weldType.WeldTypeCode,com1.ComponentsCode AS ComponentsName1,mat1.MaterialCode AS MaterialCode1,weldJoint.HeartNo1,
com2.ComponentsCode AS ComponentsName2,mat2.MaterialCode AS MaterialCode2,weldJoint.HeartNo2, WeldMethod.WeldingMethodName,
(CASE WHEN weldJoint.CoverWelderId!=weldJoint.BackingWelderId THEN cw.WelderCode+'/'+fw.WelderCode ELSE cw.WelderCode END) AS WelderCode ,
(CASE WHEN weldJoint.WeldMatId IS NOT NULL AND weldJoint.WeldSilkId IS NOT NULL THEN weldJoint.WeldSilkId+'|'+ weldJoint.WeldMatId
WHEN weldJoint.WeldMatId IS NOT NULL AND weldJoint.WeldSilkId IS NULL THEN weldJoint.WeldMatId
WHEN weldJoint.WeldSilkId IS NOT NULL AND weldJoint.WeldMatId IS NULL THEN weldJoint.WeldSilkId
ELSE '' END) AS WeldMaterial, wl.WeldingLocationCode,weldJoint.Remark
FROM Pipeline_WeldJoint AS weldJoint
LEFT JOIN Pipeline_Pipeline AS pipeline ON pipeline.PipelineId = weldJoint.PipelineId
LEFT JOIN dbo.Project_Installation ins ON ins.InstallationId = pipeline.InstallationId
LEFT JOIN dbo.Base_Unit unit ON unit.UnitId = pipeline.UnitId
LEFT JOIN dbo.Base_Components com1 ON com1.ComponentsId =weldJoint.PipeAssembly1Id
LEFT JOIN Base_Material AS mat1 ON mat1.MaterialId = weldJoint.Material1Id
LEFT JOIN dbo.Base_WeldingLocation wl ON wl.WeldingLocationId = weldJoint.WeldingLocationId
LEFT JOIN dbo.Base_Components com2 ON com2.ComponentsId =weldJoint.PipeAssembly2Id
LEFT JOIN Base_Material AS mat2 ON mat2.MaterialId = weldJoint.Material2Id
LEFT JOIN Base_WeldingMethod AS WeldMethod ON WeldMethod.WeldingMethodId = weldJoint.WeldingMethodId
LEFT JOIN dbo.Base_WeldType weldType ON weldType.WeldTypeId = weldJoint.WeldTypeId
LEFT JOIN Pipeline_WeldingDaily AS weldingDaily ON weldingDaily.WeldingDailyId = weldJoint.WeldingDailyId
left join Welder_Welder AS fw on weldJoint.BackingWelderId = fw.WelderId
left join Welder_Welder AS cw on weldJoint.CoverWelderId = cw.WelderId
LEFT JOIN dbo.Base_DetectionRate rate ON rate.DetectionRateId = pipeline.DetectionRateId
LEFT JOIN dbo.Welder_ProjectWelder pcw ON pcw.WelderId = weldJoint.CoverWelderId AND pcw.ProjectId=weldJoint.ProjectId
LEFT JOIN dbo.Welder_ProjectWelder pfw ON pfw.WelderId = weldJoint.BackingWelderId AND pfw.ProjectId=weldJoint.ProjectId
WHERE weldJoint.WeldingDailyId IS NOT NULL AND weldJoint.ProjectId=@projectId AND weldJoint.AuditStatus=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
if (drpInstallation.SelectedValue != Const._Null)
{
strSql += " AND pipeline.InstallationId = @InstallationId";
listStr.Add(new SqlParameter("@InstallationId", this.drpInstallation.SelectedValue));
}
if (this.drpWorkAreaId.SelectedValue != Const._Null && this.drpWorkAreaId.SelectedValue != null)
{
strSql += " AND pipeline.WorkAreaId = @WorkAreaId";
listStr.Add(new SqlParameter("@WorkAreaId", drpWorkAreaId.SelectedValue));
}
if (this.drpUnit.SelectedValue != Const._Null)
{
strSql += " AND pipeline.UnitId = @UnitId";
listStr.Add(new SqlParameter("@UnitId", drpUnit.SelectedValue));
}
if (this.drpTeamGroup.SelectedValueArray.Length > 0)
{
string[] teamGroupList = drpTeamGroup.SelectedValueArray;
string teamGroups = string.Join(",", teamGroupList);
strSql += " AND (CHARINDEX(pcw.TeamGroupId,@TeamGroupId)>0 OR CHARINDEX(pfw.TeamGroupId,@TeamGroupId)>0) ";
listStr.Add(new SqlParameter("@TeamGroupId", teamGroups));
}
if (txtStarTime.Text != "")
{
strSql += " AND weldingDaily.WeldingDate> = @WeldingStartDate";
listStr.Add(new SqlParameter("@WeldingStartDate", txtStarTime.Text.Trim()));
}
if (txtEndTime.Text != "")
{
strSql += " AND weldingDaily.WeldingDate< = @WeldingEndDate";
listStr.Add(new SqlParameter("@WeldingEndDate", txtEndTime.Text.Trim()));
}
strSql += " ORDER BY pipeline.PipelineCode,WeldJointCode";
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
return dt;
}
/// <summary>
/// 绑定数据
/// </summary>
@ -138,7 +215,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
if (tb.Rows.Count > 0)
{
// 合计
var distinctPipelineCode = tb.AsEnumerable().GroupBy(row => row.Field<string>("PipelineCode")).Select(group => group.First());
var distinctPipelineCode = tb.AsEnumerable().GroupBy(row => row.Field<string>("PipelineId")).Select(group => group.First());
var distinctWelder = tb.AsEnumerable().GroupBy(row => row.Field<string>("WelderCode")).Select(group => group.First());
decimal sumSize = decimal.Parse(tb.Compute("sum(Size)", "").ToString());
string weldingDate = string.Empty;
@ -173,6 +250,267 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
}
}
//批量审核
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)
{
var listIds = GetWeldJointIdList();
if (listIds.Count == 0)
{
ShowNotify("请选择要审核的焊接日报数据", MessageBoxIcon.Warning);
return;
}
ModifyAuditStatus(listIds,1);
this.BindGrid();
ShowNotify("批量审核成功!", MessageBoxIcon.Success);
}
//取消审核
protected void btnCancel_Click(object sender, EventArgs e)
{
var listIds = GetWeldJointIdList();
if (listIds.Count == 0)
{
ShowNotify("请选择要取消审核的焊接日报数据", MessageBoxIcon.Warning);
return;
}
ModifyAuditStatus(listIds,0);
this.BindGrid();
ShowNotify("批量取消审核成功!", MessageBoxIcon.Success);
}
//发送邮件
protected void btnSendEmail_Click(object sender,EventArgs e)
{
DataTable dt = GetDataTableAuditStatus();
if (dt.Rows.Count == 0)
{
ShowNotify("暂无已审核的数据!",MessageBoxIcon.Warning);
return;
}
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
//模板文件
string TempletFileName = rootPath + "WeldDailyExport.xlsx";
//导出文件
string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
string ReportFileName = filePath + $"焊接日报_{DateTime.Now.ToString("yyyyMMddhhmmss")}.xlsx";
try
{
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
XSSFWorkbook hssfworkbook = new XSSFWorkbook(file);
hssfworkbook.RemoveAt(0);
XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("Sheet1");
int rowIndex = 0;
var style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 20, true, true, "微软雅黑");
#region
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex, style, 0, 19, true);
ws.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(rowIndex, rowIndex, 0, 19));
//设置表头文字
ws.GetRow(rowIndex).GetCell(0).SetCellValue("焊接日报表\nWelding Daily Report");
var style2 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 9, true, true, "Arial");
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 1, rowIndex + 2, style2, 0, 19, true);
//设置表格表头
ws.GetRow(rowIndex + 1).GetCell(0).SetCellValue("序号");
ws.GetRow(rowIndex + 1).GetCell(1).SetCellValue("管线号-页码");
ws.GetRow(rowIndex + 1).GetCell(2).SetCellValue("图纸版本");
ws.GetRow(rowIndex + 1).GetCell(3).SetCellValue("焊口号");
ws.GetRow(rowIndex + 1).GetCell(4).SetCellValue("焊接形式");
ws.GetRow(rowIndex + 1).GetCell(5).SetCellValue("焊接位置");
ws.GetRow(rowIndex + 1).GetCell(6).SetCellValue("寸径");
ws.GetRow(rowIndex + 1).GetCell(7).SetCellValue("规格");
ws.GetRow(rowIndex + 1).GetCell(8).SetCellValue("焊工号");
ws.GetRow(rowIndex + 1).GetCell(9).SetCellValue("组对部件1");
ws.GetRow(rowIndex + 1).GetCell(10).SetCellValue("组件1材质");
ws.GetRow(rowIndex + 1).GetCell(11).SetCellValue("组件1炉批号");
ws.GetRow(rowIndex + 1).GetCell(12).SetCellValue("组对部件2");
ws.GetRow(rowIndex + 1).GetCell(13).SetCellValue("组件2材质");
ws.GetRow(rowIndex + 1).GetCell(14).SetCellValue("组件2炉批号");
ws.GetRow(rowIndex + 1).GetCell(15).SetCellValue("焊接方法");
ws.GetRow(rowIndex + 1).GetCell(16).SetCellValue("组对");
ws.GetRow(rowIndex + 1).GetCell(17).SetCellValue("外观");
ws.GetRow(rowIndex + 1).GetCell(18).SetCellValue("焊接日期");
ws.GetRow(rowIndex + 1).GetCell(19).SetCellValue("备注");
ws.GetRow(rowIndex + 2).GetCell(0).SetCellValue("S/N");
ws.GetRow(rowIndex + 2).GetCell(1).SetCellValue("LineNo.-PageNo.");
ws.GetRow(rowIndex + 2).GetCell(2).SetCellValue("Drawing\nRev");
ws.GetRow(rowIndex + 2).GetCell(3).SetCellValue("Joint\nNo.");
ws.GetRow(rowIndex + 2).GetCell(4).SetCellValue("JointType");
ws.GetRow(rowIndex + 2).GetCell(5).SetCellValue("Welding\nLocation");
ws.GetRow(rowIndex + 2).GetCell(6).SetCellValue("Inch");
ws.GetRow(rowIndex + 2).GetCell(7).SetCellValue("Size");
ws.GetRow(rowIndex + 2).GetCell(8).SetCellValue("Welder\nNo.");
ws.GetRow(rowIndex + 2).GetCell(9).SetCellValue("Part(1)");
ws.GetRow(rowIndex + 2).GetCell(10).SetCellValue("Material(1)");
ws.GetRow(rowIndex + 2).GetCell(11).SetCellValue("Heat\nNo.(1)");
ws.GetRow(rowIndex + 2).GetCell(12).SetCellValue("Part(2)");
ws.GetRow(rowIndex + 2).GetCell(13).SetCellValue("Material(2)");
ws.GetRow(rowIndex + 2).GetCell(14).SetCellValue("Heat\nNo.(2)");
ws.GetRow(rowIndex + 2).GetCell(15).SetCellValue("Weld\nProcess");
ws.GetRow(rowIndex + 2).GetCell(16).SetCellValue("Fit\nUp");
ws.GetRow(rowIndex + 2).GetCell(17).SetCellValue("VT");
ws.GetRow(rowIndex + 2).GetCell(18).SetCellValue("Welding\nDate");
ws.GetRow(rowIndex + 2).GetCell(19).SetCellValue("Remark");
ws.GetRow(rowIndex).Height = 69 * 20;
ws.GetRow(rowIndex + 1).Height = 15 * 20;
ws.GetRow(rowIndex + 2).Height = 30 * 20;
ws.SetColumnWidth(0, 5 * 256);
ws.SetColumnWidth(1, (int)(21.67 * 256));
ws.SetColumnWidth(2, (int)(9.78 * 256));
ws.SetColumnWidth(3, (int)(5.33 * 256));
ws.SetColumnWidth(4, (int)(7.67 * 256));
ws.SetColumnWidth(5, (int)(8.33 * 256));
ws.SetColumnWidth(6, (int)(7 * 256));
ws.SetColumnWidth(7, (int)(10.82 * 256));
ws.SetColumnWidth(8, (int)(8.33 * 256));
ws.SetColumnWidth(9, (int)(8.40 * 256));
ws.SetColumnWidth(10, (int)(15.67 * 256));
ws.SetColumnWidth(11, (int)(12 * 256));
ws.SetColumnWidth(12, (int)(8.22 * 256));
ws.SetColumnWidth(13, (int)(16.33 * 256));
ws.SetColumnWidth(14, (int)(11.45 * 256));
ws.SetColumnWidth(15, (int)(11.00 * 256));
ws.SetColumnWidth(16, (int)(4.00 * 256));
ws.SetColumnWidth(17, (int)(4.00 * 256));
ws.SetColumnWidth(18, (int)(9.00 * 256));
ws.SetColumnWidth(19, (int)(7 * 256));
#endregion
const int pageSize = 65;
var style3 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 9, false, false, "sans-serif");
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 3, dt.Rows.Count + 2, style3, 0, 19);
for (int i = 0; i < dt.Rows.Count; i++)
{
int startIndex = (i + 3);
ws.GetRow(startIndex).GetCell(0).SetCellValue(i + 1);
ws.GetRow(startIndex).GetCell(1).SetCellValue(dt.Rows[i]["SingleNumber"].ToString());
ws.GetRow(startIndex).GetCell(2).SetCellValue(dt.Rows[i]["DrawingsNum"].ToString());
ws.GetRow(startIndex).GetCell(3).SetCellValue(dt.Rows[i]["WeldJointCode"].ToString());
ws.GetRow(startIndex).GetCell(4).SetCellValue(dt.Rows[i]["WeldTypeCode"].ToString());
ws.GetRow(startIndex).GetCell(5).SetCellValue(dt.Rows[i]["WeldingLocationCode"].ToString());
ws.GetRow(startIndex).GetCell(6).SetCellValue(dt.Rows[i]["Size"].ToString());
ws.GetRow(startIndex).GetCell(7).SetCellValue(dt.Rows[i]["Specification"].ToString());
ws.GetRow(startIndex).GetCell(8).SetCellValue(dt.Rows[i]["WelderCode"].ToString());
ws.GetRow(startIndex).GetCell(9).SetCellValue(dt.Rows[i]["ComponentsName1"].ToString());
ws.GetRow(startIndex).GetCell(10).SetCellValue(dt.Rows[i]["MaterialCode1"].ToString());
ws.GetRow(startIndex).GetCell(11).SetCellValue(dt.Rows[i]["HeartNo1"].ToString());
ws.GetRow(startIndex).GetCell(12).SetCellValue(dt.Rows[i]["ComponentsName2"].ToString());
ws.GetRow(startIndex).GetCell(13).SetCellValue(dt.Rows[i]["MaterialCode2"].ToString());
ws.GetRow(startIndex).GetCell(14).SetCellValue(dt.Rows[i]["HeartNo2"].ToString());
ws.GetRow(startIndex).GetCell(15).SetCellValue(dt.Rows[i]["WeldingMethodName"].ToString());
ws.GetRow(startIndex).GetCell(16).SetCellValue("ACC");
ws.GetRow(startIndex).GetCell(17).SetCellValue("ACC");
ws.GetRow(startIndex).GetCell(18).SetCellValue(dt.Rows[i]["WeldingDate"].ToString());
ws.GetRow(startIndex).GetCell(19).SetCellValue(dt.Rows[i]["Remark"].ToString());
ws.GetRow(startIndex).Height = 10 * 20;
if (startIndex == pageSize)
{
ws.SetRowBreak(startIndex);
startIndex += pageSize;
}
}
if (dt.Rows.Count > 0)
{
string weldingDate = string.Empty;
if (txtStarTime.Text == txtEndTime.Text)
{
weldingDate = txtStarTime.Text;
}
else
{
weldingDate = txtStarTime.Text + "-" + txtEndTime.Text;
}
var style4 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 9, true, true, "Arial");
ws = ExcelCreateRow(ws, hssfworkbook, dt.Rows.Count + 3, dt.Rows.Count + 3, style4, 0, 19);
var distinctPipelineCode = dt.AsEnumerable().GroupBy(row => row.Field<string>("PipelineCode")).Select(group => group.First());
var distinctWelder = dt.AsEnumerable().GroupBy(row => row.Field<string>("WelderCode")).Select(group => group.First());
decimal sumSize = decimal.Parse(dt.Compute("sum(Size)", "").ToString());
ws.GetRow(dt.Rows.Count + 3).GetCell(0).SetCellValue("Total");
ws.GetRow(dt.Rows.Count + 3).GetCell(1).SetCellValue($"{distinctPipelineCode.Count().ToString()}");
ws.GetRow(dt.Rows.Count + 3).GetCell(3).SetCellValue($"{dt.Rows.Count}");
ws.GetRow(dt.Rows.Count + 3).GetCell(6).SetCellValue($"{sumSize}");
ws.GetRow(dt.Rows.Count + 3).GetCell(8).SetCellValue($"{distinctWelder.Count().ToString()}");
ws.GetRow(dt.Rows.Count + 3).Height = 20 * 20;
}
#region
IFooter footer = ws.Footer;
string str = " CC7: 监理: Worley:";
str += "\n\n第 &P 页,共 &N 页";
footer.Center = str;
#endregion
ws.FitToPage = true;
ws.PrintSetup.FitWidth = 1;
ws.PrintSetup.FitHeight = short.MaxValue;
ws.SetMargin(MarginType.LeftMargin, (double)1.2 / 3);
ws.SetMargin(MarginType.RightMargin, (double)0.5 / 3);
ws.SetMargin(MarginType.TopMargin, (double)1.8 / 3);
ws.SetMargin(MarginType.BottomMargin, (double)2.9 / 3);
ws.PrintSetup.Landscape = true;
ws.ForceFormulaRecalculation = true;
ws.PrintSetup.PaperSize = (int)PaperSize.A4_Small;
ws.RepeatingRows = new NPOI.SS.Util.CellRangeAddress(0, 2, 0, 19);
using (FileStream filess = System.IO.File.OpenWrite(ReportFileName))
{
hssfworkbook.Write(filess);
}
hssfworkbook.Close();
this.GetEmailTemplateAndSendEmail(ReportFileName);
File.Delete(ReportFileName);
ShowNotify("焊接日报发送成功!", MessageBoxIcon.Success);
}
catch (Exception ex)
{
ShowNotify($"发送失败,原因:{ex.Message}", MessageBoxIcon.Error);
}
}
protected void Window1_Close(object sender, EventArgs e)
{
this.BindGrid();
}
/// <summary>
/// 改变索引事件
/// </summary>
@ -371,7 +709,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
var style4 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 9, true,true, "Arial");
ws = ExcelCreateRow(ws, hssfworkbook, dt.Rows.Count + 3, dt.Rows.Count + 3, style4, 0, 19);
var distinctPipelineCode = dt.AsEnumerable().GroupBy(row => row.Field<string>("PipelineCode")).Select(group => group.First());
var distinctPipelineCode = dt.AsEnumerable().GroupBy(row => row.Field<string>("PipelineId")).Select(group => group.First());
var distinctWelder = dt.AsEnumerable().GroupBy(row => row.Field<string>("WelderCode")).Select(group => group.First());
decimal sumSize = decimal.Parse(dt.Compute("sum(Size)", "").ToString());
@ -564,6 +902,28 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
#endregion
#region
private List<string> GetWeldJointIdList()
{
List<string> listIds = new List<string>();
int[] selections = Grid1.SelectedRowIndexArray;
foreach (int rowIndex in selections)
{
string rowId = Grid1.DataKeys[rowIndex][0].ToString();
listIds.Add(rowId);
}
return listIds;
}
private void ModifyAuditStatus(List<string> listIds, int auditStatus)
{
var result = Funs.DB.Pipeline_WeldJoint.Where(t => listIds.Contains(t.WeldJointId)).ToList();
foreach (var item in result)
{
item.AuditStatus = auditStatus;
}
Funs.DB.SubmitChanges();
}
public static DataTable GetPageToTable(DataTable dt, int StartNum, int EndNum)
{
//0页代表每页数据直接返回
@ -627,5 +987,40 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
return style;
}
#region
private void GetEmailTemplateAndSendEmail(string fileList)
{
var pop = MailHelper.getEmailPop();
if (pop == null)
{
BLL.ErrLogInfo.WriteLog($"未配置邮件服务器");
return;
}
string templateContent = string.Empty;
string mailSubject = string.Empty;
var emailTemplate = BLL.Email_Send.Email_SendTemplateService.GetEmailNotifier("焊接日报");
if (emailTemplate == null)
{
BLL.ErrLogInfo.WriteLog($"不存在此邮件模版");
return;
}
List<string> emailSend = new List<string>(); //发送人
List<string> emailCC = new List<string>(); //抄送给
emailSend = BLL.Email_Send.Email_SendTemplateService.GetEmailByTemplateId(emailTemplate.EmailId, "0");
emailCC = BLL.Email_Send.Email_SendTemplateService.GetEmailByTemplateId(emailTemplate.EmailId, "1");
if (emailSend.Count == 0)
{
BLL.ErrLogInfo.WriteLog($"未检测到发送人邮箱,请先配置邮箱地址");
return;
}
mailSubject = $"焊接日报—{emailTemplate.EailTiaoJian}"; //发送主题
templateContent = emailTemplate.EmailContext;
string resultMessage = "";
MailHelper.SendNetMail(pop, pop.EmailYx, emailSend.ToArray(), mailSubject, templateContent, fileList, string.Empty, string.Empty, emailCC.ToArray(), out resultMessage);
}
#endregion
#endregion
}
}

View File

@ -95,6 +95,15 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// </remarks>
protected global::FineUIPro.DropDownList drpTeamGroup;
/// <summary>
/// drpAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpAudit;
/// <summary>
/// txtStarTime 控件。
/// </summary>
@ -131,6 +140,15 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
@ -140,6 +158,33 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// btnAuditAll 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAuditAll;
/// <summary>
/// btnAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAudit;
/// <summary>
/// btnCancel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnCancel;
/// <summary>
/// btnOut 控件。
/// </summary>
@ -149,6 +194,24 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// btnSendEmail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSendEmail;
/// <summary>
/// hidId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hidId;
/// <summary>
/// labNumber 控件。
/// </summary>
@ -193,5 +256,14 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}

View File

@ -173,6 +173,9 @@ namespace Model
partial void InsertHotProess_TrustItem(HotProess_TrustItem instance);
partial void UpdateHotProess_TrustItem(HotProess_TrustItem instance);
partial void DeleteHotProess_TrustItem(HotProess_TrustItem instance);
partial void InsertPipeline_DailyReportComplete(Pipeline_DailyReportComplete instance);
partial void UpdatePipeline_DailyReportComplete(Pipeline_DailyReportComplete instance);
partial void DeletePipeline_DailyReportComplete(Pipeline_DailyReportComplete instance);
partial void InsertPipeline_Pipeline(Pipeline_Pipeline instance);
partial void UpdatePipeline_Pipeline(Pipeline_Pipeline instance);
partial void DeletePipeline_Pipeline(Pipeline_Pipeline instance);
@ -694,6 +697,14 @@ namespace Model
}
}
public System.Data.Linq.Table<Pipeline_DailyReportComplete> Pipeline_DailyReportComplete
{
get
{
return this.GetTable<Pipeline_DailyReportComplete>();
}
}
public System.Data.Linq.Table<Pipeline_Pipeline> Pipeline_Pipeline
{
get
@ -17700,6 +17711,212 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Pipeline_DailyReportComplete")]
public partial class Pipeline_DailyReportComplete : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _DailyReportCompleteId;
private string _ProjectId;
private string _UnitId;
private string _TeamGroupId;
private System.Nullable<System.DateTime> _DailyReportDate;
private System.Nullable<bool> _IsComplete;
private string _ReportMan;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnDailyReportCompleteIdChanging(string value);
partial void OnDailyReportCompleteIdChanged();
partial void OnProjectIdChanging(string value);
partial void OnProjectIdChanged();
partial void OnUnitIdChanging(string value);
partial void OnUnitIdChanged();
partial void OnTeamGroupIdChanging(string value);
partial void OnTeamGroupIdChanged();
partial void OnDailyReportDateChanging(System.Nullable<System.DateTime> value);
partial void OnDailyReportDateChanged();
partial void OnIsCompleteChanging(System.Nullable<bool> value);
partial void OnIsCompleteChanged();
partial void OnReportManChanging(string value);
partial void OnReportManChanged();
#endregion
public Pipeline_DailyReportComplete()
{
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DailyReportCompleteId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string DailyReportCompleteId
{
get
{
return this._DailyReportCompleteId;
}
set
{
if ((this._DailyReportCompleteId != value))
{
this.OnDailyReportCompleteIdChanging(value);
this.SendPropertyChanging();
this._DailyReportCompleteId = value;
this.SendPropertyChanged("DailyReportCompleteId");
this.OnDailyReportCompleteIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
{
return this._ProjectId;
}
set
{
if ((this._ProjectId != value))
{
this.OnProjectIdChanging(value);
this.SendPropertyChanging();
this._ProjectId = value;
this.SendPropertyChanged("ProjectId");
this.OnProjectIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")]
public string UnitId
{
get
{
return this._UnitId;
}
set
{
if ((this._UnitId != value))
{
this.OnUnitIdChanging(value);
this.SendPropertyChanging();
this._UnitId = value;
this.SendPropertyChanged("UnitId");
this.OnUnitIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TeamGroupId", DbType="NVarChar(50)")]
public string TeamGroupId
{
get
{
return this._TeamGroupId;
}
set
{
if ((this._TeamGroupId != value))
{
this.OnTeamGroupIdChanging(value);
this.SendPropertyChanging();
this._TeamGroupId = value;
this.SendPropertyChanged("TeamGroupId");
this.OnTeamGroupIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DailyReportDate", DbType="DateTime")]
public System.Nullable<System.DateTime> DailyReportDate
{
get
{
return this._DailyReportDate;
}
set
{
if ((this._DailyReportDate != value))
{
this.OnDailyReportDateChanging(value);
this.SendPropertyChanging();
this._DailyReportDate = value;
this.SendPropertyChanged("DailyReportDate");
this.OnDailyReportDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsComplete", DbType="Bit")]
public System.Nullable<bool> IsComplete
{
get
{
return this._IsComplete;
}
set
{
if ((this._IsComplete != value))
{
this.OnIsCompleteChanging(value);
this.SendPropertyChanging();
this._IsComplete = value;
this.SendPropertyChanged("IsComplete");
this.OnIsCompleteChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReportMan", DbType="NVarChar(50)")]
public string ReportMan
{
get
{
return this._ReportMan;
}
set
{
if ((this._ReportMan != value))
{
this.OnReportManChanging(value);
this.SendPropertyChanging();
this._ReportMan = value;
this.SendPropertyChanged("ReportMan");
this.OnReportManChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Pipeline_Pipeline")]
public partial class Pipeline_Pipeline : INotifyPropertyChanging, INotifyPropertyChanged
{
@ -20713,6 +20930,8 @@ namespace Model
private System.Nullable<int> _AuditStatus;
private System.Nullable<bool> _IsSuperQueWelding;
private EntitySet<Batch_BatchTrustItem> _Batch_BatchTrustItem;
private EntitySet<Batch_PointBatchItem> _Batch_PointBatchItem;
@ -20855,6 +21074,8 @@ namespace Model
partial void OnIsPMIChanged();
partial void OnAuditStatusChanging(System.Nullable<int> value);
partial void OnAuditStatusChanged();
partial void OnIsSuperQueWeldingChanging(System.Nullable<bool> value);
partial void OnIsSuperQueWeldingChanged();
#endregion
public Pipeline_WeldJoint()
@ -21929,6 +22150,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsSuperQueWelding", DbType="Bit")]
public System.Nullable<bool> IsSuperQueWelding
{
get
{
return this._IsSuperQueWelding;
}
set
{
if ((this._IsSuperQueWelding != value))
{
this.OnIsSuperQueWeldingChanging(value);
this.SendPropertyChanging();
this._IsSuperQueWelding = value;
this.SendPropertyChanged("IsSuperQueWelding");
this.OnIsSuperQueWeldingChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Batch_BatchTrustItem_Pipeline_WeldJoint", Storage="_Batch_BatchTrustItem", ThisKey="WeldJointId", OtherKey="WeldJointId", DeleteRule="NO ACTION")]
public EntitySet<Batch_BatchTrustItem> Batch_BatchTrustItem
{

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@
</system.Web>
-->
<system.web>
<compilation debug="false" targetFramework="4.8"/>
<compilation debug="true" targetFramework="4.8"/>
<httpRuntime targetFramework="4.6.1"/>
</system.web>
<system.webServer>