using BLL; using System; using System.Linq; using System.Web.Http; namespace WebAPI.Controllers { /// /// 质量计量器具同步控制器 /// public class InspectionMachineSyncController : ApiController { #region 分包单位推送数据到总包单位 /// /// 分包单位推送数据到总包单位 /// /// 项目ID /// 数据ID(可选) /// 响应数据 [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 总包单位接收分包单位推送数据 /// /// 总包单位接收分包单位推送数据 /// /// 质量计量器具同步数据 /// 响应数据 [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 } }