Commit f12fc489 authored by liudong1993's avatar liudong1993

推送调整

parent 10b4b775
...@@ -34,10 +34,16 @@ namespace Property.Common.Models ...@@ -34,10 +34,16 @@ namespace Property.Common.Models
[EnumField("请购单审核")] [EnumField("请购单审核")]
BuyingRequisition = 4, BuyingRequisition = 4,
/// <summary>
/// 请购单采购
/// </summary>
[EnumField("请购单采购")]
PurchaseRequisition = 5,
/// <summary> /// <summary>
/// 财务单据审核 /// 财务单据审核
/// </summary> /// </summary>
[EnumField("财务单据审核")] [EnumField("财务单据审核")]
Finance = 5, Finance = 6,
} }
} }
...@@ -4044,11 +4044,11 @@ namespace Property.Module.FixedAssets ...@@ -4044,11 +4044,11 @@ namespace Property.Module.FixedAssets
account.Add(new EmAccoutIdModel() account.Add(new EmAccoutIdModel()
{ {
EmployeeId = emodel.EmployeeId, EmployeeId = emodel.EmployeeId,
EmAccount = emodel.LoginMobile EmAccount = userInfo.emName
}); });
} }
//发送通知 //发送通知
PushBuyingMessage(account, 0, "您有资产请购信息已购买,请往资产管理系统查看", "请购单通知", userInfo.EmployeeId, SysTemPushTypeEnum.RequisitionAudit); PushBuyingMessage(account, 0, "您有资产请购信息已购买,请往资产管理系统查看", "请购单通知", userInfo.EmployeeId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
} }
return flag; return flag;
} }
...@@ -4062,17 +4062,27 @@ namespace Property.Module.FixedAssets ...@@ -4062,17 +4062,27 @@ namespace Property.Module.FixedAssets
/// <param name="title"></param> /// <param name="title"></param>
/// <param name="empId"></param> /// <param name="empId"></param>
/// <param name="type"></param> /// <param name="type"></param>
public void PushBuyingMessage(List<EmAccoutIdModel> account, int workFlowId, string content, string title, int? empId, SysTemPushTypeEnum type) public void PushBuyingMessage(List<EmAccoutIdModel> account, int workFlowId, string content, string title, int? empId, Common.Models.PushMessageCategoryEnum type)
{ {
//Dictionary<string, object> appExtras = new Dictionary<string, object>(); List<Common.Message.PushMessageModel> SendList = new List<Common.Message.PushMessageModel>();
//Dictionary<string, object> webExtras = new Dictionary<string, object> foreach (var item in account)
//{ {
// { "jumpUrl", "" } Common.Message.PushMessageModel model = new Common.Message.PushMessageModel()
//}; {
//appExtras.Add("jumpUrl", "vt://financeApprovalDetail/view?ID=" + workFlowId + "&Conditon=3&Source=message&Type=" + Type); CategoryId = type,
Content = content,
//IMService.PushFinanceMessage(account, empId, content, title, type, SystemPushLogTypeEnum.XMApp, appExtras); CoverImg = "",
//IMService.PushMessage(account.RefMapperToList<Property.Common.Models.EmAccoutIdModel>(), empId, content, title, type, SystemPushLogTypeEnum.Web, webExtras); CreateByName = item.EmAccount,
JumpUrl = $"",
SendTime = DateTime.Now,
SendType = 0,
Title = title,
Platform = 2,
ReceiveId = item.EmployeeId.ToString(),
};
SendList.Add(model);
}
Common.Message.MessageHelper.SendMessage(SendList);
} }
/// <summary> /// <summary>
...@@ -4337,11 +4347,11 @@ namespace Property.Module.FixedAssets ...@@ -4337,11 +4347,11 @@ namespace Property.Module.FixedAssets
account.Add(new EmAccoutIdModel() account.Add(new EmAccoutIdModel()
{ {
EmployeeId = emodel.EmployeeId, EmployeeId = emodel.EmployeeId,
EmAccount = emodel.LoginMobile EmAccount = userInfo.emName
}); });
} }
//发送通知 经办人有变更(让其快速处理采购) //发送通知 经办人有变更(让其快速处理采购)
PushBuyingMessage(account, 0, "您有请购单待采购,请往资产管理系统查看", "请购单通知", userInfo.EmployeeId, SysTemPushTypeEnum.RequisitionAudit); PushBuyingMessage(account, 0, "您有请购单待采购,请往资产管理系统查看", "请购单通知", userInfo.EmployeeId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
} }
} }
return flag; return flag;
......
...@@ -234,7 +234,7 @@ namespace Property.Module.FixedAssets ...@@ -234,7 +234,7 @@ namespace Property.Module.FixedAssets
} }
newList = ApplyForList; newList = ApplyForList;
var emp2List = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) }); var emp2List = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) });
sendAccount = emp2List.Select(t => new EmAccoutIdModel() { EmAccount = t.Account, EmployeeId = t.Id }).ToList();//推送 sendAccount = emp2List.Select(t => new EmAccoutIdModel() { EmAccount = t.EmployeeName, EmployeeId = t.Id }).ToList();//推送
} }
else else
{ {
...@@ -262,7 +262,7 @@ namespace Property.Module.FixedAssets ...@@ -262,7 +262,7 @@ namespace Property.Module.FixedAssets
newList = GetNewEmList(newList); newList = GetNewEmList(newList);
#endregion #endregion
var empList2 = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) }); var empList2 = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) });
sendAccount = empList2.Select(t => new EmAccoutIdModel() { EmAccount = t.Account, EmployeeId = t.Id }).ToList();//推送 sendAccount = empList2.Select(t => new EmAccoutIdModel() { EmAccount = t.EmployeeName, EmployeeId = t.Id }).ToList();//推送
} }
else else
{ {
...@@ -288,7 +288,7 @@ namespace Property.Module.FixedAssets ...@@ -288,7 +288,7 @@ namespace Property.Module.FixedAssets
if (empList != null && empList.Count > 0) if (empList != null && empList.Count > 0)
{ {
newList = empList.Select(x => x.Id).ToList(); newList = empList.Select(x => x.Id).ToList();
sendAccount = empList.Select(t => new EmAccoutIdModel() { EmAccount = t.Account, EmployeeId = t.Id }).ToList();//推送 sendAccount = empList.Select(t => new EmAccoutIdModel() { EmAccount = t.EmployeeName, EmployeeId = t.Id }).ToList();//推送
} }
else else
{ {
...@@ -309,7 +309,7 @@ namespace Property.Module.FixedAssets ...@@ -309,7 +309,7 @@ namespace Property.Module.FixedAssets
newList = GetNewEmList(empList); newList = GetNewEmList(empList);
#endregion #endregion
var emp2List = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) }); var emp2List = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) });
sendAccount = emp2List.Select(t => new EmAccoutIdModel() { EmAccount = t.Account, EmployeeId = t.Id }).ToList();//推送 sendAccount = emp2List.Select(t => new EmAccoutIdModel() { EmAccount = t.EmployeeName, EmployeeId = t.Id }).ToList();//推送
} }
else else
{ {
...@@ -599,7 +599,7 @@ namespace Property.Module.FixedAssets ...@@ -599,7 +599,7 @@ namespace Property.Module.FixedAssets
List<Employee_ViewModel> empList = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList.Select(x => x).ToList()) }); List<Employee_ViewModel> empList = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList.Select(x => x).ToList()) });
if (empList.Count > 0) if (empList.Count > 0)
{ {
AuditAccountList = empList.Select(t => new EmAccoutIdModel() { EmAccount = t.Account, EmployeeId = t.Id }).Distinct().ToList(); AuditAccountList = empList.Select(t => new EmAccoutIdModel() { EmAccount = t.EmployeeName, EmployeeId = t.Id }).Distinct().ToList();
newList = empList.Select(t => t.Id).ToList(); newList = empList.Select(t => t.Id).ToList();
} }
else else
...@@ -617,7 +617,7 @@ namespace Property.Module.FixedAssets ...@@ -617,7 +617,7 @@ namespace Property.Module.FixedAssets
} }
newList = ApplyForList; newList = ApplyForList;
var emp2List = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) }); var emp2List = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) });
AuditAccountList = emp2List.Select(t => new EmAccoutIdModel() { EmAccount = t.Account, EmployeeId = t.Id }).ToList();//推送 AuditAccountList = emp2List.Select(t => new EmAccoutIdModel() { EmAccount = t.EmployeeName, EmployeeId = t.Id }).ToList();//推送
} }
else else
{ {
...@@ -644,7 +644,7 @@ namespace Property.Module.FixedAssets ...@@ -644,7 +644,7 @@ namespace Property.Module.FixedAssets
newList = GetNewEmList(newList); newList = GetNewEmList(newList);
#endregion #endregion
var empList2 = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) }); var empList2 = employeeRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", newList?.Select(x => x).ToList()) });
AuditAccountList = empList2.Select(t => new EmAccoutIdModel() { EmAccount = t.Account, EmployeeId = t.Id }).ToList();//推送 AuditAccountList = empList2.Select(t => new EmAccoutIdModel() { EmAccount = t.EmployeeName, EmployeeId = t.Id }).ToList();//推送
} }
else else
{ {
...@@ -669,7 +669,7 @@ namespace Property.Module.FixedAssets ...@@ -669,7 +669,7 @@ namespace Property.Module.FixedAssets
if (empList != null && empList.Count > 0) if (empList != null && empList.Count > 0)
{ {
newList = empList.Select(x => x.Id).ToList(); newList = empList.Select(x => x.Id).ToList();
AuditAccountList = empList.Select(t => new EmAccoutIdModel() { EmAccount = t.Account, EmployeeId = t.Id }).ToList();//推送 AuditAccountList = empList.Select(t => new EmAccoutIdModel() { EmAccount = t.EmployeeName, EmployeeId = t.Id }).ToList();//推送
} }
else else
{ {
...@@ -2116,23 +2116,21 @@ namespace Property.Module.FixedAssets ...@@ -2116,23 +2116,21 @@ namespace Property.Module.FixedAssets
var CreateModel = employeeRepository.GetEmployeeInfo(usemodel.CreateBy.Value); var CreateModel = employeeRepository.GetEmployeeInfo(usemodel.CreateBy.Value);
if (CreateModel != null) if (CreateModel != null)
{ {
EmAccout = CreateModel.Account; EmAccout = CreateModel.EmployeeName;
EmId = CreateModel.Id; EmId = CreateModel.Id;
} }
List<EmAccoutIdModel> EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel { EmAccount = EmAccout, EmployeeId = EmId } }; List<EmAccoutIdModel> EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel { EmAccount = EmAccout, EmployeeId = EmId } };
if (ToAuditFlow.Count == 1) if (ToAuditFlow.Count == 1)
{//审批完成 {//审批完成
PushAuditMessage(EmNameList, WorkFlowId, $@"您的资产申请已完成!", "资产审批完成", empId, SysTemPushTypeEnum.PropertyAudit); PushAuditMessage(EmNameList, WorkFlowId, $@"您的资产申请已完成!", "资产审批完成", empId, Common.Models.PushMessageCategoryEnum.Property);
//抄送人通知 //抄送人通知
PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的资产抄送通知!", "资产抄送通知", empId, SysTemPushTypeEnum.PropertyAudit); PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的资产抄送通知!", "资产抄送通知", empId, Common.Models.PushMessageCategoryEnum.Property);
//所有审核人
//AuditAccountList = aurList.Where(x => x.AuditStatus == WFRrocessStatus.AuditThrough && x.AuditEmId != empId).Select(x => new EmAccoutIdModel() { EmAccount = x.AuditEmAccout, EmployeeId = x.AuditEmId ?? 0 }).Distinct().ToList();
} }
else else
{ {
//审批通过 //审批通过
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的资产消息!", "资产审核通知", empId, SysTemPushTypeEnum.PropertyAudit); PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的资产消息!", "资产审核通知", empId, Common.Models.PushMessageCategoryEnum.Property);
} }
//日志 //日志
...@@ -2329,10 +2327,7 @@ namespace Property.Module.FixedAssets ...@@ -2329,10 +2327,7 @@ namespace Property.Module.FixedAssets
EmId = CreateModel.Id; EmId = CreateModel.Id;
} }
var EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel() { EmAccount = EmAccout, EmployeeId = EmId } }; var EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel() { EmAccount = EmAccout, EmployeeId = EmId } };
PushAuditMessage(EmNameList, WorkFlowId, $@"您有资产申请已被驳回!", "审核不通过", empId, SysTemPushTypeEnum.PropertyAudit); PushAuditMessage(EmNameList, WorkFlowId, $@"您有资产申请已被驳回!", "审核不通过", empId, Common.Models.PushMessageCategoryEnum.Property);
//var ThroughList = aurList.Where(x => x.AuditStatus == WFRrocessStatus.AuditThrough).ToList();
//EmNameList = ThroughList.Select(x => new Model.Extend.Finance.EmAccoutIdModel() { EmAccount = x.AuditEmAccout, EmployeeId = x.AuditEmId ?? 0 }).Distinct().ToList();
//PushAuditMessage(EmNameList, WorkFlowId, $@"您的审核通过已被上级驳回!", "审核不通过", empId, SysTemPushTypeEnum.Audit, 3);
workflow_AuditRelevanceRepository.DBSession.Commit(); workflow_AuditRelevanceRepository.DBSession.Commit();
return ApiResult.Success("驳回成功"); return ApiResult.Success("驳回成功");
...@@ -2406,21 +2401,26 @@ namespace Property.Module.FixedAssets ...@@ -2406,21 +2401,26 @@ namespace Property.Module.FixedAssets
/// <param name="title"></param> /// <param name="title"></param>
/// <param name="empId"></param> /// <param name="empId"></param>
/// <param name="type"></param> /// <param name="type"></param>
public void PushAuditMessage(List<EmAccoutIdModel> account, int workFlowId, string content, string title, int? empId, SysTemPushTypeEnum type) public void PushAuditMessage(List<EmAccoutIdModel> account, int workFlowId, string content, string title, int? empId, Common.Models.PushMessageCategoryEnum type)
{ {
//Dictionary<string, object> appExtras = new Dictionary<string, object>(); List<Common.Message.PushMessageModel> SendList = new List<Common.Message.PushMessageModel>();
//string url = ""; foreach (var item in account) {
//if (type == SysTemPushTypeEnum.PropertyAudit) { Common.Message.PushMessageModel model = new Common.Message.PushMessageModel()
// url = "AssetsShenpi?Id=" + workFlowId + "&compType=shenpi"; {
//} CategoryId = type,
//Dictionary<string, object> webExtras = new Dictionary<string, object> Content = content,
//{ CoverImg = "",
// { "jumpUrl", url } CreateByName = item.EmAccount,
//}; JumpUrl = $"",
//appExtras.Add("jumpUrl", "vt://financeApprovalDetail/view?ID=" + workFlowId + "&Conditon=3&Source=message&Type=" + Type); SendTime = DateTime.Now,
SendType = 0,
//IMService.PushFinanceMessage(account, empId, content, title, type, SystemPushLogTypeEnum.XMApp, appExtras); Title = title,
//IMService.PushMessage(account.RefMapperToList<Property.Common.Models.EmAccoutIdModel>(), empId, content, title, type, SystemPushLogTypeEnum.Web, webExtras); Platform = 2,
ReceiveId = item.EmployeeId.ToString(),
};
SendList.Add(model);
}
Common.Message.MessageHelper.SendMessage(SendList);
} }
#region 耗材入库 #region 耗材入库
...@@ -3215,16 +3215,14 @@ namespace Property.Module.FixedAssets ...@@ -3215,16 +3215,14 @@ namespace Property.Module.FixedAssets
if (ToAuditFlow.Count == 1) if (ToAuditFlow.Count == 1)
{//审批完成 {//审批完成
PushAuditMessage(EmNameList, WorkFlowId, $@"您的耗材入库申请已完成!", "入库审批完成", empId, SysTemPushTypeEnum.SuppliesAudit); PushAuditMessage(EmNameList, WorkFlowId, $@"您的耗材入库申请已完成!", "入库审批完成", empId, Common.Models.PushMessageCategoryEnum.Property);
//抄送人通知 //抄送人通知
PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的耗材入库抄送通知!", "入库抄送通知", empId, SysTemPushTypeEnum.SuppliesAudit); PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的耗材入库抄送通知!", "入库抄送通知", empId, Common.Models.PushMessageCategoryEnum.Property);
//所有审核人
//AuditAccountList = aurList.Where(x => x.AuditStatus == WFRrocessStatus.AuditThrough && x.AuditEmId != empId).Select(x => new EmAccoutIdModel() { EmAccount = x.AuditEmAccout, EmployeeId = x.AuditEmId ?? 0 }).Distinct().ToList();
} }
else else
{ {
//审批通过 //审批通过
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的耗材入库消息!", "入库审核通知", empId, SysTemPushTypeEnum.SuppliesAudit); PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的耗材入库消息!", "入库审核通知", empId, Common.Models.PushMessageCategoryEnum.Property);
} }
//日志 //日志
...@@ -3454,7 +3452,7 @@ namespace Property.Module.FixedAssets ...@@ -3454,7 +3452,7 @@ namespace Property.Module.FixedAssets
EmId = CreateModel.Id; EmId = CreateModel.Id;
} }
var EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel() { EmAccount = EmAccout, EmployeeId = EmId } }; var EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel() { EmAccount = EmAccout, EmployeeId = EmId } };
PushAuditMessage(EmNameList, WorkFlowId, $@"您有耗材入库申请已被驳回!", "入库审核不通过", empId, SysTemPushTypeEnum.SuppliesAudit); PushAuditMessage(EmNameList, WorkFlowId, $@"您有耗材入库申请已被驳回!", "入库审核不通过", empId, Common.Models.PushMessageCategoryEnum.Property);
workflow_AuditRelevanceRepository.DBSession.Commit(); workflow_AuditRelevanceRepository.DBSession.Commit();
return ApiResult.Success("驳回成功"); return ApiResult.Success("驳回成功");
...@@ -4216,17 +4214,17 @@ namespace Property.Module.FixedAssets ...@@ -4216,17 +4214,17 @@ namespace Property.Module.FixedAssets
List<EmAccoutIdModel> EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel { EmAccount = EmAccout, EmployeeId = EmId } }; List<EmAccoutIdModel> EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel { EmAccount = EmAccout, EmployeeId = EmId } };
if (ToAuditFlow.Count == 1) if (ToAuditFlow.Count == 1)
{//审批完成 { //审批完成
PushAuditMessage(EmNameList, WorkFlowId, $@"您的请购申请已完成!", "请购审批完成", empId, SysTemPushTypeEnum.RequisitionAudit); PushAuditMessage(EmNameList, WorkFlowId, $@"您的请购申请已完成!", "请购审批完成", empId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
//抄送人通知 //抄送人通知
PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的请购单抄送通知!", "请购抄送通知", empId, SysTemPushTypeEnum.RequisitionAudit); PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的请购单抄送通知!", "请购抄送通知", empId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
//所有审核人 //给经办人推送
//AuditAccountList = aurList.Where(x => x.AuditStatus == WFRrocessStatus.AuditThrough && x.AuditEmId != empId).Select(x => new EmAccoutIdModel() { EmAccount = x.AuditEmAccout, EmployeeId = x.AuditEmId ?? 0 }).Distinct().ToList(); PushAuditMessage(EmNameList, WorkFlowId, $@"您有待采购的请购单!", "请购单采购", empId, Common.Models.PushMessageCategoryEnum.PurchaseRequisition);
} }
else else
{ {
//审批通过 //审批通过
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的请购消息!", "请购审核通知", empId, SysTemPushTypeEnum.RequisitionAudit); PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的请购消息!", "请购审核通知", empId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
} }
//日志 //日志
...@@ -4424,10 +4422,7 @@ namespace Property.Module.FixedAssets ...@@ -4424,10 +4422,7 @@ namespace Property.Module.FixedAssets
EmId = CreateModel.Id; EmId = CreateModel.Id;
} }
var EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel() { EmAccount = EmAccout, EmployeeId = EmId } }; var EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel() { EmAccount = EmAccout, EmployeeId = EmId } };
PushAuditMessage(EmNameList, WorkFlowId, $@"您有请购申请已被驳回!", "请购不通过", empId, SysTemPushTypeEnum.PropertyAudit); PushAuditMessage(EmNameList, WorkFlowId, $@"您有请购申请已被驳回!", "请购不通过", empId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
//var ThroughList = aurList.Where(x => x.AuditStatus == WFRrocessStatus.AuditThrough).ToList();
//EmNameList = ThroughList.Select(x => new Model.Extend.Finance.EmAccoutIdModel() { EmAccount = x.AuditEmAccout, EmployeeId = x.AuditEmId ?? 0 }).Distinct().ToList();
//PushAuditMessage(EmNameList, WorkFlowId, $@"您的审核通过已被上级驳回!", "审核不通过", empId, SysTemPushTypeEnum.Audit, 3);
workflow_AuditRelevanceRepository.DBSession.Commit(); workflow_AuditRelevanceRepository.DBSession.Commit();
return ApiResult.Success("驳回成功"); return ApiResult.Success("驳回成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment