提交代码

This commit is contained in:
2024-12-24 19:04:32 +08:00
parent 2e3c34c38c
commit 189a020cc7
78 changed files with 9689 additions and 2214 deletions
@@ -3517,6 +3517,93 @@
return responeData.code;
}
#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,
MasterSysId = x.MasterSysId,
UnitId = CommonService.GetThisUnitId(),
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 = CommonService.GetThisUnitId(),
}
);
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
}