2023-02-02 15:13:20 +08:00
|
|
|
namespace BLL
|
|
|
|
|
{
|
2026-03-26 14:44:30 +08:00
|
|
|
using Model;
|
2023-03-30 18:17:53 +08:00
|
|
|
using Newtonsoft.Json;
|
2025-10-10 14:33:21 +08:00
|
|
|
//using System.Net.Http.Headers;
|
|
|
|
|
//using System.Net.Http;
|
2023-02-02 15:13:20 +08:00
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
public static class CNCECHSSEWebService
|
|
|
|
|
{
|
2026-09-19 13:45:38 +08:00
|
|
|
#region 项目推送
|
2023-02-02 15:13:20 +08:00
|
|
|
/// <summary>
|
2026-09-19 13:45:38 +08:00
|
|
|
/// 推送项目到集团
|
2023-02-02 15:13:20 +08:00
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2026-09-19 13:45:38 +08:00
|
|
|
public static string PushProject()
|
2023-02-02 15:13:20 +08:00
|
|
|
{
|
|
|
|
|
string code = "0";
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2026-09-19 13:45:38 +08:00
|
|
|
//查询所有在建项目
|
|
|
|
|
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 = 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 = false,
|
|
|
|
|
ProjectState2 = "",
|
|
|
|
|
Progress = 0,
|
|
|
|
|
MonitorPW = "",
|
|
|
|
|
MonitorId = "",
|
|
|
|
|
ProjectAttribute = "",
|
|
|
|
|
SourceUnitId = BLL.Const.UnitId_SEDIN,
|
|
|
|
|
}
|
|
|
|
|
);
|
2023-07-12 16:50:28 +08:00
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
code = PushApiProject(upReport).ToString();
|
2023-02-02 15:13:20 +08:00
|
|
|
if (code == "1")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2026-09-19 13:45:38 +08:00
|
|
|
ErrLogInfo.WriteLog("【在建项目】上传到服务器", ex);
|
2023-02-02 15:13:20 +08:00
|
|
|
}
|
|
|
|
|
return code;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2026-09-19 13:45:38 +08:00
|
|
|
/// 推送项目
|
2023-02-02 15:13:20 +08:00
|
|
|
/// </summary>
|
2026-09-19 13:45:38 +08:00
|
|
|
/// <param name="upReport"></param>
|
2023-02-02 15:13:20 +08:00
|
|
|
/// <returns></returns>
|
|
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
private static int PushApiProject(IQueryable<Model.BaseProjectItem> upReport)
|
2023-02-02 15:13:20 +08:00
|
|
|
{
|
2026-09-19 13:45:38 +08:00
|
|
|
string baseurl = "/api/InspectionBrigade/SaveBaseProjectData";
|
|
|
|
|
var resultJsonReport = JsonConvert.SerializeObject(upReport);
|
|
|
|
|
resultJsonReport = "{\"BaseProjectItems\":" + resultJsonReport.Replace("}{", ",") + "}";
|
|
|
|
|
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
|
2023-02-02 15:13:20 +08:00
|
|
|
return responeData.code;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
#region 督查人员推送
|
2023-03-30 18:17:53 +08:00
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
public static int PushInspectionBrigadeUser()
|
2023-03-30 18:17:53 +08:00
|
|
|
{
|
2023-07-12 16:50:28 +08:00
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
string baseurl = "/api/InspectionBrigade/SaveInspectionBrigadeUser";
|
|
|
|
|
var CollCropCode = BLL.CommonService.GetIsThisUnit()?.CollCropCode;
|
|
|
|
|
var userList = from x in Funs.DB.Person_Persons
|
|
|
|
|
where x.IsInspectionBrigade == true
|
|
|
|
|
select new Model.InspectionBrigadeUserItem()
|
|
|
|
|
{
|
2023-03-30 18:17:53 +08:00
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
UserId = x.PersonId,
|
|
|
|
|
UserName = x.PersonName,
|
|
|
|
|
Sex = x.Sex,
|
|
|
|
|
Account = x.Account,
|
|
|
|
|
Password = x.Password,
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
Telephone = x.Telephone,
|
|
|
|
|
CollCropCode = CollCropCode
|
2023-03-30 18:17:53 +08:00
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
};
|
2023-03-30 18:17:53 +08:00
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
var resultJsonReport = JsonConvert.SerializeObject(userList.ToList());
|
|
|
|
|
resultJsonReport = "{\"InspectionBrigadeUserItems\":" + resultJsonReport.Replace("}{", ",") + "}";
|
2023-03-30 18:17:53 +08:00
|
|
|
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
|
|
|
|
|
return responeData.code;
|
|
|
|
|
}
|
2024-10-30 17:15:30 +08:00
|
|
|
|
|
|
|
|
|
2026-09-19 13:45:38 +08:00
|
|
|
#endregion
|
2024-10-30 17:15:30 +08:00
|
|
|
|
2023-02-02 15:13:20 +08:00
|
|
|
}
|
|
|
|
|
}
|