代码合并

T_FM_SYNC_LOG 添加 时间限制才入库
log4Net 年月 添加
跑批 部分添加 try catch 记录错误(大概率比较少错误了懒得全部添加过来)
隐患整改单 获取数据改进 (检查库 添加 整改单 查看)
FMFlowPermitService 添加 记录信息 防止 全部注入依赖
This commit is contained in:
wyw 2024-04-09 13:56:33 +08:00
parent 00d009d88f
commit f0f1669d2a
40 changed files with 5907 additions and 5313 deletions

View File

@ -21,6 +21,7 @@ namespace APT.BaseData.Services.Services.FM
{ {
/// <summary> /// <summary>
/// 送审后,单据特殊处理 /// 送审后,单据特殊处理
/// wyw此文件如果引入别的service 可能导致整个服务 都要依赖注入(引用依赖)
/// </summary> /// </summary>
public class FMFlowPermitService : CommonService, IFMFlowPermitService public class FMFlowPermitService : CommonService, IFMFlowPermitService
{ {
@ -28,16 +29,13 @@ namespace APT.BaseData.Services.Services.FM
IFMNotificationTaskService NotificationTaskService { get; set; } IFMNotificationTaskService NotificationTaskService { get; set; }
IPFSysLogService SysLogService { get; set; } IPFSysLogService SysLogService { get; set; }
IPFApproveCallBackService ApproveCallBackService { get; set; } IPFApproveCallBackService ApproveCallBackService { get; set; }
IBSOperateLogService BSOperateLogService { get; set; } public FMFlowPermitService(IRepository repository, IPFCodeRuleService codeRuleService, IFMNotificationTaskService notificationTaskService, IPFSysLogService sysLogService, IPFApproveCallBackService approveCallBackService)
public FMFlowPermitService(IRepository repository, IPFCodeRuleService codeRuleService, IFMNotificationTaskService notificationTaskService, IPFSysLogService sysLogService, IPFApproveCallBackService approveCallBackService, IBSOperateLogService bsOperateLogService)
: base(repository) : base(repository)
{ {
CodeRuleService = codeRuleService; CodeRuleService = codeRuleService;
NotificationTaskService = notificationTaskService; NotificationTaskService = notificationTaskService;
SysLogService = sysLogService; SysLogService = sysLogService;
ApproveCallBackService = approveCallBackService; ApproveCallBackService = approveCallBackService;
BSOperateLogService = bsOperateLogService;
} }
/// <summary> /// <summary>
@ -590,7 +588,7 @@ namespace APT.BaseData.Services.Services.FM
} }
} }
listBSLog = BSOperateLogService.GetListOperateLog(OPERATEPOINT, id, APT.Infrastructure.Api.AppContext.CurrentSession.UserID.Value, null, ListUserID, ListUserName, approve.ORG_ID, null, null); listBSLog = GetListOperateLog(OPERATEPOINT, id, APT.Infrastructure.Api.AppContext.CurrentSession.UserID.Value, null, ListUserID, ListUserName, approve.ORG_ID, null, null);
} }
catch { } catch { }
} }
@ -1954,5 +1952,155 @@ namespace APT.BaseData.Services.Services.FM
//#endregion //#endregion
//#endregion //#endregion
#region BSOperateLogService
public List<T_BS_OPERATE_LOG> GetListOperateLog(OPERATEPOINT_Enums OPERATEPOINT, Guid DATA_ID, Guid UserIDLogin, List<Guid> ListDATA_ID, List<Guid> ListUserID, List<string> ListUserName, Guid? ORG_ID, Guid? DATA_ID_SUB = null, List<Guid> ListUserIDDone = null, bool isEnd = true)
{
List<T_BS_OPERATE_LOG> listResult = new List<T_BS_OPERATE_LOG>();
T_BS_OPERATE_LOG modelLogUpdate = null;
switch (OPERATEPOINT)
{
case OPERATEPOINT_Enums.GotCheck:
//系统触发 只是新增
if (ListUserID != null && ListUserName != null)
for (int i = 0; i < ListUserID.Count; i++)
listResult.Add(AddModel(OPERATEPOINT, ListDATA_ID[i], ListUserID[i], ListUserName[i], ORG_ID, i));
break;
case OPERATEPOINT_Enums.CheckForm:
//BS032保存并发送 到审批流
modelLogUpdate = GetUpdateDeal(OPERATEPOINT_Enums.GotCheck, DATA_ID, UserIDLogin);
if (modelLogUpdate != null)
listResult.Add(modelLogUpdate);
if (ListUserID != null && ListUserName != null)
for (int i = 0; i < ListUserID.Count; i++)
listResult.Add(AddModel(OPERATEPOINT, DATA_ID, ListUserID[i], ListUserName[i], ORG_ID, i));
break;
case OPERATEPOINT_Enums.CheckAudit:
modelLogUpdate = GetUpdateDeal(OPERATEPOINT, DATA_ID, UserIDLogin);//处理自己的待办日志
if (modelLogUpdate != null)
listResult.Add(modelLogUpdate);
if (ListUserID != null && ListUserName != null)
for (int i = 0; i < ListUserID.Count; i++)//最后一个审批人 添加 通知
listResult.Add(AddModel(OPERATEPOINT_Enums.CheckerCheck, DATA_ID, ListUserID[i], ListUserName[i], ORG_ID, i));
break;
case OPERATEPOINT_Enums.CheckerCheck:
modelLogUpdate = GetUpdateDeal(OPERATEPOINT, DATA_ID, UserIDLogin);//处理自己的
if (modelLogUpdate != null)
listResult.Add(modelLogUpdate);
break;
case OPERATEPOINT_Enums.CheckRegister:
//检查登记
modelLogUpdate = GetUpdateDeal(OPERATEPOINT, DATA_ID, UserIDLogin);//处理自己的
if (modelLogUpdate != null)
listResult.Add(modelLogUpdate);
if (ListUserID != null && ListUserName != null)
for (int i = 0; i < ListUserID.Count; i++) //发起检查结果确认
listResult.Add(AddModel(OPERATEPOINT_Enums.CheckAgree, DATA_ID, ListUserID[i], ListUserName[i], ORG_ID, i));
break;
case OPERATEPOINT_Enums.CheckAgree:
modelLogUpdate = GetUpdateDeal(OPERATEPOINT, DATA_ID, UserIDLogin);//处理自己的
if (modelLogUpdate != null)
listResult.Add(modelLogUpdate);
if (ListUserID != null && ListUserName != null)
for (int i = 0; i < ListUserID.Count; i++) //检查结果确认完 直接到审批
listResult.Add(AddModel(OPERATEPOINT_Enums.CheckResultAudit, DATA_ID, ListUserID[i], ListUserName[i], ORG_ID, i));
break;
case OPERATEPOINT_Enums.CheckResultAudit:
modelLogUpdate = GetUpdateDeal(OPERATEPOINT, DATA_ID, UserIDLogin);//处理自己的
if (modelLogUpdate != null)
listResult.Add(modelLogUpdate);
if (isEnd) //最后一个审批就归档
{
listResult.Add(AddModel(OPERATEPOINT_Enums.CheckEnd, DATA_ID, UserIDLogin, APT.Infrastructure.Api.AppContext.CurrentSession.UserName, ORG_ID));
}
break;
case OPERATEPOINT_Enums.CheckEnd:
//此处没操作
break;
case OPERATEPOINT_Enums.RiskNoticeSD:
break;
case OPERATEPOINT_Enums.RiskUpSD:
break;
case OPERATEPOINT_Enums.RiskInfoCompleteSD:
break;
case OPERATEPOINT_Enums.RiskGet:
//审批结束后 如果有隐患
if (ListUserID != null && ListUserName != null)
for (int i = 0; i < ListUserID.Count; i++)
listResult.Add(AddModel(OPERATEPOINT, DATA_ID, ListUserID[i], ListUserName[i], ORG_ID, i));
break;
case OPERATEPOINT_Enums.RiskSend:
break;
default:
break;
}
if (ListUserIDDone != null && ListUserIDDone.Count > 0)
{
//除了登陆者 需要默认操作的
listResult.ForEach(e =>
{
if (ListUserIDDone.Contains(e.USER_ID))
e.OPERTETIME = DateTime.Now;
});
}
return listResult;
}
/// <summary>
/// 获取新记录
/// </summary>
/// <param name="OPERATEPOINT"></param>
/// <param name="DATA_ID"></param>
/// <param name="UserID"></param>
/// <param name="UserName"></param>
/// <param name="ORG_ID"></param>
/// <returns></returns>
private T_BS_OPERATE_LOG AddModel(OPERATEPOINT_Enums OPERATEPOINT, Guid DATA_ID, Guid UserID, string UserName, Guid? ORG_ID, int ORDERNO = 0)
{
T_BS_OPERATE_LOG ModelAdd = new T_BS_OPERATE_LOG()
{
ID = Guid.NewGuid(),
ORG_ID = ORG_ID,
LOGTYPE = ((int)OPERATEPOINT) > 80 ? LOGTYPE_Enums.RiskSubmit : LOGTYPE_Enums.SafeCheck,
DATA_ID = DATA_ID,
//DATA_ID_SUB = null,
OPERATEPOINT = OPERATEPOINT,
USER_ID = UserID,
USRTNAME = UserName,
ORDERNO = ORDERNO,
//OPERTETIME = null,
ISINTTIME = false,
CREATE_TIME = DateTime.Now,
CREATER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID
};
if (APT.Infrastructure.Api.AppContext.CurrentSession.UserID.HasValue && APT.Infrastructure.Api.AppContext.CurrentSession.UserID.Value == UserID)
{
ModelAdd.OPERTETIME = DateTime.Now;//默认通过
}
return ModelAdd;
}
/// <summary>
/// 获取需要修改的Model
/// </summary>
/// <param name="OPERATEPOINT">操作节点</param>
/// <param name="DATA_ID"></param>
/// <param name="UserID"></param>
/// <param name="DATA_ID_SUB"></param>
/// <returns></returns>
private T_BS_OPERATE_LOG GetUpdateDeal(OPERATEPOINT_Enums OPERATEPOINT, Guid DATA_ID, Guid UserID, Guid? DATA_ID_SUB = null)
{
Expression<Func<T_BS_OPERATE_LOG, bool>> expression = e => e.DATA_ID == DATA_ID && e.OPERATEPOINT == OPERATEPOINT && e.USER_ID == UserID;
if (DATA_ID_SUB.HasValue)
expression = expression.And(e => e.DATA_ID_SUB.HasValue && e.DATA_ID_SUB == DATA_ID_SUB);
var model = GetEntity(expression);
if (model != null)
model.OPERTETIME = DateTime.Now;
return model;
}
#endregion
} }
} }

