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
2f0d3ead
Commit
2f0d3ead
authored
Nov 15, 2023
by
Seniorious
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手持机接口完善
parent
61423228
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
238 行增加
和
11 行删除
+238
-11
BaseInfoController.cs
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
+69
-1
Startup.cs
WebApiNET6-master/APIs/Startup.cs
+2
-0
RecordsReq.cs
WebApiNET6-master/Models/ReqModel/RecordsReq.cs
+13
-0
IInvSummaryRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/IInvSummaryRepository.cs
+1
-1
ILogSummaryRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/ILogSummaryRepository.cs
+2
-0
IUsersRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/IUsersRepository.cs
+13
-0
InvSummaryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/InvSummaryRepository.cs
+8
-3
LogSummaryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
+24
-0
UsersRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/UsersRepository.cs
+19
-0
ILogService.cs
WebApiNET6-master/Services/Interface/ILogService.cs
+1
-0
IUsersService.cs
WebApiNET6-master/Services/Interface/IUsersService.cs
+14
-0
InvService.cs
WebApiNET6-master/Services/InvService.cs
+20
-1
LogService.cs
WebApiNET6-master/Services/LogService.cs
+30
-5
UsersService.cs
WebApiNET6-master/Services/UsersService.cs
+22
-0
没有找到文件。
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
View file @
2f0d3ead
...
@@ -33,8 +33,9 @@ namespace APIs.Controllers
...
@@ -33,8 +33,9 @@ namespace APIs.Controllers
private
readonly
ICarService
_carService
;
private
readonly
ICarService
_carService
;
private
readonly
IInventoryService
_inventoryService
;
private
readonly
IInventoryService
_inventoryService
;
private
readonly
IInvService
_invService
;
private
readonly
IInvService
_invService
;
private
readonly
IUsersService
_usersService
;
public
BaseInfoController
(
IMapper
mapper
,
IPoliceService
policeService
,
IEquipmentTypeService
equipmentTypeService
,
public
BaseInfoController
(
IMapper
mapper
,
IPoliceService
policeService
,
IEquipmentTypeService
equipmentTypeService
,
IEquipmentSizeService
equipmentSizeService
,
ICarService
carService
,
IInventoryService
inventoryService
,
IInvService
invService
)
IEquipmentSizeService
equipmentSizeService
,
ICarService
carService
,
IInventoryService
inventoryService
,
IInvService
invService
,
IUsersService
usersService
)
{
{
_carService
=
carService
;
_carService
=
carService
;
_equipmentSizeService
=
equipmentSizeService
;
_equipmentSizeService
=
equipmentSizeService
;
...
@@ -42,10 +43,77 @@ namespace APIs.Controllers
...
@@ -42,10 +43,77 @@ namespace APIs.Controllers
_policeService
=
policeService
;
_policeService
=
policeService
;
_inventoryService
=
inventoryService
;
_inventoryService
=
inventoryService
;
_invService
=
invService
;
_invService
=
invService
;
_usersService
=
usersService
;
Mapper
=
mapper
;
Mapper
=
mapper
;
}
}
/// <summary>
/// <summary>
/// 获取账号
/// </summary>
/// <param name=""></param>
/// <returns></returns>
[
HttpGet
]
public
virtual
async
Task
<
ApiResult
>
GetAccount
()
{
try
{
var
accountlist
=
await
_usersService
.
Query
();
var
src
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
data
=
accountlist
};
return
src
;
}
catch
(
Exception
ex
)
{
var
error
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ex
.
Message
,
};
return
error
;
}
}
/// <summary>
/// 手持机出入库记录上传
/// </summary>
/// <param name=""></param>
/// <returns></returns>
[
HttpPost
]
public
virtual
async
Task
<
ApiResult
>
UploadHandRecord
([
FromBody
]
Models
.
ReqModel
.
InvReq
req
)
{
try
{
var
rs
=
_invService
.
AddInvLogs
(
req
).
Result
;
var
src
=
rs
?
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
}
:
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ResultCode
.
OPERATE_FAILED
.
Msg
,
};
return
src
;
}
catch
(
Exception
ex
)
{
var
error
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ex
.
Message
,
};
return
error
;
}
}
/// <summary>
/// 盘库记录上传
/// 盘库记录上传
/// </summary>
/// </summary>
/// <param name=""></param>
/// <param name=""></param>
...
...
WebApiNET6-master/APIs/Startup.cs
View file @
2f0d3ead
...
@@ -62,6 +62,7 @@ namespace APIs
...
@@ -62,6 +62,7 @@ namespace APIs
services
.
AddScoped
<
ILogService
,
LogService
>();
services
.
AddScoped
<
ILogService
,
LogService
>();
services
.
AddScoped
<
IInventoryService
,
InventoryService
>();
services
.
AddScoped
<
IInventoryService
,
InventoryService
>();
services
.
AddScoped
<
IInvService
,
InvService
>();
services
.
AddScoped
<
IInvService
,
InvService
>();
services
.
AddScoped
<
IUsersService
,
UsersService
>();
#
endregion
#
endregion
#
region
Repository
#
region
Repository
...
@@ -74,6 +75,7 @@ namespace APIs
...
@@ -74,6 +75,7 @@ namespace APIs
services
.
AddScoped
<
IInventoryRepository
,
InventoryRepository
>();
services
.
AddScoped
<
IInventoryRepository
,
InventoryRepository
>();
services
.
AddScoped
<
IInvSummaryRepository
,
InvSummaryRepository
>();
services
.
AddScoped
<
IInvSummaryRepository
,
InvSummaryRepository
>();
services
.
AddScoped
<
IInvDetailRepository
,
InvDetailRepository
>();
services
.
AddScoped
<
IInvDetailRepository
,
InvDetailRepository
>();
services
.
AddScoped
<
IUsersRepository
,
UsersRepository
>();
#
endregion
#
endregion
#
region
注册
RabbitMQ
消费者
#
region
注册
RabbitMQ
消费者
...
...
WebApiNET6-master/Models/ReqModel/RecordsReq.cs
View file @
2f0d3ead
...
@@ -44,4 +44,17 @@ namespace Common.Utility.Model
...
@@ -44,4 +44,17 @@ namespace Common.Utility.Model
public
string
?
errorMsg
{
get
;
set
;
}
public
string
?
errorMsg
{
get
;
set
;
}
}
}
public
class
HandRecordsReq
{
public
DateTime
useTime
{
get
;
set
;
}
[
AllowNull
]
public
String
userName
{
get
;
set
;
}
public
int
outInState
{
get
;
set
;
}
[
AllowNull
]
public
String
equipments
{
get
;
set
;
}
[
AllowNull
]
public
List
<
EquipmentList
>?
equipmentList
{
get
;
set
;
}
//
}
}
}
WebApiNET6-master/Repositories/IRepository/IBussiness/IInvSummaryRepository.cs
View file @
2f0d3ead
...
@@ -9,6 +9,6 @@ namespace Repositories.IRepository.IBussiness
...
@@ -9,6 +9,6 @@ namespace Repositories.IRepository.IBussiness
{
{
public
interface
IInvSummaryRepository
:
IBaseRepository
<
InvSummary
>
public
interface
IInvSummaryRepository
:
IBaseRepository
<
InvSummary
>
{
{
Task
<
bool
>
AddInvLogs
(
InvSummary
model
);
Task
<
bool
>
AddInvLogs
(
InvSummary
model
,
List
<
Inventory
>
inList
,
List
<
Inventory
>
lostList
);
}
}
}
}
WebApiNET6-master/Repositories/IRepository/IBussiness/ILogSummaryRepository.cs
View file @
2f0d3ead
...
@@ -18,5 +18,7 @@ namespace Repositories.IRepository.IBussiness
...
@@ -18,5 +18,7 @@ namespace Repositories.IRepository.IBussiness
/// <returns></returns>
/// <returns></returns>
Task
<
bool
>
AddLogs
(
LogSummary
model
,
List
<
Inventory
>
invs
,
List
<
Car
>
cars
);
Task
<
bool
>
AddLogs
(
LogSummary
model
,
List
<
Inventory
>
invs
,
List
<
Car
>
cars
);
Task
<
bool
>
AddHandLogs
(
LogSummary
model
,
List
<
Inventory
>
invs
);
}
}
}
}
WebApiNET6-master/Repositories/IRepository/IBussiness/IUsersRepository.cs
0 → 100644
View file @
2f0d3ead
using
Models.Table
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Repositories.IRepository.IBussiness
{
public
interface
IUsersRepository
:
IBaseRepository
<
Users
>
{
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/InvSummaryRepository.cs
View file @
2f0d3ead
...
@@ -19,20 +19,25 @@ namespace Repositories.Repository.Bussiness
...
@@ -19,20 +19,25 @@ namespace Repositories.Repository.Bussiness
_suger
=
sugarUnitOfWork
;
_suger
=
sugarUnitOfWork
;
}
}
public
async
Task
<
bool
>
AddInvLogs
(
InvSummary
model
)
public
async
Task
<
bool
>
AddInvLogs
(
InvSummary
model
,
List
<
Inventory
>
inList
,
List
<
Inventory
>
lostList
)
{
{
using
(
var
context
=
_suger
.
GetDbClient
())
using
(
var
context
=
_suger
.
GetDbClient
())
{
{
try
try
{
{
context
.
BeginTran
();
context
.
BeginTran
();
var
result1
=
context
.
Updateable
(
inList
).
WhereColumns
(
it
=>
new
{
it
.
id
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommand
();
var
result2
=
context
.
Updateable
(
lostList
).
WhereColumns
(
it
=>
new
{
it
.
id
}).
UpdateColumns
(
it
=>
new
{
it
.
lostFlag
,
it
.
updateTime
}).
ExecuteCommand
();
var
linvSum
=
context
.
InsertNav
(
model
)
var
linvSum
=
context
.
InsertNav
(
model
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
ExecuteCommand
();
.
ExecuteCommand
();
context
.
CommitTran
();
context
.
CommitTran
();
return
linvSum
;
return
true
;
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
...
...
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
View file @
2f0d3ead
...
@@ -21,6 +21,30 @@ namespace Repositories.Repository.Bussiness
...
@@ -21,6 +21,30 @@ namespace Repositories.Repository.Bussiness
_suger
=
sugarUnitOfWork
;
_suger
=
sugarUnitOfWork
;
}
}
public
async
Task
<
bool
>
AddHandLogs
(
LogSummary
model
,
List
<
Inventory
>
inv
)
{
using
(
var
context
=
_suger
.
GetDbClient
())
{
try
{
context
.
BeginTran
();
var
result
=
context
.
Updateable
(
inv
).
WhereColumns
(
it
=>
new
{
it
.
epc
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommand
();
//实体有多少列更新多少列
var
logSum
=
context
.
InsertNav
(
model
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
ExecuteCommand
();
context
.
CommitTran
();
}
catch
(
Exception
e
)
{
throw
e
;
}
}
return
true
;
}
public
async
Task
<
bool
>
AddLogs
(
LogSummary
model
,
List
<
Inventory
>
inv
,
List
<
Car
>
cars
)
public
async
Task
<
bool
>
AddLogs
(
LogSummary
model
,
List
<
Inventory
>
inv
,
List
<
Car
>
cars
)
{
{
using
(
var
context
=
_suger
.
GetDbClient
())
using
(
var
context
=
_suger
.
GetDbClient
())
...
...
WebApiNET6-master/Repositories/Repository/Bussiness/UsersRepository.cs
0 → 100644
View file @
2f0d3ead
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
UsersRepository
:
BaseRepository
<
Users
>,
IUsersRepository
{
public
UsersRepository
(
ILocalSugarUnitOfWork
sugarUnitOfWork
)
:
base
(
sugarUnitOfWork
)
{
}
}
}
WebApiNET6-master/Services/Interface/ILogService.cs
View file @
2f0d3ead
...
@@ -17,5 +17,6 @@ namespace Services.Interface
...
@@ -17,5 +17,6 @@ namespace Services.Interface
/// <param name="model"></param>
/// <param name="model"></param>
/// <returns></returns>
/// <returns></returns>
Task
<
bool
>
AddLogs
(
RecordsReq
model
);
Task
<
bool
>
AddLogs
(
RecordsReq
model
);
Task
<
bool
>
AddHandLogs
(
HandRecordsReq
model
);
}
}
}
}
WebApiNET6-master/Services/Interface/IUsersService.cs
0 → 100644
View file @
2f0d3ead
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
{
public
interface
IUsersService
:
IBaseServices
<
Users
>
{
}
}
WebApiNET6-master/Services/InvService.cs
View file @
2f0d3ead
...
@@ -39,8 +39,27 @@ namespace Services
...
@@ -39,8 +39,27 @@ namespace Services
updateTime
=
DateTime
.
Now
,
updateTime
=
DateTime
.
Now
,
};
};
List
<
Inventory
>
inList
=
new
List
<
Inventory
>();
List
<
Inventory
>
lostList
=
new
List
<
Inventory
>();
foreach
(
var
detail
in
model
.
data
)
foreach
(
var
detail
in
model
.
data
)
{
{
if
(
detail
.
state
==
0
)
{
inList
.
Add
(
new
Inventory
()
{
id
=
detail
.
invId
,
state
=
"0"
,
});
}
else
if
(
detail
.
state
==
1
)
{
lostList
.
Add
(
new
Inventory
()
{
id
=
detail
.
invId
,
lostFlag
=
"1"
,
});
}
inv
.
DetailList
.
Add
(
new
InvDetail
()
inv
.
DetailList
.
Add
(
new
InvDetail
()
{
{
invId
=
detail
.
invId
,
invId
=
detail
.
invId
,
...
@@ -53,7 +72,7 @@ namespace Services
...
@@ -53,7 +72,7 @@ namespace Services
});
});
}
}
return
_invSummaryRepository
.
AddInvLogs
(
inv
);
return
_invSummaryRepository
.
AddInvLogs
(
inv
,
inList
,
lostList
);
}
}
}
}
}
}
WebApiNET6-master/Services/LogService.cs
View file @
2f0d3ead
...
@@ -28,12 +28,37 @@ namespace Services
...
@@ -28,12 +28,37 @@ namespace Services
mapper
=
_mapper
;
mapper
=
_mapper
;
}
}
public
Task
<
bool
>
AddHandLogs
(
HandRecordsReq
model
)
{
LogSummary
log
=
mapper
.
Map
<
LogSummary
>(
model
);
log
.
updateTime
=
DateTime
.
Now
;
log
.
createTime
=
DateTime
.
Now
;
foreach
(
var
item
in
model
.
equipmentList
)
{
LogDetail
logdetail
=
mapper
.
Map
<
LogDetail
>(
item
);
logdetail
.
createTime
=
DateTime
.
Now
;
logdetail
.
updateTime
=
DateTime
.
Now
;
logdetail
.
state
=
model
.
outInState
;
logdetail
.
errorMsg
=
item
.
errorMsg
;
log
.
DetailList
.
Add
(
logdetail
);
}
List
<
Inventory
>
inveqList
=
model
.
equipmentList
?.
Select
(
x
=>
new
Inventory
()
{
updateTime
=
DateTime
.
Now
,
epc
=
x
.
epc
,
state
=
x
.
outInState
.
ToString
()
}).
ToList
();
return
_logSummaryRepository
.
AddHandLogs
(
log
,
inveqList
);
}
public
Task
<
bool
>
AddLogs
(
RecordsReq
model
)
public
Task
<
bool
>
AddLogs
(
RecordsReq
model
)
{
{
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
)
if
(
model
.
equipmentList
!=
null
)
{
{
foreach
(
var
item
in
model
.
equipmentList
)
foreach
(
var
item
in
model
.
equipmentList
)
{
{
...
@@ -59,17 +84,17 @@ namespace Services
...
@@ -59,17 +84,17 @@ namespace Services
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
,
epc
=
x
.
epc
,
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
,
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
);
...
...
WebApiNET6-master/Services/UsersService.cs
0 → 100644
View file @
2f0d3ead
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
UsersService
:
BaseService
<
Users
>,
IUsersService
{
private
readonly
IUsersRepository
_usersRepository
;
public
UsersService
(
IUsersRepository
usersRepository
)
{
base
.
BaseDal
=
usersRepository
;
_usersRepository
=
usersRepository
;
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论