Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
OA-Integration
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李炎
OA-Integration
Commits
8c92f055
提交
8c92f055
authored
10月 15, 2021
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
改日志
上级
1f7db0f3
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
35 行增加
和
155 行删除
+35
-155
HlsUtil.java
...rc/main/java/org/jeecg/modules/iost/API/Util/HlsUtil.java
+0
-148
OAUtil.java
...src/main/java/org/jeecg/modules/iost/API/Util/OAUtil.java
+24
-0
BusinessTripDetailsServiceImpl.java
...iost/API/service/impl/BusinessTripDetailsServiceImpl.java
+3
-2
LoanDiscardDetailsServiceImpl.java
.../iost/API/service/impl/LoanDiscardDetailsServiceImpl.java
+3
-2
OtherReimbursementDetailsServiceImpl.java
...PI/service/impl/OtherReimbursementDetailsServiceImpl.java
+3
-2
OaUpdateJournalServiceImpl.java
...PI/service/oajournal/impl/OaUpdateJournalServiceImpl.java
+2
-1
没有找到文件。
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/Util/HlsUtil.java
deleted
100644 → 0
浏览文件 @
1f7db0f3
package
org
.
jeecg
.
modules
.
iost
.
API
.
Util
;
import
java.io.*
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
public
class
HlsUtil
{
private
String
uuid
;
private
String
originUrlpath
;
private
String
preUrlPath
;
private
String
rootPath
;
private
String
fileName
;
private
String
folderPath
;
private
int
threadQuantity
=
10
;
public
HlsUtil
(
String
originUrlpath
,
String
preUrlPath
,
String
rootPath
){
this
.
uuid
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
this
.
originUrlpath
=
originUrlpath
;
this
.
preUrlPath
=
preUrlPath
;
this
.
rootPath
=
rootPath
;
this
.
fileName
=
uuid
+
".mp4"
;
this
.
folderPath
=
rootPath
+
File
.
separator
+
uuid
;
File
file
=
new
File
(
folderPath
);
if
(!
file
.
exists
())
file
.
mkdirs
();
}
public
static
void
main
(
String
[]
args
)
{
String
originUrlpath
=
"http://localhost:8090/jintai/as/GetFile.m3u8"
;
// String originUrlpath ="http://127.0.0.1:8848/dsa/EZUIKit-JavaScript/adca19a95053481a836f23da28d3f55d-8498.m3u8";
System
.
out
.
println
(
originUrlpath
);
String
preUrlPath
=
originUrlpath
.
substring
(
0
,
originUrlpath
.
lastIndexOf
(
"/"
)+
1
);
System
.
out
.
println
(
preUrlPath
);
String
rootPath
=
"E:\\Eip"
;
System
.
out
.
println
(
rootPath
);
String
fileName
=
""
;
HlsUtil
downLoader
=
new
HlsUtil
(
originUrlpath
,
preUrlPath
,
rootPath
);
// downLoader.setThreadQuantity(10);
try
{
fileName
=
downLoader
.
download
(
true
);
}
catch
(
Exception
e
)
{
}
if
(
fileName
.
isEmpty
()){
System
.
out
.
println
(
"下载失败"
);
}
else
{
System
.
err
.
println
(
"下载成功"
);
}
}
public
String
download
(
boolean
isAsync
)
throws
Exception
{
String
indexStr
=
getIndexFile
();
System
.
out
.
println
(
indexStr
);
List
urlList
=
analysisIndex
(
indexStr
);
System
.
out
.
println
(
urlList
);
HashMap
<
Integer
,
String
>
keyFileMap
=
new
HashMap
<>();
// if(!isAsync){
// downLoadIndexFileAsync(urlList, keyFileMap);
//
// while (keyFileMap.size()<urlList.size()){
// //System.out.println("当前下载数量"+keyFileMap.size());
// Thread.sleep(3000);
// }
// }else{
keyFileMap
=
downLoadIndexFile
(
urlList
);
// }
// System.out.println(keyFileMap);
// return composeFile(keyFileMap);
return
""
;
}
public
String
getIndexFile
()
throws
Exception
{
URL
url
=
new
URL
(
originUrlpath
);
//下载资源
BufferedReader
in
=
new
BufferedReader
(
new
InputStreamReader
(
url
.
openStream
(),
"UTF-8"
));
String
content
=
""
;
String
line
;
while
((
line
=
in
.
readLine
())
!=
null
)
{
content
+=
line
+
"\n"
;
}
in
.
close
();
return
content
;
}
/* 解析索引文件 */
public
List
analysisIndex
(
String
content
)
throws
Exception
{
Pattern
pattern
=
Pattern
.
compile
(
".*ts"
);
Matcher
ma
=
pattern
.
matcher
(
content
);
List
<
String
>
list
=
new
ArrayList
<
String
>();
while
(
ma
.
find
()){
list
.
add
(
ma
.
group
());
}
return
list
;
}
/* 下载视频片段 */
public
HashMap
downLoadIndexFile
(
List
<
String
>
urlList
)
throws
IOException
{
HashMap
<
Integer
,
String
>
keyFileMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
urlList
.
size
();
i
++){
String
subUrlPath
=
urlList
.
get
(
i
);
String
fileOutPath
=
folderPath
+
File
.
separator
+
i
+
".ts"
;
System
.
out
.
println
(
"subUrlPath"
+
subUrlPath
);
System
.
out
.
println
(
"fileOutPath"
+
fileOutPath
);
keyFileMap
.
put
(
i
,
fileOutPath
);
try
{
downloadNet
(
subUrlPath
,
fileOutPath
);
System
.
out
.
println
(
"成功:"
+
(
i
+
1
)
+
"/"
+
urlList
.
size
());
}
catch
(
Exception
e
){
System
.
err
.
println
(
"失败:"
+
(
i
+
1
)
+
"/"
+
urlList
.
size
());
}
}
return
keyFileMap
;
}
private
void
downloadNet
(
String
fullUrlPath
,
String
fileOutPath
)
throws
Exception
{
// 下载网络文件
int
byteread
=
0
;
URL
url
=
new
URL
(
fullUrlPath
);
URLConnection
conn
=
url
.
openConnection
();
InputStream
inStream
=
conn
.
getInputStream
();
FileOutputStream
fs
=
new
FileOutputStream
(
fileOutPath
);
byte
[]
buffer
=
new
byte
[
1204
];
while
((
byteread
=
inStream
.
read
(
buffer
))
!=
-
1
)
{
//bytesum += byteread;
fs
.
write
(
buffer
,
0
,
byteread
);
}
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/Util/OAUtil.java
0 → 100644
浏览文件 @
8c92f055
package
org
.
jeecg
.
modules
.
iost
.
API
.
Util
;
import
java.util.Map
;
public
class
OAUtil
{
public
static
String
MapToString
(
Map
<
String
,
Object
>
params
)
{
String
apiUrl
=
""
;
if
(
null
!=
params
&&
params
.
size
()
>
0
)
{
StringBuffer
param
=
new
StringBuffer
();
int
i
=
0
;
for
(
String
key
:
params
.
keySet
())
{
if
(
i
==
0
)
param
.
append
(
"?"
);
else
param
.
append
(
"&"
);
param
.
append
(
key
).
append
(
"="
).
append
(
params
.
get
(
key
));
i
++;
}
apiUrl
+=
param
;
}
return
apiUrl
;
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/BusinessTripDetailsServiceImpl.java
浏览文件 @
8c92f055
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.jeecg.modules.iost.API.ExternalInterface.BusinessTripInterfaceApi
;
import
org.jeecg.modules.iost.API.Util.OAUtil
;
import
org.jeecg.modules.iost.API.entity.BusinessTripDetails
;
import
org.jeecg.modules.iost.API.entity.LQKJ_t_IMSSyncDetails
;
import
org.jeecg.modules.iost.API.mapper.BusinessTripDetailsMapper
;
...
...
@@ -70,7 +71,7 @@ public class BusinessTripDetailsServiceImpl extends ServiceImpl<BusinessTripDeta
}};
String
select
=
businessTripInterfaceApi
.
update
(
params
);
System
.
out
.
println
(
"废弃OA返回"
+
select
);
oaUpdateJournalService
.
setOaUpdateJournal
(
key
,
select
,
7
);
oaUpdateJournalService
.
setOaUpdateJournal
(
OAUtil
.
MapToString
(
params
)
,
select
,
7
);
continue
;
}
if
(
list
.
get
(
"FDocumentStatus"
).
toString
().
equals
(
"C"
))
{
//判断付款状态 -已付款
...
...
@@ -81,7 +82,7 @@ public class BusinessTripDetailsServiceImpl extends ServiceImpl<BusinessTripDeta
}};
String
select
=
businessTripInterfaceApi
.
update
(
params
);
System
.
out
.
println
(
"付款OA返回"
+
select
);
oaUpdateJournalService
.
setOaUpdateJournal
(
key
,
select
,
8
);
oaUpdateJournalService
.
setOaUpdateJournal
(
OAUtil
.
MapToString
(
params
)
,
select
,
8
);
}
}
String
kingdeeRequest
=
key
;
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/LoanDiscardDetailsServiceImpl.java
浏览文件 @
8c92f055
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.jeecg.modules.iost.API.ExternalInterface.LoanInterfaceApi
;
import
org.jeecg.modules.iost.API.Util.JsonUtil
;
import
org.jeecg.modules.iost.API.Util.OAUtil
;
import
org.jeecg.modules.iost.API.entity.LQKJ_t_IMSSyncDetails
;
import
org.jeecg.modules.iost.API.entity.LoanDiscardDetails
;
import
org.jeecg.modules.iost.API.mapper.LoanDiscardDetailsMapper
;
...
...
@@ -70,7 +71,7 @@ public class LoanDiscardDetailsServiceImpl extends ServiceImpl<LoanDiscardDetail
put
(
"status"
,
"废弃"
);
}};
String
select
=
loanInterfaceApi
.
update
(
params
);
oaUpdateJournalService
.
setOaUpdateJournal
(
key
,
select
,
3
);
oaUpdateJournalService
.
setOaUpdateJournal
(
OAUtil
.
MapToString
(
params
)
,
select
,
3
);
continue
;
}
if
(
list
.
get
(
"FDocumentStatus"
).
toString
().
equals
(
"C"
))
{
//判断付款状态 -已付款
...
...
@@ -80,7 +81,7 @@ public class LoanDiscardDetailsServiceImpl extends ServiceImpl<LoanDiscardDetail
put
(
"status"
,
"已付款"
);
}};
String
select
=
loanInterfaceApi
.
update
(
params
);
oaUpdateJournalService
.
setOaUpdateJournal
(
key
,
select
,
4
);
oaUpdateJournalService
.
setOaUpdateJournal
(
OAUtil
.
MapToString
(
params
)
,
select
,
4
);
}
}
String
kingdeeRequest
=
key
;
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/OtherReimbursementDetailsServiceImpl.java
浏览文件 @
8c92f055
...
...
@@ -3,6 +3,7 @@ package org.jeecg.modules.iost.API.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.jeecg.modules.iost.API.ExternalInterface.OtherReimbursementInterfaceApi
;
import
org.jeecg.modules.iost.API.Util.OAUtil
;
import
org.jeecg.modules.iost.API.entity.OtherReimbursementDetails
;
import
org.jeecg.modules.iost.API.entity.LQKJ_t_IMSSyncDetails
;
import
org.jeecg.modules.iost.API.mapper.OtherReimbursementDetailsMapper
;
...
...
@@ -66,7 +67,7 @@ public class OtherReimbursementDetailsServiceImpl extends ServiceImpl<OtherReimb
put
(
"status"
,
"废弃"
);
}};
String
select
=
otherReimbursementInterfaceApi
.
update
(
params
);
oaUpdateJournalService
.
setOaUpdateJournal
(
key
,
select
,
11
);
oaUpdateJournalService
.
setOaUpdateJournal
(
OAUtil
.
MapToString
(
params
)
,
select
,
11
);
continue
;
}
if
(
list
.
get
(
"FDocumentStatus"
).
toString
().
equals
(
"C"
))
{
//判断付款状态 -已付款
...
...
@@ -76,7 +77,7 @@ public class OtherReimbursementDetailsServiceImpl extends ServiceImpl<OtherReimb
put
(
"status"
,
"已付款"
);
}};
String
select
=
otherReimbursementInterfaceApi
.
update
(
params
);
oaUpdateJournalService
.
setOaUpdateJournal
(
key
,
select
,
12
);
oaUpdateJournalService
.
setOaUpdateJournal
(
OAUtil
.
MapToString
(
params
)
,
select
,
12
);
}
}
String
kingdeeRequest
=
key
;
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/oajournal/impl/OaUpdateJournalServiceImpl.java
浏览文件 @
8c92f055
...
...
@@ -32,7 +32,8 @@ public class OaUpdateJournalServiceImpl extends ServiceImpl<OaUpdateJournalMappe
listOaRequest
=
JSONObject
.
parseObject
(
responsejson
,
OaRequest
.
class
);
oaUpdateJournal
.
setCode
(
listOaRequest
.
getCode
());
oaUpdateJournal
.
setMessage
(
listOaRequest
.
getMessage
());
oaUpdateJournal
.
setResult
(
listOaRequest
.
getResult
());
// oaUpdateJournal.setResult(listOaRequest.getResult());
oaUpdateJournal
.
setResult
(
responsejson
);
oaUpdateJournal
.
setSynchronization
(
"成功"
!=
listOaRequest
.
getMessage
()?
0
:
1
);
}
catch
(
Exception
e
){
oaUpdateJournal
.
setSynchronization
(
0
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论