Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
Overview
Details
Activity
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
gechengyang
nouiWithSpringMVC
Commits
4a9d88d8
Commit
4a9d88d8
authored
Mar 18, 2021
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加bd提前退出交易机制
parent
60001fbe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
33 deletions
+34
-33
ExitTransactionException.java
...entation/noui/api/exception/ExitTransactionException.java
+1
-1
NoUiPresentation.java
...a/org/sss/presentation/noui/context/NoUiPresentation.java
+28
-28
AbstractCommonController.java
...resentation/noui/controller/AbstractCommonController.java
+5
-4
No files found.
src/main/java/org/sss/presentation/noui/api/exception/ExitTransactionException.java
View file @
4a9d88d8
...
...
@@ -5,7 +5,7 @@ public class ExitTransactionException extends RuntimeException {
private
String
errorCode
;
public
ExitTransactionException
(
String
message
,
String
errorCod
e
)
{
public
ExitTransactionException
(
String
errorCode
,
String
messag
e
)
{
super
(
message
);
this
.
errorCode
=
errorCode
;
}
...
...
src/main/java/org/sss/presentation/noui/context/NoUiPresentation.java
View file @
4a9d88d8
...
...
@@ -9,6 +9,7 @@ import org.sss.common.impl.AbstractNullPresentation;
import
org.sss.common.impl.ProxyDatafield
;
import
org.sss.common.model.*
;
import
org.sss.exception.ContainerException
;
import
org.sss.presentation.noui.api.exception.ExitTransactionException
;
import
org.sss.presentation.noui.api.request.NoUiRequest
;
import
org.sss.presentation.noui.api.response.ErrorCodes
;
import
org.sss.presentation.noui.common.Constants
;
...
...
@@ -44,20 +45,28 @@ public class NoUiPresentation extends AbstractNullPresentation {
// ArrayList<IAttribute<?>>();
// public final List<IAttribute<?>> codeValuesList = new
// ArrayList<IAttribute<?>>();
public
IPanel
popupPanel
=
null
;
public
String
transactionName
=
null
;
public
boolean
clearFlag
=
false
;
public
boolean
newTabFlag
=
false
;
public
Boolean
logoutFlag
=
null
;
private
Map
<
String
,
Object
>
codetable
=
new
HashMap
<>();
private
NoUiRequest
noUiRequest
;
private
Map
<
String
,
Object
>
error
=
new
HashMap
<>();
private
Map
<
String
,
Object
>
modifyMap
=
new
HashMap
<>();
// public final List<IAttribute<?>> enableList = new
// ArrayList<IAttribute<?>>();
// public final List<IAttribute<?>> requiredList = new
// ArrayList<IAttribute<?>>();
private
String
message
=
null
;
// 弹出的message
private
String
message_code
=
ErrorCodes
.
SUCCESS
;
public
IPanel
popupPanel
=
null
;
private
boolean
isChain
=
false
;
public
NoUiPresentation
(
NoUiContext
context
,
NoUiRequest
noUiRequest
)
{
this
.
ctx
=
context
;
this
.
noUiRequest
=
noUiRequest
;
}
@Override
public
void
close
(
IPanel
panel
)
throws
ContainerException
{
// TODO Auto-generated method stub
...
...
@@ -72,7 +81,7 @@ public class NoUiPresentation extends AbstractNullPresentation {
@Override
public
Object
readFromSession
(
String
name
)
{
return
((
NoUiContext
)
this
.
ctx
).
getRedisLoginInfo
().
getContextMap
().
get
(
name
);
return
((
NoUiContext
)
this
.
ctx
).
getRedisLoginInfo
().
getContextMap
().
get
(
name
);
}
@Override
...
...
@@ -87,15 +96,9 @@ public class NoUiPresentation extends AbstractNullPresentation {
@Override
public
void
writeToSession
(
String
name
,
Object
value
)
{
((
NoUiContext
)
this
.
ctx
).
getRedisLoginInfo
().
getContextMap
().
put
(
name
,
value
);
((
NoUiContext
)
this
.
ctx
).
getRedisLoginInfo
().
getContextMap
().
put
(
name
,
value
);
}
public
String
transactionName
=
null
;
public
boolean
clearFlag
=
false
;
public
boolean
newTabFlag
=
false
;
private
boolean
isChain
=
false
;
public
Boolean
logoutFlag
=
null
;
public
String
getMessageCode
()
{
return
this
.
message_code
;
}
...
...
@@ -108,11 +111,6 @@ public class NoUiPresentation extends AbstractNullPresentation {
return
isChain
;
}
public
NoUiPresentation
(
NoUiContext
context
,
NoUiRequest
noUiRequest
)
{
this
.
ctx
=
context
;
this
.
noUiRequest
=
noUiRequest
;
}
public
synchronized
void
dispose
()
{
if
(
disposed
)
{
return
;
...
...
@@ -202,7 +200,7 @@ public class NoUiPresentation extends AbstractNullPresentation {
error
.
put
(((
IBaseObject
)
paramIAttribute
).
getUrl
(),
str
);
}
if
((
log
.
isDebugEnabled
())
&&
((
paramIAttribute
instanceof
IDatafield
)))
{
log
.
info
(
String
.
format
(
"error field url %s."
,
new
Object
[]
{
((
IDatafield
<?>)
paramIAttribute
).
getUrl
()
}));
log
.
info
(
String
.
format
(
"error field url %s."
,
new
Object
[]{((
IDatafield
<?>)
paramIAttribute
).
getUrl
()
}));
}
}
...
...
@@ -211,12 +209,14 @@ public class NoUiPresentation extends AbstractNullPresentation {
// mapPut(hintMap, paramIAttribute, "HINT", paramString, paramVarArgs);
}
public
boolean
message
(
MessageType
paramMessageType
,
String
paramString
,
Object
paramObject
)
throws
ContainerException
{
public
boolean
message
(
MessageType
paramMessageType
,
String
paramString
,
Object
paramObject
)
{
if
(
paramObject
instanceof
ExitTransactionException
){
throw
ExitTransactionException
.
class
.
cast
(
paramObject
);
}
if
(
paramMessageType
.
equals
(
MessageType
.
ERROR
)
&&
(
paramObject
instanceof
Throwable
))
{
if
(
paramMessageType
.
equals
(
MessageType
.
ERROR
)
&&
(
paramObject
instanceof
Throwable
))
{
//记录异常日志
TxInfo
.
recordException
((
Throwable
)
paramObject
);
TxInfo
.
recordException
((
Throwable
)
paramObject
);
}
...
...
@@ -232,8 +232,8 @@ public class NoUiPresentation extends AbstractNullPresentation {
PrintStream
localPrintStream
=
new
PrintStream
(
new
FileOutputStream
(
new
File
(
localFile
,
str2
)));
((
Throwable
)
paramObject
).
printStackTrace
(
localPrintStream
);
localPrintStream
.
close
();
str1
=
String
.
format
(
getI18nValue
(
"eibs"
,
"error.message"
),
new
Object
[]
{
((
Throwable
)
paramObject
).
getMessage
(),
str2
});
log
.
error
(
"事件触发异常:"
+((
Throwable
)
paramObject
).
getMessage
(),(
Throwable
)
paramObject
);
str1
=
String
.
format
(
getI18nValue
(
"eibs"
,
"error.message"
),
new
Object
[]{((
Throwable
)
paramObject
).
getMessage
(),
str2
});
log
.
error
(
"事件触发异常:"
+
((
Throwable
)
paramObject
).
getMessage
(),
(
Throwable
)
paramObject
);
}
else
if
(
paramObject
!=
null
)
{
str1
=
paramObject
.
toString
();
}
...
...
@@ -533,14 +533,14 @@ public class NoUiPresentation extends AbstractNullPresentation {
return
codetable
;
}
public
Map
<
String
,
Object
>
getError
()
{
return
error
;
}
public
void
setCodetable
(
Map
<
String
,
Object
>
codetable
)
{
this
.
codetable
=
codetable
;
}
public
Map
<
String
,
Object
>
getError
()
{
return
error
;
}
public
void
setError
(
Map
<
String
,
Object
>
error
)
{
this
.
error
=
error
;
}
...
...
src/main/java/org/sss/presentation/noui/controller/AbstractCommonController.java
View file @
4a9d88d8
...
...
@@ -188,14 +188,15 @@ public abstract class AbstractCommonController {
ret
=
ResultUtil
.
result
(
NoUiPresentationUtil
.
retCode
(
context
),
NoUiPresentationUtil
.
retMsg
(
context
),
afterReturnData
,
paginationData
,
NoUiPresentationUtil
.
handleErrorReturnData
(
context
,
alias
),
NoUiPresentationUtil
.
handleCodeTableReturnData
(
context
,
alias
),
noUiVersion
.
getVersion
());
}
catch
(
ExitTransactionException
exitTrans
)
{
ret
=
ResultUtil
.
result
(
exitTrans
.
getErrorCode
(),
exitTrans
.
getMessage
(),
"service error"
,
noUiVersion
.
getVersion
());
}
catch
(
Throwable
e
)
{
if
(
e
.
getCause
()
instanceof
ExitTransactionException
){
ExitTransactionException
exitTrans
=
ExitTransactionException
.
class
.
cast
(
e
.
getCause
());
ret
=
ResultUtil
.
result
(
exitTrans
.
getErrorCode
(),
exitTrans
.
getMessage
(),
exitTrans
.
getMessage
(),
noUiVersion
.
getVersion
());
}
else
{
log
.
error
(
"OnClick command error"
,
e
);
ret
=
ResultUtil
.
result
(
ErrorCodes
.
ERROR
,
"hander error"
,
"service error"
,
noUiVersion
.
getVersion
());
TxInfo
.
recordException
(
e
);
}
}
finally
{
if
(
context
!=
null
)
{
//context.getSupport().disconnect();
...
...
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