duan
2024-08-21 22bd5bc1ce2b49284cc2f042c7f4f48619fcf85b
提交 | 用户 | age
5e4ef3 1 using DIXWeb.Business.Workflow;
1e406e 2 using DIXWeb.Entity.Power;
5e4ef3 3 using DIXWeb.Entity.Workflow;
A 4 using System;
5 using System.Collections.Generic;
6 using System.Linq;
7 using System.Web;
8 using System.Web.Mvc;
9
10 namespace DIXWeb.Web
11 {
12     public class BillController : BaseMvcController
13     {
14         BillBusiness _billBusiness = new BillBusiness();
1e406e 15         public ActionResult GetWorkflowBillType()
A 16         {
17             object obj = this._billBusiness.GetWorkflowBillType();
18             return Json(Json(obj).Data);
19         }
5e4ef3 20         // GET: GlobalM/Bill
1e406e 21         public ActionResult Index(int BillId = 0)
5e4ef3 22         {
A 23             ReceiveBill record = null;
24             if (BillId == 0)
25             {
26                 record = new ReceiveBill()
27                 {
28                     Code = "",
29                     Name = "",
30                 };
31             }
32             else
33             {
34                 record = _billBusiness.GetBillById(BillId);
35             }
36             ViewData["BillIndex"] = record;
37             return PartialView();
38         }
1e406e 39
A 40         public ActionResult StartIndex()
41         {
42             return View();
43         }
955cd4 44         public ActionResult StartDIX()
A 45         {
46             return View();
47         }
1e406e 48
ac2719 49         public ActionResult StartDIXFireControl() {
A 50             return View();
51         }
52
1bf8ef 53         public ActionResult StartDIXQuality() {
A 54             return View();
55         }
56
37756f 57         public ActionResult InspectDetail(int InspectBookId = 0,int ShowBtn = 0)
40698f 58         {
A 59             //<input id="tbxInspectBookId" readonly="readonly" value='@ViewData["InspectBookId"]' />
60             ViewData["InspectBookId"] = InspectBookId;
37756f 61             ViewData["RoleNameString"] = Util.SessionHelper.Session["RoleNameString"].ToString();
A 62             ViewData["ShowBtn"] = ShowBtn;
40698f 63             return PartialView();
ac2719 64         }
A 65
fb7589 66         public ActionResult InspectFalseDetail(int InspectBookId = 0, int ShowBtn = 0)
ac2719 67         {
A 68             ViewData["InspectBookId"] = InspectBookId;
fb7589 69             ViewData["RoleNameString"] = Util.SessionHelper.Session["RoleNameString"].ToString();
A 70             ViewData["ShowBtn"] = ShowBtn;
7d6280 71             return PartialView();
A 72         }
73
74         public ActionResult ReckUpdateHistory(int InspectBookId,string FilterType)
75         {
76             ViewData["InspectBookId"] = InspectBookId;
77             ViewData["FilterType"] = FilterType;
ac2719 78             return View();
A 79         }
80
7d6280 81         public ActionResult GetReckDataUpdateHistory(int InspectBookId,string FilterType, int rows, int page)
ac2719 82         {
7d6280 83             Receive receive = _billBusiness.ReckDataUpdateHistory(InspectBookId, FilterType, rows,page);
ac2719 84             return Json(receive);
A 85         }
86
7d6280 87         public ActionResult GetReckImgUpdateHistory(int InspectBookId, string FilterType, int rows, int page)
ac2719 88         {
7d6280 89             Receive receive = _billBusiness.ReckImgUpdateHistory(InspectBookId, FilterType, rows, page);
ac2719 90             return Json(receive);
40698f 91         }
A 92
1e406e 93         public ActionResult SubmitBill(string Code,string Name,int BillTypeId)
A 94         {
95             Receive record = null;
96             try
97             {
98                 UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo;
955cd4 99                 record = this._billBusiness.SubmitBill(Code, Name, BillTypeId, ui.Id);
1e406e 100             }
A 101             catch (Exception ex)
102             {
103                 record = new Receive()
104                 {
105                     Code = 500,
106                     Message = ex.Message,
107                 };
108             }
109             return Json(record);
110         }
111
955cd4 112
675b00 113         public ActionResult GetInspectBook(string InspectObjectCode, DateTime TimeBegin,DateTime TimeEnd,int Status,string filterType, int rows, int page) {
1bf8ef 114             UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo;
A 115             object obj = this._billBusiness.GetInspectBook(InspectObjectCode,TimeBegin, TimeEnd, Status, rows, page, filterType, ui.Id);
40698f 116             return Json(obj);
A 117         }
7d6280 118
A 119         public ActionResult GetFalseInspectBook(int InspectAreaId,int InspectObjectTypeId,string InspectObjectCode,DateTime TimeBegin, DateTime TimeEnd, int rows, int page)
40698f 120         {
7d6280 121             object obj = this._billBusiness.GetFalseInspectBook(InspectAreaId, InspectObjectTypeId, InspectObjectCode, TimeBegin, TimeEnd, rows, page);
A 122             return Json(obj);
123         }
124
125         public ActionResult GetInspectDetailByBookId(int BookId,string FilterType)
126         {
127             object obj = this._billBusiness.GetInspectDetailByBookId(BookId, FilterType);
955cd4 128             return Json(obj);
A 129         }
130
40698f 131         public ActionResult StartDIXWorkflow(int[] BookIdArr, int[] BillTypeArr)
955cd4 132         {
A 133             Receive record = new Receive();
9057d4 134             UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo;
A 135             
136             
955cd4 137             try
A 138             {
139                 int UserId = ui.Id;
40698f 140                 for (int i = 0; i < BookIdArr.Length; i++)
955cd4 141                 {
40698f 142                     int BookId = BookIdArr[i];
955cd4 143                     int BillTypeId = BillTypeArr[i];
ef7699 144                     record = this._billBusiness.SubmitBill(BookId, BillTypeId, UserId);
A 145                     if (record.Code != 200)
146                     {
147                         break;
148                     }
955cd4 149                 }
ef7699 150                 if (record.Code == 200)
A 151                 {
152                     record.Message = "SUCCESS";
153                 }
955cd4 154             }
A 155             catch (Exception ex)
156             {
157                 record.Code = 500;
158                 record.Message = ex.Message;
159             }
160             return Json(record);
161         }
162
9057d4 163
A 164         public ActionResult GetNeedDealtNum() {
165             Receive receive = new Receive();
166             try
167             {
168                 if (Util.SessionHelper.Session["UserInfo"] == null)
169                 {
170                     receive.Code = 500;
171                     receive.Message = "0,0";
172                 }
173                 else
174                 {
175                     string UserNo = (Util.SessionHelper.Session["UserInfo"] as UserInfo).UserNo;
176                     receive.Code = 200;
177                     receive.Message = _billBusiness.GetNeedDealtNumByUserCode(UserNo);
178                 }
179             }
180             catch (Exception ex)
181             {
182                 receive.Code = 500;
183                 receive.Message=ex.Message;
184             }
185             return Json(receive);
186         }
187
ac2719 188
A 189         public ActionResult BillUpdate()
190         {
191             return View();
192         }
193
762399 194         public ActionResult BillInspectFinished()
A 195         {
196             return View();
197         }
198
7d6280 199         public ActionResult UpdateInspectReck( int InspectReckId,string InspectLimit,int Judge,string NGReason,int DealInScene,string Answer, string FilterType)
ac2719 200         {
A 201             string userName = string.Empty;
202             try
203             {
204                 if (Util.SessionHelper.Session["UserInfo"] == null)
205                 {
206                     userName = "";
207                 }
208                 else
209                 {
210                     userName = (Util.SessionHelper.Session["UserInfo"] as UserInfo).UserName;
211                 }
212             }
213             catch
214             {
215                 userName = "";
216             }
7d6280 217             Receive receive = _billBusiness.UpdateInspectReck(InspectReckId, InspectLimit, Judge, NGReason, DealInScene, Answer, userName, FilterType);
ac2719 218             return Json(receive);
A 219         }
220
7d6280 221         public ActionResult UpdateInspectReckImg(int InspectReckId, string ImgArrStr,string FilterType)
ac2719 222         {
A 223             string userName = string.Empty;
224             try
225             {
226                 if (Util.SessionHelper.Session["UserInfo"] == null)
227                 {
228                     userName = "";
229                 }
230                 else
231                 {
232                     userName = (Util.SessionHelper.Session["UserInfo"] as UserInfo).UserName;
233                 }
234             }
235             catch
236             {
237                 userName = "";
238             }
7d6280 239             Receive receive = _billBusiness.UpdateInspectReck(InspectReckId, ImgArrStr, userName, FilterType);
ac2719 240             return Json(receive);
A 241         }
242
5e4ef3 243     }
A 244 }