diff --git a/DataBase/版本日志/SGGLDB_WH_V2024-07-26-phf.sql b/DataBase/版本日志/SGGLDB_WH_V2024-07-26-phf.sql new file mode 100644 index 00000000..a4a87d11 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_V2024-07-26-phf.sql @@ -0,0 +1,26 @@ +ALTER TABLE Transfer_Firefighting ADD Installation nvarchar(50) NULL +GO + +ALTER TABLE Transfer_Firefighting ADD Debugging nvarchar(50) NULL +GO + +ALTER TABLE Transfer_Firefighting ADD Acceptancecheck nvarchar(50) NULL +GO + +ALTER TABLE Transfer_Telecom ADD Installation nvarchar(50) NULL +GO +ALTER TABLE Transfer_Telecom ADD Communication nvarchar(50) NULL +GO +ALTER TABLE Transfer_Telecom ADD CableLaying nvarchar(50) NULL +GO +ALTER TABLE Transfer_Telecom ADD FunctionTest nvarchar(50) NULL +GO + +ALTER TABLE Transfer_Plumbing ADD Ndt nvarchar(50) NULL +GO + +ALTER TABLE Transfer_Plumbing ADD Flushing nvarchar(50) NULL +GO + +ALTER TABLE Transfer_Plumbing ADD RunningTest nvarchar(50) NULL +GO diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/Firefighting导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/Firefighting导入模板.xls index 7163bb6a..d79f250d 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/Firefighting导入模板.xls and b/SGGL/FineUIPro.Web/File/Excel/DataIn/Firefighting导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/Plumbing导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/Plumbing导入模板.xls index 766efdd1..59b1372a 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/Plumbing导入模板.xls and b/SGGL/FineUIPro.Web/File/Excel/DataIn/Plumbing导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/Telecom导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/Telecom导入模板.xls index b118a026..963b2b7b 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/Telecom导入模板.xls and b/SGGL/FineUIPro.Web/File/Excel/DataIn/Telecom导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx b/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx index 110128f9..d5b7e303 100644 --- a/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx +++ b/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx @@ -26,13 +26,20 @@ - + + + + + + + <%-- - + --%> @@ -64,10 +71,17 @@ - - + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx.cs b/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx.cs index c18a64d4..5bc6a4b7 100644 --- a/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx.cs @@ -40,22 +40,27 @@ namespace FineUIPro.Web.Transfer strSql += " AND Firefighting like @Firefighting"; listStr.Add(new SqlParameter("@Firefighting", "%" + this.txtFirefighting.Text.Trim() + "%")); } - if (!string.IsNullOrEmpty(txtStarTime.Text.Trim())) - { - strSql += " AND Test_Package_START >= @InspectionDateA"; - listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim()))); - } - if (!string.IsNullOrEmpty(txtEndTime.Text.Trim())) - { - strSql += " AND Test_Package_START <= @InspectionDateZ"; - listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim()))); - } + //if (!string.IsNullOrEmpty(txtStarTime.Text.Trim())) + //{ + // strSql += " AND Test_Package_START >= @InspectionDateA"; + // listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim()))); + //} + //if (!string.IsNullOrEmpty(txtEndTime.Text.Trim())) + //{ + // strSql += " AND Test_Package_START <= @InspectionDateZ"; + // listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim()))); + //} if (!string.IsNullOrEmpty(this.txtSystem.Text.Trim())) { strSql += " AND SystemName like @SystemName"; listStr.Add(new SqlParameter("@SystemName", "%" + this.txtSystem.Text.Trim() + "%")); } + if (!string.IsNullOrEmpty(ddStatus.SelectedValue)) + { + strSql += " And FINAL_Status='" + ddStatus.SelectedValue + "' "; + } + strSql += " order by Firefighting "; SqlParameter[] parameter = listStr.ToArray(); diff --git a/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx.designer.cs index fe469cc9..7328b1f3 100644 --- a/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/Firefighting.aspx.designer.cs @@ -78,31 +78,13 @@ namespace FineUIPro.Web.Transfer protected global::FineUIPro.TextBox txtSystem; /// - /// txtStarTime 控件。 + /// ddStatus 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DatePicker txtStarTime; - - /// - /// Label1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label Label1; - - /// - /// txtEndTime 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtEndTime; + protected global::FineUIPro.DropDownList ddStatus; /// /// btnSearch 控件。 diff --git a/SGGL/FineUIPro.Web/Transfer/FirefightingDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/FirefightingDataIn.aspx.cs index c43a1635..2434908f 100644 --- a/SGGL/FineUIPro.Web/Transfer/FirefightingDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/FirefightingDataIn.aspx.cs @@ -168,30 +168,12 @@ namespace FineUIPro.Web.Transfer { for (int i = 1; i < ir; i++) { - string row4 = pds.Rows[i][4].ToString(); - if (!string.IsNullOrEmpty(row4)) + string row4 = pds.Rows[i][0].ToString(); + if (string.IsNullOrEmpty(row4)) { - try - { - DateTime date = Convert.ToDateTime(row4.Trim()); - } - catch (Exception) - { - result += (i + 2).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|"; - } - } - string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row5)) - { - try - { - DateTime date = Convert.ToDateTime(row5.Trim()); - } - catch (Exception) - { - result += (i + 2).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|"; - } + result += (i + 2).ToString() + "," + "Firefighting" + "," + "不能为空!" + "|"; } + } if (!string.IsNullOrEmpty(result)) { @@ -331,10 +313,10 @@ namespace FineUIPro.Web.Transfer { if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Firefighting.FirstOrDefault(x => x.Firefighting == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) - { + ////查询第一列,没查到的情况下作导入处理 + //var modelOnly = Funs.DB.Transfer_Firefighting.FirstOrDefault(x => x.Firefighting == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); + //if (modelOnly == null) + //{ Model.Transfer_Firefighting model = new Model.Transfer_Firefighting(); model.Id = Guid.NewGuid().ToString(); model.ProjectId = CurrUser.LoginProjectId; @@ -342,44 +324,72 @@ namespace FineUIPro.Web.Transfer model.SystemName = pds.Rows[i][1].ToString().Trim(); model.Subsystem = pds.Rows[i][2].ToString().Trim(); model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - if (model.FINAL_Status.ToLower() == "finished") - { - model.CompleteTime = DateTime.Now; - } - list.Add(model); - } - else + var obj1 = model.Installation = pds.Rows[i][4].ToString().Trim(); + var obj2 = model.Debugging = pds.Rows[i][5].ToString().Trim(); + var obj3 = model.Acceptancecheck = pds.Rows[i][6].ToString().Trim(); + #region 判断状态 + var listObj = new List(); + listObj.Add(obj1); + listObj.Add(obj2); + listObj.Add(obj3); + //全是NA或Completed 状态是Completed + if (listObj.Where(x => x == "NA" || x == "Completed").ToList().Count == 3) { - //修改 - modelOnly.Firefighting = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - - //更改前不是finished,更改后是finished的,才修改实际完成时间 - if (modelOnly.FINAL_Status.ToLower() != "finished" && pds.Rows[i][6].ToString().Trim() == "finished") - { - modelOnly.CompleteTime = DateTime.Now; - } - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - //if (modelOnly.FINAL_Status.ToLower() == "finished") - //{ - // modelOnly.CompleteTime = DateTime.Now; - //} - Funs.DB.SubmitChanges(); + model.FINAL_Status = "Completed"; + list.Add(model); + continue; } + + + //如果全是Not Start 就是 Not Start + if (listObj.Where(x => x == "Not Start").ToList().Count == 3) + { + model.FINAL_Status = "Not Start"; + list.Add(model); + continue; + } + + //如果其中有一项是In progress 或Not Start 是 In progress + if (listObj.Where(x => x == "In progress" || x == "Not Start").ToList().Count >= 1) + { + model.FINAL_Status = "In progress"; + list.Add(model); + continue; + } + + model.FINAL_Status = "Not Start"; + list.Add(model); + + #endregion + + list.Add(model); + //} + //else + //{ + // //修改 + // modelOnly.Firefighting = pds.Rows[i][0].ToString().Trim(); + // modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + // modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + // modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + // DateTime t1, t2; + // if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + // modelOnly.Test_Package_START = t1; + // if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + // modelOnly.Test_Package_FINISH = t2; + + // //更改前不是finished,更改后是finished的,才修改实际完成时间 + // if (modelOnly.FINAL_Status.ToLower() != "finished" && pds.Rows[i][6].ToString().Trim() == "finished") + // { + // modelOnly.CompleteTime = DateTime.Now; + // } + // modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + // //if (modelOnly.FINAL_Status.ToLower() == "finished") + // //{ + // // modelOnly.CompleteTime = DateTime.Now; + // //} + // Funs.DB.SubmitChanges(); + //} } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx b/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx index 08a9ed31..89826672 100644 --- a/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx +++ b/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx @@ -26,13 +26,12 @@ - - - - - - + + + + + + @@ -64,10 +63,17 @@ - - + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx.cs b/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx.cs index cd19d616..9f5225f7 100644 --- a/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx.cs @@ -41,22 +41,19 @@ namespace FineUIPro.Web.Transfer strSql += " AND Plumbing like @Plumbing"; listStr.Add(new SqlParameter("@Plumbing", "%" + this.txtPlumbing.Text.Trim() + "%")); } - if (!string.IsNullOrEmpty(txtStarTime.Text.Trim())) - { - strSql += " AND Test_Package_START >= @InspectionDateA"; - listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim()))); - } - if (!string.IsNullOrEmpty(txtEndTime.Text.Trim())) - { - strSql += " AND Test_Package_START <= @InspectionDateZ"; - listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim()))); - } + if (!string.IsNullOrEmpty(this.txtSystem.Text.Trim())) { strSql += " AND SystemName like @SystemName"; listStr.Add(new SqlParameter("@SystemName", "%" + this.txtSystem.Text.Trim() + "%")); } + if (!string.IsNullOrEmpty(ddStatus.SelectedValue)) + { + strSql += " And FINAL_Status='" + ddStatus.SelectedValue + "' "; + } + + strSql += " order by Plumbing "; SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); diff --git a/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx.designer.cs index ae747e36..2a065db0 100644 --- a/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/Plumbing.aspx.designer.cs @@ -78,31 +78,13 @@ namespace FineUIPro.Web.Transfer protected global::FineUIPro.TextBox txtSystem; /// - /// txtStarTime 控件。 + /// ddStatus 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DatePicker txtStarTime; - - /// - /// Label1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label Label1; - - /// - /// txtEndTime 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtEndTime; + protected global::FineUIPro.DropDownList ddStatus; /// /// btnSearch 控件。 diff --git a/SGGL/FineUIPro.Web/Transfer/PlumbingDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/PlumbingDataIn.aspx.cs index 2f93eb19..da73af0e 100644 --- a/SGGL/FineUIPro.Web/Transfer/PlumbingDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/PlumbingDataIn.aspx.cs @@ -168,30 +168,12 @@ namespace FineUIPro.Web.Transfer { for (int i = 1; i < ir; i++) { - string row4 = pds.Rows[i][4].ToString(); - if (!string.IsNullOrEmpty(row4)) + string row4 = pds.Rows[i][0].ToString(); + if (string.IsNullOrEmpty(row4)) { - try - { - DateTime date = Convert.ToDateTime(row4.Trim()); - } - catch (Exception) - { - result += (i + 2).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|"; - } - } - string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row5)) - { - try - { - DateTime date = Convert.ToDateTime(row5.Trim()); - } - catch (Exception) - { - result += (i + 2).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|"; - } + result += (i + 2).ToString() + "," + "Plumbing" + "," + "不能为空!" + "|"; } + } if (!string.IsNullOrEmpty(result)) { @@ -332,55 +314,83 @@ namespace FineUIPro.Web.Transfer if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) { //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Plumbing.FirstOrDefault(x => x.Plumbing == pds.Rows[i][0].ToString().Trim() - && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) + // var modelOnly = Funs.DB.Transfer_Plumbing.FirstOrDefault(x => x.Plumbing == pds.Rows[i][0].ToString().Trim() + //&& x.ProjectId == CurrUser.LoginProjectId); + // if (modelOnly == null) + // { + Model.Transfer_Plumbing model = new Model.Transfer_Plumbing(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.Plumbing = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + var obj1 = model.Ndt = pds.Rows[i][4].ToString().Trim(); + var obj2 = model.Flushing = pds.Rows[i][5].ToString().Trim(); + var obj3 = model.RunningTest = pds.Rows[i][6].ToString().Trim(); + #region 判断状态 + var listObj = new List(); + listObj.Add(obj1); + listObj.Add(obj2); + listObj.Add(obj3); + //全是NA或Completed 状态是Completed + if (listObj.Where(x => x == "NA" || x == "Completed").ToList().Count == 3) { - Model.Transfer_Plumbing model = new Model.Transfer_Plumbing(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.Plumbing = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; - - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - if (model.FINAL_Status.ToLower() == "finished") - { - model.CompleteTime = DateTime.Now; - } + model.FINAL_Status = "Completed"; list.Add(model); + continue; } - else - { - //修改 - modelOnly.Plumbing = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - //更改前不是finished,更改后是finished的,才修改实际完成时间 - if (modelOnly.FINAL_Status.ToLower() != "finished" && pds.Rows[i][6].ToString().Trim() == "finished") - { - modelOnly.CompleteTime = DateTime.Now; - } - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - //if (modelOnly.FINAL_Status.ToLower() == "finished") - //{ - // modelOnly.CompleteTime = DateTime.Now; - //} - Funs.DB.SubmitChanges(); + + //如果全是Not Start 就是 Not Start + if (listObj.Where(x => x == "Not Start").ToList().Count == 3) + { + model.FINAL_Status = "Not Start"; + list.Add(model); + continue; } + + //如果其中有一项是In progress 或Not Start 是 In progress + if (listObj.Where(x => x == "In progress" || x == "Not Start").ToList().Count >= 1) + { + model.FINAL_Status = "In progress"; + list.Add(model); + continue; + } + + model.FINAL_Status = "Not Start"; + list.Add(model); + + #endregion + + + list.Add(model); + //} + //else + //{ + // //修改 + // modelOnly.Plumbing = pds.Rows[i][0].ToString().Trim(); + // modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + // modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + // modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + // DateTime t1, t2; + // if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + // modelOnly.Test_Package_START = t1; + // if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + // modelOnly.Test_Package_FINISH = t2; + + // //更改前不是finished,更改后是finished的,才修改实际完成时间 + // if (modelOnly.FINAL_Status.ToLower() != "finished" && pds.Rows[i][6].ToString().Trim() == "finished") + // { + // modelOnly.CompleteTime = DateTime.Now; + // } + // modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + // //if (modelOnly.FINAL_Status.ToLower() == "finished") + // //{ + // // modelOnly.CompleteTime = DateTime.Now; + // //} + // Funs.DB.SubmitChanges(); + //} } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/Telecom.aspx b/SGGL/FineUIPro.Web/Transfer/Telecom.aspx index 4868ebb4..9304dda6 100644 --- a/SGGL/FineUIPro.Web/Transfer/Telecom.aspx +++ b/SGGL/FineUIPro.Web/Transfer/Telecom.aspx @@ -26,13 +26,19 @@ - + + + + + + <%-- - + --%> @@ -64,10 +70,21 @@ - - + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/Telecom.aspx.cs b/SGGL/FineUIPro.Web/Transfer/Telecom.aspx.cs index 2043236e..0ba55acc 100644 --- a/SGGL/FineUIPro.Web/Transfer/Telecom.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/Telecom.aspx.cs @@ -41,21 +41,25 @@ namespace FineUIPro.Web.Transfer strSql += " AND Telecom like @Telecom"; listStr.Add(new SqlParameter("@Telecom", "%" + this.txtTelecom.Text.Trim() + "%")); } - if (!string.IsNullOrEmpty(txtStarTime.Text.Trim())) - { - strSql += " AND Test_Package_START >= @InspectionDateA"; - listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim()))); - } - if (!string.IsNullOrEmpty(txtEndTime.Text.Trim())) - { - strSql += " AND Test_Package_START <= @InspectionDateZ"; - listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim()))); - } + //if (!string.IsNullOrEmpty(txtStarTime.Text.Trim())) + //{ + // strSql += " AND Test_Package_START >= @InspectionDateA"; + // listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim()))); + //} + //if (!string.IsNullOrEmpty(txtEndTime.Text.Trim())) + //{ + // strSql += " AND Test_Package_START <= @InspectionDateZ"; + // listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim()))); + //} if (!string.IsNullOrEmpty(this.txtSystem.Text.Trim())) { strSql += " AND SystemName like @SystemName"; listStr.Add(new SqlParameter("@SystemName", "%" + this.txtSystem.Text.Trim() + "%")); } + if (!string.IsNullOrEmpty(ddStatus.SelectedValue)) + { + strSql += " And FINAL_Status='" + ddStatus.SelectedValue + "' "; + } strSql += " order by Telecom "; diff --git a/SGGL/FineUIPro.Web/Transfer/Telecom.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/Telecom.aspx.designer.cs index 4518bcf3..965ca7b5 100644 --- a/SGGL/FineUIPro.Web/Transfer/Telecom.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/Telecom.aspx.designer.cs @@ -78,31 +78,13 @@ namespace FineUIPro.Web.Transfer protected global::FineUIPro.TextBox txtSystem; /// - /// txtStarTime 控件。 + /// ddStatus 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DatePicker txtStarTime; - - /// - /// Label1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label Label1; - - /// - /// txtEndTime 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtEndTime; + protected global::FineUIPro.DropDownList ddStatus; /// /// btnSearch 控件。 diff --git a/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs index d6aa2dea..9c540145 100644 --- a/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs @@ -130,7 +130,7 @@ namespace FineUIPro.Web.Transfer oleDBConn.Close(); oleDBConn.Dispose(); - AddDatasetToSQL(ds.Tables[0], 7); + AddDatasetToSQL(ds.Tables[0], 8); hdCheckResult.Text = "1"; } catch (Exception exc) @@ -168,30 +168,12 @@ namespace FineUIPro.Web.Transfer { for (int i = 1; i < ir; i++) { - string row4 = pds.Rows[i][4].ToString(); - if (!string.IsNullOrEmpty(row4)) + string row4 = pds.Rows[i][0].ToString(); + if (string.IsNullOrEmpty(row4)) { - try - { - DateTime date = Convert.ToDateTime(row4.Trim()); - } - catch (Exception) - { - result += (i + 2).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|"; - } - } - string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row5)) - { - try - { - DateTime date = Convert.ToDateTime(row5.Trim()); - } - catch (Exception) - { - result += (i + 2).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|"; - } + result += (i + 2).ToString() + "," + "Telecom" + "," + "不能为空!" + "|"; } + } if (!string.IsNullOrEmpty(result)) { @@ -298,7 +280,7 @@ namespace FineUIPro.Web.Transfer oleDBConn.Close(); oleDBConn.Dispose(); - AddDatasetToSQL2(ds.Tables[0], 7); + AddDatasetToSQL2(ds.Tables[0], 8); } catch (Exception ex) { @@ -331,56 +313,87 @@ namespace FineUIPro.Web.Transfer { if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Telecom.FirstOrDefault(x => x.Telecom == pds.Rows[i][0].ToString().Trim() - && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) + // //查询第一列,没查到的情况下作导入处理 + // var modelOnly = Funs.DB.Transfer_Telecom.FirstOrDefault(x => x.Telecom == pds.Rows[i][0].ToString().Trim() + //&& x.ProjectId == CurrUser.LoginProjectId); + // if (modelOnly == null) + // { + Model.Transfer_Telecom model = new Model.Transfer_Telecom(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.Telecom = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + var obj1 = model.Installation = pds.Rows[i][4].ToString().Trim(); + var obj2 = model.Communication = pds.Rows[i][5].ToString().Trim(); + var obj3 = model.CableLaying = pds.Rows[i][6].ToString().Trim(); + var obj4 = model.FunctionTest = pds.Rows[i][7].ToString().Trim(); + #region 判断状态 + var listObj = new List(); + listObj.Add(obj1); + listObj.Add(obj2); + listObj.Add(obj3); + listObj.Add(obj4); + //全是NA或Completed 状态是Completed + if (listObj.Where(x => x == "NA" || x == "Completed").ToList().Count == 4) { - Model.Transfer_Telecom model = new Model.Transfer_Telecom(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.Telecom = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; - - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - if (model.FINAL_Status.ToLower() == "finished") - { - model.CompleteTime = DateTime.Now; - } + model.FINAL_Status = "Completed"; list.Add(model); + continue; } - else - { - //修改 - modelOnly.Telecom = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - //更改前不是finished,更改后是finished的,才修改实际完成时间 - if (modelOnly.FINAL_Status.ToLower() != "finished" && pds.Rows[i][6].ToString().Trim() == "finished") - { - modelOnly.CompleteTime = DateTime.Now; - } - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - //if (modelOnly.FINAL_Status.ToLower() == "finished") - //{ - // modelOnly.CompleteTime = DateTime.Now; - //} - Funs.DB.SubmitChanges(); + + //如果全是Not Start 就是 Not Start + if (listObj.Where(x => x == "Not Start").ToList().Count == 4) + { + model.FINAL_Status = "Not Start"; + list.Add(model); + continue; } + + //如果其中有一项是In progress 或Not Start 是 In progress + if (listObj.Where(x => x == "In progress" || x == "Not Start").ToList().Count >= 1) + { + model.FINAL_Status = "In progress"; + list.Add(model); + continue; + } + + model.FINAL_Status = "Not Start"; + list.Add(model); + + #endregion + + + + list.Add(model); + //} + //else + //{ + // //修改 + // modelOnly.Telecom = pds.Rows[i][0].ToString().Trim(); + // modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + // modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + // modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + // DateTime t1, t2; + // if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + // modelOnly.Test_Package_START = t1; + // if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + // modelOnly.Test_Package_FINISH = t2; + + // //更改前不是finished,更改后是finished的,才修改实际完成时间 + // if (modelOnly.FINAL_Status.ToLower() != "finished" && pds.Rows[i][6].ToString().Trim() == "finished") + // { + // modelOnly.CompleteTime = DateTime.Now; + // } + // modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + // //if (modelOnly.FINAL_Status.ToLower() == "finished") + // //{ + // // modelOnly.CompleteTime = DateTime.Now; + // //} + // Funs.DB.SubmitChanges(); + //} } } if (list.Count > 0) diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 62773263..91bd026b 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -391581,6 +391581,12 @@ namespace Model private System.Nullable _CompleteTime; + private string _Installation; + + private string _Debugging; + + private string _Acceptancecheck; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -391605,6 +391611,12 @@ namespace Model partial void OnFINAL_StatusChanged(); partial void OnCompleteTimeChanging(System.Nullable value); partial void OnCompleteTimeChanged(); + partial void OnInstallationChanging(string value); + partial void OnInstallationChanged(); + partial void OnDebuggingChanging(string value); + partial void OnDebuggingChanged(); + partial void OnAcceptancecheckChanging(string value); + partial void OnAcceptancecheckChanged(); #endregion public Transfer_Firefighting() @@ -391812,6 +391824,66 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Installation", DbType="NVarChar(50)")] + public string Installation + { + get + { + return this._Installation; + } + set + { + if ((this._Installation != value)) + { + this.OnInstallationChanging(value); + this.SendPropertyChanging(); + this._Installation = value; + this.SendPropertyChanged("Installation"); + this.OnInstallationChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Debugging", DbType="NVarChar(50)")] + public string Debugging + { + get + { + return this._Debugging; + } + set + { + if ((this._Debugging != value)) + { + this.OnDebuggingChanging(value); + this.SendPropertyChanging(); + this._Debugging = value; + this.SendPropertyChanged("Debugging"); + this.OnDebuggingChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Acceptancecheck", DbType="NVarChar(50)")] + public string Acceptancecheck + { + get + { + return this._Acceptancecheck; + } + set + { + if ((this._Acceptancecheck != value)) + { + this.OnAcceptancecheckChanging(value); + this.SendPropertyChanging(); + this._Acceptancecheck = value; + this.SendPropertyChanged("Acceptancecheck"); + this.OnAcceptancecheckChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -393451,6 +393523,12 @@ namespace Model private System.Nullable _CompleteTime; + private string _Ndt; + + private string _Flushing; + + private string _RunningTest; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -393475,6 +393553,12 @@ namespace Model partial void OnFINAL_StatusChanged(); partial void OnCompleteTimeChanging(System.Nullable value); partial void OnCompleteTimeChanged(); + partial void OnNdtChanging(string value); + partial void OnNdtChanged(); + partial void OnFlushingChanging(string value); + partial void OnFlushingChanged(); + partial void OnRunningTestChanging(string value); + partial void OnRunningTestChanged(); #endregion public Transfer_Plumbing() @@ -393682,6 +393766,66 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ndt", DbType="NVarChar(50)")] + public string Ndt + { + get + { + return this._Ndt; + } + set + { + if ((this._Ndt != value)) + { + this.OnNdtChanging(value); + this.SendPropertyChanging(); + this._Ndt = value; + this.SendPropertyChanged("Ndt"); + this.OnNdtChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Flushing", DbType="NVarChar(50)")] + public string Flushing + { + get + { + return this._Flushing; + } + set + { + if ((this._Flushing != value)) + { + this.OnFlushingChanging(value); + this.SendPropertyChanging(); + this._Flushing = value; + this.SendPropertyChanged("Flushing"); + this.OnFlushingChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RunningTest", DbType="NVarChar(50)")] + public string RunningTest + { + get + { + return this._RunningTest; + } + set + { + if ((this._RunningTest != value)) + { + this.OnRunningTestChanging(value); + this.SendPropertyChanging(); + this._RunningTest = value; + this.SendPropertyChanged("RunningTest"); + this.OnRunningTestChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -395801,6 +395945,14 @@ namespace Model private System.Nullable _CompleteTime; + private string _Installation; + + private string _Communication; + + private string _CableLaying; + + private string _FunctionTest; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -395825,6 +395977,14 @@ namespace Model partial void OnFINAL_StatusChanged(); partial void OnCompleteTimeChanging(System.Nullable value); partial void OnCompleteTimeChanged(); + partial void OnInstallationChanging(string value); + partial void OnInstallationChanged(); + partial void OnCommunicationChanging(string value); + partial void OnCommunicationChanged(); + partial void OnCableLayingChanging(string value); + partial void OnCableLayingChanged(); + partial void OnFunctionTestChanging(string value); + partial void OnFunctionTestChanged(); #endregion public Transfer_Telecom() @@ -396032,6 +396192,86 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Installation", DbType="NVarChar(50)")] + public string Installation + { + get + { + return this._Installation; + } + set + { + if ((this._Installation != value)) + { + this.OnInstallationChanging(value); + this.SendPropertyChanging(); + this._Installation = value; + this.SendPropertyChanged("Installation"); + this.OnInstallationChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Communication", DbType="NVarChar(50)")] + public string Communication + { + get + { + return this._Communication; + } + set + { + if ((this._Communication != value)) + { + this.OnCommunicationChanging(value); + this.SendPropertyChanging(); + this._Communication = value; + this.SendPropertyChanged("Communication"); + this.OnCommunicationChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CableLaying", DbType="NVarChar(50)")] + public string CableLaying + { + get + { + return this._CableLaying; + } + set + { + if ((this._CableLaying != value)) + { + this.OnCableLayingChanging(value); + this.SendPropertyChanging(); + this._CableLaying = value; + this.SendPropertyChanged("CableLaying"); + this.OnCableLayingChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FunctionTest", DbType="NVarChar(50)")] + public string FunctionTest + { + get + { + return this._FunctionTest; + } + set + { + if ((this._FunctionTest != value)) + { + this.OnFunctionTestChanging(value); + this.SendPropertyChanging(); + this._FunctionTest = value; + this.SendPropertyChanged("FunctionTest"); + this.OnFunctionTestChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged;