Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EIP-Integration
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李炎
EIP-Integration
Commits
f9d43c5e
提交
f9d43c5e
authored
9月 14, 2021
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
091fd14c
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
58 行增加
和
34 行删除
+58
-34
MaterialinventoryTimed.java
...cg/modules/iost/API/TimedTask/MaterialinventoryTimed.java
+1
-1
PhysicalIDTimed.java
...org/jeecg/modules/iost/API/TimedTask/PhysicalIDTimed.java
+1
-1
ProductInventoryTimed.java
...ecg/modules/iost/API/TimedTask/ProductInventoryTimed.java
+1
-1
ProductionOrderTimed.java
...eecg/modules/iost/API/TimedTask/ProductionOrderTimed.java
+12
-2
ProductionSchedulingTimed.java
...modules/iost/API/TimedTask/ProductionSchedulingTimed.java
+12
-2
PurchaseorderTimed.java
.../jeecg/modules/iost/API/TimedTask/PurchaseorderTimed.java
+1
-1
ReserveStockTimed.java
...g/jeecg/modules/iost/API/TimedTask/ReserveStockTimed.java
+1
-1
SalesOrderTimed.java
...org/jeecg/modules/iost/API/TimedTask/SalesOrderTimed.java
+8
-2
SupplylistTimed.java
...org/jeecg/modules/iost/API/TimedTask/SupplylistTimed.java
+1
-1
HlsAlterController.java
...modules/iost/API/controller/video/HlsAlterController.java
+9
-11
HlsController.java
...eecg/modules/iost/API/controller/video/HlsController.java
+9
-11
application-docker.yml
...t-module-system/src/main/resources/application-docker.yml
+1
-0
application-test.yml
...oot-module-system/src/main/resources/application-test.yml
+1
-0
没有找到文件。
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/MaterialinventoryTimed.java
浏览文件 @
f9d43c5e
...
...
@@ -48,7 +48,7 @@ public class MaterialinventoryTimed implements Job {
/**设置定时器功能
* */
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000*60)
public
void
Materialinventory
()
throws
IOException
,
ParseException
{
iMaterialinventoryService
.
synchronization
(
null
);
}
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/PhysicalIDTimed.java
浏览文件 @
f9d43c5e
...
...
@@ -24,7 +24,7 @@ public class PhysicalIDTimed implements Job {
/**测试定时*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000*60)
public
void
Materialinventory
()
throws
IOException
,
ParseException
{
physicalIDService
.
synchronization
(
null
);
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/ProductInventoryTimed.java
浏览文件 @
f9d43c5e
...
...
@@ -28,7 +28,7 @@ public class ProductInventoryTimed implements Job {
/**测试定时*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000*60)
public
void
Materialinventory
()
throws
IOException
,
ParseException
{
productInventoryService
.
synchronization
(
null
);
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/ProductionOrderTimed.java
浏览文件 @
f9d43c5e
package
org
.
jeecg
.
modules
.
iost
.
API
.
TimedTask
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
org.jeecg.modules.iost.API.service.IProductionOrderService
;
import
org.quartz.Job
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
...
@@ -12,12 +16,18 @@ import java.text.ParseException;
@Slf4j
@Component
@EnableScheduling
public
class
ProductionOrderTimed
{
public
class
ProductionOrderTimed
implements
Job
{
@Autowired
IProductionOrderService
productionOrderService
;
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000*60)
public
void
job
()
throws
ParseException
{
productionOrderService
.
synchronization
(
null
);
}
@SneakyThrows
@Override
public
void
execute
(
JobExecutionContext
jobExecutionContext
)
throws
JobExecutionException
{
productionOrderService
.
synchronization
(
null
);
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/ProductionSchedulingTimed.java
浏览文件 @
f9d43c5e
package
org
.
jeecg
.
modules
.
iost
.
API
.
TimedTask
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
org.jeecg.modules.iost.API.service.IProductionOrderService
;
import
org.jeecg.modules.iost.API.service.IProductionSchedulingService
;
import
org.quartz.Job
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
...
@@ -12,12 +16,18 @@ import java.text.ParseException;
@Slf4j
@Component
@EnableScheduling
public
class
ProductionSchedulingTimed
{
public
class
ProductionSchedulingTimed
implements
Job
{
@Autowired
IProductionSchedulingService
productionSchedulingService
;
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000*60)
public
void
job
()
throws
ParseException
{
productionSchedulingService
.
synchronization
(
null
);
}
@SneakyThrows
@Override
public
void
execute
(
JobExecutionContext
jobExecutionContext
)
throws
JobExecutionException
{
productionSchedulingService
.
synchronization
(
null
);
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/PurchaseorderTimed.java
浏览文件 @
f9d43c5e
...
...
@@ -26,7 +26,7 @@ public class PurchaseorderTimed implements Job {
* 测试定时
*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000 * 60)
public
void
Materialinventory
()
throws
IOException
,
ParseException
{
iPurchaseorderService
.
synchronizationList
(
null
);
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/ReserveStockTimed.java
浏览文件 @
f9d43c5e
...
...
@@ -30,7 +30,7 @@ public class ReserveStockTimed implements Job {
* 测试定时
*/
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000 * 60)
public
void
Materialinventory
()
throws
IOException
,
ParseException
{
reserveStockService
.
synchronization
(
null
);
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/SalesOrderTimed.java
浏览文件 @
f9d43c5e
package
org
.
jeecg
.
modules
.
iost
.
API
.
TimedTask
;
import
com.google.api.client.util.Sleeper
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.json.JSONObject
;
import
org.jeecg.modules.iost.API.entity.Purchaseorder
;
...
...
@@ -20,13 +21,18 @@ import java.io.IOException;
@Slf4j
@Component
@EnableScheduling
public
class
SalesOrderTimed
{
public
class
SalesOrderTimed
implements
Job
{
@Autowired
ISalesOrderService
salesOrderService
;
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000*60)
public
void
job
()
throws
ParseException
{
salesOrderService
.
synchronization
(
null
);
}
@SneakyThrows
@Override
public
void
execute
(
JobExecutionContext
jobExecutionContext
)
throws
JobExecutionException
{
salesOrderService
.
synchronization
(
null
);
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/TimedTask/SupplylistTimed.java
浏览文件 @
f9d43c5e
...
...
@@ -25,7 +25,7 @@ public class SupplylistTimed implements Job {
@Autowired
ISupplyListIService
supplyListIService
;
// @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled
(
fixedDelay
=
1000
*
60
)
//
@Scheduled(fixedDelay = 1000*60)
public
void
Materialinventory
()
throws
IOException
,
ParseException
{
supplyListIService
.
synchronization
(
null
);
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/video/HlsAlterController.java
浏览文件 @
f9d43c5e
...
...
@@ -3,6 +3,7 @@ package org.jeecg.modules.iost.API.controller.video;//package org.jeecg.modules.
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -15,16 +16,14 @@ import java.net.HttpURLConnection;
import
java.net.InetAddress
;
import
java.net.URL
;
import
java.net.UnknownHostException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
@RequestMapping
(
"/asAlter"
)
@Slf4j
//@Scope("session")
@Api
(
tags
=
"请求金蝶日志"
)
@RestController
public
class
HlsAlterController
{
...
...
@@ -33,7 +32,8 @@ public class HlsAlterController {
private
int
port
;
@Value
(
"${server.servlet.context-path}"
)
private
String
path
;
private
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
@Value
(
"${server.localip}"
)
private
String
ip
;
public
HlsAlterController
()
throws
UnknownHostException
{
...
...
@@ -42,7 +42,7 @@ public class HlsAlterController {
@GetMapping
(
"/GetFile.m3u8"
)
public
void
getFile
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
// urlPath=null
;
urlPath
=
new
HashMap
<>()
;
// 读取路径下面的文件
String
originUrlpath
=
"https://hls01open.ys7.com/openlive/6e0b2be040a943489ef0b9bb344b96b8.hd.m3u8"
;
//文件流返回格式设为.m3u8
...
...
@@ -52,17 +52,15 @@ public class HlsAlterController {
List
urlList
=
analysisIndex
(
indexStr
);
//解析indexStr获取.ts文件地址
String
inIp
=
"192.168.2.209"
;
String
localPath
=
"http://"
+
ip
+
":"
+
port
+
path
+
"/"
;
Map
<
String
,
InputStream
>
urlPathMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
urlList
.
size
();
i
++)
{
String
url
=
urlList
.
get
(
i
).
toString
();
//
InputStream
fileInputStream
=
getFileInputStream
(
url
);
String
tsUrl
=
System
.
nanoTime
()
+
".ts"
;
//文件后缀,key
String
tsUrl
=
UUID
.
randomUUID
().
toString
()
+
".ts"
;
//文件后缀,key
String
localPathTs
=
localPath
+
"asAlter/GetTs/"
+
tsUrl
;
String
resultA
=
indexStr
.
replaceAll
(
url
,
localPathTs
);
//文本中的“url”替换为“localPathTs”
urlPath
Map
.
put
(
tsUrl
,
fileInputStream
);
urlPath
.
put
(
tsUrl
,
fileInputStream
);
indexStr
=
resultA
;
}
urlPath
=
urlPathMap
;
InputStream
in
=
new
ByteArrayInputStream
(
indexStr
.
getBytes
());
OutputStream
outputStream
=
new
BufferedOutputStream
(
response
.
getOutputStream
());
...
...
@@ -114,7 +112,6 @@ public class HlsAlterController {
public
void
getFileInputStream
(
@PathVariable
()
String
path
,
HttpServletResponse
response
)
{
InputStream
in
=
urlPath
.
get
(
path
);
try
{
response
.
setContentType
(
"application/x-linguist"
);
OutputStream
outputStream
=
new
BufferedOutputStream
(
response
.
getOutputStream
());
//创建存放文件内容的数组
...
...
@@ -135,6 +132,7 @@ public class HlsAlterController {
System
.
out
.
println
(
"读取网络文件异常:"
+
path
);
// logger.error("读取网络文件异常:"+path);
}
finally
{
urlPath
.
remove
(
path
);
}
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/video/HlsController.java
浏览文件 @
f9d43c5e
...
...
@@ -7,6 +7,7 @@ import org.jeecg.common.util.oConvertUtils;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -28,6 +29,7 @@ import java.util.regex.Pattern;
@RequestMapping
(
"/as"
)
@Slf4j
//@Scope("prototype")
@Api
(
tags
=
"请求金蝶日志"
)
@RestController
public
class
HlsController
{
...
...
@@ -36,7 +38,8 @@ public class HlsController {
private
int
port
;
@Value
(
"${server.servlet.context-path}"
)
private
String
path
;
private
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
@Value
(
"${server.localip}"
)
private
String
ip
;
public
HlsController
()
throws
UnknownHostException
{
...
...
@@ -45,7 +48,7 @@ public class HlsController {
@GetMapping
(
"/GetFile.m3u8"
)
public
void
getFile
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
urlPath
=
null
;
//
urlPath=null;
// 读取路径下面的文件
String
originUrlpath
=
"https://hls01open.ys7.com/openlive/6e0b2be040a943489ef0b9bb344b96b8.hd.m3u8"
;
//文件流返回格式设为.m3u8
...
...
@@ -53,24 +56,17 @@ public class HlsController {
//读取指定路径下面的文件
String
indexStr
=
getIndexFile
(
originUrlpath
);
//解析originUrlpath 返回为文本
List
urlList
=
analysisIndex
(
indexStr
);
//解析indexStr获取.ts文件地址
String
inIp
=
"192.168.2.209"
;
String
localPath
=
"http://"
+
ip
+
":"
+
port
+
path
+
"/"
;
System
.
out
.
println
(
urlList
);
Map
<
String
,
String
>
urlPathMap
=
new
HashMap
<
String
,
String
>();
for
(
int
i
=
0
;
i
<
urlList
.
size
();
i
++)
{
String
tsUrl
=
i
+
".ts"
;
//文件后缀,key
String
tsUrl
=
UUID
.
randomUUID
().
toString
()
+
".ts"
;
//文件后缀,key
String
localPathTs
=
localPath
+
"as/GetTs/"
+
tsUrl
;
String
url
=
urlList
.
get
(
i
).
toString
();
//
String
resultA
=
indexStr
.
replaceAll
(
url
,
localPathTs
);
//文本中的“url”替换为“localPathTs”
urlPath
Map
.
put
(
tsUrl
,
url
);
urlPath
.
put
(
tsUrl
,
url
);
indexStr
=
resultA
;
}
urlPath
=
urlPathMap
;
System
.
out
.
println
(
"urlPath"
+
urlPath
);
System
.
out
.
println
(
indexStr
);
InputStream
in
=
new
ByteArrayInputStream
(
indexStr
.
getBytes
());
OutputStream
outputStream
=
new
BufferedOutputStream
(
response
.
getOutputStream
());
//创建存放文件内容的数组
byte
[]
buff
=
new
byte
[
1024
];
...
...
@@ -152,6 +148,8 @@ public class HlsController {
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"读取网络文件异常:"
+
path
);
// logger.error("读取网络文件异常:"+path);
}
finally
{
urlPath
.
remove
(
path
);
}
}
...
...
jeecg-boot-module-system/src/main/resources/application-docker.yml
浏览文件 @
f9d43c5e
server
:
localip
:
www.lingqingkeji.com
port
:
8081
tomcat
:
max-swallow-size
:
-1
...
...
jeecg-boot-module-system/src/main/resources/application-test.yml
浏览文件 @
f9d43c5e
server
:
localip
:
192.168.2.209
port
:
8090
tomcat
:
max-swallow-size
:
-1
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论