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
fc40bd0a
Commit
fc40bd0a
authored
Nov 27, 2023
by
Seniorious
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f3ff8f67
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
95 行增加
和
3 行删除
+95
-3
APIs.exe - 快捷方式.lnk
WebApiNET6-master/APIs.exe - 快捷方式.lnk
+0
-0
BaseInfoController.cs
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
+80
-3
PictureReq.cs
WebApiNET6-master/APIs/Req/PictureReq.cs
+5
-0
LogSummaryRepository.cs
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
+10
-0
没有找到文件。
WebApiNET6-master/APIs.exe - 快捷方式.lnk
0 → 100644
View file @
fc40bd0a
File added
WebApiNET6-master/APIs/Controllers/BaseInfoController.cs
View file @
fc40bd0a
...
...
@@ -7,6 +7,7 @@ using Common.Utility.Model;
using
Common.Utility.RabbitMQ
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc.ModelBinding
;
using
Microsoft.CodeAnalysis
;
using
Microsoft.IdentityModel.Tokens
;
using
Models.SqlModel
;
using
Models.Table
;
...
...
@@ -15,12 +16,14 @@ using Newtonsoft.Json;
using
Services
;
using
Services.Interface
;
using
SqlSugar
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.Linq.Expressions
;
using
System.Security.Cryptography.Xml
;
using
static
Microsoft
.
AspNetCore
.
Razor
.
Language
.
TagHelperMetadata
;
using
static
System
.
Net
.
Mime
.
MediaTypeNames
;
namespace
APIs.Controllers
{
...
...
@@ -53,6 +56,80 @@ namespace APIs.Controllers
}
/// <summary>
/// 3.0平台获取图片
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[
HttpGet
]
public
IActionResult
DownloadLogPicture
(
string
id
)
{
try
{
// 读取文件内容
byte
[]
fileBytes
=
System
.
IO
.
File
.
ReadAllBytes
(
$"LogPictures\\
{
id
}
.jpg"
);
// 获取文件的MIME类型
string
contentType
=
"application/octet-stream"
;
// 默认使用二进制流的MIME类型,如果需要根据具体文件类型动态获取,请进行适当的处理。
// 返回文件结果
return
File
(
fileBytes
,
contentType
,
$"
{
id
}
.jpg"
);
}
catch
(
Exception
ex
)
{
return
new
ContentResult
{
Content
=
"ERROR:"
+
ex
,
ContentType
=
"text/plain"
,
StatusCode
=
400
};
}
}
/// <summary>
/// 获取出入库照片
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
async
Task
<
ApiResult
>
GetLogPicture
([
FromBody
]
GetLogPictureReq
req
)
{
try
{
//读取图片
string
imageBytes
=
""
;
string
url
=
$"LogPictures\\
{
req
.
logId
}
.jpg"
;
using
(
FileStream
fileStream
=
new
FileStream
(
url
,
FileMode
.
Open
))
{
using
(
BinaryReader
reader
=
new
BinaryReader
(
fileStream
))
{
imageBytes
=
Convert
.
ToBase64String
(
reader
.
ReadBytes
((
int
)
fileStream
.
Length
));
}
}
var
res
=
new
DownloadPicRes
()
{
picture
=
imageBytes
};
var
src
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_SUCCESS
.
Code
,
msg
=
ResultCode
.
OPERATE_SUCCESS
.
Msg
,
data
=
res
};
return
src
;
}
catch
(
Exception
ex
)
{
var
error
=
new
ApiResult
{
code
=
ResultCode
.
OPERATE_FAILED
.
Code
,
msg
=
ex
.
Message
,
};
return
error
;
}
}
/// <summary>
/// 获取账号
/// </summary>
/// <param name=""></param>
...
...
@@ -175,7 +252,7 @@ namespace APIs.Controllers
{
try
{
Expression
<
Func
<
Inventory
,
bool
>>
expression
=
s
=>
/*!s.lostFlag.Equals("1") &&*/
!
s
.
bussinessState
.
Equals
(
"destruction"
);
Expression
<
Func
<
Inventory
,
bool
>>
expression
=
s
=>
s
.
locationType
!=
"1"
&&
!
s
.
bussinessState
.
Equals
(
"destruction"
);
var
invlist
=
await
_inventoryService
.
Query
(
expression
);
if
(
invlist
==
null
)
...
...
@@ -240,7 +317,7 @@ namespace APIs.Controllers
/// <param name=""></param>
/// <returns></returns>
[
HttpPost
]
public
async
Task
<
ApiResult
>
DeletePictureById
([
From
Body
]
DelPicReq
req
)
public
async
Task
<
ApiResult
>
DeletePictureById
([
From
Form
]
DelPicReq
req
)
{
try
{
...
...
@@ -401,7 +478,7 @@ namespace APIs.Controllers
Directory
.
CreateDirectory
(
path
);
var
filePath
=
Path
.
Combine
(
path
,
fileName
);
Image
.
FromStream
(
ms
).
Save
(
filePath
);
System
.
Drawing
.
Image
.
FromStream
(
ms
).
Save
(
filePath
);
//更新警员照片地址
police
.
picUrl
=
filePath
;
...
...
WebApiNET6-master/APIs/Req/PictureReq.cs
View file @
fc40bd0a
...
...
@@ -21,4 +21,9 @@
public
string
picture
{
get
;
set
;
}
}
public
class
GetLogPictureReq
{
public
string
logId
{
get
;
set
;}
}
}
WebApiNET6-master/Repositories/Repository/Bussiness/LogSummaryRepository.cs
View file @
fc40bd0a
...
...
@@ -54,11 +54,21 @@ namespace Repositories.Repository.Bussiness
//var invs = await context.Queryable<Inventory>().Where(x =>
//model.DetailList.Select(x => x.epc).Contains(x.epc)).ToListAsync();
var
cabinetInv
=
inv
.
Where
(
s
=>
s
.
state
==
"0"
).
ToList
();
for
(
int
i
=
0
;
i
<
cabinetInv
.
Count
();
i
++)
{
cabinetInv
[
i
].
locationType
=
"1"
;
}
context
.
BeginTran
();
context
.
Updateable
(
cars
).
WhereColumns
(
it
=>
new
{
it
.
id
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommand
();
//实体有多少列更新多少列
var
result
=
context
.
Updateable
(
inv
).
WhereColumns
(
it
=>
new
{
it
.
epc
}).
UpdateColumns
(
it
=>
new
{
it
.
state
,
it
.
updateTime
}).
ExecuteCommand
();
//实体有多少列更新多少列
var
result1
=
context
.
Updateable
(
cabinetInv
).
WhereColumns
(
it
=>
new
{
it
.
epc
}).
UpdateColumns
(
it
=>
new
{
it
.
locationType
}).
ExecuteCommand
();
var
logSum
=
context
.
InsertNav
(
model
)
.
Include
(
z1
=>
z1
.
DetailList
)
.
ExecuteCommand
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论