303 lines
8.0 KiB
C#
303 lines
8.0 KiB
C#
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 getProjectList(string userId, string projectCode, string projectSoft, int page, int pageSize)
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
return APIBaseServices.getProjectList(userId, projectCode, projectSoft, page, pageSize);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
[HttpGet]
|
|
public Model.ResponeData weldInfoList(string weldName, string unitStoreId, int page, int pageSize)
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.weldInfoList(weldName, unitStoreId, page, pageSize);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
[HttpGet]
|
|
public Model.ResponeData getWeldInfo(string weldId)
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.getWeldInfo(weldId);
|
|
}
|
|
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, string usePositon, int page, int pageSize)
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.usePositionList(projectId, usePositon, page, pageSize);
|
|
}
|
|
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 unitStoreList()
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.unitStoreList();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
|
|
}
|
|
|
|
[HttpGet]
|
|
public Model.ResponeData bsSteelList(string ste_Code, int page, int pageSize)
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.bsSteelList(ste_Code, page, pageSize);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
|
|
[HttpGet]
|
|
public Model.ResponeData locationList()
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.locationList();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
|
|
[HttpGet]
|
|
public Model.ResponeData weldMethodList()
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.weldMethodList();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
|
|
[HttpGet]
|
|
public Model.ResponeData weldSilkList()
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.weldSilkList();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
|
|
[HttpGet]
|
|
public Model.ResponeData weldMatList()
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
|
|
return APIBaseServices.weldMatList();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
|
|
[HttpGet]
|
|
public Model.ResponeData getVersion()
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
using (Model.SGGLDB db = new Model.SGGLDB(BLL.Funs.ConnString))
|
|
{
|
|
Model.Sys_Const c = db.Sys_Const.FirstOrDefault(x => x.ConstText == "Version");
|
|
if (c != null)
|
|
{
|
|
respone.data = c.ConstValue;
|
|
return respone;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
|
|
[HttpGet]
|
|
public Model.ResponeData getVersionUrl()
|
|
{
|
|
Model.ResponeData respone = new ResponeData();
|
|
try
|
|
{
|
|
using (Model.SGGLDB db = new Model.SGGLDB(BLL.Funs.ConnString))
|
|
{
|
|
Model.Sys_Const c = db.Sys_Const.FirstOrDefault(x => x.ConstText == "VersionUrl");
|
|
if (c != null)
|
|
{
|
|
respone.data = c.ConstValue;
|
|
return respone;
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
respone.code = 0;
|
|
respone.message = e.Message;
|
|
}
|
|
return respone;
|
|
}
|
|
}
|
|
} |