CNCEC_SUBQHSE_WUHUAN/SGGL/WebAPI/Controllers/DataShare/CQMS/InspectionMachineSyncContro...

71 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}
}