diff --git a/HJGL/.vs/HJGL/v17/.suo b/HJGL/.vs/HJGL/v17/.suo index e1850e8..1bb5cea 100644 Binary files a/HJGL/.vs/HJGL/v17/.suo and b/HJGL/.vs/HJGL/v17/.suo differ diff --git a/HJGL/BLL/BLL.csproj b/HJGL/BLL/BLL.csproj index d13a5a3..d3515ff 100644 --- a/HJGL/BLL/BLL.csproj +++ b/HJGL/BLL/BLL.csproj @@ -120,6 +120,7 @@ + diff --git a/HJGL/BLL/Common/MailHelper.cs b/HJGL/BLL/Common/MailHelper.cs index ad2dc72..50df84f 100644 --- a/HJGL/BLL/Common/MailHelper.cs +++ b/HJGL/BLL/Common/MailHelper.cs @@ -1,6 +1,8 @@ -using Model; +using BLL; +using Model; using System; using System.Collections.Generic; +using System.Linq; using System.Net.Mail; namespace FineUIPro.Web.common { @@ -170,12 +172,13 @@ namespace FineUIPro.Web.common } - public static Email_Pop getEmailPop(string EmailID) + public static Email_Pop getEmailPop() { - Email_Pop pp = new Email_Pop(); - pp = BLL.Email_Send.Email_PopService.GetEmail_Pop(EmailID); + var pp = Funs.DB.Email_Pop.FirstOrDefault(); return pp; + + } } diff --git a/HJGL/BLL/Schedule/TaskScheduleService.cs b/HJGL/BLL/Schedule/TaskScheduleService.cs new file mode 100644 index 0000000..248368c --- /dev/null +++ b/HJGL/BLL/Schedule/TaskScheduleService.cs @@ -0,0 +1,78 @@ +using FineUIPro.Web.common; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class TaskScheduleService + { + + //NDE点口未审核统计 + public static int NDEWeldPointNotAuditStatusTotal(int type) + { + if (type == 0) + return 0; + + StringBuilder strSql = new StringBuilder(); + strSql.Append(@"SELECT count(1) FROM dbo.View_Batch_PointBatchItem WHERE PointState IS NOT NULL "); + switch (type) + { + case 1: + strSql.Append(" AND JLAudit='未审核'"); + break; + case 2: + strSql.Append(" AND GLGSAudit='未审核' "); + break; + } + + int totalCount= SQLHelper.getIntValue(strSql.ToString()); + + return totalCount; + } + + public static void GetNDEAuditEmailTemplate(int type) + { + var pop = MailHelper.getEmailPop(); + if (pop == null) + { + BLL.ErrLogInfo.WriteLog($"未配置邮件服务器"); + return; + } + string templateContent = string.Empty; + List emailSend = new List(); //发送人 + List emailCC = new List(); //抄送给 + string mailSubject = string.Empty; + string typeStr = string.Empty; + if (type == 1) + typeStr = "监理"; + if (type == 2) + typeStr = "管理公司"; + + var emailTemplate = BLL.Email_Send.Email_SendTemplateService.GetEmailNotifier(typeStr); + if (emailTemplate == null) + { + BLL.ErrLogInfo.WriteLog($"不存在此邮件模版"); + return; + } + emailSend = BLL.Email_Send.Email_SendTemplateService.GetEmailByTemplateId(emailTemplate.EmailId, "0"); + emailCC = BLL.Email_Send.Email_SendTemplateService.GetEmailByTemplateId(emailTemplate.EmailId, "1"); + if (emailSend.Count == 0) + { + BLL.ErrLogInfo.WriteLog($"未检测到发送人邮箱,请先配置邮箱地址"); + return; + } + mailSubject = $"{typeStr}—{emailTemplate.EailTiaoJian}"; //发送主题 + templateContent = emailTemplate.EmailContext; + int totalCount = BLL.TaskScheduleService.NDEWeldPointNotAuditStatusTotal(type); + templateContent = templateContent.Replace("{{totalCount}}", totalCount.ToString()); + + string resultMessage = ""; + MailHelper.SendNetMail(pop, pop.EmailYx, emailSend.ToArray(), mailSubject, templateContent, string.Empty, string.Empty, string.Empty, emailCC.ToArray(), out resultMessage); + + } + } +} diff --git a/HJGL/BLL/SendEmail/Email_SendTemplateService.cs b/HJGL/BLL/SendEmail/Email_SendTemplateService.cs index 1bca1f2..ec65e4c 100644 --- a/HJGL/BLL/SendEmail/Email_SendTemplateService.cs +++ b/HJGL/BLL/SendEmail/Email_SendTemplateService.cs @@ -1,4 +1,5 @@ using Model; +using NPOI.SS.Formula.Functions; using System; using System.Collections.Generic; using System.Data.Common; @@ -79,7 +80,7 @@ namespace BLL.Email_Send } #endregion - #region 根据主键删除EProject + #region 根据主键删除 /// /// 根据主键删除EProject /// @@ -95,7 +96,7 @@ namespace BLL.Email_Send } #endregion - #region 根据EmailNotifier查询EProject + #region 根据EmailNotifier查询 /// /// 根据EmailNotifier查询EProject /// @@ -106,7 +107,7 @@ namespace BLL.Email_Send } #endregion - #region 根据EmailNotifier查询EProject + #region 根据EmailNotifier查询 /// /// 根据EmailNotifier查询EProject /// @@ -117,6 +118,19 @@ namespace BLL.Email_Send } #endregion + #region 根据模版ID获取发送人列表 + public static List GetEmailByTemplateId(string templateId,string isCc) + { + var result = (from a in Funs.DB.Email_ToPeople + join b in Funs.DB.Sys_User on a.EmuserID equals b.UserId + where b.IsPost.Value && b.Email!="" + && a.EMPeopleType==isCc && a.EmtempID==templateId + select b.Email + ).ToList(); + + return result; + } + #endregion #region 事务提交 新增 /// diff --git a/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_Edit.aspx b/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_Edit.aspx index fa51bb6..4857287 100644 --- a/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_Edit.aspx +++ b/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_Edit.aspx @@ -8,7 +8,7 @@ - + 编辑
@@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - @@ -34,7 +34,7 @@ - @@ -53,8 +53,8 @@ - - + + @@ -63,7 +63,7 @@ - diff --git a/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_Edit.aspx.cs b/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_Edit.aspx.cs index 10403c9..7fdf4e4 100644 --- a/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_Edit.aspx.cs +++ b/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_Edit.aspx.cs @@ -107,6 +107,7 @@ namespace FineUIPro.Web.Email_Send ddlEmailParamsID.DataValueField = "MailClassID"; ddlEmailParamsID.DataSource = email_Params; ddlEmailParamsID.DataBind(); + ddlEmailParamsID.Items.Insert(0,new ListItem("","")); } #endregion diff --git a/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_List.aspx b/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_List.aspx index 15ae2a0..8f90836 100644 --- a/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_List.aspx +++ b/HJGL/FineUIPro.Web/Email_Send/Email_SendTemplate_List.aspx @@ -97,7 +97,7 @@ - diff --git a/HJGL/FineUIPro.Web/Email_Send/Email_Send_Edit.aspx.cs b/HJGL/FineUIPro.Web/Email_Send/Email_Send_Edit.aspx.cs index 6c653f9..9b575d3 100644 --- a/HJGL/FineUIPro.Web/Email_Send/Email_Send_Edit.aspx.cs +++ b/HJGL/FineUIPro.Web/Email_Send/Email_Send_Edit.aspx.cs @@ -107,9 +107,12 @@ namespace FineUIPro.Web.Email_Send protected void btnSave_Click(object sender, EventArgs e) { //string mailFrom = MailHelper.MailServerFrom; - Email_Pop pop = new Email_Pop(); - pop = MailHelper.getEmailPop("7EC5E991-B7A0-495A-90ED-2BE15370C959"); - + var pop = MailHelper.getEmailPop(); + if (pop == null) + { + ShowNotify("未配置邮件服务器", MessageBoxIcon.Error); + return; + } string mailFrom = pop.EmailYx; diff --git a/HJGL/FineUIPro.Web/Email_Send/SelectUserControl.ascx.cs b/HJGL/FineUIPro.Web/Email_Send/SelectUserControl.ascx.cs index d2e0d36..1b74c08 100644 --- a/HJGL/FineUIPro.Web/Email_Send/SelectUserControl.ascx.cs +++ b/HJGL/FineUIPro.Web/Email_Send/SelectUserControl.ascx.cs @@ -94,7 +94,7 @@ namespace FineUIPro.Web.Email_Send string sortField = Grid1.SortField; string sortDirection = Grid1.SortDirection; - string strSql = @"select a.UserId,b.UnitId,b.UserName,c.UnitName from Project_User as a inner join Sys_User as b on a.UserId=b.UserId + string strSql = @"select a.UserId,b.UnitId,b.UserName,c.UnitName,b.Email from Project_User as a inner join Sys_User as b on a.UserId=b.UserId inner join Base_Unit as c on b.UnitId=c.UnitId where b.IsPost=1 order by c.UnitName "; List listStr = new List(); SqlParameter[] parameter = listStr.ToArray(); diff --git a/HJGL/FineUIPro.Web/Global.asax.cs b/HJGL/FineUIPro.Web/Global.asax.cs index 834db2a..a99c92b 100644 --- a/HJGL/FineUIPro.Web/Global.asax.cs +++ b/HJGL/FineUIPro.Web/Global.asax.cs @@ -14,6 +14,8 @@ using System.Data; using System.Data.SqlClient; using BLL; + using FineUIPro.Web.common; + using System.Threading.Tasks; public class Global : System.Web.HttpApplication { @@ -47,6 +49,8 @@ // 开启线程 System.Threading.Thread LoadServiceData = new System.Threading.Thread(new System.Threading.ThreadStart(ExpirePoint)); LoadServiceData.Start(); + + } private void ExpirePoint() @@ -60,6 +64,7 @@ ExpirePoint.Elapsed += new System.Timers.ElapsedEventHandler(ExpirePoint_Elapsed); } + void ExpirePoint_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { @@ -141,7 +146,8 @@ } } - + + protected void Session_Start(object sender, EventArgs e) { Session.Timeout = 36000; diff --git a/HJGL/FineUIPro.Web/Web.config b/HJGL/FineUIPro.Web/Web.config index 9ecdad1..96e7b3b 100644 --- a/HJGL/FineUIPro.Web/Web.config +++ b/HJGL/FineUIPro.Web/Web.config @@ -14,7 +14,7 @@ providerName="System.Data.SqlClient" />--> - + diff --git a/HJGL/FineUIPro.Web/common/SysManage/UserListEdit.aspx.cs b/HJGL/FineUIPro.Web/common/SysManage/UserListEdit.aspx.cs index d510e42..dc14f67 100644 --- a/HJGL/FineUIPro.Web/common/SysManage/UserListEdit.aspx.cs +++ b/HJGL/FineUIPro.Web/common/SysManage/UserListEdit.aspx.cs @@ -69,7 +69,8 @@ namespace FineUIPro.Web.common.SysManage this.txtUserName.Text = user.UserName; this.txtAccount.Text = user.Account; this.txtDepart.Text = user.Depart; - + this.txtEmail.Text = user.Email; + this.txtEmailPassword.Text = user.EmailPassword; if (user.IsPost.HasValue) { this.cbIsPost.Checked = user.IsPost.Value; diff --git a/HJGL/WebApi/App_Start/WebApiConfig.cs b/HJGL/WebApi/App_Start/WebApiConfig.cs index 2f808d1..f92be46 100644 --- a/HJGL/WebApi/App_Start/WebApiConfig.cs +++ b/HJGL/WebApi/App_Start/WebApiConfig.cs @@ -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}", diff --git a/HJGL/WebApi/Controllers/BaseInfoController.cs b/HJGL/WebApi/Controllers/BaseInfoController.cs deleted file mode 100644 index d6bc745..0000000 --- a/HJGL/WebApi/Controllers/BaseInfoController.cs +++ /dev/null @@ -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获取项目列表(对施工单位) - /// - /// 根据登陆的用户ID获取项目列表 - /// - /// 登陆的用户ID - /// 项目区域 - /// - 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 根据项目区域获取项目列表(对查询) - /// - /// 根据项目区域获取项目列表 - /// - /// 登陆的用户ID - /// 项目区域 - /// - 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和施工单位获取区域列表 - /// - /// 根据项目ID和施工单位获取区域列表 - /// - /// 项目ID - /// 施工单位ID - /// - 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和施工区域获取管线列表信息 - /// - /// 根据项目ID和施工区域获取管线列表信息 - /// - /// 项目ID - /// 施工区域ID - /// - 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获取焊口列表信息 - /// - /// 根据管线ID获取焊口列表信息 - /// - /// 管线ID - /// - 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获取装置列表信息 - /// - /// 根据管线ID获取焊口列表信息 - /// - /// 管线ID - /// - 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 - - - } -} \ No newline at end of file diff --git a/HJGL/WebApi/Controllers/CheckController.cs b/HJGL/WebApi/Controllers/CheckController.cs deleted file mode 100644 index c9b9dab..0000000 --- a/HJGL/WebApi/Controllers/CheckController.cs +++ /dev/null @@ -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 保存检查(巡检)信息 - /// - /// 保存检查(巡检)信息 - /// - /// 检查信息 - /// - [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 更新检查(巡检)信息 - /// - /// 保存检查(巡检)信息 - /// - /// 检查信息 - /// - [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 获取项目区域的检查列表 - /// - /// 获取项目区域的检查列表 - /// - /// 项目区域 - /// - 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 - /// - /// 根据主建获取检查信息 - /// - /// 主建 - /// - 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 - } -} \ No newline at end of file diff --git a/HJGL/WebApi/Controllers/FileUploadController.cs b/HJGL/WebApi/Controllers/FileUploadController.cs deleted file mode 100644 index 797bab3..0000000 --- a/HJGL/WebApi/Controllers/FileUploadController.cs +++ /dev/null @@ -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 附件上传 - /// - /// 附件上传 - /// - /// - 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 - /// 推送的热处理委托单 - ///
- /// 登陆的用户ID - /// - 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检测委托单 - /// - /// 推送的NDE检测委托单 - /// - /// 登陆的用户ID - /// - 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%预警 - /// - /// 焊工一次合格率低于96%预警 - /// - /// 项目区域 - /// - 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%预警 - /// - /// 施工单位一次合格率低于96%预警 - /// - /// 项目区域 - /// - 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 - } -} \ No newline at end of file diff --git a/HJGL/WebApi/Controllers/PreWeldingDailyController.cs b/HJGL/WebApi/Controllers/PreWeldingDailyController.cs deleted file mode 100644 index b0ce8a1..0000000 --- a/HJGL/WebApi/Controllers/PreWeldingDailyController.cs +++ /dev/null @@ -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 保存焊接日报 - /// - /// 保存焊接日报 - /// - /// 焊口信息 - /// - [HttpPost] - public Model.ResponeData SavePreWeldingDaily([FromBody] List newItem) - { - var responeData = new Model.ResponeData(); - try - { - APIPreWeldingDailyService.SavePreWeldingDaily(newItem); - } - catch (Exception ex) - { - responeData.code = 0; - responeData.message = ex.Message; - } - - return responeData; - } - #endregion - } -} \ No newline at end of file diff --git a/HJGL/WebApi/Controllers/ReportQueryController.cs b/HJGL/WebApi/Controllers/ReportQueryController.cs deleted file mode 100644 index b40d643..0000000 --- a/HJGL/WebApi/Controllers/ReportQueryController.cs +++ /dev/null @@ -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 根据焊工号获取焊工业绩 - /// - /// 根据焊工号获取焊工业绩 - /// - /// - /// - /// - 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 根据条件获取管线综合信息 - /// - /// 根据条件获取管线综合信息 - /// - /// 项目 - /// 区域 - /// 管线号 - /// - 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 焊接工作量查询 - /// - /// 焊接工作量查询 - /// - /// 项目区域 - /// 项目Id - /// - 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 拍片工作量查询 - /// - /// 焊接工作量查询 - /// - /// 项目区域 - /// 项目Id - /// - 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 - } -} \ No newline at end of file diff --git a/HJGL/WebApi/Controllers/TaskController.cs b/HJGL/WebApi/Controllers/TaskController.cs new file mode 100644 index 0000000..35b69fa --- /dev/null +++ b/HJGL/WebApi/Controllers/TaskController.cs @@ -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; + } + } +} \ No newline at end of file diff --git a/HJGL/WebApi/Controllers/UserController.cs b/HJGL/WebApi/Controllers/UserController.cs deleted file mode 100644 index daeb7cd..0000000 --- a/HJGL/WebApi/Controllers/UserController.cs +++ /dev/null @@ -1,130 +0,0 @@ -using BLL; -using System; -using System.Linq; -using System.Web.Http; - -namespace WebAPI.Controllers -{ - /// - /// 用户 - /// - public class UserController : ApiController - { - #region 根据账号或手机号码登录方法 - /// - /// 登录方法 - /// - /// - /// - [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获取用户信息 - /// - /// 根据userid获取用户信息 - /// - /// - /// - 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、施工) - /// - /// 根据登陆用户的单位ID和选择的项目获取单位类型(1、建设方,2、总承包商,3、监理,4、检测,5、施工) - /// - /// 项目ID - /// 单位ID - /// - 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 获取项目区域的用户列表 - /// - /// 获取项目区域的用户列表 - /// - /// 项目区域 - /// - 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 - - - } -} diff --git a/HJGL/WebApi/Controllers/WelderController.cs b/HJGL/WebApi/Controllers/WelderController.cs deleted file mode 100644 index 3685980..0000000 --- a/HJGL/WebApi/Controllers/WelderController.cs +++ /dev/null @@ -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 获取焊工登录信息 - /// - /// 获取焊工登录信息 - /// - /// 焊工登录信息 - /// - 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和施工单位获取项目焊工列表信息 - /// - /// 根据项目ID和施工单位获取项目焊工列表信息 - /// - /// 项目ID - /// 施工单位ID - /// - 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 - } -} \ No newline at end of file diff --git a/HJGL/WebApi/ErrLog.txt b/HJGL/WebApi/ErrLog.txt new file mode 100644 index 0000000..ef9d8d6 --- /dev/null +++ b/HJGL/WebApi/ErrLog.txt @@ -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.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 + +未检测到发送人邮箱,请先配置邮箱地址 +未检测到发送人邮箱,请先配置邮箱地址 diff --git a/HJGL/WebApi/Filter/PermissionAttribute.cs b/HJGL/WebApi/Filter/PermissionAttribute.cs deleted file mode 100644 index fdb96cc..0000000 --- a/HJGL/WebApi/Filter/PermissionAttribute.cs +++ /dev/null @@ -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 -{ - /// - /// - /// - public class PermissionAttribute: ActionFilterAttribute - { - /// - /// - /// - /// - public override void OnActionExecuting(HttpActionContext actionContext) - { - bool isOk = false; - actionContext.Request.Headers.TryGetValues("token", out IEnumerable 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); - } - } - - /// - /// - /// - public static List lists = new List { "User*postLoginOn" }; - } -} \ No newline at end of file diff --git a/HJGL/WebApi/Web.config b/HJGL/WebApi/Web.config index fa4b215..c767bb2 100644 --- a/HJGL/WebApi/Web.config +++ b/HJGL/WebApi/Web.config @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ --> - + diff --git a/HJGL/WebApi/WebApi.csproj b/HJGL/WebApi/WebApi.csproj index 0e1a2d7..898a76b 100644 --- a/HJGL/WebApi/WebApi.csproj +++ b/HJGL/WebApi/WebApi.csproj @@ -157,16 +157,7 @@ - - - - - - - - - - + Global.asax @@ -228,6 +219,7 @@ +