天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

141 lines
5.0 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QMAPP.Common.Web.Controllers;
using QMFrameWork.WebUI.Attribute;
using QMAPP.FJC.Web.Models.FIS;
using QMFrameWork.Data;
using QMAPP.FJC.Entity.FIS;
using QMAPP.ServicesAgent;
using QMAPP.Entity;
using QMFrameWork.WebUI.DataSource;
using QMFrameWork.Common.Serialization;
using System.Data;
using QMAPP.Common.Web.Models;
using QMAPP.FJC.Entity.Basic;
using QMAPP.MD.Entity;
using QMAPP.FJC.Entity;
using QMAPP.FJC.BLL.FIS;
using QMAPP.FJC.Entity.FileCopy.FIS;
namespace QMAPP.FJC.Web.Controllers
{
/// <summary>
/// 计划管理操作记录
/// 作 者:周晓东
/// 时 间:2018年03月22日
/// </summary>
public class OrderPlanTraceController : QController
{
#region 获取信息
/// <summary>
/// 加载列表
/// </summary>
/// <returns>结果</returns>
[HandleException]
public ActionResult List(bool? callback)
{
OrderPlanTraceModel seachModel = new OrderPlanTraceModel();
string order_type = Request["ORDER_TYPE"];
seachModel.PLANTIMESTART = DateTime.Now.Date.AddDays(-10).ToString("yyyy-MM-dd HH:mm:ss");
seachModel.PLANTIMEEND = DateTime.Now.Date.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss");
//seachModel.ImmediateSearch = false;
seachModel.ORDER_TYPE = order_type;
if (callback == true)
TryGetSelectBuffer<OrderPlanTraceModel>(out seachModel);
seachModel.rownumbers = false;
seachModel.url = "/OrderPlanTrace/GetList";
return View("OrderPlanTraceList", seachModel);
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="callBack">是否回调</param>
/// <returns>列表</returns>
[HandleException]
public ActionResult GetList(bool? callBack)
{
OrderPlanTraceModel seachModel = null;
DataPage page = null;
ServiceAgent wcfAgent = this.GetServiceAgent();
OrderPlanTrace condition = null;
DataResult<DataPage> pageResult = new DataResult<DataPage>();
try
{
//获取查询对象
seachModel = GetModel<OrderPlanTraceModel>();
#region 获取缓存值
if (callBack != null)
{
TryGetSelectBuffer<OrderPlanTraceModel>(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer<OrderPlanTraceModel>(seachModel);
}
#endregion
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
condition = CopyToModel<OrderPlanTrace, OrderPlanTraceModel>(seachModel);
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("OrderPlanBLL_GetTraceList", condition, page);
if (pageResult.IsSuccess == false)
{
SetMessage(pageResult.Msg);
return List(true);
}
DateGridResult<OrderPlanTrace> result = new DateGridResult<OrderPlanTrace>();
result.Total = pageResult.Result.RecordCount;
result.Rows = JsonConvertHelper.GetDeserialize<List<OrderPlanTrace>>(pageResult.Result.Result.ToString());
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出excel
/// <summary>
/// 导出excel
/// </summary>
/// <returns>结果</returns>
[HttpPost]
public ActionResult ExportExcel()
{
OrderPlanTraceModel seachModel = null;
OrderPlanTrace condition = null;
DataTable exportDt = new DataTable();
ServiceAgent wcfAgent = this.GetServiceAgent();
try
{
//获取查询对象
seachModel = GetModel<OrderPlanTraceModel>();
condition = CopyToModel<OrderPlanTrace, OrderPlanTraceModel>(seachModel);
condition.PIDList = Request.Form["selectKey"];
//获取数据
//exportDt = wcfAgent.InvokeServiceFunction<DataTable>("OrderPlanBLL_GetExportDataTrace", condition);
exportDt = new OrderPlanBLL().GetExportDataTrace(condition);
//导出
QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool();
return efTool.GetExcelFileResult("OrderPlanTraceExp", "计划操作记录.xlsx", exportDt);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}