duhongyu преди 4 години
родител
ревизия
c824b26948

+ 9 - 2
CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs

@@ -286,6 +286,7 @@ namespace CallCenterApi.DAL
286 286
             strSql.Append("F_SubWorkorder1=@F_SubWorkorder1, ");
287 287
             strSql.Append("F_Administrative=@F_Administrative, ");
288 288
             strSql.Append("F_Identification=@F_Identification, ");
289
+            strSql.Append("F_IsMedia=@F_IsMedia, ");
289 290
             strSql.Append("F_IsSms=@F_IsSms ");
290 291
             strSql.Append(" where F_Id=@F_Id");
291 292
             SqlParameter[] parameters = {
@@ -365,6 +366,7 @@ namespace CallCenterApi.DAL
365 366
                     new SqlParameter("@F_SubWorkorder1", SqlDbType.VarChar,500),
366 367
                        new SqlParameter("@F_Administrative", SqlDbType.VarChar,500),
367 368
                         new SqlParameter("@F_Identification", SqlDbType.Int ,4),
369
+                         new SqlParameter("@F_IsMedia", SqlDbType.Int ,4),
368 370
                        new SqlParameter("@F_IsSms", SqlDbType.Int,4),
369 371
                     new SqlParameter("@F_Id", SqlDbType.Int,4)};
370 372
             parameters[0].Value = model.F_WorkOrderId;
@@ -443,8 +445,9 @@ namespace CallCenterApi.DAL
443 445
             parameters[73].Value = model.F_SubWorkorder1;
444 446
             parameters[74].Value = model.F_Administrative;
445 447
             parameters[75].Value = model.F_Identification;
446
-            parameters[76].Value = model.F_IsSms;
447
-            parameters[77].Value = model.F_Id;
448
+            parameters[76].Value = model.F_IsMedia ;
449
+            parameters[77].Value = model.F_IsSms;
450
+            parameters[78].Value = model.F_Id;
448 451
 
449 452
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
450 453
             if (rows > 0)
@@ -902,6 +905,10 @@ namespace CallCenterApi.DAL
902 905
                 {
903 906
                     model.F_VisitType = int.Parse(row["F_VisitType"].ToString());
904 907
                 }
908
+                if (row["F_IsMedia"] != null && row["F_IsMedia"].ToString() != "")
909
+                {
910
+                    model.F_IsMedia = int.Parse(row["F_IsMedia"].ToString());
911
+                }
905 912
                 
906 913
             }
907 914
             return model;

+ 298 - 6
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -5728,18 +5728,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
5728 5728
         }
5729 5729
 
5730 5730
         /// <summary>
5731
-        /// 获取媒体工单列表
5731
+        /// 获取公开工单列表
5732 5732
         /// </summary>
5733 5733
         /// <returns></returns>
5734 5734
         //[Authority]
5735 5735
         public ActionResult GetMediaList(int isdc = 0)
5736 5736
         {
5737 5737
             DataTable dt = new DataTable();
5738
-
5739
-
5740
-
5741
-
5742
-
5743 5738
             string sql = " and F_IsDelete=0";
5744 5739
             string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));
5745 5740
             int islike = RequestString.GetInt("islike", 1);
@@ -6006,6 +6001,247 @@ namespace CallCenterApi.Interface.Controllers.workorder
6006 6001
             return Content(obj.ToJson());
6007 6002
         }
6008 6003
 
