| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- using RMYY_CallCenter_Api.DB;
- using RMYY_CallCenter_Api.Models.Dto;
- using RMYY_CallCenter_Api.Models.Enum;
- using RMYY_CallCenter_Api.Utility;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Web.Mvc;
- namespace RMYY_CallCenter_Api.Controllers.WorkOrder
- {
- public class WorkCommonController : BaseController
- {
- /// <summary>
- /// 我的提交
- /// </summary>
- /// <param name="keyword"></param>
- /// <param name="starttime"></param>
- /// <param name="endtime"></param>
- /// <param name="pageindex"></param>
- /// <param name="pagesize"></param>
- /// <param name="state"></param>
- /// <returns></returns>
- public ActionResult GetSubmitList(string starttime = "", string endtime = "", int pageindex = 1, int pagesize = 10, int state = -1, int type = 0, int loweltype = 0)
- {
- if (User != null)
- {
- int recordCount = 0;
- string sql = "";// $" and F_Proposer='{User.F_UserCode}' and F_IsDelete = 0";
- //if (type > 0)
- //{
- // sql += $" and F_Type={type}";
- //}
- //if (loweltype > 0)
- //{
- // sql += $" and F_SonType={loweltype}";
- //}
- //if (state >= 0)
- //{
- // sql += $" and F_Status={state}";
- //}
- //if (!string.IsNullOrEmpty(starttime))
- //{
- // sql += $" and F_CreateTime>='{starttime}'";
- //}
- //if (!string.IsNullOrEmpty(endtime))
- //{
- // sql += $" and F_CreateTime<'{endtime}'";
- //}
- DataTable datatable = Bll.PagerBll.GetListPager
- ("T_Wo_CommonBase ",
- "F_WoCode",
- "*,[dbo].[GetUserName](F_Proposer) F_ProposerName,[dbo].[GetUserName](F_DealUser) F_DealUserName",
- sql,
- "order by F_CreateTime desc",
- pagesize,
- pageindex,
- true,
- out recordCount
- );
- datatable = WorkOrderBase.SetOtherField(datatable, MENUENUM.我的提交);
- var obj = new
- {
- state = "success",
- message = "成功",
- rows = datatable,
- total = recordCount
- };
- return Content(obj.ToJson());
- }
- return Error("无操作权限!");
- }
- /// <summary>
- /// 综合查询
- /// </summary>
- /// <param name="keyword"></param>
- /// <param name="starttime"></param>
- /// <param name="endtime"></param>
- /// <param name="pageindex"></param>
- /// <param name="pagesize"></param>
- /// <param name="state"></param>
- /// <returns></returns>
- public ActionResult GetComList(string starttime = "", string endtime = "", int pageindex = 1, int pagesize = 10, int state = -1, int type = 0, int loweltype = 0)
- {
- if (User != null)
- {
- int recordCount = 0;
- string sql = ""; //$" and F_Proposer='{User.F_UserCode}' and F_IsDelete = 0";
- //if (type > 0)
- //{
- // sql += $" and F_Type={type}";
- //}
- //if (loweltype > 0)
- //{
- // sql += $" and F_SonType={loweltype}";
- //}
- //if (state >= 0)
- //{
- // sql += $" and F_Status={state}";
- //}
- //if (!string.IsNullOrEmpty(starttime))
- //{
- // sql += $" and F_CreateTime>='{starttime}'";
- //}
- //if (!string.IsNullOrEmpty(endtime))
- //{
- // sql += $" and F_CreateTime<'{endtime}'";
- //}
- DataTable datatable = Bll.PagerBll.GetListPager
- ("T_Wo_CommonBase ",
- "F_WoCode",
- "*,[dbo].[GetUserName](F_Proposer) F_ProposerName,[dbo].[GetUserName](F_DealUser) F_DealUserName",
- sql,
- "order by F_CreateTime desc",
- pagesize,
- pageindex,
- true,
- out recordCount
- );
- //datatable.Columns.Add("GapTime", typeof(string));//执行时限
- //datatable.Columns.Add("AssistanceState", typeof(string));//协作工单的状态
- //datatable.Columns.Add("StateName", typeof(string));//协作工单的状态
- //datatable.Columns.Add("Buttons", typeof(object));//操作按钮
- datatable = WorkOrderBase.SetOtherField(datatable, MENUENUM.工单列表);
- var obj = new
- {
- state = "success",
- message = "成功",
- rows = datatable,
- total = recordCount
- };
- return Content(obj.ToJson());
- }
- return Error("无操作权限!");
- }
- }
- }
|