Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TakeStock
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengjinyang
TakeStock
Commits
3f3ffb11
Commit
3f3ffb11
authored
Jul 02, 2019
by
pengjinyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
744b4601
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
TakeStockService.cs
Service/TakeStock/TakeStockService.cs
+33
-0
No files found.
Service/TakeStock/TakeStockService.cs
View file @
3f3ffb11
...
...
@@ -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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment