public async Task <ResponseBaseViewModel <GetCorpPolicyCustomerResponseViewModel> > GetCorpPolicyCustomers( [FromBody] GetCorpPolicyCustomerRequestViewModel request) { request.Cid = this.GetCid(); if (request.PolicyId == 0) { throw new Exception("政策Id不能为0"); } GetCorpPolicyCustomerResponseViewModel viewModel = new GetCorpPolicyCustomerResponseViewModel(); await new TaskFactory().StartNew(() => { viewModel = _getCorpPolicyCustomerApplication.GetCorpPolicyCustomer(request); }); ResponseBaseViewModel <GetCorpPolicyCustomerResponseViewModel> v = new ResponseBaseViewModel <GetCorpPolicyCustomerResponseViewModel> { Flag = new ResponseCodeViewModel() { Code = 0, MojoryToken = this.GetToken() }, Data = viewModel }; return(v); }
public GetCorpPolicyCustomerResponseViewModel GetCorpPolicyCustomer( GetCorpPolicyCustomerRequestViewModel request) { List <CorpPolicyCustomerModel> customerModels = _getCorpPolicyCustomerServiceBll.GetCorpPolicyCustomer(request.CorpId, request.PolicyId); GetCorpPolicyCustomerResponseViewModel viewModel = new GetCorpPolicyCustomerResponseViewModel(); viewModel.CustomerList = Mapper.Map <List <CorpPolicyCustomerModel>, List <CorpPolicyCustomerViewModel> >(customerModels); return(viewModel); }