|
- using System;
- using Learun.Util;
- using System.Data;
- using Learun.Application.TwoDevelopment.PersonnelManagement;
- using System.Web.Mvc;
- using System.Collections.Generic;
- using ClosedXML.Excel;
-
- namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架
- /// Copyright (c) 2013-2018 上海力软信息技术有限公司
- /// 创 建:超级管理员
- /// 日 期:2019-09-24 15:35
- /// 描 述:绩效跟踪
- /// </summary>
- public class MP_PerformanceTrackingController : MvcControllerBase
- {
- private MP_PerformanceTrackingIBLL mP_PerformanceTrackingIBLL = new MP_PerformanceTrackingBLL();
-
- #region 视图功能
-
- /// <summary>
- /// 主页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 管理员页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexManagement()
- {
- return View();
- }
- /// <summary>
- /// 提交材料页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexChildren()
- {
- return View();
- }
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
-
- /// <summary>
- /// 提交材料页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult UploadForm()
- {
- return View();
- }
-
- #endregion
-
- #region 获取数据
-
- /// <summary>
- /// 获取页面显示列表数据
- /// <summary>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = mP_PerformanceTrackingIBLL.GetPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
- /// <summary>
- /// 获取表单数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormData(string keyValue)
- {
- var MP_ManageMentPlanData = mP_PerformanceTrackingIBLL.GetMP_ManageMentPlanEntity(keyValue);
- var jsonData = new
- {
- MP_ManageMentPlan = MP_ManageMentPlanData,
- };
- return Success(jsonData);
- }
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- mP_PerformanceTrackingIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
-
- /// <summary>
- /// 合格/不合格
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult Qqualified(string keyValue,bool status)
- {
- var keyValueArr = keyValue.Split(',');
- foreach (var item in keyValueArr)
- {
- var entity = mP_PerformanceTrackingIBLL.GetMP_ManageMentPlanEntity(item);
- entity.MPConclusion = status ? 1 : 0;
- mP_PerformanceTrackingIBLL.SaveEntity(item, entity);
- }
- return Success("操作成功!");
- }
-
-
-
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, string strEntity)
- {
- MP_ManageMentPlanEntity entity = strEntity.ToObject<MP_ManageMentPlanEntity>();
- entity.MPType = 1;
- mP_PerformanceTrackingIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
-
-
-
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult UploadForm(string keyValue, string strEntity)
- {
- MP_ManageMentPlanEntity entity = strEntity.ToObject<MP_ManageMentPlanEntity>();
- if (!string.IsNullOrEmpty(keyValue))
- {
- var entity2 = mP_PerformanceTrackingIBLL.GetMP_ManageMentPlanEntity(keyValue);
- if (!string.IsNullOrEmpty(entity.MPFileTwo))
- {
- entity.MPStatus = 0;//已提交
- entity.MPUploadTimes = $"{DateTime.Now.ToString()}, {entity2.MPUploadTimes}";
- entity.SUpdateTime = entity2.SUpdateTime + 1;
- }
-
- }
- else
- {
- entity.Create();
- if (!string.IsNullOrEmpty(entity.MPFileTwo))
- {
- entity.MPStatus = 0;//已提交
- entity.MPUploadTimes = DateTime.Now.ToString();
- entity.SUpdateTime = 1;
- entity.MPType = 1;
- }
-
- }
-
- entity.MPUploaderTwo = LoginUserInfo.Get().userId;
-
-
- mP_PerformanceTrackingIBLL.SaveEntity(keyValue, entity);
- return Success("提交成功!");
- }
- #endregion
-
- }
- }
|