using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using AutoMapper;
|
using AngleSharp.Html.Parser;
|
using DTO;
|
using IServices;
|
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.Bot.Builder.Integration.AspNet.Core;
|
using Microsoft.Extensions.Logging;
|
using Newtonsoft.Json;
|
using System.Net.Http;
|
using System.Threading.Tasks;
|
using zhengcaioa.Models;
|
using zhengcaioa.IService;
|
using System.Net.Mail;
|
using static CommonToolsCore.SendMailHelper;
|
using CommonToolsCore;
|
|
namespace zhengcaioa.Controllers.WorkFlow
|
{
|
[CheckLogin]
|
public class WorkFlowTaskController : Controller
|
{
|
private readonly ILogger<WorkFlowTaskController> _logger;
|
|
private readonly IWfRunProcessService _wfRunProcessService;
|
private readonly IWfHistoryService _wfHistoryService;
|
private readonly IWfNeeddeelService _wfNeeddeelService;
|
private readonly IWfApplytypeService _wfApplytypeService;
|
private readonly ILiaotianService _liaotianService;
|
[CheckLogin]
|
public WorkFlowTaskController(ILogger<WorkFlowTaskController> logger, IWfRunProcessService wfRunProcessService
|
, IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService, IWfApplytypeService wfApplytypeService
|
, ILiaotianService liaotianService)
|
{
|
_logger = logger;
|
|
_wfRunProcessService = wfRunProcessService;
|
_wfHistoryService = wfHistoryService;
|
_wfNeeddeelService = wfNeeddeelService;
|
_wfApplytypeService = wfApplytypeService;
|
_liaotianService = liaotianService;
|
}
|
public IActionResult Index()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
|
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.Applytiye = _wfApplytypeService.GetList().Select(x => new { code = x.Applyno, label = x.Applytiye }).ToList();
|
|
return View();
|
}
|
|
public IActionResult GetList(WfNeeddeelDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
search.Creater = curentuser.Id;
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_wfNeeddeelService.SearchByPaging(search));
|
}
|
|
|
public int CountRemindRecord()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
WfNeeddeelDTOSearch search = new WfNeeddeelDTOSearch();
|
search.page = 1;
|
search.rows = 10;
|
search.Creater = curentuser.Id;
|
ResultDataEntity<WfNeeddeelDTO> resultDataEntity = _wfNeeddeelService.SearchByPaging(search);
|
return search.totalrows;
|
}
|
|
|
|
public IActionResult IndexYiBan()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
|
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.Applytiye = _wfApplytypeService.GetList().Select(x => new { code = x.Applyno, label = x.Applytiye }).ToList();
|
|
|
|
return View();
|
}
|
|
public IActionResult GetListYiBan(WfHistoryDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
search.Creater = curentuser.Id;
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_wfHistoryService.SearchByPaging(search));
|
}
|
|
|
|
public IActionResult IndexMyApply()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
|
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.Applytiye = _wfApplytypeService.GetList().Select(x => new { code = x.Applyno, label = x.Applytiye }).ToList();
|
ViewBag.ShenpiStatus = _liaotianService.GetSYScode("wf_run_process", "shenpi_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
return View();
|
}
|
|
public IActionResult GetListMyApply(WfRunProcessDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
search.Creater = curentuser.Id;
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_wfRunProcessService.SearchByPaging(search));
|
}
|
|
|
|
public IActionResult IndexGuanLi()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
List<ActionEntity> actionlist = new List<ActionEntity>();
|
ActionEntity actionEntity = new ActionEntity();
|
actionEntity.OpenType = 0;
|
actionEntity.ActionUrl = "";
|
actionEntity.ActionFun = "Search";
|
actionEntity.PageIco = "fa fa-search";
|
actionEntity.ActionName = "查询";
|
actionlist.Add(actionEntity);
|
|
|
|
|
ViewData["ActionInfo"] = actionlist;
|
|
ViewBag.Applytiye = _wfApplytypeService.GetList().Select(x => new { code = x.Applyno, label = x.Applytiye }).ToList();
|
|
|
|
return View();
|
}
|
|
public IActionResult GetListGuanLi(WfHistoryDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
//search.Creater = curentuser.Id;
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_wfHistoryService.SearchByPagingGuanLi(search));
|
}
|
|
|
public IActionResult Del(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
|
|
resultEntity = _wfRunProcessService.ModifyStatus(id, curentuser.Id);
|
|
|
return new JsonResult(resultEntity);
|
}
|
}
|
}
|