1
duan
2024-08-21 f71a02229c1ba00fbecaead19256593ffb052753
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
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)
        {
            //<input id="tbxInspectBookId" readonly="readonly" value='@ViewData["InspectBookId"]' />
            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);
        }
 
    }
}