Browse Source

急标本更新

zhupei 4 years ago
parent
commit
4c5a2d25f1

+ 11 - 0
RMYY_CallCenter_Api.Model/T_Dis_WorkOrder.cs

387
         }
387
         }
388
         #endregion Model
388
         #endregion Model
389
 
389
 
390
+        #region 扩展model
391
+        /// <summary>
392
+        /// 工单状态
393
+        /// </summary>
394
+        public string F_Wostate { get; set; }
395
+        /// <summary>
396
+        /// 坐席
397
+        /// </summary>
398
+        public string F_SitMan { get; set; }
399
+        #endregion
400
+
390
     }
401
     }
391
 }
402
 }

+ 4 - 4
RMYY_CallCenter_Api/Controllers/CallTel/CallrecordsController.cs

66
             }
66
             }
67
             if (starttime.Trim() != "")
67
             if (starttime.Trim() != "")
68
             {
68
             {
69
-                sql += " and BeginTime>='" + starttime + "' ";
69
+                sql += " and BeginTime>='"+ Convert.ToDateTime(starttime).ToString("yyyy-MM-dd") + " 00:00:00" + "' ";
70
             }
70
             }
71
             if (endtime.Trim() != "")
71
             if (endtime.Trim() != "")
72
             { 
72
             { 
73
-                sql += " and BeginTime<='" + endtime + "' ";
73
+                sql += " and BeginTime<='" + Convert.ToDateTime(endtime).ToString("yyyy-MM-dd") + " 23:59:59" + "' ";
74
             }
74
             }
75
             if(extnumber.Trim()!="")
75
             if(extnumber.Trim()!="")
76
             {
76
             {
220
 
220
 
221
             if (starttime.Trim() != "")
221
             if (starttime.Trim() != "")
222
             {
222
             {
223
-                sql += " and BeginTime>= '" + starttime + "' ";
223
+                sql += " and BeginTime>= '" + Convert.ToDateTime(starttime).ToString("yyyy-MM-dd")+ " 00:00:00" + "' ";
224
             }
224
             }
225
             if (endtime.Trim() != "")
225
             if (endtime.Trim() != "")
226
             {
226
             {
227
-                sql += " and BeginTime<='" + endtime + "' ";
227
+                sql += " and BeginTime<='" + Convert.ToDateTime(endtime).ToString("yyyy-MM-dd")+ " 23:59:59" + "' ";
228
             }
228
             }
229
 
229
 
230
             int recordCount = 0;
230
             int recordCount = 0;

+ 15 - 22
RMYY_CallCenter_Api/Controllers/WorkOrder/Con_WorkOrderController.cs

67
                 }
67
                 }
68
                 if (User.F_UserCode != "8000")
68
                 if (User.F_UserCode != "8000")
69
                 {
69
                 {
70
-                    if (User.F_RoleCode == "ZXZ")//坐席组看不到自己创建的工单
71
-                    {
72
-                        sql += $" and F_ID<0";
70
+                    sql += $" and F_CreateUser=" + User.F_UserCode;
73
 
71
 
74
-                    }
75
-                    else
72
+                    if (User.F_RoleCode == "HSZ")//护士长角色
76
                     {
73
                     {
77
-                        sql += $" and F_CreateUser=" + User.F_UserCode;
78
-
79
-                        if (User.F_RoleCode == "HSZ")//护士长角色
74
+                        string idstr = GetGongDanId(User.F_UserCode);
75
+                        if (!string.IsNullOrEmpty(idstr))
80
                         {
76
                         {
81
-                            string idstr = GetGongDanId(User.F_UserCode);
82
-                            if (!string.IsNullOrEmpty(idstr))
83
-                            {
84
-                                sql += $" or F_ID in (" + idstr + ")";
85
-                            }
77
+                            sql += $" or F_ID in (" + idstr + ")";
86
                         }
78
                         }
87
-                        if (User.F_RoleCode == "BZ")//行风办
79
+                    }
80
+                    if (User.F_RoleCode == "BZ")//行风办
81
+                    {
82
+                        transql = GetTranPersonsql(User.F_UserCode);
83
+                        if (transql != "")
88
                         {
84
                         {
89
-                            transql = GetTranPersonsql(User.F_UserCode);
90
-                            if (transql != "")
91
-                            {
92
-                                sql += $" or F_Id in (" + transql + ")";
93
-                                wokerlist = transql.Split(',').Distinct().ToList();
94
-                            }
85
+                            sql += $" or F_Id in (" + transql + ")";
86
+                            wokerlist = transql.Split(',').Distinct().ToList();
95
                         }
87
                         }
96
                     }
88
                     }
97
                 }
89
                 }
650
         /// </summary>
642
         /// </summary>
651
         private Model.T_Con_WorkOrder inputtoobj(Model.T_Con_WorkOrder model, Con_WorkOrderInput input, int type)
643
         private Model.T_Con_WorkOrder inputtoobj(Model.T_Con_WorkOrder model, Con_WorkOrderInput input, int type)
652
         {
644
         {
653
-            string usercode = "8000";
645
+            string usercode = User.F_UserCode;
654
             var newmodel = model;
646
             var newmodel = model;
655
             if (input.F_ID != 0)
647
             if (input.F_ID != 0)
656
             {
648
             {
722
             else
714
             else
723
             {               
715
             {               
724
                 model.F_State = (int)EnumWorkOrderState.neworder;//0
716
                 model.F_State = (int)EnumWorkOrderState.neworder;//0
725
-                model.F_CreateUser = usercode;
717
+                model.F_CreateUser = User.F_UserCode;
718
+                model.F_CreateUserName = User.F_UserName;
726
                 model.F_CreateTime = DateTime.Now;//添加时间
719
                 model.F_CreateTime = DateTime.Now;//添加时间
727
             }
720
             }
728
             model.F_IsDel = 0;
721
             model.F_IsDel = 0;

+ 193 - 215
RMYY_CallCenter_Api/Controllers/WorkOrder/T_Dis_WorkOrderController.cs

15
         Bll.T_Dis_WorkOrder orderbll = new Bll.T_Dis_WorkOrder();
15
         Bll.T_Dis_WorkOrder orderbll = new Bll.T_Dis_WorkOrder();
16
         Bll.T_Dis_WorkOrderItem itembll = new Bll.T_Dis_WorkOrderItem();
16
         Bll.T_Dis_WorkOrderItem itembll = new Bll.T_Dis_WorkOrderItem();
17
         Bll.T_Sys_Department dptbll = new Bll.T_Sys_Department();
17
         Bll.T_Sys_Department dptbll = new Bll.T_Sys_Department();
18
-
19
-
20
-
21
         /// <summary>
18
         /// <summary>
22
         /// 获取列表
19
         /// 获取列表
23
         /// </summary>
20
         /// </summary>
28
         /// <param name="pagesize"></param>
25
         /// <param name="pagesize"></param>
29
         /// <param name="state"></param>
26
         /// <param name="state"></param>
30
         /// <returns></returns>
27
         /// <returns></returns>
31
-        public ActionResult GetList(string keyword,int type, string starttime = "", string endtime = "", int pageindex = 1, int pagesize = 10, int state = -1)
28
+        public ActionResult GetList(string keyword,int type=0, string starttime = "", string endtime = "", int pageindex = 1, int pagesize = 10, int state = -1)
32
         {
29
         {
33
-            string usercode = "8000";
34
-            if (usercode != "")
30
+            if (User!= null)
35
             {
31
             {
36
-                var ua = userbll.GetModel(usercode);
37
                 string transql = "";
32
                 string transql = "";
38
                 List<string> wokerlist = new List<string>();
33
                 List<string> wokerlist = new List<string>();
39
                 #region 查询条件
34
                 #region 查询条件
53
                 {
48
                 {
54
                     sql += $"and F_State=" + state;
49
                     sql += $"and F_State=" + state;
55
                 }
50
                 }
56
-                if (ua.F_DeptId == 1)//综合保障中心
51
+                if (User.F_DeptId == 1)//综合保障中心
57
                 {
52
                 {
58
-                    if (ua.F_UserCode != "8000" && ua.F_RoleId != 1003)
59
-                        sql += $" and F_ControlManCode=" + ua.F_UserCode;
53
+                    if (User.F_UserCode != "8000" && User.F_RoleCode != "ZYY")
54
+                        sql += $" and F_ControlManCode=" + User.F_UserCode;
60
                 }
55
                 }
61
-                else if (ua.F_DeptId == 3002)//申请科室
56
+                else if (User.F_DeptId == 3002)//申请科室
62
                 {
57
                 {
63
-                    sql += $" and F_CreateCode=" + ua.F_UserCode + "";
58
+                    sql += $" and F_CreateCode=" + User.F_UserCode + "";
64
                 }
59
                 }
65
-                if (ua.F_DeptId == 1 && ua.F_RoleId == 1003)//转运人判断
60
+                if (User.F_DeptId == 1 && User.F_RoleCode == "ZYY")//转运人判断
66
                 {
61
                 {
67
-                    transql = GetTranPersonsql(usercode, ua.F_RoleId,type);
68
-                    string assignsql = GetTransql(usercode,type);
62
+                    transql = GetTranPersonsql(User.F_UserCode,type);
63
+                    string assignsql = GetTransql(User.F_UserCode,type);
69
                     if (assignsql != "" && transql != "")
64
                     if (assignsql != "" && transql != "")
70
                     {
65
                     {
71
-                        sql += $" and (F_Id in (" + transql + ") or F_Id in (" + assignsql + "))";
66
+                        //sql += $" and (F_Id in (" + transql + ") or F_Id in (" + assignsql + "))";
72
                         wokerlist = (transql + "," + assignsql).Split(',').Distinct().ToList();
67
                         wokerlist = (transql + "," + assignsql).Split(',').Distinct().ToList();
73
                     }
68
                     }
74
                     else if (transql != "")
69
                     else if (transql != "")
75
                     {
70
                     {
76
-                        sql += $" and F_Id in (" + transql + ")";
71
+                        //sql += $" and F_Id in (" + transql + ")";
77
                         wokerlist = transql.Split(',').Distinct().ToList();
72
                         wokerlist = transql.Split(',').Distinct().ToList();
78
                     }
73
                     }
79
                     else if (assignsql != "")
74
                     else if (assignsql != "")
80
                     {
75
                     {
81
-                        sql += $" and F_Id in (" + assignsql + ")";
76
+                        //sql += $" and F_Id in (" + assignsql + ")";
82
                         wokerlist = assignsql.Split(',').Distinct().ToList();
77
                         wokerlist = assignsql.Split(',').Distinct().ToList();
83
                     }
78
                     }
79
+                    sql += $" and F_Id in (" + string.Join(",", wokerlist)  + ")";
84
                 }
80
                 }
85
                 #endregion
81
                 #endregion
86
                 int recordCount = 0;
82
                 int recordCount = 0;
103
                 var modellist = orderbll.DataTableToList(data);
99
                 var modellist = orderbll.DataTableToList(data);
104
                 if (modellist.Count > 0)
100
                 if (modellist.Count > 0)
105
                 {
101
                 {
106
-                    if (wokerlist.Count > 0 || ua.F_RoleId== 1003)
102
+                    //if (wokerlist.Count > 0 || User.F_UserCode== "ZYY")
103
+                    //{
104
+                    foreach (var item in modellist)
107
                     {
105
                     {
108
-                        var obj = new
106
+                        if (wokerlist.Count > 0 || User.F_RoleCode == "ZYY")
109
                         {
107
                         {
110
-                            state = "success",
111
-                            message = "成功",
112
-                            rows = modellist.Where(p => wokerlist.Contains(p.F_Id.ToString())).Select(p =>
113
-                            new
114
-                            {
115
-                                Wostate = GetWoStateName(p.F_Id,ua.F_UserCode),
116
-                                SitMan = p.F_ControlManName + '(' + p.F_ControlManName + ')',
117
-                                modellist = p
118
-                            }),
119
-                            total = recordCount
120
-                        };
121
-                        return Content(obj.ToJson());
122
-                    }
123
-                    else
124
-                    {
125
-                        var obj = new
108
+                            item.F_Wostate = GetWoStateName(item.F_Id, User.F_UserCode);
109
+                        }
110
+                        else
126
                         {
111
                         {
127
-                            state = "success",
128
-                            message = "成功",
129
-                            rows = modellist.Select(p =>
130
-                            new
131
-                            {
132
-                                Wostate = EnumHelper.GetDescription((EnumDisWorkOrderState)p.F_State),
133
-                                SitMan = p.F_ControlManName + '(' + p.F_ControlManName + ')',
134
-                                modellist = p
135
-                            }),
136
-                            total = recordCount
137
-                        };
138
-                        return Content(obj.ToJson());
112
+                            item.F_Wostate = EnumHelper.GetDescription((EnumDisWorkOrderState)item.F_State);
113
+                        }
114
+                        item.F_SitMan = item.F_ControlManName + '(' + item.F_ControlManCode + ')';
139
 
115
 
140
                     }
116
                     }
117
+                    var obj = new
118
+                    {
119
+                        state = "success",
120
+                        message = "成功",
121
+                        rows = modellist,
122
+                        total = recordCount
123
+                    };
124
+                    return Content(obj.ToJson());
125
+                    //}
126
+                    //else
127
+                    //{
128
+                    //    var obj = new
129
+                    //    {
130
+                    //        state = "success",
131
+                    //        message = "成功",
132
+                    //        rows = modellist.Where(p => wokerlist.Contains(p.F_Id.ToString())).Select(p =>
133
+                    //        new
134
+                    //        {
135
+                    //            Wostate = EnumHelper.GetDescription((EnumDisWorkOrderState)p.F_State),
136
+                    //            SitMan = p.F_ControlManName + '(' + p.F_ControlManName + ')',
137
+                    //            modellist = p
138
+                    //        }),
139
+                    //        total = recordCount
140
+                    //    };
141
+                    //    return Content(obj.ToJson());
142
+
143
+                    //}
141
                 }
144
                 }
142
                 else return Error("暂无工单记录");
145
                 else return Error("暂无工单记录");
143
             }
146
             }
151
         private string GetTransql(string usercode, int type)
154
         private string GetTransql(string usercode, int type)
152
         {
155
         {
153
             string str = string.Empty;
156
             string str = string.Empty;
154
-            var list = itembll.GetModelList("F_OptType=" + (int)EnumDisItemOpt.assign + "and F_IsUsed='0' and F_WoType=" + type + " and F_WoState=" + (int)EnumDisWorkOrderState.assign + " and F_NextUser=" + usercode + " ").Select(t => t.F_WoID).Distinct().ToList();
157
+            var list = itembll.GetModelList("F_OptType=" + (int)EnumDisItemOpt.assign + " and F_WoType=" + type + " and F_WoState=" + (int)EnumDisWorkOrderState.assign + " and F_NextUser=" + usercode + " ").Select(t => t.F_WoID).Distinct().ToList();
155
             if (list.Count > 0)
158
             if (list.Count > 0)
156
                 foreach (var item in list)
159
                 foreach (var item in list)
157
                 {
160
                 {
165
         /// <param name="usercode"></param>
168
         /// <param name="usercode"></param>
166
         /// <param name="roleid"></param>
169
         /// <param name="roleid"></param>
167
         /// <returns></returns>
170
         /// <returns></returns>
168
-        private string GetTranPersonsql(string usercode, int roleid, int type)
171
+        private string GetTranPersonsql(string usercode, int type)
169
         {
172
         {
170
             string wokerlist = "";
173
             string wokerlist = "";
171
             string[] wokerarr = { };
174
             string[] wokerarr = { };
172
-            if (userbll.GetModel(usercode).F_RoleId == roleid)
175
+            var itemlist = itembll.GetModelList("F_CreateUser=" + usercode + "and F_WoType=" + type + "").Select(t => t.F_WoID).Distinct<long>().ToList();
176
+            if (itemlist.Count > 0)
173
             {
177
             {
174
-                var itemlist = itembll.GetModelList("F_CreateUser=" + usercode + "and F_WoType=" + type + " and F_IsUsed='0'").Select(t => t.F_WoID).Distinct<long>().ToList();
175
-                if (itemlist.Count > 0)
178
+                foreach (var item in itemlist)
176
                 {
179
                 {
177
-                    foreach (var item in itemlist)
178
-                    {
179
-                        wokerlist = string.IsNullOrEmpty(wokerlist) ? item.ToString() : wokerlist + "," + item.ToString();
180
-                    }
181
-                    if (wokerlist != "")
182
-                        wokerarr = wokerlist.Split(',');
180
+                    wokerlist = string.IsNullOrEmpty(wokerlist) ? item.ToString() : wokerlist + "," + item.ToString();
183
                 }
181
                 }
182
+                if (wokerlist != "")
183
+                    wokerarr = wokerlist.Split(',');
184
             }
184
             }
185
             return wokerlist;
185
             return wokerlist;
186
         }
186
         }
205
         /// <returns></returns>
205
         /// <returns></returns>
206
         public ActionResult GetModelDetail(int id)
206
         public ActionResult GetModelDetail(int id)
207
         {
207
         {
208
-            string ucode = "8000";
209
             string sql = "F_WoID = " + id + "";
208
             string sql = "F_WoID = " + id + "";
210
-            Model.T_Sys_UserAccount ua = userbll.GetModel(ucode);
211
             if (id <= 0)
209
             if (id <= 0)
212
             {
210
             {
213
                 return Error("请选择要查询的工单!");
211
                 return Error("请选择要查询的工单!");
242
         /// <returns></returns>
240
         /// <returns></returns>
243
         public ActionResult GetListExpt(int type,string keyword, string starttime = "", string endtime = "", int state = -1)
241
         public ActionResult GetListExpt(int type,string keyword, string starttime = "", string endtime = "", int state = -1)
244
         {
242
         {
245
-            string usercode = "8000";
246
-            if (usercode != "")
243
+            if (User != null)
247
             {
244
             {
248
                 #region 查询条件
245
                 #region 查询条件
249
                 if (type != (int)EnumWorkOrder.OrtherDis && type != (int)EnumWorkOrder.UrgDis && type != (int)EnumWorkOrder.RedDis && type != (int)EnumWorkOrder.BloodDis)
246
                 if (type != (int)EnumWorkOrder.OrtherDis && type != (int)EnumWorkOrder.UrgDis && type != (int)EnumWorkOrder.RedDis && type != (int)EnumWorkOrder.BloodDis)
531
         /// <returns></returns>
528
         /// <returns></returns>
532
         public ActionResult UpdateWorkOrder(int woid,int type,int hosid, int deptid, string deptname, string positon, string usercode, string username, string phon, string itemessage, string remark, string callid = "",int isthird = 0, int islarge = 0, string carrytime = "", int number = 0, string pic = "",string orthertype="")
529
         public ActionResult UpdateWorkOrder(int woid,int type,int hosid, int deptid, string deptname, string positon, string usercode, string username, string phon, string itemessage, string remark, string callid = "",int isthird = 0, int islarge = 0, string carrytime = "", int number = 0, string pic = "",string orthertype="")
533
         {
530
         {
534
-            //if (User != null)
535
-            //{
536
-            string ucode = "6004";
537
-            var User1 = userbll.GetModel(ucode);
538
-
539
-            #region 添加条件
540
-            if (woid <= 0)
541
-                return Error("请选择要修改的工单!");
542
-            if (type != (int)EnumWorkOrder.OrtherDis && type != (int)EnumWorkOrder.UrgDis && type != (int)EnumWorkOrder.RedDis && type != (int)EnumWorkOrder.BloodDis)
543
-                return Error("工单类型错误!");
544
-            if (hosid <= 0)
545
-                return Error("请选择院区!");
546
-            if (deptid <= 0)
547
-                return Error("请选择申请部门!");
548
-            if (usercode == "")
549
-                return Error("请选择申请人!");
550
-            if (phon == "")
551
-                return Error("请输入联系电话!");
552
-            if (type == (int)EnumWorkOrder.OrtherDis && string.IsNullOrEmpty(orthertype))
531
+            if (User != null)
553
             {
532
             {
554
-                return Error("请选择配送类型!");
555
-            }
556
-            //if (string.IsNullOrEmpty(itemessage))
557
-            //    return Error("请填写配送信息!");
558
-            #endregion
559
 
533
 
560
-            var model = orderbll.GetModel(woid);
561
-            if (model == null)
562
-                return Error("不存在此工单信息!");
563
-            if (model.F_State == (int)EnumDisWorkOrderState.assign || model.F_TransPersonCode != "")
564
-                return Error("工单已指派不能修改!");
565
-            model.F_ProposerDeptId = deptid;//申请科室
566
-            model.F_ProposerDeptName = deptname;//申请科室名称
567
-            model.F_ProposerCode = usercode;//申请人
568
-            model.F_ProposerName = username;
569
-            model.F_ProposerPhon = phon;
570
-            model.F_BedPosition = positon;//送达地点
571
-            model.F_Remark = remark;
572
-            if (!string.IsNullOrEmpty(orthertype))
573
-                model.F_OrtherType = orthertype;
574
-            if (type == (int)EnumWorkOrder.OrtherDis && isthird == 1)
575
-            {
576
-                model.F_IsThird = 1;
577
-                model.F_Islarge = islarge;
578
-                if (!string.IsNullOrEmpty(carrytime))
579
-                    model.F_CarryTime = Convert.ToDateTime(carrytime);
580
-            }
581
-            if (type == (int)EnumWorkOrder.OrtherDis || type == (int)EnumWorkOrder.UrgDis)
582
-            {
583
-                #region 信息处理
584
-                if (string.IsNullOrEmpty(itemessage))
585
-                    return Error("请填写配送信息!");
586
-                string[] _list = itemessage.TrimEnd(',').Split(',');
587
-                string mscontents = "";
588
-                for (int i = 0; i < _list.Length; i++)
534
+                #region 添加条件
535
+                if (woid <= 0)
536
+                    return Error("请选择要修改的工单!");
537
+                if (type != (int)EnumWorkOrder.OrtherDis && type != (int)EnumWorkOrder.UrgDis && type != (int)EnumWorkOrder.RedDis && type != (int)EnumWorkOrder.BloodDis)
538
+                    return Error("工单类型错误!");
539
+                if (hosid <= 0)
540
+                    return Error("请选择院区!");
541
+                if (deptid <= 0)
542
+                    return Error("请选择申请部门!");
543
+                if (usercode == "")
544
+                    return Error("请选择申请人!");
545
+                if (phon == "")
546
+                    return Error("请输入联系电话!");
547
+                if (type == (int)EnumWorkOrder.OrtherDis && string.IsNullOrEmpty(orthertype))
589
                 {
548
                 {
590
-                    string[] _temp = _list[i].Split('-');
591
-                    string itemess = _temp[0];
592
-                    int num = Convert.ToInt32(_temp[1]);
593
-
594
-                    if (num > 0 && itemess != "")
595
-                    {
596
-                        mscontents = string.IsNullOrEmpty(mscontents) ? (itemess + ",数量:" + num) : (mscontents + " ; " + itemess + ",数量:" + num);
597
-                    }
598
-                    else return Error("配送信息不正确!");
549
+                    return Error("请选择配送类型!");
599
                 }
550
                 }
551
+                //if (string.IsNullOrEmpty(itemessage))
552
+                //    return Error("请填写配送信息!");
600
                 #endregion
553
                 #endregion
601
-                model.F_ItemMessages = itemessage;//配送内容
602
-                model.F_ItemContents = mscontents;
603
-                bool n = orderbll.Update(model);
604
-                if (n)
554
+
555
+                var model = orderbll.GetModel(woid);
556
+                if (model == null)
557
+                    return Error("不存在此工单信息!");
558
+                if (model.F_State == (int)EnumDisWorkOrderState.assign || model.F_TransPersonCode != "")
559
+                    return Error("工单已指派不能修改!");
560
+                model.F_ProposerDeptId = deptid;//申请科室
561
+                model.F_ProposerDeptName = deptname;//申请科室名称
562
+                model.F_ProposerCode = usercode;//申请人
563
+                model.F_ProposerName = username;
564
+                model.F_ProposerPhon = phon;
565
+                model.F_BedPosition = positon;//送达地点
566
+                model.F_Remark = remark;
567
+                if (!string.IsNullOrEmpty(orthertype))
568
+                    model.F_OrtherType = orthertype;
569
+                if (type == (int)EnumWorkOrder.OrtherDis && isthird == 1)
605
                 {
570
                 {
606
-                    AddLog(woid, 0, type, User1.F_UserName + "(" + User1.F_UserCode + ")" + "修改工单", 0, (int)EnumDisItemOpt.update, "", 0, User1);
571
+                    model.F_IsThird = 1;
572
+                    model.F_Islarge = islarge;
573
+                    if (!string.IsNullOrEmpty(carrytime))
574
+                        model.F_CarryTime = Convert.ToDateTime(carrytime);
607
                 }
575
                 }
608
-                else return Error("修改失败");
609
-            }
610
-            if (type == (int)EnumWorkOrder.RedDis)
611
-            {
612
-                if (number <= 0)
613
-                    return Error("红处方数量不能为空!");
614
-                model.F_DisNum = number;//红处方数量
615
-                model.F_ItemMessages = pic;//红处方图片
616
-                model.F_ItemContents = "红处方配送";
617
-                bool n = orderbll.Update(model);
618
-                if (n)
576
+                if (type == (int)EnumWorkOrder.OrtherDis || type == (int)EnumWorkOrder.UrgDis)
619
                 {
577
                 {
620
-                    AddLog(woid, 0, type, User1.F_UserName + "(" + User1.F_UserCode + ")" + "修改工单", 0, (int)EnumDisItemOpt.update, "", 0, User1);
578
+                    #region 信息处理
579
+                    if (string.IsNullOrEmpty(itemessage))
580
+                        return Error("请填写配送信息!");
581
+                    string[] _list = itemessage.TrimEnd(',').Split(',');
582
+                    string mscontents = "";
583
+                    for (int i = 0; i < _list.Length; i++)
584
+                    {
585
+                        string[] _temp = _list[i].Split('-');
586
+                        string itemess = _temp[0];
587
+                        int num = Convert.ToInt32(_temp[1]);
588
+
589
+                        if (num > 0 && itemess != "")
590
+                        {
591
+                            mscontents = string.IsNullOrEmpty(mscontents) ? (itemess + ",数量:" + num) : (mscontents + " ; " + itemess + ",数量:" + num);
592
+                        }
593
+                        else return Error("配送信息不正确!");
594
+                    }
595
+                    #endregion
596
+                    model.F_ItemMessages = itemessage;//配送内容
597
+                    model.F_ItemContents = mscontents;
598
+                    bool n = orderbll.Update(model);
599
+                    if (n)
600
+                    {
601
+                        AddLog(woid, 0, type, User.F_UserName + "(" + User.F_UserCode + ")" + "修改工单", 0, (int)EnumDisItemOpt.update, "", 0, User);
602
+                    }
603
+                    else return Error("修改失败");
621
                 }
604
                 }
622
-                else return Error("修改失败");
623
-            }
624
-            if (type == (int)EnumWorkOrder.BloodDis)
625
-            {
626
-                #region 信息处理
627
-                if (string.IsNullOrEmpty(itemessage))
628
-                    return Error("请填写配送信息!");
629
-                string[] _list = itemessage.TrimEnd(',').Split(',');
630
-                string mscontents = "";
631
-                //string deptstr = "";
632
-                //string[] deptlist = { };
633
-                for (int i = 0; i < _list.Length; i++)
605
+                if (type == (int)EnumWorkOrder.RedDis)
634
                 {
606
                 {
635
-                    string[] _temp = _list[i].Split('-');
636
-                    string itemess = _temp[0];
637
-                    int sendeptid = Convert.ToInt32(_temp[1]);
638
-                    string sendepatname = _temp[2].ToString();
639
-                    int num = Convert.ToInt32(_temp[3]);
640
-
641
-                    if (num > 0 && itemess != "" && sendepatname != "" && sendeptid > 0)
607
+                    if (number <= 0)
608
+                        return Error("红处方数量不能为空!");
609
+                    model.F_DisNum = number;//红处方数量
610
+                    model.F_ItemMessages = pic;//红处方图片
611
+                    model.F_ItemContents = "红处方配送";
612
+                    bool n = orderbll.Update(model);
613
+                    if (n)
642
                     {
614
                     {
643
-                        //mscontents = string.IsNullOrEmpty(mscontents) ? (itemess + "配送到" + sendepatname + "科室" + ",数量:" + num) : (mscontents + " ; " + itemess + "配送到" + sendepatname + "科室" + ",数量:" + num);
644
-                        mscontents = itemess + "配送到" + sendepatname + "科室" + ",数量:" + num;
645
-                        model.F_ItemMessages = itemessage;//配送内容
646
-                        model.F_ItemContents = mscontents;
647
-                        var deptmodel = dptbll.GetModel(sendeptid);
648
-                        if (deptmodel != null)
615
+                        AddLog(woid, 0, type, User.F_UserName + "(" + User.F_UserCode + ")" + "修改工单", 0, (int)EnumDisItemOpt.update, "", 0, User);
616
+                    }
617
+                    else return Error("修改失败");
618
+                }
619
+                if (type == (int)EnumWorkOrder.BloodDis)
620
+                {
621
+                    #region 信息处理
622
+                    if (string.IsNullOrEmpty(itemessage))
623
+                        return Error("请填写配送信息!");
624
+                    string[] _list = itemessage.TrimEnd(',').Split(',');
625
+                    string mscontents = "";
626
+                    //string deptstr = "";
627
+                    //string[] deptlist = { };
628
+                    for (int i = 0; i < _list.Length; i++)
629
+                    {
630
+                        string[] _temp = _list[i].Split('-');
631
+                        string itemess = _temp[0];
632
+                        int sendeptid = Convert.ToInt32(_temp[1]);
633
+                        string sendepatname = _temp[2].ToString();
634
+                        int num = Convert.ToInt32(_temp[3]);
635
+
636
+                        if (num > 0 && itemess != "" && sendepatname != "" && sendeptid > 0)
649
                         {
637
                         {
650
-                            model.F_SendDeptId = sendeptid;
651
-                            model.F_SendDeptName = sendepatname;
652
-                            bool tt = orderbll.Update(model);
653
-                            if (tt)
638
+                            //mscontents = string.IsNullOrEmpty(mscontents) ? (itemess + "配送到" + sendepatname + "科室" + ",数量:" + num) : (mscontents + " ; " + itemess + "配送到" + sendepatname + "科室" + ",数量:" + num);
639
+                            mscontents = itemess + "配送到" + sendepatname + "科室" + ",数量:" + num;
640
+                            model.F_ItemMessages = itemessage;//配送内容
641
+                            model.F_ItemContents = mscontents;
642
+                            var deptmodel = dptbll.GetModel(sendeptid);
643
+                            if (deptmodel != null)
654
                             {
644
                             {
655
-                                AddLog(woid, 0, type, User1.F_UserName + "(" + User1.F_UserCode + ")" + "修改工单", 0, (int)EnumDisItemOpt.update, "", 0, User1);
645
+                                model.F_SendDeptId = sendeptid;
646
+                                model.F_SendDeptName = sendepatname;
647
+                                bool tt = orderbll.Update(model);
648
+                                if (tt)
649
+                                {
650
+                                    AddLog(woid, 0, type, User.F_UserName + "(" + User.F_UserCode + ")" + "修改工单", 0, (int)EnumDisItemOpt.update, "", 0, User);
651
+                                }
652
+                                else return Error("修改失败");
656
                             }
653
                             }
657
-                            else return Error("修改失败");
654
+                            else return Error("不存在此部门信息!");
655
+                            //deptstr += sendeptid + ",";
658
                         }
656
                         }
659
-                        else return Error("不存在此部门信息!");
660
-                        //deptstr += sendeptid + ",";
657
+                        else return Error("配送信息不正确!");
661
                     }
658
                     }
662
-                    else return Error("配送信息不正确!");
663
-                }
664
-                //if (!string.IsNullOrEmpty(deptstr))
665
-                //    deptlist = deptstr.TrimEnd(',').Split(',');
666
-                #endregion
659
+                    //if (!string.IsNullOrEmpty(deptstr))
660
+                    //    deptlist = deptstr.TrimEnd(',').Split(',');
661
+                    #endregion
667
 
662
 
668
 
663
 
664
+                }
665
+                return Success("操作成功!");
669
             }
666
             }
670
-            return Success("操作成功!");
667
+            return Error("无操作权限!");
671
         }
668
         }
672
         /// <summary>
669
         /// <summary>
673
         /// 转派
670
         /// 转派
676
         /// <returns></returns>
673
         /// <returns></returns>
677
         public ActionResult AssignWo(int woid, string transMestr)
674
         public ActionResult AssignWo(int woid, string transMestr)
678
         {
675
         {
679
-            string usercode = "8001";
680
             string transperson = "";
676
             string transperson = "";
681
             string transcodestr = "";
677
             string transcodestr = "";
682
-            var ua = userbll.GetModel(usercode);
683
             if (woid == 0)
678
             if (woid == 0)
684
                 return Error("工单编号错误!");
679
                 return Error("工单编号错误!");
685
             var omodel = orderbll.GetModel(woid);
680
             var omodel = orderbll.GetModel(woid);
699
                     {
694
                     {
700
                         try { name = userbll.GetModel(code).F_UserName; }
695
                         try { name = userbll.GetModel(code).F_UserName; }
701
                         catch { return Error("转运人信息不正确"); }
696
                         catch { return Error("转运人信息不正确"); }
702
-                        bool n = AssignTrans(ua, omodel, "", code, phon, talkie);
697
+                        bool n = AssignTrans(User, omodel, "", code, phon, talkie);
703
                         if (n)
698
                         if (n)
704
                         {
699
                         {
705
                             transperson = string.IsNullOrEmpty(transperson) ? name + "(" + code + ")" : transperson + "," + name + "(" + code + ")";
700
                             transperson = string.IsNullOrEmpty(transperson) ? name + "(" + code + ")" : transperson + "," + name + "(" + code + ")";
709
                     }
704
                     }
710
                     else return Error("转运人编号和手机号不能为空!");
705
                     else return Error("转运人编号和手机号不能为空!");
711
                 }
706
                 }
712
-                omodel.F_ControlManCode = ua.F_UserCode;//调度人
713
-                omodel.F_ControlManName = ua.F_UserName;
707
+                omodel.F_ControlManCode = User.F_UserCode;//调度人
708
+                omodel.F_ControlManName = User.F_UserName;
714
                 omodel.F_TransPersonCode = transcodestr;//转派人编码字符串
709
                 omodel.F_TransPersonCode = transcodestr;//转派人编码字符串
715
                 omodel.F_TransPerson = transperson;
710
                 omodel.F_TransPerson = transperson;
716
                 omodel.F_State = (int)EnumDisWorkOrderState.assign;//已指派待查收
711
                 omodel.F_State = (int)EnumDisWorkOrderState.assign;//已指派待查收
771
         /// <returns></returns>
766
         /// <returns></returns>
772
         public ActionResult SureWo(int woid)
767
         public ActionResult SureWo(int woid)
773
         {
768
         {
774
-            string uacode = "6001";
775
-            int state = 0;
776
-            var ua = userbll.GetModel(uacode);
777
             if (woid == 0)
769
             if (woid == 0)
778
                 return Error("工单编号错误!");
770
                 return Error("工单编号错误!");
779
             var omodel = orderbll.GetModel(woid);
771
             var omodel = orderbll.GetModel(woid);
780
             if (omodel != null)
772
             if (omodel != null)
781
             {
773
             {
782
-                if (DealWO(ua, omodel, "", "", 1))
774
+                if (DealWO(User, omodel, "", "", 1))
783
                     return Success("操作成功,请尽快处理工单!");
775
                     return Success("操作成功,请尽快处理工单!");
784
                 else return Error("工单操作失败!");
776
                 else return Error("工单操作失败!");
785
             }
777
             }
794
         /// <param name="woid"></param>
786
         /// <param name="woid"></param>
795
         /// <returns></returns>
787
         /// <returns></returns>
796
         public ActionResult DealWork(int woid)
788
         public ActionResult DealWork(int woid)
797
-        {
798
-            string uacode = "6002";
799
-            var ua = userbll.GetModel(uacode);
789
+        {          
800
             if (woid == 0)
790
             if (woid == 0)
801
                 return Error("工单编号错误!");
791
                 return Error("工单编号错误!");
802
             var omodel = orderbll.GetModel(woid);
792
             var omodel = orderbll.GetModel(woid);
803
             if (omodel != null)
793
             if (omodel != null)
804
             {
794
             {
805
-                if (DealWO(ua, omodel, "", "", 2))
795
+                if (DealWO(User, omodel, "", "", 2))
806
                     return Success("操作成功,请尽快完成工单!");
796
                     return Success("操作成功,请尽快完成工单!");
807
                 else return Error("工单操作失败!");
797
                 else return Error("工单操作失败!");
808
             }
798
             }
817
         /// <returns></returns>
807
         /// <returns></returns>
818
         public ActionResult FeachRed(int woid)
808
         public ActionResult FeachRed(int woid)
819
         {
809
         {
820
-            string uacode = "6001";
821
-            var ua = userbll.GetModel(uacode);
822
             if (woid == 0)
810
             if (woid == 0)
823
                 return Error("工单编号错误!");
811
                 return Error("工单编号错误!");
824
             var omodel = orderbll.GetModel(woid);
812
             var omodel = orderbll.GetModel(woid);
825
             if (omodel != null)
813
             if (omodel != null)
826
             {
814
             {
827
-                if (DealWO(ua, omodel, "", "", 4))
815
+                if (DealWO(User, omodel, "", "", 4))
828
                     return Success("操作成功!");
816
                     return Success("操作成功!");
829
                 else return Error("工单操作失败!");
817
                 else return Error("工单操作失败!");
830
             }
818
             }
839
         /// <returns></returns>
827
         /// <returns></returns>
840
         public ActionResult FeachDrug(int woid)
828
         public ActionResult FeachDrug(int woid)
841
         {
829
         {
842
-            string uacode = "6001";
843
-            var ua = userbll.GetModel(uacode);
844
             if (woid == 0)
830
             if (woid == 0)
845
                 return Error("工单编号错误!");
831
                 return Error("工单编号错误!");
846
             var omodel = orderbll.GetModel(woid);
832
             var omodel = orderbll.GetModel(woid);
847
             if (omodel != null)
833
             if (omodel != null)
848
             {
834
             {
849
-                if (DealWO(ua, omodel, "", "", 5))
835
+                if (DealWO(User, omodel, "", "", 5))
850
                     return Success("操作成功!");
836
                     return Success("操作成功!");
851
                 else return Error("工单操作失败!");
837
                 else return Error("工单操作失败!");
852
             }
838
             }
861
         /// <param name="woid"></param>
847
         /// <param name="woid"></param>
862
         /// <returns></returns>
848
         /// <returns></returns>
863
         public ActionResult TakeBlood(int woid)
849
         public ActionResult TakeBlood(int woid)
864
-        {
865
-            string uacode = "6001";
866
-            var ua = userbll.GetModel(uacode);
850
+        {           
867
             if (woid == 0)
851
             if (woid == 0)
868
                 return Error("工单编号错误!");
852
                 return Error("工单编号错误!");
869
             var omodel = orderbll.GetModel(woid);
853
             var omodel = orderbll.GetModel(woid);
870
             if (omodel != null)
854
             if (omodel != null)
871
             {
855
             {
872
-                if (DealWO(ua, omodel, "", "", 6))
856
+                if (DealWO(User, omodel, "", "", 6))
873
                     return Success("操作成功!");
857
                     return Success("操作成功!");
874
                 else return Error("工单操作失败!");
858
                 else return Error("工单操作失败!");
875
             }
859
             }
882
         /// <param name="woid"></param>
866
         /// <param name="woid"></param>
883
         /// <returns></returns>
867
         /// <returns></returns>
884
         public ActionResult SendTo(int woid)
868
         public ActionResult SendTo(int woid)
885
-        {
886
-            string uacode = "6001";
887
-            var ua = userbll.GetModel(uacode);
869
+        {          
888
             if (woid == 0)
870
             if (woid == 0)
889
                 return Error("工单编号错误!");
871
                 return Error("工单编号错误!");
890
             var omodel = orderbll.GetModel(woid);
872
             var omodel = orderbll.GetModel(woid);
891
             if (omodel != null)
873
             if (omodel != null)
892
             {
874
             {
893
-                if (DealWO(ua, omodel, "", "", 7))
875
+                if (DealWO(User, omodel, "", "", 7))
894
                     return Success("操作成功!");
876
                     return Success("操作成功!");
895
                 else return Error("工单操作失败!");
877
                 else return Error("工单操作失败!");
896
             }
878
             }
904
         /// <returns></returns>
886
         /// <returns></returns>
905
         public ActionResult ServiceWo(int woid)
887
         public ActionResult ServiceWo(int woid)
906
         {
888
         {
907
-            string uacode = "6001";
908
-            var ua = userbll.GetModel(uacode);
909
             if (woid == 0)
889
             if (woid == 0)
910
                 return Error("工单编号错误!");
890
                 return Error("工单编号错误!");
911
             var omodel = orderbll.GetModel(woid);
891
             var omodel = orderbll.GetModel(woid);
912
             if (omodel != null)
892
             if (omodel != null)
913
             {
893
             {
914
-                if (DealWO(ua, omodel, "", "", 3))
894
+                if (DealWO(User, omodel, "", "", 3))
915
                     return Success("操作成功!");
895
                     return Success("操作成功!");
916
                 else return Error("工单操作失败!");
896
                 else return Error("工单操作失败!");
917
             }
897
             }
926
         /// <returns></returns>
906
         /// <returns></returns>
927
         public ActionResult OverWo(int woid, string sureman, string phon, string talkie)
907
         public ActionResult OverWo(int woid, string sureman, string phon, string talkie)
928
         {
908
         {
929
-            string usercode = "6004";
930
-            var ua = userbll.GetModel(usercode);
931
             if (woid == 0)
909
             if (woid == 0)
932
                 return Error("工单编号错误!");
910
                 return Error("工单编号错误!");
933
             if (string.IsNullOrEmpty(sureman))
911
             if (string.IsNullOrEmpty(sureman))
938
             var omodel = orderbll.GetModel(woid);
916
             var omodel = orderbll.GetModel(woid);
939
             if (omodel != null)
917
             if (omodel != null)
940
             {
918
             {
941
-                if (omodel.F_CreateCode != usercode)
919
+                if (omodel.F_CreateCode != User.F_UserCode)
942
                     return Error("无操作权限!");
920
                     return Error("无操作权限!");
943
-                var n = AddLogTrans(woid, (int)omodel.F_State,(int)omodel.F_Type, user.F_UserName + "(" + user.F_UserCode + ")" + "确认完结工单", (int)EnumDisItemType.deal, (int)EnumDisItemOpt.over, "", "", phon, talkie, 0, ua);
921
+                var n = AddLogTrans(woid, (int)omodel.F_State,(int)omodel.F_Type, user.F_UserName + "(" + user.F_UserCode + ")" + "确认完结工单", (int)EnumDisItemType.deal, (int)EnumDisItemOpt.over, "", "", phon, talkie, 0, User);
944
                 //if (DealWO(ua, omodel, "", "", 6))
922
                 //if (DealWO(ua, omodel, "", "", 6))
945
                 if (n > 0)
923
                 if (n > 0)
946
                 {
924
                 {