|
|
@@ -2,22 +2,24 @@ |
|
|
|
using Learun.Application.OA; |
|
|
|
using Learun.Application.Organization; |
|
|
|
using Learun.Application.TwoDevelopment.EducationalAdministration; |
|
|
|
using Learun.Application.TwoDevelopment.LR_Desktop; |
|
|
|
using Learun.Application.TwoDevelopment.Permission; |
|
|
|
using Learun.Application.TwoDevelopment.PersonnelManagement; |
|
|
|
using Learun.Application.WorkFlow; |
|
|
|
using Learun.Cache.Base; |
|
|
|
using Learun.Cache.Factory; |
|
|
|
using Learun.Util; |
|
|
|
using Learun.Util.Operat; |
|
|
|
|
|
|
|
using Newtonsoft.Json; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Configuration; |
|
|
|
using System.Linq; |
|
|
|
using System.Net.Http; |
|
|
|
using System.Security.Cryptography; |
|
|
|
using System.Text; |
|
|
|
using System.Web; |
|
|
|
using System.Web.Mvc; |
|
|
|
using Learun.Cache.Base; |
|
|
|
using Learun.Cache.Factory; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Learun.Application.TwoDevelopment.LR_Desktop; |
|
|
|
using Learun.Application.TwoDevelopment.PersonnelManagement; |
|
|
|
|
|
|
|
namespace Learun.Application.Web.Controllers |
|
|
|
{ |
|
|
@@ -58,7 +60,10 @@ namespace Learun.Application.Web.Controllers |
|
|
|
private StuConsumptionIBLL stuConsumptionIBLL = new StuConsumptionBLL(); |
|
|
|
private MealCardRunTabIBLL mealCardRunTabIBLL = new MealCardRunTabBLL(); |
|
|
|
private Sys_UpdateRecordIBLL sys_UpdateRecordIBLL = new Sys_UpdateRecordBLL(); |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 标记登录的浏览器 |
|
|
|
/// </summary> |
|
|
|
private string LoginUserMarkKey = "Learun_ADMS_V7_Mark"; |
|
|
|
#region 统一身份认证3.0 |
|
|
|
/// <summary> |
|
|
|
/// 退出 |
|
|
@@ -966,6 +971,11 @@ namespace Learun.Application.Web.Controllers |
|
|
|
functionVisitEntity.PDate = DateTime.Now; |
|
|
|
functionVisitEntity.PUId = userid; |
|
|
|
var userinfo = userBll.GetEntityByUserId(userid); |
|
|
|
var type = 0;//1学生 0教师 |
|
|
|
if (userinfo.F_Description == "学生") |
|
|
|
{ |
|
|
|
type = 1; |
|
|
|
} |
|
|
|
functionVisitEntity.PUName = userinfo.F_RealName; |
|
|
|
if (uplist == null) |
|
|
|
{ |
|
|
@@ -980,22 +990,38 @@ namespace Learun.Application.Web.Controllers |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(perfun.FInterfaceUrl)) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass)) |
|
|
|
var url = perfun.FUrl; |
|
|
|
var token = OperatorHelper.Instance.AddLoginUser(userinfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 |
|
|
|
string loginMark = WebHelper.GetCookie(LoginUserMarkKey).ToString(); |
|
|
|
if (url.Contains("?")) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
functionVisitEntity.PIsLoginSuccess = true; |
|
|
|
functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl; |
|
|
|
functionVisitIbll.SaveEntity(null, functionVisitEntity); |
|
|
|
return Redirect(perfun.FInterfaceUrl + "?u=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPUserName, secretkey), publickey) + "&p=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPPass, secretkey), publickey) + "&t=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(DateTime.Now.ToString("yyyyMMddHHmmss"), secretkey), publickey) + "&ip=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(GetIP(), secretkey), publickey)+"&m=" + DESEncrypt.Encrypt(user.loginMark) + "&t=" + DESEncrypt.Encrypt(user.token)); |
|
|
|
url += "&appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userinfo.F_RealName, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userinfo.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userinfo.F_EnCode, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
functionVisitEntity.PIsLoginSuccess = false; |
|
|
|
functionVisitEntity.PContent = "用户未配置转到用户名密码配置页面"; |
|
|
|
functionVisitIbll.SaveEntity(null, functionVisitEntity); |
|
|
|
//用户未配置转到用户名密码配置页面 |
|
|
|
return Redirect("/SSOSystem/FirstLogin?sysid=" + sysid + "&openid=" + openid); |
|
|
|
url += "?appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userinfo.F_RealName, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userinfo.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userinfo.F_EnCode, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); |
|
|
|
} |
|
|
|
Util.Log.LogHelper.Info($"2{url};"); |
|
|
|
return Redirect(url); |
|
|
|
|
|
|
|
|
|
|
|
//if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass)) |
|
|
|
//{ |
|
|
|
// var token = OperatorHelper.Instance.AddLoginUser(userinfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 |
|
|
|
// string loginMark = WebHelper.GetCookie(LoginUserMarkKey).ToString(); |
|
|
|
// functionVisitEntity.PIsLoginSuccess = true; |
|
|
|
// functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl; |
|
|
|
// functionVisitIbll.SaveEntity(null, functionVisitEntity); |
|
|
|
// //return Redirect(perfun.FInterfaceUrl + "?u=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPUserName, secretkey), publickey) + "&p=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPPass, secretkey), publickey) + "&t=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(DateTime.Now.ToString("yyyyMMddHHmmss"), secretkey), publickey) + "&ip=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(GetIP(), secretkey), publickey)+"&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token)); |
|
|
|
//} |
|
|
|
//else |
|
|
|
//{ |
|
|
|
// functionVisitEntity.PIsLoginSuccess = false; |
|
|
|
// functionVisitEntity.PContent = "用户未配置转到用户名密码配置页面"; |
|
|
|
// functionVisitIbll.SaveEntity(null, functionVisitEntity); |
|
|
|
// //用户未配置转到用户名密码配置页面 |
|
|
|
// return Redirect("/SSOSystem/FirstLogin?sysid=" + sysid + "&openid=" + openid); |
|
|
|
//} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -1248,23 +1274,155 @@ namespace Learun.Application.Web.Controllers |
|
|
|
} |
|
|
|
ViewBag.NewsListOfzhuanti = newsListOfzhuanti; |
|
|
|
ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti); |
|
|
|
#region 流程 |
|
|
|
string Zero = ConfigurationManager.AppSettings["Zero"]; |
|
|
|
string URL = ""; |
|
|
|
var response = ""; |
|
|
|
//接口请求地址 |
|
|
|
URL = $"http://{Zero}/api/openapi/task/query/todo?pageNo=1&pageSize=10"; |
|
|
|
// 发送POST请求 |
|
|
|
response = SendPostRequestAsync(URL); |
|
|
|
|
|
|
|
var todoResult = JsonConvert.DeserializeObject<ZeroResult>(response); |
|
|
|
|
|
|
|
if (todoResult != null && todoResult.code == "200") |
|
|
|
{ |
|
|
|
//totalRows |
|
|
|
List<rows> ListTaskrows = new List<rows>(); |
|
|
|
if (todoResult.data.rows.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in todoResult.data.rows) |
|
|
|
{ |
|
|
|
var Taskrowss = new rows(); |
|
|
|
Taskrowss.appId = item.appId; |
|
|
|
Taskrowss.taskId = item.taskId; |
|
|
|
Taskrowss.instanceId = item.instanceId; |
|
|
|
Taskrowss.applyName = item.applyName; |
|
|
|
Taskrowss.applyId = item.applyId; |
|
|
|
Taskrowss.createTime = item.createTime; |
|
|
|
Taskrowss.formName = item.formName; |
|
|
|
Taskrowss.stage = item.stage; |
|
|
|
Taskrowss.url = item.url; |
|
|
|
ListTaskrows.Add(item); |
|
|
|
} |
|
|
|
ViewBag.TaskTotalNum = todoResult.data.totalRows; |
|
|
|
ViewBag.TaskListStr = JsonConvert.SerializeObject(ListTaskrows); |
|
|
|
ViewBag.TaskList = ViewBag.TaskListStr; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ViewBag.TaskTotalNum = 0; |
|
|
|
ViewBag.TaskListStr = JsonConvert.SerializeObject(ListTaskrows); |
|
|
|
ViewBag.TaskList = ViewBag.TaskListStr; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Util.Log.LogHelper.Info($"请求失败,<待办>发送POST请求失败;"); |
|
|
|
} |
|
|
|
//办公事项-待办任务 |
|
|
|
paginationobj.sidx = "F_CreateDate"; |
|
|
|
paginationobj.rows = 4; |
|
|
|
var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}"); |
|
|
|
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}"); |
|
|
|
ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList); |
|
|
|
ViewBag.TaskTotalNum = taskListAll.Count(); |
|
|
|
//var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}"); |
|
|
|
//ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}"); |
|
|
|
//ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList); |
|
|
|
//ViewBag.TaskTotalNum = taskListAll.Count(); |
|
|
|
|
|
|
|
//办公事项-已办任务 |
|
|
|
var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}"); |
|
|
|
ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}"); |
|
|
|
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList); |
|
|
|
ViewBag.FinishTaskTotalNum = finishTaskListAll.Count(); |
|
|
|
//var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}"); |
|
|
|
//ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}"); |
|
|
|
//ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList); |
|
|
|
//ViewBag.FinishTaskTotalNum = finishTaskListAll.Count(); |
|
|
|
|
|
|
|
URL = $"http://{Zero}/api/openapi/task/query/handle?pageNo=1&pageSize=10"; |
|
|
|
// 发送POST请求 |
|
|
|
response = SendPostRequestAsync(URL); |
|
|
|
var handleResult = JsonConvert.DeserializeObject<ZeroResult>(response); |
|
|
|
|
|
|
|
if (handleResult != null && handleResult.code == "200") |
|
|
|
{ |
|
|
|
List<rows> ListFinishrows = new List<rows>(); |
|
|
|
if (handleResult.data.rows.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in handleResult.data.rows) |
|
|
|
{ |
|
|
|
var Finishrowss = new rows(); |
|
|
|
Finishrowss.appId = item.appId; |
|
|
|
Finishrowss.taskId = item.taskId; |
|
|
|
Finishrowss.instanceId = item.instanceId; |
|
|
|
Finishrowss.applyName = item.applyName; |
|
|
|
Finishrowss.applyId = item.applyId; |
|
|
|
Finishrowss.createTime = item.createTime; |
|
|
|
Finishrowss.formName = item.formName; |
|
|
|
Finishrowss.stage = item.stage; |
|
|
|
Finishrowss.url = item.url; |
|
|
|
ListFinishrows.Add(item); |
|
|
|
} |
|
|
|
ViewBag.FinishTaskTotalNum = handleResult.data.totalRows; |
|
|
|
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ListFinishrows); |
|
|
|
ViewBag.FinishTaskList = ViewBag.FinishTaskListStr; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ViewBag.FinishTaskTotalNum = 0; |
|
|
|
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ListFinishrows); |
|
|
|
ViewBag.FinishTaskList = ViewBag.FinishTaskListStr; |
|
|
|
} |
|
|
|
//待办条数 |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Util.Log.LogHelper.Info($"请求失败,<已办>发送POST请求失败;"); |
|
|
|
} |
|
|
|
|
|
|
|
//办公事项-我发起的 |
|
|
|
var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}"); |
|
|
|
ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}"); |
|
|
|
ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList); |
|
|
|
ViewBag.MyListTotalNum = myListAll.Count(); |
|
|
|
//var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}"); |
|
|
|
//ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}"); |
|
|
|
//ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList); |
|
|
|
//ViewBag.MyListTotalNum = myListAll.Count(); |
|
|
|
|
|
|
|
URL = $"http://{Zero}/api/openapi/task/query/start?pageNo=1&pageSize=10"; |
|
|
|
|
|
|
|
// 发送POST请求 |
|
|
|
response = SendPostRequestAsync(URL); |
|
|
|
var startResult = JsonConvert.DeserializeObject<ZeroResult>(response); |
|
|
|
|
|
|
|
if (startResult != null && startResult.code == "200") |
|
|
|
{ |
|
|
|
List<rows> ListMyListrows = new List<rows>(); |
|
|
|
if (startResult.data.rows.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in startResult.data.rows) |
|
|
|
{ |
|
|
|
var MyListrowss = new rows(); |
|
|
|
MyListrowss.appId = item.appId; |
|
|
|
MyListrowss.taskId = item.taskId; |
|
|
|
MyListrowss.instanceId = item.instanceId; |
|
|
|
MyListrowss.applyName = item.applyName; |
|
|
|
MyListrowss.applyId = item.applyId; |
|
|
|
MyListrowss.createTime = item.createTime; |
|
|
|
MyListrowss.formName = item.formName; |
|
|
|
MyListrowss.stage = item.stage; |
|
|
|
MyListrowss.url = item.url; |
|
|
|
ListMyListrows.Add(item); |
|
|
|
} |
|
|
|
ViewBag.MyListTotalNum = startResult.data.totalRows; |
|
|
|
ViewBag.MyListStr = JsonConvert.SerializeObject(ListMyListrows); |
|
|
|
ViewBag.TaskList = ViewBag.MyListStr; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ViewBag.MyListTotalNum = 0; |
|
|
|
ViewBag.MyListStr = JsonConvert.SerializeObject(ListMyListrows); |
|
|
|
ViewBag.TaskList = ViewBag.MyListStr; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Util.Log.LogHelper.Info($"请求失败,<我发起的>发送POST请求失败;"); |
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
//常用服务 |
|
|
|
List<ModuleEntity> modulelist = new List<ModuleEntity>(); |
|
|
|
List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList(); |
|
|
@@ -1593,23 +1751,159 @@ namespace Learun.Application.Web.Controllers |
|
|
|
} |
|
|
|
ViewBag.NewsListOfzhuanti = newsListOfzhuanti; |
|
|
|
ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti); |
|
|
|
#region 流程 |
|
|
|
string Zero = ConfigurationManager.AppSettings["Zero"]; |
|
|
|
string URL = ""; |
|
|
|
var response = ""; |
|
|
|
//接口请求地址 |
|
|
|
URL = $"http://{Zero}/api/openapi/task/query/todo?pageNo=1&pageSize=10"; |
|
|
|
// 发送POST请求 |
|
|
|
response = SendPostRequestAsync(URL); |
|
|
|
|
|
|
|
var todoResult = JsonConvert.DeserializeObject<ZeroResult>(response); |
|
|
|
|
|
|
|
if (todoResult != null && todoResult.code == "200") |
|
|
|
{ |
|
|
|
//totalRows |
|
|
|
List<rows> ListTaskrows = new List<rows>(); |
|
|
|
if (todoResult.data.rows.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in todoResult.data.rows) |
|
|
|
{ |
|
|
|
var Taskrowss = new rows(); |
|
|
|
Taskrowss.appId = item.appId; |
|
|
|
Taskrowss.taskId = item.taskId; |
|
|
|
Taskrowss.instanceId = item.instanceId; |
|
|
|
Taskrowss.applyName = item.applyName; |
|
|
|
Taskrowss.applyId = item.applyId; |
|
|
|
Taskrowss.createTime = item.createTime; |
|
|
|
Taskrowss.formName = item.formName; |
|
|
|
Taskrowss.stage = item.stage; |
|
|
|
Taskrowss.url = item.url; |
|
|
|
ListTaskrows.Add(item); |
|
|
|
} |
|
|
|
ViewBag.TaskTotalNum = todoResult.data.totalRows; |
|
|
|
ViewBag.TaskListStr = JsonConvert.SerializeObject(ListTaskrows); |
|
|
|
ViewBag.TaskList = ViewBag.TaskListStr; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ViewBag.TaskTotalNum = 0; |
|
|
|
ViewBag.TaskListStr = JsonConvert.SerializeObject(ListTaskrows); |
|
|
|
ViewBag.TaskList = ViewBag.TaskListStr; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Util.Log.LogHelper.Info($"请求失败,<待办>发送POST请求失败;"); |
|
|
|
} |
|
|
|
//办公事项-待办任务 |
|
|
|
paginationobj.sidx = "F_CreateDate"; |
|
|
|
paginationobj.rows = 4; |
|
|
|
var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}"); |
|
|
|
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}"); |
|
|
|
ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList); |
|
|
|
ViewBag.TaskTotalNum = taskListAll.Count(); |
|
|
|
//var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}"); |
|
|
|
//ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}"); |
|
|
|
//ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList); |
|
|
|
//ViewBag.TaskTotalNum = taskListAll.Count(); |
|
|
|
|
|
|
|
//办公事项-已办任务 |
|
|
|
var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}"); |
|
|
|
ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}"); |
|
|
|
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList); |
|
|
|
ViewBag.FinishTaskTotalNum = finishTaskListAll.Count(); |
|
|
|
//var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}"); |
|
|
|
//ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}"); |
|
|
|
//ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList); |
|
|
|
//ViewBag.FinishTaskTotalNum = finishTaskListAll.Count(); |
|
|
|
|
|
|
|
URL = $"http://{Zero}/api/openapi/task/query/handle?pageNo=1&pageSize=10"; |
|
|
|
// 发送POST请求 |
|
|
|
response = SendPostRequestAsync(URL); |
|
|
|
var handleResult = JsonConvert.DeserializeObject<ZeroResult>(response); |
|
|
|
|
|
|
|
if (handleResult != null && handleResult.code == "200") |
|
|
|
{ |
|
|
|
List<rows> ListFinishrows = new List<rows>(); |
|
|
|
if (handleResult.data.rows.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in handleResult.data.rows) |
|
|
|
{ |
|
|
|
var Finishrowss = new rows(); |
|
|
|
Finishrowss.appId = item.appId; |
|
|
|
Finishrowss.taskId = item.taskId; |
|
|
|
Finishrowss.instanceId = item.instanceId; |
|
|
|
Finishrowss.applyName = item.applyName; |
|
|
|
Finishrowss.applyId = item.applyId; |
|
|
|
Finishrowss.createTime = item.createTime; |
|
|
|
Finishrowss.formName = item.formName; |
|
|
|
Finishrowss.stage = item.stage; |
|
|
|
Finishrowss.url = item.url; |
|
|
|
ListFinishrows.Add(item); |
|
|
|
} |
|
|
|
//待办条数 |
|
|
|
ViewBag.FinishTaskTotalNum = handleResult.data.totalRows; |
|
|
|
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ListFinishrows); |
|
|
|
ViewBag.FinishTaskList = ViewBag.FinishTaskListStr; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//待办条数 |
|
|
|
ViewBag.FinishTaskTotalNum = 0; |
|
|
|
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ListFinishrows); |
|
|
|
ViewBag.FinishTaskList = ViewBag.FinishTaskListStr; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Util.Log.LogHelper.Info($"请求失败,<已办>发送POST请求失败;"); |
|
|
|
} |
|
|
|
|
|
|
|
//办公事项-我发起的 |
|
|
|
var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}"); |
|
|
|
ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}"); |
|
|
|
ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList); |
|
|
|
ViewBag.MyListTotalNum = myListAll.Count(); |
|
|
|
//var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}"); |
|
|
|
//ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}"); |
|
|
|
//ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList); |
|
|
|
//ViewBag.MyListTotalNum = myListAll.Count(); |
|
|
|
|
|
|
|
URL = $"http://{Zero}/api/openapi/task/query/start?pageNo=1&pageSize=10"; |
|
|
|
|
|
|
|
// 发送POST请求 |
|
|
|
response = SendPostRequestAsync(URL); |
|
|
|
var startResult = JsonConvert.DeserializeObject<ZeroResult>(response); |
|
|
|
|
|
|
|
if (startResult != null && startResult.code == "200") |
|
|
|
{ |
|
|
|
List<rows> ListMyListrows = new List<rows>(); |
|
|
|
if (startResult.data.rows.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in startResult.data.rows) |
|
|
|
{ |
|
|
|
var MyListrowss = new rows(); |
|
|
|
MyListrowss.appId = item.appId; |
|
|
|
MyListrowss.taskId = item.taskId; |
|
|
|
MyListrowss.instanceId = item.instanceId; |
|
|
|
MyListrowss.applyName = item.applyName; |
|
|
|
MyListrowss.applyId = item.applyId; |
|
|
|
MyListrowss.createTime = item.createTime; |
|
|
|
MyListrowss.formName = item.formName; |
|
|
|
MyListrowss.stage = item.stage; |
|
|
|
MyListrowss.url = item.url; |
|
|
|
ListMyListrows.Add(item); |
|
|
|
} |
|
|
|
ViewBag.MyListTotalNum = startResult.data.totalRows; |
|
|
|
ViewBag.MyListStr = JsonConvert.SerializeObject(ListMyListrows); |
|
|
|
ViewBag.MyList = ViewBag.MyListStr; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ViewBag.MyListTotalNum = 0; |
|
|
|
ViewBag.MyListStr = JsonConvert.SerializeObject(ListMyListrows); |
|
|
|
ViewBag.MyList = ViewBag.MyListStr; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Util.Log.LogHelper.Info($"请求失败,<我发起的>发送POST请求失败;"); |
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
//常用服务 |
|
|
|
List<ModuleEntity> modulelist = new List<ModuleEntity>(); |
|
|
|
List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList(); |
|
|
@@ -2051,5 +2345,117 @@ namespace Learun.Application.Web.Controllers |
|
|
|
return Success("操作成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public class ZeroResult |
|
|
|
{ |
|
|
|
public bool? success { get; set; } |
|
|
|
public string code { get; set; } |
|
|
|
public string message { get; set; } |
|
|
|
public Result data { get; set; } |
|
|
|
} |
|
|
|
public class Result |
|
|
|
{ |
|
|
|
public string pageNo { get; set; } |
|
|
|
public string pageSize { get; set; } |
|
|
|
public string totalPage { get; set; } |
|
|
|
public string totalRows { get; set; } |
|
|
|
public List<rows> rows { get; set; } |
|
|
|
public ranbow ranbow { get; set; } |
|
|
|
} |
|
|
|
public class rows |
|
|
|
{ |
|
|
|
public string appId { get; set; } |
|
|
|
public string taskId { get; set; } |
|
|
|
public string instanceId { get; set; } |
|
|
|
public string applyName { get; set; } |
|
|
|
public string applyId { get; set; } |
|
|
|
public DateTime createTime { get; set; } |
|
|
|
public string formName { get; set; } |
|
|
|
public string stage { get; set; } |
|
|
|
public List<formData> formData { get; set; } |
|
|
|
public string model { get; set; } |
|
|
|
public string name { get; set; } |
|
|
|
public string value { get; set; } |
|
|
|
public string url { get; set; } |
|
|
|
|
|
|
|
} |
|
|
|
public class formData |
|
|
|
{ |
|
|
|
public string model { get; set; } |
|
|
|
public string name { get; set; } |
|
|
|
public string value { get; set; } |
|
|
|
} |
|
|
|
public class ranbow |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
public class Countsdata |
|
|
|
{ |
|
|
|
/// <summary> |
|
|
|
/// 待办 |
|
|
|
/// </summary> |
|
|
|
public int todo { get; set; } |
|
|
|
/// <summary> |
|
|
|
/// 抄送 |
|
|
|
/// </summary> |
|
|
|
public int cc { get; set; } |
|
|
|
/// <summary> |
|
|
|
/// 已办 |
|
|
|
/// </summary> |
|
|
|
public int handler { get; set; } |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 第三方对接传参加密方法 |
|
|
|
/// </summary> |
|
|
|
/// <param name="input"></param> |
|
|
|
/// <returns></returns> |
|
|
|
static string Sha1Hex(string input) |
|
|
|
{ |
|
|
|
using (SHA1Managed sha1 = new SHA1Managed()) |
|
|
|
{ |
|
|
|
byte[] hashBytes = sha1.ComputeHash(Encoding.UTF8.GetBytes(input)); |
|
|
|
StringBuilder hexString = new StringBuilder(); |
|
|
|
foreach (byte b in hashBytes) |
|
|
|
{ |
|
|
|
hexString.AppendFormat("{0:x2}", b); |
|
|
|
} |
|
|
|
return hexString.ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static string SendPostRequestAsync(string url) |
|
|
|
{ |
|
|
|
HttpClient Clientnew = new HttpClient(); |
|
|
|
string AppName = ConfigurationManager.AppSettings["AppName"]; |
|
|
|
string AppKey = ConfigurationManager.AppSettings["AppKey"]; |
|
|
|
string Secret = ConfigurationManager.AppSettings["Secret"]; |
|
|
|
///盐 随机数 |
|
|
|
Random ran = new Random(); |
|
|
|
var Nonce = ran.Next(100000).ToString(); |
|
|
|
///时间戳当前时间 |
|
|
|
TimeSpan ts = DateTime.Now - new DateTime(); |
|
|
|
DateTime now = DateTime.UtcNow; |
|
|
|
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); |
|
|
|
TimeSpan span = now - epoch; |
|
|
|
long timestamp = (long)span.TotalSeconds; |
|
|
|
string CurTime = timestamp.ToString(); |
|
|
|
//拼接CheckSum并加密 |
|
|
|
string CheckSum = Secret + Nonce + CurTime; |
|
|
|
CheckSum = Sha1Hex(CheckSum); |
|
|
|
var requestBody = new |
|
|
|
{ |
|
|
|
|
|
|
|
account = "cs00123" |
|
|
|
//account = userInfo.account |
|
|
|
}; |
|
|
|
string jsonBody = JsonConvert.SerializeObject(requestBody); |
|
|
|
|
|
|
|
HttpContent content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); |
|
|
|
content.Headers.Add("AppKey", AppKey); |
|
|
|
content.Headers.Add("Nonce", Nonce); |
|
|
|
content.Headers.Add("CurTime", CurTime); |
|
|
|
content.Headers.Add("CheckSum", CheckSum); |
|
|
|
var response = Clientnew.PostAsync(url, content).Result.Content.ReadAsStringAsync().Result; |
|
|
|
return response; |
|
|
|
} |
|
|
|
} |
|
|
|
} |