Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
24261ecb
Commit
24261ecb
authored
1 year ago
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表结构修改
parent
8800de17
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
37 additions
and
0 deletions
+37
-0
CheckerHelper.java
.../main/java/com/yanzuoguang/util/helper/CheckerHelper.java
+1
-0
DateHelper.java
...src/main/java/com/yanzuoguang/util/helper/DateHelper.java
+1
-0
EnumHelper.java
...src/main/java/com/yanzuoguang/util/helper/EnumHelper.java
+3
-0
RunHelper.java
.../src/main/java/com/yanzuoguang/util/helper/RunHelper.java
+1
-0
Log.java
...util-base/src/main/java/com/yanzuoguang/util/log/Log.java
+1
-0
ProcessData.java
...rc/main/java/com/yanzuoguang/util/thread/ProcessData.java
+1
-0
RunPlan.java
...se/src/main/java/com/yanzuoguang/util/thread/RunPlan.java
+2
-0
RunnableListAutoItem.java
...ava/com/yanzuoguang/util/thread/RunnableListAutoItem.java
+1
-0
ThreadHelper.java
...c/main/java/com/yanzuoguang/util/thread/ThreadHelper.java
+2
-0
ThreadNext.java
...src/main/java/com/yanzuoguang/util/thread/ThreadNext.java
+1
-0
HttpHelperTest.java
yzg-util-base/src/test/java/helper/HttpHelperTest.java
+1
-0
YzgFileConsumer.java
...main/java/com/yanzuoguang/cloud/file/YzgFileConsumer.java
+12
-0
MqConfigurable.java
...src/main/java/com/yanzuoguang/mq/base/MqConfigurable.java
+2
-0
YzgMqConsumer.java
.../src/main/java/com/yanzuoguang/mq/plan/YzgMqConsumer.java
+6
-0
MessageSendServiceImpl.java
...m/yanzuoguang/mq/service/impl/MessageSendServiceImpl.java
+1
-0
MessageServeServiceImpl.java
.../yanzuoguang/mq/service/impl/MessageServeServiceImpl.java
+1
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/CheckerHelper.java
View file @
24261ecb
...
...
@@ -385,6 +385,7 @@ public final class CheckerHelper {
DateAutoHelper
.
getAutoDate
(
paramVal
);
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
this
.
checkResult
=
language
.
format
(
PARAM_NOT_DATE
,
paramName
,
formatStr
);
this
.
setValid
(
false
);
}
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/DateHelper.java
View file @
24261ecb
...
...
@@ -99,6 +99,7 @@ public class DateHelper {
}
return
initMillSecond
(
to
,
initMillSecond
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ExceptionHelper
.
handleException
(
DateHelper
.
class
,
ex
,
from
);
}
return
null
;
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/EnumHelper.java
View file @
24261ecb
...
...
@@ -22,6 +22,7 @@ public class EnumHelper {
result
=
Enum
.
valueOf
(
vType
,
vStr
);
}
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ExceptionHelper
.
handleException
(
EnumHelper
.
class
,
ex
,
vStr
);
}
return
result
;
...
...
@@ -40,6 +41,7 @@ public class EnumHelper {
result
=
(
T
)
Enum
.
valueOf
((
Class
)
vType
,
vStr
);
}
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ExceptionHelper
.
handleException
(
EnumHelper
.
class
,
ex
,
vStr
);
}
if
(
result
==
null
&&
vDefault
==
null
)
{
...
...
@@ -69,6 +71,7 @@ public class EnumHelper {
}
}
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ExceptionHelper
.
handleException
(
EnumHelper
.
class
,
ex
,
i
);
}
return
result
;
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/RunHelper.java
View file @
24261ecb
...
...
@@ -43,6 +43,7 @@ public class RunHelper {
ex
=
null
;
break
;
}
catch
(
RuntimeException
e
)
{
e
.
printStackTrace
();
if
(
i
<
size
)
{
// 间隔100ms,防止服务器重启时请求失败
ThreadHelper
.
sleep
(
sleep
);
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/log/Log.java
View file @
24261ecb
...
...
@@ -165,6 +165,7 @@ public class Log {
try
{
msg
=
String
.
format
(
msg
,
args
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
Log
.
class
,
ex
);
}
}
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/thread/ProcessData.java
View file @
24261ecb
...
...
@@ -75,6 +75,7 @@ public class ProcessData {
try
{
runProcess
.
execute
(
this
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
HttpHelper
.
class
,
ex
);
}
}
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/thread/RunPlan.java
View file @
24261ecb
...
...
@@ -102,6 +102,7 @@ public class RunPlan {
}
millSeconds
=
(
now
-
item
.
getDate
());
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ExceptionHelper
.
handleException
(
ThreadHelper
.
class
,
ex
);
}
// 未到执行时间
...
...
@@ -117,6 +118,7 @@ public class RunPlan {
this
.
triggerEvent
(
this
.
onItemExecuted
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ExceptionHelper
.
handleException
(
RunPlan
.
class
,
ex
);
}
item
.
initDate
();
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/thread/RunnableListAutoItem.java
View file @
24261ecb
...
...
@@ -142,6 +142,7 @@ public class RunnableListAutoItem implements Comparable<RunnableListAutoItem> {
}
this
.
code
.
run
();
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
this
.
handleException
(
ex
);
}
finally
{
this
.
count
++;
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/thread/ThreadHelper.java
View file @
24261ecb
...
...
@@ -75,11 +75,13 @@ public class ThreadHelper {
try
{
timeout
.
run
(
true
,
-
1
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ExceptionHelper
.
handleException
(
ThreadHelper
.
class
,
ex
);
}
try
{
interval
.
run
(
false
,
-
1
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ExceptionHelper
.
handleException
(
ThreadHelper
.
class
,
ex
);
}
if
(
timeout
.
getCount
()
==
0
&&
interval
.
getCount
()
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/thread/ThreadNext.java
View file @
24261ecb
...
...
@@ -61,6 +61,7 @@ public class ThreadNext {
try
{
isPause
=
next
.
next
();
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
boolean
isNewEx
=
frontEx
==
null
||
!(
frontEx
.
getClass
()
==
ex
.
getClass
()
&&
StringHelper
.
compare
(
frontEx
.
getMessage
(),
ex
.
getMessage
()));
if
(
isNewEx
||
System
.
currentTimeMillis
()
-
newErrorTime
>
5L
*
60L
*
1000L
)
{
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/test/java/helper/HttpHelperTest.java
View file @
24261ecb
...
...
@@ -120,6 +120,7 @@ public class HttpHelperTest {
try
{
String
s
=
HttpHelper
.
get
(
req
.
url
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
isError
=
true
;
}
finally
{
long
end
=
System
.
currentTimeMillis
();
...
...
This diff is collapsed.
Click to expand it.
yzg-util-file/src/main/java/com/yanzuoguang/cloud/file/YzgFileConsumer.java
View file @
24261ecb
...
...
@@ -66,8 +66,10 @@ public class YzgFileConsumer implements InitializingBean {
try
{
fileService
.
removeTempFolder
(
tempFolder
);
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
fileProcedure
.
removeTempFolder
(
tempFolder
);
}
finally
{
...
...
@@ -88,8 +90,10 @@ public class YzgFileConsumer implements InitializingBean {
YzgFileMoveReqVo
req
=
JsonHelper
.
deserialize
(
json
,
YzgFileMoveReqVo
.
class
);
fileService
.
moveFile
(
req
);
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
fileProcedure
.
moveFile
(
json
,
60
*
1000
);
}
finally
{
...
...
@@ -125,8 +129,10 @@ public class YzgFileConsumer implements InitializingBean {
fileProcedure
.
convertImage
(
req
);
}
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
fileProcedure
.
convertImage
(
json
,
60
*
1000
);
}
finally
{
...
...
@@ -162,8 +168,10 @@ public class YzgFileConsumer implements InitializingBean {
fileProcedure
.
convertVideo
(
req
);
}
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
fileProcedure
.
convertVideo
(
json
,
60
*
1000
);
}
finally
{
...
...
@@ -188,8 +196,10 @@ public class YzgFileConsumer implements InitializingBean {
}
excelService
.
fileCreate
(
json
,
fileReq
);
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
fileProcedure
.
fileCreateDelay
(
json
);
}
finally
{
...
...
@@ -213,8 +223,10 @@ public class YzgFileConsumer implements InitializingBean {
}
excelService
.
updateStatus
(
fileReq
);
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgFileConsumer
.
class
,
ex
);
fileProcedure
.
fileStatus
(
json
);
}
finally
{
...
...
This diff is collapsed.
Click to expand it.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/base/MqConfigurable.java
View file @
24261ecb
...
...
@@ -68,6 +68,7 @@ public class MqConfigurable implements RabbitTemplate.ConfirmCallback, RabbitTem
System
.
out
.
println
(
"丢失消息:"
+
ack
+
" msg:"
+
cause
);
}
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
MqConfigurable
.
class
,
ex
);
}
}
...
...
@@ -93,6 +94,7 @@ public class MqConfigurable implements RabbitTemplate.ConfirmCallback, RabbitTem
// 写入数据库
messageSendService
.
onError
(
messageVo
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
MqConfigurable
.
class
,
ex
);
}
}
...
...
This diff is collapsed.
Click to expand it.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/plan/YzgMqConsumer.java
View file @
24261ecb
...
...
@@ -49,8 +49,10 @@ public class YzgMqConsumer {
req
=
JsonHelper
.
deserialize
(
json
,
MessageVo
.
class
);
yzgMqProcedure
.
send
(
req
,
true
);
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgMqConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgMqConsumer
.
class
,
ex
);
// 等待100ms再次执行
yzgMqProcedure
.
sendDelay
(
req
,
100
);
...
...
@@ -74,8 +76,10 @@ public class YzgMqConsumer {
req
=
JsonHelper
.
deserialize
(
json
,
MessagePlan
.
class
);
yzgMqProcedure
.
sendDelay
(
req
);
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgMqConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgMqConsumer
.
class
,
ex
);
// 等待100ms再次执行
yzgMqProcedure
.
sendDelay
(
req
,
100
);
...
...
@@ -97,8 +101,10 @@ public class YzgMqConsumer {
RegisterServerTokenReqVo
req
=
JsonHelper
.
deserialize
(
json
,
RegisterServerTokenReqVo
.
class
);
messageServerService
.
removeServerToken
(
req
);
}
catch
(
CodeException
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgMqConsumer
.
class
,
ex
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
YzgMqConsumer
.
class
,
ex
);
// 等待100ms再次执行
yzgMqProcedure
.
sendRemove
(
json
,
100
);
...
...
This diff is collapsed.
Click to expand it.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MessageSendServiceImpl.java
View file @
24261ecb
...
...
@@ -149,6 +149,7 @@ public class MessageSendServiceImpl implements MessageSendService {
channel
.
basicAck
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
Log
.
error
(
MessageSendServiceImpl
.
class
,
e
);
}
}
...
...
This diff is collapsed.
Click to expand it.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MessageServeServiceImpl.java
View file @
24261ecb
...
...
@@ -192,6 +192,7 @@ public class MessageServeServiceImpl implements MessageServerService, Initializi
});
sendServerMessage
(
msg
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
Log
.
error
(
MqServiceImpl
.
class
,
ex
);
}
finally
{
messageSendService
.
basicAck
(
message
,
channel
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment