Ejemplo n.º 1
0
        public IHttpActionResult SearchOpenGateRecord(OpenGateSearchRequest model)
        {
            GetRecordListResponse <OpenGateRecordResponse> response = new GetRecordListResponse <OpenGateRecordResponse>()
            {
                IsSuccess      = true,
                MessageCode    = (int)ApiBaseErrorCode.API_SUCCESS,
                MessageContent = ApiBaseErrorCode.API_SUCCESS.ToString()
            };

            if (string.IsNullOrWhiteSpace(model.ParkingCode))
            {
                response.IsSuccess      = false;
                response.MessageCode    = (int)ApiBaseErrorCode.API_PARAM_ERROR;
                response.MessageContent = "车场编码不能为空,请检查";
                return(Ok(response));
            }
            GetRecordListResponse <OpenGateRecordResponse> opengatereasonlistmodel = _reportManager.GetOpenGateRecordList(model);

            if (opengatereasonlistmodel != null)
            {
                response = opengatereasonlistmodel;
            }
            else
            {
                response.IsSuccess      = false;
                response.MessageCode    = (int)ApiPersonnelErrorCode.API_DATA_NULL_ERROR;
                response.MessageContent = ApiPersonnelErrorCode.API_DATA_NULL_ERROR.ToString();
            }
            return(Ok(response));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 读取异常开闸列表(报表)
        /// </summary>
        /// <param name="parkCode"></param>
        /// <returns></returns>
        public GetRecordListResponse <OpenGateRecordResponse> GetOpenGateRecordList(OpenGateSearchRequest model)
        {
            GetRecordListResponse <OpenGateRecordResponse> responseModel = null;
            RequestFujicaReportStatistical requestFujica = new RequestFujicaReportStatistical();
            //请求方法
            string servername = "SearchRecord/SearchOpenGateRecord";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["ParkingCode"]       = model.ParkingCode;
            dicParam["EntranceType"]      = model.EntranceType;
            dicParam["OpenGateStartTime"] = model.OpenGateStartTime;
            dicParam["OpenGateEndTime"]   = model.OpenGateEndTime;
            dicParam["OpenGateOperator"]  = model.OpenGateOperator;
            dicParam["NextToken"]         = model.NextToken; //就是第一次查询,需要制定当前页  页大小 ,需要下一页的时候,直接给这个nexttoken就可以了
            dicParam["PageIndex"]         = model.PageIndex;
            dicParam["PageSize"]          = model.PageSize;
            dicParam["Sort"]      = model.Sort;
            dicParam["FieldSort"] = model.FieldSort;
            bool falg = requestFujica.RequestFujicaReport(servername, dicParam);

            if (falg)
            {
                string fujicaResult = requestFujica.FujicaResult;
                if (!string.IsNullOrEmpty(fujicaResult))
                {
                    //解析返回参数json字符串
                    GetRecordListResponse <OpenGateRecordResponse> response = m_serializer.Deserialize <GetRecordListResponse <OpenGateRecordResponse> >(fujicaResult);
                    responseModel = response;
                }
            }
            return(responseModel);
        }