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
f57f7b60
Commit
f57f7b60
authored
Jun 27, 2019
by
pengjinyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
59866969
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
125 additions
and
117 deletions
+125
-117
TakeStockOrder.cs
Domain/Domain/TakeStock/TakeStockOrder.cs
+26
-0
TakeStockOrderLog.cs
Domain/Domain/TakeStock/TakeStockOrderLog.cs
+5
-0
TakeStockSchedule.cs
Domain/Domain/TakeStock/TakeStockSchedule.cs
+6
-0
TakeStockService.cs
Service/TakeStock/TakeStockService.cs
+71
-57
TakeStockController.cs
TakeStock.API/Controllers/TakeStockController.cs
+2
-2
Startup.cs
TakeStock.API/Startup.cs
+1
-1
appsettings.json
TakeStock.API/appsettings.json
+1
-1
OrderInputDto.cs
TakeStock.Application/TakeStock/Dto/OrderInputDto.cs
+2
-30
ScheduleInputDto.cs
TakeStock.Application/TakeStock/Dto/ScheduleInputDto.cs
+0
-22
TakeStockAppService.cs
TakeStock.Application/TakeStock/TakeStockAppService.cs
+1
-1
DbContext.cs
TakeStock.SqlSugar/DbContext.cs
+3
-2
Repository.cs
TakeStock.SqlSugar/Repository.cs
+7
-1
No files found.
Domain/Domain/TakeStock/TakeStockOrder.cs
View file @
f57f7b60
...
...
@@ -9,6 +9,12 @@ namespace Domain.Domain.TakeStock
[
SugarTable
(
"stock_takestockorder"
)]
public
class
TakeStockOrder
{
public
TakeStockOrder
()
{
this
.
Code
=
"TSO"
+
DateTime
.
Now
.
ToString
(
"yyMMddHHmmssfff"
);
this
.
CreationTime
=
DateTime
.
Now
;
}
[
SugarColumn
(
IsPrimaryKey
=
true
,
IsIdentity
=
true
)]
public
int
Id
{
get
;
set
;
}
...
...
@@ -47,6 +53,18 @@ namespace Domain.Domain.TakeStock
public
int
?
AfterQuantity
{
get
;
set
;
}
/// <summary>
/// 等待完结的配货单号
/// </summary>
[
SugarColumn
(
IsNullable
=
true
,
Length
=
1000
)]
public
string
WaitCodes
{
get
;
set
;
}
/// <summary>
/// 取消的配货单号
/// </summary>
[
SugarColumn
(
IsNullable
=
true
,
Length
=
1000
)]
public
string
CancelCodes
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
[
SugarColumn
(
IsNullable
=
true
,
Length
=
500
)]
...
...
@@ -62,5 +80,13 @@ namespace Domain.Domain.TakeStock
[
SugarColumn
(
IsNullable
=
true
)]
public
long
?
LastModifierUserId
{
get
;
set
;
}
public
bool
IsDeleted
{
get
;
set
;
}
[
SugarColumn
(
IsNullable
=
true
)]
public
long
?
DeleterUserId
{
get
;
set
;
}
[
SugarColumn
(
IsNullable
=
true
)]
public
DateTime
?
DeletionTime
{
get
;
set
;
}
}
}
Domain/Domain/TakeStock/TakeStockOrderLog.cs
View file @
f57f7b60
...
...
@@ -9,6 +9,11 @@ namespace Domain.Domain.TakeStock
[
SugarTable
(
"stock_takestockorder_log"
)]
public
class
TakeStockOrderLog
{
public
TakeStockOrderLog
()
{
this
.
CreationTime
=
DateTime
.
Now
;
}
[
SugarColumn
(
IsPrimaryKey
=
true
,
IsIdentity
=
true
)]
public
int
Id
{
get
;
set
;
}
...
...
Domain/Domain/TakeStock/TakeStockSchedule.cs
View file @
f57f7b60
...
...
@@ -9,6 +9,12 @@ namespace Domain.Domain.TakeStock
[
SugarTable
(
"stock_takestockschedule"
)]
public
class
TakeStockSchedule
{
public
TakeStockSchedule
()
{
this
.
Code
=
"TSS"
+
DateTime
.
Now
.
ToString
(
"yyMMddHHmmssfff"
);
this
.
CreationTime
=
DateTime
.
Now
;
}
[
SugarColumn
(
IsPrimaryKey
=
true
,
IsIdentity
=
true
)]
public
int
Id
{
get
;
set
;
}
...
...
Service/TakeStock/TakeStockService.cs
View file @
f57f7b60
...
...
@@ -54,6 +54,27 @@ namespace Service.TakeStock
});
}
private
async
Task
<
bool
>
AddOrUpdateLog
(
int
orderId
,
TSOrderState
state
,
string
content
,
string
jsonData
=
null
)
{
var
log
=
await
logRepository
.
FirstOrDefaultAsync
(
l
=>
l
.
OrderId
==
orderId
&&
l
.
State
==
state
);
if
(
log
==
null
)
{
log
=
new
TakeStockOrderLog
();
log
.
OrderId
=
orderId
;
log
.
State
=
state
;
}
else
log
.
LastModificationTime
=
DateTime
.
Now
;
log
.
Content
=
content
;
if
(!
string
.
IsNullOrWhiteSpace
(
jsonData
))
log
.
JsonData
=
jsonData
;
if
(
log
.
Id
>
0
)
return
await
logRepository
.
UpdateAsync
(
log
,
"Content"
,
"JsonData"
,
"LastModificationTime"
)
>
0
;
else
return
logRepository
.
InsertFulfill
(
log
);
}
/// <summary>
/// 冻结库存
/// </summary>
...
...
@@ -63,7 +84,7 @@ namespace Service.TakeStock
{
var
order
=
orderRepository
.
Get
(
id
);
bool
isSuccess
=
false
;
if
(
order
.
State
==
T
akeStockEnum
.
T
SOrderState
.
冻结库存
)
if
(
order
.
State
==
TSOrderState
.
冻结库存
)
isSuccess
=
true
;
else
{
...
...
@@ -79,30 +100,24 @@ namespace Service.TakeStock
{
string
responseContent
=
await
response
.
Content
.
ReadAsStringAsync
();
isFreeze
=
Convert
.
ToBoolean
(
JObject
.
Parse
(
responseContent
)[
"data"
]);
TakeStockOrderLog
log
=
new
TakeStockOrderLog
();
log
.
OrderId
=
id
;
Task
<
bool
>
logTask
=
null
;
if
(
isFreeze
)
{
order
.
State
=
T
akeStockEnum
.
T
SOrderState
.
冻结库存
;
order
.
State
=
TSOrderState
.
冻结库存
;
order
.
LastModificationTime
=
DateTime
.
Now
;
log
.
State
=
TakeStockEnum
.
TSOrderState
.
冻结库存
;
log
.
Content
=
"冻结库存成功。"
;
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
冻结库存
,
"冻结库存成功。"
);
isSuccess
=
true
;
}
else
{
order
.
State
=
T
akeStockEnum
.
T
SOrderState
.
异常
;
order
.
State
=
TSOrderState
.
异常
;
order
.
LastModificationTime
=
DateTime
.
Now
;
log
.
State
=
TakeStockEnum
.
TSOrderState
.
异常
;
log
.
Content
=
"冻结库存失败,WMS返回消息:"
+
JObject
.
Parse
(
responseContent
)[
"message"
];
log
.
JsonData
=
responseContent
;
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
异常
,
"冻结库存失败,WMS返回消息:"
+
JObject
.
Parse
(
responseContent
)[
"message"
],
responseContent
);
}
int
row
=
await
orderRepository
.
UpdateAsync
(
order
,
"State"
,
"LastModificationTime"
);
log
=
await
logRepository
.
InsertAsync
(
log
);
if
(!(
row
>
0
&&
log
.
Id
>
0
))
int
row
=
await
orderRepository
.
UpdateAsync
(
order
,
"State"
,
"LastModificationTime"
);
if
(!(
row
>
0
&&
await
logTask
))
isSuccess
=
false
;
}
}
...
...
@@ -125,7 +140,7 @@ namespace Service.TakeStock
{
var
order
=
orderRepository
.
Get
(
id
);
bool
isSuccess
=
false
;
if
(
order
.
State
==
T
akeStockEnum
.
T
SOrderState
.
释放库存
)
if
(
order
.
State
==
TSOrderState
.
释放库存
)
isSuccess
=
true
;
else
{
...
...
@@ -140,32 +155,38 @@ namespace Service.TakeStock
var
responseContent
=
await
response
.
Content
.
ReadAsStringAsync
();
var
jobj
=
JObject
.
Parse
(
responseContent
)[
"data"
];
isSuccess
=
jobj
[
"result"
].
ToObject
<
bool
>();
TakeStockOrderLog
log
=
new
TakeStockOrderLog
();
log
.
OrderId
=
id
;
Task
<
bool
>
logTask
=
null
;
if
(
isSuccess
)
{
order
.
State
=
T
akeStockEnum
.
T
SOrderState
.
释放库存
;
order
.
State
=
TSOrderState
.
释放库存
;
order
.
LastModificationTime
=
DateTime
.
Now
;
log
.
State
=
TakeStockEnum
.
TSOrderState
.
释放库存
;
log
.
Content
=
$"已释放占用库存。"
;
var
cancelCodes
=
jobj
[
"cancelCodes"
].
ToObject
<
List
<
string
>>();
if
(
cancelCodes
?.
Count
()
>
0
)
log
.
Content
+=
"取消了配货的订单:"
+
string
.
Join
(
';'
,
cancelCodes
);
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
释放库存
,
"已释放占用库存。"
);
}
else
{
order
.
State
=
T
akeStockEnum
.
T
SOrderState
.
异常
;
order
.
State
=
TSOrderState
.
异常
;
order
.
LastModificationTime
=
DateTime
.
Now
;
log
.
State
=
TakeStockEnum
.
TSOrderState
.
异常
;
log
.
Content
=
"释放占用库存失败,WMS返回消息:"
+
JObject
.
Parse
(
responseContent
)[
"message"
];
log
.
JsonData
=
responseContent
;
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
异常
,
"释放占用库存失败,WMS返回消息:"
+
jobj
[
"message"
],
responseContent
);
}
int
row
=
await
orderRepository
.
UpdateAsync
(
order
,
"State"
,
"LastModificationTime"
);
log
=
await
logRepository
.
InsertAsync
(
log
);
if
(!(
row
>
0
&&
log
.
Id
>
0
))
isSuccess
=
false
;
var
cancelCodes
=
jobj
[
"cancelCodes"
].
ToString
();
var
waitCodes
=
jobj
[
"waitCodes"
].
ToString
();
if
(!
cancelCodes
.
Equals
(
"[]"
))
{
order
.
CancelCodes
+=
","
+
cancelCodes
.
Trim
(
'['
,
']'
);
order
.
CancelCodes
=
order
.
CancelCodes
.
TrimStart
(
','
);
}
if
(!
waitCodes
.
Equals
(
"[]"
))
{
order
.
WaitCodes
+=
","
+
waitCodes
.
Trim
(
'['
,
']'
);
order
.
WaitCodes
=
order
.
WaitCodes
.
TrimStart
(
','
);
}
int
row
=
await
orderRepository
.
UpdateAsync
(
order
,
"State"
,
"CancelCodes"
,
"WaitCodes"
,
"LastModificationTime"
);
if
(!(
row
>
0
&&
await
logTask
))
isSuccess
=
false
;
}
}
...
...
@@ -191,7 +212,7 @@ namespace Service.TakeStock
{
var
order
=
orderRepository
.
Get
(
id
);
bool
isSuccess
=
false
;
if
(
order
.
State
==
T
akeStockEnum
.
T
SOrderState
.
完成
)
if
(
order
.
State
==
TSOrderState
.
完成
)
isSuccess
=
true
;
else
{
...
...
@@ -205,25 +226,19 @@ namespace Service.TakeStock
{
var
responseContent
=
await
response
.
Content
.
ReadAsStringAsync
();
isSuccess
=
Convert
.
ToBoolean
(
JObject
.
Parse
(
responseContent
)[
"data"
]);
TakeStockOrderLog
log
=
new
TakeStockOrderLog
();
log
.
OrderId
=
id
;
Task
<
bool
>
logTask
=
null
;
if
(
isSuccess
)
{
order
.
State
=
TakeStockEnum
.
TSOrderState
.
完成
;
log
.
State
=
TakeStockEnum
.
TSOrderState
.
完成
;
log
.
Content
=
$"同步并启用库存,盘点完成。"
;
order
.
State
=
TSOrderState
.
完成
;
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
完成
,
"同步并启用库存,盘点完成。"
,
responseContent
);
}
else
{
order
.
State
=
TakeStockEnum
.
TSOrderState
.
异常
;
log
.
State
=
TakeStockEnum
.
TSOrderState
.
异常
;
log
.
Content
=
"盘点失败,WMS返回消息:"
+
JObject
.
Parse
(
responseContent
)[
"message"
];
log
.
JsonData
=
responseContent
;
order
.
State
=
TSOrderState
.
异常
;
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
异常
,
"盘点失败,WMS返回消息:"
+
JObject
.
Parse
(
responseContent
)[
"message"
],
responseContent
);
}
int
row
=
await
orderRepository
.
UpdateAsync
(
order
,
"State"
,
"LastModificationTime"
);
log
=
await
logRepository
.
InsertAsync
(
log
);
if
(!(
row
>
0
&&
log
.
Id
>
0
))
if
(!(
row
>
0
&&
await
logTask
))
isSuccess
=
false
;
}
}
...
...
@@ -238,7 +253,7 @@ namespace Service.TakeStock
public
async
Task
CheckComplete
(
int
scheduleId
)
{
bool
isComplete
=
orderRepository
.
Count
(
o
=>
o
.
ScheduleId
==
scheduleId
&&
o
.
State
!=
T
akeStockEnum
.
TSOrderState
.
完成
&&
o
.
State
!=
TakeStockEnum
.
TSOrderState
.
取消
)
<=
0
;
bool
isComplete
=
orderRepository
.
Count
(
o
=>
o
.
ScheduleId
==
scheduleId
&&
o
.
State
!=
T
SOrderState
.
完成
&&
o
.
State
!=
TSOrderState
.
取消
)
<=
0
;
if
(
isComplete
)
{
var
schedule
=
scheduleRepository
.
Get
(
scheduleId
);
...
...
@@ -263,6 +278,7 @@ namespace Service.TakeStock
order
.
BeforeQuantity
=
beforeQuantity
;
order
.
LastModificationTime
=
DateTime
.
Now
;
var
record
=
await
orderRepository
.
UpdateAsync
(
order
,
"State"
,
"BeforeQuantity"
,
"LastModificationTime"
);
var
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
盘点中
,
"发起线下盘点。"
);
return
record
>
0
;
}
...
...
@@ -278,7 +294,8 @@ namespace Service.TakeStock
order
.
LastModificationTime
=
DateTime
.
Now
;
order
.
Description
=
description
;
var
record
=
await
orderRepository
.
UpdateAsync
(
order
,
"AfterQuantity"
,
"LastModificationTime"
,
"Description"
);
bool
isSuccess
=
record
>
0
;
var
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
盘点中
,
"盘点反馈。"
);
bool
isSuccess
=
record
>
0
&&
await
logTask
;
if
(
isSuccess
)
BackgroundJob
.
Enqueue
(()
=>
ModifAndEnabledAsync
(
order
.
Id
));
...
...
@@ -295,7 +312,7 @@ namespace Service.TakeStock
{
var
order
=
orderRepository
.
Get
(
id
);
bool
isSuccess
=
false
;
if
(
order
.
State
==
T
akeStockEnum
.
T
SOrderState
.
完成
)
if
(
order
.
State
==
TSOrderState
.
完成
)
isSuccess
=
true
;
else
{
...
...
@@ -309,25 +326,20 @@ namespace Service.TakeStock
{
var
responseContent
=
await
response
.
Content
.
ReadAsStringAsync
();
isSuccess
=
Convert
.
ToBoolean
(
JObject
.
Parse
(
responseContent
)[
"data"
]);
TakeStockOrderLog
log
=
new
TakeStockOrderLog
();
log
.
OrderId
=
id
;
Task
<
bool
>
logTask
=
null
;
if
(
isSuccess
)
{
order
.
State
=
TakeStockEnum
.
TSOrderState
.
完成
;
log
.
State
=
TakeStockEnum
.
TSOrderState
.
完成
;
log
.
Content
=
$"更新为盘点数并启用库存,盘点完成。"
;
order
.
State
=
TSOrderState
.
完成
;
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
完成
,
"更新为盘点数并启用库存,盘点完成。"
);
}
else
{
order
.
State
=
TakeStockEnum
.
TSOrderState
.
异常
;
log
.
State
=
TakeStockEnum
.
TSOrderState
.
异常
;
log
.
Content
=
"盘点失败,WMS返回消息:"
+
JObject
.
Parse
(
responseContent
)[
"message"
];
log
.
JsonData
=
responseContent
;
order
.
State
=
TSOrderState
.
异常
;
logTask
=
AddOrUpdateLog
(
id
,
TSOrderState
.
异常
,
"盘点失败,WMS返回消息:"
+
JObject
.
Parse
(
responseContent
)[
"message"
],
responseContent
);
}
int
row
=
await
orderRepository
.
UpdateAsync
(
order
,
"State"
,
"LastModificationTime"
);
log
=
await
logRepository
.
InsertAsync
(
log
);
if
(!(
row
>
0
&&
log
.
Id
>
0
))
if
(!(
row
>
0
&&
await
logTask
))
isSuccess
=
false
;
}
}
...
...
@@ -360,7 +372,9 @@ namespace Service.TakeStock
BackgroundJob
.
Enqueue
(()
=>
GainLoss
(
schedule
.
Id
));
}
else
{
schedule
.
State
=
TSScheduleState
.
完成
;
}
int
record
=
await
scheduleRepository
.
UpdateAsync
(
schedule
);
isSuccess
=
record
>
0
;
...
...
TakeStock.API/Controllers/TakeStockController.cs
View file @
f57f7b60
...
...
@@ -44,9 +44,9 @@ namespace TakeStock.API.Controllers
//}
[
HttpPost
]
public
async
Task
<
bool
>
PostCheckRecord
([
FromBody
]
ScheduleInputDto
record
)
public
async
Task
<
bool
>
CreateTakeStockSchedule
([
FromBody
]
ScheduleInputDto
record
)
{
var
result
=
await
takeStockAppService
.
Create
CheckRecord
(
record
);
var
result
=
await
takeStockAppService
.
Create
TakeStockSchedule
(
record
);
return
result
;
}
...
...
TakeStock.API/Startup.cs
View file @
f57f7b60
...
...
@@ -96,7 +96,7 @@ namespace TakeStock.API
app
.
UseHangfireDashboard
(
"/hangfire"
,
options
);
app
.
UseMvc
();
dbContext
.
Migration
();
//
dbContext.Migration();
}
public
void
RegisterHttpClient
(
IServiceCollection
services
)
...
...
TakeStock.API/appsettings.json
View file @
f57f7b60
...
...
@@ -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.1.74"
"Redis"
:
"172.31.1.74"
},
"App"
:
{
"CorsOrigins"
:
"*"
...
...
TakeStock.Application/TakeStock/Dto/OrderInputDto.cs
View file @
f57f7b60
...
...
@@ -8,43 +8,15 @@ namespace TakeStock.Application.TakeStock.Dto
public
class
OrderInputDto
{
/// <summary>
/// 盘点单号
/// </summary>
public
string
Code
{
get
;
set
;
}
/// <summary>
/// 仓库编码
/// </summary>
public
string
WarehouseCode
{
get
;
set
;
}
public
TSOrderState
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
Description
{
get
;
set
;
}
public
DateTime
CreationTime
{
get
;
set
;
}
public
long
?
CreatorUserId
{
get
;
set
;
}
public
DateTime
?
LastModificationTime
{
get
;
set
;
}
public
long
?
LastModifierUserId
{
get
;
set
;
}
public
long
?
CreatorUserId
{
get
;
set
;
}
}
}
TakeStock.Application/TakeStock/Dto/ScheduleInputDto.cs
View file @
f57f7b60
...
...
@@ -8,11 +8,6 @@ namespace TakeStock.Application.TakeStock.Dto
public
class
ScheduleInputDto
{
/// <summary>
/// 盘点单号
/// </summary>
public
string
Code
{
get
;
set
;
}
/// <summary>
/// 仓库编码
/// </summary>
public
string
WarehouseCode
{
get
;
set
;
}
...
...
@@ -28,29 +23,12 @@ namespace TakeStock.Application.TakeStock.Dto
public
bool
IsAutomation
{
get
;
set
;
}
/// <summary>
/// 状态
/// </summary>
public
TSScheduleState
State
{
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
;
}
public
virtual
List
<
OrderInputDto
>
Orders
{
get
;
set
;
}
}
}
TakeStock.Application/TakeStock/TakeStockAppService.cs
View file @
f57f7b60
...
...
@@ -19,7 +19,7 @@ namespace TakeStock.Application.TakeStock
this
.
takeStockService
=
takeStockService
;
}
public
async
Task
<
bool
>
Create
CheckRecord
(
ScheduleInputDto
input
)
public
async
Task
<
bool
>
Create
TakeStockSchedule
(
ScheduleInputDto
input
)
{
var
str
=
JsonConvert
.
SerializeObject
(
input
);
TakeStockSchedule
schedule
=
JsonConvert
.
DeserializeObject
<
TakeStockSchedule
>(
str
);
...
...
TakeStock.SqlSugar/DbContext.cs
View file @
f57f7b60
...
...
@@ -59,8 +59,8 @@ namespace SqlSugar
public
void
Migration
()
{
//
Db.CodeFirst.SetStringDefaultLength(20/*设置varchar默认长度为200*/)
//
.InitTables(typeof(TakeStockSchedule), typeof(TakeStockOrder), typeof(TakeStockOrderLog));//执行完数据库就有这个表了
Db
.
CodeFirst
.
SetStringDefaultLength
(
20
/*设置varchar默认长度为200*/
)
.
InitTables
(
typeof
(
TakeStockSchedule
),
typeof
(
TakeStockOrder
),
typeof
(
TakeStockOrderLog
));
//执行完数据库就有这个表了
}
}
}
\ No newline at end of file
TakeStock.SqlSugar/Repository.cs
View file @
f57f7b60
using
Domain
;
using
SqlSugar
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
...
...
@@ -241,5 +240,12 @@ namespace TakeStock.SqlSugar
else
return
client
.
Updateable
(
entity
).
ExecuteCommandAsync
();
}
// public void PageList(TEntity entity)
// {
// var pageJoin = client.Queryable<Student, School>((st, sc) => new object[] {
// JoinType.Left,st.SchoolId==sc.Id
//}).ToPageList(pageIndex, pageSize, ref totalCount);
// }
}
}
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