using BLL; using System; using System.Web.Http; namespace WebAPI.Controllers.HJGL.WeldingManage { /// /// 焊缝外观检测接口。 /// public class WeldAppearanceCheckController : ApiController { /// /// 分页查询当前项目中已焊接的焊口。 /// /// 项目ID。 /// 管线号查询条件。 /// 焊口号查询条件。 /// 页码,从0开始。 /// 每页记录数。 /// 已焊接焊口列表。 public Model.ResponeData GetWeldedJoints(string projectId, string pipelineCode = "", string weldJointCode = "", int pageIndex = 0, int pageSize = 20) { var responeData = new Model.ResponeData(); try { responeData.data = WeldAppearanceCheckService.GetWeldedJoints( projectId, pipelineCode, weldJointCode, pageIndex, pageSize); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// 查询焊口基础信息及历史外观检测记录。 /// /// 焊口ID。 /// 焊口详情及外观检测历史。 public Model.ResponeData GetJointDetail(string weldJointId) { var responeData = new Model.ResponeData(); try { responeData.data = WeldAppearanceCheckService.GetJointDetail(weldJointId); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } /// /// 保存焊缝外观检测记录。 /// /// 外观检测结果、检测人、检测时间及照片信息。 /// 外观检测记录ID。 [HttpPost] public Model.ResponeData SaveRecord([FromBody] Model.WeldAppearanceCheckInput item) { var responeData = new Model.ResponeData(); try { responeData.data = WeldAppearanceCheckService.Save(item); } catch (Exception ex) { responeData.code = 0; responeData.message = ex.Message; } return responeData; } } }