20251028
This commit is contained in:
@@ -59,8 +59,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
//this.SetDailyReportNo(null, null);
|
||||
|
||||
List<Model.View_JointInfo> GetWeldReportItem = BLL.WeldReportService.GetDistinctWeldReportItem(this.DReportID);
|
||||
|
||||
this.PageInfoLoad(); // 加载页面
|
||||
this.BindGrid(GetWeldReportItem); // 初始化页面
|
||||
this.PageInfoLoad(); // 加载页面
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -101,6 +102,40 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallation, this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue, true);
|
||||
this.drpInstallation.SelectedValue = BLL.Const._Null;
|
||||
|
||||
var report = BLL.WeldReportService.GetWeldReportByDReportID(this.DReportID);
|
||||
if (report != null)
|
||||
{
|
||||
//this.txtDailyReportNo.Text = report.JOT_DailyReportNo;
|
||||
if (!string.IsNullOrEmpty(report.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = report.UnitId;
|
||||
this.hdUnitId.Text = report.UnitId;
|
||||
//this.txtUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(report.UnitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(report.CHT_Tabler))
|
||||
{
|
||||
this.hdUserId.Text = report.CHT_Tabler;
|
||||
this.txtUserName.Text = BLL.UserService.GetUserNameByUserId(report.CHT_Tabler);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(report.InstallationId))
|
||||
{
|
||||
this.drpInstallation.Items.Clear();
|
||||
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallation, this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue, true);
|
||||
this.drpInstallation.SelectedValue = report.InstallationId;
|
||||
}
|
||||
this.hdDailyReportNo.Text = report.JOT_DailyReportNo;
|
||||
this.txtJOT_WeldDate.Text = string.Format("{0:yyyy-MM-dd}", report.JOT_WeldDate);
|
||||
this.txtCHT_TableDate.Text = string.Format("{0:yyyy-MM-dd}", report.CHT_TableDate);
|
||||
this.txtJOT_Remark.Text = report.JOT_Remark;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SimpleForm1.Reset(); ///重置所有字段
|
||||
this.txtJOT_WeldDate.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
|
||||
this.txtCHT_TableDate.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
|
||||
}
|
||||
|
||||
///盖面焊工
|
||||
this.drpCellWelderCode.Items.Clear();
|
||||
///打底焊工
|
||||
@@ -119,36 +154,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
drpFloorWelderCode.DataSource = BLL.WelderService.GetWelderCodeListByProjectIdAndUnitId(this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue);
|
||||
drpFloorWelderCode.DataBind();
|
||||
}
|
||||
var report = BLL.WeldReportService.GetWeldReportByDReportID(this.DReportID);
|
||||
if (report != null)
|
||||
{
|
||||
//this.txtDailyReportNo.Text = report.JOT_DailyReportNo;
|
||||
if (!string.IsNullOrEmpty(report.UnitId))
|
||||
{
|
||||
|
||||
this.hdUnitId.Text = report.UnitId;
|
||||
//this.txtUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(report.UnitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(report.CHT_Tabler))
|
||||
{
|
||||
this.hdUserId.Text = report.CHT_Tabler;
|
||||
this.txtUserName.Text = BLL.UserService.GetUserNameByUserId(report.CHT_Tabler);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(report.InstallationId))
|
||||
{
|
||||
this.drpInstallation.SelectedValue = report.InstallationId;
|
||||
}
|
||||
this.hdDailyReportNo.Text = report.JOT_DailyReportNo;
|
||||
this.txtJOT_WeldDate.Text = string.Format("{0:yyyy-MM-dd}", report.JOT_WeldDate);
|
||||
this.txtCHT_TableDate.Text = string.Format("{0:yyyy-MM-dd}", report.CHT_TableDate);
|
||||
this.txtJOT_Remark.Text = report.JOT_Remark;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SimpleForm1.Reset(); ///重置所有字段
|
||||
this.txtJOT_WeldDate.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
|
||||
this.txtCHT_TableDate.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
|
||||
}
|
||||
|
||||
/////制单人
|
||||
//this.drpCHT_Tabler.DataTextField = "UserName";
|
||||
@@ -161,9 +166,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
// this.drpCHT_Tabler.SelectedValue = this.CurrUser.UserId;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//BLL.Project_InstallationService.InitInstallationsDropDownList(this.drpInstallation, this.CurrUser.LoginProjectId, true);
|
||||
@@ -207,7 +212,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
// 2.获取当前分页数据
|
||||
//var table = this.GetPagedDataTable(GridNewDynamic, tb1);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
||||
Grid1.DataSource = table;
|
||||
@@ -250,108 +255,111 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
List<Model.View_JointInfo> GetWeldReportItem = this.CollectGridJointInfo();
|
||||
|
||||
Model.BO_WeldReportMain newWeldReportMain = new Model.BO_WeldReportMain();
|
||||
newWeldReportMain.ProjectId = this.CurrUser.LoginProjectId;
|
||||
//newWeldReportMain.JOT_DailyReportNo = this.txtDailyReportNo.Text.Trim();
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
if (GetWeldReportItem.Count > 0)
|
||||
{
|
||||
newWeldReportMain.UnitId = this.drpUnit.SelectedValue;
|
||||
}
|
||||
//if (!string.IsNullOrEmpty(this.CurrUser.UnitId))
|
||||
//{
|
||||
// newWeldReportMain.UnitId = this.CurrUser.UnitId;
|
||||
//}
|
||||
if (this.drpInstallation.SelectedValue != BLL.Const._Null&&!string.IsNullOrEmpty(this.drpInstallation.SelectedValue))
|
||||
{
|
||||
newWeldReportMain.InstallationId = this.drpInstallation.SelectedValue;
|
||||
}
|
||||
DateTime? weldDate = Funs.GetNewDateTime(this.txtJOT_WeldDate.Text);
|
||||
if (weldDate.HasValue)
|
||||
{
|
||||
newWeldReportMain.JOT_WeldDate = weldDate.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWeldReportMain.JOT_WeldDate = System.DateTime.Now;
|
||||
}
|
||||
//if (this.drpCHT_Tabler.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// newWeldReportMain.CHT_Tabler = this.drpCHT_Tabler.SelectedValue;
|
||||
//}
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.UserId))
|
||||
{
|
||||
newWeldReportMain.CHT_Tabler = this.CurrUser.UserId;
|
||||
}
|
||||
newWeldReportMain.CHT_TableDate = Funs.GetNewDateTime(this.txtCHT_TableDate.Text);
|
||||
newWeldReportMain.JOT_Remark = this.txtJOT_Remark.Text.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(this.DReportID))
|
||||
{
|
||||
newWeldReportMain.JOT_DailyReportNo = this.hdDailyReportNo.Text.Trim();
|
||||
newWeldReportMain.DReportID = this.DReportID;
|
||||
BLL.WeldReportService.UpdateWeldReport(newWeldReportMain);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newWeldReportMain.JOT_DailyReportNo, this.DReportID, BLL.Const.HJGL_WeldReportMenuId, "修改焊接日报信息");
|
||||
}
|
||||
else
|
||||
{
|
||||
#region 自动生成日报告号
|
||||
var workAreaCode = string.Empty;
|
||||
var welderCode = string.Empty;
|
||||
string jotId = GetWeldReportItem.FirstOrDefault().JOT_ID;
|
||||
if (!string.IsNullOrEmpty(jotId))
|
||||
Model.BO_WeldReportMain newWeldReportMain = new Model.BO_WeldReportMain();
|
||||
newWeldReportMain.ProjectId = this.CurrUser.LoginProjectId;
|
||||
//newWeldReportMain.JOT_DailyReportNo = this.txtDailyReportNo.Text.Trim();
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
var jotInfo = BLL.PW_JointInfoService.GetJointInfoByJotID(jotId);
|
||||
if (jotInfo != null)
|
||||
newWeldReportMain.UnitId = this.drpUnit.SelectedValue;
|
||||
}
|
||||
//if (!string.IsNullOrEmpty(this.CurrUser.UnitId))
|
||||
//{
|
||||
// newWeldReportMain.UnitId = this.CurrUser.UnitId;
|
||||
//}
|
||||
if (this.drpInstallation.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpInstallation.SelectedValue))
|
||||
{
|
||||
newWeldReportMain.InstallationId = this.drpInstallation.SelectedValue;
|
||||
}
|
||||
DateTime? weldDate = Funs.GetNewDateTime(this.txtJOT_WeldDate.Text);
|
||||
if (weldDate.HasValue)
|
||||
{
|
||||
newWeldReportMain.JOT_WeldDate = weldDate.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWeldReportMain.JOT_WeldDate = System.DateTime.Now;
|
||||
}
|
||||
//if (this.drpCHT_Tabler.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// newWeldReportMain.CHT_Tabler = this.drpCHT_Tabler.SelectedValue;
|
||||
//}
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.UserId))
|
||||
{
|
||||
newWeldReportMain.CHT_Tabler = this.CurrUser.UserId;
|
||||
}
|
||||
newWeldReportMain.CHT_TableDate = Funs.GetNewDateTime(this.txtCHT_TableDate.Text);
|
||||
newWeldReportMain.JOT_Remark = this.txtJOT_Remark.Text.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(this.DReportID))
|
||||
{
|
||||
newWeldReportMain.JOT_DailyReportNo = this.hdDailyReportNo.Text.Trim();
|
||||
newWeldReportMain.DReportID = this.DReportID;
|
||||
BLL.WeldReportService.UpdateWeldReport(newWeldReportMain);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newWeldReportMain.JOT_DailyReportNo, this.DReportID, BLL.Const.HJGL_WeldReportMenuId, "修改焊接日报信息");
|
||||
}
|
||||
else
|
||||
{
|
||||
#region 自动生成日报告号
|
||||
var workAreaCode = string.Empty;
|
||||
var welderCode = string.Empty;
|
||||
string jotId = GetWeldReportItem.FirstOrDefault().JOT_ID;
|
||||
if (!string.IsNullOrEmpty(jotId))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(jotInfo.ISO_ID))
|
||||
var jotInfo = BLL.PW_JointInfoService.GetJointInfoByJotID(jotId);
|
||||
if (jotInfo != null)
|
||||
{
|
||||
var isoInfo = BLL.PW_IsoInfoService.GetIsoInfoByIsoInfoId(jotInfo.ISO_ID);
|
||||
if (isoInfo != null)
|
||||
if (!string.IsNullOrEmpty(jotInfo.ISO_ID))
|
||||
{
|
||||
workAreaCode = BLL.WorkAreaService.GetWorkAreaCodeByWorkAreaId(isoInfo.WorkAreaId);
|
||||
var isoInfo = BLL.PW_IsoInfoService.GetIsoInfoByIsoInfoId(jotInfo.ISO_ID);
|
||||
if (isoInfo != null)
|
||||
{
|
||||
workAreaCode = BLL.WorkAreaService.GetWorkAreaCodeByWorkAreaId(isoInfo.WorkAreaId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
string welderId = GetWeldReportItem.FirstOrDefault().JOT_CellWelder;
|
||||
if (!string.IsNullOrEmpty(welderId))
|
||||
{
|
||||
welderCode = BLL.WelderService.GetWelderById(welderId).WED_Code;
|
||||
}
|
||||
string perfix = workAreaCode + "-" + welderCode + "-";
|
||||
newWeldReportMain.JOT_DailyReportNo = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.BO_WeldReportMain", "JOT_DailyReportNo", this.CurrUser.LoginProjectId, perfix);
|
||||
#endregion
|
||||
|
||||
this.DReportID = SQLHelper.GetNewID(typeof(Model.BO_WeldReportMain));
|
||||
newWeldReportMain.DReportID = this.DReportID;
|
||||
BLL.WeldReportService.AddWeldReport(newWeldReportMain);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newWeldReportMain.JOT_DailyReportNo, this.DReportID, BLL.Const.HJGL_WeldReportMenuId, "添加焊接日报信息");
|
||||
}
|
||||
string welderId = GetWeldReportItem.FirstOrDefault().JOT_CellWelder;
|
||||
if (!string.IsNullOrEmpty(welderId))
|
||||
|
||||
foreach (var item in GetWeldReportItem)
|
||||
{
|
||||
welderCode = BLL.WelderService.GetWelderById(welderId).WED_Code;
|
||||
Model.PW_JointInfo jot = BLL.PW_JointInfoService.GetJointInfoByJotID(item.JOT_ID);
|
||||
jot.DReportID = newWeldReportMain.DReportID;
|
||||
jot.JOT_CellWelder = item.JOT_CellWelder;
|
||||
jot.JOT_FloorWelder = item.JOT_FloorWelder;
|
||||
jot.WLO_Code = item.WLO_Code == "安装" ? "F" : "S";
|
||||
jot.JOT_JointAttribute = item.JOT_JointAttribute;
|
||||
jot.JOT_Location = item.JOT_Location;
|
||||
jot.JOT_DoneDin = item.JOT_DoneDin;
|
||||
jot.JOT_Electricity = item.JOT_Electricity;
|
||||
jot.JOT_Voltage = item.JOT_Voltage;
|
||||
jot.JOT_JointStatus = "100";
|
||||
jot.WeldingSpeed = item.WeldingSpeed;
|
||||
jot.JOT_PrepareTemp = item.JOT_PrepareTemp;
|
||||
jot.ActualPrepareTemp = item.ActualPrepareTemp;
|
||||
jot.JOT_CellTemp = item.JOT_CellTemp;
|
||||
jot.JOT_LastTemp = item.JOT_LastTemp;
|
||||
BLL.PW_JointInfoService.UpdateJointInfoByDReport(jot);
|
||||
//更新焊口号 修改固定焊口号后 +G
|
||||
BLL.PW_JointInfoService.UpdateJointNoAddG(item.JOT_ID, item.JOT_JointAttribute, "Add");
|
||||
}
|
||||
string perfix = workAreaCode + "-" + welderCode + "-";
|
||||
newWeldReportMain.JOT_DailyReportNo = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.BO_WeldReportMain", "JOT_DailyReportNo", this.CurrUser.LoginProjectId, perfix);
|
||||
#endregion
|
||||
|
||||
this.DReportID = SQLHelper.GetNewID(typeof(Model.BO_WeldReportMain));
|
||||
newWeldReportMain.DReportID = this.DReportID;
|
||||
BLL.WeldReportService.AddWeldReport(newWeldReportMain);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newWeldReportMain.JOT_DailyReportNo, this.DReportID, BLL.Const.HJGL_WeldReportMenuId, "添加焊接日报信息");
|
||||
ShowNotify("提交成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
foreach (var item in GetWeldReportItem)
|
||||
{
|
||||
Model.PW_JointInfo jot = BLL.PW_JointInfoService.GetJointInfoByJotID(item.JOT_ID);
|
||||
jot.DReportID = newWeldReportMain.DReportID;
|
||||
jot.JOT_CellWelder = item.JOT_CellWelder;
|
||||
jot.JOT_FloorWelder = item.JOT_FloorWelder;
|
||||
jot.WLO_Code = item.WLO_Code == "安装" ? "F" : "S";
|
||||
jot.JOT_JointAttribute = item.JOT_JointAttribute;
|
||||
jot.JOT_Location = item.JOT_Location;
|
||||
jot.JOT_DoneDin = item.JOT_DoneDin;
|
||||
jot.JOT_Electricity = item.JOT_Electricity;
|
||||
jot.JOT_Voltage = item.JOT_Voltage;
|
||||
jot.JOT_JointStatus = "100";
|
||||
jot.WeldingSpeed = item.WeldingSpeed;
|
||||
jot.JOT_PrepareTemp = item.JOT_PrepareTemp;
|
||||
jot.ActualPrepareTemp = item.ActualPrepareTemp;
|
||||
jot.JOT_CellTemp = item.JOT_CellTemp;
|
||||
jot.JOT_LastTemp = item.JOT_LastTemp;
|
||||
BLL.PW_JointInfoService.UpdateJointInfoByDReport(jot);
|
||||
//更新焊口号 修改固定焊口号后 +G
|
||||
BLL.PW_JointInfoService.UpdateJointNoAddG(item.JOT_ID, item.JOT_JointAttribute, "Add");
|
||||
}
|
||||
ShowNotify("提交成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user