1550076451 1 年間 前
コミット
3f5b950b8d

+ 18 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -98,7 +98,7 @@ namespace CallCenterApi.Interface.Controllers
98 98
                         F_PId = x.F_PId,
99 99
                         F_TmId = x.F_TmId,
100 100
                         F_RoleName = x.F_RoleName,
101
-                        F_DeptName = x.F_DeptName,
101
+                        F_DeptName = GetDeptName(x.F_DeptId),
102 102
                         F_WorkNumber = x.F_WorkNumber,
103 103
                         //F_WXNo=x.F_WXNo,
104 104
                         F_AreaName = GetModelDeptName(x.F_DeptId),
@@ -138,6 +138,23 @@ namespace CallCenterApi.Interface.Controllers
138 138
             }
139 139
             return str;
140 140
         }
141
+        public string GetDeptName(int deptid)
142
+        {
143
+            string deptname = "";
144
+            string sql = " select(select  stuff((select '|' + F_DeptName from T_Sys_Department  where F_DeptId   in " +
145
+                "  (select col from dbo.SplitToNvarchar(a.F_DeptCode, '|')  ) for xml path('')),1,1,''))  deptname" +
146
+                $" from T_Sys_Department a where F_DeptId={deptid}";
147
+            object ob = DbHelperSQL.GetSingle(sql.ToString());
148
+            if (ob != null)
149
+            {
150
+                deptname = ob.ToString();
151
+                if (deptname.Contains("河南心连心化学工业集团股份有限公司|"))
152
+                {
153
+                    deptname = deptname.Replace("河南心连心化学工业集团股份有限公司|", "");
154
+                }
155
+            }
156
+            return deptname;
157
+        }
141 158
         /// <summary>
142 159
         /// 获取下一个工号
143 160
         /// </summary>

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -6969,7 +6969,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
6969 6969
         /// <returns></returns>
6970 6970
 
6971 6971
         [WechatActionFilter]
6972
-        public ActionResult BackWorkOrder(string OpenId, long orderid, string cont, int type = 0, int inoutflag = 1)
6972
+        public ActionResult BackWorkOrder(string OpenId, long orderid, string cont, int type = 0, int inoutflag = 0)
6973 6973
         {//办理人员和监管可以退回工单
6974 6974
             if (!string.IsNullOrEmpty(OpenId))
6975 6975
             {

+ 10 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -1312,7 +1312,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
1312 1312
                             #endregion
1313 1313
                         }
1314 1314
                         NPOIHelper npoi = new NPOIHelper();
1315
-                        if (npoi.ExportToExcel("工单列表", dt) == "")
1315
+                        string columnName = "实收返厂数量";
1316
+                        int index = dt.Columns.IndexOf(columnName);
1317
+                        int[] array = { index };
1318
+                        if (npoi.ExportToExcel("工单列表", dt,null, array) == "")
1316 1319
                         {
1317 1320
                             return Success("导出成功");
1318 1321
                         }
@@ -4820,7 +4823,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
4820 4823
                             #endregion
4821 4824
                         }
4822 4825
                         NPOIHelper npoi = new NPOIHelper();
4823
-                        if (npoi.ExportToExcel("工单列表", dt) == "")
4826
+                        string columnName = "实收返厂数量";
4827
+                        int index = dt.Columns.IndexOf(columnName);
4828
+                        int[] array = { index };
4829
+                        if (npoi.ExportToExcel("工单列表", dt,null, array) == "")
4824 4830
                         {
4825 4831
                             return Success("导出成功");
4826 4832
                         }
@@ -10468,7 +10474,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
10468 10474
         /// <param name="input"></param>
10469 10475
         /// <returns></returns>
10470 10476
         [Authority]
