11212121
This commit is contained in:
@@ -1,156 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
public class BaseInfoController : ApiController
|
||||
{
|
||||
#region 根据登陆的用户ID获取项目列表(对施工单位)
|
||||
/// <summary>
|
||||
/// 根据登陆的用户ID获取项目列表
|
||||
/// </summary>
|
||||
/// <param name="userId">登陆的用户ID</param>
|
||||
/// <param name="projectArea">项目区域</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getProjectList(string userId, string projectArea)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getProjectList(userId, projectArea);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据项目区域获取项目列表(对查询)
|
||||
/// <summary>
|
||||
/// 根据项目区域获取项目列表
|
||||
/// </summary>
|
||||
/// <param name="userId">登陆的用户ID</param>
|
||||
/// <param name="projectArea">项目区域</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getProjectListByArea(string projectArea)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getProjectListByArea(projectArea);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据项目ID和施工单位获取区域列表
|
||||
/// <summary>
|
||||
/// 根据项目ID和施工单位获取区域列表
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="unitId">施工单位ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getWorkAreaList(string projectId, string unitId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getWorkAreaList(projectId, unitId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据项目ID和施工区域获取管线列表信息
|
||||
/// <summary>
|
||||
/// 根据项目ID和施工区域获取管线列表信息
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="wordAreaId">施工区域ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getPipeLineList(string projectId, string wordAreaId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getPipeLineList(projectId, wordAreaId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据管线ID获取焊口列表信息
|
||||
/// <summary>
|
||||
/// 根据管线ID获取焊口列表信息
|
||||
/// </summary>
|
||||
/// <param name="pipelineId">管线ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getWeldJointList(string pipelineId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getWeldJointList(pipelineId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据企业ID获取装置列表信息
|
||||
/// <summary>
|
||||
/// 根据管线ID获取焊口列表信息
|
||||
/// </summary>
|
||||
/// <param name="pipelineId">管线ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getInstallationList(string projectId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getInstallationList(projectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
public class CheckController : ApiController
|
||||
{
|
||||
#region 保存检查(巡检)信息
|
||||
/// <summary>
|
||||
/// 保存检查(巡检)信息
|
||||
/// </summary>
|
||||
/// <param name="newItem">检查信息</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData SaveCheckInfo([FromBody] Model.CheckItem newItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
APICheckService.SaveCheckInfo(newItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新检查(巡检)信息
|
||||
/// <summary>
|
||||
/// 保存检查(巡检)信息
|
||||
/// </summary>
|
||||
/// <param name="newItem">检查信息</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData UpdateReCheckInfo([FromBody] Model.CheckItem newItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
APICheckService.UpdateReCheckInfo(newItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取项目区域的检查列表
|
||||
/// <summary>
|
||||
/// 获取项目区域的检查列表
|
||||
/// </summary>
|
||||
/// <param name="projectArea">项目区域</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetCheckList(string projectArea)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APICheckService.GetCheckList(projectArea);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region
|
||||
/// <summary>
|
||||
/// 根据主建获取检查信息
|
||||
/// </summary>
|
||||
/// <param name="checkId">主建</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetCheckInfo(string checkId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APICheckService.GetCheckInfo(checkId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
public class FileUploadController : ApiController
|
||||
{
|
||||
#region 附件上传
|
||||
/// <summary>
|
||||
/// 附件上传
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IHttpActionResult Post()
|
||||
{
|
||||
HttpFileCollection files = HttpContext.Current.Request.Files;
|
||||
string typeName = HttpContext.Current.Request["typeName"];
|
||||
if (string.IsNullOrEmpty(typeName))
|
||||
{
|
||||
typeName = "WebApi";
|
||||
}
|
||||
string reUrl = string.Empty;
|
||||
if (files != null && files.Count > 0)
|
||||
{
|
||||
string folderUrl = "FileUpLoad/" + typeName + "/" + DateTime.Now.ToString("yyyy-MM") + "/";
|
||||
string localRoot = ConfigurationManager.AppSettings["localRoot"] + folderUrl; //物理路径
|
||||
if (!Directory.Exists(localRoot))
|
||||
{
|
||||
Directory.CreateDirectory(localRoot);
|
||||
}
|
||||
// foreach (string key in files.AllKeys)
|
||||
for(int i=0;i<files.Count;i++)
|
||||
{
|
||||
string rootUrl = string.Empty;
|
||||
string fileName = string.Empty;
|
||||
string extensionstr = string.Empty;
|
||||
HttpPostedFile file = files[i];//files[key];//file.ContentLength文件长度
|
||||
if (!string.IsNullOrEmpty(file.FileName))
|
||||
{
|
||||
extensionstr = Path.GetExtension(file.FileName).ToLower();
|
||||
fileName = Guid.NewGuid()+ extensionstr;
|
||||
rootUrl = localRoot + fileName;
|
||||
file.SaveAs(localRoot + fileName);
|
||||
}
|
||||
|
||||
if (extensionstr == ".jpg" || extensionstr == ".gif" || extensionstr == ".bmp" || extensionstr == ".png")
|
||||
{
|
||||
string TakePicDateTime = string.Empty;
|
||||
System.Drawing.Image image = System.Drawing.Image.FromStream(file.InputStream, true, false);
|
||||
Encoding ascii = Encoding.ASCII;
|
||||
//遍历图像文件元数据,检索所有属性
|
||||
foreach (System.Drawing.Imaging.PropertyItem p in image.PropertyItems)
|
||||
{
|
||||
//如果是PropertyTagDateTime,则返回该属性所对应的值
|
||||
if (p.Id == 0x0132)
|
||||
{
|
||||
TakePicDateTime = ascii.GetString(p.Value);
|
||||
}
|
||||
}
|
||||
TakePicDateTime = string.IsNullOrEmpty(TakePicDateTime) ? string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now) : TakePicDateTime;
|
||||
if (!string.IsNullOrEmpty(TakePicDateTime))
|
||||
{
|
||||
////获取元数据中的拍照日期时间,以字符串形式保存
|
||||
//TakePicDateTime = GetTakePicDateTime(pi);
|
||||
//分析字符串分别保存拍照日期和时间的标准格式
|
||||
var SpaceLocation = TakePicDateTime.IndexOf(" ");
|
||||
var dt = TakePicDateTime.Substring(0, SpaceLocation);
|
||||
dt = dt.Replace(":", "-");
|
||||
var tm = TakePicDateTime.Substring(SpaceLocation + 1, TakePicDateTime.Length - SpaceLocation - 2);
|
||||
TakePicDateTime = dt + " " + tm;
|
||||
//由列表中的文件创建内存位图对象
|
||||
var Pic = new Bitmap(rootUrl);
|
||||
//由位图对象创建Graphics对象的实例
|
||||
var g = Graphics.FromImage(Pic);
|
||||
Font ft = new Font("宋体", 20, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134)));//定义字体
|
||||
//在Graphics表面绘制数码照片的日期/时间戳
|
||||
g.DrawString(TakePicDateTime, ft, Brushes.Gold, 0, Pic.Height - 100);
|
||||
// - 50);
|
||||
string newRoot = localRoot + "newfile/";
|
||||
if (!Directory.Exists(newRoot))
|
||||
{
|
||||
Directory.CreateDirectory(newRoot);
|
||||
}
|
||||
|
||||
//将添加日期/时间戳后的图像进行保存
|
||||
Pic.Save(newRoot + fileName);
|
||||
fileName = "newfile/" + fileName;
|
||||
//释放内存位图对象
|
||||
Pic.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
if (string.IsNullOrEmpty(reUrl))
|
||||
{
|
||||
reUrl += folderUrl + fileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
reUrl += "," + folderUrl + fileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(reUrl);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
public class MessagePushController : ApiController
|
||||
{
|
||||
#region 推送的热处理委托单
|
||||
/// <summary>
|
||||
/// 推送的热处理委托单
|
||||
/// </summary>
|
||||
/// <param name="userId">登陆的用户ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetPushHotTrust(string userId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data =APIMessagePushService.GetPushHotTrust(userId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 推送的NDE检测委托单
|
||||
/// <summary>
|
||||
/// 推送的NDE检测委托单
|
||||
/// </summary>
|
||||
/// <param name="userId">登陆的用户ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetPushNDTTrust(string userId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIMessagePushService.GetPushNDTTrust(userId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 焊工一次合格率低于96%预警
|
||||
/// <summary>
|
||||
/// 焊工一次合格率低于96%预警
|
||||
/// </summary>
|
||||
/// <param name="projectArea">项目区域</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetWelderOnePassRateWarning(string projectArea)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIMessagePushService.GetWelderOnePassRateWarning(projectArea);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 施工单位一次合格率低于96%预警
|
||||
/// <summary>
|
||||
/// 施工单位一次合格率低于96%预警
|
||||
/// </summary>
|
||||
/// <param name="projectArea">项目区域</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetUnitOnePassRateWarning(string projectArea)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIMessagePushService.GetUnitOnePassRateWarning(projectArea);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
public class PreWeldingDailyController : ApiController
|
||||
{
|
||||
#region 保存焊接日报
|
||||
/// <summary>
|
||||
/// 保存焊接日报
|
||||
/// </summary>
|
||||
/// <param name="newItem">焊口信息</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData SavePreWeldingDaily([FromBody] List<Model.WeldJointItem > newItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
APIPreWeldingDailyService.SavePreWeldingDaily(newItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
public class ReportQueryController : ApiController
|
||||
{
|
||||
#region 根据焊工号获取焊工业绩
|
||||
/// <summary>
|
||||
/// 根据焊工号获取焊工业绩
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="welderCode"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetWelderPerformanceByWelderCode(string projectId, string welderCode)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIReportQueryService.GetWelderPerformanceByWelderCode(projectId, welderCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据条件获取管线综合信息
|
||||
/// <summary>
|
||||
/// 根据条件获取管线综合信息
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目</param>
|
||||
/// <param name="workAreaId">区域</param>
|
||||
/// <param name="pipelineCode">管线号</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetPipeLineInfo(string projectId, string workAreaId, string pipelineCode)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIReportQueryService.GetPipeLineInfo(projectId, workAreaId, pipelineCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 焊接工作量查询
|
||||
/// <summary>
|
||||
/// 焊接工作量查询
|
||||
/// </summary>
|
||||
/// <param name="projectArea">项目区域</param>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetWeldWorkload(string projectArea, string projectId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIReportQueryService.GetWeldWorkload(projectArea, projectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 拍片工作量查询
|
||||
/// <summary>
|
||||
/// 焊接工作量查询
|
||||
/// </summary>
|
||||
/// <param name="projectArea">项目区域</param>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData GetWeldNdtFilm(string projectArea, string projectId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIReportQueryService.GetWeldNdtFilm(projectArea, projectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
public class TaskController: ApiController
|
||||
{
|
||||
[HttpGet]
|
||||
public Model.ResponeData GetNDEAuditEmailTemplate()
|
||||
{
|
||||
var model=new Model.ResponeData();
|
||||
|
||||
try
|
||||
{
|
||||
//定时任务跑 监理 未审核的点口邮件
|
||||
BLL.TaskScheduleService.GetNDEAuditEmailTemplate(1);
|
||||
//定时任务跑 管理公司 未审核的点口邮件
|
||||
BLL.TaskScheduleService.GetNDEAuditEmailTemplate(2);
|
||||
model.code = 200;
|
||||
model.message = "OK";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog(ex, "The scheduled task failed to run the unaudited point-of-mail. Procedure");
|
||||
model.code=500;
|
||||
model.message = "Error";
|
||||
}
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
public class UserController : ApiController
|
||||
{
|
||||
#region 根据账号或手机号码登录方法
|
||||
/// <summary>
|
||||
/// 登录方法
|
||||
/// </summary>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData postLoginOn([FromBody] Model.UserItem userInfo)
|
||||
{
|
||||
//登录方法 Model.UserItem
|
||||
var responeData = new Model.ResponeData
|
||||
{
|
||||
message = "账号密码不匹配!"
|
||||
};
|
||||
try
|
||||
{
|
||||
////用户登录
|
||||
var user = APIUserService.UserLogOn(userInfo);
|
||||
if (user != null)
|
||||
{
|
||||
responeData.message = "登录成功!";
|
||||
responeData.data = user;
|
||||
}
|
||||
//else 暂不用
|
||||
//{
|
||||
// // 焊工登录
|
||||
// var user1 = APIWelderService.PersonLogOn(userInfo);
|
||||
// if (user1 != null)
|
||||
// {
|
||||
// responeData.message = "登录成功!";
|
||||
// responeData.code = 2;
|
||||
// responeData.data = user1;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据userid获取用户信息
|
||||
/// <summary>
|
||||
/// 根据userid获取用户信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getUserByUserId(string userId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIUserService.getUserByUserId(userId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据登陆用户的单位ID和选择的项目获取单位类型(1、建设方,2、总承包商,3、监理,4、检测,5、施工)
|
||||
/// <summary>
|
||||
/// 根据登陆用户的单位ID和选择的项目获取单位类型(1、建设方,2、总承包商,3、监理,4、检测,5、施工)
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="unitId">单位ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getUserInfo(string projectId, string unitId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIUserService.getUserInfo(projectId, unitId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取项目区域的用户列表
|
||||
/// <summary>
|
||||
/// 获取项目区域的用户列表
|
||||
/// </summary>
|
||||
/// <param name="projectArea">项目区域</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getUserListByProjectArea(string projectArea)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIUserService.getUserListByProjectArea(projectArea);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
{
|
||||
public class WelderController : ApiController
|
||||
{
|
||||
#region 获取焊工登录信息
|
||||
/// <summary>
|
||||
/// 获取焊工登录信息
|
||||
/// </summary>
|
||||
/// <param name="userInfo">焊工登录信息</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData WelderLogOn(Model.UserItem userInfo)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIWelderService.WelderLogOn(userInfo);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据项目ID和施工单位获取项目焊工列表信息
|
||||
/// <summary>
|
||||
/// 根据项目ID和施工单位获取项目焊工列表信息
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="unitId">施工单位ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getWelderList(string projectId, string unitId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIWelderService.getWelderList(projectId, unitId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user