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 CommonToolsCore;
|
using Services;
|
using System.Transactions;
|
|
namespace zhengcaioa.Controllers.admin
|
{
|
[CheckLogin]
|
public class AdmEvaluateController : Controller
|
{
|
private readonly ILogger<AdmEvaluateController> _logger;
|
private readonly ILiaotianService _liaotianService;
|
private readonly IHrDeptService _hrDeptService;
|
private readonly IAdmEvaluateService _admEvaluateService;
|
|
|
public AdmEvaluateController(ILogger<AdmEvaluateController> logger, ILiaotianService liaotianService, IAdmEvaluateService AdmEvaluateService, IHrDeptService hrDeptService, IAdmEvaluateService admEvaluateService)
|
{
|
_logger = logger;
|
_liaotianService = liaotianService;
|
_hrDeptService = hrDeptService;
|
_admEvaluateService = admEvaluateService;
|
|
}
|
|
public IActionResult IndexKaoping()
|
{
|
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.UserDept = _hrDeptService.GetList().Select(x => new { code = x.Id, label = x.DeptName }).ToList();
|
return View();
|
|
}
|
public IActionResult GetListUser(PltUserDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_admEvaluateService.SearchUserByPaging(search));
|
}
|
|
|
public IActionResult Index(string userid = null)
|
{
|
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;
|
|
ViewData["userid"] = userid;
|
return View();
|
|
}
|
|
|
|
|
public IActionResult GetList(AdmEvaluateDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
//search.UserId = curentuser.Id;
|
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
|
return new JsonResult(_admEvaluateService.SearchByPaging(search));
|
}
|
|
|
public IActionResult Edit(string id = null, string userid = null)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
AdmEvaluateDTO dto = new AdmEvaluateDTO();
|
if (!String.IsNullOrEmpty(id))
|
{
|
dto = _admEvaluateService.Get(id);
|
}
|
else
|
{
|
dto.Evaluatetime = DateTime.Now;
|
dto.UserId = userid;
|
}
|
|
|
|
ViewBag.EvaluateValue = _liaotianService.GetSYScode("adm_evaluate", "evaluate_value");
|
|
|
ViewData.Model = dto;
|
return View();
|
}
|
|
|
/// <summary>
|
/// 保存
|
/// </summary>
|
/// <param name="data">岗位实体类对象</param>
|
/// <returns></returns>
|
///
|
[HttpPost]
|
public IActionResult Save(AdmEvaluateDTO data)
|
{
|
// data.DocContent = data.DocContent.Replace(";", ";");
|
ResultEntity resultEntity = new ResultEntity();
|
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
data.RecStatus = "A";
|
if (String.IsNullOrEmpty(data.Id))
|
{
|
data.Creater = curentuser.Id;
|
data.Createtime = DateTime.Now;
|
}
|
data.Modifier = curentuser.Id;
|
data.Modifytime = DateTime.Now;
|
|
resultEntity = _admEvaluateService.save(data);
|
|
|
|
return new JsonResult(resultEntity);
|
}
|
|
|
|
}
|
}
|