using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using BLL;
namespace WebAPI.Controllers
{
///
///
///
public class PipeJointController : ApiController
{
///
/// 根据单位工程获取管线列表
///
///
///
public Model.ResponeData getPipelineListByUnitWrokId(string unitWrokId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APIPipeJointService.getPipelineList(unitWrokId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
///
/// 根据管线ID获取未焊接的焊口信息
///
///
///
public Model.ResponeData getWeldJointListByPipeLineId(string pipeLineId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APIPipeJointService.GetWeldJointList(pipeLineId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
///
/// 根据管线ID获取所有的焊口列表
///
///
///
public Model.ResponeData GetAllWeldJointList(string pipeLineId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APIPipeJointService.GetAllWeldJointList(pipeLineId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
///
/// 获取焊工列表
///
///
///
public Model.ResponeData getWelderListByUnitWorkId(string unitWorkId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APIPipeJointService.getWelderList(unitWorkId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
///
/// 根据焊口ID获取焊口信息
///
///
///
public Model.ResponeData getWeldJointInfoById(string weldJointId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APIPipeJointService.getWeldJointInfo(weldJointId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#region 根据焊口标识获取焊口详细信息
///
/// 根据焊口标识获取焊口详细信息
///
///
///
public Model.ResponeData getWeldJointByIdentify(string weldJointIdentify)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APIPipeJointService.getWeldJointByIdentify(weldJointIdentify);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region 保存管线焊口信息
///
/// 保存管线焊口信息
///
/// 管线焊口项
///
[HttpPost]
public Model.ResponeData PostSavePipeWeldJoint([FromBody] Model.WeldJointItem addItem)
{
var responeData = new Model.ResponeData();
try
{
APIPipeJointService.SavePipeWeldJoint(addItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region 批量保存管线焊口信息
///
/// 批量保存管线焊口信息
///
/// 管线焊口项
///
[HttpPost]
public Model.ResponeData PostSavePipeWeldJointList([FromBody] List addItems)
{
var responeData = new Model.ResponeData();
try
{
APIPipeJointService.SavePipeWeldJointList(addItems);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region 保存预焊接日报
///
/// 保存预焊接日报
///
///
///
[HttpPost]
public Model.ResponeData PostSavePreWeldingDaily([FromBody] Model.WeldJointItem addItem)
{
var responeData = new Model.ResponeData();
try
{
APIPipeJointService.SavePreWeldingDaily(addItem);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}