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
8e944f54
Commit
8e944f54
authored
Jul 09, 2019
by
pengjinyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
1bbde191
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
248 additions
and
1 deletion
+248
-1
ITakeStockService.cs
IService/TakeStock/ITakeStockService.cs
+11
-0
TakeStockService.cs
Service/TakeStock/TakeStockService.cs
+31
-0
TakeStockController.cs
TakeStock.API/Controllers/TakeStockController.cs
+18
-0
appsettings.json
TakeStock.API/appsettings.json
+1
-1
TakeStockProfile.cs
...tock.Application/TakeStock/AutoMapper/TakeStockProfile.cs
+2
-0
LogOutputDto.cs
TakeStock.Application/TakeStock/Dto/LogOutputDto.cs
+27
-0
OrderOutputDto.cs
TakeStock.Application/TakeStock/Dto/OrderOutputDto.cs
+70
-0
SearchOrderByPageInputDto.cs
...ck.Application/TakeStock/Dto/SearchOrderByPageInputDto.cs
+13
-0
SearchOrderByPageOutputDto.cs
...k.Application/TakeStock/Dto/SearchOrderByPageOutputDto.cs
+13
-0
SearchOrderInputDto.cs
TakeStock.Application/TakeStock/Dto/SearchOrderInputDto.cs
+16
-0
TakeStockAppService.cs
TakeStock.Application/TakeStock/TakeStockAppService.cs
+46
-0
No files found.
IService/TakeStock/ITakeStockService.cs
View file @
8e944f54
...
...
@@ -32,6 +32,13 @@ namespace IService.TakeStock
Task
<
bool
>
Feedback
(
int
id
,
int
afterQuantity
,
string
description
);
/// <summary>
/// 盘点结果反馈
/// </summary>
/// <param name="order"></param>
/// <returns></returns>
Task
<
bool
>
SaveDescription
(
int
id
,
string
description
);
/// <summary>
/// 取消盘点的订单
/// </summary>
/// <param name="id"></param>
...
...
@@ -40,6 +47,10 @@ namespace IService.TakeStock
(
int
total
,
List
<
TakeStockSchedule
>
items
)
SearchScheduleByPage
(
int
pageIndex
,
int
pageSize
,
Expression
<
Func
<
TakeStockSchedule
,
bool
>>
expr
);
(
int
total
,
List
<
TakeStockOrder
>
items
)
SearchOrderByPage
(
int
pageIndex
,
int
pageSize
,
Expression
<
Func
<
TakeStockOrder
,
bool
>>
expr
);
List
<
TakeStockOrderLog
>
SearchOrderLogs
(
Expression
<
Func
<
TakeStockOrderLog
,
bool
>>
expr
);
///// <summary>
///// 冻结库存
///// </summary>
...
...
Service/TakeStock/TakeStockService.cs
View file @
8e944f54
...
...
@@ -351,6 +351,25 @@ namespace Service.TakeStock
}
/// <summary>
/// 盘点反馈
/// </summary>
/// <param name="order"></param>
/// <returns></returns>
public
async
Task
<
bool
>
SaveDescription
(
int
id
,
string
description
)
{
var
order
=
orderRepository
.
Get
(
id
);
order
.
LastModificationTime
=
DateTime
.
Now
;
order
.
Description
=
description
;
var
record
=
await
orderRepository
.
UpdateAsync
(
order
,
"LastModificationTime"
,
"Description"
);
var
logTask
=
await
AddOrUpdateLog
(
id
,
order
.
State
,
"保存盘点描述。"
);
bool
isSuccess
=
record
>
0
&&
logTask
;
if
(
isSuccess
)
BackgroundJob
.
Enqueue
(()
=>
ModifAndEnabledAsync
(
order
.
Id
));
return
isSuccess
;
}
/// <summary>
/// 同步和启用库存
/// </summary>
/// <param name="warehouseCode"></param>
...
...
@@ -605,5 +624,17 @@ namespace Service.TakeStock
return
(
totalCount
,
data
);
}
public
(
int
total
,
List
<
TakeStockOrder
>
items
)
SearchOrderByPage
(
int
pageIndex
,
int
pageSize
,
Expression
<
Func
<
TakeStockOrder
,
bool
>>
expr
)
{
int
totalCount
=
0
;
var
data
=
scheduleRepository
.
PageList
(
pageIndex
,
pageSize
,
expr
,
out
totalCount
);
return
(
totalCount
,
data
);
}
public
List
<
TakeStockOrderLog
>
SearchOrderLogs
(
Expression
<
Func
<
TakeStockOrderLog
,
bool
>>
expr
)
{
var
data
=
logRepository
.
GetAllList
(
expr
);
return
data
;
}
}
}
TakeStock.API/Controllers/TakeStockController.cs
View file @
8e944f54
...
...
@@ -68,6 +68,12 @@ namespace TakeStock.API.Controllers
return
await
takeStockAppService
.
Feedback
(
input
);
}
[
HttpPost
(
"SaveDescription"
)]
public
async
Task
<
bool
>
SaveDescription
([
FromBody
]
FeedbackInputDto
input
)
{
return
await
takeStockAppService
.
SaveDescription
(
input
);
}
[
HttpGet
(
"CancelOrder"
)]
public
async
Task
<
bool
>
CancelOrder
(
int
id
)
{
...
...
@@ -85,5 +91,17 @@ namespace TakeStock.API.Controllers
{
return
await
takeStockAppService
.
SearchScheduleByPage
(
input
);
}
[
HttpPost
(
"GetOrderByPage"
)]
public
async
Task
<
SearchOrderByPageOutputDto
>
GetOrderByPage
([
FromBody
]
SearchOrderByPageInputDto
input
)
{
return
await
takeStockAppService
.
SearchOrderByPage
(
input
);
}
[
HttpGet
(
"GetOrderLogs"
)]
public
async
Task
<
List
<
LogOutputDto
>>
GetOrderLogs
(
int
id
)
{
return
await
takeStockAppService
.
SearchOrderLogs
(
id
);
}
}
}
TakeStock.API/appsettings.json
View file @
8e944f54
...
...
@@ -15,7 +15,7 @@
"ConnectionStrings"
:
{
"Localhost"
:
"server=gz-cdb-hqmznu0w.sql.tencentcdb.com;port=63523;database=bailun_wms;uid=root;password=#7kfnymAM$Y9-Ntf;Convert Zero Datetime=True;Allow User Variables=true;"
,
//
"Redis"
:
"127.0.0.1"
"Redis"
:
"
172.31.0.76
"
"Redis"
:
"
common-redis
"
//
"Redis"
:
"129.204.97.78"
},
"App"
:
{
...
...
TakeStock.Application/TakeStock/AutoMapper/TakeStockProfile.cs
View file @
8e944f54
...
...
@@ -12,6 +12,8 @@ namespace TakeStock.Application.TakeStock.AutoMapper
public
TakeStockProfile
()
{
CreateMap
<
TakeStockSchedule
,
ScheduleOutputDto
>();
CreateMap
<
TakeStockOrder
,
OrderOutputDto
>();
CreateMap
<
TakeStockOrderLog
,
LogOutputDto
>();
}
}
}
TakeStock.Application/TakeStock/Dto/LogOutputDto.cs
0 → 100644
View file @
8e944f54
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
TakeStock.Application.TakeStock.Dto
{
public
class
LogOutputDto
{
public
int
Id
{
get
;
set
;
}
public
int
OrderId
{
get
;
set
;
}
public
string
State
{
get
;
set
;
}
public
string
Content
{
get
;
set
;
}
public
string
JsonData
{
get
;
set
;
}
public
DateTime
CreationTime
{
get
;
set
;
}
public
long
?
CreatorUserId
{
get
;
set
;
}
public
DateTime
?
LastModificationTime
{
get
;
set
;
}
public
long
?
LastModifierUserId
{
get
;
set
;
}
}
}
TakeStock.Application/TakeStock/Dto/OrderOutputDto.cs
0 → 100644
View file @
8e944f54
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
static
Domain
.
Domain
.
TakeStock
.
TakeStockEnum
;
namespace
TakeStock.Application.TakeStock.Dto
{
public
class
OrderOutputDto
{
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 盘点单号
/// </summary>
public
string
Code
{
get
;
set
;
}
public
int
ScheduleId
{
get
;
set
;
}
/// <summary>
/// 仓库编码
/// </summary>
public
string
WarehouseCode
{
get
;
set
;
}
public
string
State
{
get
;
set
;
}
/// <summary>
/// 产品sku
/// </summary>
public
string
Sku
{
get
;
set
;
}
/// <summary>
/// 盘点前数量
/// </summary>
public
int
?
BeforeQuantity
{
get
;
set
;
}
/// <summary>
/// 盘点后数量
/// </summary>
public
int
?
AfterQuantity
{
get
;
set
;
}
/// <summary>
/// 等待完结的配货单号
/// </summary>
public
string
WaitCodes
{
get
;
set
;
}
/// <summary>
/// 取消的配货单号
/// </summary>
public
string
CancelCodes
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
Description
{
get
;
set
;
}
public
DateTime
CreationTime
{
get
;
set
;
}
public
long
?
CreatorUserId
{
get
;
set
;
}
public
DateTime
?
LastModificationTime
{
get
;
set
;
}
public
long
?
LastModifierUserId
{
get
;
set
;
}
public
bool
IsDeleted
{
get
;
set
;
}
public
long
?
DeleterUserId
{
get
;
set
;
}
public
DateTime
?
DeletionTime
{
get
;
set
;
}
}
}
TakeStock.Application/TakeStock/Dto/SearchOrderByPageInputDto.cs
0 → 100644
View file @
8e944f54
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
TakeStock.Application.Page
;
namespace
TakeStock.Application.TakeStock.Dto
{
public
class
SearchOrderByPageInputDto
{
public
SearchOrderInputDto
Search
{
get
;
set
;
}
public
PageInputDto
Page
{
get
;
set
;
}
}
}
TakeStock.Application/TakeStock/Dto/SearchOrderByPageOutputDto.cs
0 → 100644
View file @
8e944f54
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
TakeStock.Application.Page
;
namespace
TakeStock.Application.TakeStock.Dto
{
public
class
SearchOrderByPageOutputDto
{
public
List
<
OrderOutputDto
>
Items
{
get
;
set
;
}
public
PageOutputDto
PageItem
{
get
;
set
;
}
}
}
TakeStock.Application/TakeStock/Dto/SearchOrderInputDto.cs
0 → 100644
View file @
8e944f54
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
static
Domain
.
Domain
.
TakeStock
.
TakeStockEnum
;
namespace
TakeStock.Application.TakeStock.Dto
{
public
class
SearchOrderInputDto
{
public
int
ScheduleId
{
get
;
set
;
}
public
string
Code
{
get
;
set
;
}
public
TSOrderState
?
State
{
get
;
set
;
}
}
}
TakeStock.Application/TakeStock/TakeStockAppService.cs
View file @
8e944f54
...
...
@@ -46,6 +46,11 @@ namespace TakeStock.Application.TakeStock
return
await
takeStockService
.
Feedback
(
input
.
Id
,
input
.
AfterQuantity
,
input
.
Description
);
}
public
async
Task
<
bool
>
SaveDescription
(
FeedbackInputDto
input
)
{
return
await
takeStockService
.
SaveDescription
(
input
.
Id
,
input
.
Description
);
}
public
async
Task
<
bool
>
CancelOrder
(
int
id
)
{
return
await
takeStockService
.
CancelOrder
(
id
);
...
...
@@ -81,5 +86,46 @@ namespace TakeStock.Application.TakeStock
}
};
}
private
Expression
<
Func
<
TakeStockOrder
,
bool
>>
OrderQuery
(
SearchOrderInputDto
search
)
{
Expression
<
Func
<
TakeStockOrder
,
bool
>>
expr
=
s
=>
s
.
ScheduleId
==
search
.
ScheduleId
;
//if (search.ScheduleId > 0)
// expr.And();
if
(!
string
.
IsNullOrWhiteSpace
(
search
.
Code
))
expr
.
And
(
s
=>
s
.
Code
.
Equals
(
search
.
Code
));
if
(
search
.
State
!=
null
)
expr
.
And
(
s
=>
s
.
State
.
Equals
(
search
.
State
));
return
expr
;
}
public
async
Task
<
SearchOrderByPageOutputDto
>
SearchOrderByPage
(
SearchOrderByPageInputDto
input
)
{
int
pageIndex
=
input
.
Page
.
Page
;
int
pageSize
=
input
.
Page
.
Rows
;
var
expr
=
OrderQuery
(
input
.
Search
);
var
data
=
takeStockService
.
SearchOrderByPage
(
pageIndex
,
pageSize
,
expr
);
var
total
=
data
.
total
;
var
items
=
data
.
items
;
return
new
SearchOrderByPageOutputDto
{
Items
=
_mapper
.
Map
<
List
<
OrderOutputDto
>>(
items
),
PageItem
=
new
Page
.
PageOutputDto
{
Total
=
total
,
CurrentPage
=
pageIndex
,
PageSize
=
pageSize
}
};
}
public
async
Task
<
List
<
LogOutputDto
>>
SearchOrderLogs
(
int
orderId
)
{
Expression
<
Func
<
TakeStockOrderLog
,
bool
>>
expr
=
l
=>
l
.
OrderId
==
orderId
;
var
data
=
takeStockService
.
SearchOrderLogs
(
expr
);
return
_mapper
.
Map
<
List
<
LogOutputDto
>>(
data
);
}
}
}
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