View File

@ -352,6 +352,7 @@ builder.HasOne(t => t.Nav_Department).WithMany().HasForeignKey(t => t.DEPARTMENT
builder.HasOne(t => t.Nav_ApproveCheckAudit).WithMany().HasForeignKey(t => t.APPROVE_ID).OnDelete(DeleteBehavior.Restrict); builder.HasOne(t => t.Nav_ApproveCheckAudit).WithMany().HasForeignKey(t => t.APPROVE_ID).OnDelete(DeleteBehavior.Restrict);
builder.Ignore(t => t.FORM_CODE); builder.Ignore(t => t.FORM_CODE);
builder.Ignore(t => t.IS_OVERTIME); builder.Ignore(t => t.IS_OVERTIME);
builder.Ignore(t => t.CREATE_NAME);
} }
} }
#endregion #endregion

View File

@ -207,5 +207,18 @@ namespace APT.MS.Domain.Entities.BS
public bool? ISFINISHINTTIME { get; set; } public bool? ISFINISHINTTIME { get; set; }
[DataFieldIngore] [DataFieldIngore]
public int IS_OVERTIME { get; set; } public int IS_OVERTIME { get; set; }
/// <summary>
/// 外界IDTPM
/// </summary>
public Guid? DATAID { get; set; }
/// <summary>
/// 完善人
/// </summary>
[Description("完善人")]
[DataFieldIngore]
public string CREATE_NAME { get; set; }
} }
} }

View File

@ -13,6 +13,7 @@ namespace APT.MS.Domain.Entities.BS
/// 隐患上报明细 隐患上报子表(关联检查内容) /// 隐患上报明细 隐患上报子表(关联检查内容)
/// </summary> /// </summary>
[Description("隐患上报明细")] [Description("隐患上报明细")]
[DataRuleField("DEPARTMENT_ID")]
public class T_BS_RISK_SUBMIT_CONTENT : MesEntityBase public class T_BS_RISK_SUBMIT_CONTENT : MesEntityBase
{ {
/// <summary> /// <summary>

View File

@ -1,9 +1,10 @@
using APT.MS.Domain.Entities.BS; using APT.Infrastructure.Api;
using APT.MS.Domain.Entities.BS;
using APT.MS.Domain.Enums; using APT.MS.Domain.Enums;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace APT.BaseData.Domain.IServices.BS namespace APT.BaseData.Domain.IServices
{ {
public interface IBSOperateLogService public interface IBSOperateLogService
{ {

View File

@ -25,6 +25,6 @@ namespace APT.BaseData.Domain.IServices
/// <param name="listUserID"></param> /// <param name="listUserID"></param>
/// <param name="entity"></param> /// <param name="entity"></param>
/// <param name="listAllUser"></param> /// <param name="listAllUser"></param>
void GetEntityInfo(Guid MEETINGID, string NAME, string THEME, string CODE, Guid? ORG_ID, Guid DEPARTMENT_ID, int? DEPARTMENT_TYPE, Guid USER_ID_ORIGINATOR, CREACTTYPEEnum CREACTTYPE, SCMEETINGTYPE MEETINGTYPE, IEnumerable<Guid> listUserID, out T_SC_MT_MEETING entity, out List<T_SC_MT_MEETING_PALL> listAllUser); List<T_SC_MT_MEETING_PALL> GetEntityInfo(Guid MEETINGID, string NAME, string THEME, string CODE, Guid? ORG_ID, Guid DEPARTMENT_ID, int? DEPARTMENT_TYPE, Guid USER_ID_ORIGINATOR, CREACTTYPEEnum CREACTTYPE, SCMEETINGTYPE MEETINGTYPE, IEnumerable<Guid> listUserID, out T_SC_MT_MEETING entity);
} }
} }

View File

@ -16,7 +16,7 @@ using APT.BaseData.Domain.IServices.BS;
using APT.MS.Domain.Entities.BS; using APT.MS.Domain.Entities.BS;
namespace APT.BaseData.Services.Services.BS namespace APT.BaseData.Services.DomainServices
{ {
/// <summary> /// <summary>
/// 安全检查 /// 安全检查
@ -185,9 +185,7 @@ namespace APT.BaseData.Services.Services.BS
expression = expression.And(e => e.DATA_ID_SUB.HasValue && e.DATA_ID_SUB == DATA_ID_SUB); expression = expression.And(e => e.DATA_ID_SUB.HasValue && e.DATA_ID_SUB == DATA_ID_SUB);
var model = GetEntity(expression); var model = GetEntity(expression);
if (model != null) if (model != null)
{
model.OPERTETIME = DateTime.Now; model.OPERTETIME = DateTime.Now;
}
return model; return model;
} }

View File

@ -48,13 +48,13 @@ namespace APT.BaseData.Services.DomainServices
/// <param name="listUserID"></param> /// <param name="listUserID"></param>
/// <param name="entity"></param> /// <param name="entity"></param>
/// <param name="listAllUser"></param> /// <param name="listAllUser"></param>
public void GetEntityInfo(Guid MEETINGID, string NAME, string THEME, string CODE, Guid? ORG_ID, Guid DEPARTMENT_ID, int? DEPARTMENT_TYPE, Guid USER_ID_ORIGINATOR, CREACTTYPEEnum CREACTTYPE, SCMEETINGTYPE MEETINGTYPE, IEnumerable<Guid> listUserID, out T_SC_MT_MEETING entity, out List<T_SC_MT_MEETING_PALL> listAllUser) public List<T_SC_MT_MEETING_PALL> GetEntityInfo(Guid MEETINGID, string NAME, string THEME, string CODE, Guid? ORG_ID, Guid DEPARTMENT_ID, int? DEPARTMENT_TYPE, Guid USER_ID_ORIGINATOR, CREACTTYPEEnum CREACTTYPE, SCMEETINGTYPE MEETINGTYPE, IEnumerable<Guid> listUserID, out T_SC_MT_MEETING entity)
{ {
listAllUser = new List<T_SC_MT_MEETING_PALL>(); var listAllUser = new List<T_SC_MT_MEETING_PALL>();
entity = new T_SC_MT_MEETING(); entity = new T_SC_MT_MEETING();
if (listUserID == null || !listUserID.Any()) if (listUserID == null || !listUserID.Any())
{ {
return; return listAllUser;
} }
if (listUserID != null && listUserID.Any()) if (listUserID != null && listUserID.Any())
{ {
@ -119,6 +119,7 @@ namespace APT.BaseData.Services.DomainServices
modelUser.PERSONNATURE = PersonNature.JOIN; modelUser.PERSONNATURE = PersonNature.JOIN;
listAllUser.Add(modelUser); listAllUser.Add(modelUser);
} }
return listAllUser;
} }
} }
} }

View File

@ -65,9 +65,9 @@ namespace APT.WebApi.Models
} }
} }
var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds; double TalSeconds = (DateTime.Now - START_TIME).TotalSeconds;
//if (TalSeconds > 1) if (TalSeconds > 0.8)
//{ {
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() T_FM_SYNC_LOG log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
@ -121,6 +121,7 @@ namespace APT.WebApi.Models
} }
} }
} }
}
catch catch
{ {
} }

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -56,11 +56,11 @@ namespace APT.BS.WebApi.Controllers.Api
} }
} }
filter.Include = Include; filter.Include = Include;
var modelSubConDel = GetEntity<T_BS_RISK_SUBMIT_CONTENT_DEAL>(null, filter);
List<FilterRule> filterRules = filter.FilterGroup.Rules.ToList(); if (modelSubConDel == null)
var guid = new Guid(filterRules[0].Value.ToString()); {
var modelSubConDel = GetEntity<T_BS_RISK_SUBMIT_CONTENT_DEAL>(e => e.ID == guid, filter); throw new Exception("获取整改单信息失败!");
}
List<Guid> listUserID = new List<Guid>(); List<Guid> listUserID = new List<Guid>();
if (modelSubConDel.DEAL_USER_ID.HasValue) if (modelSubConDel.DEAL_USER_ID.HasValue)
listUserID.Add(modelSubConDel.DEAL_USER_ID.Value); listUserID.Add(modelSubConDel.DEAL_USER_ID.Value);

View File

