集成人员同步,专项检查同步
This commit is contained in:
@@ -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()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.code = 1;
|
||||
responeData.data = APIHazardRegisterSyncService.getHazardRegisterLists();
|
||||
}
|
||||
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,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
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user