zhupei 4 anni fa
parent
commit
4ebe5f0ce4

+ 4 - 4
RMYY_CallCenter_Api.Dal/T_Dis_WorkOrder.cs

@@ -619,8 +619,8 @@ namespace RMYY_CallCenter_Api.Dal
619 619
         {
620 620
             StringBuilder strSql = new StringBuilder();
621 621
             strSql.Append($"select ");
622
-            strSql.Append($"F_WorkOrderCode,case isnull(F_Type,0) when 6 then '急查标本配送'end,F_ItemContents,F_ControlManName+'('+F_ControlManCode+')'as F_ControlMan, ");
623
-            strSql.Append($" F_Source,F_ProposerDeptName, F_ProposerName, F_BedPosition,F_CreateTime, '综合保障中心'as F_TransDept,F_TransPerson,F_Remark");
622
+            strSql.Append($"F_WorkOrderCode,'急查标本配送',F_ItemContents,F_ControlManName+'('+F_ControlManCode+')'as F_ControlMan, ");
623
+            strSql.Append($" F_Source,F_ProposerDeptName, F_ProposerName,F_SendDeptName,F_CreateTime, '综合保障中心'as F_TransDept,F_TransPerson,F_Remark");
624 624
             strSql.Append($" from T_Dis_WorkOrder");
625 625
             if (strWhere.Trim() != "")
626 626
             {
@@ -632,7 +632,7 @@ namespace RMYY_CallCenter_Api.Dal
632 632
         {
633 633
             StringBuilder strSql = new StringBuilder();
634 634
             strSql.Append($"select ");
635
-            strSql.Append($"F_WorkOrderCode,case isnull(F_Type,0) when 7 then '血液制品配送'end,F_ProposerDeptName,F_ItemContents,F_ProposerPhon,F_ProposerName,F_Source,F_SendDeptName,");
635
+            strSql.Append($"F_WorkOrderCode,'血液制品配送',F_ProposerDeptName,F_ItemContents,F_ProposerPhon,F_ProposerName,F_Source,F_SendDeptName,");
636 636
             strSql.Append($" F_ControlManName+'('+F_ControlManCode+')'as F_ControlMan,F_CreateTime, '综合保障中心'as F_TransDept,F_TransPerson,F_Remark");
637 637
             strSql.Append($" from T_Dis_WorkOrder");
638 638
             if (strWhere.Trim() != "")
@@ -646,7 +646,7 @@ namespace RMYY_CallCenter_Api.Dal
646 646
         {
647 647
             StringBuilder strSql = new StringBuilder();
648 648
             strSql.Append($"select ");
649
-            strSql.Append($"F_WorkOrderCode,F_ProposerDeptName,F_ProposerName,F_ProposerPhon,case isnull(F_Type,0) when 4 then '红处方配送'end,F_ItemContents,");
649
+            strSql.Append($"F_WorkOrderCode,F_ProposerDeptName,F_ProposerName,F_ProposerPhon,'红处方配送',F_ItemContents,");
650 650
             strSql.Append($" F_ControlManName+'('+F_ControlManCode+')'as F_ControlMan,F_CreateTime, '综合保障中心'as F_TransDept,F_TransPerson,F_Remark");
651 651
             strSql.Append($" from T_Dis_WorkOrder");
652 652
             if (strWhere.Trim() != "")

+ 12 - 1
RMYY_CallCenter_Api.Model/T_Dis_WorkOrder.cs

@@ -392,6 +392,11 @@ namespace RMYY_CallCenter_Api.Model
392 392
         /// 工单状态
393 393
         /// </summary>
394 394
         public string F_Wostate { get; set; }
395
+
396
+        /// <summary>
397
+        /// 工单类型名称
398
+        /// </summary>
399
+        public string F_TypeName { get; set; }
395 400
         /// <summary>
396 401
         /// 坐席
397 402
         /// </summary>
@@ -406,7 +411,13 @@ namespace RMYY_CallCenter_Api.Model
406 411
         /// <summary>
407 412
         /// 角色编码
408 413
         /// </summary>
409
-        public string  rolecode{get;set;}
414
+        public string rolecode { get; set; }
415
+        /// <summary>
416
+        /// 红处方图片
417
+        /// </summary>
418
+        public string RedPic { get; set; }
419
+
420
+        //public List<button> buttons { get; set; }
410 421
         #endregion
411 422
 
412 423
     }

+ 1 - 1
RMYY_CallCenter_Api.Utility/Helper/ImageHelper.cs

@@ -213,7 +213,7 @@ namespace RMYY_CallCenter_Api.Utility
213 213
             if (_SaveType == 0 || _InFileName.Trim() == "")
214 214
                 return "(" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ")" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + Ext;
215 215
             else
216
-                return "(" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ")" + _InFileName + Ext;
216
+                return "(" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ")" + _InFileName;
217 217
         }
218 218
 
219 219
         /// <summary>

+ 148 - 1
RMYY_CallCenter_Api.Utility/Helper/NPOIHelper.cs

@@ -23,7 +23,7 @@ namespace RMYY_CallCenter_Api.Utility
23 23
         /// <param name="Name"></param>
24 24
         /// <param name="dt"></param>
25 25
         /// <returns></returns>
26
-        public string ExportToExcel(string Name, DataTable dt, string[] cols = null)
26
+        public string ExportToExcel2(string Name, DataTable dt, string[] cols = null)
27 27
         {
28 28
             try
29 29
             {
@@ -147,6 +147,153 @@ namespace RMYY_CallCenter_Api.Utility
147 147
             }
148 148
         }
149 149
 
150
+
151
+        /// <summary>
152
+        /// 弹出下载框导出excel
153
+        /// </summary>
154
+        /// <param name="Name"></param>
155
+        /// <param name="dt"></param>
156
+        /// <returns></returns>
157
+        public string ExportToExcel(string Name, DataTable dt, string[] cols = null, int issort = 0)
158
+        {
159
+            try
160
+            {
161
+                //if (dt.Rows.Count > 0)
162
+                //{
163
+                HSSFWorkbook workbook = new HSSFWorkbook();
164
+                ISheet sheet = workbook.CreateSheet(Name);
165
+
166
+                ICellStyle HeadercellStyle = workbook.CreateCellStyle();
167
+                HeadercellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
168
+                HeadercellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
169
+                HeadercellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
170
+                HeadercellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
171
+                HeadercellStyle.Alignment = HorizontalAlignment.Center;
172
+                HeadercellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.SkyBlue.Index;
173
+                HeadercellStyle.FillPattern = FillPattern.SolidForeground;
174
+                HeadercellStyle.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.SkyBlue.Index;
175
+
176
+                //字体
177
+                NPOI.SS.UserModel.IFont headerfont = workbook.CreateFont();
178
+                headerfont.Boldweight = (short)FontBoldWeight.Bold;
179
+                headerfont.FontHeightInPoints = 12;
180
+                HeadercellStyle.SetFont(headerfont);
181
+
182
+
183
+                //用column name 作为列名
184
+                int icolIndex = 0;
185
+                IRow headerRow = sheet.CreateRow(0);
186
+
187
+                if (issort == 1)
188
+                {
189
+                    ICell cell = headerRow.CreateCell(icolIndex);
190
+                    cell.SetCellValue("序号");
191
+                    cell.CellStyle = HeadercellStyle;
192
+                    icolIndex++;
193
+                }
194
+
195
+                if (cols == null || (cols != null && cols.Length == 0))
196
+                {
197
+                    foreach (DataColumn dc in dt.Columns)
198
+                    {
199
+                        ICell cell = headerRow.CreateCell(icolIndex);
200
+                        cell.SetCellValue(dc.ColumnName);
201
+                        cell.CellStyle = HeadercellStyle;
202
+                        icolIndex++;
203
+                    }
204
+                }
205
+                else
206
+                {
207
+                    foreach (string dc in cols)
208
+                    {
209
+                        ICell cell = headerRow.CreateCell(icolIndex);
210
+                        cell.SetCellValue(dc);
211
+                        cell.CellStyle = HeadercellStyle;
212
+                        icolIndex++;
213
+                    }
214
+                }
215
+                ICellStyle cellStyle = workbook.CreateCellStyle();
216
+
217
+                //为避免日期格式被Excel自动替换,所以设定 format 为 『@』 表示一率当成text來看
218
+                cellStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat("@");
219
+                cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
220
+                cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
221
+                cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
222
+                cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
223
+
224
+
225
+                NPOI.SS.UserModel.IFont cellfont = workbook.CreateFont();
226
+                cellfont.Boldweight = (short)FontBoldWeight.Normal;
227
+                cellStyle.SetFont(cellfont);
228
+
229
+                //建立内容行
230
+                int iRowIndex = 0;
231
+                foreach (DataRow dr in dt.Rows)
232
+                {
233
+                    int iCellIndex = 0;
234
+                    IRow irow = sheet.CreateRow(iRowIndex + 1);
235
+
236
+                    if (issort == 1)
237
+                    {
238
+                        ICell cell = irow.CreateCell(iCellIndex);
239
+                        cell.SetCellValue(iRowIndex + 1);
240
+                        cell.CellStyle = cellStyle;
241
+                        iCellIndex++;
242
+                    }
243
+                    for (int i = 0; i < dt.Columns.Count; i++)
244
+                    {
245
+                        string strsj = string.Empty;
246
+                        if (dr[i] != null)
247
+                        {
248
+                            strsj = dr[i].ToString();
249
+                        }
250
+                        ICell cell = irow.CreateCell(iCellIndex);
251
+                        cell.SetCellValue(strsj);
252
+                        cell.CellStyle = cellStyle;
253
+                        iCellIndex++;
254
+                    }
255
+                    iRowIndex++;
256
+                }
257
+
258
+                //自适应列宽度
259
+                for (int i = 0; i < icolIndex; i++)
260
+                {
261
+                    sheet.AutoSizeColumn(i);
262
+                }
263
+
264
+                using (MemoryStream ms = new MemoryStream())
265
+                {
266
+                    workbook.Write(ms);
267
+
268
+                    HttpContext curContext = HttpContext.Current;
269
+
270
+
271
+                    // 设置编码和附件格式
272
+                    curContext.Response.ContentType = "application/vnd.ms-excel"; //指定返回的是一个不能被客户端读取的流,必须被下载
273
+                    curContext.Response.ContentEncoding = Encoding.UTF8;
274
+                    curContext.Response.Charset = "";
275
+                    curContext.Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
276
+                    curContext.Response.AppendHeader("Content-Disposition",
277
+                        "attachment;filename=" + HttpUtility.UrlEncode(Name + "_导出文件_" + DateTime.Now.Ticks + ".xls", Encoding.UTF8));
278
+
279
+                    curContext.Response.BinaryWrite(ms.GetBuffer());
280
+
281
+                    workbook = null;
282
+                    ms.Close();
283
+                    ms.Dispose();
284
+
285
+                    curContext.Response.End();
286
+                }
287
+                //}
288
+                return "";
289
+            }
290
+            catch
291
+            {
292
+                return "导出失败!";
293
+            }
294
+        }
295
+
296
+
150 297
         /// <summary>
151 298
         /// 导入excel转换为datatable
152 299
         /// </summary>

+ 14 - 0
RMYY_CallCenter_Api/Controllers/HomeController.cs

@@ -18,6 +18,20 @@ namespace RMYY_CallCenter_Api.Controllers
18 18
             return Content("hello world!");
19 19
         }
20 20
 
21
+        public ActionResult Daochu()
22
+        {
23
+            DataTable dt = new DataTable();
24
+            dt.Columns.Add("code");
25
+            dt.Columns.Add("name");
26
+            DataRow dr = dt.NewRow();
27
+            dr["code"] = "asd";
28
+            dr["name"] = "咋说";
29
+            dt.Rows.Add(dr);
30
+
31
+            new NPOIHelper().ExportToExcel2("123", dt);
32
+            return Content("hello world!");
33
+        }
34
+
21 35
         /// <summary>
22 36
         /// 登录
23 37
         /// </summary>

+ 1 - 1
RMYY_CallCenter_Api/Controllers/System/CustomerController.cs

@@ -31,7 +31,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
31 31
 
32 32
             if (isdc > 0)
33 33
             {
34
-                var dtdc = DB.DbHelperSQL.Query(" F_CustomerName 联系人姓名,F_Mobile 联系人电话,F_Email 邮箱,F_Address 地址"
34
+                var dtdc = DB.DbHelperSQL.Query("SELECT F_CustomerName 联系人姓名,F_Mobile 联系人电话,F_Email 邮箱,F_Address 地址"
35 35
                  + " from T_Cus_Customer a WITH(NOLOCK) where 1=1 " + sql).Tables[0];
36 36
                 var msg = new NPOIHelper().ExportToExcel("市民资料", dtdc);
37 37
                 if (msg == "")

+ 121 - 66
RMYY_CallCenter_Api/Controllers/WorkOrder/T_Dis_WorkOrderController.cs

@@ -7,6 +7,7 @@ using System.Web;
7 7
 using System.Web.Mvc;
8 8
 using RMYY_CallCenter_Api.Utility;
9 9
 using RMYY_CallCenter_Api.Models.Dto;
10
+using RMYY_CallCenter_Api.Models;
10 11
 
11 12
 namespace RMYY_CallCenter_Api.Controllers.WorkOrder
12 13
 {
@@ -26,7 +27,7 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
26 27
         /// <param name="pagesize"></param>
27 28
         /// <param name="state"></param>
28 29
         /// <returns></returns>
29
-        public ActionResult GetList(string keyword,int type=0, string starttime = "", string endtime = "", int pageindex = 1, int pagesize = 10, int state = -1)
30
+        public ActionResult GetList(string keyword,int type=0, string starttime = "", string endtime = "", int pageindex = 1, int pagesize = 10, int state = -1, int isdc = 0)
30 31
         {
31 32
             if (User != null)
32 33
             {
@@ -86,55 +87,73 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
86 87
                         sql += $" and F_Id in (0)";
87 88
                     }
88 89
                 }
89
-                #endregion
90
-                int recordCount = 0;
91
-                if (!string.IsNullOrEmpty(sql))
90
+                if (isdc > 0)
92 91
                 {
93
-                    data = Bll.PagerBll.GetListPager
94
-                        (
95
-                        "T_Dis_WorkOrder aa",
96
-                        "F_Id",
97
-                        "*",
98
-                        sql,
99
-                        "ORDER BY F_Id desc",
100
-                        pagesize,
101
-                        pageindex,
102
-                        true,
103
-                        out recordCount
104
-                        );
92
+                    if (GetListExpt(sql, type))
93
+                        return Success("导出成功!");
94
+                    else return Error("导出失败!");
105 95
                 }
106
-                var modellist = orderbll.DataTableToList(data);
107
-                if (modellist.Count > 0)
96
+                else
108 97
                 {
109
-                    //if (wokerlist.Count > 0 || User.F_UserCode== "ZYY")
110
-                    //{
111
-                    foreach (var item in modellist)
98
+                    #endregion
99
+                    int recordCount = 0;
100
+                    if (!string.IsNullOrEmpty(sql))
112 101
                     {
113
-                        if (wokerlist.Count > 0 || User.F_RoleCode == "ZYY")
114
-                        {
115
-                            item.F_Wostate = GetWoStateName(item.F_Id, User.F_UserCode);
116
-                        }
117
-                        else
118
-                        {
119
-                            item.F_Wostate = EnumHelper.GetDescription((EnumDisWorkOrderState)item.F_State);
120
-                        }
121
-                        item.F_SitMan = item.F_ControlManName + '(' + item.F_ControlManCode + ')';
122
-                        if (type == (int)EnumWorkOrder.UrgDis)
102
+                        data = Bll.PagerBll.GetListPager
103
+                            (
104
+                            "T_Dis_WorkOrder aa",
105
+                            "F_Id",
106
+                            "*",
107
+                            sql,
108
+                            "ORDER BY F_Id desc",
109
+                            pagesize,
110
+                            pageindex,
111
+                            true,
112
+                            out recordCount
113
+                            );
114
+                    }
115
+                    var modellist = orderbll.DataTableToList(data);
116
+                    if (modellist.Count > 0)
117
+                    {
118
+                        //if (wokerlist.Count > 0 || User.F_UserCode== "ZYY")
119
+                        //{
120
+                        foreach (var item in modellist)
123 121
                         {
124
-                            item.dislist = orderbll.GetModelList("datediff(second,F_CreateTime,'" + item.F_CreateTime + "')=0  and F_Id!=" + item.F_Id + "");
125
-                        }
126
-                        item.rolecode = User.F_RoleCode;
127 122
 
123
+                            if (wokerlist.Count > 0 || User.F_RoleCode == "ZYY")
124
+                            {
125
+                                item.F_Wostate = GetWoStateName(item.F_Id, User.F_UserCode);
126
+                            }
127
+                            else
128
+                            {
129
+                                item.F_Wostate = EnumHelper.GetDescription((EnumDisWorkOrderState)item.F_State);
130
+                            }
131
+                            item.F_SitMan = item.F_ControlManName + '(' + item.F_ControlManCode + ')';
132
+                            if (type == (int)EnumWorkOrder.UrgDis)
133
+                            {
134
+                                item.dislist = orderbll.GetModelList("datediff(second,F_CreateTime,'" + item.F_CreateTime + "')=0  and F_Id!=" + item.F_Id + "");
135
+                            }
136
+                            if (type == (int)EnumWorkOrder.RedDis)
137
+                            {
138
+
139
+                                item.RedPic = GetRedPics(item.F_ItemMessages);
140
+
141
+                            }
142
+                            item.rolecode = User.F_RoleCode;
143
+                            item.F_TypeName = GetTypeName(type);
144
+                            //var buttons = ButtonGroup.GetButtons(item.F_State, User.F_RoleCode, item.F_Type);
145
+
146
+                        }
128 147
                     }
148
+                    var obj = new
149
+                    {
150
+                        state = "success",
151
+                        message = "成功",
152
+                        rows = modellist,
153
+                        total = recordCount
154
+                    };
155
+                    return Content(obj.ToJson());
129 156
                 }
130
-                var obj = new
131
-                {
132
-                    state = "success",
133
-                    message = "成功",
134
-                    rows = modellist,
135
-                    total = recordCount
136
-                };
137
-                return Content(obj.ToJson());
138 157
             }
139 158
            return Error("无操作权限!");
140 159
         }
@@ -203,6 +222,55 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
203 222
 
204 223
 
205 224
         /// <summary>
225
+        /// 获取工单类型名称
226
+        /// </summary>
227
+        /// <returns></returns>
228
+        public string  GetTypeName(int type)
229
+        {
230
+            string name = "";
231
+            switch (type)
232
+            {
233
+                case (int)EnumWorkOrder.RedDis:
234
+                    name= "红处方配送";
235
+                    break;
236
+                case (int)EnumWorkOrder.OrtherDis:
237
+                    name= "其他配送";
238
+                    break;
239
+                case (int)EnumWorkOrder.UrgDis:
240
+                    name= "急标本配送";
241
+                    break;
242
+                case (int)EnumWorkOrder.BloodDis:
243
+                    name= "血液制品配送";
244
+                    break;
245
+            }
246
+            return name;
247
+        }
248
+
249
+        /// <summary>
250
+        /// 获取图片路径
251
+        /// </summary>
252
+        /// <param name="ids"></param>
253
+        /// <returns></returns>
254
+
255
+        public string GetRedPics(string ids)
256
+        {
257
+            string  PicPath = "";
258
+            if (!string.IsNullOrEmpty(ids))
259
+            {
260
+                var modelist = new Bll.T_Sys_Accessories().GetModelList(" F_FileId in (" + ids.Trim(',') + ")");
261
+                if (modelist.Count > 0)
262
+                {
263
+                    foreach (var item in modelist)
264
+                    {
265
+                        PicPath = PicPath + item.F_FileUrl + ",";
266
+                    }
267
+                }
268
+            }
269
+            return PicPath.Trim(',');
270
+        }
271
+
272
+
273
+        /// <summary>
206 274
         /// 获取工单详情
207 275
         /// </summary>
208 276
         /// <param name="id"></param>
@@ -222,6 +290,10 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
222 290
                 model.HosName = new Bll.T_Wowo_repairyqbll().GetModel(model.F_HosId??0).T_Woname;
223 291
                 model.dislist= orderbll.GetModelList("datediff(second,F_CreateTime,'" + model.F_CreateTime + "')=0  and F_Id!=" + model.F_Id + "");
224 292
                 model.F_Wostate = EnumHelper.GetDescription((EnumDisWorkOrderState)model.F_State);
293
+                if (model.F_Type == (int)EnumWorkOrder.RedDis)
294
+                {
295
+                    model.RedPic = GetRedPics(model.F_ItemMessages);
296
+                }
225 297
                 var obj = new
226 298
                 {
227 299
                     state = "success",
@@ -242,38 +314,21 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
242 314
         /// <param name="starttime"></param>
243 315
         /// <param name="endtime"></param>
244 316
         /// <returns></returns>
245
-        public ActionResult GetListExpt(int type,string keyword, string starttime = "", string endtime = "", int state = -1)
317
+        public bool GetListExpt(string sql,int  type)
246 318
         {
247
-            if (User != null)
248
-            {
249 319
                 #region 查询条件
250 320
                 if (type != (int)EnumWorkOrder.OrtherDis && type != (int)EnumWorkOrder.UrgDis && type != (int)EnumWorkOrder.RedDis && type != (int)EnumWorkOrder.BloodDis)
251
-                    return Error("工单类型错误!");
252
-                string sql = $" and F_IsDel=0 and F_Type=" + type;
253
-                DataTable data = new DataTable();
254
-                if (starttime.Trim() != "" && starttime != "undefined")
255
-                    sql += $" and datediff(day,F_CreateTime,'" + starttime + "') <=0 ";
256
-                if (endtime.Trim() != "" && endtime != "undefined")
257
-                    sql += $" and datediff(day,F_CreateTime,'" + endtime + "')>=0";
258
-                if (!string.IsNullOrEmpty(keyword))
259
-                {
260
-                    sql += $"and (F_WorkOrderCode like '%" + keyword.Trim() + "%' or F_ProposerCode like '%" + keyword.Trim() + "%' or F_ProposerPhon like '%" + keyword.Trim() + "%')";
261
-                }
262
-                if (state >= 0)
263
-                {
264
-                    sql += $"and F_State=" + state;
265
-                }
321
+                    return false;            
322
+                DataTable data = new DataTable();             
266 323
                 #endregion
267 324
 
268 325
                 NPOIHelper nopi = new NPOIHelper();
269 326
                 data = GetData(type,sql);
270 327
                 if (nopi.ExportToExcel(GetExportTitle(type), data, col(type)) == "")
271 328
                 {
272
-                    return Success("导出成功!");
329
+                    return true;
273 330
                 }
274
-                else return Error("导出失败!");
275
-            }
276
-            return Error("无操作权限!");
331
+                else return false;
277 332
         }
278 333
 
279 334
 
@@ -525,8 +580,8 @@ namespace RMYY_CallCenter_Api.Controllers.WorkOrder
525 580
                     for (int i = 0; i < _list.Length; i++)
526 581
                     {
527 582
                         string[] _temp = _list[i].Split('-');
528
-                        string itemess = _temp[0];
529
-                        int sendeptid = Convert.ToInt32(_temp[1]);
583
+                        int sendeptid = Convert.ToInt32(_temp[0]);
584
+                        string itemess = _temp[1];
530 585
                         int num = Convert.ToInt32(_temp[2]);
531 586
                         string sendepatname = "";
532 587
                         try { sendepatname = dptbll.GetModel(sendeptid).F_DeptName; }

+ 20 - 8
RMYY_CallCenter_Api/Controllers/WorkOrderBaseController.cs

@@ -271,13 +271,20 @@ namespace RMYY_CallCenter_Api.Controllers
271 271
         {
272 272
             string path = string.Empty;
273 273
             //HttpPostedFile _upfile = RequestString.GetFile("upFile");
274
-            string dataurl = HttpUtility.UrlDecode(Request.Form["dataurl"]);
274
+            string dataurl = HttpUtility.UrlDecode(Request["dataurl"]);
275
+            string filename = Request["filename"];
275 276
             if (!string.IsNullOrEmpty(dataurl))
276 277
             {
277 278
                 path = "/Upload/Pic/" + DateTime.Now.ToString("yyyy") + "/" + DateTime.Now.ToString("MM") + "/" + DateTime.Now.ToString("dd") + "/";
278 279
                 ImageHelper iu = new ImageHelper();
279 280
                 iu.SavePath = path;
280 281
                 iu.DataUrl = dataurl;
282
+                if (!string.IsNullOrEmpty(filename))
283
+                {
284
+
285
+                    iu.SaveType = 1;
286
+                    iu.InFileName = filename;
287
+                }
281 288
                 iu.Upload64();
282 289
 
283 290
                 //var configfj = new Bll.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
@@ -285,14 +292,19 @@ namespace RMYY_CallCenter_Api.Controllers
285 292
                 int n = iu.Error;
286 293
                 if (n == 0)
287 294
                 {
288
-                    var obj = new
289
-                    {
290
-                        //ym = configfj != null ? configfj.F_ParamValue : "",
291
-                        imgurl = path + iu.OutFileName,
292
-                        smallimgurl = path + iu.OutThumbFileName
293
-                    };
295
+                    path = path + iu.OutFileName;
296
+
297
+                    Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
298
+                    model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
299
+                    model_T_Sys_Accessories.F_FileName = iu.OutFileName;//附件名称
300
+                    model_T_Sys_Accessories.F_FileType = ".jpg";//附件类型
301
+                    model_T_Sys_Accessories.F_FileUrl = path;//附件地址
302
+                    model_T_Sys_Accessories.F_Size = iu.FileSize;
303
+                    //model_T_Sys_Accessories.F_UserCode = User.F_UserCode;//上传人  
304
+                    int id = new Bll.T_Sys_Accessories().Add(model_T_Sys_Accessories);
305
+                    model_T_Sys_Accessories.F_FileId = id;
294 306
 
295
-                    return Success("成功", obj);
307
+                    return Success("成功", model_T_Sys_Accessories);
296 308
                 }
297 309
                 else
298 310
                 {

+ 1 - 0
RMYY_CallCenter_Api/RMYY_CallCenter_Api.csproj

@@ -159,6 +159,7 @@
159 159
     <Compile Include="Global.asax.cs">
160 160
       <DependentUpon>Global.asax</DependentUpon>
161 161
     </Compile>
162
+    <Compile Include="Models\ButtonGroup.cs" />
162 163
     <Compile Include="Models\Dto\TotalWorkeOrderDto.cs" />
163 164
     <Compile Include="Models\Dto\TypeState.cs" />
164 165
     <Compile Include="Models\Enum\EnumAccWorkOrderState.cs" />