Files
SGGL_SHJ/SGGL/BLL/WebService/CNCECHSSEWebService.cs
T
lpf 8efe030f47 refactor: 清理旧模块资源并整理人员服务目录
为收敛当前分支代码范围并统一人员服务目录,移除历史模块与静态资源,减少无效代码和目录分散带来的维护成本。
2026-09-19 13:45:38 +08:00

133 lines
5.6 KiB
C#

namespace BLL
{
using Model;
using Newtonsoft.Json;
//using System.Net.Http.Headers;
//using System.Net.Http;
using System;
using System.Linq;
public static class CNCECHSSEWebService
{
#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 = 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,
}
);
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
#region 督查人员推送
public static int PushInspectionBrigadeUser()
{
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()
{
UserId = x.PersonId,
UserName = x.PersonName,
Sex = x.Sex,
Account = x.Account,
Password = x.Password,
IdentityCard = x.IdentityCard,
Telephone = x.Telephone,
CollCropCode = CollCropCode
};
var resultJsonReport = JsonConvert.SerializeObject(userList.ToList());
resultJsonReport = "{\"InspectionBrigadeUserItems\":" + resultJsonReport.Replace("}{", ",") + "}";
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
}
}