dd
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
using BLL.API;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class BaseController : ApiController
|
||||
{
|
||||
|
||||
[HttpGet]
|
||||
public Model.ResponeData baseProjectList(string userId, string trustType)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(trustType) || trustType == "null")
|
||||
{
|
||||
trustType = "";
|
||||
}
|
||||
return APIBaseServices.baseProjectList(userId, trustType);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
[HttpGet]
|
||||
public Model.ResponeData weldInfoList()
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
return APIBaseServices.weldInfoList();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
[HttpGet]
|
||||
public Model.ResponeData baseUnitList(string projectId)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
return APIBaseServices.baseUnitList(projectId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public Model.ResponeData usePositionList(string projectId)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
return APIBaseServices.usePositionList(projectId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public Model.ResponeData baseTeamGroupList(string projectId,string unitId)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
return APIBaseServices.baseTeamGroupList(projectId, unitId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public Model.ResponeData bsWelderList(string projectId)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
return APIBaseServices.bsWelderList(projectId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public Model.ResponeData bsSteelList()
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
return APIBaseServices.bsSteelList();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
ViewBag.Title = "Home Page";
|
||||
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class IsoInfoController : ApiController
|
||||
{
|
||||
#region 保存管线信息
|
||||
/// <summary>
|
||||
/// 保存管线信息
|
||||
/// </summary>
|
||||
/// <param name="addItem">管线项</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData PostSaveIsoInfo([FromBody] Model.IsoInfoItem addItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
BLL.APIIsoInfoServicecs.SaveIsoInfo(addItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 批量保存管线信息
|
||||
/// <summary>
|
||||
/// 批量保存管线信息
|
||||
/// </summary>
|
||||
/// <param name="addItems">管线项</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData PostSaveIsoInfoList([FromBody] List<Model.IsoInfoItem> addItems)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
BLL.APIIsoInfoServicecs.SaveBatchIsoInfo(addItems);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class JointInfoController : ApiController
|
||||
{
|
||||
#region 保存焊口信息
|
||||
/// <summary>
|
||||
/// 保存焊口信息
|
||||
/// </summary>
|
||||
/// <param name="addItem">焊口项</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData PostSaveJointInfo([FromBody] Model.JointInfoItem addItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
BLL.APIJointInfoService.SaveJointInfo(addItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 批量保存焊口信息
|
||||
/// <summary>
|
||||
/// 批量保存焊口信息
|
||||
/// </summary>
|
||||
/// <param name="addItems">焊口项</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData PostSaveJointInfoList([FromBody] List<Model.JointInfoItem> addItems)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
BLL.APIJointInfoService.SaveBatchJointInfo(addItems);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using BLL.API;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class LoginController : ApiController
|
||||
{
|
||||
|
||||
[HttpPost]
|
||||
|
||||
public Model.ResponeData login([FromBody]UserItem user)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
return APILoginServices.login(user.Code, user.PassWord );
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class UnitInfoController: ApiController
|
||||
{
|
||||
#region 根据项目和单位类型获取分包单位
|
||||
/// <summary>
|
||||
/// 根据项目和单位类型获取分包单位
|
||||
/// </summary>
|
||||
/// <param name="projectCode">施工号</param>
|
||||
/// <param name="unitType">单位类型(1-业主,2-监理,3-总包,4-施工,5-质检,6-理化,7-热处理,8-检测)</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData getUnitByProjectIdUnitType([FromBody] Model.ParmItem parmItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIUnitInfoService.getUnitByProjectIdUnitType(parmItem.ProjectCode.Trim(), parmItem.UnitType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class ValuesController : ApiController
|
||||
{
|
||||
// GET api/values
|
||||
public IEnumerable<string> Get()
|
||||
{
|
||||
return new string[] { "value1", "value2" };
|
||||
}
|
||||
|
||||
// GET api/values/5
|
||||
public string Get(int id)
|
||||
{
|
||||
return "value";
|
||||
}
|
||||
|
||||
// POST api/values
|
||||
public void Post([FromBody]string value)
|
||||
{
|
||||
}
|
||||
|
||||
// PUT api/values/5
|
||||
public void Put(int id, [FromBody]string value)
|
||||
{
|
||||
}
|
||||
|
||||
// DELETE api/values/5
|
||||
public void Delete(int id)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using BLL.API;
|
||||
using Model;
|
||||
using Model.APIItem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class WeldController: ApiController
|
||||
{
|
||||
[HttpGet]
|
||||
public Model.ResponeData usingPlanList(string weldName, string needConfirm, string userId, string useState, int page, int pageSize)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(weldName) || weldName == "null")
|
||||
{
|
||||
weldName = "";
|
||||
}
|
||||
if (string.IsNullOrEmpty(needConfirm) || needConfirm == "null")
|
||||
{
|
||||
needConfirm = "";
|
||||
}
|
||||
if (string.IsNullOrEmpty(userId) || userId == "null")
|
||||
{
|
||||
userId = "";
|
||||
}
|
||||
if (string.IsNullOrEmpty(useState) || useState == "null")
|
||||
{
|
||||
useState = "";
|
||||
}
|
||||
return APIWeldServices.usingPlanList(weldName, needConfirm, userId, useState, page, pageSize);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
[HttpGet]
|
||||
public Model.ResponeData getUsingPlanById(string usingPlanId)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
return APIWeldServices.getUsingPlanById(usingPlanId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
[HttpGet]
|
||||
public Model.ResponeData welderQueIsPass(string welderId, string steelType, bool isSteelStru )
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(welderId) || welderId == "null")
|
||||
{
|
||||
welderId = "";
|
||||
}
|
||||
if (string.IsNullOrEmpty(steelType) || steelType == "null")
|
||||
{
|
||||
steelType = "";
|
||||
}
|
||||
|
||||
return APIWeldServices.welderQueIsPass( welderId, steelType, isSteelStru);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public Model.ResponeData addUsingPlan([FromBody] UsingPlanItem usingPlan)
|
||||
{
|
||||
Model.ResponeData respone = new ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
return APIWeldServices.addUsingPlan(usingPlan);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
respone.code = 0;
|
||||
respone.message = e.Message;
|
||||
}
|
||||
return respone;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
public class WeldingSynController : ApiController
|
||||
{
|
||||
#region 根据施工号和管线号获取该管线下所有焊口
|
||||
/// <summary>
|
||||
/// 根据施工号和管线号获取该管线下所有焊口
|
||||
/// </summary>
|
||||
/// <param name="projectCode">施工号</param>
|
||||
/// <param name="iso_No">管线号</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData getWeldingSynList([FromBody] Model.ParmItem parmItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIWeldingSynServic.getWeldingSynList(parmItem.ProjectCode, parmItem.Iso_No);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user