Ejemplo n.º 1
0
        /// <summary>
        /// 报事受理
        /// </summary>
        /// <param name="strParameter"></param>
        /// <returns></returns>
        private string InspectManage_Incident(string strParameter)
        {
            JavaScriptSerializer jsonSet = new JavaScriptSerializer();

            jsonSet.MaxJsonLength = int.MaxValue;
            string strReturn = string.Empty;
            IncidentAcceptManage_Entity incidentAcceptManage_Entity = null;

            try
            {
                string strConnectionString = PubConstant.ZTWYConnectionString;
                string strIncidentUserCode = PubConstant.ZTWYIncidentUserCode;
                incidentAcceptManage_Entity = jsonSet.Deserialize <IncidentAcceptManage_Entity>(strParameter);
                try
                {
                    incidentAcceptManage_Entity.AdmiMan_UserCode = strIncidentUserCode;
                    DataAccess  DAccess  = new DataAccess(strConnectionString);
                    DbParamters dbParams = new DbParamters();
                    dbParams.CommandText   = "Proc_HSPR_IncidentAccept_Insert_Crm";
                    dbParams.CommandType   = CommandType.StoredProcedure;
                    dbParams.ProcParamters = @"@CommID,@CustID,@RoomID,@TypeID,@IncidentDate,@ReserveDate,@IncidentPlace,@IncidentMan,@Phone,@IncidentContent,@AdmiDate,@AdmiManUserLoginCode,@AdmiManUserMan,@AdmiManUserCode,@RegionalID,@IncidentImgs,@IncidentSource,@CrmIncidentID,@OperationType";
                    dbParams.Add("CommID", incidentAcceptManage_Entity.CommId);
                    dbParams.Add("CustID", incidentAcceptManage_Entity.CustId);
                    dbParams.Add("RoomID", incidentAcceptManage_Entity.RoomId);
                    dbParams.Add("TypeID", incidentAcceptManage_Entity.Type_ID);
                    dbParams.Add("IncidentDate", incidentAcceptManage_Entity.Incident_Date);
                    dbParams.Add("ReserveDate", incidentAcceptManage_Entity.Reserve_Date);
                    dbParams.Add("IncidentPlace", incidentAcceptManage_Entity.Incident_Place);
                    dbParams.Add("IncidentMan", incidentAcceptManage_Entity.Incident_Man);
                    dbParams.Add("Phone", incidentAcceptManage_Entity.Phone);
                    dbParams.Add("IncidentContent", incidentAcceptManage_Entity.Incident_Content);

                    dbParams.Add("AdmiDate", incidentAcceptManage_Entity.Incident_Date);
                    dbParams.Add("AdmiManUserLoginCode", incidentAcceptManage_Entity.AdmiMan_UserLoginCode);
                    dbParams.Add("AdmiManUserMan", incidentAcceptManage_Entity.AdmiMan_UserName);
                    dbParams.Add("AdmiManUserCode", incidentAcceptManage_Entity.AdmiMan_UserCode);
                    dbParams.Add("RegionalID", incidentAcceptManage_Entity.Regional_Id);
                    dbParams.Add("IncidentImgs", incidentAcceptManage_Entity.Incident_Imgs);
                    dbParams.Add("IncidentSource", incidentAcceptManage_Entity.IncidentSource);
                    dbParams.Add("CrmIncidentID", incidentAcceptManage_Entity.Incident_CrmId);
                    dbParams.Add("OperationType", 0); //只新增
                    DataTable dtTable = DAccess.DataTable(dbParams);
                    if (dtTable.Rows.Count > 0)
                    {
                        Internal_BackParameter             backParameter    = jsonSet.Deserialize <Internal_BackParameter>(JsonConvert.SerializeObject(dtTable).Replace("[", "").Replace("]", ""));
                        IncidentAcceptManage_BackParameter retBackParameter = jsonSet.Deserialize <IncidentAcceptManage_BackParameter>(JsonConvert.SerializeObject(dtTable).Replace("[", "").Replace("]", ""));
                        if (backParameter.Code == 0)
                        {
                            strReturn = jsonSet.Serialize(new ExecResult(backParameter.Code, backParameter.Message, ErrType.Normal, retBackParameter));
                        }
                        else
                        {
                            strReturn = new ExecResult(backParameter.Code, backParameter.Message, ErrType.Verification).ToJson();
                        }
                    }
                }

                catch (Exception ex)
                {
                    strReturn = new ExecResult(-20, ex.Message, ErrType.System).ToJson();
                }
            }
            catch (Exception ex)
            {
                strReturn = new ExecResult(-21, $"数据解析异常【{ex.Message}】", ErrType.System).ToJson();
            }
            return(strReturn);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 报事流程跟进
        /// </summary>
        /// <param name="strParameter"></param>
        /// <returns></returns>
        private string InspectManage_IncidentProcess(string strParameter)
        {
            JavaScriptSerializer jsonSet = new JavaScriptSerializer();

            jsonSet.MaxJsonLength = int.MaxValue;
            string             strReturn = string.Empty;
            Process_ToDealWith Process   = null;

            try
            {
                string strConnectionString = PubConstant.ZTWYConnectionString;
                string strIncidentUserCode = PubConstant.ZTWYIncidentUserCode;
                Process = jsonSet.Deserialize <Process_ToDealWith>(strParameter);
                string strDealInfoParameter = jsonSet.Serialize(Process.DealInfo);
                try
                {
                    DataTable dtTable      = null;
                    object    retParameter = null;
                    switch (Process.DealType)
                    {
                    case "报事分派":
                        Process.分派_2 = jsonSet.Deserialize <进程处理_分派_2>(strDealInfoParameter);
                        dtTable      = IncidentDisp(Process, strConnectionString, strIncidentUserCode);
                        break;

                    case "报事完成":
                        Process.完成_3 = jsonSet.Deserialize <进程处理_完成_3>(strDealInfoParameter);
                        dtTable      = IncidentComplete(Process, strConnectionString, strIncidentUserCode);
                        break;

                    case "报事关闭":
                        Process.关闭_4 = jsonSet.Deserialize <进程处理_关闭_4>(strDealInfoParameter);
                        dtTable      = IncidentClose(Process, strConnectionString, strIncidentUserCode);
                        break;

                    case "报事回访":
                        Process.回访_5 = jsonSet.Deserialize <进程处理_回访_5>(strDealInfoParameter);
                        dtTable      = IncidentReply(Process, strConnectionString, strIncidentUserCode);
                        //retParameter = jsonSet.Deserialize<进程处理_回访_5_BackParameter>(JsonConvert.SerializeObject(dtTable).Replace("[", "").Replace("]", ""));
                        break;

                    case "报事废弃":
                        Process.废弃_6 = jsonSet.Deserialize <进程处理_废弃_6>(strDealInfoParameter);
                        dtTable      = IncidentAbandoned(Process, strConnectionString, strIncidentUserCode);
                        break;

                    case "报事回退":
                        Process.回退_7 = jsonSet.Deserialize <进程处理_回退_7>(strDealInfoParameter);
                        dtTable      = IncidentCancleFinish(Process, strConnectionString, strIncidentUserCode);
                        break;

                    case "转派责任方":
                        Process.转发_8 = jsonSet.Deserialize <进程处理_转发_8>(strDealInfoParameter);
                        dtTable      = IncidentTransmit(Process, strConnectionString, strIncidentUserCode);
                        break;

                    default:
                        strReturn = new ExecResult(-20, $"此类进程不受理,进程编码【{Process.DealType}】", ErrType.System).ToJson();
                        break;
                    }
                    if (dtTable != null && dtTable.Rows.Count > 0)
                    {
                        Internal_BackParameter backParameter = jsonSet.Deserialize <Internal_BackParameter>(JsonConvert.SerializeObject(dtTable).Replace("[", "").Replace("]", ""));
                        if (backParameter.Code == 0)
                        {
                            if (retParameter == null)
                            {
                                strReturn = new ExecResult(backParameter.Code, backParameter.Message, ErrType.Normal).ToJson();
                            }
                            else
                            {
                                strReturn = jsonSet.Serialize(new ExecResult(backParameter.Code, backParameter.Message, ErrType.Normal, retParameter));
                            }
                        }
                        else
                        {
                            strReturn = new ExecResult(backParameter.Code, backParameter.Message, ErrType.Verification).ToJson();
                        }
                    }
                }
                catch (Exception ex)
                {
                    strReturn = new ExecResult(-20, ex.Message, ErrType.System).ToJson();
                }
            }
            catch (Exception ex)
            {
                strReturn = new ExecResult(-21, $"数据解析异常【{ex.Message}】", ErrType.System).ToJson();
            }
            return(strReturn);
        }