10471
-        public ActionResult BackWorkOrder(long orderid, string cont, int type = 0, int inoutflag = 1)
10477
+        public ActionResult BackWorkOrder(long orderid, string cont, int type = 0, int inoutflag = 0)
10472 10478
         {//办理人员和监管可以退回工单
10473 10479
             int userId = CurrentUser.UserData.F_UserId;
10474 10480
             if (userId != 0)
@@ -11270,7 +11276,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
11270 11276
                 model.F_Sid = sid;
11271 11277
                 if (!string.IsNullOrEmpty(F_VisitRemarks))
11272 11278
                 {
11273
-                    var VisitRemarks = nowUser.F_UserName + DateTime.Now.ToString("yyyy-MM-dd") + "  "+ F_VisitRemarks;
11279
+                    var VisitRemarks = nowUser.F_UserName+"("+ nowUser .F_WorkNumber+ ")" + DateTime.Now.ToString("yyyy-MM-dd") + "  "+ F_VisitRemarks;
11274 11280
                     model.F_VisitRemarks = VisitRemarks;
11275 11281
                 }
11276 11282
                 workOrder.Update(model);

+ 25 - 2
codegit/CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

@@ -9,6 +9,7 @@ using NPOI.SS.UserModel;
9 9
 using NPOI.SS.Util;
10 10
 using NPOI.XSSF.UserModel;
11 11
 using System.Collections.Generic;
12
+using System.Linq;
12 13
 
13 14
 namespace CallCenter.Utility
14 15
 {
@@ -115,7 +116,8 @@ namespace CallCenter.Utility
115 116
         /// <param name="Name"></param>
116 117
         /// <param name="dt"></param>
117 118
         /// <returns></returns>
118
-        public string ExportToExcel(string Name, DataTable dt, string[] cols = null)
119
+        public string ExportToExcel(string Name, DataTable dt, string[] cols = null
120
+            ,int  [] Format=null)
119 121
         {
120 122
             try
121 123
             {
@@ -151,6 +153,7 @@ namespace CallCenter.Utility
151 153
                         ICell cell = headerRow.CreateCell(icolIndex);
152 154
                         cell.SetCellValue(dc.ColumnName);
153 155
                         cell.CellStyle = HeadercellStyle;
156
+                       
154 157
                         icolIndex++;
155 158
                     }
156 159
                 }
@@ -161,6 +164,7 @@ namespace CallCenter.Utility
161 164
                         ICell cell = headerRow.CreateCell(icolIndex);
162 165
                         cell.SetCellValue(dc);
163 166
                         cell.CellStyle = HeadercellStyle;
167
+
164 168
                         icolIndex++;
165 169
                     }
166 170
                 }
@@ -178,6 +182,17 @@ namespace CallCenter.Utility
178 182
                 cellfont.Boldweight = (short)FontBoldWeight.Normal;
179 183
                 cellStyle.SetFont(cellfont);
180 184
 
185
+
186
+                ICellStyle cellStyle1 = workbook.CreateCellStyle();
187
+
188
+                //为避免日期格式被Excel自动替换,所以设定 format 为 『@』 表示一率当成text來看
189
+                cellStyle1.DataFormat = HSSFDataFormat.GetBuiltinFormat("#,##0.00");
190
+                cellStyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
191
+                cellStyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
192
+                cellStyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
193
+                cellStyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
194
+                cellStyle1.SetFont(cellfont);
195
+
181 196
                 //建立内容行
182 197
                 int iRowIndex = 0;
183 198
                 foreach (DataRow dr in dt.Rows)
@@ -193,7 +208,15 @@ namespace CallCenter.Utility
193 208
                         }
194 209
                         ICell cell = irow.CreateCell(iCellIndex);
195 210
                         cell.SetCellValue(strsj);
196
-                        cell.CellStyle = cellStyle;
211
+                        if (Format!=null&&Array.Exists(Format, element => element == i) )
212
+                        {
213
+                            cell.CellStyle = cellStyle1;
214
+                        }
215
+                        else
216
+                        {
217
+                            cell.CellStyle = cellStyle;
218
+                        }
219
+                        
197 220
                         iCellIndex++;
198 221
                     }
199 222
                     iRowIndex++;