提交代码
This commit is contained in:
@@ -1840,6 +1840,92 @@
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 项目推送 新增方法
|
||||
/// <summary>
|
||||
/// 推送项目到集团
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string PushProject()
|
||||
{
|
||||
string code = "0";
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
try
|
||||
{
|
||||
//查询所有在建项目
|
||||
var upReport = (from x in db.Base_Project
|
||||
where (x.ProjectState == "1" || x.ProjectState == null)
|
||||
select new Model.BaseProjectItem
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
UnitId = BLL.Const.UnitId_SEDIN,
|
||||
ProjectCode = x.ProjectCode,
|
||||
ProjectName = x.ProjectName,
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
ProjectAddress = x.ProjectAddress,
|
||||
ShortName = x.ShortName,
|
||||
ProjectType = x.ProjectType,
|
||||
PostCode = x.PostCode,
|
||||
Remark = x.Remark,
|
||||
ProjectState = x.ProjectState,
|
||||
ContractNo = x.ContractNo,
|
||||
WorkRange = x.WorkRange,
|
||||
Duration = x.Duration,
|
||||
IsUpTotalMonth = x.IsUpTotalMonth,
|
||||
ProjectMainPerson = x.ProjectMainPerson,
|
||||
ProjectLiaisonPerson = x.ProjectLiaisonPerson,
|
||||
IsForeign = x.IsForeign,
|
||||
FromProjectId = x.FromProjectId,
|
||||
MapCoordinates = x.MapCoordinates,
|
||||
ProjectMoney = x.ProjectMoney,
|
||||
ConstructionMoney = x.ConstructionMoney,
|
||||
Country = x.Country,
|
||||
Province = x.Province,
|
||||
City = x.City,
|
||||
Telephone = x.Telephone,
|
||||
EnglishRemark = x.EnglishRemark,
|
||||
//IsFace = x.IsFace,
|
||||
//ProjectState2 = x.ProjectState2,
|
||||
//Progress = x.Progress,
|
||||
//MonitorPW = x.MonitorPW,
|
||||
//MonitorId = x.MonitorId,
|
||||
//ProjectAttribute = x.ProjectAttribute,
|
||||
SourceUnitId = BLL.Const.UnitId_SEDIN,
|
||||
}
|
||||
);
|
||||
|
||||
code = PushApiProject(upReport).ToString();
|
||||
if (code == "1")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("【在建项目】上传到服务器", ex);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 推送项目
|
||||
/// </summary>
|
||||
/// <param name="upReport"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
private static int PushApiProject(IQueryable<Model.BaseProjectItem> upReport)
|
||||
{
|
||||
string baseurl = "/api/InspectionBrigade/SaveBaseProjectData";
|
||||
var resultJsonReport = JsonConvert.SerializeObject(upReport);
|
||||
resultJsonReport = "{\"BaseProjectItems\":" + resultJsonReport.Replace("}{", ",") + "}";
|
||||
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
|
||||
return responeData.code;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user