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
cc60725d
Commit
cc60725d
authored
Sep 21, 2023
by
赵剑炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加消息队列的日志存储
parent
2f1d9517
显示空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
185 行增加
和
93 行删除
+185
-93
.editorconfig
WebApiNET6-master/.editorconfig
+3
-0
BaseInfoController.cs
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
+24
-2
RecordsReq.cs
WebApiNET6-master/APIs/Req/RecordsReq.cs
+0
-40
BaseTable.cs
WebApiNET6-master/Models/BaseTable.cs
+9
-3
Models.csproj
WebApiNET6-master/Models/Models.csproj
+0
-4
RecordsReq.cs
WebApiNET6-master/Models/ReqModel/RecordsReq.cs
+3
-2
Car.cs
WebApiNET6-master/Models/Table/Car.cs
+1
-5
EquipmentSize.cs
WebApiNET6-master/Models/Table/EquipmentSize.cs
+2
-5
EquipmentType.cs
WebApiNET6-master/Models/Table/EquipmentType.cs
+2
-5
Inventory.cs
WebApiNET6-master/Models/Table/Inventory.cs
+49
-0
LogDetail.cs
WebApiNET6-master/Models/Table/LogDetail.cs
+2
-5
LogSummary.cs
WebApiNET6-master/Models/Table/LogSummary.cs
+3
-5
Police.cs
WebApiNET6-master/Models/Table/Police.cs
+1
-5
IInventoryRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/IInventoryRepository.cs
+5
-3
ILogSummaryRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/ILogSummaryRepository.cs
+1
-1
InventoryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/InventoryRepository.cs
+21
-0
LogSummaryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
+7
-4
IInventoryService.cs
WebApiNET6-master/Services/Interface/IInventoryService.cs
+5
-2
InventoryService.cs
WebApiNET6-master/Services/InventoryService.cs
+24
-0
LogService.cs
WebApiNET6-master/Services/LogService.cs
+23
-1
Services.csproj
WebApiNET6-master/Services/Services.csproj
+0
-1
没有找到文件。
WebApiNET6-master/.editorconfig
View file @
cc60725d
...
...
@@ -2,3 +2,6 @@
# CS8600: 将 null 字面量或可能为 null 的值转换为非 null 类型。
dotnet_diagnostic.CS8600.severity = none
# CS8618: 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑声明为可以为 null。
dotnet_diagnostic.CS8618.severity = silent
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
View file @
cc60725d
...
...
@@ -3,6 +3,7 @@ using APIs.Dto;
using
APIs.Req
;
using
Autofac.Core
;
using
AutoMapper
;
using
Common.Utility.Model
;
using
Common.Utility.RabbitMQ
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc.ModelBinding
;
...
...
@@ -201,8 +202,29 @@ namespace APIs.Controllers
public
async
Task
<
string
>
GetTime
()
{
DateTime
reqTime
=
DateTime
.
Now
;
return
JsonConvert
.
SerializeObject
(
reqTime
.
ToString
(
"yyyy-MM-dd"
));
try
{
var
src
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
data
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
};
return
JsonConvert
.
SerializeObject
(
src
);
}
catch
(
Exception
ex
)
{
var
error
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ex
.
Message
,
};
return
JsonConvert
.
SerializeObject
(
error
);
}
}
/// <summary>
/// 发送消息队列测试
...
...
WebApiNET6-master/APIs/Req/RecordsReq.cs
deleted
100644 → 0
View file @
2f1d9517
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc.ModelBinding
;
using
System.ComponentModel.DataAnnotations
;
using
System.Diagnostics.CodeAnalysis
;
namespace
APIs.Req
{
public
class
RecordsReq
{
public
String
id
{
get
;
set
;
}
public
DateTime
useTime
{
get
;
set
;
}
public
String
userName
{
get
;
set
;
}
public
String
type
{
get
;
set
;
}
public
String
equipments
{
get
;
set
;
}
[
FromBody
]
public
List
<
EquipmentList
>
equipmentList
{
get
;
set
;
}
[
FromBody
]
public
List
<
CarList
>
carList
{
get
;
set
;
}
//
}
public
class
EquipmentList
{
public
String
epc
{
get
;
set
;
}
public
String
equipmentName
{
get
;
set
;
}
public
String
equipmentSize
{
get
;
set
;
}
public
String
outInState
{
get
;
set
;
}
public
String
errorState
{
get
;
set
;
}
}
public
class
CarList
{
public
String
carId
{
get
;
set
;
}
public
String
outInState
{
get
;
set
;
}
public
String
errorState
{
get
;
set
;
}
}
}
WebApiNET6-master/
Services/Interface/IEqTypeServic
e.cs
→
WebApiNET6-master/
Models/BaseTabl
e.cs
View file @
cc60725d
using
System
;
using
SqlSugar
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Services.Interface
namespace
Models
{
public
interface
IEqTypeServic
e
public
class
BaseTabl
e
{
[
SugarColumn
(
ColumnName
=
"update_time"
)]
public
DateTime
?
updateTime
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"create_time"
)]
public
DateTime
?
createTime
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Models.csproj
View file @
cc60725d
...
...
@@ -12,8 +12,4 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Entity\" />
</ItemGroup>
</Project>
WebApiNET6-master/Models/ReqModel/RecordsReq.cs
View file @
cc60725d
...
...
@@ -21,6 +21,7 @@ namespace Common.Utility.Model
public
class
EquipmentList
{
public
String
invId
{
get
;
set
;
}
public
String
epc
{
get
;
set
;
}
public
String
equipmentName
{
get
;
set
;
}
public
String
equipmentSize
{
get
;
set
;
}
...
...
@@ -31,8 +32,8 @@ namespace Common.Utility.Model
public
class
CarList
{
public
String
carId
{
get
;
set
;
}
public
String
outInState
{
get
;
set
;
}
public
int
carId
{
get
;
set
;
}
public
int
outInState
{
get
;
set
;
}
public
String
errorState
{
get
;
set
;
}
}
...
...
WebApiNET6-master/Models/Table/Car.cs
View file @
cc60725d
...
...
@@ -10,7 +10,7 @@ namespace Models.Table
{
[
SugarTable
(
"base_car"
)]
public
class
Car
public
class
Car
:
BaseTable
{
[
SugarColumn
(
IsIdentity
=
true
,
IsPrimaryKey
=
true
)]
...
...
@@ -22,9 +22,5 @@ namespace Models.Table
public
String
?
state
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"update_time"
)]
public
DateTime
?
updateTime
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"create_time"
)]
public
DateTime
?
createTime
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/EquipmentSize.cs
View file @
cc60725d
...
...
@@ -11,7 +11,7 @@ namespace Models.Table
{
[
SugarTable
(
"base_equipment_size"
)]
public
class
EquipmentSize
public
class
EquipmentSize
:
BaseTable
{
[
SugarColumn
(
IsIdentity
=
true
,
IsPrimaryKey
=
true
)]
...
...
@@ -30,9 +30,6 @@ namespace Models.Table
public
String
?
state
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"update_time"
)]
public
DateTime
?
updateTime
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"create_time"
)]
public
DateTime
?
createTime
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/EquipmentType.cs
View file @
cc60725d
...
...
@@ -10,7 +10,7 @@ namespace Models.SqlModel
{
[
SugarTable
(
"base_equipment_type"
)]
public
class
EquipmentType
public
class
EquipmentType
:
BaseTable
{
[
SugarColumn
(
IsIdentity
=
true
,
IsPrimaryKey
=
true
)]
...
...
@@ -31,10 +31,7 @@ namespace Models.SqlModel
public
String
?
note
{
get
;
set
;
}
public
String
?
type
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"update_time"
)]
public
DateTime
?
updateTime
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"create_time"
)]
public
DateTime
?
createTime
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/Inventory.cs
0 → 100644
View file @
cc60725d
using
SqlSugar
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Security.Principal
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Models.Table
{
[
SugarTable
(
"base_inventory"
)]
public
class
Inventory
:
BaseTable
{
[
SugarColumn
(
IsIdentity
=
true
,
IsPrimaryKey
=
true
)]
public
String
id
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"type_id"
)]
public
String
typeId
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"size_id"
)]
public
String
sizeId
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"supplier_id"
)]
public
String
supplierId
{
get
;
set
;
}
public
String
epc
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"org_id"
)]
public
String
orgId
{
get
;
set
;
}
public
String
state
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"bussiness_state"
)]
public
String
bussinessState
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"production_date"
)]
public
DateTime
?
productionDate
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"warranty_period"
)]
public
String
warrantyPeriod
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"maintenance_period"
)]
public
String
maintenancePeriod
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"fix_count"
)]
public
String
fixCount
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"location_id"
)]
public
String
locationId
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"location_type"
)]
public
String
locationType
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"lost_flag"
)]
public
String
lostFlag
{
get
;
set
;
}
public
String
price
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/LogDetail.cs
View file @
cc60725d
...
...
@@ -11,7 +11,7 @@ namespace Models.Table
[
SugarTable
(
"base_log_detail"
)]
public
class
LogDetail
public
class
LogDetail
:
BaseTable
{
[
SugarColumn
(
IsIdentity
=
true
,
IsPrimaryKey
=
true
)]
...
...
@@ -32,9 +32,6 @@ namespace Models.Table
[
SugarColumn
(
ColumnName
=
"car_id"
)]
public
int
?
carid
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"update_time"
)]
public
DateTime
?
updateTime
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"create_time"
)]
public
DateTime
?
createTime
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/LogSummary.cs
View file @
cc60725d
...
...
@@ -10,7 +10,7 @@ namespace Models.Table
{
[
SugarTable
(
"base_log_summary"
)]
public
class
LogSummary
public
class
LogSummary
:
BaseTable
{
[
SugarColumn
(
IsIdentity
=
true
,
IsPrimaryKey
=
true
)]
...
...
@@ -30,10 +30,8 @@ namespace Models.Table
[
SugarColumn
(
ColumnName
=
"plan_name"
)]
public
String
?
planName
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"update_time"
)]
public
DateTime
?
updateTime
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"create_time"
)]
public
DateTime
?
createTime
{
get
;
set
;
}
[
Navigate
(
NavigateType
.
OneToMany
,
nameof
(
LogDetail
.
summaryId
))]
public
List
<
LogDetail
>
DetailList
{
get
;
set
;
}
=
new
List
<
LogDetail
>();
}
...
...
WebApiNET6-master/Models/Table/Police.cs
View file @
cc60725d
...
...
@@ -11,7 +11,7 @@ namespace Models.Table
[
SugarTable
(
"base_personnel"
)]
public
class
Police
public
class
Police
:
BaseTable
{
[
SugarColumn
(
IsIdentity
=
true
,
IsPrimaryKey
=
true
)]
...
...
@@ -25,9 +25,5 @@ namespace Models.Table
[
SugarColumn
(
ColumnName
=
"id_card"
)]
public
String
?
idCard
{
get
;
set
;
}
public
String
?
sex
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"update_time"
)]
public
DateTime
?
updateTime
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"create_time"
)]
public
DateTime
?
createTime
{
get
;
set
;
}
}
}
WebApiNET6-master/
Services/Interface/IEqSizeService
.cs
→
WebApiNET6-master/
Repositories/IRepository/IBussiness/IInventoryRepository
.cs
View file @
cc60725d
using
System
;
using
Models.SqlModel
;
using
Models.Table
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Services.Interface
namespace
Repositories.IRepository.IBussiness
{
public
class
IEqSizeService
public
interface
IInventoryRepository
:
IBaseRepository
<
Inventory
>
{
}
}
WebApiNET6-master/Repositories/IRepository/IBussiness/ILogSummaryRepository.cs
View file @
cc60725d
...
...
@@ -16,7 +16,7 @@ namespace Repositories.IRepository.IBussiness
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
Task
<
bool
>
AddLogs
(
LogSummary
model
);
Task
<
bool
>
AddLogs
(
LogSummary
model
,
List
<
Inventory
>
invs
,
List
<
Car
>
cars
);
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/InventoryRepository.cs
0 → 100644
View file @
cc60725d
using
Models.SqlModel
;
using
Models.Table
;
using
Repositories.IRepository.IBussiness
;
using
Repositories.IRepository.IUnitOfWork
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Repositories.Repository.Bussiness
{
public
class
InventoryRepository
:
BaseRepository
<
Inventory
>,
IInventoryRepository
{
public
InventoryRepository
(
ILocalSugarUnitOfWork
sugarUnitOfWork
)
:
base
(
sugarUnitOfWork
)
{
}
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
View file @
cc60725d
...
...
@@ -20,17 +20,20 @@ namespace Repositories.Repository.Bussiness
_suger
=
sugarUnitOfWork
;
}
public
async
Task
<
bool
>
AddLogs
(
LogSummary
model
)
public
async
Task
<
bool
>
AddLogs
(
LogSummary
model
,
List
<
Inventory
>
inv
,
List
<
Car
>
cars
)
{
using
(
var
context
=
_suger
.
GetDbClient
())
{
try
{
//var invs = await context.Queryable<Inventory>().Where(x =>
//model.DetailList.Select(x => x.epc).Contains(x.epc)).ToListAsync();
context
.
BeginTran
();
var
logSum
=
context
.
InsertNav
(
model
)
await
context
.
Updateable
(
cars
).
ExecuteCommandAsync
();
//实体有多少列更新多少列
var
result
=
await
context
.
Updateable
(
inv
).
ExecuteCommandAsync
();
//实体有多少列更新多少列
var
logSum
=
await
context
.
InsertNav
(
model
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
ExecuteCommand
();
.
ExecuteCommand
Async
();
context
.
CommitTran
();
}
catch
(
Exception
e
)
...
...
WebApiNET6-master/Services/Interface/IInventoryService.cs
View file @
cc60725d
using
System
;
using
Models.SqlModel
;
using
Models.Table
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -6,7 +8,8 @@ using System.Threading.Tasks;
namespace
Services.Interface
{
public
class
IInventoryService
public
interface
IInventoryService
:
IBaseServices
<
Inventory
>
{
}
}
WebApiNET6-master/Services/InventoryService.cs
0 → 100644
View file @
cc60725d
using
Models.SqlModel
;
using
Models.Table
;
using
Repositories.IRepository.IBussiness
;
using
Services.Interface
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Services
{
public
class
InventoryService
:
BaseService
<
Inventory
>,
IInventoryService
{
private
readonly
IInventoryRepository
_inventoryRepository
;
public
InventoryService
(
IInventoryRepository
inventoryRepository
)
{
base
.
BaseDal
=
inventoryRepository
;
_inventoryRepository
=
inventoryRepository
;
}
}
}
WebApiNET6-master/Services/LogService.cs
View file @
cc60725d
...
...
@@ -39,9 +39,31 @@ namespace Services
LogDetail
logdetail
=
mapper
.
Map
<
LogDetail
>(
item
);
logdetail
.
createTime
=
DateTime
.
Now
;
logdetail
.
updateTime
=
DateTime
.
Now
;
logdetail
.
state
=
item
.
outInState
;
log
.
DetailList
.
Add
(
logdetail
);
}
return
_logSummaryRepository
.
AddLogs
(
log
);
foreach
(
var
item
in
model
.
carList
)
{
LogDetail
logdetail
=
new
LogDetail
();
logdetail
.
createTime
=
DateTime
.
Now
;
logdetail
.
updateTime
=
DateTime
.
Now
;
logdetail
.
state
=
item
.
outInState
;
logdetail
.
carid
=
item
.
carId
;
log
.
DetailList
.
Add
(
logdetail
);
}
List
<
Inventory
>
inveqList
=
model
.
equipmentList
.
Select
(
x
=>
new
Inventory
()
{
updateTime
=
DateTime
.
Now
,
id
=
x
.
invId
,
state
=
x
.
outInState
.
ToString
()
}).
ToList
();
List
<
Car
>
invCarList
=
model
.
carList
?.
Select
(
x
=>
new
Car
()
{
updateTime
=
DateTime
.
Now
,
id
=
x
.
carId
,
state
=
x
.
outInState
.
ToString
()
}).
ToList
();
return
_logSummaryRepository
.
AddLogs
(
log
,
inveqList
,
invCarList
);
}
}
}
WebApiNET6-master/Services/Services.csproj
View file @
cc60725d
...
...
@@ -9,7 +9,6 @@
<ItemGroup>
<Compile Remove="Interface\IEqSizeService.cs" />
<Compile Remove="Interface\IEqTypeService.cs" />
<Compile Remove="Interface\IInventoryService.cs" />
<Compile Remove="UserService.cs" />
</ItemGroup>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论