Пример #1
0
        /// <summary>
        /// 设置激活
        /// </summary>
        /// <param name="inparams">初始参数</param>
        /// <returns>成功结果</returns>
        public ResponseResult active(Dictionary <string, string> inparams)
        {
            ResponseResult Result     = null;
            string         uid        = string.Empty;
            long           cid        = 0;
            long           tno        = 0;
            string         vin        = string.Empty;
            string         energytype = string.Empty;
            int            orderType  = 0;
            string         CarNo      = string.Empty;
            string         OrgNo      = string.Empty;
            string         Lockstatus = string.Empty;

            try
            {
                #region 取参数
                if (!inparams.Keys.Contains("sid") ||
                    !inparams.Keys.Contains("sysuid") ||
                    !inparams.Keys.Contains("token") ||
                    !inparams.Keys.Contains("sysflag") ||
                    !inparams.Keys.Contains("uid") ||
                    !inparams.Keys.Contains("cid") ||
                    !inparams.Keys.Contains("tno") ||
                    !inparams.Keys.Contains("vin") ||
                    !inparams.Keys.Contains("energytype") ||
                    !inparams.Keys.Contains("orderType") ||
                    !inparams.Keys.Contains("CarNo") ||
                    !inparams.Keys.Contains("OrgNo") ||
                    !inparams.Keys.Contains("Lockstatus"))
                {
                    Result = new ResponseResult(ResState.ParamsImperfect, "缺少参数", null);
                    return(Result);
                }
                uid = inparams["uid"];
                if (!string.IsNullOrWhiteSpace(inparams["cid"]))
                {
                    cid = Convert.ToInt64(inparams["cid"]);
                }
                if (!string.IsNullOrWhiteSpace(inparams["tno"]))
                {
                    tno = Convert.ToInt64(inparams["tno"]);
                }
                vin        = inparams["vin"];
                energytype = inparams["energytype"];
                if (!inparams["orderType"].ToString().Equals(string.Empty))
                {
                    orderType = Convert.ToInt32(inparams["orderType"]);
                }
                CarNo      = inparams["CarNo"];
                OrgNo      = inparams["OrgNo"];
                Lockstatus = inparams["Lockstatus"];
                #endregion 取参数

                #region 调用WebService接口
                WebGIS.WebGISService.WebGISServiceSoap           soap        = new WebGIS.WebGISService.WebGISServiceSoapClient();
                WebGIS.WebGISService.XD_activateOrderRequest     request     = new WebGIS.WebGISService.XD_activateOrderRequest();
                WebGIS.WebGISService.XD_activateOrderRequestBody requestBody = new WebGIS.WebGISService.XD_activateOrderRequestBody();
                string  basepath = HttpRuntime.AppDomainAppPath.ToString();
                DataSet ds       = new DataSet();
                ds.ReadXml(basepath + "ALConfig.xml");
                DataTable dt      = ds.Tables[0];
                string    sysflag = dt.Rows[0]["WebServiceSysFlag"].ToString();
                sysflag                = sysflag.Replace("\r\n", "").Trim();
                requestBody.sysflag    = sysflag;
                requestBody.cid        = cid;
                requestBody.tno        = tno;
                requestBody.vin        = vin;
                requestBody.energytype = energytype;
                requestBody.orderType  = orderType;
                request.Body           = requestBody;
                WebGIS.WebGISService.XD_activateOrderResponse     response     = soap.XD_activateOrder(request);
                WebGIS.WebGISService.XD_activateOrderResponseBody responseBody = response.Body;
                WebGIS.WebGISService.ResponseResult result = responseBody.XD_activateOrderResult;
                #endregion 调用WebService接口

                #region 调用存储过程
                if (result.state == 100)
                {
                    string parameter = "设置激活状态为";
                    if (orderType == 0xAA)
                    {
                        parameter += "激活";
                    }
                    else if (orderType == 0x55)
                    {
                        parameter += "关闭";
                    }
                    sysflag = inparams["sysflag"];
                    //int iResult = daoSaveSysLog(sysflag, cid.ToString(), CarNo, OrgNo, uid, parameter, Lockstatus);
                    Result = new ResponseResult(ResState.Success, result.msg, 1);
                }
                else
                {
                    Result = new ResponseResult(ResState.OperationFailed, result.msg, result.result);
                }
                #endregion 调用存储过程
            }
            catch (Exception ex)
            {
                Result = new ResponseResult(ResState.OperationFailed, ex.Message, "");
            }
            return(Result);
        }
