Exemplo n.º 1
0
        /// <summary>
        /// 整车订单列表查询
        /// </summary>
        /// <param name="vehorderRequest"></param>
        /// <returns></returns>
        public async Task <QueryResult <CrmEntity> > GetVehorderList(VehorderRequest vehorderRequest)
        {
            try
            {
                var userInfo    = ContextContainer.GetValue <UserInfo>(ContextExtensionTypes.CurrentUserInfo);
                var ProxyUserId = userInfo != null ? userInfo.systemuserid : null;

                var fetchString  = _vehorderRepository.GetVehorderList(vehorderRequest);
                var fetchXdoc    = XDocument.Parse(fetchString);
                var fetchRequest = new CrmRetrieveMultipleFetchRequestMessage()
                {
                    EntityName  = "mcs_vehorder",
                    FetchXml    = fetchXdoc,
                    ProxyUserId = ProxyUserId
                };
                var fetchResponse = await _crmService.Execute(fetchRequest);

                var fetchResponseResult = fetchResponse as CrmRetrieveMultipleFetchResponseMessage;

                var queryResult = new QueryResult <CrmEntity>();
                queryResult.Results     = fetchResponseResult.Value.Results;
                queryResult.CurrentPage = vehorderRequest.PageIndex;
                queryResult.TotalCount  = 0;
                return(queryResult);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 整车订单列表查询xml
        /// </summary>
        /// <param name="vehorderRequest"></param>
        /// <returns></returns>
        public string GetVehorderList(VehorderRequest vehorderRequest)
        {
            var filter = string.Empty;

            if (!string.IsNullOrWhiteSpace(vehorderRequest.SearchKey))
            {
                filter += $"<filter type='or'>";
                filter += $"<condition attribute='mcs_contactname' operator='like' value='%{vehorderRequest.SearchKey}%' />";
                filter += $"<condition attribute='mcs_contactphone' operator='like' value='%{vehorderRequest.SearchKey}%' />";
                filter += $"<condition attribute='mcs_code' operator='like' value='%{vehorderRequest.SearchKey}%' />";
                filter += $"</filter>";
            }
            if (vehorderRequest.mcs_rostatus.HasValue && vehorderRequest.mcs_rostatus.GetValueOrDefault(0) > 0)
            {
                filter += $"<filter type='and'>";
                filter += $"<condition attribute='mcs_rostatus' operator='eq' value='{vehorderRequest.mcs_rostatus}' />";
                filter += $"</filter>";
            }

            var fetchString = $@"<fetch version='1.0' count='{vehorderRequest.PageSize}' page='{vehorderRequest.PageIndex}' output-format='xml-platform' mapping='logical' distinct='false'>
                <entity name='mcs_vehorder'>
                <attribute name='mcs_vehorderid' />
                <attribute name='mcs_code' />
                <attribute name='mcs_contactname' />
                <attribute name='mcs_contactphone' />
                <attribute name='mcs_rostatus' />
                <attribute name='mcs_dealer' />
                <attribute name='createdon' />
                <order attribute='createdon' descending='true' />
                <filter type='and'>
                  <condition attribute='statecode' operator='eq' value='0' />
                    {filter}
                </filter>
              </entity>
            </fetch>";

            return(fetchString);
        }
Exemplo n.º 3
0
        public async Task <NewtonsoftJsonActionResult <QueryResult <CrmEntity> > > GetVehorderList(VehorderRequest vehorderRequest)
        {
            var list = await app.GetVehorderList(vehorderRequest);

            return(list);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 整车订单列表查询
 /// </summary>
 /// <param name="vehorderRequest"></param>
 /// <returns></returns>
 public async Task <QueryResult <CrmEntity> > GetVehorderList(VehorderRequest vehorderRequest)
 {
     return(await _vehorderService.GetVehorderList(vehorderRequest));
 }