非采购上架接口
This commit is contained in:
@@ -13,11 +13,18 @@ namespace WMS.Web.Domain.IService
|
||||
public interface IInStockTaskService
|
||||
{
|
||||
/// <summary>
|
||||
/// 来源单-与金蝶校准-第二步-pad
|
||||
/// 来源单-与金蝶校准-第二步-pad:这个只针对采购订单
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNo"></param>
|
||||
/// <returns></returns>
|
||||
Task<ResultList<InStockTaskBillNoQueryResponse>> Adjust(string sourceBillNo);
|
||||
Task<ResultList<SourceBillNoQueryResponse>> Adjust(string sourceBillNo);
|
||||
|
||||
/// <summary>
|
||||
/// 来源单-与金蝶校准-第二步-pad:这个是非采购订单上架使用
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNo"></param>
|
||||
/// <returns></returns>
|
||||
Task<ResultList<SourceBillNoNoPurchaseQueryResponse>> AdjustNoPurchase(string sourceBillNo);
|
||||
/// <summary>
|
||||
/// 同步:采购入库类型单据
|
||||
/// </summary>
|
||||
@@ -25,5 +32,13 @@ namespace WMS.Web.Domain.IService
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> SsynPurchaseInStock(List<string> billNos = null, bool isTransaction=true);
|
||||
|
||||
/// <summary>
|
||||
/// 同步:其他入库类型单据
|
||||
/// </summary>
|
||||
/// <param name="billNos"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> SysnMiscellaneous(List<string> billNos = null, bool isTransaction = true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,15 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNo"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<InStockTaskBillNoQueryResponse>> GetListBy(InStockTaskBillNoQueryRequest dto);
|
||||
Task<List<SourceBillNoQueryResponse>> GetListBy(InStockTaskBillNoQueryRequest dto);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 列表-根据来源单模糊查询-非采购上架使用
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<SourceBillNoNoPurchaseQueryResponse>> GetListInfoBy(InStockTaskBillNoQueryRequest dto);
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace WMS.Web.Domain.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 非采购单上架-按箱
|
||||
/// 非采购单上架
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="loginInDto"></param>
|
||||
@@ -203,7 +203,7 @@ namespace WMS.Web.Domain.Services
|
||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
}
|
||||
/// <summary>
|
||||
/// 非采购上架-按箱-保存
|
||||
/// 非采购上架-保存
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="staffId"></param>
|
||||
|
||||
@@ -41,11 +41,11 @@ namespace WMS.Web.Domain.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 来源单-与金蝶校准-第二步-pad
|
||||
/// 来源单-与金蝶校准-第二步-pad:这个只针对采购订单
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNo"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ResultList<InStockTaskBillNoQueryResponse>> Adjust(string sourceBillNo)
|
||||
public async Task<ResultList<SourceBillNoQueryResponse>> Adjust(string sourceBillNo)
|
||||
{
|
||||
//1.事务
|
||||
IDbContextTransaction _transaction = _basicsRepositories.GetTransaction();
|
||||
@@ -55,20 +55,55 @@ namespace WMS.Web.Domain.Services
|
||||
//2.查看是否有入库任务单
|
||||
var task = await _inStockTaskRepositories.GetBySource(sourceBillNo);
|
||||
if (task == null)
|
||||
return ResultList<InStockTaskBillNoQueryResponse>.ReFailure(ResultCodes.OrderNoData);
|
||||
return ResultList<SourceBillNoQueryResponse>.ReFailure(ResultCodes.OrderNoData);
|
||||
|
||||
//3.有的话就同步一下金蝶的数据
|
||||
var billNos = new List<string>();
|
||||
billNos.Add(sourceBillNo);
|
||||
//3.1采购订单类型-进去金蝶交互更新
|
||||
if (task.Type == InstockType.Purchase)
|
||||
{
|
||||
var result = await this.SsynPurchaseInStock(billNos, isTransaction);
|
||||
if (!result.IsSuccess) isRollback = true;
|
||||
}
|
||||
|
||||
//4.提交事务
|
||||
var isSuccess = _basicsRepositories.CommitTransaction(isRollback, _transaction);
|
||||
if (!isSuccess)
|
||||
return ResultList<SourceBillNoQueryResponse>.ReFailure(ResultCodes.AdjustError);
|
||||
|
||||
|
||||
//5.再一次查询新的数据:并返回最后的结果
|
||||
var request = new InStockTaskBillNoQueryRequest() { SourceBillNo = sourceBillNo };
|
||||
var list = await _inStockTaskRepositories.GetListBy(request);
|
||||
return ResultList<SourceBillNoQueryResponse>.ReSuccess(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 来源单-与金蝶校准-第二步-pad:这个是非采购订单上架使用
|
||||
/// </summary>
|
||||
/// <param name="sourceBillNo"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ResultList<SourceBillNoNoPurchaseQueryResponse>> AdjustNoPurchase(string sourceBillNo)
|
||||
{
|
||||
//1.事务
|
||||
IDbContextTransaction _transaction = _basicsRepositories.GetTransaction();
|
||||
bool isRollback = false;
|
||||
bool isTransaction = false;
|
||||
|
||||
//2.查看是否有入库任务单
|
||||
var task = await _inStockTaskRepositories.GetBySource(sourceBillNo);
|
||||
if (task == null)
|
||||
return ResultList<SourceBillNoNoPurchaseQueryResponse>.ReFailure(ResultCodes.OrderNoData);
|
||||
|
||||
//3.有的话就同步一下金蝶的数据
|
||||
var billNos = new List<string>();
|
||||
billNos.Add(sourceBillNo);
|
||||
//3.1这里要对入库任务单的类型逐一判断,进行去ErpService找对应的单据类型重新获取;这里只有采购,后面再加其它的
|
||||
if (task.Type == InstockType.Purchase)
|
||||
if (task.Type == InstockType.Miscellaneous)
|
||||
{
|
||||
var result = await this.SsynPurchaseInStock(billNos, isTransaction);
|
||||
var result = await this.SysnMiscellaneous(billNos, isTransaction);
|
||||
if (!result.IsSuccess) isRollback = true;
|
||||
}
|
||||
else if (task.Type == InstockType.Miscellaneous)
|
||||
{
|
||||
|
||||
}
|
||||
else if (task.Type == InstockType.Assembled)
|
||||
{
|
||||
@@ -82,18 +117,16 @@ namespace WMS.Web.Domain.Services
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//4.提交事务
|
||||
var isSuccess = _basicsRepositories.CommitTransaction(isRollback, _transaction);
|
||||
if (!isSuccess)
|
||||
return ResultList<InStockTaskBillNoQueryResponse>.ReFailure(ResultCodes.AdjustError);
|
||||
return ResultList<SourceBillNoNoPurchaseQueryResponse>.ReFailure(ResultCodes.AdjustError);
|
||||
|
||||
|
||||
//5.再一次查询新的数据:并返回最后的结果
|
||||
var request = new InStockTaskBillNoQueryRequest() { SourceBillNo = sourceBillNo };
|
||||
var list = await _inStockTaskRepositories.GetListBy(request);
|
||||
return ResultList<InStockTaskBillNoQueryResponse>.ReSuccess(list);
|
||||
var list = await _inStockTaskRepositories.GetListInfoBy(request);
|
||||
return ResultList<SourceBillNoNoPurchaseQueryResponse>.ReSuccess(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user