Commit 4aaa8ec0 by pengjinyang

提交

parent d92f5a82
...@@ -51,7 +51,7 @@ namespace IService.TakeStock ...@@ -51,7 +51,7 @@ namespace IService.TakeStock
List<TakeStockOrderLog> SearchOrderLogs(Expression<Func<TakeStockOrderLog, bool>> expr); List<TakeStockOrderLog> SearchOrderLogs(Expression<Func<TakeStockOrderLog, bool>> expr);
Task PushTakeStockMsg(int id); //Task PushTakeStockMsg(int id);
///// <summary> ///// <summary>
///// 冻结库存 ///// 冻结库存
......
...@@ -296,7 +296,11 @@ namespace Service.TakeStock ...@@ -296,7 +296,11 @@ namespace Service.TakeStock
} }
if (isSuccess) if (isSuccess)
{
BackgroundJob.Enqueue(() => CheckComplete(order.ScheduleId)); BackgroundJob.Enqueue(() => CheckComplete(order.ScheduleId));
if(order.State == TSOrderState.完成)
PushTakeStockMsg(order);
}
else else
BackgroundJob.Schedule(() => SyncAndEnabledAsync(id), DateTimeOffset.UtcNow.AddMinutes(_delay)); BackgroundJob.Schedule(() => SyncAndEnabledAsync(id), DateTimeOffset.UtcNow.AddMinutes(_delay));
...@@ -325,9 +329,11 @@ namespace Service.TakeStock ...@@ -325,9 +329,11 @@ namespace Service.TakeStock
} }
} }
public async Task PushTakeStockMsg(int id) public async Task PushTakeStockMsg(TakeStockOrder order)
{ {
//var order = _orderRepository.Get(id); string message = JsonConvert.SerializeObject(new { Code = order.Code, WarehouseCode = order.WarehouseCode, Sku = order.Sku, Quantity = order.AfterQuantity ?? 0 });
_bus.Send("skuputin_queue", message);
//TakeStockMessage msg = new TakeStockMessage //TakeStockMessage msg = new TakeStockMessage
//{ //{
// Code = order.Code, // Code = order.Code,
...@@ -458,7 +464,11 @@ namespace Service.TakeStock ...@@ -458,7 +464,11 @@ namespace Service.TakeStock
} }
if (isSuccess) if (isSuccess)
{
BackgroundJob.Enqueue(() => Audit(order.ScheduleId)); BackgroundJob.Enqueue(() => Audit(order.ScheduleId));
if (order.State == TSOrderState.完成)
PushTakeStockMsg(order);
}
else else
BackgroundJob.Schedule(() => ModifAndEnabledAsync(id), DateTimeOffset.UtcNow.AddMinutes(_delay)); BackgroundJob.Schedule(() => ModifAndEnabledAsync(id), DateTimeOffset.UtcNow.AddMinutes(_delay));
......
...@@ -27,7 +27,7 @@ namespace TakeStock.API.Controllers ...@@ -27,7 +27,7 @@ namespace TakeStock.API.Controllers
[HttpGet] [HttpGet]
public IEnumerable<string> Get() public IEnumerable<string> Get()
{ {
takeStockAppService.PushTakeStockMsg(); //takeStockAppService.PushTakeStockMsg();
return new string[] { "value1", "value2" }; return new string[] { "value1", "value2" };
} }
......
...@@ -14,10 +14,11 @@ ...@@ -14,10 +14,11 @@
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Localhost": "server=10.0.8.14;database=bailun_wms;uid=root;pwd=#7kfnymAM$Y9-Ntf;port=3306;Convert Zero Datetime=True;", "Localhost": "server=10.0.8.14;database=bailun_wms;uid=root;pwd=#7kfnymAM$Y9-Ntf;port=3306;Convert Zero Datetime=True;",
//"Redis": "127.0.0.1"
"Redis": "common-redis", "Redis": "common-redis",
//"Redis": "129.204.97.78",
"RabbitMqConnection": "host=owms-rabbitmq:5672;username=bailun;password=1234abcd;prefetchcount=2;publisherConfirms=true;timeout=10" "RabbitMqConnection": "host=owms-rabbitmq:5672;username=bailun;password=1234abcd;prefetchcount=2;publisherConfirms=true;timeout=10"
//"Localhost": "server=gz-cdb-hqmznu0w.sql.tencentcdb.com;port=63523;database=bailun_wms;uid=root;password=#7kfnymAM$Y9-Ntf;Convert Zero Datetime=True;",
//"Redis": "129.204.97.78",
//"RabbitMqConnection": "host=111.230.164.154:5672;username=bailun;password=1234abcd;prefetchcount=2;publisherConfirms=true;timeout=10"
}, },
"App": { "App": {
"CorsOrigins": "*" "CorsOrigins": "*"
......
...@@ -172,7 +172,7 @@ namespace TakeStock.Application.TakeStock ...@@ -172,7 +172,7 @@ namespace TakeStock.Application.TakeStock
public async Task PushTakeStockMsg() public async Task PushTakeStockMsg()
{ {
await takeStockService.PushTakeStockMsg(0); //await takeStockService.PushTakeStockMsg(100);
} }
} }
} }
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