修改博盛接口和进度录入

This commit is contained in:
高飞 2023-07-25 17:32:36 +08:00
parent 22b400ec20
commit 9838978a8c
6 changed files with 95 additions and 35 deletions

View File

@ -91,7 +91,7 @@ namespace BLL
JArray arr = JArray.Parse(obj["Data"].ToString());
string projectId = string.Empty;
////根据传值项目主键
var getProjectByFromProjectId = Funs.DB.Base_Project.FirstOrDefault(x => x.FromProjectId == fromprojectId && x.ProjectCode== OtherDepartId);
var getProjectByFromProjectId = Funs.DB.Base_Project.FirstOrDefault(x => x.FromProjectId == fromprojectId && x.ProjectCode == OtherDepartId);
if (getProjectByFromProjectId != null)
{
projectId = getProjectByFromProjectId.ProjectId;
@ -99,7 +99,7 @@ namespace BLL
else
{
var getPByCode= Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectCode == OtherDepartId);
var getPByCode = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectCode == OtherDepartId);
if (getPByCode != null)
{
getPByCode.FromProjectId = fromprojectId;
@ -216,11 +216,12 @@ namespace BLL
try
{
List<Model.Bo_Sheng_Person> insertPersons = new List<Model.Bo_Sheng_Person>();
List<Model.SitePerson_Person> insertSitePersons = new List<Model.SitePerson_Person>();
foreach (var item in arr)
{
string getID = item["ID"].ToString();
var getPerson = db.Bo_Sheng_Person.FirstOrDefault(x => x.ID == getID);
if (!string.IsNullOrEmpty(getID) )
if (!string.IsNullOrEmpty(getID))
{
if (getPerson == null)
{
@ -291,6 +292,27 @@ namespace BLL
db.SubmitChanges();
}
}
var getSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == item["IdentifyID"].ToString());
if (!string.IsNullOrEmpty(getID))
{
if (getSitePerson == null)
{
Model.SitePerson_Person newPerson = new Model.SitePerson_Person
{
PersonId = SQLHelper.GetNewID(),
ProjectId = projectId,
PersonName = item["Name"].ToString(),
Sex = item["Sex"].ToString(),
Birthday = Funs.GetNewDateTime(item["BirthDay"].ToString()),
Address = item["Address"].ToString(),
Nation = item["Nation"].ToString(),
IdentityCard = item["IdentifyID"].ToString(),
UnitId = BLL.UnitService.GetUnitIdByUnitName(item["DepartName"].ToString()),
Telephone = item["Telephone"].ToString(),
MaritalStatus = item["MaritalStatus"].ToString(),
};
insertSitePersons.Add(newPerson);
}
}
if (insertPersons.Count() > 0)
@ -298,7 +320,12 @@ namespace BLL
db.Bo_Sheng_Person.InsertAllOnSubmit(insertPersons);
db.SubmitChanges();
}
if (insertSitePersons.Count() > 0)
{
db.SitePerson_Person.InsertAllOnSubmit(insertSitePersons);
db.SubmitChanges();
}
}
}
catch (Exception ex)
{

View File

@ -2829,7 +2829,7 @@ namespace BLL
/// 获取模拟树表格
/// </summary>
/// <returns></returns>
public static DataTable GetAllTreeDataTable(string projectId, string IsOut)
public static DataTable GetAllTreeDataTable(string projectId, string IsOut, string Id)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
@ -2897,6 +2897,8 @@ namespace BLL
CostControlDetailStatisticsList = getCostControlDetailStatisticss.Where(x => x.ProjectId == projectId).Distinct().ToList();
List<Model.View_WBS_CostControlDetailStatistics> newList = new List<Model.View_WBS_CostControlDetailStatistics>();
if (string.IsNullOrEmpty(Id)) //加载全项目记录
{
var installationList = CostControlDetailStatisticsList.Where(x => x.WBSType == "Installation" && x.SupId == "0");
foreach (var item in installationList)
{
@ -2910,6 +2912,23 @@ namespace BLL
AddDetailOut(newList, CostControlDetailStatisticsList, item.Id, string.Empty);
}
}
}
else //加载选择节点及其子级
{
var node = CostControlDetailStatisticsList.FirstOrDefault(x => x.Id == Id);
if (node != null)
{
newList.Add(node);
if (string.IsNullOrEmpty(IsOut))
{
AddDetail(newList, CostControlDetailStatisticsList, node.Id);
}
else
{
AddDetailOut(newList, CostControlDetailStatisticsList, node.Id, string.Empty);
}
}
}
DataRow row;
foreach (Model.View_WBS_CostControlDetailStatistics item in newList)
{

View File

@ -308,6 +308,22 @@ namespace BLL
return name;
}
/// <summary>
/// 获取单位Id
/// </summary>
/// <param name="UnitName"></param>
/// <returns></returns>
public static string GetUnitIdByUnitName(string unitName)
{
string name = null;
var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitName == unitName);
if (unit != null)
{
name = unit.UnitId;
}
return name;
}
/// <summary>
/// 获取单位简称
/// </summary>

View File

@ -336,12 +336,9 @@ namespace FineUIPro.Web.JDGL.WBS
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
if (this.trWBS.SelectedNode != null)
{
if (this.trWBS.SelectedNode.CommandName != "project" && this.trWBS.SelectedNode.CommandName != "installation" && this.trWBS.SelectedNode.CommandName != "cnProfession") //非项目、装置、专业节点可以修改
{
this.hdSelectId.Text = this.trWBS.SelectedNode.NodeID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkloadInputEdit.aspx?Id={0}", this.trWBS.SelectedNode.NodeID, "编辑 - ")));
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkloadInputEditAll.aspx?Id={0}", this.trWBS.SelectedNode.NodeID, "编辑 - ")));
}
else
{

View File

@ -127,7 +127,8 @@ namespace FineUIPro.Web.JDGL.WBS
if (!IsPostBack)
{
errorInfos = string.Empty;
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty);
string Id = Request.Params["Id"];
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, Id);
Grid1.DataSource = table;
Grid1.DataBind();
for (int i = 0; i < this.Grid1.Rows.Count; i++)

View File

@ -133,7 +133,7 @@ namespace FineUIPro.Web.JDGL.WBS
errorInfos = string.Empty;
this.hdFileName.Text = string.Empty;
this.hdCheckResult.Text = string.Empty;
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty);
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty,string.Empty);
Grid1.DataSource = table;
Grid1.DataBind();
}
@ -153,14 +153,14 @@ namespace FineUIPro.Web.JDGL.WBS
Response.ContentType = "application/excel";
Response.ContentEncoding = Encoding.UTF8;
this.Grid1.Columns[ColumnNum - 1].Hidden = false;
DataTable tableOut = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, "Out");
DataTable tableOut = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, "Out", string.Empty);
Grid1.DataSource = tableOut;
Grid1.DataBind();
this.Grid1.PageSize = Grid1.RecordCount;
Response.Write(GetGridTableHtml2(Grid1));
Response.End();
this.Grid1.Columns[ColumnNum - 1].Hidden = true;
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty);
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, string.Empty);
Grid1.DataSource = table;
Grid1.DataBind();
}
@ -393,7 +393,7 @@ namespace FineUIPro.Web.JDGL.WBS
ImportXlsToData2(rootPath + initPath + this.hdFileName.Text);
hdCheckResult.Text = string.Empty;
ShowNotify("导入成功!", MessageBoxIcon.Success);
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty);
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, string.Empty);
Grid1.DataSource = table;
Grid1.DataBind();
}