2024-06-04 15:52:03 +08:00
|
|
|
|
using Aspose.Words;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
using BLL;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.CQMS.QualityPlanning
|
|
|
|
|
{
|
|
|
|
|
public partial class Organizational : PageBase
|
|
|
|
|
{
|
|
|
|
|
#region 加载
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
|
|
|
|
string projectId = this.CurrUser.LoginProjectId;
|
|
|
|
|
string unitId = this.CurrUser.UnitId;
|
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
this.ContentPanel1.Title = "项目名称:" + BLL.ProjectService.GetProjectNameByProjectId(projectId);
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
|
|
|
|
var unit = (from x in Funs.DB.Project_ProjectUnit
|
2024-06-04 15:52:03 +08:00
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|
|
|
|
where x.ProjectId == projectId
|
|
|
|
|
//&& x.UnitType == BLL.Const.ProjectUnitType_2
|
|
|
|
|
&& x.UnitId == unitId
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (unit != null)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
if (unit.UnitType == BLL.Const.ProjectUnitType_1)
|
|
|
|
|
{
|
|
|
|
|
this.divSubOrganizational.Visible = false;
|
|
|
|
|
this.divOrganizational.Visible = true;
|
|
|
|
|
|
|
|
|
|
string projectManagerName = string.Empty;
|
|
|
|
|
var projectManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "项目经理");
|
|
|
|
|
if (projectManager != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in projectManager)
|
|
|
|
|
{
|
|
|
|
|
projectManagerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(projectManagerName))
|
|
|
|
|
{
|
|
|
|
|
this.Label1.Text = "项目经理:" + projectManagerName.Substring(0, projectManagerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string sjName = string.Empty;
|
|
|
|
|
var sj = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "设计经理");
|
|
|
|
|
if (sj != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in sj)
|
|
|
|
|
{
|
|
|
|
|
sjName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(sjName))
|
|
|
|
|
{
|
|
|
|
|
this.Label2.Text = "设计经理:" + sjName.Substring(0, sjName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string cgName = string.Empty;
|
|
|
|
|
var cg = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "采购经理");
|
|
|
|
|
if (cg != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in cg)
|
|
|
|
|
{
|
|
|
|
|
cgName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(cgName))
|
|
|
|
|
{
|
|
|
|
|
this.Label3.Text = "采购经理:" + cgName.Substring(0, cgName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string name4 = string.Empty;
|
|
|
|
|
var con = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "施工经理");
|
|
|
|
|
if (con != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in con)
|
|
|
|
|
{
|
|
|
|
|
name4 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name4))
|
|
|
|
|
{
|
|
|
|
|
this.Label4.Text = "施工经理:" + name4.Substring(0, name4.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string name5 = string.Empty;
|
|
|
|
|
var qa = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "质量经理");
|
|
|
|
|
if (qa != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in qa)
|
|
|
|
|
{
|
|
|
|
|
name5 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name5))
|
|
|
|
|
{
|
|
|
|
|
this.Label5.Text = "质量经理:" + name5.Substring(0, name5.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string name6 = string.Empty;
|
|
|
|
|
var hseManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE经理");
|
|
|
|
|
if (hseManager != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in hseManager)
|
|
|
|
|
{
|
|
|
|
|
name6 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name6))
|
|
|
|
|
{
|
|
|
|
|
this.Label6.Text = "HSE经理:" + name6.Substring(0, name6.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string name7 = string.Empty;
|
|
|
|
|
var carManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "开车经理");
|
|
|
|
|
if (carManager != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in carManager)
|
|
|
|
|
{
|
|
|
|
|
name7 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name7))
|
|
|
|
|
{
|
|
|
|
|
this.Label7.Text = "开车经理:" + name7.Substring(0, name7.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string warehousemanName = string.Empty;
|
|
|
|
|
var warehousemanLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "仓库管理员");
|
|
|
|
|
if (warehousemanLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in warehousemanLists)
|
|
|
|
|
{
|
|
|
|
|
warehousemanName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(warehousemanName))
|
|
|
|
|
{
|
|
|
|
|
warehousemanName = warehousemanName.Substring(0, warehousemanName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label8.Text = "仓库管理员:" + warehousemanName;
|
|
|
|
|
|
|
|
|
|
string docName = string.Empty;
|
|
|
|
|
var doc = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "文控工程师");
|
|
|
|
|
if (doc != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in doc)
|
|
|
|
|
{
|
|
|
|
|
docName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(docName))
|
|
|
|
|
{
|
|
|
|
|
docName = docName.Substring(0, docName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label9.Text = "文控工程师:" + docName;
|
|
|
|
|
|
|
|
|
|
string hseEngineerName = string.Empty;
|
|
|
|
|
var hseEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE工程师");
|
|
|
|
|
if (hseEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in hseEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
hseEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(hseEngineerName))
|
|
|
|
|
{
|
|
|
|
|
hseEngineerName = hseEngineerName.Substring(0, hseEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label10.Text = "HSE工程师:" + hseEngineerName;
|
|
|
|
|
|
|
|
|
|
string carEngineerName = string.Empty;
|
|
|
|
|
var carEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "开车工程师");
|
|
|
|
|
if (carEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in carEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
carEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(carEngineerName))
|
|
|
|
|
{
|
|
|
|
|
carEngineerName = carEngineerName.Substring(0, carEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label11.Text = "开车工程师:" + carEngineerName;
|
|
|
|
|
|
|
|
|
|
string CVEngineerName = string.Empty;
|
|
|
|
|
var CVEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "土建工程师");
|
|
|
|
|
if (CVEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in CVEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
CVEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(CVEngineerName))
|
|
|
|
|
{
|
|
|
|
|
CVEngineerName = CVEngineerName.Substring(0, CVEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label12.Text = "土建工程师:" + CVEngineerName;
|
|
|
|
|
|
|
|
|
|
string FEEngineerName = string.Empty;
|
|
|
|
|
var FEEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "设备工程师");
|
|
|
|
|
if (FEEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in FEEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
FEEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(FEEngineerName))
|
|
|
|
|
{
|
|
|
|
|
FEEngineerName = FEEngineerName.Substring(0, FEEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label13.Text = "设备工程师:" + FEEngineerName;
|
|
|
|
|
|
|
|
|
|
string PDEngineerName = string.Empty;
|
|
|
|
|
var PDEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "管道工程师");
|
|
|
|
|
if (PDEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in PDEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
PDEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(PDEngineerName))
|
|
|
|
|
{
|
|
|
|
|
PDEngineerName = PDEngineerName.Substring(0, PDEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label14.Text = "管道工程师:" + PDEngineerName;
|
|
|
|
|
|
|
|
|
|
string EHEngineerName = string.Empty;
|
|
|
|
|
var EHEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "电气工程师");
|
|
|
|
|
if (EHEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in EHEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
EHEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(EHEngineerName))
|
|
|
|
|
{
|
|
|
|
|
EHEngineerName = EHEngineerName.Substring(0, EHEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label15.Text = "电气工程师:" + EHEngineerName;
|
|
|
|
|
|
|
|
|
|
string EAEngineerName = string.Empty;
|
|
|
|
|
var EAEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "仪表工程师");
|
|
|
|
|
if (EAEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in EAEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
EAEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(EAEngineerName))
|
|
|
|
|
{
|
|
|
|
|
EAEngineerName = EAEngineerName.Substring(0, EAEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label16.Text = "仪表工程师:" + EAEngineerName;
|
|
|
|
|
}
|
|
|
|
|
else if (unit.UnitType == BLL.Const.ProjectUnitType_2)
|
|
|
|
|
{
|
|
|
|
|
this.divSubOrganizational.Visible = true;
|
|
|
|
|
this.divOrganizational.Visible = false;
|
|
|
|
|
|
|
|
|
|
string projectManagerName = string.Empty;
|
|
|
|
|
var projectManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "项目经理");
|
|
|
|
|
if (projectManager != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in projectManager)
|
|
|
|
|
{
|
|
|
|
|
projectManagerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(projectManagerName))
|
|
|
|
|
{
|
|
|
|
|
projectManagerName = projectManagerName.Substring(0, projectManagerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label17.Text = "项目经理:" + projectManagerName;
|
|
|
|
|
|
|
|
|
|
string name4 = string.Empty;
|
|
|
|
|
var con = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "施工经理");
|
|
|
|
|
if (con != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in con)
|
|
|
|
|
{
|
|
|
|
|
name4 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name4))
|
|
|
|
|
{
|
|
|
|
|
name4 = name4.Substring(0, name4.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label8.Text = "施工经理:" + name4;
|
|
|
|
|
|
|
|
|
|
string name5 = string.Empty;
|
|
|
|
|
var qa = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "质量经理");
|
|
|
|
|
if (qa != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in qa)
|
|
|
|
|
{
|
|
|
|
|
name5 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name5))
|
|
|
|
|
{
|
|
|
|
|
name5 = name5.Substring(0, name5.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label9.Text = "质量经理:" + name5;
|
|
|
|
|
|
|
|
|
|
string name6 = string.Empty;
|
|
|
|
|
var hseManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE经理");
|
|
|
|
|
if (hseManager != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in hseManager)
|
|
|
|
|
{
|
|
|
|
|
name6 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name6))
|
|
|
|
|
{
|
|
|
|
|
name6 = name6.Substring(0, name6.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label20.Text = "HSE经理:" + name6;
|
|
|
|
|
|
|
|
|
|
string docName = string.Empty;
|
|
|
|
|
var doc = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "文控工程师");
|
|
|
|
|
if (doc != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in doc)
|
|
|
|
|
{
|
|
|
|
|
docName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(docName))
|
|
|
|
|
{
|
|
|
|
|
docName = docName.Substring(0, docName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label21.Text = "文控工程师:" + docName;
|
|
|
|
|
|
|
|
|
|
string hseEngineerName = string.Empty;
|
|
|
|
|
var hseEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE工程师");
|
|
|
|
|
if (hseEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in hseEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
hseEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(hseEngineerName))
|
|
|
|
|
{
|
|
|
|
|
hseEngineerName = hseEngineerName.Substring(0, hseEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label22.Text = "HSE工程师:" + hseEngineerName;
|
|
|
|
|
|
|
|
|
|
string CVEngineerName = string.Empty;
|
|
|
|
|
var CVEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "土建工程师");
|
|
|
|
|
if (CVEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in CVEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
CVEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(CVEngineerName))
|
|
|
|
|
{
|
|
|
|
|
CVEngineerName = CVEngineerName.Substring(0, CVEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label23.Text = "土建工程师:" + CVEngineerName;
|
|
|
|
|
|
|
|
|
|
string FEEngineerName = string.Empty;
|
|
|
|
|
var FEEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "设备工程师");
|
|
|
|
|
if (FEEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in FEEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
FEEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(FEEngineerName))
|
|
|
|
|
{
|
|
|
|
|
FEEngineerName = FEEngineerName.Substring(0, FEEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label24.Text = "设备工程师:" + FEEngineerName;
|
|
|
|
|
|
|
|
|
|
string PDEngineerName = string.Empty;
|
|
|
|
|
var PDEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "管道工程师");
|
|
|
|
|
if (PDEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in PDEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
PDEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(PDEngineerName))
|
|
|
|
|
{
|
|
|
|
|
PDEngineerName = PDEngineerName.Substring(0, PDEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label25.Text = "管道工程师:" + PDEngineerName;
|
|
|
|
|
|
|
|
|
|
string EHEngineerName = string.Empty;
|
|
|
|
|
var EHEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "电气工程师");
|
|
|
|
|
if (EHEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in EHEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
EHEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(EHEngineerName))
|
|
|
|
|
{
|
|
|
|
|
EHEngineerName = EHEngineerName.Substring(0, EHEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label26.Text = "电气工程师:" + EHEngineerName;
|
|
|
|
|
|
|
|
|
|
string EAEngineerName = string.Empty;
|
|
|
|
|
var EAEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "仪表工程师");
|
|
|
|
|
if (EAEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in EAEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
EAEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(EAEngineerName))
|
|
|
|
|
{
|
|
|
|
|
EAEngineerName = EAEngineerName.Substring(0, EAEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.Label27.Text = "仪表工程师:" + EAEngineerName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 导出
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnOut_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string rootPath = Server.MapPath("~/");
|
|
|
|
|
string initTemplatePath = string.Empty;
|
|
|
|
|
string uploadfilepath = string.Empty;
|
|
|
|
|
string newUrl = string.Empty;
|
|
|
|
|
string filePath = string.Empty;
|
|
|
|
|
|
|
|
|
|
string projectId = this.CurrUser.LoginProjectId;
|
|
|
|
|
string unitId = this.CurrUser.UnitId;
|
|
|
|
|
|
|
|
|
|
var pModel = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == projectId);
|
|
|
|
|
|
|
|
|
|
var unit = (from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
|
|
|
|
where x.ProjectId == projectId
|
|
|
|
|
//&& x.UnitType == BLL.Const.ProjectUnitType_2
|
|
|
|
|
&& x.UnitId == unitId
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
if (unit != null)
|
|
|
|
|
{
|
|
|
|
|
if (unit.UnitType == BLL.Const.ProjectUnitType_1)
|
|
|
|
|
{
|
|
|
|
|
initTemplatePath = Const.CQMS_OrganizationalUrl;
|
|
|
|
|
uploadfilepath = rootPath + initTemplatePath;
|
|
|
|
|
|
|
|
|
|
newUrl = uploadfilepath.Replace("总包质量管理组织机构图", "总包质量管理组织机构图(" + pModel.ShortName + ")");
|
|
|
|
|
//filePath = initTemplatePath.Replace(".doc", trainRecords.TrainRecordsId.Replace("/", "-") + ".pdf");
|
|
|
|
|
if (File.Exists(newUrl))
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
File.Delete(newUrl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
File.Copy(uploadfilepath, newUrl);
|
|
|
|
|
Document doc = new Aspose.Words.Document(uploadfilepath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bookmark projectName = doc.Range.Bookmarks["ProjectName"];
|
|
|
|
|
if (projectName != null)
|
|
|
|
|
{
|
|
|
|
|
projectName.Text = "项目名称:" + BLL.ProjectService.GetProjectNameByProjectId(projectId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bookmark projectManager = doc.Range.Bookmarks["ProjectManager"];
|
|
|
|
|
string pm = string.Empty;
|
|
|
|
|
var lists1 = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "项目经理");
|
|
|
|
|
if (lists1 != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in lists1)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
pm += item + ",";
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(pm))
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
pm = pm.Substring(0, pm.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
projectManager.Text = "项目经理:" + pm;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark sj = doc.Range.Bookmarks["sjManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string sjName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var sjLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "设计经理");
|
|
|
|
|
if (sjLists != null)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
foreach (var item in sjLists)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
|
|
|
|
sjName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(sjName))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
sjName = sjName.Substring(0, sjName.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
sj.Text = "设计经理:" + sjName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark cgManager = doc.Range.Bookmarks["cgManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string cgName = string.Empty;
|
|
|
|
|
var cg = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "采购经理");
|
|
|
|
|
if (cg != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in cg)
|
|
|
|
|
{
|
|
|
|
|
cgName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(cgName))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
cgName = cgName.Substring(0, cgName.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
cgManager.Text = "采购经理:" + cgName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark sgManager = doc.Range.Bookmarks["sgManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string name4 = string.Empty;
|
|
|
|
|
var con = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "施工经理");
|
|
|
|
|
if (con != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in con)
|
|
|
|
|
{
|
|
|
|
|
name4 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name4))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
name4 = name4.Substring(0, name4.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
sgManager.Text = "施工经理:" + name4;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark qaManager = doc.Range.Bookmarks["qaManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string name5 = string.Empty;
|
|
|
|
|
var qa = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "质量经理");
|
|
|
|
|
if (qa != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in qa)
|
|
|
|
|
{
|
|
|
|
|
name5 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name5))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
name5 = name5.Substring(0, name5.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
qaManager.Text = "质量经理:" + name5;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark hse = doc.Range.Bookmarks["hseManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string name6 = string.Empty;
|
|
|
|
|
var hseManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE经理");
|
|
|
|
|
if (hseManager != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in hseManager)
|
|
|
|
|
{
|
|
|
|
|
name6 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name6))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
name6 = name6.Substring(0, name6.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
hse.Text = "HSE经理:" + name6;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark car = doc.Range.Bookmarks["carManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string name7 = string.Empty;
|
|
|
|
|
var carManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "开车经理");
|
|
|
|
|
if (carManager != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in carManager)
|
|
|
|
|
{
|
|
|
|
|
name7 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name7))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
name7 = name7.Substring(0, name7.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
car.Text = "开车经理:" + name7;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark warehouse = doc.Range.Bookmarks["warehouseManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string warehousemanName = string.Empty;
|
|
|
|
|
var warehousemanLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "仓库管理员");
|
|
|
|
|
if (warehousemanLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in warehousemanLists)
|
|
|
|
|
{
|
|
|
|
|
warehousemanName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(warehousemanName))
|
|
|
|
|
{
|
|
|
|
|
warehousemanName = warehousemanName.Substring(0, warehousemanName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
warehouse.Text = "仓库管理员:" + warehousemanName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark docManager = doc.Range.Bookmarks["docManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string docName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var docm = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "文控工程师");
|
|
|
|
|
if (docm != null)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
foreach (var item in docm)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
|
|
|
|
docName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(docName))
|
|
|
|
|
{
|
|
|
|
|
docName = docName.Substring(0, docName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
docManager.Text = "文控工程师:" + docName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark hseEngineer = doc.Range.Bookmarks["hseEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string hseEngineerName = string.Empty;
|
|
|
|
|
var hseEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE工程师");
|
|
|
|
|
if (hseEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in hseEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
hseEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(hseEngineerName))
|
|
|
|
|
{
|
|
|
|
|
hseEngineerName = hseEngineerName.Substring(0, hseEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
hseEngineer.Text = "HSE工程师:" + hseEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark carEngineer = doc.Range.Bookmarks["carEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string carEngineerName = string.Empty;
|
|
|
|
|
var carEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "开车工程师");
|
|
|
|
|
if (carEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in carEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
carEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(carEngineerName))
|
|
|
|
|
{
|
|
|
|
|
carEngineerName = carEngineerName.Substring(0, carEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
carEngineer.Text = "开车工程师:" + carEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark CVEngineer = doc.Range.Bookmarks["CVEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string CVEngineerName = string.Empty;
|
|
|
|
|
var CVEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "土建工程师");
|
|
|
|
|
if (CVEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in CVEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
CVEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(CVEngineerName))
|
|
|
|
|
{
|
|
|
|
|
CVEngineerName = CVEngineerName.Substring(0, CVEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
CVEngineer.Text = "土建工程师:" + CVEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark FEEngineer = doc.Range.Bookmarks["FEEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string FEEngineerName = string.Empty;
|
|
|
|
|
var FEEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "设备工程师");
|
|
|
|
|
if (FEEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in FEEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
FEEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(FEEngineerName))
|
|
|
|
|
{
|
|
|
|
|
FEEngineerName = FEEngineerName.Substring(0, FEEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
FEEngineer.Text = "设备工程师:" + FEEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark PDEngineer = doc.Range.Bookmarks["PDEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string PDEngineerName = string.Empty;
|
|
|
|
|
var PDEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "管道工程师");
|
|
|
|
|
if (PDEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in PDEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
PDEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(PDEngineerName))
|
|
|
|
|
{
|
|
|
|
|
PDEngineerName = PDEngineerName.Substring(0, PDEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
PDEngineer.Text = "管道工程师:" + PDEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark EHEngineer = doc.Range.Bookmarks["EHEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string EHEngineerName = string.Empty;
|
|
|
|
|
var EHEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "电气工程师");
|
|
|
|
|
if (EHEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in EHEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
EHEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(EHEngineerName))
|
|
|
|
|
{
|
|
|
|
|
EHEngineerName = EHEngineerName.Substring(0, EHEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
EHEngineer.Text = "电气工程师:" + EHEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark EAEngineer = doc.Range.Bookmarks["EAEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string EAEngineerName = string.Empty;
|
|
|
|
|
var EAEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "仪表工程师");
|
|
|
|
|
if (EAEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in EAEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
EAEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(EAEngineerName))
|
|
|
|
|
{
|
|
|
|
|
EAEngineerName = EAEngineerName.Substring(0, EAEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
EAEngineer.Text = "仪表工程师:" + EAEngineerName;
|
|
|
|
|
|
|
|
|
|
doc.Save(newUrl);
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
else if(unit.UnitType == BLL.Const.ProjectUnitType_2)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
initTemplatePath = Const.CQMS_SubOrganizationalUrl;
|
|
|
|
|
uploadfilepath = rootPath + initTemplatePath;
|
|
|
|
|
|
|
|
|
|
newUrl = uploadfilepath.Replace("分包质量管理组织机构图", "分包质量管理组织机构图(" + pModel.ShortName + ")");
|
|
|
|
|
//filePath = initTemplatePath.Replace(".doc", trainRecords.TrainRecordsId.Replace("/", "-") + ".pdf");
|
|
|
|
|
if (File.Exists(newUrl))
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
File.Delete(newUrl);
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
File.Copy(uploadfilepath, newUrl);
|
|
|
|
|
Document doc = new Aspose.Words.Document(uploadfilepath);
|
|
|
|
|
|
|
|
|
|
Bookmark projectName = doc.Range.Bookmarks["ProjectName"];
|
|
|
|
|
if (projectName != null)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
projectName.Text = "项目名称:" + BLL.ProjectService.GetProjectNameByProjectId(projectId);
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark projectManager = doc.Range.Bookmarks["ProjectManager"];
|
|
|
|
|
string pm = string.Empty;
|
|
|
|
|
var lists1 = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "项目经理");
|
|
|
|
|
if (lists1 != null)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
foreach (var item in lists1)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
pm += item + ",";
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(pm))
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
pm = pm.Substring(0, pm.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
projectManager.Text = "项目经理:" + pm;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark sgManager = doc.Range.Bookmarks["sgManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string name4 = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var con = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "施工经理");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (con != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in con)
|
|
|
|
|
{
|
|
|
|
|
name4 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name4))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
name4 = name4.Substring(0, name4.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
sgManager.Text = "施工经理:" + name4;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark qaManager = doc.Range.Bookmarks["qaManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string name5 = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var qa = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "质量经理");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (qa != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in qa)
|
|
|
|
|
{
|
|
|
|
|
name5 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name5))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
name5 = name5.Substring(0, name5.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
qaManager.Text = "质量经理:" + name5;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark hse = doc.Range.Bookmarks["hseManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string name6 = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var hseManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE经理");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (hseManager != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in hseManager)
|
|
|
|
|
{
|
|
|
|
|
name6 += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(name6))
|
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
name6 = name6.Substring(0, name6.LastIndexOf(','));
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
hse.Text = "HSE经理:" + name6;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark docManager = doc.Range.Bookmarks["docManager"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string docName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var docm = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "文控工程师");
|
|
|
|
|
if (docm != null)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
2024-06-04 15:52:03 +08:00
|
|
|
|
foreach (var item in docm)
|
2024-05-31 16:17:04 +08:00
|
|
|
|
{
|
|
|
|
|
docName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(docName))
|
|
|
|
|
{
|
|
|
|
|
docName = docName.Substring(0, docName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
docManager.Text = "文控工程师:" + docName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark hseEngineer = doc.Range.Bookmarks["hseEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string hseEngineerName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var hseEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE工程师");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (hseEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in hseEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
hseEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(hseEngineerName))
|
|
|
|
|
{
|
|
|
|
|
hseEngineerName = hseEngineerName.Substring(0, hseEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
hseEngineer.Text = "HSE工程师:" + hseEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark CVEngineer = doc.Range.Bookmarks["CVEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string CVEngineerName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var CVEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "土建工程师");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (CVEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in CVEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
CVEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(CVEngineerName))
|
|
|
|
|
{
|
|
|
|
|
CVEngineerName = CVEngineerName.Substring(0, CVEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
CVEngineer.Text = "土建工程师:" + CVEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark FEEngineer = doc.Range.Bookmarks["FEEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string FEEngineerName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var FEEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "设备工程师");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (FEEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in FEEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
FEEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(FEEngineerName))
|
|
|
|
|
{
|
|
|
|
|
FEEngineerName = FEEngineerName.Substring(0, FEEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
FEEngineer.Text = "设备工程师:" + FEEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark PDEngineer = doc.Range.Bookmarks["PDEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string PDEngineerName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var PDEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "管道工程师");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (PDEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in PDEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
PDEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(PDEngineerName))
|
|
|
|
|
{
|
|
|
|
|
PDEngineerName = PDEngineerName.Substring(0, PDEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
PDEngineer.Text = "管道工程师:" + PDEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark EHEngineer = doc.Range.Bookmarks["EHEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string EHEngineerName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var EHEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "电气工程师");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (EHEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in EHEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
EHEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(EHEngineerName))
|
|
|
|
|
{
|
|
|
|
|
EHEngineerName = EHEngineerName.Substring(0, EHEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
EHEngineer.Text = "电气工程师:" + EHEngineerName;
|
2024-05-31 16:17:04 +08:00
|
|
|
|
|
2024-06-04 15:52:03 +08:00
|
|
|
|
Bookmark EAEngineer = doc.Range.Bookmarks["EAEngineer"];
|
2024-05-31 16:17:04 +08:00
|
|
|
|
string EAEngineerName = string.Empty;
|
2024-06-04 15:52:03 +08:00
|
|
|
|
var EAEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "仪表工程师");
|
2024-05-31 16:17:04 +08:00
|
|
|
|
if (EAEngineerLists != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in EAEngineerLists)
|
|
|
|
|
{
|
|
|
|
|
EAEngineerName += item + ",";
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(EAEngineerName))
|
|
|
|
|
{
|
|
|
|
|
EAEngineerName = EAEngineerName.Substring(0, EAEngineerName.LastIndexOf(','));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
EAEngineer.Text = "仪表工程师:" + EAEngineerName;
|
|
|
|
|
|
|
|
|
|
doc.Save(newUrl);
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string fileName = Path.GetFileName(newUrl);
|
|
|
|
|
FileInfo info = new FileInfo(newUrl);
|
|
|
|
|
long fileSize = info.Length;
|
|
|
|
|
Response.Clear();
|
|
|
|
|
Response.ContentType = "application/x-zip-compressed";
|
|
|
|
|
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
|
|
|
|
Response.AddHeader("Content-Length", fileSize.ToString());
|
|
|
|
|
Response.TransmitFile(newUrl, 0, fileSize);
|
|
|
|
|
Response.Flush();
|
|
|
|
|
Response.Close();
|
|
|
|
|
File.Delete(newUrl);
|
2024-05-31 16:17:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-04 15:52:03 +08:00
|
|
|
|
}
|