6004
+
6005
+        /// <summary>
6006
+        /// 获取媒体工单列表
6007
+        /// </summary>
6008
+        /// <returns></returns>
6009
+        //[Authority]
6010
+        public ActionResult GetMassList(int isdc = 0)
6011
+        {
6012
+            DataTable dt = new DataTable();
6013
+            string sql = " and F_IsDelete=0";
6014
+            string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));
6015
+            int islike = RequestString.GetInt("islike", 1);
6016
+            string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
6017
+            string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));
6018
+            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
6019
+            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
6020
+            string strworkid = HttpUtility.UrlDecode(RequestString.GetQueryString("workid"));
6021
+            string strusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
6022
+            string strddusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("ddusercode"));//调度员
6023
+            int source = RequestString.GetInt("source", 0);
6024
+            int keyid = RequestString.GetInt("keyid", 0);
6025
+            int type = RequestString.GetInt("type", 0);
6026
+            int bigtype = RequestString.GetInt("bigtype", 0);
6027
+            int smalltype = RequestString.GetInt("smalltype", 0);
6028
+            int sourcearea = RequestString.GetInt("sourcearea", 0);
6029
+            int deptid = RequestString.GetInt("deptid", 0);
6030
+
6031
+            string strpageindex = RequestString.GetQueryString("page");
6032
+            int pageindex = 1;
6033
+            string strpagesize = RequestString.GetQueryString("pagesize");
6034
+            int pagesize = 10;
6035
+
6036
+            sql += " and isnull(F_IsMedia,0) =1 ";
6037
+            int business = RequestString.GetInt("business", 0);
6038
+            if (business > 0)
6039
+                sql += " and F_Business = '1'";
6040
+            if (strworkid.Trim() != "" && strworkid != "undefined")
6041
+            {
6042
+                sql += " and F_WorkOrderId like '%" + strworkid + "%' ";
6043
+            }
6044
+            if (strname.Trim() != "" && strname != "undefined")
6045
+            {
6046
+                sql += " and F_CusName like '%" + strname + "%' ";
6047
+            }
6048
+            if (islike > 0)
6049
+            {
6050
+                if (strtel.Trim() != "" && strtel != "undefined")
6051
+                {
6052
+                    sql += " and (F_CusPhone  like '%" + strtel + "%' or F_ConPhone like '%" + strtel + "%') ";
6053
+                }
6054
+            }
6055
+            else
6056
+            {
6057
+                if (strtel.Trim() != "" && strtel != "undefined")
6058
+                {
6059
+                    sql += " and (F_CusPhone  = '" + strtel + "' or F_ConPhone like '" + strtel + "') ";
6060
+                }
6061
+            }
6062
+
6063
+            string ComTitle = HttpUtility.UrlDecode(RequestString.GetQueryString("ComTitle"));
6064
+            string ComContent = HttpUtility.UrlDecode(RequestString.GetQueryString("ComContent"));
6065
+            string Result = HttpUtility.UrlDecode(RequestString.GetQueryString("Result"));
6066
+            if (ComTitle.Trim() != "" && ComTitle != "undefined")
6067
+            {
6068
+                sql += " and F_ComTitle like '%" + ComTitle + "%' ";
6069
+            }
6070
+            if (Result.Trim() != "" && Result != "undefined")
6071
+            {
6072
+                sql += " and F_Result like '%" + Result + "%' ";
6073
+            }
6074
+            if (ComContent.Trim() != "" && ComContent != "undefined")
6075
+            {
6076
+                sql += " and F_ComContent like '%" + ComContent + "%' ";
6077
+            }
6078
+            if (strkey.Trim() != "" && strkey != "undefined")
6079
+            {
6080
+                sql += " and (F_ComTitle like '%" + strkey + "%' or F_ComContent like '%" + strkey + "%'" +
6081
+                   " or F_Result like  '%" + strkey + "%' ) ";
6082
+            }
6083
+            #region  坐席&调度员
6084
+            if (strusercode.Trim() != "" && strusercode != "undefined")
6085
+            {//坐席
6086
+                var usercode = strusercode.Trim().Split(',');
6087
+                var newusercode = "";
6088
+                foreach (var item in usercode)
6089
+                {
6090
+                    if (!string.IsNullOrWhiteSpace(item.Trim()))
6091
+                        newusercode += "'" + item + "',";
6092
+                }
6093
+                newusercode = newusercode.Trim(',');
6094
+                if (newusercode.Trim() != "" && newusercode != "undefined")
6095
+                {
6096
+                    sql += " and F_CreateUser in (" + newusercode + ") ";
6097
+                }
6098
+            }
6099
+            if (strddusercode.Trim() != "" && strddusercode != "undefined")
6100
+            {//调度员
6101
+                var ddusercode = strddusercode.Trim().Split(',');
6102
+                var newusercode = "";
6103
+                foreach (var item in ddusercode)
6104
+                {
6105
+                    if (!string.IsNullOrWhiteSpace(item.Trim()))
6106
+                        newusercode += "'" + item + "',";
6107
+                }
6108
+                newusercode = newusercode.Trim(',');
6109
+                if (newusercode.Trim() != "" && newusercode != "undefined")
6110
+                {
6111
+                    sql += " and F_AssignUser in(" + newusercode + ") ";
6112
+                }
6113
+            }
6114
+            
6115
+            #endregion
6116
+
6117
+            if (source != 0)
6118
+            {
6119
+                sql += " and F_InfoSource = '" + source + "' ";
6120
+            }
6121
+            string sqlwheres = "";
6122
+            if (keyid != 0)
6123
+            {
6124
+                sqlwheres = " INNER JOIN[GetValueId]('" + keyid + "') Value on a.F_Key = Value.F_ValueId";
6125
+                //sql += "and (F_Key IN(  SELECT  F_ValueId from [GetValueId]('"+ keyid + "'))" +
6126
+                //  " or F_Key='" + keyid + "' )";
6127
+            }
6128
+            if (type != 0)
6129
+            {
6130
+                sql += " and F_InfoType = '" + type + "' ";
6131
+            }
6132
+            if (bigtype != 0)
6133
+            {
6134
+                sql += " and F_InfoConBigType = '" + bigtype + "' ";
6135
+            }
6136
+            if (smalltype != 0)
6137
+            {
6138
+                sql += " and F_InfoConSmallType = '" + smalltype + "' ";
6139
+            }
6140
+            if (sourcearea != 0)
6141
+            {
6142
+                sql += " and F_SourceArea = '" + sourcearea + "' ";
6143
+            }
6144
+            if (deptid != 0)
6145
+            {
6146
+                string sqlwhere = "select F_WorkOrderID from T_Bus_AssignedInfo WITH(NOLOCK) where F_MainDeptId = '" + deptid + "' and F_IsSure in (0,1) and F_State=1 and F_IsDelete=0 ";
6147
+                sql += " and F_WorkOrderID in(" + sqlwhere + ")";
6148
+            }
6149
+            if (strstarttime.Trim() != "" && strstarttime != "undefined")
6150
+            {
6151
+                sql += " and F_CreateTime>='" + strstarttime + "' ";
6152
+            }
6153
+            if (strendtime.Trim() != "" && strendtime != "undefined")
6154
+            {
6155
+                sql += " and F_CreateTime<='" + strendtime + "' ";
6156
+            }
6157
+
6158
+            if (strpageindex.Trim() != "")
6159
+            {
6160
+                pageindex = Convert.ToInt32(strpageindex);
6161
+            }
6162
+
6163
+            if (strpagesize.Trim() != "")
6164
+            {
6165
+                pagesize = Convert.ToInt32(strpagesize);
6166
+            }
6167
+            string cols = "F_WorkOrderId,F_ComTitle,F_WorkState,F_MainDeptId,F_OtherDeptIds,F_DealTime,F_LeaveRecordId,F_CallRecordId,F_IsResult,F_IsProtect,F_IsReturn,F_CreateTime,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,F_Identification";
6168
+            if (isdc > 0)
6169
+            {
6170
+                var dtdc = DbHelperSQL.Query(" select " + cols + " from T_Bus_WorkOrder WITH(NOLOCK) where 1=1 " + sql).Tables[0];
6171
+                var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
6172
+                if (msg == "")
6173
+                {
6174
+                    return Success("导出成功");
6175
+                }
6176
+                else
6177
+                {
6178
+                    return Error("导出失败");
6179
+                }
6180
+            }
6181
+
6182
+            int recordCount = 0;
6183
+            dt = BLL.PagerBLL.GetListPager(
6184
+                "T_Bus_WorkOrder a WITH(NOLOCK)" + sqlwheres,
6185
+                "F_Id",
6186
+                cols,
6187
+                sql,
6188
+                "ORDER BY F_CreateTime DESC",
6189
+                pagesize,
6190
+                pageindex,
6191
+                true,
6192
+                out recordCount);
6193
+
6194
+            #region 声音文件
6195
+            dt.Columns.Add("DeptName", typeof(string));//交办单位
6196
+            dt.Columns.Add("OtherDeptName", typeof(string));//协办单位
6197
+            dt.Columns.Add("AssignTime", typeof(string));//交办时间
6198
+            dt.Columns.Add("IsReturnMedia", typeof(string));
6199
+
6200
+            dt.Columns.Add("Buttons", typeof(object));
6201
+
6202
+            int IsReturnMedia = 0;
6203
+            if (User.F_RoleCode == "ZXLD" || User.F_RoleCode == "ZXLDGLYGLY" || User.F_RoleCode == "ZXLDGLY" || User.F_RoleCode == "GLY" || User.F_RoleCode == "DDZG" || User.F_RoleCode == "MTDD")
6204
+            {
6205
+                IsReturnMedia = 1;
6206
+            }
6207
+            foreach (DataRow dr in dt.Rows)
6208
+            {
6209
+                int state = Int32.Parse(dr["F_WorkState"].ToString());
6210
+                if (state > 1)
6211
+                {
6212
+                    //获取最新交办信息
6213
+                    string sqljb = "SELECT TOP 1 * FROM T_Bus_AssignedInfo WITH(NOLOCK) WHERE F_WorkOrderId='" + dr["F_WorkOrderId"].ToString() + "' and F_State=1 and F_IsDelete=0 and F_IsSure<>3   ORDER BY F_Id DESC";
6214
+                    var dtjb = DbHelperSQL.Query(sqljb).Tables[0];
6215
+                    if (dtjb.Rows.Count > 0)
6216
+                    {
6217
+                        dr["DeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_MainDeptId"].ToString() + "')");
6218
+                        if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
6219
+                        {
6220
+                            dr["OtherDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_OtherDeptIds"].ToString() + "')");
6221
+                        }
6222
+                        dr["AssignTime"] = dtjb.Rows[0]["F_CreateTime"].ToString();
6223
+                    }
6224
+                }
6225
+                List<ButtonGroup.button> btns = new List<ButtonGroup.button>();
6226
+                btns.Add(ButtonGroup.query());
6227
+                dr["Buttons"] = btns;
6228
+
6229
+                dr["IsReturnMedia"] = IsReturnMedia;
6230
+            }
6231
+
6232
+            #endregion
6233
+
6234
+            var obj = new
6235
+            {
6236
+                state = "success",
6237
+                message = "成功",
6238
+                rows = dt,
6239
+                total = recordCount
6240
+            };
6241
+
6242
+            return Content(obj.ToJson());
6243
+        }
6244
+
6009 6245
         ///// <summary>