Пример #2
0
        /// <summary>
        /// 审批锁车/解锁
        /// </summary>
        /// <param name="inparams">参数</param>
        /// <returns>成功结果</returns>
        public ResponseResult approve(Dictionary <string, string> inparams)
        {
            ResponseResult Result       = null;
            string         id           = string.Empty;
            string         uid          = string.Empty;
            long           cid          = 0;
            long           tno          = 0;
            int            orderType    = 0;
            int            lockType     = 0;
            uint           torque       = 0;
            uint           rotspeed     = 0;
            string         lockreason   = string.Empty;
            string         unlockreason = string.Empty;

            try
            {
                #region 取参数
                if (!inparams.Keys.Contains("sid") ||
                    !inparams.Keys.Contains("sysuid") ||
                    !inparams.Keys.Contains("token") ||
                    !inparams.Keys.Contains("sysflag") ||
                    !inparams.Keys.Contains("id") ||
                    !inparams.Keys.Contains("uid") ||
                    !inparams.Keys.Contains("cid") ||
                    !inparams.Keys.Contains("tno") ||
                    !inparams.Keys.Contains("orderType") ||
                    !inparams.Keys.Contains("lockType") ||
                    !inparams.Keys.Contains("torque") ||
                    !inparams.Keys.Contains("rotspeed") ||
                    !inparams.Keys.Contains("lockreason") ||
                    !inparams.Keys.Contains("unlockreason"))
                {
                    Result = new ResponseResult(ResState.ParamsImperfect, "缺少参数", null);
                    return(Result);
                }
                id  = inparams["id"];
                uid = inparams["uid"];
                if (!string.IsNullOrWhiteSpace(inparams["cid"]))
                {
                    cid = Convert.ToInt64(inparams["cid"]);
                }
                if (!string.IsNullOrWhiteSpace(inparams["tno"]))
                {
                    tno = Convert.ToInt64(inparams["tno"]);
                }
                if (!string.IsNullOrWhiteSpace(inparams["orderType"]))
                {
                    orderType = Convert.ToInt32(inparams["orderType"]);
                }
                if (!string.IsNullOrWhiteSpace(inparams["lockType"]))
                {
                    tno = Convert.ToInt32(inparams["lockType"]);
                }
                if (!string.IsNullOrWhiteSpace(inparams["torque"]))
                {
                    torque = Convert.ToUInt32(inparams["torque"]);
                }
                if (!string.IsNullOrWhiteSpace(inparams["rotspeed"]))
                {
                    rotspeed = Convert.ToUInt32(inparams["rotspeed"]);
                }
                lockreason   = inparams["lockreason"];
                unlockreason = inparams["unlockreason"];
                #endregion 取参数

                #region 调用WebService接口
                WebGIS.WebGISService.WebGISServiceSoap       soap        = new WebGIS.WebGISService.WebGISServiceSoapClient();
                WebGIS.WebGISService.XD_lockOrderRequest     request     = new WebGIS.WebGISService.XD_lockOrderRequest();
                WebGIS.WebGISService.XD_lockOrderRequestBody requestBody = new WebGIS.WebGISService.XD_lockOrderRequestBody();
                string  basepath = HttpRuntime.AppDomainAppPath.ToString();
                DataSet ds       = new DataSet();
                ds.ReadXml(basepath + "ALConfig.xml");
                DataTable dt      = ds.Tables[0];
                string    sysflag = dt.Rows[0]["WebServiceSysFlag"].ToString();
                sysflag                  = sysflag.Replace("\r\n", "").Trim();
                requestBody.sysflag      = sysflag;
                requestBody.cid          = cid;
                requestBody.tno          = tno;
                requestBody.orderType    = orderType;
                requestBody.lockType     = lockType;
                requestBody.torque       = torque;
                requestBody.rotspeed     = rotspeed;
                requestBody.lockreason   = lockreason;
                requestBody.unlockreason = unlockreason;
                request.Body             = requestBody;
                WebGIS.WebGISService.XD_lockOrderResponse     response     = soap.XD_lockOrder(request);
                WebGIS.WebGISService.XD_lockOrderResponseBody responseBody = response.Body;
                WebGIS.WebGISService.ResponseResult           result       = responseBody.XD_lockOrderResult;
                #endregion 调用WebService接口

                #region 调用存储过程
                if (result.state == 100)
                {
                    sysflag = inparams["sysflag"];
                    int iResult = daoUpdateApproveControl(sysflag, id, lockreason, unlockreason, torque, rotspeed, result, uid, lockType);
                    Result = new ResponseResult(ResState.Success, result.msg, iResult);
                }
                else
                {
                    Result = new ResponseResult(ResState.OperationFailed, result.msg, result.result);
                }
                #endregion 调用存储过程
            }
            catch (Exception ex)
            {
                Result = new ResponseResult(ResState.OperationFailed, ex.Message, "");
            }
            return(Result);
        }