@ -4099,6 +4099,21 @@ namespace APT.BS.WebApi.Controllers.Api
//Expression<Func<T_BS_RISK_SUBMIT, bool>> expression = e => !e.IS_DELETED && e.DEPARTMENT_ID.HasValue && departmentIds.Contains(e.DEPARTMENT_ID.Value); //Expression<Func<T_BS_RISK_SUBMIT, bool>> expression = e => !e.IS_DELETED && e.DEPARTMENT_ID.HasValue && departmentIds.Contains(e.DEPARTMENT_ID.Value);
PagedActionResult<T_BS_RISK_SUBMIT> orderPageEntities = GetOrderPageEntities(expression, pageFilter, null); PagedActionResult<T_BS_RISK_SUBMIT> orderPageEntities = GetOrderPageEntities(expression, pageFilter, null);
if (orderPageEntities.TotalCount > 0)
{
var listCreateID = orderPageEntities.Data.Where(e => e.CREATER_ID.HasValue).Select(e => e.CREATER_ID.Value).Distinct();
if (listCreateID != null && listCreateID.Any())
{
var listUser = GetEntities<T_FM_USER>(e => listCreateID.Contains(e.ID), null, null);
foreach (var item in orderPageEntities.Data)
{
if (!item.CREATER_ID.HasValue)
continue;
item.CREATE_NAME = listUser.FirstOrDefault(e => e.ID == item.CREATER_ID.Value)?.NAME;
}
}
}
result.Data = orderPageEntities.Data; result.Data = orderPageEntities.Data;
result.TotalCount = orderPageEntities.TotalCount; result.TotalCount = orderPageEntities.TotalCount;
}); });
@ -4854,8 +4869,9 @@ namespace APT.BS.WebApi.Controllers.Api
} }
} }
BaseFilter filterRiskContent = new BaseFilter(); BaseFilter filterRiskContent = new BaseFilter(pageFilter.OrgId);
filterRiskContent.SelectField = new List<string> { "ID", "QUESTION_LEVEL", "RISK_AREA_ID", "CHECKCONTENT", "DESCREPTION" }; filterRiskContent.SelectField = new List<string> { "ID", "QUESTION_LEVEL", "RISK_AREA_ID", "CHECKCONTENT", "DESCREPTION" };
filterRiskContent.IgnoreDataRule = true;
var IlistRiskContent = GetEntities(expressionSC, filterRiskContent); var IlistRiskContent = GetEntities(expressionSC, filterRiskContent);
BaseFilter filterArea = new BaseFilter(); BaseFilter filterArea = new BaseFilter();
@ -5579,6 +5595,7 @@ namespace APT.BS.WebApi.Controllers.Api
#endregion #endregion
#region #region
@ -6131,6 +6148,9 @@ namespace APT.BS.WebApi.Controllers.Api
entity.STARTTIME = task.CREATE_TIME; entity.STARTTIME = task.CREATE_TIME;
} }
//记录完善人信息
entity.CREATER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
entity.CREATE_TIME = DateTime.Now;
if (entity.SUBMIT_STATUS == (int)BSSubmitStatusEnum.Temp) if (entity.SUBMIT_STATUS == (int)BSSubmitStatusEnum.Temp)
{ {
this.UnifiedCommit(() => this.UnifiedCommit(() =>

View File

@ -1879,12 +1879,14 @@ namespace APT.BS.WebApi.Controllers.Api
item.Nav_Standard = null; item.Nav_Standard = null;
} }
} }
if (DataHelper.GetRequestType(HttpContext.Response.Headers) == 2) //var requestType = DataHelper.GetRequestType(HttpContext.Response.Headers);
//if (DataHelper.GetRequestType(HttpContext.Response.Headers) == 2)
//{
if (listDetail != null && listDetail.Count > 0)
{ {
foreach (var item in listDetail) foreach (var item in listDetail)
{ {
if (item.Nav_SafeCheck != null) if (item.Nav_SafeCheck != null)
{
item.Nav_SafeCheck = null; item.Nav_SafeCheck = null;
} }
} }
@ -1892,10 +1894,11 @@ namespace APT.BS.WebApi.Controllers.Api
{ {
foreach (var item in listDetailLaw) foreach (var item in listDetailLaw)
{ {
if (item.Nav_Standard != null)
item.Nav_Standard = null; item.Nav_Standard = null;
} }
} }
} //}
if (entity.STATUSPLAN == 0) if (entity.STATUSPLAN == 0)
{ {
@ -7285,6 +7288,7 @@ namespace APT.BS.WebApi.Controllers.Api
break; break;
} }
//var iListCheck = GetEntities(expressionCheck, null, "Nav_Department", "Nav_CheckType", "Nav_CheckTypeLevel.Nav_Enums").Select(e => new T_BS_SAFE_CHECK_SUM() //var iListCheck = GetEntities(expressionCheck, null, "Nav_Department", "Nav_CheckType", "Nav_CheckTypeLevel.Nav_Enums").Select(e => new T_BS_SAFE_CHECK_SUM()
//{ //{
// ID = e.ID.ToString() + "_", // ID = e.ID.ToString() + "_",

View File

