This commit is contained in:
2026-03-29 12:03:57 +08:00
397 changed files with 57694 additions and 2915 deletions
@@ -0,0 +1,136 @@
using BLL;
using System;
using System.Linq;
using System.Web.Http;
using System.Threading.Tasks;
namespace WebAPI.Controllers
{
/// <summary>
/// 质量巡检同步控制器
/// </summary>
public class CheckControlSyncController : ApiController
{
#region
/// <summary>
/// 拉取质量巡检数据
/// </summary>
/// <returns>响应数据</returns>
[HttpGet]
public Model.ResponeData getCheckControlLists()
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
responeData.data = APICheckControlSyncService.getCheckControlLists();
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region id和单位统一社会代码
/// <summary>
/// 获取质量巡检数据根据项目id和单位统一社会代码
/// </summary>
/// <param name="projectId">项目ID</param>
/// <param name="collCropCode">单位社会统一信用代码</param>
/// <returns>响应数据</returns>
[HttpGet]
public Model.ResponeData getCheckControlListByProjectIdAndCollCropCode(string projectId, string collCropCode)
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
var unit = BLL.Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == collCropCode);
if (unit != null)
{
responeData.data = APICheckControlSyncService.GetCheckControlListsByProjectIdUnitIdPage(projectId, unit.UnitId);
}
else
{
responeData.code = 0;
responeData.message = "未找到对应单位";
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 推送质量巡检数据
/// </summary>
/// <param name="projectId">项目ID</param>
/// <param name="dataId">数据ID(可选)</param>
/// <returns>响应数据</returns>
[HttpPost]
public Model.ResponeData pushCheckControlLists(string projectId, string dataId)
{
var responeData = new Model.ResponeData();
try
{
var returndata = APICheckControlSyncService.pushCheckControlLists(projectId, dataId);
responeData.code = returndata.code;
responeData.message = returndata.message;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 接收保存质量巡检数据
/// </summary>
/// <param name="newItem">质量巡检同步数据</param>
/// <returns>响应数据</returns>
[HttpPost]
public Model.ResponeData SaveCheckControlSyncData([FromBody] Model.CheckControlSyncData newItem)
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
responeData.message = APICheckControlSyncService.SaveCheckControlSyncData(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,72 @@
using BLL;
using System;
using System.Linq;
using System.Web.Http;
namespace WebAPI.Controllers
{
/// <summary>
/// 质量会议同步控制器
/// </summary>
public class CqmsMeetingSyncController : ApiController
{
#region
/// <summary>
/// 推送质量会议数据
/// </summary>
/// <param name="projectId">项目ID</param>
/// <param name="dataId">数据ID(可选)</param>
/// <returns>响应数据</returns>
[HttpPost]
public Model.ResponeData pushCqmsMeetingLists(string projectId, string dataId)
{
var responeData = new Model.ResponeData();
try
{
var returndata = APICqmsMeetingSyncService.PushCqmsMeetingLists(projectId, dataId);
responeData.code = returndata.code;
responeData.message = returndata.message;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 接收保存质量会议数据
/// </summary>
/// <param name="newItem">质量会议同步数据</param>
/// <returns>响应数据</returns>
[HttpPost]
public Model.ResponeData SaveCqmsMeetingSyncData([FromBody] Model.CqmsMeetingSyncData newItem)
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
responeData.message = APICqmsMeetingSyncService.SaveCqmsMeetingSyncData(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,70 @@
using BLL;
using System;
using System.Linq;
using System.Web.Http;
namespace WebAPI.Controllers
{
/// <summary>
/// 质量计量器具同步控制器
/// </summary>
public class InspectionMachineSyncController : ApiController
{
#region
/// <summary>
/// 分包单位推送数据到总包单位
/// </summary>
/// <param name="projectId">项目ID</param>
/// <param name="dataId">数据ID(可选)</param>
/// <returns>响应数据</returns>
[HttpPost]
public Model.ResponeData pushInspectionMachineLists(string projectId, string dataId)
{
var responeData = new Model.ResponeData();
try
{
var returndata = APIInspectionMachineSyncService.PushInspectionMachineLists(projectId, dataId);
responeData.code = returndata.code;
responeData.message = returndata.message;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 总包单位接收分包单位推送数据
/// </summary>
/// <param name="newItem">质量计量器具同步数据</param>
/// <returns>响应数据</returns>
[HttpPost]
public Model.ResponeData SaveInspectionMachineSyncData([FromBody] Model.InspectionMachineSyncData newItem)
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
responeData.message = APIInspectionMachineSyncService.SaveInspectionMachineSyncData(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,119 @@
using BLL;
using System;
using System.Linq;
using System.Web.Http;
using System.Threading.Tasks;
namespace WebAPI.Controllers
{
public class CheckSpecialSyncController : ApiController
{
#region
/// <summary>
/// 从分包拉取总包上的项目专项检查数据
/// </summary>
/// <returns></returns>
public async Task<Model.ResponeData> getCheckSpecialLists()
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
responeData.data = APICheckSpecialSyncService.getCheckSpecialLists();
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region id和单位统一社会代码获取项目专项检查
/// <summary>
/// 根据项目id和单位统一社会代码获取项目专项检查
/// </summary>
/// <returns></returns>
public Model.ResponeData getCheckSpecialListByProjectIdAndCollCropCode(string projectId, string collCropCode)
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
var unit = BLL.Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == collCropCode);
responeData.data =
APICheckSpecialSyncService.GetCheckSpecialLitsByprojectIdUnitId(projectId, unit.UnitId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 分包推送项目专项检查数据到总包
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<Model.ResponeData> pushCheckSpecialLists(string projectId, string dataId)
{
var responeData = new Model.ResponeData();
try
{
var returndata = APICheckSpecialSyncService.pushCheckSpecialLists(projectId,dataId);
responeData.code = returndata.code;
responeData.message = returndata.message;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 接收保存分包单位推送到总包的项目专项检查数据
/// </summary>
/// <param name="newItem">HSSE数据</param>
/// <returns></returns>
[HttpPost]
public async Task<Model.ResponeData> SaveCheckSpecialSyncData([FromBody] Model.CheckSpecialSyncData newItem)
{
var responeData = new Model.ResponeData();
try
{
responeData.message = await APICheckSpecialSyncService.SaveCheckSpecialSyncData(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,119 @@
using BLL;
using System;
using System.Linq;
using System.Web.Http;
using System.Threading.Tasks;
namespace WebAPI.Controllers
{
public class HazardRegisterSyncController : ApiController
{
#region
/// <summary>
/// 拉取项目安全检查数据
/// </summary>
/// <returns></returns>
public Model.ResponeData getHazardRegisterLists(string projectId = "")
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
responeData.data = APIHazardRegisterSyncService.getHazardRegisterLists(projectId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region id和单位统一社会代码
/// <summary>
/// 获取所有单位
/// </summary>
/// <returns></returns>
public Model.ResponeData getHazardRegisterListByProjectIdAndCollCropCode(string projectId, string collCropCode)
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
var unit = BLL.Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == collCropCode);
responeData.data =
APIHazardRegisterSyncService.GetHazardRegisterLitsByprojectIdUnitIdPage(projectId, unit.UnitId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 推送项目安全检查数据
/// </summary>
/// <returns></returns>
[HttpPost]
public Model.ResponeData pushHazardRegisterLists(string projectId, string dataId)
{
var responeData = new Model.ResponeData();
try
{
var returndata = APIHazardRegisterSyncService.pushHazardRegisterLists(projectId, dataId);
responeData.code = returndata.code;
responeData.message = returndata.message;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 接收保存项目安全检查数据
/// </summary>
/// <param name="newItem">HSSE数据</param>
/// <returns></returns>
[HttpPost]
public Model.ResponeData SaveHazardRegisterSyncData([FromBody] Model.HazardRegisterSyncData newItem)
{
var responeData = new Model.ResponeData();
try
{
responeData.message = APIHazardRegisterSyncService.SaveHazardRegisterSyncData(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,64 @@
using BLL;
using Model;
using System;
using System.Threading.Tasks;
using System.Web.Http;
namespace WebAPI.Controllers
{
/// <summary>
/// 作业票定稿
/// </summary>
public class LicenseSyncController : ApiController
{
#region
/// <summary>
/// 推送项目作业票定稿数据
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<Model.ResponeData> PushLicenseManagerLists()
{
var responeData = new Model.ResponeData();
try
{
var returndata = APILicenseSyncService.PushLicenseManagerLists("");
responeData.code = returndata.code;
responeData.message = returndata.message;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 总包单位接收分包单位推送的作业票定稿数据
/// </summary>
/// <param name="data">作业票定稿数据</param>
/// <returns></returns>
[HttpPost]
public Model.ResponeData ReceiveSaveProjectLicenseManagerData([FromBody] LicenseManagerData data)
{
var responeData = new Model.ResponeData();
try
{
responeData.message = APILicenseSyncService.ReceiveSaveProjectLicenseManagerData(data);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,64 @@
using BLL;
using Model;
using System;
using System.Threading.Tasks;
using System.Web.Http;
namespace WebAPI.Controllers
{
/// <summary>
/// 安全会议
/// </summary>
public class MeetingSyncController : ApiController
{
#region
/// <summary>
/// 推送项目班前会数据
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<Model.ResponeData> PushClassMeetingLists()
{
var responeData = new Model.ResponeData();
try
{
var returndata = APIMeetingSyncService.PushClassMeetingLists("");
responeData.code = returndata.code;
responeData.message = returndata.message;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 总包单位接收分包单位推送的班前会数据
/// </summary>
/// <param name="data">班前会数据</param>
/// <returns></returns>
[HttpPost]
public Model.ResponeData ReceiveSaveProjectClassMeetingData([FromBody] ClassMeetingData data)
{
var responeData = new Model.ResponeData();
try
{
responeData.message = APIMeetingSyncService.ReceiveSaveProjectClassMeetingData(data);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,120 @@
using BLL;
using System;
using System.Linq;
using System.Web.Http;
using System.Threading.Tasks;
namespace WebAPI.Controllers
{
public class PersonSyncController : ApiController
{
#region
/// <summary>
/// 从分包拉取总包上的项目人员数据
/// </summary>
/// <returns></returns>
public async Task<Model.ResponeData> getPersonLists()
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
responeData.data = APIPersonSyncService.getPersonLists();
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region id和单位统一社会代码获取项目人员
/// <summary>
/// 根据项目id和单位统一社会代码获取项目人员
/// </summary>
/// <returns></returns>
public Model.ResponeData getPersonListByProjectIdAndCollCropCode(string projectId, string collCropCode)
{
var responeData = new Model.ResponeData();
try
{
responeData.code = 1;
var unit = BLL.Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == collCropCode);
responeData.data = APIPersonSyncService.GetPersonLitsByProjectIdAndUnitId(projectId, unit.UnitId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 分包推送项目人员数据到总包
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<Model.ResponeData> pushPersonLists(string projectId, string dataId)
{
var responeData = new Model.ResponeData();
try
{
var returndata = APIPersonSyncService.pushPersonLists(projectId, dataId);
responeData.code = returndata.code;
responeData.message = returndata.message;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
/// <summary>
/// 接收保存分包单位推送到总包的项目人员数据
/// </summary>
/// <param name="newItem">HSSE数据</param>
/// <returns></returns>
[HttpPost]
public async Task<Model.ResponeData> SavePersonSyncData([FromBody] Model.PersonSyncData newItem)
{
var responeData = new Model.ResponeData();
try
{
responeData.message = await APIPersonSyncService.SavePersonSyncData(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -1,4 +1,7 @@
using System;
using BLL;
using Microsoft.Ajax.Utilities;
using Model;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
@@ -6,8 +9,6 @@ using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using BLL;
using Model;
using WebAPI.Filter;
namespace WebAPI.Controllers
@@ -42,7 +43,7 @@ namespace WebAPI.Controllers
if (getProject != null)
{
projectId = getProject.ProjectId;
}
}
}
if (!string.IsNullOrEmpty(projectId))
{
@@ -103,7 +104,7 @@ namespace WebAPI.Controllers
isIn = 1;
}
APIPersonService.getPersonInOut(getPerson, isIn, facerecord.DateTimeRecord.Value);
}
}
}
responeData.message = "插入成功!";
}
@@ -157,116 +158,116 @@ namespace WebAPI.Controllers
{
var getUnit = UnitService.getUnitByCollCropCodeUnitName(person.CollCropCode, person.UnitName);
if (getUnit != null)
{
Model.SitePerson_Person newPerson = new Model.SitePerson_Person
{
PersonId = SQLHelper.GetNewID(),
ProjectId = getProject.ProjectId,
UnitId = getUnit.UnitId,
PersonName = person.PersonName,
IdentityCard = person.IdentityCard,
IdcardType = "SHENFEN_ZHENGJIAN",
IdcardAddress = person.IdcardAddress,
IdcardForever = "N",
IdcardStartDate = Funs.GetNewDateTime(person.IdcardStartDate),
IdcardEndDate = Funs.GetNewDateTime(person.IdcardEndDate),
Sex = (person.Sex == "女" || person.Sex == "2") ? "2" : "1",
Address = person.Address,
OutResult = person.OutResult,
Birthday = person.Birthday,
Telephone = person.Telephone,
IsUsed = person.IsUsed == false ? false : true,
InTime = Funs.GetNewDateTimeOrNow(person.InTime),
Password = BLL.PersonService.GetPersonPassWord(person.IdentityCard),
Isprint = "0",
//PositionId = person.PositionId,
//PostTitleId = person.PostTitleId,
//IsForeign = person.IsForeign,
//IsOutside = person.IsOutside,
//EduLevel = person.EduLevel,
//MaritalStatus = person.MaritalStatus,
//PoliticsStatus = person.PoliticsStatus,
//Nation = person.Nation,
//CountryCode = person.CountryCode,
//ProvinceCode = person.ProvinceCode,
};
{
Model.SitePerson_Person newPerson = new Model.SitePerson_Person
{
PersonId = SQLHelper.GetNewID(),
ProjectId = getProject.ProjectId,
UnitId = getUnit.UnitId,
PersonName = person.PersonName,
IdentityCard = person.IdentityCard,
IdcardType = "SHENFEN_ZHENGJIAN",
IdcardAddress = person.IdcardAddress,
IdcardForever = "N",
IdcardStartDate = Funs.GetNewDateTime(person.IdcardStartDate),
IdcardEndDate = Funs.GetNewDateTime(person.IdcardEndDate),
Sex = (person.Sex == "女" || person.Sex == "2") ? "2" : "1",
Address = person.Address,
OutResult = person.OutResult,
Birthday = person.Birthday,
Telephone = person.Telephone,
IsUsed = person.IsUsed == false ? false : true,
InTime = Funs.GetNewDateTimeOrNow(person.InTime),
Password = BLL.PersonService.GetPersonPassWord(person.IdentityCard),
Isprint = "0",
//PositionId = person.PositionId,
//PostTitleId = person.PostTitleId,
//IsForeign = person.IsForeign,
//IsOutside = person.IsOutside,
//EduLevel = person.EduLevel,
//MaritalStatus = person.MaritalStatus,
//PoliticsStatus = person.PoliticsStatus,
//Nation = person.Nation,
//CountryCode = person.CountryCode,
//ProvinceCode = person.ProvinceCode,
};
if (!string.IsNullOrEmpty(person.TeamGroupName) && !string.IsNullOrEmpty(newPerson.UnitId))
if (!string.IsNullOrEmpty(person.TeamGroupName) && !string.IsNullOrEmpty(newPerson.UnitId))
{
var getTeamGroup = TeamGroupService.getTeamGroupByTeamGroupName(getProject.ProjectId, newPerson.UnitId, person.TeamGroupName);
if (getTeamGroup != null)
{
var getTeamGroup = TeamGroupService.getTeamGroupByTeamGroupName(getProject.ProjectId, newPerson.UnitId, person.TeamGroupName);
if (getTeamGroup != null)
newPerson.TeamGroupId = getTeamGroup.TeamGroupId;
}
else
{
Model.ProjectData_TeamGroup newTeamGroup = new Model.ProjectData_TeamGroup
{
newPerson.TeamGroupId = getTeamGroup.TeamGroupId;
}
else
{
Model.ProjectData_TeamGroup newTeamGroup = new Model.ProjectData_TeamGroup
{
TeamGroupId = SQLHelper.GetNewID(),
ProjectId = getProject.ProjectId,
UnitId = newPerson.UnitId,
TeamGroupName = person.TeamGroupName,
Remark = "来源:门禁对接数据",
TeamTypeId = "CANJIAN_TEAM",
EntryTime = System.DateTime.Now,
RealNamePushTime = null,
};
db.ProjectData_TeamGroup.InsertOnSubmit(newTeamGroup);
db.SubmitChanges();
newPerson.TeamGroupId = newTeamGroup.TeamGroupId;
}
TeamGroupId = SQLHelper.GetNewID(),
ProjectId = getProject.ProjectId,
UnitId = newPerson.UnitId,
TeamGroupName = person.TeamGroupName,
Remark = "来源:门禁对接数据",
TeamTypeId = "CANJIAN_TEAM",
EntryTime = System.DateTime.Now,
RealNamePushTime = null,
};
db.ProjectData_TeamGroup.InsertOnSubmit(newTeamGroup);
db.SubmitChanges();
newPerson.TeamGroupId = newTeamGroup.TeamGroupId;
}
var getWorkArea = UnitWorkService.GetUnitWorkByUnitWorkName(getProject.ProjectId, person.WorkAreaName);
if (getWorkArea != null)
}
var getWorkArea = UnitWorkService.GetUnitWorkByUnitWorkName(getProject.ProjectId, person.WorkAreaName);
if (getWorkArea != null)
{
newPerson.WorkAreaId = getWorkArea.UnitWorkId;
}
var getWorkPost = WorkPostService.GetWorkPostByName(person.WorkPostName);
if (getWorkPost != null)
{
newPerson.WorkPostId = getWorkPost.WorkPostId;
}
var getHsseMan = ProjectService.getHSSEManager(getProject.ProjectId);
if (getHsseMan != null)
{
newPerson.AuditorId = getHsseMan.UserId;
newPerson.AuditorDate = DateTime.Now;
}
newPerson.OutTime = Funs.GetNewDateTime(person.OutTime);
if (person.headImage.Length == 0 && !string.IsNullOrEmpty(person.PhotoUrl))
{
var getS = AttachFileService.SetImageToByteArray(person.PhotoUrl);
if (getS != null)
{
newPerson.WorkAreaId = getWorkArea.UnitWorkId;
person.headImage = getS.ToString();
}
var getWorkPost = WorkPostService.GetWorkPostByName(person.WorkPostName);
if (getWorkPost != null)
}
if (person.headImage.Length > 0)
{
var image = Convert.FromBase64String(person.headImage);
newPerson.HeadImage = image;
string rootPath = ConfigurationManager.AppSettings["localRoot"];
string path = "FileUpLoad/PersonBaseInfo/" + DateTime.Now.ToString("yyyy-MM") + "/";
string fileUrl = (rootPath + path).Replace('/', '\\');
string flieName = Funs.GetNewFileName() + "~" + person.PersonName + ".jpg";
if (!Directory.Exists(fileUrl))
{
newPerson.WorkPostId = getWorkPost.WorkPostId;
}
var getHsseMan = ProjectService.getHSSEManager(getProject.ProjectId);
if (getHsseMan != null)
{
newPerson.AuditorId = getHsseMan.UserId;
newPerson.AuditorDate = DateTime.Now;
}
newPerson.OutTime = Funs.GetNewDateTime(person.OutTime);
if (person.headImage.Length == 0 && !string.IsNullOrEmpty(person.PhotoUrl))
{
var getS = AttachFileService.SetImageToByteArray(person.PhotoUrl);
if (getS != null)
{
person.headImage = getS.ToString();
}
}
if (person.headImage.Length > 0)
{
var image = Convert.FromBase64String(person.headImage);
newPerson.HeadImage = image;
string rootPath = ConfigurationManager.AppSettings["localRoot"];
string path = "FileUpLoad/PersonBaseInfo/" + DateTime.Now.ToString("yyyy-MM") + "/";
string fileUrl = (rootPath + path).Replace('/', '\\');
string flieName = Funs.GetNewFileName() + "~" + person.PersonName + ".jpg";
if (!Directory.Exists(fileUrl))
{
Directory.CreateDirectory(fileUrl);
}
newPerson.PhotoUrl = path + flieName;
System.IO.File.WriteAllBytes((fileUrl + flieName), image);
//AttachFileService.Base64ToImage(person.headImage, path, person.PersonName);
Directory.CreateDirectory(fileUrl);
}
newPerson.PhotoUrl = path + flieName;
System.IO.File.WriteAllBytes((fileUrl + flieName), image);
//AttachFileService.Base64ToImage(person.headImage, path, person.PersonName);
}
var getPerson = PersonService.GetPersonByIdentityCard(getProject.ProjectId, person.IdentityCard);
if (getPerson == null)
if (getPerson == null && !string.IsNullOrWhiteSpace(newPerson.PersonName))
{
PersonService.AddPerson(newPerson);
responeData.message = "新增人员成功!";
}
else
{
newPerson.PersonId =getPerson.PersonId;
newPerson.PersonId = getPerson.PersonId;
PersonService.UpdateDoorPerson(newPerson);
responeData.message = "更新人员成功!";
}
@@ -152,5 +152,61 @@ namespace WebAPI.Controllers
}
return responeData;
}
#region id删除专项检查明细
/// <summary>
/// 根据id删除专项检查明细
/// </summary>
/// <param name="newItem">专项检查</param>
/// <returns></returns>
[HttpGet]
public Model.ResponeData deleteCheckSpecialDetailById(string checkSpecialDetailId)
{
var responeData = new Model.ResponeData();
try
{
Check_CheckSpecialDetailService.DeleteCheckSpecialDetailById(checkSpecialDetailId);
responeData.message = "删除成功!";
responeData.code = 1;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region Check_CheckSpecial
/// <summary>
/// 保存专项检查 Check_CheckSpecial
/// </summary>
/// <param name="newItem">专项检查</param>
/// <returns></returns>
[HttpPost]
public Model.ResponeData SaveCheckSpecialNew([FromBody] Model.CheckSpecialItem newItem)
{
var responeData = new Model.ResponeData();
try
{
responeData.message = APICheckSpecialService.SaveCheckSpecialNew(newItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,34 @@
using BLL;
using Model;
using System;
using System.Web.Http;
namespace WebAPI.Controllers
{
/// <summary>
/// 督查检查整改
/// </summary>
public class DCGLCheckRectifyController : ApiController
{
/// <summary>
/// 集团驳回督查检查整改
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
[HttpPost]
public Model.ResponeData RejectRectify([FromBody] DCGLCheckRectifyReject data)
{
var responeData = new Model.ResponeData();
try
{
responeData = CNCECHSSEGetWebService.RejectRectify(data);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
}
}
@@ -0,0 +1,219 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace WebAPI.Controllers.HSSE
{
public class MaterialInAndOutRecordController : ApiController
{
#region
//获取物资列表提供选择
public Model.ResponeData GetGoodsCategoryList(string goodsCategoryName, int pageIndex = 0)
{
var responeData = new Model.ResponeData();
try
{
List<Model.Base_GoodsCategory> result = GoodsCategoryService.GetGoodsCategoryList();
if (!string.IsNullOrEmpty(goodsCategoryName))
{
result = result.Where(x => x.GoodsCategoryName.Contains(goodsCategoryName)).ToList();
}
int resultCount = result.Count();
if (resultCount > 0 && pageIndex > 0)
{
result = result.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
responeData.data = result;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
//获取物资列表提供选择
public Model.ResponeData GetMaterialUnitList(string materialUnitName, int pageIndex = 0)
{
var responeData = new Model.ResponeData();
try
{
List<Model.Base_MaterialUnit> result = MaterialUnitService.GetMaterialUnitList();
if (!string.IsNullOrEmpty(materialUnitName))
{
result = result.Where(x => x.MaterialUnitName.Contains(materialUnitName)).ToList();
}
int resultCount = result.Count();
if (resultCount > 0 && pageIndex > 0)
{
result = result.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
responeData.data = result;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
//保存物资进出记录
[HttpPost]
public Model.ResponeData SaveMaterialInAndOutRecord(Model.MaterialInAndOutRecord materialInAndOutRecord)
{
var responeData = new Model.ResponeData();
try
{
if (!string.IsNullOrEmpty(materialInAndOutRecord.Id))
{
//编辑
MaterialInAndOutRecordService.UpdateMaterialInAndOutRecord(materialInAndOutRecord);
}
else
{
//新增
materialInAndOutRecord.Id = SQLHelper.GetNewID(typeof(Model.MaterialInAndOutRecord));
materialInAndOutRecord.CompileDate = DateTime.Now;
MaterialInAndOutRecordService.AddMaterialInAndOutRecord(materialInAndOutRecord);
}
responeData.data = "保存成功";
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region id删除物资进出记录
//根据id删除物资进出记录
[HttpPost]
public Model.ResponeData DelMaterialInAndOutRecordById(string id)
{
var responeData = new Model.ResponeData();
try
{
MaterialInAndOutRecordService.DeleteMaterialInAndOutRecordById(id);
responeData.data = "删除成功";
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region id获取物资进出记录
//根据id获取物资进出记录
public Model.ResponeData GetMaterialInAndOutRecordById(string id)
{
var responeData = new Model.ResponeData();
try
{
var result = (from record in Funs.DB.MaterialInAndOutRecord
join materialUnit in Funs.DB.Base_MaterialUnit on record.MaterialUnitId equals materialUnit
.MaterialUnitId into MaterialUnitGroup
from materialUnit in MaterialUnitGroup.DefaultIfEmpty()
join unit in Funs.DB.Base_Unit on record.UnitId equals unit.UnitId into UnitGroup
from unit in UnitGroup.DefaultIfEmpty()
join users in Funs.DB.Sys_User on record.CompileMan equals users.UserId into UsersGroup
from users in UsersGroup.DefaultIfEmpty()
where record.Id == id
select new
{
record.Id,
record.ProjectId,
record.GoodsCategoryId,
record.GoodsCategoryName,
record.MaterialModel,
record.InOutDate,
record.InOrOut,
record.Number,
record.UnitId,
record.Remark,
record.CompileMan,
record.CompileDate,
record.MaterialUnitId,
MaterialUnitName = materialUnit != null ? materialUnit.MaterialUnitName : null,
UnitName = unit != null ? unit.UnitName : null,
CompileManName = users != null ? users.UserName : null
}).FirstOrDefault();
responeData.data = result;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region
//获取物资进出记录列表
public Model.ResponeData GetMaterialInAndOutRecordList(int pageIndex = 0)
{
var responeData = new Model.ResponeData();
try
{
var data = MaterialInAndOutRecordService.GetMaterialInAndOutRecordList();
int dataCount = data.Count();
if (dataCount > 0 && pageIndex > 0)
{
data = data.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
responeData.data = data;
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -11,13 +11,13 @@ namespace WebAPI.Controllers.JDGL
/// 人力预警
/// </summary>
/// <returns></returns>
public Model.ResponeData getManPowerWarning(string userId)
public Model.ResponeData getSGPersonWarningStatistics()
{
var responeData = new Model.ResponeData();
try
{
var list = SGManPowerService.CheckAndSendPersonWarning(userId);
responeData.data = list;
SGManPowerService.SGPersonWarningStatistics();
responeData.data = "1";
}
catch (Exception ex)
{
+6 -1
View File
@@ -92,13 +92,18 @@ namespace WebAPI.Controllers
/// <param name="projectId"></param>
/// <param name="unitId"></param>
/// <param name="pageIndex"></param>
/// <param name="personName"></param>
/// <returns></returns>
public Model.ResponeData getPersonByProjectIdUnitId(string projectId, string unitId, int pageIndex)
public Model.ResponeData getPersonByProjectIdUnitId(string projectId, string unitId, int pageIndex, string personName = "")
{
var responeData = new Model.ResponeData();
try
{
var getDataList = APIPersonService.getPersonByProjectIdUnitId(projectId, unitId);
if (!string.IsNullOrEmpty(personName))
{
getDataList = getDataList.Where(x => x.PersonName.Contains(personName)).ToList();
}
int pageCount = getDataList.Count;
if (pageCount > 0 && pageIndex > 0)
{