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
633f8b75
Commit
633f8b75
authored
Dec 19, 2023
by
Seniorious
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4f23bed8
显示空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
495 行增加
和
17 行删除
+495
-17
BaseInfoController.cs
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
+154
-9
CommonReq.cs
WebApiNET6-master/APIs/Req/CommonReq.cs
+15
-1
Startup.cs
WebApiNET6-master/APIs/Startup.cs
+2
-0
RecordsReq.cs
WebApiNET6-master/Models/ReqModel/RecordsReq.cs
+2
-1
Channel.cs
WebApiNET6-master/Models/Table/Channel.cs
+22
-0
PoliceFinger.cs
WebApiNET6-master/Models/Table/PoliceFinger.cs
+5
-0
Warehouse.cs
WebApiNET6-master/Models/Table/Warehouse.cs
+1
-1
IBussinessInventoryRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/IBussinessInventoryRepository.cs
+1
-1
IChannelRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/IChannelRepository.cs
+13
-0
ILogSummaryRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/ILogSummaryRepository.cs
+2
-0
IPoliceFingerRepository.cs
WebApiNET6-master/Repositories/IRepository/IBussiness/IPoliceFingerRepository.cs
+1
-0
ChannelRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/ChannelRepository.cs
+19
-0
LogSummaryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
+174
-1
PoliceFingerRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/PoliceFingerRepository.cs
+34
-1
BussinessInventoryService.cs
WebApiNET6-master/Services/BussinessInventoryService.cs
+1
-1
ChannelService.cs
WebApiNET6-master/Services/ChannelService.cs
+22
-0
IBussinessInventoryService.cs
WebApiNET6-master/Services/Interface/IBussinessInventoryService.cs
+1
-1
IChannelService.cs
WebApiNET6-master/Services/Interface/IChannelService.cs
+13
-0
ILogService.cs
WebApiNET6-master/Services/Interface/ILogService.cs
+2
-0
IPoliceFingerService.cs
WebApiNET6-master/Services/Interface/IPoliceFingerService.cs
+1
-0
LogService.cs
WebApiNET6-master/Services/LogService.cs
+6
-0
PoliceFingerService.cs
WebApiNET6-master/Services/PoliceFingerService.cs
+4
-0
没有找到文件。
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
View file @
633f8b75
...
...
@@ -8,6 +8,7 @@ using Common.Global;
using
Common.Utility.Model
;
using
Common.Utility.RabbitMQ
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc.Filters
;
using
Microsoft.AspNetCore.Mvc.ModelBinding
;
using
Microsoft.CodeAnalysis
;
using
Microsoft.IdentityModel.Tokens
;
...
...
@@ -30,6 +31,7 @@ using System.Linq.Expressions;
using
System.Runtime.InteropServices
;
using
System.Security.Cryptography
;
using
System.Security.Cryptography.Xml
;
using
System.Text
;
using
static
Common
.
HttpHelper
;
using
static
Dm
.
net
.
buffer
.
ByteArrayBuffer
;
using
static
Microsoft
.
AspNetCore
.
Razor
.
Language
.
TagHelperMetadata
;
...
...
@@ -61,13 +63,14 @@ namespace APIs.Controllers
private
readonly
IPoliceInfoService
_policeInfoService
;
private
readonly
IBussinessInventoryService
_bussinessInventoryService
;
private
readonly
IBussinessInventoryDetailService
_bussinessInventoryDetailService
;
private
readonly
IChannelService
_channelService
;
public
BaseInfoController
(
IMapper
mapper
,
IPoliceService
policeService
,
IEquipmentTypeService
equipmentTypeService
,
IEquipmentSizeService
equipmentSizeService
,
ICarService
carService
,
IInventoryService
inventoryService
,
IInvService
invService
,
IUsersService
usersService
,
ILogService
logService
,
IDevHistoryService
devHistoryService
,
IDevService
devService
,
IWarehouseService
warehouseService
,
IOrderService
orderService
,
ISupplierService
supplierService
,
IThisInfoService
thisInfoService
,
IPrintService
printService
,
IPoliceFingerService
policeFingerService
,
IPoliceInfoService
policeInfoService
,
IBussinessInventoryService
bussinessInventoryService
,
IBussinessInventoryDetailService
bussinessInventoryDetailService
)
IBussinessInventoryService
bussinessInventoryService
,
IBussinessInventoryDetailService
bussinessInventoryDetailService
,
IChannelService
channelService
)
{
_carService
=
carService
;
_equipmentSizeService
=
equipmentSizeService
;
...
...
@@ -88,6 +91,7 @@ namespace APIs.Controllers
_policeInfoService
=
policeInfoService
;
_bussinessInventoryService
=
bussinessInventoryService
;
_bussinessInventoryDetailService
=
bussinessInventoryDetailService
;
_channelService
=
channelService
;
Mapper
=
mapper
;
}
...
...
@@ -160,7 +164,7 @@ namespace APIs.Controllers
}
var
httpRes
=
JsonConvert
.
DeserializeObject
<
res
<
string
>>(
json
);
if
(
httpRes
.
code
!=
"1000
0"
)
if
(
httpRes
==
null
||
httpRes
.
code
!=
"992
0"
)
{
await
_bussinessInventoryService
.
OrderRollBack
(
rs
);
return
new
ApiResult
...
...
@@ -211,14 +215,27 @@ namespace APIs.Controllers
};
}
if
(
req
==
null
||
req
.
order
==
null
||
req
.
logList
==
null
)
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"参数错误"
,
};
}
var
src
=
new
ApiResult
var
rs
=
await
_logService
.
HandUploadResult
(
Convert
.
ToInt64
(
AdminGlobalContext
.
jyzbConfig
.
OrgId
),
req
);
return
rs
?
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
}:
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"数据更新失败"
,
};
return
src
;
}
catch
(
Exception
ex
)
{
...
...
@@ -373,6 +390,55 @@ namespace APIs.Controllers
}
/// <summary>
/// 通道获取配置
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
async
Task
<
ApiResult
>
GetWarehouseConfig
([
FromBody
]
GetWarehouseConfigReq
req
)
{
try
{
if
(
req
==
null
||
string
.
IsNullOrEmpty
(
req
.
deviceId
))
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"参数错误"
,
};
}
var
config
=
await
_channelService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
req
.
deviceId
));
if
(
config
!=
null
)
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
data
=
config
.
config
,
};
}
else
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"无通道配置"
,
};
}
}
catch
(
Exception
ex
)
{
var
error
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ex
.
Message
,
};
return
error
;
}
}
/// <summary>
/// 人脸机通过人员标识获取警员信息
/// </summary>
/// <returns></returns>
...
...
@@ -449,7 +515,7 @@ namespace APIs.Controllers
carNo
=
s
.
HkFaceDevice
,
createTime
=
s
.
createTime
,
updateTime
=
s
.
updateTime
,
fingerList
=
fingers
.
Where
(
c
=>
c
.
policeId
.
Equals
(
s
.
id
)).
ToList
(),
fingerList
=
fingers
.
Where
(
c
=>
c
.
policeId
.
Equals
(
s
.
id
)).
Select
(
s
=>
new
{
fingerInfo
=
s
.
fingerInfo
,
fingerNum
=
s
.
fingerNum
}).
ToList
(),
}).
ToList
();
var
src
=
new
ApiResult
...
...
@@ -491,7 +557,7 @@ namespace APIs.Controllers
};
}
if
(
req
.
state
!=
0
||
req
.
Epc
.
Count
()
!=
1
)
if
(
req
.
state
!=
0
&&
req
.
state
!=
1
)
{
return
new
ApiResult
{
...
...
@@ -565,6 +631,8 @@ namespace APIs.Controllers
List
<
Inventory
>
newEquList
=
new
List
<
Inventory
>();
List
<
LogDetail
>
logDetailList
=
new
List
<
LogDetail
>();
var
policeName
=
string
.
IsNullOrEmpty
(
req
.
policeId
)
?
""
:
(
await
_policeInfoService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
req
.
policeId
)))?.
name
;
var
orgInfo
=
await
_thisInfoService
.
QueryOne
(
s
=>
true
);
foreach
(
var
epc
in
epcList
)
{
...
...
@@ -575,7 +643,7 @@ namespace APIs.Controllers
var
mytype
=
await
_equipmentTypeService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
typecode
));
var
mysize
=
await
_equipmentSizeService
.
QueryOne
(
s
=>
s
.
typeId
.
Equals
(
typecode
)
&&
s
.
code
.
Equals
(
sizecode
));
var
mysupplier
=
await
_supplierService
.
QueryOne
(
s
=>
s
.
code
.
Equals
(
suppliercode
));
;
var
mysupplier
=
await
_supplierService
.
QueryOne
(
s
=>
s
.
code
.
Equals
(
suppliercode
));
if
(
mytype
!=
null
&&
mysize
!=
null
)
{
...
...
@@ -661,7 +729,7 @@ namespace APIs.Controllers
{
locationId
=
req
.
warehouseId
,
locationName
=
warehouse
.
name
,
userName
=
""
,
userName
=
policeName
,
useTime
=
DateTime
.
Now
,
createTime
=
DateTime
.
Now
,
updateTime
=
DateTime
.
Now
,
...
...
@@ -702,6 +770,83 @@ namespace APIs.Controllers
}
/// <summary>
/// 更新警员指纹
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
async
Task
<
ApiResult
>
UpdateFinger
([
FromBody
]
UpdateFingerReq
req
)
{
try
{
if
(
req
==
null
)
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"参数错误"
,
};
}
else
if
(
string
.
IsNullOrEmpty
(
req
.
policeId
))
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"警员编号为空"
,
};
}
else
if
(
req
.
fingerList
==
null
||
req
.
fingerList
.
Count
()
==
0
)
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"指纹信息为空"
,
};
}
var
police
=
await
_policeInfoService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
req
.
policeId
));
if
(
police
==
null
)
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"无警员信息"
,
};
}
else
{
var
json
=
HttpHelper
.
HttpPost
(
AdminGlobalContext
.
jyzbConfig
.
Url
+
"BussinessInventory/UpdateFinger"
,
JsonConvert
.
SerializeObject
(
req
));
var
httprs
=
JsonConvert
.
DeserializeObject
<
HttpHelper
.
res
<
string
>>(
json
);
if
(
httprs
!=
null
&&
httprs
.
code
==
"9920"
)
{
var
rs
=
await
_policeFingerService
.
UpdateFinger
(
req
.
policeId
,
req
.
fingerList
);
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ResultCode
.
OPERATE_FAILED
.
Msg
,
};
}
else
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"上传平台失败"
,
};
}
}
}
catch
(
Exception
ex
)
{
var
error
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ex
.
Message
,
};
return
error
;
}
}
/// <summary>
/// 获取装备类别
/// </summary>
/// <returns></returns>
...
...
WebApiNET6-master/APIs/Req/CommonReq.cs
View file @
633f8b75
namespace
APIs.Req
using
Models.Table
;
namespace
APIs.Req
{
public
class
CommonReq
{
...
...
@@ -25,4 +27,15 @@
{
public
string
warehouseId
{
get
;
set
;
}
}
public
class
GetWarehouseConfigReq
{
public
string
deviceId
{
get
;
set
;
}
}
public
class
UpdateFingerReq
{
public
string
policeId
{
get
;
set
;
}
public
List
<
PoliceFinger
>
fingerList
{
get
;
set
;
}
}
}
\ No newline at end of file
WebApiNET6-master/APIs/Startup.cs
View file @
633f8b75
...
...
@@ -77,6 +77,7 @@ namespace APIs
services
.
AddScoped
<
IPoliceFingerService
,
PoliceFingerService
>();
services
.
AddScoped
<
IBussinessInventoryService
,
BussinessInventoryService
>();
services
.
AddScoped
<
IBussinessInventoryDetailService
,
BussinessInventoryDetailService
>();
services
.
AddScoped
<
IChannelService
,
ChannelService
>();
#
endregion
#
region
Repository
...
...
@@ -103,6 +104,7 @@ namespace APIs
services
.
AddScoped
<
IPoliceFingerRepository
,
PoliceFingerRepository
>();
services
.
AddScoped
<
IBussinessInventoryRepository
,
BussinessInventoryRepository
>();
services
.
AddScoped
<
IBussinessInventoryDetailRepository
,
BussinessInventoryDetailRepository
>();
services
.
AddScoped
<
IChannelRepository
,
ChannelRepository
>();
#
endregion
#
region
注册
RabbitMQ
消费者
...
...
WebApiNET6-master/Models/ReqModel/RecordsReq.cs
View file @
633f8b75
...
...
@@ -64,12 +64,13 @@ namespace Common.Utility.Model
public
int
?
state
{
get
;
set
;
}
public
string
warehouseId
{
get
;
set
;
}
public
string
picture
{
get
;
set
;
}
public
string
policeId
{
get
;
set
;
}
}
public
class
HandResultReq
{
public
OrderDetail
order
{
get
;
set
;
}
public
List
<
LogSummary
>
logList
{
get
;
set
;
}
public
List
<
Inventory
>?
purchaseList
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/Channel.cs
0 → 100644
View file @
633f8b75
using
SqlSugar
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Models.Table
{
[
SugarTable
(
"base_warehouse_channel"
)]
public
class
Channel
:
BaseTable
{
[
SugarColumn
(
IsPrimaryKey
=
true
)]
public
string
id
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"warehouse_id"
)]
public
string
warehouseId
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"config"
)]
public
string
config
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/PoliceFinger.cs
View file @
633f8b75
...
...
@@ -30,5 +30,10 @@ namespace Models.Table
///</summary>
[
SugarColumn
(
ColumnName
=
"finger_info"
)]
public
string
fingerInfo
{
get
;
set
;
}
/// <summary>
/// 指纹编号
///</summary>
[
SugarColumn
(
ColumnName
=
"finger_num"
)]
public
string
fingerNum
{
get
;
set
;
}
}
}
WebApiNET6-master/Models/Table/Warehouse.cs
View file @
633f8b75
...
...
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace
Models.Table
{
[
SugarTable
(
"base_warehouse"
)]
public
class
Warehouse
:
BaseTable
public
class
Warehouse
{
[
SugarColumn
(
IsPrimaryKey
=
true
)]
public
string
id
{
get
;
set
;
}
...
...
WebApiNET6-master/Repositories/IRepository/IBussiness/IBussinessInventoryRepository.cs
View file @
633f8b75
...
...
@@ -10,6 +10,6 @@ namespace Repositories.IRepository.IBussiness
public
interface
IBussinessInventoryRepository
:
IBaseRepository
<
BussinessInventory
>
{
Task
<
BussinessInventory
>?
GenerateInventoryOrder
(
BussinessInventory
myBIOrder
);
async
Task
<
bool
>
OrderRollBack
(
BussinessInventory
myBIOrder
);
Task
<
bool
>
OrderRollBack
(
BussinessInventory
myBIOrder
);
}
}
WebApiNET6-master/Repositories/IRepository/IBussiness/IChannelRepository.cs
0 → 100644
View file @
633f8b75
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
IChannelRepository
:
IBaseRepository
<
Channel
>
{
}
}
WebApiNET6-master/Repositories/IRepository/IBussiness/ILogSummaryRepository.cs
View file @
633f8b75
using
Common.Utility.Model
;
using
Models.SqlModel
;
using
Models.Table
;
using
System
;
...
...
@@ -17,5 +18,6 @@ namespace Repositories.IRepository.IBussiness
Task
<
bool
>
AddChannelLog
(
OrderMain
?
myOrder
,
LogSummary
summary
,
List
<
Inventory
>
newInvs
,
Tuple
<
string
,
string
>
inv_states
);
Task
<
bool
>
HandUploadResult
(
long
?
orgid
,
HandResultReq
req
);
}
}
WebApiNET6-master/Repositories/IRepository/IBussiness/IPoliceFingerRepository.cs
View file @
633f8b75
...
...
@@ -9,5 +9,6 @@ namespace Repositories.IRepository.IBussiness
{
public
interface
IPoliceFingerRepository
:
IBaseRepository
<
PoliceFinger
>
{
Task
<
bool
>
UpdateFinger
(
string
policeId
,
List
<
PoliceFinger
>
fingers
);
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/ChannelRepository.cs
0 → 100644
View file @
633f8b75
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
ChannelRepository
:
BaseRepository
<
Channel
>,
IChannelRepository
{
public
ChannelRepository
(
ILocalSugarUnitOfWork
sugarUnitOfWork
)
:
base
(
sugarUnitOfWork
)
{
}
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
View file @
633f8b75
using
AutoMapper
;
using
Common.Utility.Model
;
using
Models.SqlModel
;
using
Models.Table
;
using
Repositories.IRepository.IBussiness
;
...
...
@@ -21,6 +22,176 @@ namespace Repositories.Repository.Bussiness
_suger
=
sugarUnitOfWork
;
}
public
async
Task
<
bool
>
HandUploadResult
(
long
?
orgid
,
HandResultReq
req
)
{
using
(
var
context
=
_suger
.
GetDbClient
())
{
try
{
context
.
BeginTran
();
//更新主单
var
mainOrder
=
context
.
Queryable
<
OrderMain
>().
First
(
x
=>
x
.
id
.
Equals
(
req
.
order
.
orderId
));
mainOrder
.
actualQuantity
+=
req
.
order
.
actualNum
;
mainOrder
.
price
+=
req
.
order
.
price
;
mainOrder
.
updateTime
=
DateTime
.
Now
;
context
.
Updateable
(
mainOrder
)
.
WhereColumns
(
s
=>
new
{
s
.
actualQuantity
,
s
.
price
,
s
.
updateTime
})
.
ExecuteCommand
();
//更新子单
req
.
order
.
updateTime
=
DateTime
.
Now
;
context
.
Updateable
(
req
.
order
)
.
WhereColumns
(
s
=>
new
{
s
.
actualNum
,
s
.
price
,
s
.
updateTime
})
.
PublicSetColumns
(
s
=>
s
.
price
,
"+"
)
//price += s.price
.
PublicSetColumns
(
s
=>
s
.
actualNum
,
"+"
)
.
ExecuteCommand
();
//新装备
bool
isNewEqu
=
false
;
bool
isPurchase
=
false
;
List
<
Inventory
>
newEquList
=
new
List
<
Inventory
>();
List
<
PrintDetail
>
periodInfoList
=
new
List
<
PrintDetail
>();
//采购装备质保期维保期生产日期等信息
List
<
string
>
newEquOrderType
=
new
List
<
string
>()
{
"purchase"
,
"gift"
,
"allocate"
};
if
(
newEquOrderType
.
Contains
(
mainOrder
.
bussinessType
)
&&
mainOrder
.
orderType
.
Equals
(
"in"
))
{
isNewEqu
=
true
;
periodInfoList
=
context
.
Queryable
<
PrintDetail
>().
Where
(
s
=>
s
.
orderId
.
Equals
(
mainOrder
.
id
)).
ToList
();
if
(
mainOrder
.
bussinessType
.
Equals
(
"purchase"
))
{
isPurchase
=
true
;
}
}
List
<
string
>
InventoryIds
=
new
List
<
string
>();
//出入库记录
var
supplierDic
=
context
.
Queryable
<
Supplier
>().
ToList
();
req
.
logList
.
ForEach
(
s
=>
{
s
.
isUpload
=
0
;
s
.
useTime
=
DateTime
.
Now
;
s
.
createTime
=
DateTime
.
Now
;
s
.
updateTime
=
DateTime
.
Now
;
s
.
DetailList
.
ForEach
(
c
=>
{
var
mySup
=
supplierDic
.
FirstOrDefault
(
a
=>
a
.
code
.
Equals
(
c
.
supplierName
));
if
(!
string
.
IsNullOrEmpty
(
c
.
inventoryId
))
InventoryIds
.
Add
(
c
.
inventoryId
);
c
.
createTime
=
DateTime
.
Now
;
c
.
updateTime
=
DateTime
.
Now
;
c
.
errorState
=
0
;
c
.
state
=
s
.
outInState
==
"in"
?
0
:
1
;
c
.
supplierId
=
mySup
?.
id
;
c
.
supplierName
=
mySup
?.
name
;
//新装备
if
(
isNewEqu
)
{
var
equ
=
new
Inventory
()
{
id
=
Guid
.
NewGuid
().
ToString
(),
equipmentType
=
"0"
,
typeId
=
c
.
equipmentTypeId
,
typeName
=
c
.
equipmentName
,
sizeId
=
c
.
equipmentSizeId
,
sizeName
=
c
.
equipmentSize
,
supplierId
=
mySup
?.
id
,
supplierName
=
mySup
?.
name
,
epc
=
c
.
epc
,
orgId
=
orgid
,
state
=
"0"
,
lostFlag
=
"0"
,
price
=
c
.
price
,
locationType
=
"0"
,
locationId
=
s
.
locationId
,
equState
=
"normal"
,
bussinessState
=
"normal"
,
createTime
=
DateTime
.
Now
,
updateTime
=
DateTime
.
Now
,
};
c
.
inventoryId
=
equ
.
id
;
if
(
isPurchase
)
{
var
myperiod
=
periodInfoList
?.
FirstOrDefault
(
b
=>
b
.
sizeId
.
Equals
(
c
.
equipmentSizeId
));
equ
.
state
=
"2"
;
equ
.
maintenancePeriod
=
myperiod
?.
maintenancePeriod
?.
ToString
();
equ
.
warrantyPeriod
=
myperiod
?.
warrantyPeriod
?.
ToString
();
equ
.
productionDate
=
myperiod
?.
productionDate
;
}
newEquList
.
Add
(
equ
);
}
});
});
context
.
Insertable
(
req
).
ExecuteCommand
();
if
(
newEquList
!=
null
&&
newEquList
.
Count
()
>
0
)
{
context
.
Insertable
(
newEquList
).
ExecuteCommand
();
}
#
region
更新装备状态
var
target_bussinessState
=
"normal"
;
var
target_equState
=
"normal"
;
if
(
mainOrder
.
orderType
.
Equals
(
"out"
))
//获取装备应设为的状态
{
switch
(
mainOrder
.
bussinessType
)
{
case
"allocate"
:
target_bussinessState
=
"transfer"
;
break
;
case
"use"
:
target_bussinessState
=
"take"
;
break
;
case
"remove"
:
target_bussinessState
=
"remove"
;
break
;
case
"destruction"
:
target_bussinessState
=
"destruction"
;
target_equState
=
"destory"
;
break
;
case
"repair"
:
target_bussinessState
=
"repair"
;
target_equState
=
"fix"
;
break
;
default
:
break
;
}
}
if
(
InventoryIds
.
Count
()
>
0
)
{
context
.
Updateable
<
Inventory
>()
.
Where
(
s
=>
InventoryIds
.
Contains
(
s
.
id
))
.
ReSetValue
(
it
=>
{
it
.
bussinessState
=
target_bussinessState
;
it
.
equState
=
target_equState
;
it
.
updateTime
=
DateTime
.
Now
;
})
.
ExecuteCommand
();
}
#
endregion
context
.
CommitTran
();
return
true
;
}
catch
(
Exception
e
)
{
return
false
;
}
}
}
public
async
Task
<
bool
>
AddChannelLog
(
OrderMain
?
myOrder
,
LogSummary
summary
,
List
<
Inventory
>
newInvs
,
Tuple
<
string
,
string
>
inv_states
)
{
using
(
var
context
=
_suger
.
GetDbClient
())
...
...
@@ -43,11 +214,12 @@ namespace Repositories.Repository.Bussiness
var
logrs
=
context
.
InsertNav
(
summary
).
Include
(
z1
=>
z1
.
DetailList
).
ExecuteCommand
();
//更新库存状态
var
state
=
newInvs
!=
null
&&
newInvs
.
Count
()
>
0
?
"2"
:
summary
.
outInState
.
Equals
(
"out"
)
?
"1"
:
"0"
;
var
invIds
=
summary
.
DetailList
.
Select
(
a
=>
a
.
inventoryId
).
ToList
();
context
.
Updateable
<
Inventory
>().
Where
(
s
=>
invIds
.
Contains
(
s
.
id
))
.
SetColumns
(
i
=>
new
Inventory
()
{
state
=
newInvs
!=
null
&&
newInvs
.
Count
()
>
0
?
"2"
:
summary
.
outInState
.
Equals
(
"out"
)
?
"1"
:
"0"
,
state
=
state
,
bussinessState
=
inv_states
.
Item1
,
equState
=
inv_states
.
Item2
,
updateTime
=
DateTime
.
Now
...
...
@@ -169,5 +341,6 @@ namespace Repositories.Repository.Bussiness
}
return
true
;
}
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/PoliceFingerRepository.cs
View file @
633f8b75
using
Models.Table
;
using
AutoMapper
;
using
Models.Table
;
using
Repositories.IRepository.IBussiness
;
using
Repositories.IRepository.IUnitOfWork
;
using
System
;
...
...
@@ -11,9 +12,41 @@ namespace Repositories.Repository.Bussiness
{
public
class
PoliceFingerRepository
:
BaseRepository
<
PoliceFinger
>,
IPoliceFingerRepository
{
protected
readonly
ILocalSugarUnitOfWork
_suger
;
public
IMapper
mapper
;
public
PoliceFingerRepository
(
ILocalSugarUnitOfWork
sugarUnitOfWork
)
:
base
(
sugarUnitOfWork
)
{
_suger
=
sugarUnitOfWork
;
}
public
async
Task
<
bool
>
UpdateFinger
(
string
policeId
,
List
<
PoliceFinger
>
fingers
)
{
using
(
var
context
=
_suger
.
GetDbClient
())
{
try
{
fingers
.
ForEach
(
s
=>
{
s
.
policeId
=
policeId
;
s
.
createTime
=
DateTime
.
Now
;
s
.
updateTime
=
DateTime
.
Now
;
});
//新增或更新
var
x
=
context
.
Storageable
(
fingers
).
ToStorage
();
x
.
AsInsertable
.
ExecuteCommand
();
x
.
AsUpdateable
.
WhereColumns
(
s
=>
new
{
s
.
id
,
s
.
fingerNum
})
//查询字段
.
UpdateColumns
(
s
=>
new
{
s
.
fingerInfo
,
s
.
updateTime
})
//更新字段
.
IgnoreColumns
(
s
=>
new
{
s
.
policeId
,
s
.
fingerNum
,
s
.
createTime
})
//不更新字段
.
ExecuteCommand
();
return
true
;
}
catch
(
Exception
e
)
{
return
false
;
}
}
}
}
}
WebApiNET6-master/Services/BussinessInventoryService.cs
View file @
633f8b75
...
...
@@ -29,7 +29,7 @@ namespace Services
return
_bussinessInventoryRepository
.
GenerateInventoryOrder
(
myBIOrder
);
}
public
async
Task
<
bool
>
OrderRollBack
(
BussinessInventory
myBIOrder
)
public
Task
<
bool
>
OrderRollBack
(
BussinessInventory
myBIOrder
)
{
return
_bussinessInventoryRepository
.
OrderRollBack
(
myBIOrder
);
}
...
...
WebApiNET6-master/Services/ChannelService.cs
0 → 100644
View file @
633f8b75
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
ChannelService
:
BaseService
<
Channel
>,
IChannelService
{
private
readonly
IChannelRepository
_channelRepository
;
public
ChannelService
(
IChannelRepository
channelRepository
)
{
base
.
BaseDal
=
channelRepository
;
_channelRepository
=
channelRepository
;
}
}
}
WebApiNET6-master/Services/Interface/IBussinessInventoryService.cs
View file @
633f8b75
...
...
@@ -10,6 +10,6 @@ namespace Services.Interface
public
interface
IBussinessInventoryService
:
IBaseServices
<
BussinessInventory
>
{
Task
<
BussinessInventory
>?
GenerateInventoryOrder
(
BussinessInventory
myBIOrder
);
async
Task
<
bool
>
OrderRollBack
(
BussinessInventory
myBIOrder
);
Task
<
bool
>
OrderRollBack
(
BussinessInventory
myBIOrder
);
}
}
WebApiNET6-master/Services/Interface/IChannelService.cs
0 → 100644
View file @
633f8b75
using
Models.Table
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Services.Interface
{
public
interface
IChannelService
:
IBaseServices
<
Channel
>
{
}
}
WebApiNET6-master/Services/Interface/ILogService.cs
View file @
633f8b75
...
...
@@ -20,5 +20,7 @@ namespace Services.Interface
Task
<
bool
>
AddHandLogs
(
HandRecordsReq
model
);
Task
<
bool
>
AddChannelLog
(
OrderMain
?
myOrder
,
LogSummary
summary
,
List
<
Inventory
>
newInvs
);
Task
<
bool
>
HandUploadResult
(
long
?
orgid
,
HandResultReq
req
);
}
}
WebApiNET6-master/Services/Interface/IPoliceFingerService.cs
View file @
633f8b75
...
...
@@ -9,5 +9,6 @@ namespace Services.Interface
{
public
interface
IPoliceFingerService
:
IBaseServices
<
PoliceFinger
>
{
Task
<
bool
>
UpdateFinger
(
string
policeId
,
List
<
PoliceFinger
>
fingers
);
}
}
WebApiNET6-master/Services/LogService.cs
View file @
633f8b75
...
...
@@ -28,6 +28,11 @@ namespace Services
mapper
=
_mapper
;
}
public
Task
<
bool
>
HandUploadResult
(
long
?
orgid
,
HandResultReq
req
)
{
return
_logSummaryRepository
.
HandUploadResult
(
orgid
,
req
);
}
public
Task
<
bool
>
AddChannelLog
(
OrderMain
?
myOrder
,
LogSummary
summary
,
List
<
Inventory
>
newInvs
)
{
var
rs1
=
"normal"
;
//bussiness_state
...
...
@@ -134,5 +139,6 @@ namespace Services
}).
ToList
();
return
_logSummaryRepository
.
AddLogs
(
log
,
inveqList
,
invCarList
);
}
}
}
WebApiNET6-master/Services/PoliceFingerService.cs
View file @
633f8b75
...
...
@@ -18,5 +18,9 @@ namespace Services
_policeFingerRepository
=
policeFingerRepository
;
}
public
Task
<
bool
>
UpdateFinger
(
string
policeId
,
List
<
PoliceFinger
>
fingers
)
{
return
_policeFingerRepository
.
UpdateFinger
(
policeId
,
fingers
);
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论