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
afc4a833
Commit
afc4a833
authored
Nov 16, 2023
by
Seniorious
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手持机加盘盈
parent
2f0d3ead
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
80 行增加
和
13 行删除
+80
-13
BaseInfoController.cs
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
+42
-7
IInvSummaryRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/IInvSummaryRepository.cs
+1
-1
InvSummaryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/InvSummaryRepository.cs
+3
-1
IInvService.cs
WebApiNET6-master/Services/Interface/IInvService.cs
+1
-1
InvService.cs
WebApiNET6-master/Services/InvService.cs
+33
-3
没有找到文件。
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
View file @
afc4a833
...
@@ -7,6 +7,7 @@ using Common.Utility.Model;
...
@@ -7,6 +7,7 @@ using Common.Utility.Model;
using
Common.Utility.RabbitMQ
;
using
Common.Utility.RabbitMQ
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc.ModelBinding
;
using
Microsoft.AspNetCore.Mvc.ModelBinding
;
using
Microsoft.IdentityModel.Tokens
;
using
Models.SqlModel
;
using
Models.SqlModel
;
using
Models.Table
;
using
Models.Table
;
using
Models.ToolsModel
;
using
Models.ToolsModel
;
...
@@ -17,6 +18,7 @@ using SqlSugar;
...
@@ -17,6 +18,7 @@ using SqlSugar;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.Drawing.Imaging
;
using
System.Linq.Expressions
;
using
System.Security.Cryptography.Xml
;
using
System.Security.Cryptography.Xml
;
using
static
Microsoft
.
AspNetCore
.
Razor
.
Language
.
TagHelperMetadata
;
using
static
Microsoft
.
AspNetCore
.
Razor
.
Language
.
TagHelperMetadata
;
...
@@ -34,8 +36,10 @@ namespace APIs.Controllers
...
@@ -34,8 +36,10 @@ namespace APIs.Controllers
private
readonly
IInventoryService
_inventoryService
;
private
readonly
IInventoryService
_inventoryService
;
private
readonly
IInvService
_invService
;
private
readonly
IInvService
_invService
;
private
readonly
IUsersService
_usersService
;
private
readonly
IUsersService
_usersService
;
private
readonly
ILogService
_logService
;
public
BaseInfoController
(
IMapper
mapper
,
IPoliceService
policeService
,
IEquipmentTypeService
equipmentTypeService
,
public
BaseInfoController
(
IMapper
mapper
,
IPoliceService
policeService
,
IEquipmentTypeService
equipmentTypeService
,
IEquipmentSizeService
equipmentSizeService
,
ICarService
carService
,
IInventoryService
inventoryService
,
IInvService
invService
,
IUsersService
usersService
)
IEquipmentSizeService
equipmentSizeService
,
ICarService
carService
,
IInventoryService
inventoryService
,
IInvService
invService
,
IUsersService
usersService
,
ILogService
logService
)
{
{
_carService
=
carService
;
_carService
=
carService
;
_equipmentSizeService
=
equipmentSizeService
;
_equipmentSizeService
=
equipmentSizeService
;
...
@@ -44,6 +48,7 @@ namespace APIs.Controllers
...
@@ -44,6 +48,7 @@ namespace APIs.Controllers
_inventoryService
=
inventoryService
;
_inventoryService
=
inventoryService
;
_invService
=
invService
;
_invService
=
invService
;
_usersService
=
usersService
;
_usersService
=
usersService
;
_logService
=
logService
;
Mapper
=
mapper
;
Mapper
=
mapper
;
}
}
...
@@ -85,11 +90,11 @@ namespace APIs.Controllers
...
@@ -85,11 +90,11 @@ namespace APIs.Controllers
/// <param name=""></param>
/// <param name=""></param>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
virtual
async
Task
<
ApiResult
>
UploadHandRecord
([
FromBody
]
Models
.
ReqModel
.
Inv
Req
req
)
public
virtual
async
Task
<
ApiResult
>
UploadHandRecord
([
FromBody
]
HandRecords
Req
req
)
{
{
try
try
{
{
var
rs
=
_invService
.
AddInvLogs
(
req
).
Result
;
var
rs
=
await
_logService
.
AddHandLogs
(
req
)
;
var
src
=
rs
?
new
ApiResult
var
src
=
rs
?
new
ApiResult
{
{
...
@@ -123,7 +128,20 @@ namespace APIs.Controllers
...
@@ -123,7 +128,20 @@ namespace APIs.Controllers
{
{
try
try
{
{
var
rs
=
_invService
.
AddInvLogs
(
req
).
Result
;
Expression
<
Func
<
Inventory
,
bool
>>
expression
=
s
=>
s
.
lostFlag
==
"1"
;
var
inv
=
await
_inventoryService
.
Query
(
expression
);
var
lostInv
=
inv
?.
Select
(
s
=>
new
Inventory
()
{
id
=
s
.
id
,
epc
=
s
.
epc
,
typeName
=
s
.
typeName
,
sizeName
=
s
.
sizeName
,
lostFlag
=
"0"
,
updateTime
=
DateTime
.
Now
,
}).
ToList
();
var
rs
=
_invService
.
AddInvLogs
(
req
,
lostInv
).
Result
;
var
src
=
rs
?
new
ApiResult
var
src
=
rs
?
new
ApiResult
{
{
...
@@ -157,7 +175,8 @@ namespace APIs.Controllers
...
@@ -157,7 +175,8 @@ namespace APIs.Controllers
{
{
try
try
{
{
var
invlist
=
await
_inventoryService
.
Query
();
Expression
<
Func
<
Inventory
,
bool
>>
expression
=
s
=>
/*!s.lostFlag.Equals("1") &&*/
!
s
.
bussinessState
.
Equals
(
"destruction"
);
var
invlist
=
await
_inventoryService
.
Query
(
expression
);
if
(
invlist
==
null
)
if
(
invlist
==
null
)
{
{
...
@@ -169,17 +188,33 @@ namespace APIs.Controllers
...
@@ -169,17 +188,33 @@ namespace APIs.Controllers
return
error
;
return
error
;
}
}
var
inv
=
invlist
.
Select
(
s
=>
new
var
base
inv
=
invlist
.
Select
(
s
=>
new
{
{
id
=
s
.
id
,
typeId
=
s
.
typeId
,
typeId
=
s
.
typeId
,
typeName
=
s
.
typeName
,
typeName
=
s
.
typeName
,
sizeId
=
s
.
sizeId
,
sizeId
=
s
.
sizeId
,
sizeName
=
s
.
sizeName
,
sizeName
=
s
.
sizeName
,
equipId
=
s
.
id
,
epc
=
s
.
epc
,
epc
=
s
.
epc
,
state
=
s
.
state
,
state
=
s
.
state
,
}).
ToList
();
}).
ToList
();
var
inv
=
baseinv
.
GroupBy
(
x
=>
new
{
x
.
typeId
,
x
.
typeName
,
x
.
sizeName
,
x
.
sizeId
})
.
Select
(
s
=>
new
{
typeId
=
s
.
Key
.
typeId
,
typeName
=
s
.
Key
.
typeName
,
sizeId
=
s
.
Key
.
sizeId
,
sizeName
=
s
.
Key
.
sizeName
,
epcList
=
baseinv
.
Where
(
a
=>
a
.
sizeId
.
Equals
(
s
.
Key
.
sizeId
))
.
Select
(
b
=>
new
{
equipId
=
b
.
equipId
,
epc
=
b
.
epc
,
state
=
b
.
state
,
}).
ToList
()
}).
ToList
();
var
src
=
new
ApiResult
var
src
=
new
ApiResult
{
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
...
...
WebApiNET6-master/Repositories/IRepository/IBussiness/IInvSummaryRepository.cs
View file @
afc4a833
...
@@ -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
,
List
<
Inventory
>
inList
,
List
<
Inventory
>
lostList
);
Task
<
bool
>
AddInvLogs
(
InvSummary
model
,
List
<
Inventory
>
inList
,
List
<
Inventory
>
lostList
,
List
<
Inventory
>
getList
);
}
}
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/InvSummaryRepository.cs
View file @
afc4a833
...
@@ -19,7 +19,7 @@ namespace Repositories.Repository.Bussiness
...
@@ -19,7 +19,7 @@ namespace Repositories.Repository.Bussiness
_suger
=
sugarUnitOfWork
;
_suger
=
sugarUnitOfWork
;
}
}
public
async
Task
<
bool
>
AddInvLogs
(
InvSummary
model
,
List
<
Inventory
>
inList
,
List
<
Inventory
>
lostList
)
public
async
Task
<
bool
>
AddInvLogs
(
InvSummary
model
,
List
<
Inventory
>
inList
,
List
<
Inventory
>
lostList
,
List
<
Inventory
>
getList
)
{
{
using
(
var
context
=
_suger
.
GetDbClient
())
using
(
var
context
=
_suger
.
GetDbClient
())
{
{
...
@@ -31,6 +31,8 @@ namespace Repositories.Repository.Bussiness
...
@@ -31,6 +31,8 @@ namespace Repositories.Repository.Bussiness
var
result2
=
context
.
Updateable
(
lostList
).
WhereColumns
(
it
=>
new
{
it
.
id
}).
UpdateColumns
(
it
=>
new
{
it
.
lostFlag
,
it
.
updateTime
}).
ExecuteCommand
();
var
result2
=
context
.
Updateable
(
lostList
).
WhereColumns
(
it
=>
new
{
it
.
id
}).
UpdateColumns
(
it
=>
new
{
it
.
lostFlag
,
it
.
updateTime
}).
ExecuteCommand
();
var
result3
=
context
.
Updateable
(
getList
).
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
();
...
...
WebApiNET6-master/Services/Interface/IInvService.cs
View file @
afc4a833
...
@@ -11,6 +11,6 @@ namespace Services.Interface
...
@@ -11,6 +11,6 @@ namespace Services.Interface
{
{
public
interface
IInvService
:
IBaseServices
<
InvSummary
>
public
interface
IInvService
:
IBaseServices
<
InvSummary
>
{
{
Task
<
bool
>
AddInvLogs
(
InvReq
model
);
Task
<
bool
>
AddInvLogs
(
InvReq
model
,
List
<
Inventory
>
lostList
);
}
}
}
}
WebApiNET6-master/Services/InvService.cs
View file @
afc4a833
...
@@ -25,7 +25,7 @@ namespace Services
...
@@ -25,7 +25,7 @@ namespace Services
mapper
=
_mapper
;
mapper
=
_mapper
;
}
}
public
Task
<
bool
>
AddInvLogs
(
InvReq
model
)
public
Task
<
bool
>
AddInvLogs
(
InvReq
model
,
List
<
Inventory
>
lostInv
)
{
{
InvSummary
inv
=
new
InvSummary
()
InvSummary
inv
=
new
InvSummary
()
{
{
...
@@ -34,7 +34,6 @@ namespace Services
...
@@ -34,7 +34,6 @@ namespace Services
useName
=
model
.
userName
,
useName
=
model
.
userName
,
invSum
=
model
.
invSum
,
invSum
=
model
.
invSum
,
resultSum
=
model
.
resultSum
,
resultSum
=
model
.
resultSum
,
overView
=
model
.
overView
,
createTime
=
DateTime
.
Now
,
createTime
=
DateTime
.
Now
,
updateTime
=
DateTime
.
Now
,
updateTime
=
DateTime
.
Now
,
};
};
...
@@ -50,6 +49,7 @@ namespace Services
...
@@ -50,6 +49,7 @@ namespace Services
{
{
id
=
detail
.
invId
,
id
=
detail
.
invId
,
state
=
"0"
,
state
=
"0"
,
updateTime
=
DateTime
.
Now
});
});
}
else
if
(
detail
.
state
==
1
)
}
else
if
(
detail
.
state
==
1
)
{
{
...
@@ -57,9 +57,12 @@ namespace Services
...
@@ -57,9 +57,12 @@ namespace Services
{
{
id
=
detail
.
invId
,
id
=
detail
.
invId
,
lostFlag
=
"1"
,
lostFlag
=
"1"
,
updateTime
=
DateTime
.
Now
});
});
}
}
if
(
detail
.
state
!=
2
)
{
inv
.
DetailList
.
Add
(
new
InvDetail
()
inv
.
DetailList
.
Add
(
new
InvDetail
()
{
{
invId
=
detail
.
invId
,
invId
=
detail
.
invId
,
...
@@ -72,7 +75,34 @@ namespace Services
...
@@ -72,7 +75,34 @@ namespace Services
});
});
}
}
return
_invSummaryRepository
.
AddInvLogs
(
inv
,
inList
,
lostList
);
}
var
lostIds
=
lostList
.
Select
(
s
=>
s
.
id
);
List
<
Inventory
>
addList
=
new
List
<
Inventory
>();
foreach
(
var
item
in
lostInv
)
{
if
(!
lostIds
.
Contains
(
item
.
id
))
{
addList
.
Add
(
item
);
}
}
inv
.
DetailList
.
AddRange
(
lostInv
.
Select
(
s
=>
new
InvDetail
()
{
invId
=
s
.
id
,
typeName
=
s
.
typeName
,
sizeName
=
s
.
sizeName
,
epc
=
s
.
epc
,
state
=
2
,
createTime
=
DateTime
.
Now
,
updateTime
=
DateTime
.
Now
,
}).
ToList
());
inv
.
overView
=
$"盘盈
{
addList
.
Count
()}
件,盘亏
{
lostList
.
Count
()}
件,更新在库
{
inList
.
Count
()}
件"
;
return
_invSummaryRepository
.
AddInvLogs
(
inv
,
inList
,
lostList
,
lostInv
);
}
}
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论