feat: 完善材料管理与焊接业务功能
This commit is contained in:
@@ -264,38 +264,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </summary>
|
||||
private void BindPendingGrid()
|
||||
{
|
||||
string strSql = @"SELECT temp.TempDetailId,
|
||||
temp.WeldJointId,
|
||||
temp.WeldingDate,
|
||||
jot.PipelineCode,
|
||||
jot.WeldJointCode,
|
||||
coverWelder.WelderCode AS CoverWelderCode,
|
||||
backingWelder.WelderCode AS BackingWelderCode,
|
||||
temp.JointAttribute,
|
||||
location.WeldingLocationCode,
|
||||
jot.Size,
|
||||
jot.Dia,
|
||||
jot.Thickness,
|
||||
jot.WeldingMethodCode,
|
||||
submitPerson.PersonName AS SubmitPersonName,
|
||||
temp.SubmitDate,
|
||||
beforeAtt.AttachUrl AS BeforePhotoUrl,
|
||||
afterAtt.AttachUrl AS AfterPhotoUrl
|
||||
FROM dbo.HJGL_WeldingDailyTempDetail AS temp
|
||||
LEFT JOIN dbo.View_HJGL_WeldJoint AS jot ON jot.WeldJointId = temp.WeldJointId
|
||||
LEFT JOIN dbo.SitePerson_Person AS coverWelder ON coverWelder.PersonId = temp.CoverWelderId
|
||||
LEFT JOIN dbo.SitePerson_Person AS backingWelder ON backingWelder.PersonId = temp.BackingWelderId
|
||||
LEFT JOIN dbo.Base_WeldingLocation AS location ON location.WeldingLocationId = temp.WeldingLocationId
|
||||
LEFT JOIN dbo.Person_Persons AS submitPerson ON submitPerson.PersonId = temp.SubmitPersonId
|
||||
LEFT JOIN dbo.AttachFile AS beforeAtt ON beforeAtt.MenuId = @WeldReportMenuId
|
||||
AND beforeAtt.ToKeyId = temp.TempDetailId + '#Before'
|
||||
LEFT JOIN dbo.AttachFile AS afterAtt ON afterAtt.MenuId = @WeldReportMenuId
|
||||
AND afterAtt.ToKeyId = temp.TempDetailId + '#After'
|
||||
WHERE temp.ProjectId = @ProjectId AND temp.AuditState = 0";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@WeldReportMenuId", Const.HJGL_WeldReportMenuId));
|
||||
|
||||
var unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID);
|
||||
if (unitWork == null)
|
||||
{
|
||||
@@ -305,31 +273,30 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(daily.UnitWorkId);
|
||||
}
|
||||
}
|
||||
if (unitWork != null)
|
||||
{
|
||||
strSql += " AND temp.UnitWorkId = @UnitWorkId";
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", unitWork.UnitWorkId));
|
||||
}
|
||||
|
||||
DateTime? weldingDate = null;
|
||||
if (!string.IsNullOrEmpty(txtPendingWeldingDate.Text.Trim()))
|
||||
{
|
||||
strSql += " AND temp.WeldingDate >= @WeldingDate AND temp.WeldingDate < @WeldingDateEnd";
|
||||
DateTime weldingDate = Convert.ToDateTime(txtPendingWeldingDate.Text.Trim()).Date;
|
||||
listStr.Add(new SqlParameter("@WeldingDate", weldingDate));
|
||||
listStr.Add(new SqlParameter("@WeldingDateEnd", weldingDate.AddDays(1)));
|
||||
DateTime parsedDate;
|
||||
if (!DateTime.TryParse(txtPendingWeldingDate.Text.Trim(), out parsedDate))
|
||||
{
|
||||
GridPending.RecordCount = 0;
|
||||
GridPending.DataSource = null;
|
||||
GridPending.DataBind();
|
||||
Alert.ShowInTop("焊接日期格式不正确!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
weldingDate = parsedDate.Date;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtPendingPipelineCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND jot.PipelineCode LIKE @PendingPipelineCode";
|
||||
listStr.Add(new SqlParameter("@PendingPipelineCode", "%" + txtPendingPipelineCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtPendingWelderCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND (coverWelder.WelderCode LIKE @PendingWelderCode OR backingWelder.WelderCode LIKE @PendingWelderCode)";
|
||||
listStr.Add(new SqlParameter("@PendingWelderCode", "%" + txtPendingWelderCode.Text.Trim() + "%"));
|
||||
}
|
||||
strSql += " ORDER BY jot.PipelineCode, jot.WeldJointCode";
|
||||
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, listStr.ToArray());
|
||||
// 待审核列表与接口共用同一套查询和字段映射,避免PC端SQL与接口逐渐分叉。
|
||||
var pendingItems = BLL.WeldingDailyService.GetWeldingDailyTempDetailList(
|
||||
this.CurrUser.LoginProjectId,
|
||||
unitWork == null ? null : unitWork.UnitWorkId,
|
||||
weldingDate,
|
||||
txtPendingPipelineCode.Text.Trim(),
|
||||
txtPendingWelderCode.Text.Trim());
|
||||
DataTable tb = this.LINQToDataTable(pendingItems);
|
||||
GridPending.RecordCount = tb.Rows.Count;
|
||||
tb = GetFilteredTable(GridPending.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(GridPending, tb);
|
||||
|
||||
Reference in New Issue
Block a user