Commit 3f3ffb11 by pengjinyang

提交

parent 744b4601
......@@ -8,6 +8,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
......@@ -100,6 +101,8 @@ namespace Service.TakeStock
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[DisplayName("冻结库存, 盘点单Id:{0}")]
[Queue("FreezeStock")]
public async Task<bool> FreezeStockAsync(int id)
{
var order = orderRepository.Get(id);
......@@ -156,6 +159,8 @@ namespace Service.TakeStock
/// <param name="warehouseCode"></param>
/// <param name="sku"></param>
/// <returns></returns>
[DisplayName("回滚库存, 盘点单Id:{0}")]
[Queue("RollbackStock")]
public async Task<bool> RollbackStockAsync(int id)
{
var order = orderRepository.Get(id);
......@@ -229,6 +234,8 @@ namespace Service.TakeStock
/// <param name="warehouseCode"></param>
/// <param name="sku"></param>
/// <returns></returns>
[DisplayName("同步并启用库存, 盘点单Id:{0}")]
[Queue("SyncAndEnabledStock")]
public async Task<bool> SyncAndEnabledAsync(int id)
{
var order = orderRepository.Get(id);
......@@ -329,6 +336,8 @@ namespace Service.TakeStock
/// <param name="warehouseCode"></param>
/// <param name="sku"></param>
/// <returns></returns>
[DisplayName("修改并启用库存, 盘点单Id:{0}")]
[Queue("ModifAndEnabledStock")]
public async Task<bool> ModifAndEnabledAsync(int id)
{
var order = orderRepository.Get(id);
......@@ -414,6 +423,12 @@ namespace Service.TakeStock
return isSuccess;
}
/// <summary>
/// 报溢报损
/// </summary>
/// <param name="scheduleId"></param>
[DisplayName("报溢报损, 盘点计划Id:{0}")]
[Queue("ModifAndEnabledStock")]
public void GainLoss(int scheduleId)
{
var schedule = scheduleRepository.Get(scheduleId);
......@@ -456,6 +471,8 @@ namespace Service.TakeStock
}
}
[DisplayName("远程调用报溢报损,")]
[Queue("ModifAndEnabledStock")]
public async Task<string> AddGainLoss(object obj)
{
string code = string.Empty;
......@@ -477,6 +494,13 @@ namespace Service.TakeStock
return code;
}
/// <summary>
/// 取消盘点单
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[DisplayName("取消盘点, 盘点单Id:{0}")]
[Queue("CancelTakeStock")]
public async Task<bool> CancelOrder(int id)
{
var order = orderRepository.Get(id);
......@@ -519,6 +543,13 @@ namespace Service.TakeStock
return isSuccess;
}
/// <summary>
/// 取消盘点计划
/// </summary>
/// <param name="scheduleId"></param>
/// <returns></returns>
[DisplayName("取消盘点, 盘点计划Id:{0}")]
[Queue("CancelTakeStock")]
private async Task CancelSchedule(int scheduleId)
{
var schedule = scheduleRepository.Get(scheduleId);
......@@ -537,6 +568,8 @@ namespace Service.TakeStock
int record = await scheduleRepository.UpdateAsync(schedule, "State", "LastModificationTime");
isSuccess = record > 0;
}
else
isSuccess = true;
if (!isSuccess)
BackgroundJob.Schedule(() => CancelSchedule(scheduleId), DateTimeOffset.UtcNow.AddMinutes(delay));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment