|
|
@@ -15,9 +15,6 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
15
|
15
|
Bll.T_Dis_WorkOrder orderbll = new Bll.T_Dis_WorkOrder();
|
|
16
|
16
|
Bll.T_Dis_WorkOrderItem itembll = new Bll.T_Dis_WorkOrderItem();
|
|
17
|
17
|
Bll.T_Sys_Department dptbll = new Bll.T_Sys_Department();
|
|
18
|
|
-
|
|
19
|
|
-
|
|
20
|
|
-
|
|
21
|
18
|
/// <summary>
|
|
22
|
19
|
/// 获取列表
|
|
23
|
20
|
/// </summary>
|
|
|
@@ -28,12 +25,10 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
28
|
25
|
/// <param name="pagesize"></param>
|
|
29
|
26
|
/// <param name="state"></param>
|
|
30
|
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
|
32
|
string transql = "";
|
|
38
|
33
|
List<string> wokerlist = new List<string>();
|
|
39
|
34
|
#region 查询条件
|
|
|
@@ -53,34 +48,35 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
53
|
48
|
{
|
|
54
|
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
|
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
|
67
|
wokerlist = (transql + "," + assignsql).Split(',').Distinct().ToList();
|
|
73
|
68
|
}
|
|
74
|
69
|
else if (transql != "")
|
|
75
|
70
|
{
|
|
76
|
|
- sql += $" and F_Id in (" + transql + ")";
|
|
|
71
|
+ //sql += $" and F_Id in (" + transql + ")";
|
|
77
|
72
|
wokerlist = transql.Split(',').Distinct().ToList();
|
|
78
|
73
|
}
|
|
79
|
74
|
else if (assignsql != "")
|
|
80
|
75
|
{
|
|
81
|
|
- sql += $" and F_Id in (" + assignsql + ")";
|
|
|
76
|
+ //sql += $" and F_Id in (" + assignsql + ")";
|
|
82
|
77
|
wokerlist = assignsql.Split(',').Distinct().ToList();
|
|
83
|
78
|
}
|
|
|
79
|
+ sql += $" and F_Id in (" + string.Join(",", wokerlist) + ")";
|
|
84
|
80
|
}
|
|
85
|
81
|
#endregion
|
|
86
|
82
|
int recordCount = 0;
|
|
|
@@ -103,41 +99,48 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
103
|
99
|
var modellist = orderbll.DataTableToList(data);
|
|
104
|
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
|
145
|
else return Error("暂无工单记录");
|
|
143
|
146
|
}
|
|
|
@@ -151,7 +154,7 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
151
|
154
|
private string GetTransql(string usercode, int type)
|
|
152
|
155
|
{
|
|
153
|
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
|
158
|
if (list.Count > 0)
|
|
156
|
159
|
foreach (var item in list)
|
|
157
|
160
|
{
|
|
|
@@ -165,22 +168,19 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
165
|
168
|
/// <param name="usercode"></param>
|
|
166
|
169
|
/// <param name="roleid"></param>
|
|
167
|
170
|
/// <returns></returns>
|
|
168
|
|
- private string GetTranPersonsql(string usercode, int roleid, int type)
|
|
|
171
|
+ private string GetTranPersonsql(string usercode, int type)
|
|
169
|
172
|
{
|
|
170
|
173
|
string wokerlist = "";
|
|
171
|
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
|
185
|
return wokerlist;
|
|
186
|
186
|
}
|
|
|
@@ -205,9 +205,7 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
205
|
205
|
/// <returns></returns>
|
|
206
|
206
|
public ActionResult GetModelDetail(int id)
|
|
207
|
207
|
{
|
|
208
|
|
- string ucode = "8000";
|
|
209
|
208
|
string sql = "F_WoID = " + id + "";
|
|
210
|
|
- Model.T_Sys_UserAccount ua = userbll.GetModel(ucode);
|
|
211
|
209
|
if (id <= 0)
|
|
212
|
210
|
{
|
|
213
|
211
|
return Error("请选择要查询的工单!");
|
|
|
@@ -242,8 +240,7 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
242
|
240
|
/// <returns></returns>
|
|
243
|
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
|
245
|
#region 查询条件
|
|
249
|
246
|
if (type != (int)EnumWorkOrder.OrtherDis && type != (int)EnumWorkOrder.UrgDis && type != (int)EnumWorkOrder.RedDis && type != (int)EnumWorkOrder.BloodDis)
|
|
|
@@ -531,143 +528,143 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
531
|
528
|
/// <returns></returns>
|
|
532
|
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
|
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
|
669
|
/// <summary>
|
|
673
|
670
|
/// 转派
|
|
|
@@ -676,10 +673,8 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
676
|
673
|
/// <returns></returns>
|
|
677
|
674
|
public ActionResult AssignWo(int woid, string transMestr)
|
|
678
|
675
|
{
|
|
679
|
|
- string usercode = "8001";
|
|
680
|
676
|
string transperson = "";
|
|
681
|
677
|
string transcodestr = "";
|
|
682
|
|
- var ua = userbll.GetModel(usercode);
|
|
683
|
678
|
if (woid == 0)
|
|
684
|
679
|
return Error("工单编号错误!");
|
|
685
|
680
|
var omodel = orderbll.GetModel(woid);
|
|
|
@@ -699,7 +694,7 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
699
|
694
|
{
|
|
700
|
695
|
try { name = userbll.GetModel(code).F_UserName; }
|
|
701
|
696
|
catch { return Error("转运人信息不正确"); }
|
|
702
|
|
- bool n = AssignTrans(ua, omodel, "", code, phon, talkie);
|
|
|
697
|
+ bool n = AssignTrans(User, omodel, "", code, phon, talkie);
|
|
703
|
698
|
if (n)
|
|
704
|
699
|
{
|
|
705
|
700
|
transperson = string.IsNullOrEmpty(transperson) ? name + "(" + code + ")" : transperson + "," + name + "(" + code + ")";
|
|
|
@@ -709,8 +704,8 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
709
|
704
|
}
|
|
710
|
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
|
709
|
omodel.F_TransPersonCode = transcodestr;//转派人编码字符串
|
|
715
|
710
|
omodel.F_TransPerson = transperson;
|
|
716
|
711
|
omodel.F_State = (int)EnumDisWorkOrderState.assign;//已指派待查收
|
|
|
@@ -771,15 +766,12 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
771
|
766
|
/// <returns></returns>
|
|
772
|
767
|
public ActionResult SureWo(int woid)
|
|
773
|
768
|
{
|
|
774
|
|
- string uacode = "6001";
|
|
775
|
|
- int state = 0;
|
|
776
|
|
- var ua = userbll.GetModel(uacode);
|
|
777
|
769
|
if (woid == 0)
|
|
778
|
770
|
return Error("工单编号错误!");
|
|
779
|
771
|
var omodel = orderbll.GetModel(woid);
|
|
780
|
772
|
if (omodel != null)
|
|
781
|
773
|
{
|
|
782
|
|
- if (DealWO(ua, omodel, "", "", 1))
|
|
|
774
|
+ if (DealWO(User, omodel, "", "", 1))
|
|
783
|
775
|
return Success("操作成功,请尽快处理工单!");
|
|
784
|
776
|
else return Error("工单操作失败!");
|
|
785
|
777
|
}
|
|
|
@@ -794,15 +786,13 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
794
|
786
|
/// <param name="woid"></param>
|
|
795
|
787
|
/// <returns></returns>
|
|
796
|
788
|
public ActionResult DealWork(int woid)
|
|
797
|
|
- {
|
|
798
|
|
- string uacode = "6002";
|
|
799
|
|
- var ua = userbll.GetModel(uacode);
|
|
|
789
|
+ {
|
|
800
|
790
|
if (woid == 0)
|
|
801
|
791
|
return Error("工单编号错误!");
|
|
802
|
792
|
var omodel = orderbll.GetModel(woid);
|
|
803
|
793
|
if (omodel != null)
|
|
804
|
794
|
{
|
|
805
|
|
- if (DealWO(ua, omodel, "", "", 2))
|
|
|
795
|
+ if (DealWO(User, omodel, "", "", 2))
|
|
806
|
796
|
return Success("操作成功,请尽快完成工单!");
|
|
807
|
797
|
else return Error("工单操作失败!");
|
|
808
|
798
|
}
|
|
|
@@ -817,14 +807,12 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
817
|
807
|
/// <returns></returns>
|
|
818
|
808
|
public ActionResult FeachRed(int woid)
|
|
819
|
809
|
{
|
|
820
|
|
- string uacode = "6001";
|
|
821
|
|
- var ua = userbll.GetModel(uacode);
|
|
822
|
810
|
if (woid == 0)
|
|
823
|
811
|
return Error("工单编号错误!");
|
|
824
|
812
|
var omodel = orderbll.GetModel(woid);
|
|
825
|
813
|
if (omodel != null)
|
|
826
|
814
|
{
|
|
827
|
|
- if (DealWO(ua, omodel, "", "", 4))
|
|
|
815
|
+ if (DealWO(User, omodel, "", "", 4))
|
|
828
|
816
|
return Success("操作成功!");
|
|
829
|
817
|
else return Error("工单操作失败!");
|
|
830
|
818
|
}
|
|
|
@@ -839,14 +827,12 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
839
|
827
|
/// <returns></returns>
|
|
840
|
828
|
public ActionResult FeachDrug(int woid)
|
|
841
|
829
|
{
|
|
842
|
|
- string uacode = "6001";
|
|
843
|
|
- var ua = userbll.GetModel(uacode);
|
|
844
|
830
|
if (woid == 0)
|
|
845
|
831
|
return Error("工单编号错误!");
|
|
846
|
832
|
var omodel = orderbll.GetModel(woid);
|
|
847
|
833
|
if (omodel != null)
|
|
848
|
834
|
{
|
|
849
|
|
- if (DealWO(ua, omodel, "", "", 5))
|
|
|
835
|
+ if (DealWO(User, omodel, "", "", 5))
|
|
850
|
836
|
return Success("操作成功!");
|
|
851
|
837
|
else return Error("工单操作失败!");
|
|
852
|
838
|
}
|
|
|
@@ -861,15 +847,13 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
861
|
847
|
/// <param name="woid"></param>
|
|
862
|
848
|
/// <returns></returns>
|
|
863
|
849
|
public ActionResult TakeBlood(int woid)
|
|
864
|
|
- {
|
|
865
|
|
- string uacode = "6001";
|
|
866
|
|
- var ua = userbll.GetModel(uacode);
|
|
|
850
|
+ {
|
|
867
|
851
|
if (woid == 0)
|
|
868
|
852
|
return Error("工单编号错误!");
|
|
869
|
853
|
var omodel = orderbll.GetModel(woid);
|
|
870
|
854
|
if (omodel != null)
|
|
871
|
855
|
{
|
|
872
|
|
- if (DealWO(ua, omodel, "", "", 6))
|
|
|
856
|
+ if (DealWO(User, omodel, "", "", 6))
|
|
873
|
857
|
return Success("操作成功!");
|
|
874
|
858
|
else return Error("工单操作失败!");
|
|
875
|
859
|
}
|
|
|
@@ -882,15 +866,13 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
882
|
866
|
/// <param name="woid"></param>
|
|
883
|
867
|
/// <returns></returns>
|
|
884
|
868
|
public ActionResult SendTo(int woid)
|
|
885
|
|
- {
|
|
886
|
|
- string uacode = "6001";
|
|
887
|
|
- var ua = userbll.GetModel(uacode);
|
|
|
869
|
+ {
|
|
888
|
870
|
if (woid == 0)
|
|
889
|
871
|
return Error("工单编号错误!");
|
|
890
|
872
|
var omodel = orderbll.GetModel(woid);
|
|
891
|
873
|
if (omodel != null)
|
|
892
|
874
|
{
|
|
893
|
|
- if (DealWO(ua, omodel, "", "", 7))
|
|
|
875
|
+ if (DealWO(User, omodel, "", "", 7))
|
|
894
|
876
|
return Success("操作成功!");
|
|
895
|
877
|
else return Error("工单操作失败!");
|
|
896
|
878
|
}
|
|
|
@@ -904,14 +886,12 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
904
|
886
|
/// <returns></returns>
|
|
905
|
887
|
public ActionResult ServiceWo(int woid)
|
|
906
|
888
|
{
|
|
907
|
|
- string uacode = "6001";
|
|
908
|
|
- var ua = userbll.GetModel(uacode);
|
|
909
|
889
|
if (woid == 0)
|
|
910
|
890
|
return Error("工单编号错误!");
|
|
911
|
891
|
var omodel = orderbll.GetModel(woid);
|
|
912
|
892
|
if (omodel != null)
|
|
913
|
893
|
{
|
|
914
|
|
- if (DealWO(ua, omodel, "", "", 3))
|
|
|
894
|
+ if (DealWO(User, omodel, "", "", 3))
|
|
915
|
895
|
return Success("操作成功!");
|
|
916
|
896
|
else return Error("工单操作失败!");
|
|
917
|
897
|
}
|
|
|
@@ -926,8 +906,6 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
926
|
906
|
/// <returns></returns>
|
|
927
|
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
|
909
|
if (woid == 0)
|
|
932
|
910
|
return Error("工单编号错误!");
|
|
933
|
911
|
if (string.IsNullOrEmpty(sureman))
|
|
|
@@ -938,9 +916,9 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
|
|
938
|
916
|
var omodel = orderbll.GetModel(woid);
|
|
939
|
917
|
if (omodel != null)
|
|
940
|
918
|
{
|
|
941
|
|
- if (omodel.F_CreateCode != usercode)
|
|
|
919
|
+ if (omodel.F_CreateCode != User.F_UserCode)
|
|
942
|
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
|
922
|
//if (DealWO(ua, omodel, "", "", 6))
|
|
945
|
923
|
if (n > 0)
|
|
946
|
924
|
{
|