Пример #3
0
        /// <summary>
        /// 设置参数
        /// </summary>
        /// <param name="inparams">初始参数</param>
        /// <returns>成功结果</returns>
        public ResponseResult set(Dictionary <string, string> inparams)
        {
            ResponseResult Result      = null;
            string         uid         = string.Empty;
            long           cid         = 0;
            long           tno         = 0;
            string         datevalue   = string.Empty;
            string         dayvalue    = string.Empty;
            string         minutevalue = string.Empty;
            string         CarNo       = string.Empty;
            string         OrgNo       = string.Empty;
            string         Lockstatus  = string.Empty;

            try
            {
                #region 取参数
                if (!inparams.Keys.Contains("sid") ||
                    !inparams.Keys.Contains("sysuid") ||
                    !inparams.Keys.Contains("token") ||
                    !inparams.Keys.Contains("sysflag") ||
                    !inparams.Keys.Contains("uid") ||
                    !inparams.Keys.Contains("cid") ||
                    !inparams.Keys.Contains("tno") ||
                    !inparams.Keys.Contains("datevalue") ||
                    !inparams.Keys.Contains("dayvalue") ||
                    !inparams.Keys.Contains("minutevalue") ||
                    !inparams.Keys.Contains("CarNo") ||
                    !inparams.Keys.Contains("OrgNo") ||
                    !inparams.Keys.Contains("Lockstatus"))
                {
                    Result = new ResponseResult(ResState.ParamsImperfect, "缺少参数", null);
                    return(Result);
                }
                uid = inparams["uid"];
                if (!string.IsNullOrWhiteSpace(inparams["cid"]))
                {
                    cid = Convert.ToInt64(inparams["cid"]);
                }
                if (!string.IsNullOrWhiteSpace(inparams["tno"]))
                {
                    tno = Convert.ToInt64(inparams["tno"]);
                }
                datevalue   = inparams["datevalue"];
                dayvalue    = inparams["dayvalue"];
                minutevalue = inparams["minutevalue"];
                CarNo       = inparams["CarNo"];
                OrgNo       = inparams["OrgNo"];
                Lockstatus  = inparams["Lockstatus"];
                #endregion 取参数

                #region 调用WebService接口
                WebGIS.WebGISService.WebGISServiceSoap           soap        = new WebGIS.WebGISService.WebGISServiceSoapClient();
                WebGIS.WebGISService.XD_setParamOrderRequest     request     = new WebGIS.WebGISService.XD_setParamOrderRequest();
                WebGIS.WebGISService.XD_setParamOrderRequestBody requestBody = new WebGIS.WebGISService.XD_setParamOrderRequestBody();
                string  basepath = HttpRuntime.AppDomainAppPath.ToString();
                DataSet ds       = new DataSet();
                ds.ReadXml(basepath + "ALConfig.xml");
                DataTable dt      = ds.Tables[0];
                string    sysflag = dt.Rows[0]["WebServiceSysFlag"].ToString();
                sysflag                 = sysflag.Replace("\r\n", "").Trim();
                requestBody.sysflag     = sysflag;
                requestBody.cid         = cid;
                requestBody.tno         = tno;
                requestBody.datevalue   = datevalue;
                requestBody.dayvalue    = dayvalue;
                requestBody.minutevalue = minutevalue;
                request.Body            = requestBody;
                WebGIS.WebGISService.XD_setParamOrderResponse     response     = soap.XD_setParamOrder(request);
                WebGIS.WebGISService.XD_setParamOrderResponseBody responseBody = response.Body;
                WebGIS.WebGISService.ResponseResult result = responseBody.XD_setParamOrderResult;
                #endregion 调用WebService接口

                #region 调用存储过程
                if (result.state == 100)
                {
                    int iMinuteValue = Convert.ToInt32(minutevalue);
                    iMinuteValue = iMinuteValue / 24 / 60;
                    string parameter = "设置" + "到期还款日为" + datevalue + ",还款到期日提前提醒天数" + dayvalue + ",无通讯连接最长连续时间为" + iMinuteValue + "天";
                    sysflag = inparams["sysflag"];
                    //int iResult = daoSaveSysLog(sysflag, cid.ToString(), CarNo, OrgNo, uid, parameter, Lockstatus);
                    Result = new ResponseResult(ResState.Success, result.msg, 0);
                }
                else
                {
                    Result = new ResponseResult(ResState.OperationFailed, result.msg, result.result);
                }
                #endregion 调用存储过程
            }
            catch (Exception ex)
            {
                Result = new ResponseResult(ResState.OperationFailed, ex.Message, "");
            }
            return(Result);
        }