6010 6246
         ///// 获取通报工单列表
6011 6247
         ///// </summary>
@@ -17490,6 +17726,62 @@ namespace CallCenterApi.Interface.Controllers.workorder
17490 17726
             }
17491 17727
         }
17492 17728
         /// <summary>
17729
+        /// 转公开媒体
17730
+        /// </summary>
17731
+        /// <returns></returns>
17732
+        //[Authority]
17733
+        public ActionResult MediaWorkOrder()
17734
+        {
17735
+            if (User.F_RoleCode == "ZXLD" || User.F_RoleCode == "ZXLDGLYGLY" || User.F_RoleCode == "GLY" || User.F_RoleCode == "DDZG" || User.F_RoleCode == "MTDD")
17736
+            {
17737
+                string workorderid = RequestString.GetFormString("workorderid");
17738
+                int isrelease = RequestString.GetInt("isrelease", -1);
17739
+                // int isopen = RequestString.GetInt("isopen", 0);
17740
+                if (isrelease > -1)
17741
+                {
17742
+                    Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(workorderid);
17743
+                    if (modelT_Bus_WorkOrder != null)
17744
+                    {
17745
+                        using (TransactionScope trans = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(0, 10, 0)))
17746
+                        {
17747
+                            #region 修改工单记录
17748
+                            if (isrelease > 0)
17749
+                                modelT_Bus_WorkOrder.F_IsMedia = 1;
17750
+                            else
17751
+                                modelT_Bus_WorkOrder.F_IsMedia = 0;
17752
+                            workorderBLL.Update(modelT_Bus_WorkOrder);
17753
+                            #endregion
17754
+                            #region 插入操作记录
17755
+                            Model.T_Bus_Operation oper = new Model.T_Bus_Operation();
17756
+                            oper.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
17757
+                            oper.F_State = modelT_Bus_WorkOrder.F_WorkState;
17758
+                            string userinfo = User.depname + "(" + User.F_UserCode + ")";
17759
+                            if (modelT_Bus_WorkOrder.F_IsOpen == 1)
17760
+                                oper.F_Message = userinfo + "转媒体了工单";
17761
+                            else
17762
+                                oper.F_Message = userinfo + "撤回了媒体工单";
17763
+                            oper.F_CreateUser = User.F_UserCode;
17764
+                            oper.F_CreateTime = DateTime.Now;
17765
+                            oper.F_IsDelete = 0;
17766
+                            operBLL.Add(oper);
17767
+                            #endregion
17768
+                            trans.Complete();
17769
+                        }
17770
+                        return Success("操作成功");
17771
+                    }
17772
+                    else
17773
+                        return Error("操作失败");
17774
+                }
17775
+                else
17776
+                    return Error("操作失败");
17777
+
17778
+            }
17779
+            else
17780
+            {
17781
+                return Error("权限不足否");
17782
+            }
17783
+        }
17784
+        /// <summary>
17493 17785
         /// 关联工单
17494 17786
         /// </summary>
17495 17787
         /// <returns></returns>

+ 1 - 1
CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

@@ -697,7 +697,7 @@ namespace CallCenterApi.Model
697 697
         /// 回访方式1无需回访
698 698
         /// </summary>
699 699
         public int F_VisitType { set; get; }
700
-        
700
+        public int F_IsMedia { set; get; }
701 701
         #endregion Model
702 702
 
703 703
     }