天津投入产出系统后端
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.
 
 
 
 
 
 

1066 lines
36 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QMFrameWork.WebUI.Attribute;
using QMAPP.Web.Models.Sys;
using QMAPP.Common.Web.Controllers;
using QMFrameWork.Data;
using QMAPP.Entity.Sys;
using QMFrameWork.WebUI.DataSource;
using QMFrameWork.Common.Serialization;
using System.Collections;
using QMAPP.ServicesAgent;
using System.Data;
using System.Configuration;
namespace QMAPP.Web.Controllers
{
/// <summary>
/// 问题管理控制器
/// 创建人:wangyf
/// 创建时间:2015.03.30
/// </summary>
public class SupportInteractionController : QController
{
#region 字符串常量
private const string NOTCLOSED = "未关闭";
private const string CLOSED = "已关闭";
private const string SHOW = "查看";
private const string uploadFolder = "\\SupportInteraction\\";
#endregion
#region 编辑
/// <summary>
/// 编辑载入
/// </summary>
/// <returns>处理结果</returns>
[HandleException]
public ActionResult SupportInteractionEdit()
{
SupportInteractionModel model = new SupportInteractionModel();
string ID = Request.Params["PID"];
SupportInteraction entity = new SupportInteraction();
try
{
if (string.IsNullOrEmpty(ID) == false)
{
//修改获取原数据
entity.PID = ID;
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
entity = agent.InvokeServiceFunction<SupportInteraction>("SupportInteractionBLL_GetInfo", entity);
model = CopyToModel<SupportInteractionModel, SupportInteraction>(entity);
}
return View(model);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 编辑载入
/// <summary>
/// 编辑载入
/// </summary>
/// <returns>处理结果</returns>
[HandleException]
public ActionResult SupportInteractionDeal(SupportInteractionModel model)
{
string ID = Request.Params["PID"];
SupportInteraction entity = new SupportInteraction();
try
{
if (string.IsNullOrEmpty(ID) == false)
{
//修改获取原数据
entity.PID = ID;
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
entity = agent.InvokeServiceFunction<SupportInteraction>("SupportInteractionBLL_GetInfo", entity);
model = CopyToModel<SupportInteractionModel, SupportInteraction>(entity);
}
return View(model);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 保存
/// <summary>
/// 保存
/// </summary>
/// <param name="model"></param>
/// <returns>处理结果</returns>
[HttpPost]
[HandleException]
public ActionResult SupportInteractionSave(HttpPostedFileBase attfile, SupportInteractionModel saveModel)
{
SupportInteraction info = null;
//原附件名
string oldFileName = saveModel.AttachFile;
//上传的附件名
string fileName = null;
if (attfile != null)
{
fileName = attfile.FileName;
//判断文件大小是否符合要求
if (!CheckFileSize(attfile))
{
SetMessage("上传附件不能大于5M");
return View("SupportInteractionEdit", saveModel);
}
}
try
{
info = CopyToModel<SupportInteraction, SupportInteractionModel>(saveModel);
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
if (string.IsNullOrEmpty(info.PID))
{
//新建的文件名
info.PID = Guid.NewGuid().ToString();
if (!string.IsNullOrEmpty(fileName))
{
//应用程序物理路径
string PhysicsRootPath = Server.MapPath(HttpRuntime.AppDomainAppVirtualPath);
//附件名
info.AttachFileName = fileName;
//附件GUID名
info.AttachFile = info.PID + fileName.Substring(fileName.LastIndexOf("."));
//创建附件上传文件夹
SaveAttachFile(attfile, PhysicsRootPath, uploadFolder, info.AttachFile);
}
//新增
agent.InvokeServiceFunction("SupportInteractionBLL_Insert", info);
}
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();"
, AppResource.SubmitSuccess));
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 判断附件大小
/// <summary>
/// 判断附件大小
/// </summary>
/// <param name="file"></param>
/// <returns>附件路径,结果</returns>
[HttpPost]
[HandleException]
public Boolean CheckFileSize(HttpPostedFileBase file)
{
SupportInteractionModel model = new SupportInteractionModel();
try
{
//计算文件大小
int fileLength = file.ContentLength / 1024;
//判断如果文件大小超过5M,不允许上传
if (fileLength > 5120)
{
return false;
}
return true;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 保存附件
/// <summary>
/// 保存附件
/// </summary>
/// <param name="uploadPath"></param>
/// <param name="file"></param>
/// <param name="trueFileName"></param>
[HandleException]
private void SaveAttachFile(HttpPostedFileBase file,string PhysicsRootPath, string uploadFolder, string guidFileName)
{
if (file != null)
{
//判断路径是否在,不存在则创建
CheckUploadPath(PhysicsRootPath, uploadFolder);
//保存文件
file.SaveAs(PhysicsRootPath + uploadFolder + guidFileName);
}
}
#endregion
#region 删除原有附件
/// <summary>
/// 删除原有附件
/// </summary>
/// <param name="filePath"></param>
/// <param name="fileName"></param>
[HandleException]
private void DeleteAttachFile(string PhysicsRootPath, string uploadFolder, string oldFileName)
{
string oldFilePath = PhysicsRootPath + uploadFolder + oldFileName;
//如果文件存在则删除
if (System.IO.File.Exists(oldFilePath))
{
System.IO.File.Delete(oldFilePath);
}
}
#endregion
#region 创建附件上传文件夹
/// <summary>
/// 创建附件上传文件夹
/// </summary>
/// <param name="PhysicsRootPath">物理路径</param>
/// <param name="uploadPath">附件存放路径</param>
[HandleException]
private void CheckUploadPath(string PhysicsRootPath, string uploadFolder)
{
//获取配置文件上传附件文件夹名称
string siUploadFile = ConfigurationManager.AppSettings.Get("UploadFileRoot");
//附件目录
string UploadFile = PhysicsRootPath + siUploadFile + uploadFolder;
//如果文件夹不存在则创建文件夹
if (System.IO.Directory.Exists(UploadFile) == false)
{
System.IO.Directory.CreateDirectory(UploadFile);
}
//附件文件路径
string siPath = PhysicsRootPath + uploadFolder;
//如果文件夹不存在则创建文件夹
if (System.IO.Directory.Exists(siPath) == false)
{
System.IO.Directory.CreateDirectory(siPath);
}
}
#endregion
#region 下载附件
/// <summary>
/// 下载文件名
/// </summary>
/// <param name="fileName"></param>
[HttpPost]
[HandleException]
public FilePathResult DownAttach(string fileName, string oldFileName)
{
try
{
//应用程序物理路径
string PhysicsRootPath = Server.MapPath(HttpRuntime.AppDomainAppVirtualPath);
string contentType = GetContenType(fileName.Substring(fileName.LastIndexOf(".")));
return File(PhysicsRootPath + uploadFolder + fileName, contentType, Url.Encode(oldFileName));
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 根据后缀获取返回CONTENTTYPE
/// <summary>
/// 根据后缀获取返回CONTENTTYPE
/// </summary>
/// <param name="suffix">后缀</param>
/// <returns>CONTENTTYPE</returns>
[HandleException]
private string GetContenType(string suffix)
{
string resultType = "";
if (".txt".Equals(suffix.ToLower()))
{
resultType = "";
}
switch (suffix.ToLower())
{
case ".txt":
resultType = "text/plain";
break;
case ".xls":
resultType = "application/vnd.ms-excel";
break;
case ".xlsx":
resultType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
break;
case ".doc":
resultType = "application/msword";
break;
case ".docx":
resultType = "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
break;
case ".ppt":
resultType = "application/vnd.ms-powerpoint";
break;
case ".pptx":
resultType = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
break;
case ".bmp":
resultType = "application/x-MS-bmp";
break;
case ".jpg":
resultType = "aimage/jpeg";
break;
case ".jpeg":
resultType = "image/jpeg";
break;
case ".gif":
resultType = "image/gif";
break;
case ".png":
resultType = "image/png";
break;
case ".rar":
resultType = "application/x-rar-compressed";
break;
case ".zip":
resultType = "application/zip";
break;
}
return resultType;
}
#endregion
#region 获取列表
/// <summary>
/// 加载列表
/// </summary>
/// <returns>结果</returns>
[HandleException]
public ActionResult SupportInteractionList(bool? callBack)
{
SupportInteractionModel seachModel = new SupportInteractionModel();
if (callBack == true)
TryGetSelectBuffer<SupportInteractionModel>(out seachModel);
else
seachModel.PStatus = "0";
seachModel.rownumbers = false;
seachModel.url = "/SupportInteraction/GetProblemList";
return View("SupportInteractionList", seachModel);
}
/// <summary>
/// 获取问题列表
/// </summary>
/// <param name="callBack">是否回调</param>
/// <returns>列表</returns>
[HandleException]
public ActionResult GetProblemList(bool? callBack)
{
SupportInteractionModel seachModel = null;
DataPage page = null;
SupportInteraction condition = null;
try
{
//获取查询对象
seachModel = GetModel<SupportInteractionModel>();
#region 获取缓存值
if (callBack != null)
{
TryGetSelectBuffer<SupportInteractionModel>(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer<SupportInteractionModel>(seachModel);
}
#endregion
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
seachModel.Ecind = seachModel.PStatus;
condition = CopyToModel<SupportInteraction, SupportInteractionModel>(seachModel);
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
page = agent.InvokeServiceFunction<DataPage>("SupportInteractionBLL_GetProblemList", condition, page);
List<SupportInteraction> list = (List<SupportInteraction>)JsonConvertHelper.GetDeserialize<List<SupportInteraction>>(page.Result.ToString());
List<SupportInteractionModel> modelList = new List<SupportInteractionModel>();
//设置问题状态
foreach (SupportInteraction si in list)
{
SupportInteractionModel tmp = CopyToModel<SupportInteractionModel, SupportInteraction>(si);
if (si.Ecind == "1")
{
tmp.PStatus = CLOSED;
}
else
{
tmp.PStatus = NOTCLOSED;
}
tmp.DealList = "查看";
modelList.Add(tmp);
}
DataGridResult<SupportInteractionModel> result = new DataGridResult<SupportInteractionModel>();
result.Total = page.RecordCount;
result.Rows = modelList;
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取部门下的人员
/// <summary>
/// 取得当前部门下的人员
/// </summary>
/// <returns>结果</returns>
[HandleException]
public ActionResult GetUserList()
{
string organId = Request["orgaID"].ToString();
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
List<User> userlist = agent.InvokeServiceFunction<List<User>>("UserManageBLL_GetOrgaUserList", organId);
return Content(QMFrameWork.Common.Serialization.JsonConvertHelper.GetSerializes(userlist));
}
#endregion
#region 搜索问题解决方案
/// <summary>
/// 搜索问题解决方案
/// </summary>
/// <param name="callBack"></param>
/// <returns></returns>
[HandleException]
public ActionResult SearchProlemSolution(bool? callBack)
{
SearchSIModel seachModel = new SearchSIModel();
if (callBack == true)
TryGetSelectBuffer<SearchSIModel>(out seachModel);
seachModel.rownumbers = false;
seachModel.url = "/SupportInteraction/GetList";
seachModel.checkbox = false;
string mode = Request.QueryString["mode"];
if(string.IsNullOrEmpty(mode)==true)
return View("SearchProlemSolution", seachModel);
else
return View("SelectProlemSolution", seachModel);
}
/// <summary>
/// 获取问题处理方法列表
/// </summary>
/// <param name="callBack">是否回调</param>
/// <returns>列表</returns>
[HandleException]
public ActionResult GetList(bool? callBack)
{
SearchSIModel seachModel = null;
DataPage page = null;
SupportInteraction condition = null;
try
{
//获取查询对象
seachModel = GetModel<SearchSIModel>();
#region 获取缓存值
if (callBack != null)
{
TryGetSelectBuffer<SearchSIModel>(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer<SearchSIModel>(seachModel);
}
#endregion
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
condition = CopyToModel<SupportInteraction, SearchSIModel>(seachModel);
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
page = agent.InvokeServiceFunction<DataPage>("SupportInteractionBLL_GetList", condition, page);
List<SearchSIModel> siList = new List<SearchSIModel>();
List<SupportInteraction> resultList = JsonConvertHelper.GetDeserialize<List<SupportInteraction>>(page.Result.ToString());
foreach (SupportInteraction si in resultList)
{
SearchSIModel tempModel = CopyToModel<SearchSIModel, SupportInteraction>(si);
tempModel.CDate = Convert.ToDateTime(tempModel.CDate) == new DateTime() ? "" : Convert.ToDateTime(tempModel.CDate).ToString("yyyy-MM-dd hh:mm:ss");
siList.Add(tempModel);
}
DataGridResult<SearchSIModel> result = new DataGridResult<SearchSIModel>();
result.Total = siList.Count;
result.Rows = siList;
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 选择问题参照解决方案
/// <summary>
/// 选择问题参照解决方案
/// </summary>
/// <param name="callBack"></param>
/// <returns></returns>
[HandleException]
public ActionResult SelectProlemSolution(bool? callBack)
{
SearchSIModel seachModel = new SearchSIModel();
if (callBack == true)
TryGetSelectBuffer<SearchSIModel>(out seachModel);
seachModel.rownumbers = false;
seachModel.url = "/SupportInteraction/GetSloveList";
string mode = Request.QueryString["mode"];
if (string.IsNullOrEmpty(mode) == true)
return View("SelectProlemSolution", seachModel);
else
return View("SelectProlemSolution", seachModel);
}
/// <summary>
/// 选择问题参照解决方案列表
/// </summary>
/// <param name="callBack">是否回调</param>
/// <returns>列表</returns>
[HandleException]
public ActionResult GetSloveList(bool? callBack)
{
SearchSIModel seachModel = null;
DataPage page = null;
SupportInteraction condition = null;
try
{
//获取查询对象
seachModel = GetModel<SearchSIModel>();
#region 获取缓存值
if (callBack != null)
{
TryGetSelectBuffer<SearchSIModel>(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer<SearchSIModel>(seachModel);
}
#endregion
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
condition = CopyToModel<SupportInteraction, SearchSIModel>(seachModel);
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
page = agent.InvokeServiceFunction<DataPage>("SupportInteractionBLL_GetList", condition, page);
List<SearchSloveModel> siList = new List<SearchSloveModel>();
List<SupportInteraction> resultList = JsonConvertHelper.GetDeserialize<List<SupportInteraction>>(page.Result.ToString());
foreach (SupportInteraction si in resultList)
{
SearchSloveModel tempModel = CopyToModel<SearchSloveModel, SupportInteraction>(si);
tempModel.VCDate = tempModel.CDate == new DateTime() ? "" : tempModel.CDate.ToString("yyyy-MM-dd hh:mm:ss");
siList.Add(tempModel);
}
DataGridResult<SearchSloveModel> result = new DataGridResult<SearchSloveModel>();
result.Total = siList.Count;
result.Rows = siList;
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取问题状态列表
/// <summary>
/// 获取问题状态列表
/// </summary>
/// <returns>数据源</returns>
[HandleException]
public ActionResult GetPStatusList()
{
try
{
ComboboxResult model = new ComboboxResult();
model.Add(new ComboboxItem { ID = "", Text = new DictController().EmptyItemTitle, Selected = "Selected" });
model.Add(new ComboboxItem { ID = "0", Text = NOTCLOSED });
model.Add(new ComboboxItem { ID = "1", Text = CLOSED });
return Content(model.ToString());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 选择支持用户
/// <summary>
/// 选择支持用户
/// </summary>
/// <returns></returns>
[HandleException]
public ActionResult SelectSupportUser(SupportInteractionModel model)
{
return View("SelectSupportUser", model);
}
#endregion
#region 提交
/// <summary>
/// 提交
/// </summary>
/// <returns></returns>
[HandleException]
public ActionResult SaveSupportInteraction(SupportInteractionModel seachModel)
{
ServiceAgent wcfAgent = this.GetServiceAgent();
Boolean retBool = false;
try
{
SupportInteraction seachEntity = new SupportInteraction();
seachEntity = CopyToModel<SupportInteraction, SupportInteractionModel>(seachModel);
retBool = wcfAgent.InvokeServiceFunction<bool>("SupportInteractionBLL_UpdateSupportInteraction", seachEntity);
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();"
, AppResource.SubmitSuccess));
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 解决问题
/// <summary>
/// 解决问题
/// </summary>
/// <returns></returns>
[HandleException]
public ActionResult SloveSupportInteraction(SupportInteractionModel seachModel)
{
ServiceAgent wcfAgent = this.GetServiceAgent();
Boolean retBool = false;
try
{
SupportInteraction seachEntity = new SupportInteraction();
seachEntity = CopyToModel<SupportInteraction, SupportInteractionModel>(seachModel);
retBool = wcfAgent.InvokeServiceFunction<bool>("SupportInteractionBLL_SloveSupportInteraction", seachEntity);
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();"
, AppResource.SloveSuccess));
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取处理用户的机构列表
/// <summary>
/// 获取处理用户的机构列表
/// </summary>
/// <returns>结果</returns>
[HttpPost]
[HandleException]
public ActionResult GetCurrentHandleOrga()
{
ServiceAgent wcfAgent = this.GetServiceAgent();
try
{
ZPFlow entity = new ZPFlow();
List<ZPFlow> resultList = wcfAgent.InvokeServiceFunction<List<ZPFlow>>("SupportInteractionBLL_GetCurrentHandleOrga", entity);
ComboboxResult model = new ComboboxResult();
//添加第一行空行
if (resultList != null && resultList.Count > 0)
{
model.Add(new ComboboxItem { ID = "", Text = new DictController().EmptyItemTitle });
}
foreach (ZPFlow o in resultList)
{
model.Add(new ComboboxItem { ID = o.SDept, Text = o.SOrgaDesc });
}
return Content(model.ToString());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 处理记录列表
/// <summary>
/// 跳转到行为记录页面
/// </summary>
/// <returns></returns>
[HandleException]
public ActionResult SIDealInfoList()
{
SIDealInfoModel seachModel = new SIDealInfoModel();
//提交的ID
string ZPDDBPID = Request["ZPDDBPID"].ToString();
seachModel.rownumbers = false;
seachModel.url = "/SupportInteraction/GetSIDealList?ZPDDBPID=" + ZPDDBPID;
seachModel.checkbox = false;
return View("SIDealInfoList", seachModel);
}
/// <summary>
/// 获取处理记录列表
/// </summary>
/// <returns></returns>
[HandleException]
public ActionResult GetSIDealList()
{
SIDealInfoModel seachModel = new SIDealInfoModel();
ZPDealInfo condition = null;
DataPage page = null;
try
{
//提交的ID
string ZPDDBPID = Request["ZPDDBPID"].ToString();
seachModel.ZPDDBPID = ZPDDBPID;
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
condition = CopyToModel<ZPDealInfo, SIDealInfoModel>(seachModel);
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
page = agent.InvokeServiceFunction<DataPage>("SupportInteractionBLL_GetSIDealList", condition, page);
DataGridResult<ZPDealInfo> result = new DataGridResult<ZPDealInfo>();
result.Total = page.RecordCount;
result.Rows = JsonConvertHelper.GetDeserialize<List<ZPDealInfo>>(page.Result.ToString());
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取问题列表
/// <summary>
/// 获取问题状态列表
/// </summary>
/// <returns>数据源</returns>
[HandleException]
public ActionResult GetTypeList()
{
try
{
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
List<SupportInteraction> typeList = agent.InvokeServiceFunction<List<SupportInteraction>>("SupportInteractionBLL_GetTypeList");
ComboboxResult model = new ComboboxResult();
model.Add(new ComboboxItem { ID = "" , Text = new DictController().EmptyItemTitle });
if(typeList != null && typeList.Count > 0)
{
foreach(SupportInteraction si in typeList){
model.Add(new ComboboxItem { ID = si.PID, Text = si.PTypeName });
}
}
return Content(model.ToString());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出问题处理方法excel
/// <summary>
/// 导出问题处理方法excel
/// </summary>
/// <returns>结果</returns>
[HttpPost]
[HandleException]
public ActionResult ExportExcel()
{
SearchSIModel seachModel = null;
SupportInteraction seachEntity = null;
ServiceAgent wcfAgent = this.GetServiceAgent();
DataTable exportDt = null;
try
{
//获取查询条件
TryGetSelectBuffer<SearchSIModel>(out seachModel);
seachEntity = CopyToModel<SupportInteraction, SearchSIModel>(seachModel);
//获取数据
exportDt = wcfAgent.InvokeServiceFunction<DataTable>("SupportInteractionBLL_GetExportData", seachEntity);
//转换日期格式
foreach (DataRow dr in exportDt.Rows)
{
string cd = dr["CDate"].ToString();
if (!string.IsNullOrEmpty(cd))
{
dr["CDate"] = Convert.ToDateTime(cd).ToString("yyyy-MM-dd hh:mm:ss");
}
}
//导出
QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool();
return efTool.GetExcelFileResult("ProblemSulotion", "问题处理方法.xls", exportDt);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出问题管理excel
/// <summary>
/// 导出问题管理excel
/// </summary>
/// <returns>结果</returns>
[HttpPost]
[HandleException]
public ActionResult ProblemManageExportExcel()
{
SupportInteractionModel seachModel = null;
SupportInteraction seachEntity = null;
ServiceAgent wcfAgent = this.GetServiceAgent();
DataTable exportDt = null;
string selectKey = Request.Form["selectKey"];
try
{
//获取查询条件
TryGetSelectBuffer<SupportInteractionModel>(out seachModel);
seachEntity = CopyToModel<SupportInteraction, SupportInteractionModel>(seachModel);
//获取数据
exportDt = wcfAgent.InvokeServiceFunction<DataTable>("SupportInteractionBLL_GetProblemManageExportData", seachEntity);
//导出
if (selectKey != "")
{
DataView dv = new DataView(exportDt);
string strWhere = "";
string[] list = selectKey.Split(":".ToCharArray());
foreach (string pid in list)
{
strWhere += " PID='" + pid + "' or";
}
if (strWhere != "")
{
strWhere = strWhere.Remove((strWhere.Length - 2), 2);
}
dv.RowFilter = strWhere;
exportDt = dv.ToTable();
}
//添加列
//处理记录
exportDt.Columns.Add("DEALLIST");
//处理状态
exportDt.Columns.Add("PSTATUS");
//处理状态
exportDt.Columns.Add("CD");
//设置问题状态
foreach (DataRow dr in exportDt.Rows)
{
dr["DEALLIST"] = SHOW;
if (dr["ECIND"].ToString() == "1")
{
dr["PSTATUS"] = CLOSED;
}
else
{
dr["PSTATUS"] = NOTCLOSED;
}
string cd = dr["CreateDate"].ToString();
if (!string.IsNullOrEmpty(cd))
{
dr["CD"] = Convert.ToDateTime(cd).ToString("yyyy-MM-dd hh:mm:ss");
}
}
//导出
QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool();
return efTool.GetExcelFileResult("ProblemManage", "问题管理.xls", exportDt);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 判断选中的问题是否已经关闭
/// <summary>
/// 判断选中的问题是否已经关闭
/// </summary>
/// <returns>结果</returns>
[HttpPost]
[HandleException]
public ActionResult CheckProblemClosed()
{
ServiceAgent wcfAgent = this.GetServiceAgent();
string PID = Request.Form["PID"];
Boolean retBool = false;
try
{
SupportInteraction seachEntity = new SupportInteraction();
seachEntity.PID = PID;
retBool = wcfAgent.InvokeServiceFunction<bool>("SupportInteractionBLL_CheckProblemClosed", seachEntity);
return Json(retBool);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 校验选中问题的处理部门是否为当前用户部门
/// <summary>
/// 校验选中问题的处理部门是否为当前用户部门
/// </summary>
/// <returns>结果</returns>
[HttpPost]
[HandleException]
public ActionResult CheckProblemDept()
{
ServiceAgent wcfAgent = this.GetServiceAgent();
string PID = Request.Form["PID"];
Boolean retBool = false;
try
{
SupportInteraction seachEntity = new SupportInteraction();
seachEntity.PID = PID;
retBool = wcfAgent.InvokeServiceFunction<bool>("SupportInteractionBLL_CheckProblemDept", seachEntity);
return Json(retBool);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 校验选中问题的处理人是否为当前用户
/// <summary>
/// 校验选中问题的处理人是否为当前用户
/// </summary>
/// <returns>结果</returns>
[HttpPost]
[HandleException]
public ActionResult CheckProblemUser()
{
ServiceAgent wcfAgent = this.GetServiceAgent();
string PID = Request.Form["PID"];
Boolean retBool = false;
try
{
SupportInteraction seachEntity = new SupportInteraction();
seachEntity.PID = PID;
retBool = wcfAgent.InvokeServiceFunction<bool>("SupportInteractionBLL_CheckProblemUser", seachEntity);
return Json(retBool);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}