11212121
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using WebAPI.Filter;
|
||||
|
||||
namespace WebApi
|
||||
{
|
||||
public static class WebApiConfig
|
||||
@@ -14,8 +12,6 @@ namespace WebApi
|
||||
GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();
|
||||
// Web API 路由
|
||||
config.MapHttpAttributeRoutes();
|
||||
//
|
||||
config.Filters.Add(new PermissionAttribute());
|
||||
config.Routes.MapHttpRoute(
|
||||
name: "DefaultApi",
|
||||
routeTemplate: "api/{controller}/{action}/{id}",
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
错误信息开始=====>
|
||||
错误类型:NotSupportedException
|
||||
错误信息:方法“Boolean IsNullOrEmpty(System.String)”不支持转换为 SQL。
|
||||
错误堆栈:
|
||||
在 System.Data.Linq.SqlClient.PostBindDotNetConverter.Visitor.TranslateStringStaticMethod(SqlMethodCall mc)
|
||||
在 System.Data.Linq.SqlClient.PostBindDotNetConverter.Visitor.VisitMethodCall(SqlMethodCall mc)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitExpression(SqlExpression exp)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitUnaryOperator(SqlUnary uo)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitExpression(SqlExpression exp)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitBinaryOperator(SqlBinary bo)
|
||||
在 System.Data.Linq.SqlClient.PostBindDotNetConverter.Visitor.VisitBinaryOperator(SqlBinary bo)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitExpression(SqlExpression exp)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitBinaryOperator(SqlBinary bo)
|
||||
在 System.Data.Linq.SqlClient.PostBindDotNetConverter.Visitor.VisitBinaryOperator(SqlBinary bo)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitExpression(SqlExpression exp)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitSelectCore(SqlSelect select)
|
||||
在 System.Data.Linq.SqlClient.PostBindDotNetConverter.Visitor.VisitSelect(SqlSelect select)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitAlias(SqlAlias a)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitSource(SqlSource source)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.VisitSelectCore(SqlSelect select)
|
||||
在 System.Data.Linq.SqlClient.PostBindDotNetConverter.Visitor.VisitSelect(SqlSelect select)
|
||||
在 System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node)
|
||||
在 System.Data.Linq.SqlClient.SqlProvider.BuildQuery(ResultShape resultShape, Type resultType, SqlNode node, ReadOnlyCollection`1 parentParameters, SqlNodeAnnotations annotations)
|
||||
在 System.Data.Linq.SqlClient.SqlProvider.BuildQuery(Expression query, SqlNodeAnnotations annotations)
|
||||
在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
|
||||
在 System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
|
||||
在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
|
||||
在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
|
||||
在 BLL.Email_Send.Email_SendTemplateService.GetEmailByTemplateId(String templateId, String isCc) 位置 E:\湛江巴斯夫\Basf_TCC7\HJGL\BLL\SendEmail\Email_SendTemplateService.cs:行号 124
|
||||
在 BLL.TaskScheduleService.GetNDEAuditEmailTemplate(Int32 type) 位置 E:\湛江巴斯夫\Basf_TCC7\HJGL\BLL\Schedule\TaskScheduleService.cs:行号 51
|
||||
在 WebApi.Controllers.TaskController.GetNDEAuditEmailTemplate() 位置 E:\湛江巴斯夫\Basf_TCC7\HJGL\WebApi\Controllers\TaskController.cs:行号 19
|
||||
出错时间:05/17/2024 11:16:43
|
||||
The scheduled task failed to run the unaudited point-of-mail. Procedure
|
||||
出错时间:05/17/2024 11:16:43
|
||||
|
||||
未检测到发送人邮箱,请先配置邮箱地址
|
||||
未检测到发送人邮箱,请先配置邮箱地址
|
||||
@@ -1,61 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Filters;
|
||||
|
||||
namespace WebAPI.Filter
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class PermissionAttribute: ActionFilterAttribute
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="actionContext"></param>
|
||||
public override void OnActionExecuting(HttpActionContext actionContext)
|
||||
{
|
||||
bool isOk = false;
|
||||
actionContext.Request.Headers.TryGetValues("token", out IEnumerable<string> token);
|
||||
string strValues = actionContext.ActionDescriptor.ControllerDescriptor.ControllerName + "*" + ((ReflectedHttpActionDescriptor)actionContext.ActionDescriptor).ActionName;
|
||||
if (lists.FirstOrDefault(x => x == strValues) != null)
|
||||
{
|
||||
isOk = true;
|
||||
}
|
||||
|
||||
if (!isOk && token != null)
|
||||
{
|
||||
var getUser = BLL.Sys_UserService.GetUsersByUserId(token.FirstOrDefault());
|
||||
if (getUser != null)
|
||||
{
|
||||
isOk = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var getPerson = BLL.WelderService .GetWelderById(token.FirstOrDefault());
|
||||
if (getPerson != null)
|
||||
{
|
||||
isOk = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// base.OnActionExecuting(actionContext);
|
||||
if (isOk)
|
||||
{
|
||||
base.OnActionExecuting(actionContext);
|
||||
}
|
||||
else
|
||||
{
|
||||
actionContext.Response = actionContext.Request.CreateResponse(System.Net.HttpStatusCode.OK,
|
||||
new { code = "0", message = "您没有权限!" }, actionContext.ControllerContext.Configuration.Formatters.JsonFormatter);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static List<string> lists = new List<string> { "User*postLoginOn" };
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
<add key="ClientValidationEnabled" value="true"/>
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
|
||||
<!--连接字符串-->
|
||||
<add key="ConnectionString" value="Server=.;Database=whhjdb;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>
|
||||
<add key="ConnectionString" value="Server=.;Database=HJGLDB_ZJBSF;Integrated Security=False;User ID=sa;Password=Sh@nghai9;MultipleActiveResultSets=true;Connect Timeout=1200"/>
|
||||
<!--版本号-->
|
||||
<add key="SystemVersion" value="WebApi_V2019-09-20-001"/>
|
||||
<!--附件上传物理路径-->
|
||||
@@ -27,7 +27,7 @@
|
||||
</system.Web>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation debug="false" targetFramework="4.8"/>
|
||||
<compilation debug="true" targetFramework="4.8"/>
|
||||
<httpRuntime targetFramework="4.6.1"/>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
|
||||
@@ -157,16 +157,7 @@
|
||||
<Compile Include="Areas\HelpPage\SampleGeneration\SampleDirection.cs" />
|
||||
<Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />
|
||||
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
|
||||
<Compile Include="Controllers\BaseInfoController.cs" />
|
||||
<Compile Include="Controllers\CheckController.cs" />
|
||||
<Compile Include="Controllers\FileUploadController.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Controllers\MessagePushController.cs" />
|
||||
<Compile Include="Controllers\PreWeldingDailyController.cs" />
|
||||
<Compile Include="Controllers\ReportQueryController.cs" />
|
||||
<Compile Include="Controllers\UserController.cs" />
|
||||
<Compile Include="Controllers\WelderController.cs" />
|
||||
<Compile Include="Filter\PermissionAttribute.cs" />
|
||||
<Compile Include="Controllers\TaskController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
@@ -228,6 +219,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="Filter\" />
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user