|
|
@@ -44,7 +44,9 @@ namespace RMYY_CallCenter_Api.Controllers.System
|
|
44
|
44
|
true,
|
|
45
|
45
|
out recordCount
|
|
46
|
46
|
);
|
|
47
|
|
-
|
|
|
47
|
+ data.Columns.Add("F_StateName", typeof(string));//工单状态名称
|
|
|
48
|
+ data.Columns.Add("F_WoTypeName", typeof(string));//工单类型名称
|
|
|
49
|
+ data.Columns.Add("F_MenuName", typeof(string));//功能模块名称
|
|
48
|
50
|
foreach (DataRow dr in data.Rows)
|
|
49
|
51
|
{
|
|
50
|
52
|
string state = dr["F_State"] != null ? dr["F_State"].ToString() : "";
|
|
|
@@ -53,6 +55,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
|
|
53
|
55
|
{
|
|
54
|
56
|
dr["F_StateName"] = WorkOrderBase.GetTypeState(wotype).Where(t=>t.StateId==state).FirstOrDefault().StateRemark;
|
|
55
|
57
|
dr["F_WoTypeName"] = gdbll.GetModel(Convert.ToInt32(dr["F_Type"])).F_Name;
|
|
|
58
|
+ dr["F_MenuName"] = menubll.GetModel(Convert.ToInt32(dr["F_MenuId"])).F_MenuName;
|
|
56
|
59
|
}
|
|
57
|
60
|
}
|
|
58
|
61
|
|
|
|
@@ -68,5 +71,81 @@ namespace RMYY_CallCenter_Api.Controllers.System
|
|
68
|
71
|
}
|
|
69
|
72
|
return Error("无操作权限!");
|
|
70
|
73
|
}
|
|
|
74
|
+
|
|
|
75
|
+ /// <summary>
|
|
|
76
|
+ /// 获取详情
|
|
|
77
|
+ /// </summary>
|
|
|
78
|
+ /// <returns></returns>
|
|
|
79
|
+ public ActionResult GetModel(int id)
|
|
|
80
|
+ {
|
|
|
81
|
+ if (id < 0)
|
|
|
82
|
+ return Error("参数错误!");
|
|
|
83
|
+ var model = optbll.GetModel(id);
|
|
|
84
|
+ if (model != null)
|
|
|
85
|
+ {
|
|
|
86
|
+ model.F_StateName = WorkOrderBase.GetTypeState(Convert.ToInt32(model.F_Type)).Where(t => t.StateId == model.F_State.ToString()).FirstOrDefault().StateRemark;
|
|
|
87
|
+ model.F_WoTypeName= gdbll.GetModel(Convert.ToInt32(model.F_Type)).F_Name;
|
|
|
88
|
+ model.F_MenuName = menubll.GetModel(Convert.ToInt32(model.F_MenuId)).F_MenuName;
|
|
|
89
|
+ return Content(model.ToJson());
|
|
|
90
|
+
|
|
|
91
|
+ }
|
|
|
92
|
+ else
|
|
|
93
|
+ return Error("查询失败!");
|
|
|
94
|
+ }
|
|
|
95
|
+ /// <summary>
|
|
|
96
|
+ /// 添加修改
|
|
|
97
|
+ /// </summary>
|
|
|
98
|
+ /// <param name="state"></param>
|
|
|
99
|
+ /// <param name="type"></param>
|
|
|
100
|
+ /// <param name="menuid"></param>
|
|
|
101
|
+ /// <param name="id"></param>
|
|
|
102
|
+ /// <returns></returns>
|
|
|
103
|
+ public ActionResult AddModel(int state,int type,int menuid,int id=0)
|
|
|
104
|
+ {
|
|
|
105
|
+ if (state == 0)
|
|
|
106
|
+ return Error("请选择工单状态!");
|
|
|
107
|
+ if(type==0)
|
|
|
108
|
+ return Error("请选择工单类型!");
|
|
|
109
|
+ if (menuid == 0)
|
|
|
110
|
+ return Error("请选择操作按钮!");
|
|
|
111
|
+ if (id > 0)
|
|
|
112
|
+ {
|
|
|
113
|
+ var optmodel = optbll.GetModel(id);
|
|
|
114
|
+ optmodel.F_State = state;
|
|
|
115
|
+ optmodel.F_Type = type;
|
|
|
116
|
+ optmodel.F_MenuId = menuid;
|
|
|
117
|
+ optbll.Update(optmodel);
|
|
|
118
|
+ return Success("修改成功!");
|
|
|
119
|
+ }
|
|
|
120
|
+ else
|
|
|
121
|
+ {
|
|
|
122
|
+ Model.T_Wo_StatusOpt optmodel = new Model.T_Wo_StatusOpt();
|
|
|
123
|
+ optmodel.F_State = state;
|
|
|
124
|
+ optmodel.F_Type = type;
|
|
|
125
|
+ optmodel.F_MenuId = menuid;
|
|
|
126
|
+ optbll.Add(optmodel);
|
|
|
127
|
+ return Success("添加成功!");
|
|
|
128
|
+ }
|
|
|
129
|
+ }
|
|
|
130
|
+
|
|
|
131
|
+ /// <summary>
|
|
|
132
|
+ /// 删除
|
|
|
133
|
+ /// </summary>
|
|
|
134
|
+ /// <param name="ids"></param>
|
|
|
135
|
+ /// <returns></returns>
|
|
|
136
|
+ public ActionResult Delete(string[] ids)
|
|
|
137
|
+ {
|
|
|
138
|
+ if (ids != null && ids.Length > 0)
|
|
|
139
|
+ {
|
|
|
140
|
+ string idstr = string.Join(",", ids);
|
|
|
141
|
+ if (optbll.DeleteList(idstr))
|
|
|
142
|
+ return Success("删除成功!");
|
|
|
143
|
+ else return Error("删除失败!");
|
|
|
144
|
+ }
|
|
|
145
|
+ else
|
|
|
146
|
+ {
|
|
|
147
|
+ return Error("请选择要删除的记录");
|
|
|
148
|
+ }
|
|
|
149
|
+ }
|
|
71
|
150
|
}
|
|
72
|
151
|
}
|