@ -45,6 +45,53 @@ namespace APT.WebApi.Models//APT.BS.WebApi.Models
{ {
try try
{ {
#region
//var API_NAME = context.HttpContext.Request.Path;
//bool isRecord = false;
////switch (API_NAME)
////{
//// case "":
//// isRecord = true;
//// break;
//// default:
//// break;
////}
////isRecord = true;
//if (isRecord)
//{
// //避免不需要的反射
// //bool? IsSuccessful = null;
// //try
// //{
// // IsSuccessful = ((APT.Infrastructure.Core.JsonActionResult`1[System.Boolean])((Microsoft.AspNetCore.Mvc.ObjectResult)context.Result).Value).IsSuccessful;
// //}
// //catch { }
// var ResultValue = ((Microsoft.AspNetCore.Mvc.ObjectResult)context.Result).Value;
// Type TResultValue = ResultValue.GetType();
// bool? IsSuccessful = null;
// PropertyInfo[] propsVal = TResultValue.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
// foreach (var prop in propsVal)
// {
// if (prop.Name == "IsSuccessful")
// {
// var fdsafd = prop.GetValue(ResultValue);
// IsSuccessful = (bool)fdsafd;
// break;
// }
// }
// if (IsSuccessful.HasValue && IsSuccessful.Value)
// {
// //执行成功记录操作结果
// }
//}
#endregion
#region T_FM_SYNC_LOG
T_FM_SYNC_LOG log = null;
if (context.HttpContext.Items != null && context.HttpContext.Items.ContainsKey("1")) if (context.HttpContext.Items != null && context.HttpContext.Items.ContainsKey("1"))
{ {
DateTime START_TIME = DateTime.Now; DateTime START_TIME = DateTime.Now;
@ -64,7 +111,9 @@ namespace APT.WebApi.Models//APT.BS.WebApi.Models
} }
} }
double SYNC_PARAM = (DateTime.Now - START_TIME).TotalSeconds; double SYNC_PARAM = (DateTime.Now - START_TIME).TotalSeconds;
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() if (SYNC_PARAM > 0.8)
{
log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
START_TIME = START_TIME, START_TIME = START_TIME,
@ -95,6 +144,14 @@ namespace APT.WebApi.Models//APT.BS.WebApi.Models
//var commonService = APT.Infrastructure.Api.ServiceLocator.Instance.GetService<IFMUserService>(); //var commonService = APT.Infrastructure.Api.ServiceLocator.Instance.GetService<IFMUserService>();
//commonService.AddEntity<T_FM_SYNC_LOG>(log); //commonService.AddEntity<T_FM_SYNC_LOG>(log);
}
}
#endregion
#region
if (log != null)//增加别的判断 (log != null||(isRecord&& !=null ))
{
Infrastructure.Core.IUnitOfWork UnitOfWork = UserService.UnitWork(); Infrastructure.Core.IUnitOfWork UnitOfWork = UserService.UnitWork();
Type TUnitOfWork = UnitOfWork.GetType(); Type TUnitOfWork = UnitOfWork.GetType();
PropertyInfo[] props = TUnitOfWork.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); PropertyInfo[] props = TUnitOfWork.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
@ -118,6 +175,8 @@ namespace APT.WebApi.Models//APT.BS.WebApi.Models
} }
} }
} }
#endregion
} }
catch catch
{ {

View File

@ -99,6 +99,7 @@ namespace APT.BS.WebApi
services.AddSingleton(HtmlEncoder.Create(UnicodeRanges.All)); services.AddSingleton(HtmlEncoder.Create(UnicodeRanges.All));
//UpdateDatabase(); //UpdateDatabase();
services.RegisterBearAuth(); services.RegisterBearAuth();
services.AddControllers(o => o.Filters.Add(typeof(APIAttributeActionFilter)));
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -66,8 +66,8 @@ namespace APT.WebApi.Models
} }
var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds; var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds;
//if (TalSeconds > 1) if (TalSeconds > 0.8)
//{ {
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() T_FM_SYNC_LOG log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
@ -121,6 +121,7 @@ namespace APT.WebApi.Models
} }
} }
} }
}
catch catch
{ {
} }

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -66,8 +66,8 @@ namespace APT.WebApi.Models
} }
var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds; var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds;
//if (TalSeconds > 1) if (TalSeconds > 0.8)
//{ {
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() T_FM_SYNC_LOG log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
@ -121,6 +121,7 @@ namespace APT.WebApi.Models
} }
} }
} }
}
catch catch
{ {
} }

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -66,8 +66,8 @@ namespace APT.WebApi.Models
} }
var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds; var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds;
//if (TalSeconds > 1) if (TalSeconds > 0.8)
//{ {
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() T_FM_SYNC_LOG log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
@ -121,6 +121,7 @@ namespace APT.WebApi.Models
} }
} }
} }
}
catch catch
{ {
} }

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -66,8 +66,8 @@ namespace APT.WebApi.Models
} }
var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds; var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds;
//if (TalSeconds > 1) if (TalSeconds > 0.8)
//{ {
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() T_FM_SYNC_LOG log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
@ -121,6 +121,7 @@ namespace APT.WebApi.Models
} }
} }
} }
}
catch catch
{ {
} }

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -66,8 +66,8 @@ namespace APT.WebApi.Models
} }
var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds; var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds;
//if (TalSeconds > 1) if (TalSeconds > 0.8)
//{ {
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() T_FM_SYNC_LOG log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
@ -121,6 +121,7 @@ namespace APT.WebApi.Models
} }
} }
} }
}
catch catch
{ {
} }

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -66,8 +66,8 @@ namespace APT.WebApi.Models
} }
var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds; var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds;
//if (TalSeconds > 1) if (TalSeconds > 0.8)
//{ {
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() T_FM_SYNC_LOG log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
@ -121,6 +121,7 @@ namespace APT.WebApi.Models
} }
} }
} }
}
catch catch
{ {
} }

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -31,13 +31,15 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> AddRiskMoudleInfo([FromBody] KeywordFilter filter) public JsonActionResult<bool> AddRiskMoudleInfo([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var sourceIds = new List<Guid>(); var sourceIds = new List<Guid>();
List<T_BI_FORM_RUN_ANALYSIS> formAnalysis=new List<T_BI_FORM_RUN_ANALYSIS>(); List<T_BI_FORM_RUN_ANALYSIS> formAnalysis = new List<T_BI_FORM_RUN_ANALYSIS>();
var newFilter = new BaseFilter(filter.OrgId); var newFilter = new BaseFilter(filter.OrgId);
newFilter.SelectField = new List<string> { "ID", "STATUS" }; newFilter.SelectField = new List<string> { "ID", "STATUS" };
//风险评价计划审核表 //风险评价计划审核表
var evalPlan= this.GetEntities<T_HM_EVALUATION_PLAN>(t => true, newFilter); var evalPlan = this.GetEntities<T_HM_EVALUATION_PLAN>(t => true, newFilter);
var evalPlanIds = evalPlan.Select(t => t.ID).ToList(); var evalPlanIds = evalPlan.Select(t => t.ID).ToList();
sourceIds.AddRange(evalPlanIds); sourceIds.AddRange(evalPlanIds);
//风险评价计划发布 //风险评价计划发布
@ -841,9 +843,17 @@ namespace APT.PP.WebApi.Controllers.Api.PP
this.UnifiedCommit(() => this.UnifiedCommit(() =>
{ {
if(formAnalysis != null && formAnalysis.Any()) if (formAnalysis != null && formAnalysis.Any())
BantchSaveEntityNoCommit(formAnalysis); BantchSaveEntityNoCommit(formAnalysis);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -852,6 +862,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> AddSafeCheckMoudleInfo([FromBody] KeywordFilter filter) public JsonActionResult<bool> AddSafeCheckMoudleInfo([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var sourceIds = new List<Guid>(); var sourceIds = new List<Guid>();
List<T_BI_FORM_RUN_ANALYSIS> formAnalysis = new List<T_BI_FORM_RUN_ANALYSIS>(); List<T_BI_FORM_RUN_ANALYSIS> formAnalysis = new List<T_BI_FORM_RUN_ANALYSIS>();
@ -1176,6 +1188,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (formAnalysis != null && formAnalysis.Any()) if (formAnalysis != null && formAnalysis.Any())
BantchSaveEntityNoCommit(formAnalysis); BantchSaveEntityNoCommit(formAnalysis);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -1183,6 +1203,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> AddOperationMoudleInfo([FromBody] KeywordFilter filter) public JsonActionResult<bool> AddOperationMoudleInfo([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var sourceIds = new List<Guid>(); var sourceIds = new List<Guid>();
List<T_BI_FORM_RUN_ANALYSIS> formAnalysis = new List<T_BI_FORM_RUN_ANALYSIS>(); List<T_BI_FORM_RUN_ANALYSIS> formAnalysis = new List<T_BI_FORM_RUN_ANALYSIS>();
@ -1589,7 +1611,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
item.IS_OVERTIME = 1; item.IS_OVERTIME = 1;
} }
var count = evalResult.Count(); var count = evalResult.Count();
var finish = evalResult.Count(t => t.IS_OVERTIME == 0 && t.IS_PUBLISH ==(int)FOPreMeetingStatusEnum.); var finish = evalResult.Count(t => t.IS_OVERTIME == 0 && t.IS_PUBLISH == (int)FOPreMeetingStatusEnum.);
var overfinish = evalResult.Count(t => t.IS_OVERTIME == 1 && t.IS_PUBLISH == (int)FOPreMeetingStatusEnum.); var overfinish = evalResult.Count(t => t.IS_OVERTIME == 1 && t.IS_PUBLISH == (int)FOPreMeetingStatusEnum.);
var unfinish = count - finish - overfinish; var unfinish = count - finish - overfinish;
var temp = count == 0 ? 0 : (double)(finish + overfinish) / count * 100; var temp = count == 0 ? 0 : (double)(finish + overfinish) / count * 100;
@ -1753,6 +1775,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (formAnalysis != null && formAnalysis.Any()) if (formAnalysis != null && formAnalysis.Any())
BantchSaveEntityNoCommit(formAnalysis); BantchSaveEntityNoCommit(formAnalysis);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -2630,10 +2660,12 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> AddTaskInfo([FromBody] KeywordPageFilter pageFilter) public JsonActionResult<bool> AddTaskInfo([FromBody] KeywordPageFilter pageFilter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
List<T_BI_SYSTEM_RUN_SUMMARY> departSummary = new List<T_BI_SYSTEM_RUN_SUMMARY>(); List<T_BI_SYSTEM_RUN_SUMMARY> departSummary = new List<T_BI_SYSTEM_RUN_SUMMARY>();
List<T_BI_MOULD_RUN_SUMMARY> mouldSummary = new List<T_BI_MOULD_RUN_SUMMARY>(); List<T_BI_MOULD_RUN_SUMMARY> mouldSummary = new List<T_BI_MOULD_RUN_SUMMARY>();
var dt = DateTime.Now; var dt = DateTime.Now.Date;
//最近一周 //最近一周
DateTime week = dt.AddDays(-7).Date; DateTime week = dt.AddDays(-7).Date;
//最近一月 //最近一月
@ -2644,8 +2676,9 @@ namespace APT.PP.WebApi.Controllers.Api.PP
DateTime sixMonth = dt.AddMonths(-6).Date; DateTime sixMonth = dt.AddMonths(-6).Date;
//最近一年 //最近一年
DateTime year = dt.AddYears(-1).Date; DateTime year = dt.AddYears(-1).Date;
dt = Convert.ToDateTime(dt.ToString().Replace("0:00:00", "23:59:59"));
var newFilter = new BaseFilter(pageFilter.OrgId); var newFilter = new BaseFilter(pageFilter.OrgId);
var taskYear = this.GetEntities<T_BI_NOTIFICATION_TASK_NEW>(t => t.CREATE_DATE >= year, new BaseFilter(pageFilter.OrgId)).ToList(); var taskYear = this.GetEntities<T_BI_NOTIFICATION_TASK_NEW>(t => t.CREATE_DATE >= year && t.CREATE_DATE <= dt, new BaseFilter(pageFilter.OrgId)).ToList();
newFilter.SelectField = new List<string> { "ID", "PARENT_ID", "NAME", "Nav_Parent", "DEPARTMENT_TYPE" }; newFilter.SelectField = new List<string> { "ID", "PARENT_ID", "NAME", "Nav_Parent", "DEPARTMENT_TYPE" };
var departmentInfos = this.GetEntities<T_FM_DEPARTMENT>(t => !t.IS_DELETED && t.ENABLE_STATUS == 0, newFilter).ToList(); var departmentInfos = this.GetEntities<T_FM_DEPARTMENT>(t => !t.IS_DELETED && t.ENABLE_STATUS == 0, newFilter).ToList();
//部门级 //部门级
@ -2690,7 +2723,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
departSummary.Add(sum); departSummary.Add(sum);
}); });
var groupYearMould = departGroupYear.GroupBy(t => t.MOUDLE_NAME).ToList(); var groupYearMould = departGroupYear.GroupBy(t => t.MOUDLE_NAME).ToList();
groupYearMould.ForEach(t => { groupYearMould.ForEach(t =>
{
T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY(); T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY();
sum.MOUDLE_NAME = t.Key; sum.MOUDLE_NAME = t.Key;
sum.ORG_ID = pageFilter.OrgId; sum.ORG_ID = pageFilter.OrgId;
@ -2778,7 +2812,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
departSummary.Add(sum); departSummary.Add(sum);
}); });
var groupYearMould = taskSixMonth.GroupBy(t => t.MOUDLE_NAME).ToList(); var groupYearMould = taskSixMonth.GroupBy(t => t.MOUDLE_NAME).ToList();
groupYearMould.ForEach(t => { groupYearMould.ForEach(t =>
{
T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY(); T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY();
sum.MOUDLE_NAME = t.Key; sum.MOUDLE_NAME = t.Key;
sum.ORG_ID = pageFilter.OrgId; sum.ORG_ID = pageFilter.OrgId;
@ -2866,7 +2901,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
departSummary.Add(sum); departSummary.Add(sum);
}); });
var groupYearMould = taskThreeMonth.GroupBy(t => t.MOUDLE_NAME).ToList(); var groupYearMould = taskThreeMonth.GroupBy(t => t.MOUDLE_NAME).ToList();
groupYearMould.ForEach(t => { groupYearMould.ForEach(t =>
{
T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY(); T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY();
sum.MOUDLE_NAME = t.Key; sum.MOUDLE_NAME = t.Key;
sum.ORG_ID = pageFilter.OrgId; sum.ORG_ID = pageFilter.OrgId;
@ -2954,7 +2990,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
departSummary.Add(sum); departSummary.Add(sum);
}); });
var groupYearMould = taskMonth.GroupBy(t => t.MOUDLE_NAME).ToList(); var groupYearMould = taskMonth.GroupBy(t => t.MOUDLE_NAME).ToList();
groupYearMould.ForEach(t => { groupYearMould.ForEach(t =>
{
T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY(); T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY();
sum.MOUDLE_NAME = t.Key; sum.MOUDLE_NAME = t.Key;
sum.ORG_ID = pageFilter.OrgId; sum.ORG_ID = pageFilter.OrgId;
@ -3042,7 +3079,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
departSummary.Add(sum); departSummary.Add(sum);
}); });
var groupYearMould = taskWeek.GroupBy(t => t.MOUDLE_NAME).ToList(); var groupYearMould = taskWeek.GroupBy(t => t.MOUDLE_NAME).ToList();
groupYearMould.ForEach(t => { groupYearMould.ForEach(t =>
{
T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY(); T_BI_MOULD_RUN_SUMMARY sum = new T_BI_MOULD_RUN_SUMMARY();
sum.MOUDLE_NAME = t.Key; sum.MOUDLE_NAME = t.Key;
sum.ORG_ID = pageFilter.OrgId; sum.ORG_ID = pageFilter.OrgId;
@ -3218,6 +3256,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (monthRuns != null && monthRuns.Any()) if (monthRuns != null && monthRuns.Any())
BantchSaveEntityNoCommit(monthRuns); BantchSaveEntityNoCommit(monthRuns);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -3233,6 +3279,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> UpdateTaskTable([FromBody] KeywordPageFilter pageFilter) public JsonActionResult<bool> UpdateTaskTable([FromBody] KeywordPageFilter pageFilter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var dt = DateTime.Now; var dt = DateTime.Now;
//最近一天 //最近一天
@ -3270,6 +3318,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (taskInfos != null && taskInfos.Any()) if (taskInfos != null && taskInfos.Any())
BantchSaveEntityNoCommit(taskInfos); BantchSaveEntityNoCommit(taskInfos);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -3285,6 +3341,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> UpdateNoticeType([FromBody] KeywordPageFilter pageFilter) public JsonActionResult<bool> UpdateNoticeType([FromBody] KeywordPageFilter pageFilter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var dt = DateTime.Now; var dt = DateTime.Now;
//最近一周 //最近一周
@ -3307,6 +3365,15 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (taskInfos != null && taskInfos.Any()) if (taskInfos != null && taskInfos.Any())
BantchSaveEntityNoCommit(taskInfos); BantchSaveEntityNoCommit(taskInfos);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -3322,6 +3389,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> AddNoticeTask([FromBody] KeywordPageFilter pageFilter) public JsonActionResult<bool> AddNoticeTask([FromBody] KeywordPageFilter pageFilter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var dt = DateTime.Now; var dt = DateTime.Now;
//最近一周 //最近一周
@ -3481,6 +3550,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (addTaskInfos != null && addTaskInfos.Any()) if (addTaskInfos != null && addTaskInfos.Any())
BantchAddEntityNoCommit(addTaskInfos); BantchAddEntityNoCommit(addTaskInfos);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -3533,7 +3610,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
var personIds = this.GetEntities<T_FO_JOB_EVENT_PERSON>(t => deleteIds.Contains(t.JOB_EVENT_RECORD_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList(); var personIds = this.GetEntities<T_FO_JOB_EVENT_PERSON>(t => deleteIds.Contains(t.JOB_EVENT_RECORD_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList();
var flowIds = this.GetEntities<T_FO_JOB_EVENT_FLOW>(t => deleteIds.Contains(t.JOB_EVENT_RECORD_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList(); var flowIds = this.GetEntities<T_FO_JOB_EVENT_FLOW>(t => deleteIds.Contains(t.JOB_EVENT_RECORD_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList();
var meaIds = this.GetEntities<T_FO_JOB_EVENT_MEASURE>(t => deleteIds.Contains(t.JOB_EVENT_RECORD_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList(); var meaIds = this.GetEntities<T_FO_JOB_EVENT_MEASURE>(t => deleteIds.Contains(t.JOB_EVENT_RECORD_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList();
var taskIds= this.GetEntities<T_FM_NOTIFICATION_TASK>(t => deleteIds.Contains((Guid)t.SOURCE_DATA_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList(); var taskIds = this.GetEntities<T_FM_NOTIFICATION_TASK>(t => deleteIds.Contains((Guid)t.SOURCE_DATA_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList();
UnifiedCommit(() => UnifiedCommit(() =>
{ {
if (deleteIds != null && deleteIds.Any()) if (deleteIds != null && deleteIds.Any())
@ -3563,16 +3640,18 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> JobProfile([FromBody] KeywordPageFilter pageFilter) public JsonActionResult<bool> JobProfile([FromBody] KeywordPageFilter pageFilter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
//八大作业 //八大作业
var jobProfiles = new List<T_BI_JOB_PROFILE>(); var jobProfiles = new List<T_BI_JOB_PROFILE>();
var enumList = Enum.GetValues(typeof(StepTypeEnum)); var enumList = Enum.GetValues(typeof(StepTypeEnum));
var unitList = Enum.GetValues(typeof(FMProductionUnit)); var unitList = Enum.GetValues(typeof(FMProductionUnit));
var stepList = this.GetEntities<T_HM_OPERATION_STEP>(t => t.IS_SPECIAL==true, new BaseFilter(pageFilter.OrgId)); var stepList = this.GetEntities<T_HM_OPERATION_STEP>(t => t.IS_SPECIAL == true, new BaseFilter(pageFilter.OrgId));
var stepIds = stepList.Select(t => t.ID).ToList(); var stepIds = stepList.Select(t => t.ID).ToList();
var linkList = this.GetEntities<T_HM_OPERATION_LINK>(t => stepIds.Contains(t.OPERATION_STEP_ID.Value), new BaseFilter(pageFilter.OrgId)); var linkList = this.GetEntities<T_HM_OPERATION_LINK>(t => stepIds.Contains(t.OPERATION_STEP_ID.Value), new BaseFilter(pageFilter.OrgId));
var jobList = this.GetEntities<T_FO_CRUCIAL_LICENSE_JOB>(t => stepIds.Contains(t.OPERATION_STEP_ID.Value), new BaseFilter(pageFilter.OrgId)).Select(m =>new { m.ID,m.OPERATION_STEP_ID }).ToList(); var jobList = this.GetEntities<T_FO_CRUCIAL_LICENSE_JOB>(t => stepIds.Contains(t.OPERATION_STEP_ID.Value), new BaseFilter(pageFilter.OrgId)).Select(m => new { m.ID, m.OPERATION_STEP_ID }).ToList();
var stepTyes= stepList.Select(t => t.STEP_TYPE).Distinct().ToList(); var stepTyes = stepList.Select(t => t.STEP_TYPE).Distinct().ToList();
foreach (FMProductionUnit unit in unitList) foreach (FMProductionUnit unit in unitList)
{ {
foreach (StepTypeEnum level in enumList) foreach (StepTypeEnum level in enumList)
@ -3597,6 +3676,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (jobProfiles != null && jobProfiles.Any()) if (jobProfiles != null && jobProfiles.Any())
BantchSaveEntityNoCommit(jobProfiles); BantchSaveEntityNoCommit(jobProfiles);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -3612,6 +3699,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> AddNoticeTaskNew([FromBody] KeywordPageFilter pageFilter) public JsonActionResult<bool> AddNoticeTaskNew([FromBody] KeywordPageFilter pageFilter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var dt = DateTime.Now; var dt = DateTime.Now;
//最近一天 //最近一天
@ -3636,7 +3725,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
var taskInfoTemps = this.GetEntities<T_FM_NOTIFICATION_TASK>(t => !t.IS_DELETED && t.MODIFY_TIME >= year && t.MODIFY_TIME < yearEnd && t.USER_ID != null && t.SOURCE_FORMCODE != null, newFilter).ToList(); var taskInfoTemps = this.GetEntities<T_FM_NOTIFICATION_TASK>(t => !t.IS_DELETED && t.MODIFY_TIME >= year && t.MODIFY_TIME < yearEnd && t.USER_ID != null && t.SOURCE_FORMCODE != null, newFilter).ToList();
//&& t.SOURCE_FORMCODE != "PF119" && t.SOURCE_FORMCODE != "PF135"&& t.NOTICE_TYPE != 7 && t.NOTICE_TYPE != 8 && t.NOTICE_TYPE != 2 //&& t.SOURCE_FORMCODE != "PF119" && t.SOURCE_FORMCODE != "PF135"&& t.NOTICE_TYPE != 7 && t.NOTICE_TYPE != 8 && t.NOTICE_TYPE != 2
var taskInfoIds = taskInfoTemps.Select(t => t.ID).ToList(); var taskInfoIds = taskInfoTemps.Select(t => t.ID).ToList();
biTaskInfos = this.GetEntities<T_BI_NOTIFICATION_TASK_NEW>(t=> taskInfoIds.Contains((Guid)t.TASK_ID), new BaseFilter(pageFilter.OrgId)).ToList(); biTaskInfos = this.GetEntities<T_BI_NOTIFICATION_TASK_NEW>(t => taskInfoIds.Contains((Guid)t.TASK_ID), new BaseFilter(pageFilter.OrgId)).ToList();
var dataIds = biTaskInfos.Select(t => t.TASK_ID).Distinct(); var dataIds = biTaskInfos.Select(t => t.TASK_ID).Distinct();
taskInfos = taskInfoTemps.Where(t => !dataIds.Contains(t.ID)).ToList();//&& !t.NOTICE_TITLE.Contains("审核") taskInfos = taskInfoTemps.Where(t => !dataIds.Contains(t.ID)).ToList();//&& !t.NOTICE_TITLE.Contains("审核")
updateTaskInfos = biTaskInfos.Where(t => t.NOTICE_STATUS == 0).ToList(); updateTaskInfos = biTaskInfos.Where(t => t.NOTICE_STATUS == 0).ToList();
@ -3818,6 +3907,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
//if (deleteIds != null && deleteIds.Any()) //if (deleteIds != null && deleteIds.Any())
// BantchDeleteEntityNoCommit<T_BI_NOTIFICATION_TASK_NEW>(deleteIds); // BantchDeleteEntityNoCommit<T_BI_NOTIFICATION_TASK_NEW>(deleteIds);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -3833,6 +3930,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> UpdateTaskTableNew([FromBody] KeywordPageFilter pageFilter) public JsonActionResult<bool> UpdateTaskTableNew([FromBody] KeywordPageFilter pageFilter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var dt = DateTime.Now; var dt = DateTime.Now;
//最近一周 //最近一周
@ -3857,7 +3956,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
{ {
foreach (var item in biTaskInfos) foreach (var item in biTaskInfos)
{ {
var taskFirst = taskInfos.FirstOrDefault(t=>t.ID == item.TASK_ID); var taskFirst = taskInfos.FirstOrDefault(t => t.ID == item.TASK_ID);
if (taskFirst != null) if (taskFirst != null)
{ {
item.TABLE_NAME = taskFirst.TABLE_NAME; item.TABLE_NAME = taskFirst.TABLE_NAME;
@ -3933,6 +4032,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (biTaskInfos != null && biTaskInfos.Any()) if (biTaskInfos != null && biTaskInfos.Any())
BantchSaveEntityNoCommit(biTaskInfos); BantchSaveEntityNoCommit(biTaskInfos);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }

View File

@ -30,14 +30,16 @@ namespace APT.PP.WebApi.Controllers.Api.PP
IFMSyncLogDetailService SyncLogDetailService { get; set; } IFMSyncLogDetailService SyncLogDetailService { get; set; }
//IBSSafeCheckService SafeCheckService { get; set; }, IBSSafeCheckService safeCheckService //IBSSafeCheckService SafeCheckService { get; set; }, IBSSafeCheckService safeCheckService
IPFSysLogService SysLogService { get; set; } IPFSysLogService SysLogService { get; set; }
IBSOperateLogService BSOperateLogService { get; set; }
//private readonly ILogger<BSController> _logger = null; //private readonly ILogger<BSController> _logger = null;
public BSController(IFMNotificationTaskService notificationTaskService, IPFSysLogService sysLogService, IFMSyncLogDetailService syncLogDetailService)//, ILogger<BSController> logger public BSController(IFMNotificationTaskService notificationTaskService, IPFSysLogService sysLogService, IFMSyncLogDetailService syncLogDetailService, IBSOperateLogService bsOperateLogService)//, ILogger<BSController> logger
{ {
NotificationTaskService = notificationTaskService;
//SafeCheckService = safeCheckService; //SafeCheckService = safeCheckService;
//_logger = logger;
NotificationTaskService = notificationTaskService;
SysLogService = sysLogService; SysLogService = sysLogService;
SyncLogDetailService = syncLogDetailService; SyncLogDetailService = syncLogDetailService;
//_logger = logger; BSOperateLogService = bsOperateLogService;
} }
/// <summary> /// <summary>
@ -104,6 +106,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CreateCheckPlanSet([FromBody] KeywordFilter filter) public JsonActionResult<bool> CreateCheckPlanSet([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
DateTime CURR_TASK_START_TIME = DateTime.Now; DateTime CURR_TASK_START_TIME = DateTime.Now;
DateTime dtNow = DateTime.Now; DateTime dtNow = DateTime.Now;
@ -833,6 +837,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
} }
#endregion #endregion
} }
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -847,6 +859,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CreateCheckPlanSetClass([FromBody] KeywordFilter filter) public JsonActionResult<bool> CreateCheckPlanSetClass([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
DateTime CURR_TASK_START_TIME = DateTime.Now; DateTime CURR_TASK_START_TIME = DateTime.Now;
DateTime dtNow = DateTime.Now; DateTime dtNow = DateTime.Now;
@ -1242,17 +1256,19 @@ namespace APT.PP.WebApi.Controllers.Api.PP
task.UPDATE_SUCCES_TIME = DateTime.Now; task.UPDATE_SUCCES_TIME = DateTime.Now;
} }
var listOperateLog = BSOperateLogService.GetListOperateLog(OPERATEPOINT_Enums.GotCheck, Guid.Empty, Guid.Empty, noticeDataIds, noticeUserIds, noticeUserNames, filter.OrgId, null, null);
//给 T_FM_NOTIFICATION_TASK 添加实体 //给 T_FM_NOTIFICATION_TASK 添加实体
NotificationTaskService.SendNotificationTask(noticeTitles, noticeDataIds, filter.GetOrgId(), noticeUserIds, noticeUserNames, listStartTime, listEndTime, 0, "BS032", () => NotificationTaskService.SendNotificationTask(noticeTitles, noticeDataIds, filter.GetOrgId(), noticeUserIds, noticeUserNames, listStartTime, listEndTime, 0, "BS032", () =>
{ {
if (listSafeCheckAdd.Any()) if (listSafeCheckAdd.Any())
{ {
this.BantchAddEntityNoCommit(listSafeCheckAdd); this.BantchAddEntityNoCommit(listSafeCheckAdd);
if (listOperateLog != null && listOperateLog.Any())
BantchSaveEntityNoCommit(listOperateLog);
if (task != null) if (task != null)
{
UpdateEntityNoCommit(task); UpdateEntityNoCommit(task);
} }
}
}); });
if (HttpContext.Items.ContainsKey("Count")) if (HttpContext.Items.ContainsKey("Count"))
@ -1270,6 +1286,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
} }
#endregion #endregion
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -1301,6 +1325,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> BeginCheck([FromBody] KeywordFilter filter) public JsonActionResult<bool> BeginCheck([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
DateTime dtNow = DateTime.Now; DateTime dtNow = DateTime.Now;
if (!string.IsNullOrEmpty(filter.Parameter1)) if (!string.IsNullOrEmpty(filter.Parameter1))
@ -1418,6 +1444,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
BantchSaveEntityNoCommit(checks);//检查记录表单 STATUCHECK (int)HMAuditStatusEnmu.审批中; BantchSaveEntityNoCommit(checks);//检查记录表单 STATUCHECK (int)HMAuditStatusEnmu.审批中;
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -1489,6 +1523,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CreateSubmitContentNotice([FromBody] KeywordFilter filter) public JsonActionResult<bool> CreateSubmitContentNotice([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
DateTime dtNow = DateTime.Now; DateTime dtNow = DateTime.Now;
var run = this.GetEntity<T_FM_SYNC_TASK>(filter.Keyword); var run = this.GetEntity<T_FM_SYNC_TASK>(filter.Keyword);
@ -1592,11 +1628,20 @@ namespace APT.PP.WebApi.Controllers.Api.PP
}); });
} }
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
/// <summary> /// <summary>
/// 获取部门负责人(根据组织结构) /// 获取部门负责人(根据组织结构)
/// </summary> /// </summary>

View File

@ -64,6 +64,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CreateDepartmentCompletion([FromBody] KeywordFilter filter) public JsonActionResult<bool> CreateDepartmentCompletion([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
List<T_FM_DEPARTMENT_COMPLETION> completions = new List<T_FM_DEPARTMENT_COMPLETION>(); List<T_FM_DEPARTMENT_COMPLETION> completions = new List<T_FM_DEPARTMENT_COMPLETION>();
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId()); BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
@ -221,6 +223,15 @@ namespace APT.PP.WebApi.Controllers.Api.PP
BantchAddEntityNoCommit(completions); BantchAddEntityNoCommit(completions);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -234,6 +245,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CreateDepartmentCompletionNew([FromBody] KeywordFilter filter) public JsonActionResult<bool> CreateDepartmentCompletionNew([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
List<T_FM_DEPARTMENT_COMPLETION> completions = new List<T_FM_DEPARTMENT_COMPLETION>(); List<T_FM_DEPARTMENT_COMPLETION> completions = new List<T_FM_DEPARTMENT_COMPLETION>();
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId()); BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
@ -474,6 +487,15 @@ namespace APT.PP.WebApi.Controllers.Api.PP
} }
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -506,7 +528,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{ {
try
{
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId()); BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
var riskLevelProportions = new List<T_FM_RISK_LEVEL_PROPORTION>(); var riskLevelProportions = new List<T_FM_RISK_LEVEL_PROPORTION>();
var riskTypeProportions = new List<T_FM_RISK_TYPE_PROPORTION>(); var riskTypeProportions = new List<T_FM_RISK_TYPE_PROPORTION>();
@ -573,6 +596,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (riskTypeProportions.Any() && riskTypeProportions.Count > 0) if (riskTypeProportions.Any() && riskTypeProportions.Count > 0)
BantchAddEntityNoCommit(riskTypeProportions); BantchAddEntityNoCommit(riskTypeProportions);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
@ -586,6 +617,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CreateDepartmentCompletionSort([FromBody] KeywordFilter filter) public JsonActionResult<bool> CreateDepartmentCompletionSort([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
List<T_FM_DEPARTMENT_COMPLETION_SORT> completionSortTemps = new List<T_FM_DEPARTMENT_COMPLETION_SORT>(); List<T_FM_DEPARTMENT_COMPLETION_SORT> completionSortTemps = new List<T_FM_DEPARTMENT_COMPLETION_SORT>();
List<T_FM_DEPARTMENT_COMPLETION_SORT> completionSorts = new List<T_FM_DEPARTMENT_COMPLETION_SORT>(); List<T_FM_DEPARTMENT_COMPLETION_SORT> completionSorts = new List<T_FM_DEPARTMENT_COMPLETION_SORT>();
@ -627,7 +660,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (completionSorts1.Any() && completionSorts1.Count > 0) if (completionSorts1.Any() && completionSorts1.Count > 0)
BantchAddEntityNoCommit(completionSorts1); BantchAddEntityNoCommit(completionSorts1);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -671,6 +711,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
//隐患总数 //隐患总数
//var listCheckDetail = this.GetEntities<T_BS_SAFE_CHECK_DETAIL>(e => e.CHECKRESULT.HasValue && (e.CHECKRESULT == (int)CHECKRESULTEnum.Same || e.CHECKRESULT == (int)CHECKRESULTEnum.Other) && e.Nav_SafeCheck.APPROVE_ID.HasValue && e.Nav_SafeCheck.STATUCHECK == (int)FOPreMeetingStatusEnum.归档, null, new string[] { "Nav_SafeCheck" }); //var listCheckDetail = this.GetEntities<T_BS_SAFE_CHECK_DETAIL>(e => e.CHECKRESULT.HasValue && (e.CHECKRESULT == (int)CHECKRESULTEnum.Same || e.CHECKRESULT == (int)CHECKRESULTEnum.Other) && e.Nav_SafeCheck.APPROVE_ID.HasValue && e.Nav_SafeCheck.STATUCHECK == (int)FOPreMeetingStatusEnum.归档, null, new string[] { "Nav_SafeCheck" });
try
{
//隐患上报总数 //隐患上报总数
var listAll = this.GetEntities<T_BS_RISK_SUBMIT_CONTENT>(e => e.ISBACK.HasValue && !e.ISBACK.Value && e.RiskContentState.HasValue && e.Nav_Department != null, null, new string[] { "Nav_Department" }) var listAll = this.GetEntities<T_BS_RISK_SUBMIT_CONTENT>(e => e.ISBACK.HasValue && !e.ISBACK.Value && e.RiskContentState.HasValue && e.Nav_Department != null, null, new string[] { "Nav_Department" })
@ -734,6 +776,15 @@ namespace APT.PP.WebApi.Controllers.Api.PP
BantchAddEntityNoCommit(listResult); BantchAddEntityNoCommit(listResult);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -748,6 +799,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CreateWorkTiketCompletion([FromBody] KeywordFilter filter) public JsonActionResult<bool> CreateWorkTiketCompletion([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
List<T_FM_WORK_TICKET_COMPLETION> completions = new List<T_FM_WORK_TICKET_COMPLETION>(); List<T_FM_WORK_TICKET_COMPLETION> completions = new List<T_FM_WORK_TICKET_COMPLETION>();
var jobIds = GetEntities<T_FO_CRUCIAL_LICENSE_JOB>(i => true, new BaseFilter(filter.GetOrgId())).Select(t => t.ID).ToList(); var jobIds = GetEntities<T_FO_CRUCIAL_LICENSE_JOB>(i => true, new BaseFilter(filter.GetOrgId())).Select(t => t.ID).ToList();
@ -800,6 +853,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (completions.Any() && completions.Count > 0) if (completions.Any() && completions.Count > 0)
BantchAddEntityNoCommit(completions); BantchAddEntityNoCommit(completions);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -814,6 +875,9 @@ namespace APT.PP.WebApi.Controllers.Api.PP
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{ {
try
{
List<T_FM_WORK_TICKET_COMPLETION> completions = new List<T_FM_WORK_TICKET_COMPLETION>(); List<T_FM_WORK_TICKET_COMPLETION> completions = new List<T_FM_WORK_TICKET_COMPLETION>();
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId()); BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
var startTime = Convert.ToDateTime(DateTime.Now.AddMonths(-11).Year + "-" + DateTime.Now.AddMonths(-11).Month + "-01 00:00:00"); var startTime = Convert.ToDateTime(DateTime.Now.AddMonths(-11).Year + "-" + DateTime.Now.AddMonths(-11).Month + "-01 00:00:00");
@ -896,6 +960,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
BantchAddEntityNoCommit(completions); BantchAddEntityNoCommit(completions);
} }
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -908,11 +980,21 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> BITask([FromBody] KeywordFilter filter) public JsonActionResult<bool> BITask([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
//风险模块数据 //风险模块数据
getRiskType(filter); getRiskType(filter);
//培训模块数据 //培训模块数据
getTrainPlan(filter); getTrainPlan(filter);
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -926,6 +1008,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> getRiskType([FromBody] KeywordFilter filter) public JsonActionResult<bool> getRiskType([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
DeleteEntity<T_BI_RISK_LEVEL1>(t => true); DeleteEntity<T_BI_RISK_LEVEL1>(t => true);
DeleteEntity<T_BI_RISK_LEVEL2>(t => true); DeleteEntity<T_BI_RISK_LEVEL2>(t => true);
@ -999,6 +1083,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
BantchAddEntityNoCommit(risk1s); BantchAddEntityNoCommit(risk1s);
BantchAddEntityNoCommit(risk2s); BantchAddEntityNoCommit(risk2s);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -1011,6 +1103,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> getTrainPlan([FromBody] KeywordFilter filter) public JsonActionResult<bool> getTrainPlan([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
DeleteEntity<T_BI_TRAIN_PLAN_COUNT>(t => true); DeleteEntity<T_BI_TRAIN_PLAN_COUNT>(t => true);
List<T_BI_TRAIN_PLAN_COUNT> items = new List<T_BI_TRAIN_PLAN_COUNT>(); List<T_BI_TRAIN_PLAN_COUNT> items = new List<T_BI_TRAIN_PLAN_COUNT>();
@ -1036,6 +1130,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
{ {
BantchAddEntityNoCommit(items); BantchAddEntityNoCommit(items);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -1049,6 +1151,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CreateJobActivityCompletion([FromBody] KeywordFilter filter) public JsonActionResult<bool> CreateJobActivityCompletion([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
List<T_FM_JOB_ACTIVITY_COMPLETION> completions = new List<T_FM_JOB_ACTIVITY_COMPLETION>(); List<T_FM_JOB_ACTIVITY_COMPLETION> completions = new List<T_FM_JOB_ACTIVITY_COMPLETION>();
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId()); BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
@ -1186,6 +1290,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
} }
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -1199,6 +1311,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> ExecuteJob([FromBody] KeywordPageFilter pageFilter) public JsonActionResult<bool> ExecuteJob([FromBody] KeywordPageFilter pageFilter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId.Value; var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId.Value;
BaseFilter baseFilter = new BaseFilter(orgId); BaseFilter baseFilter = new BaseFilter(orgId);
@ -1272,6 +1386,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
BantchAddEntityNoCommit(techUserLists); BantchAddEntityNoCommit(techUserLists);
} }
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -1294,6 +1416,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
public JsonActionResult<bool> CaculateRiskReason([FromBody] KeywordFilter filter) public JsonActionResult<bool> CaculateRiskReason([FromBody] KeywordFilter filter)
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{
try
{ {
DateTime dtMin = Convert.ToDateTime(DateTime.Now.ToString("yyyy-01-01 00:00:00")); DateTime dtMin = Convert.ToDateTime(DateTime.Now.ToString("yyyy-01-01 00:00:00"));
if (!string.IsNullOrEmpty(filter.Parameter1)) if (!string.IsNullOrEmpty(filter.Parameter1))
@ -1307,7 +1431,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
catch { } catch { }
} }
BaseFilter filterR = new BaseFilter(); BaseFilter filterR = new BaseFilter(filter.OrgId);
filterR.SelectField = new List<string> { "ID", "NAME" }; filterR.SelectField = new List<string> { "ID", "NAME" };
var listRiskReasons = GetEntities<T_BS_RISK_REASON>(e => !e.IS_DELETED, filterR, null).OrderBy(e => e.NAME).ToList(); var listRiskReasons = GetEntities<T_BS_RISK_REASON>(e => !e.IS_DELETED, filterR, null).OrderBy(e => e.NAME).ToList();
string CODE = DateTime.Now.ToString("yyyyMMddHHmm"); string CODE = DateTime.Now.ToString("yyyyMMddHHmm");
@ -1316,7 +1440,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" }; filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
var listDep = GetEntities<T_FM_DEPARTMENT>(e => !e.IS_DELETED && e.ENABLE_STATUS == 0, filterD, null); var listDep = GetEntities<T_FM_DEPARTMENT>(e => !e.IS_DELETED && e.ENABLE_STATUS == 0, filterD, null);
BaseFilter filterCR = new BaseFilter(); BaseFilter filterCR = new BaseFilter(filter.OrgId);
filterCR.SelectField = new List<string> { "ID", "RISK_SUBMIT_CONTENT_ID", "RISK_REASON_ID", "Nav_RiskSubmitContent.DEPARTMENT_ID", "Nav_RiskSubmitContent.ID" }; filterCR.SelectField = new List<string> { "ID", "RISK_SUBMIT_CONTENT_ID", "RISK_REASON_ID", "Nav_RiskSubmitContent.DEPARTMENT_ID", "Nav_RiskSubmitContent.ID" };
var listContentReason = GetEntities<T_BS_RISK_SUBMIT_CONTENT_REASON>(e => e.CREATE_TIME.HasValue && e.CREATE_TIME.Value >= dtMin && e.Nav_RiskSubmitContent.DEPARTMENT_ID.HasValue, filterCR, "Nav_RiskSubmitContent"); var listContentReason = GetEntities<T_BS_RISK_SUBMIT_CONTENT_REASON>(e => e.CREATE_TIME.HasValue && e.CREATE_TIME.Value >= dtMin && e.Nav_RiskSubmitContent.DEPARTMENT_ID.HasValue, filterCR, "Nav_RiskSubmitContent");
var year = dtMin.Year; var year = dtMin.Year;
@ -1363,7 +1487,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
listReason.Add(reason);//地址引用 应该是支持 listReason.Add(reason);//地址引用 应该是支持
} }
perCount = listContentReason.Where(e => e.Nav_RiskSubmitContent.DEPARTMENT_ID.Value == itemD.ID && e.RISK_REASON_ID == perReasonID).Count(); perCount = listContentReason.Where(e => e.RISK_REASON_ID == perReasonID && e.Nav_RiskSubmitContent != null && e.Nav_RiskSubmitContent.DEPARTMENT_ID.HasValue && e.Nav_RiskSubmitContent.DEPARTMENT_ID.Value == itemD.ID).Count();
reason.DEPARTMENT_TYPE = FMDepartmentType.; reason.DEPARTMENT_TYPE = FMDepartmentType.;
reason.NUMD = depNum; reason.NUMD = depNum;
reason.COUNT = perCount; reason.COUNT = perCount;
@ -1389,7 +1513,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
listReason.Add(reason);//地址引用 应该是支持 listReason.Add(reason);//地址引用 应该是支持
} }
perCount = listContentReason.Where(e => e.Nav_RiskSubmitContent.DEPARTMENT_ID.Value == itemD.ID && e.RISK_REASON_ID == perReasonID).Count(); //perCount = listContentReason.Where(e => e.Nav_RiskSubmitContent.DEPARTMENT_ID.Value == itemD.ID && e.RISK_REASON_ID == perReasonID).Count();
perCount = listContentReason.Where(e => e.RISK_REASON_ID == perReasonID && e.Nav_RiskSubmitContent != null && e.Nav_RiskSubmitContent.DEPARTMENT_ID.HasValue && e.Nav_RiskSubmitContent.DEPARTMENT_ID.Value == itemD.ID).Count();
perSubCount = 0;//每次清零 后相加 perSubCount = 0;//每次清零 后相加
if (listSubDepID != null && listSubDepID.Any()) if (listSubDepID != null && listSubDepID.Any())
@ -1429,7 +1554,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
listReason.Add(reason);//地址引用 应该是支持 listReason.Add(reason);//地址引用 应该是支持
} }
perCount = listContentReason.Where(e => e.Nav_RiskSubmitContent.DEPARTMENT_ID.Value == itemD.ID && e.RISK_REASON_ID == perReasonID).Count(); //perCount = listContentReason.Where(e => e.Nav_RiskSubmitContent.DEPARTMENT_ID.Value == itemD.ID && e.RISK_REASON_ID == perReasonID).Count();
perCount = listContentReason.Where(e => e.RISK_REASON_ID == perReasonID && e.Nav_RiskSubmitContent != null && e.Nav_RiskSubmitContent.DEPARTMENT_ID.HasValue && e.Nav_RiskSubmitContent.DEPARTMENT_ID.Value == itemD.ID).Count();
perSubCount = 0;//每次清零 后相加 perSubCount = 0;//每次清零 后相加
if (listSubDepID != null && listSubDepID.Any()) if (listSubDepID != null && listSubDepID.Any())
@ -1487,6 +1613,15 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (UpdateResult != null && UpdateResult.Any()) if (UpdateResult != null && UpdateResult.Any())
BantchSaveEntityNoCommit(UpdateResult); BantchSaveEntityNoCommit(UpdateResult);
}); });
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }
@ -1520,13 +1655,17 @@ namespace APT.PP.WebApi.Controllers.Api.PP
BaseFilter filterD = new BaseFilter(filter.OrgId); BaseFilter filterD = new BaseFilter(filter.OrgId);
filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" }; filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
filterD.IgnoreDataRule = true;
IEnumerable<T_FM_DEPARTMENT> listDep = null; IEnumerable<T_FM_DEPARTMENT> listDep = null;
try try
{ {
//可能会报错 //可能会报错
listDep = GetEntities<T_FM_DEPARTMENT>(e => !e.IS_DELETED && e.ENABLE_STATUS == 0, filterD, null); listDep = GetEntities<T_FM_DEPARTMENT>(e => !e.IS_DELETED && e.ENABLE_STATUS == 0, filterD, null);//这句代码在跑批的时候 listDep 获取不到数据
//listDep = GetEntities<T_FM_DEPARTMENT>(e => !e.IS_DELETED && e.ENABLE_STATUS == 0, null, null);
}
catch
{
} }
catch { }
if ((listDep == null || !listDep.Any())) if ((listDep == null || !listDep.Any()))
{ {
@ -2035,7 +2174,6 @@ namespace APT.PP.WebApi.Controllers.Api.PP
Logger.LogError("错误日志:[StackTrace]" + ex.StackTrace); Logger.LogError("错误日志:[StackTrace]" + ex.StackTrace);
else else
Logger.LogError("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); Logger.LogError("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
Logger.LogError("filter" + filter.ToJson());
} }
return true; return true;
}); });
@ -2106,30 +2244,41 @@ namespace APT.PP.WebApi.Controllers.Api.PP
BaseFilter filterD = new BaseFilter(filter.OrgId); BaseFilter filterD = new BaseFilter(filter.OrgId);
filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" }; filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
var listDep = GetEntities<T_FM_DEPARTMENT>(e => !e.IS_DELETED && e.ENABLE_STATUS == 0, filterD, null); IEnumerable<T_FM_DEPARTMENT> listDep = null;
try
{
listDep = GetEntities<T_FM_DEPARTMENT>(e => !e.IS_DELETED && e.ENABLE_STATUS == 0, filterD, null);
}
catch { }
if ((listDep == null || !listDep.Any())) if ((listDep == null || !listDep.Any()))
{ {
return true; //如果 没有部门 或者 为设置隐患原因 一般不会这样 return true; //如果 没有部门 或者 为设置隐患原因 一般不会这样
} }
BaseFilter filterC = new BaseFilter(); BaseFilter filterC = new BaseFilter(filter.OrgId);
filterC.SelectField = new List<string> { "ID", "DEPARTMENTID", "CREATE_TIME", "ENABLE_STATUS", "STATUSPLAN", "CHECK_TYPE_ID" }; filterC.SelectField = new List<string> { "ID", "DEPARTMENTID", "CREATE_TIME", "ENABLE_STATUS", "STATUSPLAN", "CHECK_TYPE_ID" };
filterC.IgnoreDataRule = true; filterC.IgnoreDataRule = true;
//隐患已上报 统计 有没有处理 处理的及时性 //隐患已上报 统计 有没有处理 处理的及时性
var dtSafeCheck = GetEntities<T_BS_SAFE_CHECK>(e => e.CHECK_TYPE_ID.HasValue && e.DEPARTMENTID.HasValue && e.CREATE_TIME.HasValue && e.ENABLE_STATUS == 0 && e.CREATE_TIME.Value >= dtMin, filterC, null); //&& e.STATUSPLAN > 0 IEnumerable<T_BS_SAFE_CHECK> dtSafeCheck = null;
try
{
dtSafeCheck = GetEntities<T_BS_SAFE_CHECK>(e => e.CHECK_TYPE_ID.HasValue && e.DEPARTMENTID.HasValue && e.CREATE_TIME.HasValue && e.ENABLE_STATUS == 0 && e.CREATE_TIME.Value >= dtMin, filterC, null); //&& e.STATUSPLAN > 0
}
catch { }
if ((dtSafeCheck == null || !dtSafeCheck.Any())) if ((dtSafeCheck == null || !dtSafeCheck.Any()))
{ {
return true; //如果没有检查信息 return true; //如果没有检查信息
} }
BaseFilter filterCT = new BaseFilter(filter.OrgId);
BaseFilter filterCT = new BaseFilter();
filterCT.SelectField = new List<string> { "ID", "NAME", "IS_DELETED", "ENABLE_STATUS" }; filterCT.SelectField = new List<string> { "ID", "NAME", "IS_DELETED", "ENABLE_STATUS" };
var listCheckTypeAll = GetEntities<T_BS_CHECK_TYPE>(null, filterCT, null);// IEnumerable<T_BS_CHECK_TYPE> listCheckTypeAll = null;
try
{
listCheckTypeAll = GetEntities<T_BS_CHECK_TYPE>(null, filterCT, null);//
}
catch { }
if ((listCheckTypeAll == null || !listCheckTypeAll.Any())) if ((listCheckTypeAll == null || !listCheckTypeAll.Any()))
{ {
return true; //如果没有检查信息 return true; //如果没有检查信息
@ -2428,6 +2577,9 @@ namespace APT.PP.WebApi.Controllers.Api.PP
{ {
return SafeExecute<bool>(() => return SafeExecute<bool>(() =>
{ {
try
{
Guid? DataID = null; Guid? DataID = null;
Guid? KEY = null; Guid? KEY = null;
if (!string.IsNullOrEmpty(filter.Parameter1)) if (!string.IsNullOrEmpty(filter.Parameter1))
@ -2481,6 +2633,15 @@ namespace APT.PP.WebApi.Controllers.Api.PP
} }
FMNoticeService.SendMsg(NOTICETYPE.Meeting, DataID, KEY, task); FMNoticeService.SendMsg(NOTICETYPE.Meeting, DataID, KEY, task);
}
catch (Exception ex)
{
if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
}
return true; return true;
}); });
} }

View File

@ -93,10 +93,12 @@ namespace APT.WebApi.Models
} }
} }
} }
if (!context.HttpContext.Items.ContainsKey("syncLog"))
{
context.HttpContext.Items.Add("syncLog", log); context.HttpContext.Items.Add("syncLog", log);
context.HttpContext.Items.Add("syncID", log.ID); context.HttpContext.Items.Add("syncID", log.ID);
} }
}
/// <summary> /// <summary>
/// 在方法执行之后 /// 在方法执行之后

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -62,7 +62,6 @@ namespace APT.HM.WebApi.App_Start
builder.RegisterType<BSSafeCheckService>().As<IBSSafeCheckService>().InstancePerLifetimeScope(); builder.RegisterType<BSSafeCheckService>().As<IBSSafeCheckService>().InstancePerLifetimeScope();
builder.RegisterType<BIHomeService>().As<IBIHomeService>().InstancePerLifetimeScope(); builder.RegisterType<BIHomeService>().As<IBIHomeService>().InstancePerLifetimeScope();
builder.RegisterType<FMNoticeService>().As<IFMNoticeService>().InstancePerLifetimeScope(); builder.RegisterType<FMNoticeService>().As<IFMNoticeService>().InstancePerLifetimeScope();
builder.RegisterType<BSOperateLogService>().As<IBSOperateLogService>().InstancePerLifetimeScope();
} }
} }
} }

View File

@ -103,6 +103,7 @@ namespace APT.SC.WebApi.Controllers.Api.CM
entity.Nav_ListProject = null; entity.Nav_ListProject = null;
List<T_FM_NOTIFICATION_TASK> listTask = null; List<T_FM_NOTIFICATION_TASK> listTask = null;
T_FM_NOTIFICATION_TASK taskEnd = null;
#region #region
if (listUsers == null || !listUsers.Any()) if (listUsers == null || !listUsers.Any())
@ -146,6 +147,15 @@ namespace APT.SC.WebApi.Controllers.Api.CM
{ {
throw new Exception("未获取到评估明细,操作失败!"); throw new Exception("未获取到评估明细,操作失败!");
} }
if (entity.TaskID != Guid.Empty)
{
taskEnd = NotificationTaskService.GetEntityTask(entity.TaskID, "CM026_SHOWPRINT");
if (!taskEnd.SOURCE_DATA_ID.HasValue)
{
taskEnd.SOURCE_DATA_ID = entity.ID;
}
}
} }
#endregion #endregion
@ -155,6 +165,8 @@ namespace APT.SC.WebApi.Controllers.Api.CM
{ {
if (entity != null) if (entity != null)
UpdateEntityNoCommit(entity); UpdateEntityNoCommit(entity);
if (taskEnd != null)
UpdateEntityNoCommit(taskEnd);
if (listUsers != null && listUsers.Any())//明细 if (listUsers != null && listUsers.Any())//明细
BantchSaveEntityNoCommit(listUsers); BantchSaveEntityNoCommit(listUsers);
if (listListProject != null && listListProject.Any())//关联应急预案 if (listListProject != null && listListProject.Any())//关联应急预案

View File

@ -126,10 +126,19 @@ namespace APT.SC.WebApi.Controllers.Api.CM
entity.APPROVE_ID = Guid.NewGuid(); entity.APPROVE_ID = Guid.NewGuid();
var serialCode = DateTime.Now.ToString("yyyyMMddHHmmss"); var serialCode = DateTime.Now.ToString("yyyyMMddHHmmss");
MFlowPermitService.InsertApprove("CM" + serialCode, "CM002", null, entity.ID, "CM002_SHOWPRINT", entity.TaskID, true, () => T_FM_NOTIFICATION_TASK taskEnd = null;
if (entity.TaskID != Guid.Empty)
{
taskEnd = NotificationTaskService.GetEntityTask(entity.TaskID, "CM002_SHOWPRINT");
if (!taskEnd.SOURCE_DATA_ID.HasValue)
taskEnd.SOURCE_DATA_ID = entity.ID;
}
MFlowPermitService.InsertApprove("CM" + serialCode, "CM002", null, entity.ID, "CM002_SHOWPRINT", null, true, () =>
{ {
if (entity != null) if (entity != null)
UpdateEntityNoCommit(entity); UpdateEntityNoCommit(entity);
if (taskEnd != null)//明细
UpdateEntityNoCommit(taskEnd);
if (listPlanDetail != null && listPlanDetail.Any())//明细 if (listPlanDetail != null && listPlanDetail.Any())//明细
BantchSaveEntityNoCommit(listPlanDetail); BantchSaveEntityNoCommit(listPlanDetail);
if (listFiles != null && listFiles.Any())//关联应急预案 if (listFiles != null && listFiles.Any())//关联应急预案

View File

@ -112,7 +112,11 @@ namespace APT.SC.WebApi.Controllers.Api.CM
} }
T_FM_NOTIFICATION_TASK taskEnd = null; T_FM_NOTIFICATION_TASK taskEnd = null;
if (entity.TaskID != Guid.Empty) if (entity.TaskID != Guid.Empty)
{
taskEnd = NotificationTaskService.GetEntityTask(entity.TaskID, "CM018_SHOWPRINT"); taskEnd = NotificationTaskService.GetEntityTask(entity.TaskID, "CM018_SHOWPRINT");
if (!taskEnd.SOURCE_DATA_ID.HasValue)
taskEnd.SOURCE_DATA_ID = entity.ID;
}
if (entity.ENABLE_STATUS == FMEnableStatusEnum.) if (entity.ENABLE_STATUS == FMEnableStatusEnum.)
{ {

View File

@ -66,8 +66,8 @@ namespace APT.WebApi.Models
} }
var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds; var TalSeconds = (DateTime.Now - START_TIME).TotalSeconds;
//if (TalSeconds > 1) if (TalSeconds > 0.8)
//{ {
T_FM_SYNC_LOG log = new T_FM_SYNC_LOG() T_FM_SYNC_LOG log = new T_FM_SYNC_LOG()
{ {
ID = Guid.NewGuid(), ID = Guid.NewGuid(),
@ -121,6 +121,7 @@ namespace APT.WebApi.Models
} }
} }
} }
}
catch catch
{ {
} }

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">

View File

@ -19,7 +19,7 @@
<appendToFile value="true" /> <appendToFile value="true" />
<rollingStyle value="Composite" /> <rollingStyle value="Composite" />
<staticLogFileName value="false" /> <staticLogFileName value="false" />
<datePattern value="yyyyMMdd'.log'" /> <datePattern value="yyyyMM'.log'" />
<maxSizeRollBackups value="10" /> <maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" /> <maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">