焊接管理,补充公司级树

This commit is contained in:
2025-04-14 15:31:57 +08:00
parent c8b553efc6
commit bb10b1f54e
111 changed files with 6980 additions and 4039 deletions
@@ -1,17 +1,11 @@
using BLL;
using System;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using Newtonsoft.Json.Linq;
using System.IO;
using NPOI.XSSF.UserModel;
using NPOI.SS.UserModel;
using System.Runtime.Serialization;
using NPOI.SS.Util;
using NPOI.HSSF.UserModel;
namespace FineUIPro.Web.HJGL.RepairManage
{
@@ -19,6 +13,20 @@ namespace FineUIPro.Web.HJGL.RepairManage
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 委托主键
/// </summary>
public string CH_TrustID
@@ -49,46 +57,31 @@ namespace FineUIPro.Web.HJGL.RepairManage
{
if (!IsPostBack)
{
//施工单位、装置
//if (BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId) == null || BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId).UnitTypeId == BLL.Const.ProjectUnitType_1 || BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId).UnitTypeId == BLL.Const.ProjectUnitType_5)
//{
// BLL.UnitService.InitUnitNameByUnitTypeDropDownList(this.drpCH_TrustUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
// BLL.Project_InstallationService.InitInstallationDropDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, true);
//}
//else
//{
// BLL.UnitService.InitSubUnitNameDownList(this.drpCH_TrustUnit, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
// BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
//}
var pUnit = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
if (pUnit != null)
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.drpCH_TrustUnit.DataTextField = "UnitName";
this.drpCH_TrustUnit.DataValueField = "UnitId";
this.drpCH_TrustUnit.DataSource = pUnit;
this.drpCH_TrustUnit.DataBind();
this.drpCH_TrustUnit.SelectedValue = this.CurrUser.UnitId;
if(CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && CurrUser.UserId != Const.hfnbdId)
{
this.drpCH_TrustUnit.Enabled = false;
}
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpCH_TrustUnit.SelectedValue, true);
this.drpInstallationId.SelectedIndex = 0;
this.ProjectId = Request.Params["projectId"];
}
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
BLL.Base_DetectionRateService.InitDetectionRateDropDownList(this.drpCH_NDTRate, true);//探伤比例
BLL.Base_DetectionTypeService.InitDetectionTypeDropDownList(this.drpCH_NDTMethod, true);//检测方法
BLL.UserService.InitUserDropDownList(this.drpCH_TrustMan, this.CurrUser.LoginProjectId, true);//委托人
//合格等级
this.drpCH_AcceptGrade.DataTextField = "Text";
this.drpCH_AcceptGrade.DataValueField = "Value";
this.drpCH_AcceptGrade.DataSource = BLL.DropListService.HJGL_GetAcceptGradeList();
this.drpCH_AcceptGrade.DataBind();
Funs.FineUIPleaseSelect(this.drpCH_AcceptGrade);
BLL.UserService.InitUserDropDownList(this.drpCH_Tabler, this.CurrUser.LoginProjectId, true);//制单人
BLL.Base_GrooveTypeService.InitGrooveTypeDropDownList(this.drpCH_SlopeType, true);//坡口类型
BLL.Base_WeldingMethodService.InitWeldingMethodDropDownList(this.drpCH_WeldMethod, true);//焊接方法
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpCH_CheckUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_5, true);//检测单位
this.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
this.txtCH_TrustDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
@@ -100,6 +93,56 @@ namespace FineUIPro.Web.HJGL.RepairManage
this.InitTreeMenu();
}
}
private void InitDropDownList()
{
//施工单位、装置
//if (BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId) == null || BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId).UnitTypeId == BLL.Const.ProjectUnitType_1 || BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId).UnitTypeId == BLL.Const.ProjectUnitType_5)
//{
// BLL.UnitService.InitUnitNameByUnitTypeDropDownList(this.drpCH_TrustUnit, this.ProjectId, BLL.Const.ProjectUnitType_2, true);
// BLL.Project_InstallationService.InitInstallationDropDownList(this.drpInstallationId, this.ProjectId, true);
//}
//else
//{
// BLL.UnitService.InitSubUnitNameDownList(this.drpCH_TrustUnit, this.ProjectId, this.CurrUser.UnitId, true);
// BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.CurrUser.UnitId, true);
//}
var pUnit = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2);
if (pUnit != null)
{
this.drpCH_TrustUnit.DataTextField = "UnitName";
this.drpCH_TrustUnit.DataValueField = "UnitId";
this.drpCH_TrustUnit.DataSource = pUnit;
this.drpCH_TrustUnit.DataBind();
this.drpCH_TrustUnit.SelectedValue = this.CurrUser.UnitId;
if (CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && CurrUser.UserId != Const.hfnbdId)
{
this.drpCH_TrustUnit.Enabled = false;
}
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.drpCH_TrustUnit.SelectedValue, true);
this.drpInstallationId.SelectedIndex = 0;
}
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpCH_CheckUnit, this.ProjectId, BLL.Const.ProjectUnitType_5, true);//检测单位
BLL.UserService.InitUserDropDownList(this.drpCH_TrustMan, this.ProjectId, true);//委托人
BLL.UserService.InitUserDropDownList(this.drpCH_Tabler, this.ProjectId, true);//制单人
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
//if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
//{
// btnNew.Hidden = true;
//}
//this.GetButtonPower();
this.InitTreeMenu();
}
#endregion
#region --
@@ -108,6 +151,11 @@ namespace FineUIPro.Web.HJGL.RepairManage
/// </summary>
private void InitTreeMenu()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
if (!string.IsNullOrEmpty(this.txtReportDate.Text.Trim()))
{
DateTime? startTime = Funs.GetNewDateTime(this.txtReportDate.Text.Trim());
@@ -121,19 +169,19 @@ namespace FineUIPro.Web.HJGL.RepairManage
this.tvControlItem.Nodes.Add(rootNode);
List<Model.Base_Unit> units = null;
var unit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
var unit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, this.CurrUser.UnitId);
if (unit == null || unit.UnitType == BLL.Const.ProjectUnitType_1 || unit.UnitType == BLL.Const.ProjectUnitType_3)
{
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
{
units = (from x in Funs.DB.Base_Unit
join y in Funs.DB.ProjectData_WorkArea on x.UnitId equals y.UnitId
where (x.UnitId == this.CurrUser.UnitId || y.SupervisorUnitId == this.CurrUser.UnitId) && y.ProjectId == this.CurrUser.LoginProjectId
where (x.UnitId == this.CurrUser.UnitId || y.SupervisorUnitId == this.CurrUser.UnitId) && y.ProjectId == this.ProjectId
select x).Distinct().ToList();
}
else
{
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, "2");
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, "2");
}
}
else
@@ -144,13 +192,13 @@ namespace FineUIPro.Web.HJGL.RepairManage
if (!this.txtReportDate.Hidden)
{
trustLists = (from x in Funs.DB.CH_Trust
where x.CH_TrustType == "2" && x.ProjectId == this.CurrUser.LoginProjectId && x.CH_TrustDate >= startTime && x.CH_TrustDate < endTime
where x.CH_TrustType == "2" && x.ProjectId == this.ProjectId && x.CH_TrustDate >= startTime && x.CH_TrustDate < endTime
select x).ToList();
}
else
{
trustLists = (from x in Funs.DB.CH_Trust
where x.CH_TrustType == "2" && x.ProjectId == this.CurrUser.LoginProjectId && x.CH_TrustCode.Contains(this.txtSearchCode.Text.Trim())
where x.CH_TrustType == "2" && x.ProjectId == this.ProjectId && x.CH_TrustCode.Contains(this.txtSearchCode.Text.Trim())
select x).ToList();
}
if (units != null)
@@ -325,7 +373,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
}
if (!string.IsNullOrEmpty(trust.InstallationId))
{
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpCH_TrustUnit.SelectedValue, true);
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.drpCH_TrustUnit.SelectedValue, true);
this.drpInstallationId.SelectedValue = trust.InstallationId;
}
this.txtCH_TrustDate.Text = trust.CH_TrustDate.HasValue ? string.Format("{0:yyyy-MM-dd}", trust.CH_TrustDate) : "";
@@ -545,7 +593,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
Alert.ShowInTop("请选择探伤比例!", MessageBoxIcon.Warning);
return;
}
if (this.drpCH_NDTMethod.SelectedValue == BLL.Const._Null ||string.IsNullOrEmpty(this.drpCH_NDTMethod.SelectedValue))
if (this.drpCH_NDTMethod.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpCH_NDTMethod.SelectedValue))
{
Alert.ShowInTop("请选择检测方法!", MessageBoxIcon.Warning);
return;
@@ -560,11 +608,11 @@ namespace FineUIPro.Web.HJGL.RepairManage
Alert.ShowInTop("请选择检测单位!", MessageBoxIcon.Warning);
return;
}
string isoId = null;
//7表示无损委托单对应管线,True表示只对应一条管线
var sysSet = BLL.Project_SysSetService.GetSysSetBySetId("7", this.CurrUser.LoginProjectId);
if (sysSet != null&&sysSet.IsAuto.HasValue&&sysSet.IsAuto.Value)
var sysSet = BLL.Project_SysSetService.GetSysSetBySetId("7", this.ProjectId);
if (sysSet != null && sysSet.IsAuto.HasValue && sysSet.IsAuto.Value)
{
var isoNum = (from x in trustItems select x.ISO_IsoNo).Distinct();
if (isoNum.Count() > 1)
@@ -578,7 +626,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
}
}
Model.CH_Trust trust = new Model.CH_Trust();
trust.ProjectId = this.CurrUser.LoginProjectId;
trust.ProjectId = this.ProjectId;
trust.CH_TrustCode = this.txtCH_TrustCode.Text.Trim();
if (this.drpCH_TrustUnit.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpCH_TrustUnit.SelectedValue))
{
@@ -678,7 +726,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
newitem.CH_Remark = item.CH_Remark;
}
newitem.CH_RepairLocation= values.Value<string>("CH_RepairLocation");
newitem.CH_RepairLocation = values.Value<string>("CH_RepairLocation");
}
BLL.TrustManageEditService.AddCH_TrustItem(newitem);
@@ -744,25 +792,25 @@ namespace FineUIPro.Web.HJGL.RepairManage
trustItems = new List<Model.View_CH_TrustItem>();
List<string> infos = Funs.GetStrListByStr(hdJOTID.Text, ',');
if (string.IsNullOrEmpty(CH_TrustID ))
if (string.IsNullOrEmpty(CH_TrustID))
{
foreach (var item in infos)
{
if (item.Contains(";"))
{
var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(item.Split(';')[0], this.CurrUser.LoginProjectId);
var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(item.Split(';')[0], this.ProjectId);
if (info != null)
{
var checkItem = Funs.DB.CH_CheckItem.FirstOrDefault(x => x.CHT_CheckID == item.Split(';')[1] && x.JOT_ID == item.Split(';')[0]);
var checkItem = Funs.DB.CH_CheckItem.FirstOrDefault(x => x.CHT_CheckID == item.Split(';')[1] && x.JOT_ID == item.Split(';')[0]);
if (checkItem.DefectLength.HasValue)
info.CH_RepairLocation = checkItem.DefectLength.Value.ToString("0.##");
info.CH_RepairLocation = checkItem.DefectLength.Value.ToString("0.##");
trustItems.Add(info);
}
}
else
{
var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(item, this.CurrUser.LoginProjectId);
var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(item, this.ProjectId);
if (info != null)
{
trustItems.Add(info);
@@ -776,7 +824,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
{
if (jotid.Contains(";"))
{
var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(jotid.Split(';')[0], this.CurrUser.LoginProjectId);
var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(jotid.Split(';')[0], this.ProjectId);
if (info != null)
{
@@ -791,7 +839,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
var item = BLL.TrustManageEditService.GetCH_TrustItemByJOT_ID(jotid);
if (item.Where(y => y.JOT_ID == jotid).Count() == 0)
{
var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(jotid, this.CurrUser.LoginProjectId);
var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(jotid, this.ProjectId);
if (info != null)
{
trustItems.Add(info);
@@ -799,11 +847,12 @@ namespace FineUIPro.Web.HJGL.RepairManage
}
}
}
} this.Grid1.DataSource = trustItems;
this.Grid1.DataBind();
}
this.Grid1.DataSource = trustItems;
this.Grid1.DataBind();
if (trustItems.Count > 0)
{
var join = Funs.DB.PW_JointInfo.FirstOrDefault(x => x.JOT_ID == trustItems[0].JOT_ID);
var iso = Funs.DB.PW_IsoInfo.FirstOrDefault(x => x.ISO_IsoNo == trustItems[0].ISO_IsoNo);
var trustUnit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitId == this.drpCH_TrustUnit.SelectedValue);
@@ -822,10 +871,10 @@ namespace FineUIPro.Web.HJGL.RepairManage
string code = "TCC-" + trustUnit.UnitCode + "-" + workArea.WorkAreaCode + "-" + NDTMethod.DetectionTypeCode + "-";
try
{
this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.CurrUser.LoginProjectId, code) + "K";
this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.ProjectId, code) + "K";
}
catch (Exception e1) { }
}
}
}
else
{
@@ -840,11 +889,11 @@ namespace FineUIPro.Web.HJGL.RepairManage
string code = trustUnit.UnitCode + "-" + iso.ISO_IsoNo + "-" + NDTMethod.DetectionTypeCode + "-";
try
{
this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.CurrUser.LoginProjectId, code) + "K";
this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.ProjectId, code) + "K";
}
catch (Exception e1) { }
}
}
}
}
@@ -922,26 +971,26 @@ namespace FineUIPro.Web.HJGL.RepairManage
this.drpInstallationId.Items.Clear();
if (!string.IsNullOrEmpty(this.drpCH_TrustUnit.SelectedValue) && this.drpCH_TrustUnit.SelectedValue != BLL.Const._Null)
{
//if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
//if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
//{
// BLL.Project_InstallationService.InitInstallationBySupervisorUnitIdListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpCH_TrustUnit.SelectedValue, this.CurrUser.UnitId, true);
// BLL.Project_InstallationService.InitInstallationBySupervisorUnitIdListDownList(this.drpInstallationId, this.ProjectId, this.drpCH_TrustUnit.SelectedValue, this.CurrUser.UnitId, true);
// this.drpInstallationId.SelectedIndex = 0;
//}
//else
//{
// BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpCH_TrustUnit.SelectedValue, true);
// BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.drpCH_TrustUnit.SelectedValue, true);
// this.drpInstallationId.SelectedIndex = 0;
//}
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpCH_TrustUnit.SelectedValue, true);
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.drpCH_TrustUnit.SelectedValue, true);
this.drpInstallationId.SelectedIndex = 0;
//加载委托单号
string prefixCode = string.Empty;
var epcUnitCode = BLL.UnitService.GetUnitCodeByUnitId(CommonService.GetMainProjectUnitId(this.CurrUser.LoginProjectId));
var epcUnitCode = BLL.UnitService.GetUnitCodeByUnitId(CommonService.GetMainProjectUnitId(this.ProjectId));
// var trustUnitCode = BLL.UnitService.GetUnitCodeByUnitId(this.drpCH_TrustUnit.SelectedValue);
// prefixCode = "RK-" + epcUnitCode + "-" + trustUnitCode + "-";
//this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.CurrUser.LoginProjectId, prefixCode);
needChangeCode(sender,e);
//this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.ProjectId, prefixCode);
needChangeCode(sender, e);
}
else
{
@@ -960,7 +1009,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
{
//string prefixCode = string.Empty;
//string areaCode = string.Empty;
//var workarea = BLL.WorkAreaService.GetWorkAreaByProjectIdAndInstalltionIdAndUnitId(this.CurrUser.LoginProjectId, this.drpInstallationId.SelectedValue, this.drpCH_TrustUnit.SelectedValue);
//var workarea = BLL.WorkAreaService.GetWorkAreaByProjectIdAndInstalltionIdAndUnitId(this.ProjectId, this.drpInstallationId.SelectedValue, this.drpCH_TrustUnit.SelectedValue);
//if (workarea != null)
//{
// areaCode = workarea.WorkAreaCode;
@@ -969,7 +1018,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
//var trustUnitCode = BLL.UnitService.GetUnitCodeByUnitId(this.drpCH_TrustUnit.SelectedValue);
//prefixCode = "RK-" + epcUnitCode + "-" + trustUnitCode + "-" + areaCode + "-";
//this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.CurrUser.LoginProjectId, prefixCode);
//this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.ProjectId, prefixCode);
}
}
@@ -986,7 +1035,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
//string areaCode = string.Empty;
//string unitCode = string.Empty;
//string ndttCode = string.Empty;
//var workarea = BLL.WorkAreaService.GetWorkAreaByProjectIdAndInstalltionIdAndUnitId(this.CurrUser.LoginProjectId, this.drpInstallationId.SelectedValue, this.drpCH_TrustUnit.SelectedValue);
//var workarea = BLL.WorkAreaService.GetWorkAreaByProjectIdAndInstalltionIdAndUnitId(this.ProjectId, this.drpInstallationId.SelectedValue, this.drpCH_TrustUnit.SelectedValue);
//if (workarea != null)
//{
// areaCode = workarea.WorkAreaCode;
@@ -998,8 +1047,8 @@ namespace FineUIPro.Web.HJGL.RepairManage
//{
// ndttCode = ndtt.DetectionTypeCode;
//}
// prefixCode = "RK-" + epcUnitCode + "-" + trustUnitCode + "-" + areaCode + "-" + ndttCode + "-";
// this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.CurrUser.LoginProjectId, prefixCode);
// prefixCode = "RK-" + epcUnitCode + "-" + trustUnitCode + "-" + areaCode + "-" + ndttCode + "-";
// this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.ProjectId, prefixCode);
}
}
#endregion
@@ -1012,7 +1061,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
/// <returns></returns>
private bool GetButtonPower(string button)
{
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_RepairManageMenuId, button);
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_RepairManageMenuId, button);
}
#endregion
@@ -1052,7 +1101,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// if (q != null)
// {
// string varValue = string.Empty;
// //var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
// //var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId);
// //var installationName = BLL.Project_InstallationService.GetInstallationByInstallationId(q.InstallationId).InstallationName;
// //var unitName = BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
@@ -1063,24 +1112,24 @@ namespace FineUIPro.Web.HJGL.RepairManage
// varValue = Microsoft.JScript.GlobalObject.escape(varValue.Replace("/", ","));
// }
// if (BLL.Project_SysSetService.IsAuto("3", this.CurrUser.LoginProjectId) == true) //3表示无损委托
// if (BLL.Project_SysSetService.IsAuto("3", this.ProjectId) == true) //3表示无损委托
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReportId, reportId, varValue, this.CurrUser.LoginProjectId)));
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReportId, reportId, varValue, this.ProjectId)));
// }
// else if (BLL.Project_SysSetService.IsAuto("3", this.CurrUser.LoginProjectId) == false)
// else if (BLL.Project_SysSetService.IsAuto("3", this.ProjectId) == false)
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport2Id, reportId, varValue, this.CurrUser.LoginProjectId)));
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport2Id, reportId, varValue, this.ProjectId)));
// }
// else if (BLL.Project_SysSetService.IsAuto("3", this.CurrUser.LoginProjectId) == null)
// else if (BLL.Project_SysSetService.IsAuto("3", this.ProjectId) == null)
// {
// var p = BLL.Project_SysSetService.GetSysSetBySetId("3", this.CurrUser.LoginProjectId);
// var p = BLL.Project_SysSetService.GetSysSetBySetId("3", this.ProjectId);
// if (p.SetValue == "3")
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport3Id, reportId, varValue, this.CurrUser.LoginProjectId)));
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport3Id, reportId, varValue, this.ProjectId)));
// }
// else // 4表示为神化委托单
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport4Id, reportId, varValue, this.CurrUser.LoginProjectId)));
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport4Id, reportId, varValue, this.ProjectId)));
// }
// }
@@ -1127,7 +1176,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
if (trust != null)
{
string varValue = string.Empty;
var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId);
var installation = BLL.Project_InstallationService.GetInstallationByInstallationId(trust.InstallationId);
dr["ProjectName"] = projectName;
@@ -1221,7 +1270,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
var PworkArea = Funs.DB.ProjectData_WorkArea.FirstOrDefault(x => x.WorkAreaId == tb.Rows[0]["WorkAreaId"].ToString());
if (PworkArea != null)
{
dr["WorkAreaName"] = PworkArea.WorkAreaName;
dr["WorkAreaCode"] = PworkArea.WorkAreaCode;
@@ -1257,7 +1306,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// Session["CH_TrustID"] = reportId;
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
var sysSet = Funs.DB.Project_Sys_Set.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.SetId == "3").FirstOrDefault();
var sysSet = Funs.DB.Project_Sys_Set.Where(x => x.ProjectId == this.ProjectId && x.SetId == "3").FirstOrDefault();
if (sysSet != null && sysSet.IsAuto.HasValue && sysSet.IsAuto.Value)
{
initTemplatePath = "File\\Fastreport\\管道焊口返修委托单NoPic.frx";
@@ -1270,7 +1319,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../TrustManage/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
}
}
else
{
@@ -1312,7 +1361,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
if (trust != null)
{
string varValue = string.Empty;
var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId);
var installation = BLL.Project_InstallationService.GetInstallationByInstallationId(trust.InstallationId);
dr["ProjectName"] = projectName;
@@ -1447,7 +1496,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// Session["CH_TrustID"] = reportId;
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
var sysSet = Funs.DB.Project_Sys_Set.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.SetId == "3").FirstOrDefault();
var sysSet = Funs.DB.Project_Sys_Set.Where(x => x.ProjectId == this.ProjectId && x.SetId == "3").FirstOrDefault();
if (sysSet != null && sysSet.IsAuto.HasValue && sysSet.IsAuto.Value)
{
initTemplatePath = "File\\Fastreport\\设备焊口返修委托单NoPic.frx";
@@ -1465,7 +1514,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
//if (trust != null)
//{
// string varValue = string.Empty;
// var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
// var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId);
// var installation = BLL.Project_InstallationService.GetInstallationByInstallationId(trust.InstallationId);
@@ -1695,7 +1744,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// {
// hssfworkbook.Write(filess);
// }
// //PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReportId, isoId, varValue, this.CurrUser.LoginProjectId)));
// //PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReportId, isoId, varValue, this.ProjectId)));
// FileInfo filet = new FileInfo(ReportFileName);
// Response.Clear();
@@ -1742,14 +1791,14 @@ namespace FineUIPro.Web.HJGL.RepairManage
tb.TableName = "Table1";
}
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
if (tb.Rows.Count > 0 && tb.Rows[0]["JOT_ID"] != null)
{
var joint = Funs.DB.PW_JointInfo.FirstOrDefault(x => x.JOT_ID == tb.Rows[0]["JOT_ID"].ToString());
keyValuePairs.Add("JOT_JointDesc", joint.JOT_JointDesc);
var material = Funs.DB.Base_Material.FirstOrDefault(x => x.MaterialId == joint.MaterialId);
keyValuePairs.Add("MaterialCode", material.MaterialCode);
var weldingMethod = Funs.DB.Base_WeldingMethod.FirstOrDefault(x=>x.WeldingMethodId == joint.WME_ID);
var weldingMethod = Funs.DB.Base_WeldingMethod.FirstOrDefault(x => x.WeldingMethodId == joint.WME_ID);
keyValuePairs.Add("WeldingMethodName", weldingMethod.WeldingMethodName);
@@ -1769,13 +1818,13 @@ namespace FineUIPro.Web.HJGL.RepairManage
keyValuePairs.Add("InstallationName", installation.InstallationName);
}
var proejct = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
var proejct = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == ProjectId);
keyValuePairs.Add("ProjectName", proejct.ProjectName);
BLL.Common.FastReportService.ResetData();
@@ -1785,7 +1834,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// Session["Table"] = dt;
// Session["CH_TrustID"] = reportId;
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
string rootPath = Server.MapPath("~/");
initTemplatePath = "File\\Fastreport\\管道焊缝返修施工记录.frx";
if (File.Exists(rootPath + initTemplatePath))
{
@@ -1794,7 +1843,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
}
}
else if (printType.SelectedValue == "3")
{
string strSql = @"select c.JOT_ID, CH_RepairLocation,Defects_Definition, (select count(*) from CH_CheckItem c where c.CHT_CheckResult!='合格'and a.JOT_ID =c.JOT_ID) BackNumber,DefectLength ,d.WED_Code as WED_Code1,e.WED_Code as WED_Code2,f.CHT_CheckDate
@@ -1838,7 +1887,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
keyValuePairs.Add("WorkAreaName", PworkArea.WorkAreaName);
}
}
var proejct = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
var proejct = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == ProjectId);
keyValuePairs.Add("ProjectName", proejct.ProjectName);
@@ -1873,7 +1922,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// if (trust != null)
// {
// string varValue = string.Empty;
// var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
// var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId);
// var installation = BLL.Project_InstallationService.GetInstallationByInstallationId(trust.InstallationId);
@@ -2103,7 +2152,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// {
// hssfworkbook.Write(filess);
// }
// //PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReportId, isoId, varValue, this.CurrUser.LoginProjectId)));
// //PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReportId, isoId, varValue, this.ProjectId)));
// FileInfo filet = new FileInfo(ReportFileName);
// Response.Clear();
@@ -2143,7 +2192,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
//{
// foreach (var item in infos)
// {
// var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(item, this.CurrUser.LoginProjectId);
// var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(item, this.ProjectId);
// if (info != null)
// {
// trustItems.Add(info);
@@ -2157,7 +2206,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// var item = BLL.TrustManageEditService.GetCH_TrustItemByJOT_ID(jotid);
// if (item.Where(y => y.JOT_ID == jotid).Count() == 0)
// {
// var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(jotid, this.CurrUser.LoginProjectId);
// var info = BLL.TrustManageEditService.GetView_CH_TrustItemByJotID(jotid, this.ProjectId);
// if (info != null)
// {
// trustItems.Add(info);
@@ -2169,7 +2218,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
{
var join = Funs.DB.PW_JointInfo.FirstOrDefault(x => x.JOT_ID == trustItems[0].JOT_ID);
var iso = Funs.DB.PW_IsoInfo.FirstOrDefault(x => x.ISO_IsoNo == trustItems[0].ISO_IsoNo);
var iso = Funs.DB.PW_IsoInfo.FirstOrDefault(x => x.ISO_IsoNo == trustItems[0].ISO_IsoNo);
var trustUnit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitId == this.drpCH_TrustUnit.SelectedValue);
if (iso.Is_Standard.HasValue && !iso.Is_Standard.Value)
@@ -2185,7 +2234,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
string code = "TCC-" + trustUnit.UnitCode + "-" + workArea.WorkAreaCode + "-" + NDTMethod.DetectionTypeCode + "-";
try
{
this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.CurrUser.LoginProjectId, code) + "K";
this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.ProjectId, code) + "K";
}
catch (Exception ee) { }
}
@@ -2200,10 +2249,10 @@ namespace FineUIPro.Web.HJGL.RepairManage
var NDTMethod = Funs.DB.Base_DetectionType.FirstOrDefault(x => x.DetectionTypeId == this.drpCH_NDTMethod.SelectedValue);
if (trustUnit != null && workArea != null && NDTMethod != null)
{
string code = trustUnit.UnitCode + "-" + iso.ISO_IsoNo + "-" + NDTMethod.DetectionTypeCode + "-";
string code = trustUnit.UnitCode + "-" + iso.ISO_IsoNo + "-" + NDTMethod.DetectionTypeCode + "-";
try
{
this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.CurrUser.LoginProjectId, code) + "K";
this.txtCH_TrustCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.CH_Trust", "CH_TrustCode", this.ProjectId, code) + "K";
}
catch (Exception ee) { }
}