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
9fd46a7f
Commit
9fd46a7f
authored
Jan 04, 2024
by
Seniorious
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6c3db362
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
260 行增加
和
39 行删除
+260
-39
BaseInfoController.cs
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
+90
-28
d2abb591-81b9-44ff-9d05-b5493fbeb9b1.jpg
WebApiNET6-master/APIs/LogPictures/20240104/d2abb591-81b9-44ff-9d05-b5493fbeb9b1.jpg
+0
-0
d89c5c82-a0c3-47a1-8704-a2f477be51dc.jpg
WebApiNET6-master/APIs/LogPictures/20240104/d89c5c82-a0c3-47a1-8704-a2f477be51dc.jpg
+0
-0
d8bb0490-e980-4db9-a3bf-6d7d929ada2a.jpg
WebApiNET6-master/APIs/LogPictures/20240104/d8bb0490-e980-4db9-a3bf-6d7d929ada2a.jpg
+0
-0
CommonReq.cs
WebApiNET6-master/APIs/Req/CommonReq.cs
+2
-1
EpcConvert.cs
WebApiNET6-master/Common/EpcConvert.cs
+125
-0
EquipmentSize.cs
WebApiNET6-master/Models/Table/EquipmentSize.cs
+1
-1
EquipmentType.cs
WebApiNET6-master/Models/Table/EquipmentType.cs
+1
-1
Inventory.cs
WebApiNET6-master/Models/Table/Inventory.cs
+1
-1
PoliceFinger.cs
WebApiNET6-master/Models/Table/PoliceFinger.cs
+1
-1
PoliceFingerRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/PoliceFingerRepository.cs
+29
-6
IOrderService.cs
WebApiNET6-master/Services/Interface/IOrderService.cs
+2
-0
OrderService.cs
WebApiNET6-master/Services/OrderService.cs
+8
-0
没有找到文件。
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
View file @
9fd46a7f
using
APIs.Common
;
using
APIs.Common
;
using
APIs.Dto
;
using
APIs.Dto
;
using
APIs.Req
;
using
APIs.Req
;
using
APIs.TimedTasks
;
using
Autofac.Core
;
using
Autofac.Core
;
using
AutoMapper
;
using
AutoMapper
;
using
Common
;
using
Common
;
...
@@ -39,6 +38,8 @@ using static Microsoft.AspNetCore.Razor.Language.TagHelperMetadata;
...
@@ -39,6 +38,8 @@ using static Microsoft.AspNetCore.Razor.Language.TagHelperMetadata;
using
static
System
.
Net
.
Mime
.
MediaTypeNames
;
using
static
System
.
Net
.
Mime
.
MediaTypeNames
;
using
static
JmpDehumidifierLib
.
Dehumidifier
;
using
static
JmpDehumidifierLib
.
Dehumidifier
;
using
JmpDehumidifierLib
;
using
JmpDehumidifierLib
;
using
NLog.Fluent
;
using
System.Security.Policy
;
namespace
APIs.Controllers
namespace
APIs.Controllers
{
{
...
@@ -232,7 +233,7 @@ namespace APIs.Controllers
...
@@ -232,7 +233,7 @@ namespace APIs.Controllers
}
}
var
httpRes
=
JsonConvert
.
DeserializeObject
<
res
<
string
>>(
json
);
var
httpRes
=
JsonConvert
.
DeserializeObject
<
res
<
string
>>(
json
);
if
(
httpRes
==
null
||
httpRes
.
code
!=
"9920"
)
if
(
httpRes
==
null
||
httpRes
.
code
!=
"9920
0
"
)
{
{
await
_bussinessInventoryService
.
OrderRollBack
(
rs
);
await
_bussinessInventoryService
.
OrderRollBack
(
rs
);
return
new
ApiResult
return
new
ApiResult
...
@@ -399,7 +400,7 @@ namespace APIs.Controllers
...
@@ -399,7 +400,7 @@ namespace APIs.Controllers
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
async
Task
<
ApiResult
>
UpdateHKPicture
([
From
Body
]
UpdateHKPictureReq
req
)
public
async
Task
<
ApiResult
>
UpdateHKPicture
([
From
Form
]
UpdateHKPictureReq
req
)
{
{
try
try
{
{
...
@@ -423,18 +424,43 @@ namespace APIs.Controllers
...
@@ -423,18 +424,43 @@ namespace APIs.Controllers
if
(
policeinfo
!=
null
)
if
(
policeinfo
!=
null
)
{
{
policeinfo
.
photo
=
req
.
photo
;
using
(
HttpClient
client
=
new
HttpClient
())
var
rs
=
await
_policeInfoService
.
Update
(
policeinfo
);
return
rs
?
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
}
:
new
ApiResult
{
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
var
postContent
=
new
MultipartFormDataContent
();
msg
=
"更新地址失败"
,
string
boundary
=
string
.
Format
(
"--{0}"
,
DateTime
.
Now
.
Ticks
.
ToString
(
"x"
));
};
;
postContent
.
Headers
.
Add
(
"ContentType"
,
$"multipart/form-data, boundary=
{
boundary
}
"
);
postContent
.
Add
(
new
ByteArrayContent
(
req
.
picture
),
"picture"
);
postContent
.
Add
(
new
StringContent
(
req
.
policeId
),
"policeId"
);
using
(
HttpResponseMessage
response
=
client
.
PostAsync
(
AdminGlobalContext
.
jyzbConfig
+
"/api/uploadPolicePhoto"
,
postContent
).
Result
)
{
var
str
=
response
.
Content
.
ReadAsStringAsync
().
Result
;
var
res
=
JsonConvert
.
DeserializeObject
<
HttpHelper
.
res
<
dynamic
>>(
str
);
if
(
res
!=
null
&&
res
.
code
.
Equals
(
"99200"
))
{
policeinfo
.
photo
=
res
.
data
.
photo
;
var
rs
=
await
_policeInfoService
.
Update
(
policeinfo
);
return
rs
?
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
}
:
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"更新地址失败"
,
};
}
else
{
return
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
"上传平台失败"
,
};
}
}
}
}
}
else
else
{
{
...
@@ -466,7 +492,7 @@ namespace APIs.Controllers
...
@@ -466,7 +492,7 @@ namespace APIs.Controllers
{
{
try
try
{
{
if
(
req
==
null
||
string
.
IsNullOrEmpty
(
req
.
deviceId
))
if
(
req
==
null
||
(
string
.
IsNullOrEmpty
(
req
.
deviceId
)
&&
string
.
IsNullOrEmpty
(
req
.
warehouseId
)
))
{
{
return
new
ApiResult
return
new
ApiResult
{
{
...
@@ -475,7 +501,15 @@ namespace APIs.Controllers
...
@@ -475,7 +501,15 @@ namespace APIs.Controllers
};
};
}
}
var
config
=
await
_channelService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
req
.
deviceId
));
Channel
?
config
=
null
;
if
(!
string
.
IsNullOrEmpty
(
req
.
deviceId
))
{
config
=
await
_channelService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
req
.
deviceId
));
}
else
{
config
=
await
_channelService
.
QueryOne
(
s
=>
s
.
warehouseId
.
Equals
(
req
.
warehouseId
));
}
if
(
config
!=
null
)
if
(
config
!=
null
)
{
{
...
@@ -615,6 +649,13 @@ namespace APIs.Controllers
...
@@ -615,6 +649,13 @@ namespace APIs.Controllers
{
{
try
try
{
{
var
error
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
""
,
};
return
error
;
#
region
合法判断
#
region
合法判断
if
(
req
.
Epc
==
null
||
req
.
Epc
.
Count
()
==
0
)
if
(
req
.
Epc
==
null
||
req
.
Epc
.
Count
()
==
0
)
{
{
...
@@ -653,13 +694,28 @@ namespace APIs.Controllers
...
@@ -653,13 +694,28 @@ namespace APIs.Controllers
};
};
}
}
var
myOrder
=
await
_orderService
.
QueryOne
(
s
=>
s
.
orderState
==
2
);
//单据
//还原非单标签EPC
List
<
string
>
PendingEpc
=
new
List
<
string
>();
foreach
(
var
item
in
req
.
Epc
)
{
var
info
=
EpcConvert
.
EpcAnlysing
(
EpcConvert
.
ToHexByte
(
item
));
if
(
info
.
EType
!=
0
&&
info
.
EType
!=
1
)
//如果不是单标签则还原
{
PendingEpc
.
Add
(
EpcConvert
.
RestoreEpc
(
item
));
}
else
{
PendingEpc
.
Add
(
item
);
}
}
var
myOrder
=
await
_orderService
.
QueryOrder
(
s
=>
s
.
orderState
==
2
);
//单据
var
warehouse
=
await
_warehouseService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
req
.
warehouseId
));
var
warehouse
=
await
_warehouseService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
req
.
warehouseId
));
var
warehouseInvtory
=
await
_inventoryService
.
Query
(
s
=>
!
s
.
bussinessState
.
Equals
(
"destruction"
)
&&
!
s
.
state
.
Equals
(
"2"
)
&&
s
.
locationId
.
Equals
(
req
.
warehouseId
));
//仓库装备
var
warehouseInvtory
=
await
_inventoryService
.
Query
(
s
=>
!
s
.
bussinessState
.
Equals
(
"destruction"
)
&&
!
s
.
state
.
Equals
(
"2"
)
&&
s
.
locationId
.
Equals
(
req
.
warehouseId
));
//仓库装备
myOrder
=
(
myOrder
!=
null
&&
!
myOrder
.
orderType
.
Equals
(
req
.
state
==
0
?
"in"
:
"out"
))
?
null
:
myOrder
;
//如果出入状态与单据不匹配则作为无单据处理
myOrder
=
(
myOrder
!=
null
&&
!
myOrder
.
orderType
.
Equals
(
req
.
state
==
0
?
"in"
:
"out"
))
?
null
:
myOrder
;
//如果出入状态与单据不匹配则作为无单据处理
List
<
string
>
newEquOrderType
=
new
List
<
string
>()
{
"purchase"
,
"allocate"
,
"gift"
};
//入库单据为这些种类则会有新装备
List
<
string
>
newEquOrderType
=
new
List
<
string
>()
{
"purchase"
,
"allocate"
,
"gift"
,
"return"
};
//入库单据为这些种类则会有新装备
List
<
string
>
epcList
=
new
List
<
string
>();
//经过过滤后的EPC
List
<
string
>
epcList
=
new
List
<
string
>();
//经过过滤后的EPC
...
@@ -675,22 +731,23 @@ namespace APIs.Controllers
...
@@ -675,22 +731,23 @@ namespace APIs.Controllers
};
};
}
}
var
removeEpcs
=
req
.
Epc
.
Except
(
warehouseInvtory
.
Select
(
s
=>
s
.
epc
).
ToList
()).
ToList
();
var
removeEpcs
=
Pending
Epc
.
Except
(
warehouseInvtory
.
Select
(
s
=>
s
.
epc
).
ToList
()).
ToList
();
epcList
=
req
.
Epc
.
Where
(
s
=>
!
removeEpcs
.
Contains
(
s
)).
ToList
();
epcList
=
Pending
Epc
.
Where
(
s
=>
!
removeEpcs
.
Contains
(
s
)).
ToList
();
}
}
else
//有新装备单据过滤本仓库物资
else
//有新装备单据过滤本仓库物资
{
{
if
(
warehouseInvtory
==
null
||
warehouseInvtory
.
Count
()
==
0
)
if
(
warehouseInvtory
==
null
||
warehouseInvtory
.
Count
()
==
0
)
{
{
epcList
=
req
.
Epc
;
epcList
=
Pending
Epc
;
}
}
else
else
{
{
var
keepEpcs
=
req
.
Epc
.
Except
(
warehouseInvtory
.
Select
(
s
=>
s
.
epc
).
ToList
()).
ToList
();
var
keepEpcs
=
Pending
Epc
.
Except
(
warehouseInvtory
.
Select
(
s
=>
s
.
epc
).
ToList
()).
ToList
();
epcList
=
req
.
Epc
.
Where
(
s
=>
keepEpcs
.
Contains
(
s
)).
ToList
();
epcList
=
Pending
Epc
.
Where
(
s
=>
keepEpcs
.
Contains
(
s
)).
ToList
();
}
}
}
}
var
deatilDic
=
myOrder
?.
DetailList
.
Where
(
s
=>
s
.
warehouseId
.
Equals
(
req
.
warehouseId
))
var
deatilDic
=
myOrder
?.
DetailList
.
Where
(
s
=>
s
.
warehouseId
.
Equals
(
req
.
warehouseId
))
.
Select
(
s
=>
s
.
equipmentSize
)
.
Select
(
s
=>
s
.
equipmentSize
)
.
ToList
();
//通道所在仓库子单
.
ToList
();
//通道所在仓库子单
...
@@ -707,7 +764,7 @@ namespace APIs.Controllers
...
@@ -707,7 +764,7 @@ namespace APIs.Controllers
var
epc_info
=
EpcConvert
.
EpcAnlysing
(
EpcConvert
.
ToHexByte
(
epc
));
var
epc_info
=
EpcConvert
.
EpcAnlysing
(
EpcConvert
.
ToHexByte
(
epc
));
string
typecode
=
epc_info
.
Wzdm
.
ToString
(
"X"
);
string
typecode
=
epc_info
.
Wzdm
.
ToString
(
"X"
);
string
sizecode
=
epc_info
.
Hxdm
.
ToString
(
"X"
);
string
sizecode
=
epc_info
.
Hxdm
.
ToString
(
"X"
);
string
suppliercode
=
epc_info
.
OrganizationCode
.
ToString
();
string
suppliercode
=
epc_info
.
OrganizationCode
.
ToString
()
.
ToLower
()
;
var
mytype
=
await
_equipmentTypeService
.
QueryOne
(
s
=>
s
.
id
.
Equals
(
typecode
));
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
mysize
=
await
_equipmentSizeService
.
QueryOne
(
s
=>
s
.
typeId
.
Equals
(
typecode
)
&&
s
.
code
.
Equals
(
sizecode
));
...
@@ -737,8 +794,8 @@ namespace APIs.Controllers
...
@@ -737,8 +794,8 @@ namespace APIs.Controllers
equState
=
"normal"
,
equState
=
"normal"
,
locationId
=
req
.
warehouseId
,
locationId
=
req
.
warehouseId
,
locationName
=
warehouse
?.
name
,
locationName
=
warehouse
?.
name
,
maintenancePeriod
=
Convert
.
ToString
(
periodInfo
?.
maintenancePeriod
),
maintenancePeriod
=
Convert
.
ToString
(
Convert
.
ToInt32
(
periodInfo
?.
maintenancePeriod
)
),
warrantyPeriod
=
Convert
.
ToString
(
periodInfo
?.
warrantyPeriod
),
warrantyPeriod
=
Convert
.
ToString
(
Convert
.
ToInt32
(
periodInfo
?.
warrantyPeriod
)
),
supplierId
=
mysupplier
?.
id
??
""
,
supplierId
=
mysupplier
?.
id
??
""
,
orgId
=
Convert
.
ToInt64
(
orgInfo
.
orgId
),
orgId
=
Convert
.
ToInt64
(
orgInfo
.
orgId
),
lostFlag
=
"0"
,
lostFlag
=
"0"
,
...
@@ -879,10 +936,15 @@ namespace APIs.Controllers
...
@@ -879,10 +936,15 @@ namespace APIs.Controllers
};
};
}
else
}
else
{
{
var
json
=
HttpHelper
.
HttpPost
(
AdminGlobalContext
.
jyzbConfig
.
Url
+
"/PolicemanFinger/insertOrUpdateFingerInfo"
,
JsonConvert
.
SerializeObject
(
req
));
var
send
=
new
{
policeId
=
req
.
policeId
,
fingerList
=
req
.
fingerList
.
Select
(
s
=>
new
{
fingerInfo
=
s
.
fingerInfo
,
fingerNum
=
s
.
fingerNum
})
};
var
json
=
HttpHelper
.
HttpPost
(
/*AdminGlobalContext.jyzbConfig.Url*/
"http://192.168.2.14:10030"
+
"/PolicemanFinger/insertOrUpdateFingerInfo"
,
JsonConvert
.
SerializeObject
(
send
));
var
httprs
=
JsonConvert
.
DeserializeObject
<
HttpHelper
.
res
<
string
>>(
json
);
var
httprs
=
JsonConvert
.
DeserializeObject
<
HttpHelper
.
res
<
string
>>(
json
);
if
(
httprs
!=
null
&&
httprs
.
code
==
"9920"
)
if
(
httprs
!=
null
&&
httprs
.
code
==
"9920
0
"
)
{
{
var
rs
=
await
_policeFingerService
.
UpdateFinger
(
req
.
policeId
,
req
.
fingerList
);
var
rs
=
await
_policeFingerService
.
UpdateFinger
(
req
.
policeId
,
req
.
fingerList
);
...
...
WebApiNET6-master/APIs/LogPictures/20240104/d2abb591-81b9-44ff-9d05-b5493fbeb9b1.jpg
0 → 100644
View file @
9fd46a7f
48.2 KB
WebApiNET6-master/APIs/LogPictures/20240104/d89c5c82-a0c3-47a1-8704-a2f477be51dc.jpg
0 → 100644
View file @
9fd46a7f
48.8 KB
WebApiNET6-master/APIs/LogPictures/20240104/d8bb0490-e980-4db9-a3bf-6d7d929ada2a.jpg
0 → 100644
View file @
9fd46a7f
48.2 KB
WebApiNET6-master/APIs/Req/CommonReq.cs
View file @
9fd46a7f
...
@@ -19,8 +19,8 @@ namespace APIs.Req
...
@@ -19,8 +19,8 @@ namespace APIs.Req
public
class
UpdateHKPictureReq
public
class
UpdateHKPictureReq
{
{
public
byte
[]
picture
{
get
;
set
;
}
public
string
policeId
{
get
;
set
;
}
public
string
policeId
{
get
;
set
;
}
public
string
photo
{
get
;
set
;
}
}
}
public
class
GetInventoryOrderReq
public
class
GetInventoryOrderReq
...
@@ -31,6 +31,7 @@ namespace APIs.Req
...
@@ -31,6 +31,7 @@ namespace APIs.Req
public
class
GetWarehouseConfigReq
public
class
GetWarehouseConfigReq
{
{
public
string
deviceId
{
get
;
set
;
}
public
string
deviceId
{
get
;
set
;
}
public
string
warehouseId
{
get
;
set
;
}
}
}
public
class
UpdateFingerReq
public
class
UpdateFingerReq
...
...
WebApiNET6-master/Common/EpcConvert.cs
View file @
9fd46a7f
...
@@ -30,6 +30,8 @@ namespace Common
...
@@ -30,6 +30,8 @@ namespace Common
/*---------以下为2.0版本新增参数,以下参数用于替换生产日期之后的字段,确保真唯一-----------*/
/*---------以下为2.0版本新增参数,以下参数用于替换生产日期之后的字段,确保真唯一-----------*/
public
ulong
TimeSpan
{
get
;
set
;
}
//当前日期时间戳,精确到毫秒
public
ulong
TimeSpan
{
get
;
set
;
}
//当前日期时间戳,精确到毫秒
public
byte
MachineNum
{
get
;
set
;
}
//服务器识别码(4bits),用于区分测试服务器与正式服务器生成的数据,实际1b就够了,其他3b做保留
public
byte
MachineNum
{
get
;
set
;
}
//服务器识别码(4bits),用于区分测试服务器与正式服务器生成的数据,实际1b就够了,其他3b做保留
/*---------以下为警用装备3.0添加参数-----------*/
public
byte
EType
{
get
;
set
;
}
//1单标签 2双标签 3三标签(兼容2.0标签 2.0解析输出0)
}
}
public
static
class
EpcConvert
public
static
class
EpcConvert
...
@@ -128,6 +130,11 @@ namespace Common
...
@@ -128,6 +130,11 @@ namespace Common
SetData
(
ref
buf
,
pos
,
12
,
epc
.
NoInBox
);
SetData
(
ref
buf
,
pos
,
12
,
epc
.
NoInBox
);
pos
+=
12
;
pos
+=
12
;
SetData
(
ref
buf
,
pos
,
4
,
epc
.
MachineNum
);
SetData
(
ref
buf
,
pos
,
4
,
epc
.
MachineNum
);
pos
+=
4
;
/*----------------警用装备3.0字段-------------*/
SetData
(
ref
buf
,
pos
,
4
,
epc
.
EType
);
pos
+=
4
;
// 双字节对齐, 剩余保留区
// 双字节对齐, 剩余保留区
if
(
pos
%
16
!=
0
)
if
(
pos
%
16
!=
0
)
...
@@ -260,6 +267,8 @@ namespace Common
...
@@ -260,6 +267,8 @@ namespace Common
pos
+=
12
;
pos
+=
12
;
rtn
.
MachineNum
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
rtn
.
MachineNum
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
pos
+=
4
;
pos
+=
4
;
rtn
.
EType
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
pos
+=
4
;
}
}
else
else
{
{
...
@@ -286,6 +295,122 @@ namespace Common
...
@@ -286,6 +295,122 @@ namespace Common
return
rtn
;
return
rtn
;
}
}
//非单标签还原(jyzb3.0)
public
static
string
RestoreEpc
(
string
info
)
{
var
epc
=
ToHexByte
(
info
);
var
crc_chk
=
Crc16
(
epc
,
epc
.
Length
-
2
);
var
crc_src
=
epc
[
epc
.
Length
-
2
]
<<
8
|
epc
[
epc
.
Length
-
1
];
if
(
crc_src
!=
crc_chk
)
{
throw
new
Exception
(
"CRC校验失败"
);
}
// 数据解析
Analyzingepc
rtn
=
new
Analyzingepc
();
int
pos
=
0
;
rtn
.
Header
=
(
byte
)
GetData
(
epc
,
pos
,
8
);
pos
+=
8
;
rtn
.
IssuerId
=
(
byte
)
GetData
(
epc
,
pos
,
6
);
pos
+=
6
;
var
oc
=
GetData
(
epc
,
pos
,
54
);
rtn
.
OrganizationCode
=
OrganizationCodeToStr
(
oc
);
pos
+=
54
;
rtn
.
WzdmLen
=
(
byte
)(
GetData
(
epc
,
pos
,
4
));
pos
+=
4
;
var
wzlen
=
((
rtn
.
WzdmLen
-
1
)
%
8
)
*
8
;
rtn
.
Wzdm
=
GetData
(
epc
,
pos
,
wzlen
);
pos
+=
wzlen
;
rtn
.
Hxdm
=
GetData
(
epc
,
pos
,
8
);
pos
+=
8
;
rtn
.
SerialLen
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
pos
+=
4
;
rtn
.
Ver
=
(
byte
)
GetData
(
epc
,
pos
,
8
);
pos
+=
8
;
rtn
.
ProductionDate
=
(
UInt32
)
GetData
(
epc
,
pos
,
24
);
pos
+=
24
;
rtn
.
ExpiryDate
=
(
byte
)
GetData
(
epc
,
pos
,
6
);
pos
+=
6
;
rtn
.
ExpiryDateUnit
=
(
byte
)
GetData
(
epc
,
pos
,
2
);
pos
+=
2
;
rtn
.
TimeSpan
=
(
ulong
)
GetData
(
epc
,
pos
,
48
);
pos
+=
48
;
rtn
.
NoInBox
=
(
UInt16
)
GetData
(
epc
,
pos
,
12
);
pos
+=
12
;
rtn
.
MachineNum
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
pos
+=
4
;
rtn
.
EType
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
pos
+=
4
;
rtn
.
EType
=
1
;
string
baseEpc
=
Hex16ByteToHex16String
(
EpcConvert
.
Epc2Gen
(
rtn
)).
Replace
(
" "
,
""
);
return
baseEpc
;
}
//补充生成多标签(jyzb3.0)
public
static
List
<
string
>
SupplementEpc
(
string
info
,
int
etype
)
{
var
epc
=
ToHexByte
(
info
);
var
crc_chk
=
Crc16
(
epc
,
epc
.
Length
-
2
);
var
crc_src
=
epc
[
epc
.
Length
-
2
]
<<
8
|
epc
[
epc
.
Length
-
1
];
if
(
crc_src
!=
crc_chk
)
{
throw
new
Exception
(
"CRC校验失败"
);
}
// 数据解析
Analyzingepc
rtn
=
new
Analyzingepc
();
int
pos
=
0
;
rtn
.
Header
=
(
byte
)
GetData
(
epc
,
pos
,
8
);
pos
+=
8
;
rtn
.
IssuerId
=
(
byte
)
GetData
(
epc
,
pos
,
6
);
pos
+=
6
;
var
oc
=
GetData
(
epc
,
pos
,
54
);
rtn
.
OrganizationCode
=
OrganizationCodeToStr
(
oc
);
pos
+=
54
;
rtn
.
WzdmLen
=
(
byte
)(
GetData
(
epc
,
pos
,
4
));
pos
+=
4
;
var
wzlen
=
((
rtn
.
WzdmLen
-
1
)
%
8
)
*
8
;
rtn
.
Wzdm
=
GetData
(
epc
,
pos
,
wzlen
);
pos
+=
wzlen
;
rtn
.
Hxdm
=
GetData
(
epc
,
pos
,
8
);
pos
+=
8
;
rtn
.
SerialLen
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
pos
+=
4
;
rtn
.
Ver
=
(
byte
)
GetData
(
epc
,
pos
,
8
);
pos
+=
8
;
rtn
.
ProductionDate
=
(
UInt32
)
GetData
(
epc
,
pos
,
24
);
pos
+=
24
;
rtn
.
ExpiryDate
=
(
byte
)
GetData
(
epc
,
pos
,
6
);
pos
+=
6
;
rtn
.
ExpiryDateUnit
=
(
byte
)
GetData
(
epc
,
pos
,
2
);
pos
+=
2
;
rtn
.
TimeSpan
=
(
ulong
)
GetData
(
epc
,
pos
,
48
);
pos
+=
48
;
rtn
.
NoInBox
=
(
UInt16
)
GetData
(
epc
,
pos
,
12
);
pos
+=
12
;
rtn
.
MachineNum
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
pos
+=
4
;
rtn
.
EType
=
(
byte
)
GetData
(
epc
,
pos
,
4
);
pos
+=
4
;
List
<
string
>
epcList
=
new
List
<
string
>();
for
(
int
i
=
2
;
i
<=
etype
;
i
++)
{
rtn
.
EType
=
Convert
.
ToByte
(
i
);
epcList
.
Add
(
Hex16ByteToHex16String
(
EpcConvert
.
Epc2Gen
(
rtn
)).
Replace
(
" "
,
""
));
}
return
epcList
;
}
/// <summary>
/// <summary>
/// 向目标数组指定位置插入数据
/// 向目标数组指定位置插入数据
/// </summary>
/// </summary>
...
...
WebApiNET6-master/Models/Table/EquipmentSize.cs
View file @
9fd46a7f
...
@@ -13,7 +13,7 @@ namespace Models.Table
...
@@ -13,7 +13,7 @@ namespace Models.Table
[
SugarTable
(
"base_equipment_size"
)]
[
SugarTable
(
"base_equipment_size"
)]
public
class
EquipmentSize
:
BaseTable
public
class
EquipmentSize
:
BaseTable
{
{
[
SugarColumn
(
Is
Identity
=
true
,
Is
PrimaryKey
=
true
)]
[
SugarColumn
(
IsPrimaryKey
=
true
)]
public
string
id
{
get
;
set
;
}
public
string
id
{
get
;
set
;
}
...
...
WebApiNET6-master/Models/Table/EquipmentType.cs
View file @
9fd46a7f
...
@@ -12,7 +12,7 @@ namespace Models.SqlModel
...
@@ -12,7 +12,7 @@ namespace Models.SqlModel
[
SugarTable
(
"base_equipment_type"
)]
[
SugarTable
(
"base_equipment_type"
)]
public
class
EquipmentType
:
BaseTable
public
class
EquipmentType
:
BaseTable
{
{
[
SugarColumn
(
Is
Identity
=
true
,
Is
PrimaryKey
=
true
)]
[
SugarColumn
(
IsPrimaryKey
=
true
)]
public
string
id
{
get
;
set
;
}
public
string
id
{
get
;
set
;
}
public
string
name
{
get
;
set
;
}
public
string
name
{
get
;
set
;
}
...
...
WebApiNET6-master/Models/Table/Inventory.cs
View file @
9fd46a7f
...
@@ -13,7 +13,7 @@ namespace Models.Table
...
@@ -13,7 +13,7 @@ namespace Models.Table
[
SugarTable
(
"base_inventory"
)]
[
SugarTable
(
"base_inventory"
)]
public
class
Inventory
:
BaseTable
public
class
Inventory
:
BaseTable
{
{
[
SugarColumn
(
Is
Identity
=
true
,
Is
PrimaryKey
=
true
)]
[
SugarColumn
(
IsPrimaryKey
=
true
)]
public
string
id
{
get
;
set
;
}
public
string
id
{
get
;
set
;
}
[
SugarColumn
(
ColumnName
=
"type_id"
)]
[
SugarColumn
(
ColumnName
=
"type_id"
)]
...
...
WebApiNET6-master/Models/Table/PoliceFinger.cs
View file @
9fd46a7f
...
@@ -13,7 +13,7 @@ namespace Models.Table
...
@@ -13,7 +13,7 @@ namespace Models.Table
/// <summary>
/// <summary>
/// 指纹id
/// 指纹id
///</summary>
///</summary>
[
SugarColumn
(
ColumnName
=
"id"
,
IsPrimaryKey
=
true
,
IsIdentity
=
true
)]
[
SugarColumn
(
IsPrimaryKey
=
true
,
IsIdentity
=
true
)]
public
int
id
{
get
;
set
;
}
public
int
id
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 警员id
/// 警员id
...
...
WebApiNET6-master/Repositories/Repository/Bussiness/PoliceFingerRepository.cs
View file @
9fd46a7f
...
@@ -33,12 +33,35 @@ namespace Repositories.Repository.Bussiness
...
@@ -33,12 +33,35 @@ namespace Repositories.Repository.Bussiness
});
});
//新增或更新
//新增或更新
var
x
=
context
.
Storageable
(
fingers
).
ToStorage
();
//var x = context.Storageable(fingers).WhereColumns(s => new { s.policeId, s.fingerNum }).ToStorage();
x
.
AsInsertable
.
ExecuteCommand
();
//x.AsInsertable.IgnoreColumns(s => s.id).ExecuteCommand();
x
.
AsUpdateable
.
WhereColumns
(
s
=>
new
{
s
.
id
,
s
.
fingerNum
})
//查询字段
//x.AsUpdateable.WhereColumns(s => new { s.policeId, s.fingerNum })//查询字段
.
UpdateColumns
(
s
=>
new
{
s
.
fingerInfo
,
s
.
updateTime
})
//更新字段
// .UpdateColumns(s => new { s.fingerInfo, s.updateTime })//更新字段
.
IgnoreColumns
(
s
=>
new
{
s
.
policeId
,
s
.
fingerNum
,
s
.
createTime
})
//不更新字段
// //.IgnoreColumns(s => new { s.policeId, s.fingerNum, s.createTime })//不更新字段
.
ExecuteCommand
();
// .ExecuteCommand();
var
fingerinfo
=
context
.
Queryable
<
PoliceFinger
>().
Where
(
s
=>
s
.
policeId
.
Equals
(
policeId
)).
ToList
();
var
updateDic
=
fingerinfo
.
Select
(
s
=>
s
.
fingerNum
).
ToList
();
var
updateList
=
new
List
<
PoliceFinger
>();
var
insertList
=
new
List
<
PoliceFinger
>();
fingers
.
ForEach
(
s
=>
{
if
(
updateDic
.
Contains
(
s
.
fingerNum
))
{
updateList
.
Add
(
s
);
}
else
{
insertList
.
Add
(
s
);
}
});
if
(
insertList
.
Any
())
context
.
Insertable
(
insertList
).
ExecuteCommand
();
if
(
updateList
.
Any
())
context
.
Updateable
(
updateList
)
.
WhereColumns
(
it
=>
new
{
it
.
policeId
,
it
.
fingerNum
})
.
UpdateColumns
(
it
=>
new
{
it
.
fingerInfo
,
it
.
updateTime
})
.
ExecuteCommand
();
return
true
;
return
true
;
}
}
...
...
WebApiNET6-master/Services/Interface/IOrderService.cs
View file @
9fd46a7f
...
@@ -3,6 +3,7 @@ using Models.Table;
...
@@ -3,6 +3,7 @@ using Models.Table;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
...
@@ -11,5 +12,6 @@ namespace Services.Interface
...
@@ -11,5 +12,6 @@ namespace Services.Interface
public
interface
IOrderService
:
IBaseServices
<
OrderMain
>
public
interface
IOrderService
:
IBaseServices
<
OrderMain
>
{
{
Task
<
object
>
QueryHandOrder
(
string
warehouseId
);
Task
<
object
>
QueryHandOrder
(
string
warehouseId
);
Task
<
OrderMain
?>
QueryOrder
(
Expression
<
Func
<
OrderMain
,
bool
>>
exp
);
}
}
}
}
WebApiNET6-master/Services/OrderService.cs
View file @
9fd46a7f
...
@@ -6,6 +6,7 @@ using Services.Interface;
...
@@ -6,6 +6,7 @@ using Services.Interface;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
...
@@ -29,5 +30,12 @@ namespace Services
...
@@ -29,5 +30,12 @@ namespace Services
{
{
return
_orderMainRepository
.
QueryHandOrder
(
warehouseId
);
return
_orderMainRepository
.
QueryHandOrder
(
warehouseId
);
}
}
public
async
Task
<
OrderMain
?>
QueryOrder
(
Expression
<
Func
<
OrderMain
,
bool
>>
exp
)
{
var
main
=
await
_orderMainRepository
.
QueryOne
(
exp
);
if
(
main
!=
null
)
main
.
DetailList
=
await
_orderDetailRepository
.
Query
(
s
=>
s
.
orderId
.
Equals
(
main
.
id
));
return
main
;
}
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论