Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
94f8c79b
提交
94f8c79b
authored
7月 21, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改代码
上级
9615c74d
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
28 行增加
和
14 行删除
+28
-14
AllotBackBill.java
...om/tykj/dev/device/allot/subject/domin/AllotBackBill.java
+4
-0
RepairBackBill.java
.../tykj/dev/device/repair/subject/domin/RepairBackBill.java
+4
-0
RepairBill.java
.../com/tykj/dev/device/repair/subject/domin/RepairBill.java
+4
-0
ZxingController.java
...com/tykj/dev/device/zxing/controller/ZxingController.java
+16
-14
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/subject/domin/AllotBackBill.java
浏览文件 @
94f8c79b
...
...
@@ -214,4 +214,8 @@ public class AllotBackBill {
@ApiModelProperty
(
value
=
"装备集合"
)
@Transient
private
List
<
DeviceLibrary
>
deviceLibraries
;
@ApiModelProperty
(
"任务id"
)
@Transient
private
Integer
taskId
;
}
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/domin/RepairBackBill.java
浏览文件 @
94f8c79b
...
...
@@ -258,4 +258,8 @@ public class RepairBackBill {
@Transient
private
List
<
FileRet
>
receiveFileList
=
new
ArrayList
<>();
@ApiModelProperty
(
"任务id"
)
@Transient
private
Integer
taskId
;
}
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/domin/RepairBill.java
浏览文件 @
94f8c79b
...
...
@@ -127,4 +127,8 @@ public class RepairBill {
@ApiModelProperty
(
value
=
"区块链记录id"
)
private
String
recordId
;
@ApiModelProperty
(
"任务id"
)
@Transient
private
Integer
taskId
;
}
dev-zxing/src/main/java/com/tykj/dev/device/zxing/controller/ZxingController.java
浏览文件 @
94f8c79b
...
...
@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.UUID
;
...
...
@@ -29,25 +31,25 @@ public class ZxingController {
@Autowired
private
ZXingUtil
zXingUtil
;
// @Value("${filePath}")
// private String filePath;
// @PostMapping("/decode")
// public ZxingTaskVo decode(@RequestBody ZxingFile file) throws NotFoundException, IOException {
// ZxingTaskVo taskVo = zXingUtil.decode(file.getFilePath());
// return taskVo;
// }
@PostMapping
(
"/decode"
)
public
ZxingTaskVo
decode1
(
@RequestBody
ZxingFile
file
)
throws
NotFoundException
,
IOException
{
String
stt
=
ResourceUtils
.
getURL
(
"classpath:"
).
getPath
()
+
UUID
.
randomUUID
()
+
".png"
;
//生成临时文件
String
stt
=
ResourceUtils
.
getURL
(
"classpath:"
).
getPath
()
+
UUID
.
randomUUID
()
+
".png"
;
String
path
=
file
.
getFilePath
();
List
<
byte
[]>
bytes
=
PdfToImageUtil
.
pdfToImage
(
Base64Util
.
getFileBytes
(
path
));
Base64Util
.
byte2image
(
bytes
.
get
(
0
),
stt
);
String
base64
=
Base64Util
.
getImageStr
(
stt
);
File
file1
=
new
File
(
path
);
//判断文件的类型
String
name
=
file1
.
getName
();
String
substring
=
name
.
substring
(
name
.
lastIndexOf
(
"."
+
1
));
if
(
substring
.
equals
(
"pdf"
))
{
List
<
byte
[]>
bytes
=
PdfToImageUtil
.
pdfToImage
(
Base64Util
.
getFileBytes
(
path
));
Base64Util
.
byte2image
(
bytes
.
get
(
0
),
stt
);
}
String
base64
=
Base64Util
.
getImageStr
(
stt
);
QRCodeUtils
qrCodeUtils
=
new
QRCodeUtils
();
ZxingTaskVo
zxingTaskVo
=
qrCodeUtils
.
deEncodeByBase64
(
base64
);
return
zxingTaskVo
;
return
qrCodeUtils
.
deEncodeByBase64
(
base64
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论