using DIXWeb.Business.Workflow; using DIXWeb.Entity.Power; using DIXWeb.Entity.Workflow; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace DIXWeb.Web { public class BillController : BaseMvcController { BillBusiness _billBusiness = new BillBusiness(); public ActionResult GetWorkflowBillType() { object obj = this._billBusiness.GetWorkflowBillType(); return Json(Json(obj).Data); } // GET: GlobalM/Bill public ActionResult Index(int BillId = 0) { ReceiveBill record = null; if (BillId == 0) { record = new ReceiveBill() { Code = "", Name = "", }; } else { record = _billBusiness.GetBillById(BillId); } ViewData["BillIndex"] = record; return PartialView(); } public ActionResult StartIndex() { return View(); } public ActionResult StartDIX() { return View(); } public ActionResult StartDIXFireControl() { return View(); } public ActionResult StartDIXQuality() { return View(); } public ActionResult InspectDetail(int InspectBookId = 0,int ShowBtn = 0) { // ViewData["InspectBookId"] = InspectBookId; ViewData["RoleNameString"] = Util.SessionHelper.Session["RoleNameString"].ToString(); ViewData["ShowBtn"] = ShowBtn; return PartialView(); } public ActionResult InspectFalseDetail(int InspectBookId = 0, int ShowBtn = 0) { ViewData["InspectBookId"] = InspectBookId; ViewData["RoleNameString"] = Util.SessionHelper.Session["RoleNameString"].ToString(); ViewData["ShowBtn"] = ShowBtn; return PartialView(); } public ActionResult ReckUpdateHistory(int InspectBookId,string FilterType) { ViewData["InspectBookId"] = InspectBookId; ViewData["FilterType"] = FilterType; return View(); } public ActionResult GetReckDataUpdateHistory(int InspectBookId,string FilterType, int rows, int page) { Receive receive = _billBusiness.ReckDataUpdateHistory(InspectBookId, FilterType, rows,page); return Json(receive); } public ActionResult GetReckImgUpdateHistory(int InspectBookId, string FilterType, int rows, int page) { Receive receive = _billBusiness.ReckImgUpdateHistory(InspectBookId, FilterType, rows, page); return Json(receive); } public ActionResult SubmitBill(string Code,string Name,int BillTypeId) { Receive record = null; try { UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo; record = this._billBusiness.SubmitBill(Code, Name, BillTypeId, ui.Id); } catch (Exception ex) { record = new Receive() { Code = 500, Message = ex.Message, }; } return Json(record); } public ActionResult GetInspectBook(string InspectObjectCode, DateTime TimeBegin,DateTime TimeEnd,int Status,string filterType, int rows, int page) { UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo; object obj = this._billBusiness.GetInspectBook(InspectObjectCode,TimeBegin, TimeEnd, Status, rows, page, filterType, ui.Id); return Json(obj); } public ActionResult GetFalseInspectBook(int InspectAreaId,int InspectObjectTypeId,string InspectObjectCode,DateTime TimeBegin, DateTime TimeEnd, int rows, int page) { object obj = this._billBusiness.GetFalseInspectBook(InspectAreaId, InspectObjectTypeId, InspectObjectCode, TimeBegin, TimeEnd, rows, page); return Json(obj); } public ActionResult GetInspectDetailByBookId(int BookId,string FilterType) { object obj = this._billBusiness.GetInspectDetailByBookId(BookId, FilterType); return Json(obj); } public ActionResult StartDIXWorkflow(int[] BookIdArr, int[] BillTypeArr) { Receive record = new Receive(); UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo; try { int UserId = ui.Id; for (int i = 0; i < BookIdArr.Length; i++) { int BookId = BookIdArr[i]; int BillTypeId = BillTypeArr[i]; record = this._billBusiness.SubmitBill(BookId, BillTypeId, UserId); if (record.Code != 200) { break; } } if (record.Code == 200) { record.Message = "SUCCESS"; } } catch (Exception ex) { record.Code = 500; record.Message = ex.Message; } return Json(record); } public ActionResult GetNeedDealtNum() { Receive receive = new Receive(); try { if (Util.SessionHelper.Session["UserInfo"] == null) { receive.Code = 500; receive.Message = "0,0"; } else { string UserNo = (Util.SessionHelper.Session["UserInfo"] as UserInfo).UserNo; receive.Code = 200; receive.Message = _billBusiness.GetNeedDealtNumByUserCode(UserNo); } } catch (Exception ex) { receive.Code = 500; receive.Message=ex.Message; } return Json(receive); } public ActionResult BillUpdate() { return View(); } public ActionResult BillInspectFinished() { return View(); } public ActionResult UpdateInspectReck( int InspectReckId,string InspectLimit,int Judge,string NGReason,int DealInScene,string Answer, string FilterType) { string userName = string.Empty; try { if (Util.SessionHelper.Session["UserInfo"] == null) { userName = ""; } else { userName = (Util.SessionHelper.Session["UserInfo"] as UserInfo).UserName; } } catch { userName = ""; } Receive receive = _billBusiness.UpdateInspectReck(InspectReckId, InspectLimit, Judge, NGReason, DealInScene, Answer, userName, FilterType); return Json(receive); } public ActionResult UpdateInspectReckImg(int InspectReckId, string ImgArrStr,string FilterType) { string userName = string.Empty; try { if (Util.SessionHelper.Session["UserInfo"] == null) { userName = ""; } else { userName = (Util.SessionHelper.Session["UserInfo"] as UserInfo).UserName; } } catch { userName = ""; } Receive receive = _billBusiness.UpdateInspectReck(InspectReckId, ImgArrStr, userName, FilterType); return Json(receive); } } }