Przeglądaj źródła

获取工单修改

zhoufan 4 lat temu
rodzic
commit
876533065c

+ 327 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -6949,6 +6949,333 @@ namespace CallCenterApi.Interface.Controllers.workorder
6949 6949
         }
6950 6950
 
6951 6951
         /// <summary>
6952
+        /// 获取工单信息
6953
+        /// </summary>
6954
+        /// <returns></returns>
6955
+        [Authority]
6956
+        public ActionResult GetWorkOrderNew()
6957
+        {
6958
+            int userId = Utils.StrToInt(User.UserData["F_UserID"], 0);
6959
+
6960
+            Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
6961
+
6962
+            string strworkorderid = HttpUtility.UrlDecode(RequestString.GetQueryString("workorderid"));
6963
+            int type = RequestString.GetInt("type", 0);//0基本信息1监察意见2领导批示3办理情况4回访信息5督办信息6办理过程
6964
+            if (!string.IsNullOrEmpty(strworkorderid))
6965
+            {
6966
+                var configly = configBll.GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
6967
+                var config = configBll.GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
6968
+                var configfj = configBll.GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
6969
+
6970
+                switch (type)
6971
+                {
6972
+                    case 0:
6973
+                        #region 基本信息
6974
+                        string sql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName1,"
6975
+                                    + "dbo.GetAreaName(F_SourceArea) as AreaName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName,dbo.GetDeptName(F_MainDeptId) deptname ," + "F_DeptIdIsSms = (select F_IsSms  from T_Sys_Department where F_DeptId =a.F_MainDeptId)"
6976
+                                      + " from T_Bus_WorkOrder a WITH(NOLOCK) where F_WorkOrderId ='" + strworkorderid + "'";
6977
+                        var dt = DbHelperSQL.Query(sql).Tables[0];
6978
+                        if (dt.Rows.Count > 0)
6979
+                        {
6980
+
6981
+                            if (dt.Rows[0]["F_IsProtect"] != null && (userModel.F_RoleCode == "WLDW" || userModel.F_RoleCode == "EJWLDW" || userModel.F_RoleCode == "DBZY"))
6982
+                            {
6983
+                                string isp = dt.Rows[0]["F_IsProtect"].ToString();
6984
+                                if (isp == "1")
6985
+                                {
6986
+                                    dt.Rows[0]["F_CusName"] = "";
6987
+                                    dt.Rows[0]["F_CusPhone"] = "";
6988
+                                    dt.Rows[0]["F_ConPhone"] = "";
6989
+                                }
6990
+                            }
6991
+
6992
+                            #region 声音文件
6993
+                            dt.Columns.Add("FilePath", typeof(string));
6994
+
6995
+                            if (dt.Rows[0]["F_LeaveRecordId"] != null)
6996
+                            {
6997
+                                dt.Rows[0]["FilePath"] = GetLeavePath(dt.Rows[0]["F_LeaveRecordId"].ToString(), config.F_ParamValue);
6998
+                            }
6999
+                            else if (dt.Rows[0]["F_CallRecordId"] != null)
7000
+                            {
7001
+                                dt.Rows[0]["FilePath"] = GetCallPath(dt.Rows[0]["F_CallRecordId"].ToString(), config.F_ParamValue);
7002
+                            }
7003
+                            #endregion
7004
+
7005
+                            #region 附件
7006
+                            if (configfj != null)
7007
+                            {
7008
+                                dt = BindFileData(dt, configfj.F_ParamValue);
7009
+                            }
7010
+                            #endregion
7011
+
7012
+                            #region 操作按钮
7013
+                            var btns = new List<ButtonGroup.button>();
7014
+
7015
+                            string jbsql1 = "select top 1 * from T_Bus_AssignedInfo WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7016
+                            var jbdt1 = DbHelperSQL.Query(jbsql1).Tables[0];
7017
+                            if (jbdt1.Rows.Count > 0)
7018
+                            {
7019
+
7020
+                                var jbzx = jbdt1.Rows[0];
7021
+
7022
+                                string ispd = jbzx["F_IsNext"].ToString();
7023
+                                string iszbdw = "0";
7024
+                                string fmd = jbzx["F_MainDeptId"].ToString();
7025
+                                string fod = jbzx["F_OtherDeptIds"] == null ? "" : jbzx["F_OtherDeptIds"].ToString();
7026
+                                if (fmd == userModel.F_DeptId.ToString())
7027
+                                { iszbdw = "1"; }
7028
+                                else if (fod != "" && fod.Split(',').Contains(userModel.F_DeptId.ToString()))
7029
+                                {
7030
+                                    iszbdw = "2";
7031
+                                }
7032
+                                if (!(userModel.F_RoleCode == "WLDW" && iszbdw == "0"))
7033
+                                {
7034
+                                    btns = ButtonGroup.GetButtons(dt.Rows[0]["F_WorkState"].ToString(), userModel.F_RoleCode.ToUpper(), dt.Rows[0]["F_IsResult"].ToString(), iszbdw, ispd);
7035
+                                }
7036
+                            }
7037
+                            else
7038
+                            {
7039
+                                btns = ButtonGroup.GetButtons(dt.Rows[0]["F_WorkState"].ToString(), userModel.F_RoleCode.ToUpper(), dt.Rows[0]["F_IsResult"].ToString(), "0");
7040
+                            }
7041
+
7042
+
7043
+                            #region 判断是否存在待督办
7044
+                            var recount = remindBLL.GetModelList("F_State=0 and F_IsDelete=0 and F_Type=1 and F_WorkOrderId ='" + strworkorderid + "'").ToList().Count();
7045
+                            var butt = btns.Find(c => c.key == ButtonGroup.turnsee().key);
7046
+                            if (recount > 0)
7047
+                            {
7048
+                                if (butt != null)
7049
+                                    btns.Remove(butt);
7050
+                                if (userModel.F_RoleCode == "DBZY" || userModel.F_RoleCode == "GLY" || userModel.F_RoleCode == "DDZG")
7051
+                                {
7052
+                                    btns.Add(ButtonGroup.oversee());
7053
+                                    btns.Add(ButtonGroup.turnnosee());
7054
+                                }
7055
+                            }
7056
+                            if (btns == null)
7057
+                            {
7058
+                                btns.Add(ButtonGroup.query());
7059
+                            }
7060
+                            else
7061
+                            {
7062
+                                if (btns.Count == 0)
7063
+                                    btns.Add(ButtonGroup.query());
7064
+                            }
7065
+                            #endregion
7066
+                            #endregion
7067
+
7068
+                            #region 其他权限
7069
+                            int issend = 0;
7070
+                            //if (dt.Rows[0]["F_IsRelease"] != null && (userModel.F_RoleCode == "ZXLD" || userModel.F_RoleCode == "ZXLDGLYGLY" || userModel.F_RoleCode == "ZXLDGLY" || userModel.F_RoleCode == "GLY" || userModel.F_RoleCode == "DDZG"|| userModel.F_RoleCode == "MTDD"))
7071
+                            //{
7072
+                            //    if (dt.Rows[0]["F_IsRelease"].ToString() != "1")
7073
+                            //    {
7074
+                            //        issend = 1;
7075
+                            //    }
7076
+                            //}
7077
+                            int isnotice = 0;
7078
+                            if (dt.Rows[0]["F_IsNotice"] != null && (userModel.F_RoleCode == "ZXLD" || userModel.F_RoleCode == "ZXLDGLYGLY" || userModel.F_RoleCode == "ZXLDGLY" || userModel.F_RoleCode == "GLY" || userModel.F_RoleCode == "DDZG"))
7079
+                            {
7080
+                                if (dt.Rows[0]["F_IsNotice"].ToString() != "1")
7081
+                                {
7082
+                                    isnotice = 1;
7083
+                                }
7084
+                            }
7085
+                            int isedit = 0;
7086
+                            //if (dt.Rows[0]["F_IsRelease"] != null && (userModel.F_RoleCode == "ZXLDGLYGLY" || userModel.F_RoleCode == "ZXLDGLY" || userModel.F_RoleCode == "GLY" || userModel.F_RoleCode == "DDZG"))
7087
+                            //{
7088
+                            //    isedit = 1;
7089
+                            //}
7090
+                            #endregion
7091
+
7092
+                            var obj = new
7093
+                            {
7094
+                                data = dt,
7095
+                                issend = issend,
7096
+                                isedit = isedit,
7097
+                                isnotice = isnotice,
7098
+                                btndata = btns
7099
+                            };
7100
+                            return Success("获取成功", obj);
7101
+                        }
7102
+                        else
7103
+                        {
7104
+                            return Error("获取失败");
7105
+                        }
7106
+                        #endregion
7107
+                    case 1:
7108
+                        #region 交办信息
7109
+                        string jbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDictionaryNames(F_StandardIDS) as StandardNames  from T_Bus_AssignedInfo WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7110
+                        string ejjbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName from T_Bus_AssignedInfo_Next WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7111
+                        string thsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_CreateDeptId) as DeptName from T_Bus_Feedback WITH(NOLOCK) where F_State=1 and F_Type=3 and F_IsDelete=0 and  F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7112
+                        var jbdt = DbHelperSQL.Query(jbsql).Tables[0];
7113
+                        if (configfj != null)
7114
+                        {
7115
+                            jbdt = BindFileData(jbdt, configfj.F_ParamValue);
7116
+                        }
7117
+                        var ejjbdt = DbHelperSQL.Query(ejjbsql).Tables[0];
7118
+                        if (configfj != null)
7119
+                        {
7120
+                            ejjbdt = BindFileData(ejjbdt, configfj.F_ParamValue);
7121
+                        }
7122
+                        var thdt = DbHelperSQL.Query(thsql).Tables[0];
7123
+                        var obj1 = new
7124
+                        {
7125
+                            jbdata = jbdt,
7126
+                            ejjbdata = ejjbdt,
7127
+                            thdata= thdt
7128
+                        };
7129
+                        return Success("获取成功", obj1);
7130
+                        #endregion
7131
+                    case 2:
7132
+                        #region 指示信息
7133
+                        string zssql = "select *,dbo.GetUserName(F_CreateUser) as UserName from T_Bus_SubmitSuper WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_Type=2 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7134
+                        var zsdt = DbHelperSQL.Query(zssql).Tables[0];
7135
+                        if (configfj != null)
7136
+                        {
7137
+                            zsdt = BindFileData(zsdt, configfj.F_ParamValue);
7138
+                        }
7139
+                        return Success("获取成功", zsdt);
7140
+                    #endregion
7141
+                    case 3:
7142
+                        #region 回退信息
7143
+                        string htsql = "select *,dbo.GetUserName(F_CreateUser) as UserName from T_Bus_SubmitSuper WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_Type=3 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7144
+                        var htdt = DbHelperSQL.Query(htsql).Tables[0];
7145
+                        return Success("获取成功", htdt);
7146
+                    #endregion
7147
+                    case 4:
7148
+                        #region 办理情况
7149
+                        string blsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_CreateDeptId) as DeptName from T_Bus_Feedback WITH(NOLOCK) where F_State=1 and F_Type!=3 and F_IsDelete=0 and  F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7150
+                        string ejblsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_CreateDeptId) as DeptName from T_Bus_Feedback_Next WITH(NOLOCK) where F_State=1 and F_Type!=3 and F_IsDelete=0 and  F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7151
+                        var bldt = DbHelperSQL.Query(blsql).Tables[0];
7152
+                        if (configfj != null)
7153
+                        {
7154
+                            bldt = BindFileDatas(bldt, configfj.F_ParamValue);
7155
+                        }
7156
+                        var ejbldt = DbHelperSQL.Query(ejblsql).Tables[0];
7157
+                        if (configfj != null)
7158
+                        {
7159
+                            ejbldt = BindFileData(ejbldt, configfj.F_ParamValue);
7160
+                        }
7161
+                        var obj5 = new
7162
+                        {
7163
+                            bldata = bldt,
7164
+                            ejbldata = ejbldt
7165
+                        };
7166
+                        return Success("获取成功", obj5);
7167
+                    #endregion
7168
+                    case 5:
7169
+                        #region 延时信息
7170
+                        string yssql = "select *,dbo.GetUserName(F_CreateUser) as UserName from T_Bus_DelayTime WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7171
+                        var ysdt = DbHelperSQL.Query(yssql).Tables[0];
7172
+                        if (configfj != null)
7173
+                        {
7174
+                            ysdt = BindFileData(ysdt, configfj.F_ParamValue);
7175
+                        }
7176
+                        return Success("获取成功", ysdt);
7177
+                    #endregion
7178
+                    case 6:
7179
+                        #region 回访信息
7180
+                        string hfsql = "select *,dbo.GetUserName(F_CreateUser) as UserName from T_Bus_VisitResult WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime ";
7181
+                        var hfdt = DbHelperSQL.Query(hfsql).Tables[0];
7182
+                        hfdt.Columns.Add("FilePath", typeof(string));
7183
+                        foreach (DataRow bldr in hfdt.Rows)
7184
+                        {
7185
+                            if (bldr["F_CallRecordId"] != null && config != null)
7186
+                            {
7187
+                                bldr["FilePath"] = GetCallPath(bldr["F_CallRecordId"].ToString(), config.F_ParamValue);
7188
+                            }
7189
+                        }
7190
+                        return Success("获取成功", hfdt);
7191
+                    #endregion
7192
+                    case 7:
7193
+                        #region 督办信息
7194
+                        string dbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_DeptId) as DeptName  from T_Bus_RemindRecord WITH(NOLOCK) where F_Type=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7195
+                        var dbdt = DbHelperSQL.Query(dbsql).Tables[0];
7196
+                        if (configfj != null)
7197
+                        {
7198
+                            dbdt = BindFileData(dbdt, configfj.F_ParamValue);
7199
+                        }
7200
+                        return Success("获取成功", dbdt);
7201
+                    #endregion
7202
+                    case 8:
7203
+                        #region 市民催单
7204
+                        string cbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName from T_Bus_Additional WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7205
+                        var cbdt = DbHelperSQL.Query(cbsql).Tables[0];
7206
+                        cbdt.Columns.Add("FilePath", typeof(string));
7207
+                        foreach (DataRow bldr in cbdt.Rows)
7208
+                        {
7209
+                            if (bldr["F_CallRecordId"] != null && config != null)
7210
+                            {
7211
+                                bldr["FilePath"] = GetCallPath(bldr["F_CallRecordId"].ToString(), config.F_ParamValue);
7212
+                            }
7213
+                        }
7214
+                        return Success("获取成功", cbdt);
7215
+                    #endregion
7216
+                    case 9:
7217
+                        #region 办理过程
7218
+                        string gcsql = "select o.*,u.F_UserName from T_Bus_Operation o left join T_Sys_UserAccount u on o.F_CreateUser=u.F_UserCode  where o.F_IsDelete=0 and o.F_WorkOrderId ='" + strworkorderid + "' order by o.F_CreateTime ";
7219
+                        var gcdt = DbHelperSQL.Query(gcsql).Tables[0];
7220
+                        gcdt.Columns.Add("File", typeof(object));
7221
+                        gcdt.Columns.Add("FilePath", typeof(string));
7222
+                        if (configfj != null || configly != null || config != null)
7223
+                        {
7224
+                            foreach (DataRow bldr in gcdt.Rows)
7225
+                            {
7226
+                                if (bldr["F_File"] != null && bldr["F_File"].ToString() != "" && configfj != null)
7227
+                                {
7228
+                                    bldr["File"] = GetFileData(bldr["F_File"].ToString(), configfj.F_ParamValue);
7229
+                                }
7230
+
7231
+                                if (bldr["F_LeaveRecordId"] != null && configly != null)
7232
+                                {
7233
+                                    bldr["FilePath"] = GetLeavePath(bldr["F_LeaveRecordId"].ToString(), config.F_ParamValue);
7234
+                                }
7235
+                                else if (bldr["F_CallRecordId"] != null && config != null)
7236
+                                {
7237
+                                    bldr["FilePath"] = GetCallPath(bldr["F_CallRecordId"].ToString(), config.F_ParamValue);
7238
+                                }
7239
+                            }
7240
+                        }
7241
+                        return Success("获取成功", gcdt);
7242
+                    #endregion
7243
+                    case 10:
7244
+                        #region 市民评议
7245
+                        string pysql = "select * from PublicComment WITH(NOLOCK) where  WorkOrderId ='" + strworkorderid + "' order by CreateTime";
7246
+                        var pydt = DbHelperSQL.Query(pysql).Tables[0];
7247
+                        return Success("获取成功", pydt);
7248
+                    #endregion
7249
+                    case 11:
7250
+                        #region 监察信息
7251
+                        string jcsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_DeptId) as DeptName from T_Bus_RemindRecord WITH(NOLOCK) where F_Type=2 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7252
+                        var jcdt = DbHelperSQL.Query(jcsql).Tables[0];
7253
+                        if (configfj != null)
7254
+                        {
7255
+                            jcdt = BindFileData(jcdt, configfj.F_ParamValue);
7256
+                        }
7257
+                        return Success("获取成功", jcdt);
7258
+                    #endregion
7259
+                    case 12:
7260
+                        #region 批示信息
7261
+                        string pssql = "select *,dbo.GetUserName(F_CreateUser) as UserName from T_Bus_SubmitSuper WITH(NOLOCK) where F_State=1 and F_IsDelete=0 and F_Type=1 and F_WorkOrderId ='" + strworkorderid + "' order by F_CreateTime";
7262
+                        var psdt = DbHelperSQL.Query(pssql).Tables[0];
7263
+                        if (configfj != null)
7264
+                        {
7265
+                            psdt = BindFileData(psdt, configfj.F_ParamValue);
7266
+                        }
7267
+                        return Success("获取成功", psdt);
7268
+                        #endregion
7269
+                }
7270
+                return Error("获取失败");
7271
+            }
7272
+            else
7273
+            {
7274
+                return Error("参数传输失败");
7275
+            }
7276
+        }
7277
+
7278
+        /// <summary>
6952 7279
         /// 获取草稿信息
6953 7280
         /// </summary>
6954 7281
         /// <returns></returns>