Example #1
0
        /// <summary>
        /// 新增客户
        /// </summary>
        /// <param name="input">条件参数</param>
        /// <returns></returns>
        public async Task <bool> CreatePptCustomerAsync(Ppt_Customer_AppCreateInputDto input)
        {
            try
            {
                string errMsg = await _manager.CreateValidateAsync(input);

                if (!string.IsNullOrWhiteSpace(errMsg))
                {
                    throw new Exception(errMsg);
                }
                var result = await base.Create(input);

                input.CustomerConsigneeList.ForEach(d => d.Customerid = result.Id);
                input.CustomerWarehouseList.ForEach(d => d.Customerid = result.Id);

                await _customerConsigneeAppService.CreateDescCustomerConsigneeAsync(result.Id, input.CustomerConsigneeList);

                await _customerWarehouseAppService.CreateDescCustomerWarehouseAsync(result.Id, input.CustomerWarehouseList);

                //日志
                var queueLog = QueueUtils.BuildQueueLog(LogType.OPERATION, string.Format($"客户 {input.Name}"), input.OperaterUserId, input.OperaterUserName, input.TenantId, result.Id, input.Warehouseid, OperationType.CREATE, TitleType.CREATE, input.Systemtype);
                await _capPublisher.PublishAsync(CapQueueName.Log_Basis, queueLog);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }