Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_local_platform
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_local_platform
Commits
14808cb6
Commit
14808cb6
authored
Sep 22, 2023
by
赵剑炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改dal层数据
parent
cc60725d
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
33 行增加
和
20 行删除
+33
-20
BaseInfoController.cs
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
+2
-2
Startup.cs
WebApiNET6-master/APIs/Startup.cs
+5
-0
RecordsReq.cs
WebApiNET6-master/Models/ReqModel/RecordsReq.cs
+14
-12
LogSummaryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
+2
-2
LogService.cs
WebApiNET6-master/Services/LogService.cs
+10
-4
没有找到文件。
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
View file @
14808cb6
...
@@ -91,7 +91,7 @@ namespace APIs.Controllers
...
@@ -91,7 +91,7 @@ namespace APIs.Controllers
{
{
reqTime
=
DateTime
.
Parse
(
req
.
updateTime
);
reqTime
=
DateTime
.
Parse
(
req
.
updateTime
);
}
}
var
typeQuery
=
await
_equipment
Siz
eService
.
Query
(
p
=>
p
.
updateTime
>=
reqTime
);
var
typeQuery
=
await
_equipment
Typ
eService
.
Query
(
p
=>
p
.
updateTime
>=
reqTime
);
List
<
EquipmentTypeDto
>
typeDto
=
new
List
<
EquipmentTypeDto
>()
;
List
<
EquipmentTypeDto
>
typeDto
=
new
List
<
EquipmentTypeDto
>()
;
Mapper
.
Map
(
typeQuery
,
typeDto
);
Mapper
.
Map
(
typeQuery
,
typeDto
);
var
src
=
new
ApiResult
var
src
=
new
ApiResult
...
@@ -232,7 +232,7 @@ namespace APIs.Controllers
...
@@ -232,7 +232,7 @@ namespace APIs.Controllers
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
async
Task
<
string
>
SendMQ
([
FromBody
(
EmptyBodyBehavior
=
EmptyBodyBehavior
.
Allow
)
]
RecordsReq
req
)
public
async
Task
<
string
>
SendMQ
([
FromBody
]
RecordsReq
req
)
{
{
await
RabbitMQContext
.
SendMessageAsynce
(
JsonConvert
.
SerializeObject
(
req
));
await
RabbitMQContext
.
SendMessageAsynce
(
JsonConvert
.
SerializeObject
(
req
));
...
...
WebApiNET6-master/APIs/Startup.cs
View file @
14808cb6
...
@@ -33,9 +33,14 @@ namespace APIs
...
@@ -33,9 +33,14 @@ namespace APIs
services
.
AddMemoryCache
();
services
.
AddMemoryCache
();
//services.AddControllers(o =>
//{
// o.AllowEmptyInputInBodyModelBinding = true;
//});
services
.
AddControllers
()
services
.
AddControllers
()
.
AddNewtonsoftJson
(
options
=>
.
AddNewtonsoftJson
(
options
=>
{
{
options
.
SerializerSettings
.
ReferenceLoopHandling
=
Newtonsoft
.
Json
.
ReferenceLoopHandling
.
Ignore
;
options
.
SerializerSettings
.
ReferenceLoopHandling
=
Newtonsoft
.
Json
.
ReferenceLoopHandling
.
Ignore
;
options
.
SerializerSettings
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
options
.
SerializerSettings
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
});
});
...
...
WebApiNET6-master/Models/ReqModel/RecordsReq.cs
View file @
14808cb6
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Diagnostics.CodeAnalysis
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
...
@@ -9,32 +10,33 @@ namespace Common.Utility.Model
...
@@ -9,32 +10,33 @@ namespace Common.Utility.Model
public
class
RecordsReq
public
class
RecordsReq
{
{
public
DateTime
useTime
{
get
;
set
;
}
public
DateTime
useTime
{
get
;
set
;
}
[
AllowNull
]
public
String
userName
{
get
;
set
;
}
public
String
userName
{
get
;
set
;
}
[
AllowNull
]
public
int
type
{
get
;
set
;
}
public
int
type
{
get
;
set
;
}
[
AllowNull
]
public
String
equipments
{
get
;
set
;
}
public
String
equipments
{
get
;
set
;
}
public
List
<
EquipmentList
>
equipmentList
{
get
;
set
;
}
[
AllowNull
]
public
List
<
EquipmentList
>?
equipmentList
{
get
;
set
;
}
public
List
<
CarList
>
carList
{
get
;
set
;
}
[
AllowNull
]
public
List
<
CarList
>?
carList
{
get
;
set
;
}
//
//
}
}
public
class
EquipmentList
public
class
EquipmentList
{
{
public
String
invId
{
get
;
set
;
}
public
String
epc
{
get
;
set
;
}
public
String
epc
{
get
;
set
;
}
public
String
equipmentName
{
get
;
set
;
}
public
String
?
equipmentName
{
get
;
set
;
}
public
String
equipmentSize
{
get
;
set
;
}
public
String
?
equipmentSize
{
get
;
set
;
}
public
int
outInState
{
get
;
set
;
}
public
int
?
outInState
{
get
;
set
;
}
public
int
errorState
{
get
;
set
;
}
public
int
?
errorState
{
get
;
set
;
}
}
}
public
class
CarList
public
class
CarList
{
{
public
int
carId
{
get
;
set
;
}
public
int
?
outInState
{
get
;
set
;
}
public
int
outInState
{
get
;
set
;
}
public
String
?
errorState
{
get
;
set
;
}
public
String
errorState
{
get
;
set
;
}
}
}
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
View file @
14808cb6
...
@@ -29,8 +29,8 @@ namespace Repositories.Repository.Bussiness
...
@@ -29,8 +29,8 @@ namespace Repositories.Repository.Bussiness
//var invs = await context.Queryable<Inventory>().Where(x =>
//var invs = await context.Queryable<Inventory>().Where(x =>
//model.DetailList.Select(x => x.epc).Contains(x.epc)).ToListAsync();
//model.DetailList.Select(x => x.epc).Contains(x.epc)).ToListAsync();
context
.
BeginTran
();
context
.
BeginTran
();
await
context
.
Updateable
(
cars
).
ExecuteCommandAsync
();
//实体有多少列更新多少列
await
context
.
Updateable
(
cars
).
WhereColumns
(
it
=>
new
{
it
.
no
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommandAsync
();
//实体有多少列更新多少列
var
result
=
await
context
.
Updateable
(
inv
).
ExecuteCommandAsync
();
//实体有多少列更新多少列
var
result
=
await
context
.
Updateable
(
inv
).
WhereColumns
(
it
=>
new
{
it
.
epc
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommandAsync
();
//实体有多少列更新多少列
var
logSum
=
await
context
.
InsertNav
(
model
)
var
logSum
=
await
context
.
InsertNav
(
model
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
ExecuteCommandAsync
();
.
ExecuteCommandAsync
();
...
...
WebApiNET6-master/Services/LogService.cs
View file @
14808cb6
...
@@ -34,6 +34,8 @@ namespace Services
...
@@ -34,6 +34,8 @@ namespace Services
LogSummary
log
=
mapper
.
Map
<
LogSummary
>(
model
);
LogSummary
log
=
mapper
.
Map
<
LogSummary
>(
model
);
log
.
updateTime
=
DateTime
.
Now
;
log
.
updateTime
=
DateTime
.
Now
;
log
.
createTime
=
DateTime
.
Now
;
log
.
createTime
=
DateTime
.
Now
;
if
(
model
.
equipmentList
!=
null
)
{
foreach
(
var
item
in
model
.
equipmentList
)
foreach
(
var
item
in
model
.
equipmentList
)
{
{
LogDetail
logdetail
=
mapper
.
Map
<
LogDetail
>(
item
);
LogDetail
logdetail
=
mapper
.
Map
<
LogDetail
>(
item
);
...
@@ -42,25 +44,29 @@ namespace Services
...
@@ -42,25 +44,29 @@ namespace Services
logdetail
.
state
=
item
.
outInState
;
logdetail
.
state
=
item
.
outInState
;
log
.
DetailList
.
Add
(
logdetail
);
log
.
DetailList
.
Add
(
logdetail
);
}
}
}
if
(
model
.
carList
!=
null
)
{
foreach
(
var
item
in
model
.
carList
)
foreach
(
var
item
in
model
.
carList
)
{
{
LogDetail
logdetail
=
new
LogDetail
();
LogDetail
logdetail
=
new
LogDetail
();
logdetail
.
createTime
=
DateTime
.
Now
;
logdetail
.
createTime
=
DateTime
.
Now
;
logdetail
.
updateTime
=
DateTime
.
Now
;
logdetail
.
updateTime
=
DateTime
.
Now
;
logdetail
.
state
=
item
.
outInState
;
logdetail
.
state
=
item
.
outInState
;
logdetail
.
carid
=
item
.
carId
;
log
.
DetailList
.
Add
(
logdetail
);
log
.
DetailList
.
Add
(
logdetail
);
}
}
List
<
Inventory
>
inveqList
=
model
.
equipmentList
.
Select
(
x
=>
new
Inventory
()
}
List
<
Inventory
>
inveqList
=
model
.
equipmentList
?.
Select
(
x
=>
new
Inventory
()
{
{
updateTime
=
DateTime
.
Now
,
updateTime
=
DateTime
.
Now
,
id
=
x
.
invId
,
epc
=
x
.
epc
,
state
=
x
.
outInState
.
ToString
()
state
=
x
.
outInState
.
ToString
()
}).
ToList
();
}).
ToList
();
List
<
Car
>
invCarList
=
model
.
carList
?.
Select
(
x
=>
new
Car
()
List
<
Car
>
invCarList
=
model
.
carList
?.
Select
(
x
=>
new
Car
()
{
{
updateTime
=
DateTime
.
Now
,
updateTime
=
DateTime
.
Now
,
id
=
x
.
carId
,
state
=
x
.
outInState
.
ToString
()
state
=
x
.
outInState
.
ToString
()
}).
ToList
();
}).
ToList
();
return
_logSummaryRepository
.
AddLogs
(
log
,
inveqList
,
invCarList
);
return
_logSummaryRepository
.
AddLogs
(
log
,
inveqList
,
invCarList
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论