Commit f12fc489 authored by liudong1993's avatar liudong1993

推送调整

parent 10b4b775
......@@ -34,10 +34,16 @@ namespace Property.Common.Models
[EnumField("请购单审核")]
BuyingRequisition = 4,
/// <summary>
/// 请购单采购
/// </summary>
[EnumField("请购单采购")]
PurchaseRequisition = 5,
/// <summary>
/// 财务单据审核
/// </summary>
[EnumField("财务单据审核")]
Finance = 5,
Finance = 6,
}
}
......@@ -4044,11 +4044,11 @@ namespace Property.Module.FixedAssets
account.Add(new EmAccoutIdModel()
{
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;
}
......@@ -4062,17 +4062,27 @@ namespace Property.Module.FixedAssets
/// <param name="title"></param>
/// <param name="empId"></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>();
//Dictionary<string, object> webExtras = new Dictionary<string, object>
//{
// { "jumpUrl", "" }
//};
//appExtras.Add("jumpUrl", "vt://financeApprovalDetail/view?ID=" + workFlowId + "&Conditon=3&Source=message&Type=" + Type);
//IMService.PushFinanceMessage(account, empId, content, title, type, SystemPushLogTypeEnum.XMApp, appExtras);
//IMService.PushMessage(account.RefMapperToList<Property.Common.Models.EmAccoutIdModel>(), empId, content, title, type, SystemPushLogTypeEnum.Web, webExtras);
List<Common.Message.PushMessageModel> SendList = new List<Common.Message.PushMessageModel>();
foreach (var item in account)
{
Common.Message.PushMessageModel model = new Common.Message.PushMessageModel()
{
CategoryId = type,
Content = content,
CoverImg = "",
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>
......@@ -4337,11 +4347,11 @@ namespace Property.Module.FixedAssets
account.Add(new EmAccoutIdModel()
{
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;
......
......@@ -234,7 +234,7 @@ namespace Property.Module.FixedAssets
}
newList = ApplyForList;
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
{
......@@ -262,7 +262,7 @@ namespace Property.Module.FixedAssets
newList = GetNewEmList(newList);
#endregion
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
{
......@@ -288,7 +288,7 @@ namespace Property.Module.FixedAssets
if (empList != null && empList.Count > 0)
{
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
{
......@@ -309,7 +309,7 @@ namespace Property.Module.FixedAssets
newList = GetNewEmList(empList);
#endregion
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
{
......@@ -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()) });
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();
}
else
......@@ -617,7 +617,7 @@ namespace Property.Module.FixedAssets
}
newList = ApplyForList;
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
{
......@@ -644,7 +644,7 @@ namespace Property.Module.FixedAssets
newList = GetNewEmList(newList);
#endregion
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
{
......@@ -669,7 +669,7 @@ namespace Property.Module.FixedAssets
if (empList != null && empList.Count > 0)
{
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
{
......@@ -2116,23 +2116,21 @@ namespace Property.Module.FixedAssets
var CreateModel = employeeRepository.GetEmployeeInfo(usemodel.CreateBy.Value);
if (CreateModel != null)
{
EmAccout = CreateModel.Account;
EmAccout = CreateModel.EmployeeName;
EmId = CreateModel.Id;
}
List<EmAccoutIdModel> EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel { EmAccount = EmAccout, EmployeeId = EmId } };
if (ToAuditFlow.Count == 1)
{//审批完成
PushAuditMessage(EmNameList, WorkFlowId, $@"您的资产申请已完成!", "资产审批完成", empId, SysTemPushTypeEnum.PropertyAudit);
PushAuditMessage(EmNameList, WorkFlowId, $@"您的资产申请已完成!", "资产审批完成", empId, Common.Models.PushMessageCategoryEnum.Property);
//抄送人通知
PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的资产抄送通知!", "资产抄送通知", empId, SysTemPushTypeEnum.PropertyAudit);
//所有审核人
//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(CopyAccountList, WorkFlowId, $@"有审核完成的资产抄送通知!", "资产抄送通知", empId, Common.Models.PushMessageCategoryEnum.Property);
}
else
{
//审批通过
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的资产消息!", "资产审核通知", empId, SysTemPushTypeEnum.PropertyAudit);
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的资产消息!", "资产审核通知", empId, Common.Models.PushMessageCategoryEnum.Property);
}
//日志
......@@ -2329,10 +2327,7 @@ namespace Property.Module.FixedAssets
EmId = CreateModel.Id;
}
var EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel() { EmAccount = EmAccout, EmployeeId = EmId } };
PushAuditMessage(EmNameList, WorkFlowId, $@"您有资产申请已被驳回!", "审核不通过", empId, SysTemPushTypeEnum.PropertyAudit);
//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);
PushAuditMessage(EmNameList, WorkFlowId, $@"您有资产申请已被驳回!", "审核不通过", empId, Common.Models.PushMessageCategoryEnum.Property);
workflow_AuditRelevanceRepository.DBSession.Commit();
return ApiResult.Success("驳回成功");
......@@ -2406,21 +2401,26 @@ namespace Property.Module.FixedAssets
/// <param name="title"></param>
/// <param name="empId"></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>();
//string url = "";
//if (type == SysTemPushTypeEnum.PropertyAudit) {
// url = "AssetsShenpi?Id=" + workFlowId + "&compType=shenpi";
//}
//Dictionary<string, object> webExtras = new Dictionary<string, object>
//{
// { "jumpUrl", url }
//};
//appExtras.Add("jumpUrl", "vt://financeApprovalDetail/view?ID=" + workFlowId + "&Conditon=3&Source=message&Type=" + Type);
//IMService.PushFinanceMessage(account, empId, content, title, type, SystemPushLogTypeEnum.XMApp, appExtras);
//IMService.PushMessage(account.RefMapperToList<Property.Common.Models.EmAccoutIdModel>(), empId, content, title, type, SystemPushLogTypeEnum.Web, webExtras);
List<Common.Message.PushMessageModel> SendList = new List<Common.Message.PushMessageModel>();
foreach (var item in account) {
Common.Message.PushMessageModel model = new Common.Message.PushMessageModel()
{
CategoryId = type,
Content = content,
CoverImg = "",
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);
}
#region 耗材入库
......@@ -3215,16 +3215,14 @@ namespace Property.Module.FixedAssets
if (ToAuditFlow.Count == 1)
{//审批完成
PushAuditMessage(EmNameList, WorkFlowId, $@"您的耗材入库申请已完成!", "入库审批完成", empId, SysTemPushTypeEnum.SuppliesAudit);
PushAuditMessage(EmNameList, WorkFlowId, $@"您的耗材入库申请已完成!", "入库审批完成", empId, Common.Models.PushMessageCategoryEnum.Property);
//抄送人通知
PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的耗材入库抄送通知!", "入库抄送通知", empId, SysTemPushTypeEnum.SuppliesAudit);
//所有审核人
//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(CopyAccountList, WorkFlowId, $@"有审核完成的耗材入库抄送通知!", "入库抄送通知", empId, Common.Models.PushMessageCategoryEnum.Property);
}
else
{
//审批通过
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的耗材入库消息!", "入库审核通知", empId, SysTemPushTypeEnum.SuppliesAudit);
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的耗材入库消息!", "入库审核通知", empId, Common.Models.PushMessageCategoryEnum.Property);
}
//日志
......@@ -3454,7 +3452,7 @@ namespace Property.Module.FixedAssets
EmId = CreateModel.Id;
}
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();
return ApiResult.Success("驳回成功");
......@@ -4216,17 +4214,17 @@ namespace Property.Module.FixedAssets
List<EmAccoutIdModel> EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel { EmAccount = EmAccout, EmployeeId = EmId } };
if (ToAuditFlow.Count == 1)
{//审批完成
PushAuditMessage(EmNameList, WorkFlowId, $@"您的请购申请已完成!", "请购审批完成", empId, SysTemPushTypeEnum.RequisitionAudit);
{ //审批完成
PushAuditMessage(EmNameList, WorkFlowId, $@"您的请购申请已完成!", "请购审批完成", empId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
//抄送人通知
PushAuditMessage(CopyAccountList, WorkFlowId, $@"有审核完成的请购单抄送通知!", "请购抄送通知", empId, SysTemPushTypeEnum.RequisitionAudit);
//所有审核人
//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(CopyAccountList, WorkFlowId, $@"有审核完成的请购单抄送通知!", "请购抄送通知", empId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
//给经办人推送
PushAuditMessage(EmNameList, WorkFlowId, $@"您有待采购的请购单!", "请购单采购", empId, Common.Models.PushMessageCategoryEnum.PurchaseRequisition);
}
else
{
//审批通过
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的请购消息!", "请购审核通知", empId, SysTemPushTypeEnum.RequisitionAudit);
PushAuditMessage(AuditAccountList, WorkFlowId, $@"你有待审核的请购消息!", "请购审核通知", empId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
}
//日志
......@@ -4424,10 +4422,7 @@ namespace Property.Module.FixedAssets
EmId = CreateModel.Id;
}
var EmNameList = new List<EmAccoutIdModel>() { new EmAccoutIdModel() { EmAccount = EmAccout, EmployeeId = EmId } };
PushAuditMessage(EmNameList, WorkFlowId, $@"您有请购申请已被驳回!", "请购不通过", empId, SysTemPushTypeEnum.PropertyAudit);
//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);
PushAuditMessage(EmNameList, WorkFlowId, $@"您有请购申请已被驳回!", "请购不通过", empId, Common.Models.PushMessageCategoryEnum.BuyingRequisition);
workflow_AuditRelevanceRepository.DBSession.Commit();
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