修改博盛接口和进度录入

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

@ -19,7 +19,7 @@ namespace BLL
/// </summary>
public static void StartMonitor()
{
int adTimeJ = 30;
int adTimeJ = 30;
if (messageTimer != null)
{
messageTimer.Stop();
@ -91,15 +91,15 @@ 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;
}
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,14 +292,40 @@ 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)
{
db.Bo_Sheng_Person.InsertAllOnSubmit(insertPersons);
db.SubmitChanges();
if (insertPersons.Count() > 0)
{
db.Bo_Sheng_Person.InsertAllOnSubmit(insertPersons);
db.SubmitChanges();
}
if (insertSitePersons.Count() > 0)
{
db.SitePerson_Person.InsertAllOnSubmit(insertSitePersons);
db.SubmitChanges();
}
}
}
catch (Exception ex)
{
@ -370,7 +397,7 @@ namespace BLL
{
db.Bo_Sheng_Unit.InsertAllOnSubmit(insertUnits);
db.SubmitChanges();
}
}
}
catch (Exception ex)
{
@ -454,7 +481,7 @@ namespace BLL
{
db.Bo_Sheng_Train.InsertAllOnSubmit(insertTrains);
db.SubmitChanges();
}
}
}
catch (Exception ex)
{
@ -541,7 +568,7 @@ namespace BLL
{
db.Bo_Sheng_TrainPerson.InsertAllOnSubmit(insertTrainPersons);
db.SubmitChanges();
}
}
}
catch (Exception ex)
{
@ -612,7 +639,7 @@ namespace BLL
{
db.Bo_Sheng_Exam.InsertAllOnSubmit(insertExams);
db.SubmitChanges();
}
}
}
catch (Exception ex)
{
@ -693,7 +720,7 @@ namespace BLL
{
db.Bo_Sheng_PersonTrainRecord.InsertAllOnSubmit(insertPersonTrainRecords);
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,17 +2897,36 @@ namespace BLL
CostControlDetailStatisticsList = getCostControlDetailStatisticss.Where(x => x.ProjectId == projectId).Distinct().ToList();
List<Model.View_WBS_CostControlDetailStatistics> newList = new List<Model.View_WBS_CostControlDetailStatistics>();
var installationList = CostControlDetailStatisticsList.Where(x => x.WBSType == "Installation" && x.SupId == "0");
foreach (var item in installationList)
if (string.IsNullOrEmpty(Id)) //加载全项目记录
{
newList.Add(item);
if (string.IsNullOrEmpty(IsOut))
var installationList = CostControlDetailStatisticsList.Where(x => x.WBSType == "Installation" && x.SupId == "0");
foreach (var item in installationList)
{
AddDetail(newList, CostControlDetailStatisticsList, item.Id);
newList.Add(item);
if (string.IsNullOrEmpty(IsOut))
{
AddDetail(newList, CostControlDetailStatisticsList, item.Id);
}
else
{
AddDetailOut(newList, CostControlDetailStatisticsList, item.Id, string.Empty);
}
}
else
}
else //加载选择节点及其子级
{
var node = CostControlDetailStatisticsList.FirstOrDefault(x => x.Id == Id);
if (node != null)
{
AddDetailOut(newList, CostControlDetailStatisticsList, item.Id, string.Empty);
newList.Add(node);
if (string.IsNullOrEmpty(IsOut))
{
AddDetail(newList, CostControlDetailStatisticsList, node.Id);
}
else
{
AddDetailOut(newList, CostControlDetailStatisticsList, node.Id, string.Empty);
}
}
}
DataRow row;

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

@ -7,7 +7,7 @@ using System.Data.SqlClient;
using System.Linq;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.JDGL.WBS
namespace FineUIPro.Web.JDGL.WBS
{
public partial class WorkloadInput : PageBase
{
@ -337,11 +337,8 @@ namespace FineUIPro.Web.JDGL.WBS
{
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, "编辑 - ")));
}
this.hdSelectId.Text = 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();
}