public async Task ReportBoxTo() { // var toUser = _workAppService.GetReportToManagers(); var data = await _boxRecordAppService.GetReportData(); foreach (var a in data) { string title = a.OutletName; string desc = string.Format("贵行的{0}于{1}入库", a.BoxName, a.InTime); if (!string.IsNullOrEmpty(a.ToUser)) { WeixinUtils.SendTextCard("app04", a.ToUser, title, desc); } //WeixinUtils.SendTextCard("app03", toUser, title, desc); } }
public async Task <JsonResult> ProcessIssueReport(int issueId, string content, int depotId) { try { var toUsers = WorkManager.GetReportToManagers(depotId); var title = await _issueAppService.ProcessIssue(issueId, $"发送给{toUsers}"); WeixinUtils.SendTextCard("App03", toUsers, title, content); return(Json(new { result = "success", content = $"完成处理并发送通知给{toUsers}" })); } catch (Exception ex) { throw new UserFriendlyException("操作失败", ex.Message); } }
public void ReportTaskTo(string id) { var ret = _workAppService.GetReportToManagers(); if (string.IsNullOrEmpty(ret.Item2)) { return; } var data = _workAppService.GetTaskReportData(); string title = string.Format("{0}报告今日<{1}>线路任务情况", id, ret.Item1); string desc = string.Format("线路数:{0} 条 (安排人员: {1}人)\n", data.Route.Count1, data.Route.Count2); desc += string.Format("内务数:{0} 条 (安排人员: {1}人)\n", data.Affair.Count1, data.Affair.Count2); desc += string.Format("收费中调数:{0} 个 (收费: {1}元)\n", data.Task.Count1, data.Task.Count2); WeixinUtils.SendTextCard("App03", ret.Item2, title, desc); _workAppService.SetReportDate(); }
public async Task ReportVehicleTo(string id) { var ret = _workAppService.GetReportToManagers(); if (string.IsNullOrEmpty(ret.Item2)) { return; } var data = await _vehicleRecordAppService.GetReportData(); string title = string.Format("{0}报告今日<{1}>车辆加油维修情况", id, ret.Item1);; string desc = string.Format("加油次数:{0} (量:{1}}升 费用:{2}元\n", data.OilCount, data.OilQuantity, data.OilPrice); desc += string.Format("车辆维修次数:{0} (费用: {1}元)", data.MTCount, data.MTPrice); WeixinUtils.SendTextCard("App04", ret.Item2, title, desc); _workAppService.SetReportDate(); }
public async Task ReportArticleTo(string id) { var ret = _workAppService.GetReportToManagers(); if (string.IsNullOrEmpty(ret.Item2)) { return; } var data = await _articleRecordAppService.GetReportData(); string title = string.Format("{0}报告今日<{1}>物品领用情况", id, ret.Item1); string desc = null; foreach (var a in data) { desc += string.Format("{0}今领:{1}, 未还:{2}\n", a.Name, a.LendCount, a.UnReturnCount); } WeixinUtils.SendTextCard("App03", ret.Item2, title, desc); _workAppService.SetReportDate(); await _context.Clients.All.SendAsync("getMessage", "askVaultGuard " + string.Format("你有来自({0})的设防申请", ret.Item1)); }