2023-10-12

This commit is contained in:
2023-10-12 19:33:22 +08:00
parent 7d87e48818
commit d1c7977da2
24 changed files with 688 additions and 237 deletions
@@ -1,4 +1,5 @@
using BLL;
using FineUIPro.Web.DataShow;
using System;
using System.Collections.Generic;
using System.Data;
@@ -52,7 +53,11 @@ namespace FineUIPro.Web.CQMS.Check
Funs.FineUIPleaseSelect(this.dpHandelStatus);
btnNew.OnClientClick = Window1.GetShowReference("ChecklistEdit.aspx") + "return false;";
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, CurrUser.UnitId))
{
drpSponsorUnit.SelectedValue = CurrUser.UnitId;
drpSponsorUnit.Readonly = true;
}
// 绑定表格
BindGrid();
@@ -1,5 +1,6 @@
using Apache.NMS.ActiveMQ.Threads;
using BLL;
using FineUIPro.Web.DataShow;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -296,7 +297,8 @@ namespace FineUIPro.Web.CQMS.Check
QuestionImg = 0;
CheckControlService.Init(drpHandleType, State, false);
string code = ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectCode + "-06-CM03-XJ-";
txtDocCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5", "dbo.Check_CheckControl", "DocCode", code);
txtDocCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Check_CheckControl", "DocCode", CurrUser.LoginProjectId, code);
var mainUnit = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId,Const.ProjectUnitType_1)[0];
if (mainUnit != null)
{
@@ -41,10 +41,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
BLL.UnitService.GetUnit(this.drpUnitIds, this.CurrUser.LoginProjectId, false);
LoadAuditSelect();
this.agree.Hidden = true;
this.options.Hidden = true;
this.btnSave.Hidden = true;
this.btnSubmit.Hidden = true;
this.options.Hidden = true;
this.DesignChangeOrderId = Request.Params["DesignChangeOrderId"];
Model.Comprehensive_DesignChangeOrder designChangeOrder = BLL.DesignChangeOrderService.GetDesignChangeOrderById(this.DesignChangeOrderId);
if (designChangeOrder != null)
@@ -112,10 +109,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
}
}
}
else
{
@@ -228,14 +228,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
result += (i + 2).ToString() + "," + "标识编号" + "," + "此项为必填项!" + "|";
}
else
{
var view = oldViewInfos.FirstOrDefault(x => x.RemarkCode == row12);
if (view != null)
{
result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row12 + "]已存在!" + "|";
}
}
//else
//{
// var view = oldViewInfos.FirstOrDefault(x => x.RemarkCode == row12);
// if (view != null)
// {
// result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row12 + "]已存在!" + "|";
// }
//}
}
else
@@ -398,7 +398,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
&& x.RemarkCode == pds.Rows[i][12].ToString().Trim()
).FirstOrDefault();
if (oldViewInfo == null)
if (oldViewInfo == null)//新增
{
Model.Comprehensive_InspectionEquipment Ins = new Model.Comprehensive_InspectionEquipment();
Ins.ProjectId = this.CurrUser.LoginProjectId;
@@ -428,9 +428,33 @@ namespace FineUIPro.Web.CQMS.Comprehensive
BLL.InspectionEquipmentService.AddInspectionEquipment(Ins);
}
else
else //修改
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位报验编号已存在!" + "|";
oldViewInfo.ProjectId = this.CurrUser.LoginProjectId;
oldViewInfo.UnitId = unitInfo.UnitId;
oldViewInfo.InspectionCode = pds.Rows[i][1].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][2].ToString().Trim()))
{
oldViewInfo.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][2].ToString().Trim()).CNProfessionalId;
}
oldViewInfo.EquipmentNO = pds.Rows[i][3].ToString().Trim();
oldViewInfo.InspectionName = pds.Rows[i][4].ToString().Trim();
oldViewInfo.Specifications = pds.Rows[i][5].ToString().Trim();
oldViewInfo.Supplier = pds.Rows[i][6].ToString().Trim();
oldViewInfo.Counts = pds.Rows[i][7].ToString().Trim();
oldViewInfo.Unit = pds.Rows[i][8].ToString().Trim();
oldViewInfo.SamplingCount = pds.Rows[i][9].ToString().Trim();
oldViewInfo.SamplingResult = pds.Rows[i][10].ToString().Trim() == "合格" ? "1" : "2";
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
{
oldViewInfo.InspectionDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
}
oldViewInfo.RemarkCode = pds.Rows[i][12].ToString().Trim();
oldViewInfo.CompileMan = this.CurrUser.UserId;
oldViewInfo.CompileDate = DateTime.Now.Date;
BLL.InspectionEquipmentService.UpdateInspectionEquipment(oldViewInfo);
//result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位报验编号已存在!" + "|";
}
}
@@ -25,16 +25,20 @@
<f:DropDownList ID="drpCNProfessionalId" runat="server" Label="专业" LabelAlign="Right" LabelWidth="120px"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<f:FormRow ColumnWidths="50% 25% 25%">
<Items>
<f:TextBox ID="txtInspectionName" runat="server" Label="名称" MaxLength="300" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:TextBox ID="txtSpecifications" runat="server" Label="规格" MaxLength="300" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:TextBox ID="txtSpecifications" runat="server" Label="规格" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:DropDownList ID="drpEquipmentOrMatail" runat="server" Label="设备/材料" LabelAlign="Right" ShowRedStar="true" LabelWidth="120px">
<f:ListItem Value="设备" Text="设备" />
<f:ListItem Value="材料" Text="材料" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50% 30% 20%">
<f:FormRow ColumnWidths="50% 25% 25%">
<Items>
<f:TextBox ID="txtSupplier" runat="server" Label="供货厂商" MaxLength="300" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:NumberBox ID="txtCounts" Label="本次数量" runat="server" NoDecimal="false" DecimalPrecision="3" NoNegative="true" LabelAlign="Right" LabelWidth="120px">
<f:NumberBox ID="txtCounts" Label="本次数量" runat="server" NoDecimal="false" DecimalPrecision="3" NoNegative="true" LabelAlign="Right" LabelWidth="120px">
</f:NumberBox>
<f:TextBox ID="txtUnit" runat="server" Label="单位" MaxLength="50" LabelAlign="Right" LabelWidth="70px"></f:TextBox>
</Items>
@@ -64,6 +64,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
this.txtCounts.Text = Convert.ToString(inspectionEquipment.Counts);
}
this.txtUnit.Text = inspectionEquipment.Unit;
if (!string.IsNullOrEmpty(inspectionEquipment.EquipmentOrMatail))
{
this.drpEquipmentOrMatail.SelectedValue = inspectionEquipment.EquipmentOrMatail;
}
if (inspectionEquipment.SamplingCount != null)
{
this.txtSamplingCount.Text = Convert.ToString(inspectionEquipment.SamplingCount);
@@ -256,7 +261,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
newInspectionEquipment.Unit = this.txtUnit.Text.Trim();
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
newInspectionEquipment.UsedPlace = this.txtUsedPlace.Text.Trim();
newInspectionEquipment.EquipmentOrMatail = drpEquipmentOrMatail.SelectedValue;
if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue))
{
newInspectionEquipment.AuditMan = drpAudit.SelectedValue;
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.Comprehensive {
public partial class InspectionEquipmentEdit {
namespace FineUIPro.Web.CQMS.Comprehensive
{
public partial class InspectionEquipmentEdit
{
/// <summary>
/// form1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// drpUnitId 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnitId;
/// <summary>
/// txtInspectionCode 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionCode;
/// <summary>
/// txtEquipmentNo 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentNo;
/// <summary>
/// drpCNProfessionalId 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCNProfessionalId;
/// <summary>
/// txtInspectionName 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionName;
/// <summary>
/// txtSpecifications 控件。
/// </summary>
@@ -92,7 +94,16 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSpecifications;
/// <summary>
/// drpEquipmentOrMatail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpEquipmentOrMatail;
/// <summary>
/// txtSupplier 控件。
/// </summary>
@@ -101,7 +112,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSupplier;
/// <summary>
/// txtCounts 控件。
/// </summary>
@@ -110,7 +121,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtCounts;
/// <summary>
/// txtUnit 控件。
/// </summary>
@@ -119,7 +130,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUnit;
/// <summary>
/// txtSamplingCount 控件。
/// </summary>
@@ -128,7 +139,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtSamplingCount;
/// <summary>
/// drpSamplingResult 控件。
/// </summary>
@@ -137,7 +148,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpSamplingResult;
/// <summary>
/// drpAttribute 控件。
/// </summary>
@@ -146,7 +157,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpAttribute;
/// <summary>
/// txtInspectionDate 控件。
/// </summary>
@@ -155,7 +166,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtInspectionDate;
/// <summary>
/// txtRemarkCode 控件。
/// </summary>
@@ -164,7 +175,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemarkCode;
/// <summary>
/// txtUsedPlace 控件。
/// </summary>
@@ -173,7 +184,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUsedPlace;
/// <summary>
/// Panel2 控件。
/// </summary>
@@ -182,7 +193,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel2;
/// <summary>
/// Label1 控件。
/// </summary>
@@ -191,7 +202,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// btnAttach 控件。
/// </summary>
@@ -200,7 +211,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach;
/// <summary>
/// drpAudit 控件。
/// </summary>
@@ -209,7 +220,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpAudit;
/// <summary>
/// agree 控件。
/// </summary>
@@ -218,7 +229,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow agree;
/// <summary>
/// rblIsAgree 控件。
/// </summary>
@@ -227,7 +238,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rblIsAgree;
/// <summary>
/// options 控件。
/// </summary>
@@ -236,7 +247,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow options;
/// <summary>
/// txtidea 控件。
/// </summary>
@@ -245,7 +256,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtidea;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -254,7 +265,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdAttachUrl 控件。
/// </summary>
@@ -263,7 +274,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdAttachUrl;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -272,7 +283,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnSubmit 控件。
/// </summary>
@@ -281,7 +292,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSubmit;
/// <summary>
/// WindowAtt 控件。
/// </summary>
@@ -431,59 +431,115 @@ namespace FineUIPro.Web.CQMS.Comprehensive
for (int i = 0; i < ir; i++)
{
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
string row0 = pds.Rows[i][0].ToString().Trim();
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
if (unitInfo != null && !string.IsNullOrEmpty(row0))
{
Model.Comprehensive_InspectionMachine Ins = new Model.Comprehensive_InspectionMachine();
Ins.ProjectId = this.CurrUser.LoginProjectId;
Ins.UnitId = unitInfo.UnitId;
Ins.InspectionMachineCode = pds.Rows[i][1].ToString().Trim();
Ins.InspectionMachineName = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
oldViewInfo = oldViewInfos.FirstOrDefault(x => x.UnitId == unitInfo.UnitId
&& x.InspectionMachineCode == pds.Rows[i][1].ToString().Trim());
if (oldViewInfo==null)
{
Ins.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
}
Model.Comprehensive_InspectionMachine Ins = new Model.Comprehensive_InspectionMachine();
Ins.ProjectId = this.CurrUser.LoginProjectId;
Ins.UnitId = unitInfo.UnitId;
Ins.InspectionMachineCode = pds.Rows[i][1].ToString().Trim();
Ins.InspectionMachineName = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
{
Ins.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
}
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
{
Ins.InspectionType = pds.Rows[i][4].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
{
Ins.InspectionType = pds.Rows[i][4].ToString().Trim();
}
else
{
Ins.InspectionType = "施工";
}
Ins.SpecificationModel = pds.Rows[i][5].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
{
Ins.NextTestDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());
}
Ins.TestCycle = pds.Rows[i][7].ToString().Trim();
Ins.IsOnSite = pds.Rows[i][8].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
{
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][9].ToString().Trim());
}
Ins.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
{
Ins.UnitsCount = Convert.ToInt32(pds.Rows[i][11].ToString().Trim());
}
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
{
Ins.LeaveDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
}
Ins.InspectionMachineId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionMachine));
Ins.CompileMan = this.CurrUser.UserId;
Ins.CompileDate = DateTime.Now.Date;
BLL.InspectionMachineService.AddInspectionMachine(Ins);
}
else
{
Ins.InspectionType = "施工";
oldViewInfo.ProjectId = this.CurrUser.LoginProjectId;
oldViewInfo.UnitId = unitInfo.UnitId;
oldViewInfo.InspectionMachineCode = pds.Rows[i][1].ToString().Trim();
oldViewInfo.InspectionMachineName = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
{
oldViewInfo.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
}
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
{
oldViewInfo.InspectionType = pds.Rows[i][4].ToString().Trim();
}
else
{
oldViewInfo.InspectionType = "施工";
}
oldViewInfo.SpecificationModel = pds.Rows[i][5].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
{
oldViewInfo.NextTestDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());
}
oldViewInfo.TestCycle = pds.Rows[i][7].ToString().Trim();
oldViewInfo.IsOnSite = pds.Rows[i][8].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
{
oldViewInfo.InspectionDate = Convert.ToDateTime(pds.Rows[i][9].ToString().Trim());
}
oldViewInfo.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
{
oldViewInfo.UnitsCount = Convert.ToInt32(pds.Rows[i][11].ToString().Trim());
}
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
{
oldViewInfo.LeaveDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
}
oldViewInfo.CompileMan = this.CurrUser.UserId;
oldViewInfo.CompileDate = DateTime.Now.Date;
BLL.InspectionMachineService.UpdateInspectionMachine(oldViewInfo);
}
Ins.SpecificationModel = pds.Rows[i][5].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
{
Ins.NextTestDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());
}
Ins.TestCycle = pds.Rows[i][7].ToString().Trim();
Ins.IsOnSite = pds.Rows[i][8].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
{
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][9].ToString().Trim());
}
Ins.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
{
Ins.UnitsCount = Convert.ToInt32(pds.Rows[i][11].ToString().Trim());
}
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
{
Ins.LeaveDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
}
Ins.InspectionMachineId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionMachine));
Ins.CompileMan = this.CurrUser.UserId;
Ins.CompileDate = DateTime.Now.Date;
BLL.InspectionMachineService.AddInspectionMachine(Ins);
}
else
@@ -181,97 +181,100 @@ namespace FineUIPro.Web.CQMS.Comprehensive
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
if (unitInfo != null && !string.IsNullOrEmpty(row0))
{
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
/*oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
&& x.PersonName == pds.Rows[i][2].ToString().Trim()
&& x.InspectionPersonCode == pds.Rows[i][1].ToString().Trim()
).FirstOrDefault();
if (oldViewInfo == null)
{
string row1 = pds.Rows[i][1].ToString();
if (string.IsNullOrEmpty(row1))
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "此项为必填项!" + "|";
}
string row2 = pds.Rows[i][2].ToString();
if (string.IsNullOrEmpty(row2))
{
result += (i + 2).ToString() + "," + "姓名" + "," + "此项为必填项!" + "|";
}
string row3 = pds.Rows[i][3].ToString();
if (!string.IsNullOrEmpty(row3))
{
var cn = cns.Where(x => x.ProfessionalName == row3.Trim()).FirstOrDefault();
if (cn == null)
{
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row3 + "]不存在!" + "|";
}
}
string row4 = pds.Rows[i][4].ToString();
if (!string.IsNullOrEmpty(row4))
{
var post = posts.Where(x => x.PostName == row4.Trim()).FirstOrDefault();
if (post == null)
{
result += (i + 2).ToString() + "," + "工种" + "," + "[" + row4 + "]不存在!" + "|";
}
}
string row7 = pds.Rows[i][7].ToString();
if (!string.IsNullOrEmpty(row7))
{
try
{
DateTime date = Convert.ToDateTime(row7.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "有效期" + "," + "[" + row7 + "]错误!" + "|";
}
}
string row8 = pds.Rows[i][8].ToString();
if (!string.IsNullOrEmpty(row8))
{
try
{
DateTime date = Convert.ToDateTime(row8.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "批准时间" + "," + "[" + row8 + "]错误!" + "|";
}
}
string row9 = pds.Rows[i][9].ToString().Trim();
if (!string.IsNullOrEmpty(row9))
{
if (row9 != "是" && row9 != "否")
{
result += (i + 2).ToString() + "," + "是否在场" + "," + "[" + row9 + "]错误!" + "|";
}
}
string row10 = pds.Rows[i][10].ToString();
if (!string.IsNullOrEmpty(row10))
{
try
{
DateTime date = Convert.ToDateTime(row10.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row10 + "]错误!" + "|";
}
}
}
else
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位人员报验编号已存在!" + "|";
}*/
string row1 = pds.Rows[i][1].ToString();
if (string.IsNullOrEmpty(row1))
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "此项为必填项!" + "|";
}
string row2 = pds.Rows[i][2].ToString();
if (string.IsNullOrEmpty(row2))
{
result += (i + 2).ToString() + "," + "姓名" + "," + "此项为必填项!" + "|";
}
string row3 = pds.Rows[i][3].ToString();
if (!string.IsNullOrEmpty(row3))
{
var cn = cns.Where(x => x.ProfessionalName == row3.Trim()).FirstOrDefault();
if (cn == null)
{
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row3 + "]不存在!" + "|";
}
}
string row4 = pds.Rows[i][4].ToString();
if (!string.IsNullOrEmpty(row4))
{
var post = posts.Where(x => x.PostName == row4.Trim()).FirstOrDefault();
if (post == null)
{
result += (i + 2).ToString() + "," + "工种" + "," + "[" + row4 + "]不存在!" + "|";
}
}
string row7 = pds.Rows[i][7].ToString();
if (!string.IsNullOrEmpty(row7))
{
try
{
DateTime date = Convert.ToDateTime(row7.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "有效期" + "," + "[" + row7 + "]错误!" + "|";
}
}
string row8 = pds.Rows[i][8].ToString();
if (!string.IsNullOrEmpty(row8))
{
try
{
DateTime date = Convert.ToDateTime(row8.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "批准时间" + "," + "[" + row8 + "]错误!" + "|";
}
}
string row9 = pds.Rows[i][9].ToString().Trim();
if (!string.IsNullOrEmpty(row9))
{
if (row9 != "是" && row9 != "否")
{
result += (i + 2).ToString() + "," + "是否在场" + "," + "[" + row9 + "]错误!" + "|";
}
}
string row10 = pds.Rows[i][10].ToString();
if (!string.IsNullOrEmpty(row10))
{
try
{
DateTime date = Convert.ToDateTime(row10.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row10 + "]错误!" + "|";
}
}
}
else
@@ -496,7 +499,83 @@ namespace FineUIPro.Web.CQMS.Comprehensive
}
else
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位人员报验编号已存在!" + "|";
oldViewInfo.ProjectId = this.CurrUser.LoginProjectId;
oldViewInfo.UnitId = unitInfo.UnitId;
oldViewInfo.InspectionPersonCode = pds.Rows[i][1].ToString().Trim();
oldViewInfo.PersonName = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
{
oldViewInfo.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
}
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
{
oldViewInfo.PostId = Funs.DB.Base_Post.First(e => e.PostName == pds.Rows[i][4].ToString().Trim()).PostId;
}
oldViewInfo.CertificateNumber = pds.Rows[i][5].ToString().Trim();
oldViewInfo.QualifiedProjectCode = pds.Rows[i][6].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][7].ToString().Trim()))
{
oldViewInfo.ValidityDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());
}
if (!string.IsNullOrEmpty(pds.Rows[i][8].ToString().Trim()))
{
oldViewInfo.ApprovalTime = Convert.ToDateTime(pds.Rows[i][8].ToString().Trim());
}
oldViewInfo.IsOnSite = pds.Rows[i][9].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][10].ToString().Trim()))
{
oldViewInfo.DepartureTime = Convert.ToDateTime(pds.Rows[i][10].ToString().Trim());
}
oldViewInfo.Remark = pds.Rows[i][11].ToString().Trim();
oldViewInfo.CompileMan = this.CurrUser.UserId;
oldViewInfo.CompileDate = DateTime.Now.Date;
oldViewInfo.IsTrain = true;
BLL.InspectionPersonService.UpdateInspectionPerson(oldViewInfo);
if (pds.Rows[i][4].ToString().Trim() == "焊工")
{
var welder = PersonManageService.GetBSWelderByProjectIdUnitIdAndWED_Code(CurrUser.LoginProjectId, oldViewInfo.UnitId, pds.Rows[i][1].ToString().Trim());
if (welder==null)
{
welder = new Model.BS_Welder();
welder.WED_Unit = oldViewInfo.UnitId;
welder.WED_Name = oldViewInfo.PersonName;
welder.WED_Code = pds.Rows[i][1].ToString().Trim();
welder.LimitDate = oldViewInfo.ValidityDate;
welder.LeaveDate = oldViewInfo.DepartureTime; // Convert.ToDateTime(this.txtDepartureTime.Text.ToString());
welder.PostDate = oldViewInfo.ApprovalTime;// Convert.ToDateTime(this.txtApprovalTime.Text.ToString());
welder.WED_WorkCode = oldViewInfo.CertificateNumber;// this.txtCertificateNumber.Text.Trim();
welder.WED_Class = oldViewInfo.QualifiedProjectCode;// this.txtQualifiedProjectCode.Text.Trim();
welder.WED_IfOnGuard = oldViewInfo.IsOnSite;
welder.WED_Remark = oldViewInfo.Remark;
welder.ProjectId = this.CurrUser.LoginProjectId;
// 焊工部分
BLL.PersonManageService.AddBSWelder(welder);
}
else
{
welder.WED_Unit = oldViewInfo.UnitId;
welder.WED_Name = oldViewInfo.PersonName;
welder.WED_Code = pds.Rows[i][1].ToString().Trim();
welder.LimitDate = oldViewInfo.ValidityDate;
welder.LeaveDate = oldViewInfo.DepartureTime; // Convert.ToDateTime(this.txtDepartureTime.Text.ToString());
welder.PostDate = oldViewInfo.ApprovalTime;// Convert.ToDateTime(this.txtApprovalTime.Text.ToString());
welder.WED_WorkCode = oldViewInfo.CertificateNumber;// this.txtCertificateNumber.Text.Trim();
welder.WED_Class = oldViewInfo.QualifiedProjectCode;// this.txtQualifiedProjectCode.Text.Trim();
welder.WED_IfOnGuard = oldViewInfo.IsOnSite;
welder.WED_Remark = oldViewInfo.Remark;
welder.ProjectId = this.CurrUser.LoginProjectId;
// 焊工部分
BLL.PersonManageService.UpdateBSWelder(welder);
}
}
//result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位人员报验编号已存在!" + "|";
}
}
else
@@ -43,8 +43,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
this.agree.Hidden = true;
this.options.Hidden = true;
this.btnSave.Hidden = true;
this.btnSubmit.Hidden = true;
this.NCRManagementId = Request.Params["NCRManagementId"];
Model.Comprehensive_NCRManagement nCRManagement = BLL.NCRManagementService.GetNCRManagementById(this.NCRManagementId);
if (nCRManagement != null)
@@ -76,8 +76,8 @@ namespace FineUIPro.Web.CQMS.ManageReport
checkStatisc.TotalCheckNum = totalManagementList.Count();
checkStatisc.OKNum = managementList.Count(x => x.ApprovalDate != null);
checkStatisc.TotalOKNum = totalManagementList.Count(x => x.ApprovalDate != null);
checkStatisc.OneOKRate = managementList.Count(x => x.HandleState == "3").ToString(); //当期完成数
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.HandleState == "3").ToString(); //累计完成数
checkStatisc.OneOKRate = managementList.Count(x => x.Status == "3").ToString(); //当期完成数
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.Status == "3").ToString(); //累计完成数
StatisticsList.Add(checkStatisc);
i++;
}
@@ -130,8 +130,8 @@ namespace FineUIPro.Web.CQMS.ManageReport
checkStatisc.TotalCheckNum = totalManagementList.Count();
checkStatisc.OKNum = managementList.Count(x => x.ApprovalDate != null);
checkStatisc.TotalOKNum = totalManagementList.Count(x => x.ApprovalDate != null);
checkStatisc.OneOKRate = managementList.Count(x => x.HandleState == "3").ToString(); //当期完成数
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.HandleState == "3").ToString(); //累计完成数
checkStatisc.OneOKRate = managementList.Count(x => x.Status == "3").ToString(); //当期完成数
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.Status == "3").ToString(); //累计完成数
StatisticsList.Add(checkStatisc);
i++;
}
@@ -882,12 +882,12 @@ namespace FineUIPro.Web.CQMS.ManageReport
//当期集合
List<Model.Comprehensive_NCRManagement> managementList = BLL.NCRManagementService.GetNCRManagementListByUnitNameAndDate(this.CurrUser.LoginProjectId, item, startDate, endDate);
//累计集合
List<Model.Comprehensive_NCRManagement> sumManagementList = BLL.NCRManagementService.GetNCRManagementListByUnitNameAndDate(this.CurrUser.LoginProjectId, item, projectStartDate, endDate);
List<Model.Comprehensive_NCRManagement> sumManagementList = BLL.NCRManagementService.GetNCRManagementListByUnitNameAndDate(this.CurrUser.LoginProjectId, item, projectStartDate, DateTime.Now);
Model.NCRReportStatisc NCRStatisc = new Model.NCRReportStatisc();
NCRStatisc.Num = i;
NCRStatisc.WorkName = BLL.UnitService.getUnitNamesUnitIds(item);
NCRStatisc.CurrentPeriodOkNum = managementList.Count(x => x.CompleteDate != null);
NCRStatisc.OKNum = sumManagementList.Count(x => x.CompleteDate != null);
NCRStatisc.CurrentPeriodOkNum = managementList.Count(x => x.Status == "3");
NCRStatisc.OKNum = sumManagementList.Count(x => x.Status == "3");
NCRStatisc.CheckNum = sumManagementList.Count;
if (NCRStatisc.CheckNum != 0)//被除数不能为零
{
@@ -921,6 +921,18 @@ namespace FineUIPro.Web.CQMS.ManageReport
}
StatisticsList.Add(StatisticsLast);
}
else
{
Model.NCRReportStatisc StatisticsLast = new Model.NCRReportStatisc();
StatisticsLast.Num = 0;
StatisticsLast.WorkName = "合计";
StatisticsLast.CurrentPeriodOkNum = 0;
StatisticsLast.OKNum = 0;
StatisticsLast.CheckNum = 0;
StatisticsLast.OKRate = "0%";
StatisticsList.Add(StatisticsLast);
}
this.gvNCRStatisc.DataSource = StatisticsList;
this.gvNCRStatisc.DataBind();
}
@@ -967,7 +979,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
foreach (var item in cNProfessionals)
{
//专业下所有集合
List<Model.Comprehensive_DesignChangeOrder> totalManagementList = BLL.DesignChangeOrderService.GetDesignChangeOrderListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, item.CNProfessionalId, projectStartDate, endDate);
List<Model.Comprehensive_DesignChangeOrder> totalManagementList = BLL.DesignChangeOrderService.GetDesignChangeOrderListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, item.CNProfessionalId, projectStartDate, DateTime.Now);
//专业下当期集合
List<Model.Comprehensive_DesignChangeOrder> managementList = BLL.DesignChangeOrderService.GetDesignChangeOrderListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, item.CNProfessionalId, startDate, endDate);
Model.CheckStatisc checkStatisc = new Model.CheckStatisc();
@@ -977,8 +989,8 @@ namespace FineUIPro.Web.CQMS.ManageReport
checkStatisc.TotalCheckNum = totalManagementList.Count();
checkStatisc.OKNum = managementList.Count(x => x.ApprovalDate != null);
checkStatisc.TotalOKNum = totalManagementList.Count(x => x.ApprovalDate != null);
checkStatisc.OneOKRate = managementList.Count(x => x.HandleState == "3").ToString(); //当期完成数
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.HandleState == "3").ToString(); //累计完成数
checkStatisc.OneOKRate = managementList.Count(x => x.Status == "3").ToString(); //当期完成数
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.Status == "3").ToString(); //累计完成数
if (checkStatisc.CheckNum > 0 || checkStatisc.TotalCheckNum > 0 || checkStatisc.OKNum > 0 || checkStatisc.TotalOKNum > 0)
{
StatisticsList.Add(checkStatisc);
@@ -1163,24 +1175,36 @@ namespace FineUIPro.Web.CQMS.ManageReport
UnitName=BLL.UnitService.GetUnitNameByUnitId(g.Key.UnitId),
Count = g.Key.UnitId.Count(),
};
var total = from x in db.Solution_CQMSConstructSolution
where x.CompileDate >= projectStartDate && x.CompileDate <= DateTime.Now
group x by new { x.UnitId, ProjectId = x.ProjectId == project.ProjectId }
into g
select new
{
UnitName = BLL.UnitService.GetUnitNameByUnitId(g.Key.UnitId),
Count = g.Key.UnitId.Count(),
};
var result = q.ToList().Select((item, index) => new
{
Index = index + 1,
item.UnitName,
item.Count
item.Count,
AllCount= (int)total.ToList().Where(x => x.UnitName == item.UnitName).Select(x=>x.Count).FirstOrDefault()
});
if (result.Count()>0) //增加总计
{
int totalCount = result.Sum(item => item.Count);
int totalAllCount = result.Sum(item => item.AllCount);
result = result.Concat(new[]
{
new
{
Index = result.Count() + 1,
UnitName = "合计",
Count = totalCount
Count = totalCount,
AllCount= totalAllCount
}
});
}
@@ -1194,7 +1218,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
{
if (e.Row.RowType == DataControlRowType.Header)
{
string headerStr = "序号#报审单位#完成数量";
string headerStr = "序号#报审单位#审批完成数量#总数量";
DynamicTHeaderHepler dHelper = new DynamicTHeaderHepler();
dHelper.SplitTableHeader(e.Row, headerStr);
}
@@ -74,8 +74,8 @@ namespace FineUIPro.Web.CQMS.ManageReport
NCRStatisc.Num = i;
NCRStatisc.WorkName = BLL.UnitService.getUnitNamesUnitIds(item);
NCRStatisc.CheckNum = managementList.Count();
NCRStatisc.OKNum = managementList.Count(x => x.CompleteDate != null);
NCRStatisc.NotOKNum = managementList.Count(x => x.CompleteDate == null);
NCRStatisc.OKNum = managementList.Count(x => x.Status == "3");
NCRStatisc.NotOKNum = managementList.Count(x => x.Status != "3");
NCRStatisc.Remark = "";
if (NCRStatisc.CheckNum != 0)//被除数不能为零
{
@@ -100,8 +100,8 @@ namespace FineUIPro.Web.CQMS.ManageReport
NCRStatisc.Num = i;
NCRStatisc.WorkName = item.ProfessionalName;
NCRStatisc.CheckNum = managementList.Count();
NCRStatisc.OKNum = managementList.Count(x => x.CompleteDate != null);
NCRStatisc.NotOKNum = managementList.Count(x => x.CompleteDate == null);
NCRStatisc.OKNum = managementList.Count(x => x.Status == "3");
NCRStatisc.NotOKNum = managementList.Count(x => x.Status != "3");
NCRStatisc.Remark = "";
if (NCRStatisc.CheckNum != 0)//被除数不能为零
{
@@ -1108,10 +1108,35 @@ namespace FineUIPro.Web.CQMS.Solution
{
HFConstructSolutionId.Text = SQLHelper.GetNewID(typeof(Model.Solution_CQMSConstructSolution));
}
string id = HFConstructSolutionId.Text;
Model.Solution_CQMSConstructSolution constructSolution = CQMSConstructSolutionService.GetConstructSolutionByConstructSolutionId(id);
if (constructSolution.State == Const.CQMSConstructSolution_Audit || constructSolution.State == Const.CQMSConstructSolution_ReCompile)
{
Model.Solution_CQMSConstructSolutionApprove approve = CQMSConstructSolutionApproveService.GetConstructSolutionApproveByApproveMan(id, CurrUser.UserId);
if (approve != null || CurrUser.UserId == Const.sysglyId)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}",
ContactImg, HFConstructSolutionId.Text, Const.CQMSConstructSolutionMenuId)));
}
else
{
if (!constructSolution.CompileMan.Equals(CurrUser.UserId))
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}&&editorMode={3}",
ContactImg, HFConstructSolutionId.Text, Const.CQMSConstructSolutionMenuId,"view")));
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}",
ContactImg, HFConstructSolutionId.Text, Const.CQMSConstructSolutionMenuId)));
}
}
else
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}",
ContactImg, HFConstructSolutionId.Text, Const.CQMSConstructSolutionMenuId)));
}
}
protected void btnapprove_Click(object sender, EventArgs e)