public async Task <XDocument> Getdeliverorderflow(DeliveryDetailRequest deliveryDetailRequest) { return(await Task <XDocument> .Run(() => { var fetchXml = $@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'> <entity name='mcs_deliverorderflow'> <attribute name='businessprocessflowinstanceid' /> <attribute name='bpf_name' /> <attribute name='createdon' /> <attribute name='traversedpath' /> <attribute name='statuscode' /> <attribute name='statecode' /> <attribute name='processid' /> <attribute name='activestagestartedon' /> <attribute name='activestageid' /> <attribute name='bpf_duration' /> <attribute name='completedon' /> <attribute name='overriddencreatedon' /> <attribute name='createdonbehalfby' /> <attribute name='createdby' /> <attribute name='modifiedonbehalfby' /> <attribute name='modifiedby' /> <attribute name='modifiedon' /> <attribute name='bpf_mcs_vehdeliveryid' /> <order attribute='bpf_name' descending='false' /> <filter type='and'> <condition attribute='bpf_mcs_vehdeliveryid' operator='eq' value='{deliveryDetailRequest.Id}' /> </filter> </entity> </fetch>"; return XDocument.Parse(fetchXml); })); }
public async Task <CrmEntity> get(DeliveryDetailRequest deliveryDetailRequest) { try { var crmRequestHelper = new CrmRequestHelper(); var entity = await crmRequestHelper.Retrieve(_crmService, entityName, Guid.Parse(deliveryDetailRequest.Id)); return(entity); } catch (Exception ex) { throw ex; } }
public async Task <CrmEntity> getdeliverorderflow(DeliveryDetailRequest deliveryDetailRequest) { try { var crmRequestHelper = new CrmRequestHelper(); XDocument fetchXdoc = fetchXdoc = await _deliveryRepository.Getdeliverorderflow(deliveryDetailRequest); var entities = await crmRequestHelper.ExecuteAsync(_crmService, systemuserEntityName, fetchXdoc); return(entities.Results[0]); } catch (Exception ex) { throw ex; } }
public async Task <ValidateResult <string> > moneycompleted(DeliveryDetailRequest deliveryDetailRequest) { try { var validateResult = new ValidateResult <string>(); var crmRequestHelper = new CrmRequestHelper(); var entity = await crmRequestHelper.Retrieve(_crmService, entityName, Guid.Parse(deliveryDetailRequest.Id)); if (entity != null) { var deliverystatus = entity.Attributes.Value <int>("mcs_deliverystatus"); //待检测 if (deliverystatus != 4) { validateResult.Result = false; validateResult.Description = "交车单状态不符合!"; return(validateResult); } var delivery = new CrmExecuteEntity(entityName, Guid.Parse(deliveryDetailRequest.Id)); delivery.Attributes.Add("mcs_settlestatus", 1); delivery.Attributes.Add("mcs_deliverystatus", 5); await _crmService.Update(delivery); validateResult.Result = true; validateResult.Description = "操作成功"; return(validateResult); } else { validateResult.Result = false; validateResult.Description = "交车单不存在!"; return(validateResult); } } catch (Exception ex) { throw ex; } }
public async Task <CrmEntity> getdeliverorderflow(DeliveryDetailRequest deliveryDetailRequest) { return(await _service.getdeliverorderflow(deliveryDetailRequest)); }
public async Task <ValidateResult <string> > moneycompleted(DeliveryDetailRequest deliveryDetailRequest) { return(await _service.moneycompleted(deliveryDetailRequest)); }
public async Task <CrmEntity> getmateriel(DeliveryDetailRequest deliveryDetailRequest) { return(await _service.getmateriel(deliveryDetailRequest)); }
public async Task <NewtonsoftJsonActionResult <CrmEntity> > get(DeliveryDetailRequest deliveryDetailRequest) { return(await _appDelivery.get(deliveryDetailRequest)); }
public async Task <NewtonsoftJsonActionResult <ValidateResult <string> > > moneycompleted(DeliveryDetailRequest deliveryDetailRequest) { return(await _appDelivery.moneycompleted(deliveryDetailRequest)); }