增加出库任务单详情
增加订阅通知详情
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.Erp.OutStock;
|
||||
using WMS.Web.Core.Dto.Login;
|
||||
using WMS.Web.Core.Dto.OutStockTask;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
|
||||
namespace WMS.Web.Domain.IService.Public
|
||||
@@ -56,5 +57,11 @@ namespace WMS.Web.Domain.IService.Public
|
||||
/// <param name="begin"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> Sync(List<string> billNos = null,DateTime? begin=null);
|
||||
/// <summary>
|
||||
/// 查询出库任务单详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result<OutStockTaskInfoResponse>> GetInfo(int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
//编辑
|
||||
Task<OutStock> Edit(OutStock entity, bool isTransaction = true);
|
||||
//根据任务单Id搜索
|
||||
Task<OutStock> GetByTaskId(int taskId);
|
||||
Task<List<OutStock>> GetByTaskId(int taskId);
|
||||
// 获取列表
|
||||
Task<(List<OutStockQueryInfoResponse> list, int total)> GetListAsync(OutStockQueryRequest dto, int companyId = 0);
|
||||
/// 查询实体集合
|
||||
|
||||
@@ -17,6 +17,11 @@ namespace WMS.Web.Domain.Mappers
|
||||
CreateMap<SubscribeNotification, SubscribeNotification>();
|
||||
CreateMap<SaveSubscribeNotificationRequest, SubscribeNotification>();
|
||||
CreateMap<EditSubscribeNotificationRequest, SubscribeNotification>();
|
||||
CreateMap<SubscribeNotification, SubscribeNotificationInfoResponse>()
|
||||
.ForMember(x => x.Emails, ops => ops.MapFrom(x => string.Join(",", x.Emails)))
|
||||
.ForMember(x => x.Telephones, ops => ops.MapFrom(x => string.Join(",", x.Telephones)));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,13 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.Erp.Customer;
|
||||
using WMS.Web.Core.Dto.Erp.Org;
|
||||
using WMS.Web.Core.Dto.Erp.OutStock;
|
||||
using WMS.Web.Core.Dto.Login;
|
||||
using WMS.Web.Core.Dto.OutStockTask;
|
||||
using WMS.Web.Core.Help;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
@@ -32,10 +36,11 @@ namespace WMS.Web.Domain.Services
|
||||
private readonly IOutStockTaskRepositories _outStockTaskRepositories;
|
||||
private readonly IErpOpsSyncDateRepositories _erpOpsSyncDateRepositories;
|
||||
private readonly RedisClientService _redisClientService;
|
||||
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
|
||||
public OutStockTaskService(IMapper mapper, IErpService erpService, ILoginService loginService,
|
||||
IBasicsRepositories transactionRepositories,
|
||||
IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories, IErpOpsSyncDateRepositories erpOpsSyncDateRepositories,
|
||||
RedisClientService redisClientService)
|
||||
RedisClientService redisClientService, IErpBasicDataExtendService erpBasicDataExtendService)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_erpService = erpService;
|
||||
@@ -45,6 +50,7 @@ namespace WMS.Web.Domain.Services
|
||||
_outStockTaskRepositories = outStockTaskRepositories;
|
||||
_erpOpsSyncDateRepositories = erpOpsSyncDateRepositories;
|
||||
_redisClientService = redisClientService;
|
||||
_erpBasicDataExtendService = erpBasicDataExtendService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -435,6 +441,46 @@ namespace WMS.Web.Domain.Services
|
||||
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取出库任务单详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result<OutStockTaskInfoResponse>> GetInfo(int id)
|
||||
{
|
||||
var entity = await _outStockTaskRepositories.Get(id);
|
||||
if (entity == null)
|
||||
return Result<OutStockTaskInfoResponse>.ReFailure(ResultCodes.OutStockTaskNoData);
|
||||
//获取任务单对应出库信息
|
||||
var outStockList = await _outStockRepositories.GetByTaskId(id);
|
||||
|
||||
//取组织
|
||||
var org_result = await _erpService.BillQueryForOrg();
|
||||
List<ErpOrgDto> orgs = new List<ErpOrgDto>();
|
||||
if (org_result.IsSuccess)
|
||||
orgs = org_result.Data.ToList();
|
||||
|
||||
//取客户
|
||||
var customer_result = await _erpService.BillQueryForCustomer();
|
||||
List<ErpCustomerDto> customers = new List<ErpCustomerDto>();
|
||||
if (customer_result.IsSuccess)
|
||||
customers = customer_result.Data.ToList();
|
||||
|
||||
OutStockTaskInfoResponse response = new OutStockTaskInfoResponse()
|
||||
{
|
||||
Id = entity.Id,
|
||||
BillNo = entity.BillNo,
|
||||
SourceBillNo = string.Join(",", entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo)),
|
||||
CreateTime = entity.CreateTime.DateToStringSeconds(),
|
||||
Status = entity.Status.GetRemark(),
|
||||
Type = entity.Type.GetRemark(),
|
||||
DeliveryOrg = _erpBasicDataExtendService.GetOrgName(orgs, entity.DeliveryOrgId),
|
||||
ReceiptCustomer = entity.Type == OutStockType.Sal
|
||||
? _erpBasicDataExtendService.GetCustomerName(customers, entity.ReceiptCustomerId)
|
||||
: _erpBasicDataExtendService.GetOrgName(orgs, entity.DeliveryOrgId),
|
||||
};
|
||||
|
||||
return Result<OutStockTaskInfoResponse>.ReSuccess(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user