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
6d498c6d
Commit
6d498c6d
authored
Aug 18, 2022
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.优化日志记录
2.优化数据库未关闭隐患 3.修复getCodeTable方法获取不到码表的缺陷
parent
113b921b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
59 deletions
+67
-59
PreHandle.java
src/main/java/org/sss/module/pojo/PreHandle.java
+31
-24
NoUiContextManager.java
...org/sss/presentation/noui/context/NoUiContextManager.java
+2
-0
AbstractCommonController.java
...resentation/noui/controller/AbstractCommonController.java
+1
-1
NoUiApiInitListener.java
...g/sss/presentation/noui/listener/NoUiApiInitListener.java
+33
-34
No files found.
src/main/java/org/sss/module/pojo/PreHandle.java
View file @
6d498c6d
...
@@ -116,31 +116,38 @@ public class PreHandle {
...
@@ -116,31 +116,38 @@ public class PreHandle {
}
}
public
static
boolean
initUserInr
(
String
cid
,
String
oid
)
{
public
static
boolean
initUserInr
(
String
cid
,
String
oid
)
{
Session
session
=
HibernateUtils
.
openSession
(
null
);
Session
session
=
null
;
String
ptySql
=
"select inr,ptytyp from pty where (ptytyp='2' or PTYTYP='1') and cid=?"
;
try
{
Query
<
Map
>
sqlQuery
=
session
.
createSQLQuery
(
ptySql
);
session
=
HibernateUtils
.
openSession
(
null
);
sqlQuery
.
setParameter
(
1
,
cid
);
String
ptySql
=
"select inr,ptytyp from pty where (ptytyp='2' or PTYTYP='1') and cid=?"
;
sqlQuery
.
setResultTransformer
(
Transformers
.
ALIAS_TO_ENTITY_MAP
);
Query
<
Map
>
sqlQuery
=
session
.
createSQLQuery
(
ptySql
);
List
<
Map
>
ptyLst
=
sqlQuery
.
list
();
sqlQuery
.
setParameter
(
1
,
cid
);
sqlQuery
.
setResultTransformer
(
Transformers
.
ALIAS_TO_ENTITY_MAP
);
if
(
ptyLst
==
null
||
ptyLst
.
size
()
==
0
)
{
List
<
Map
>
ptyLst
=
sqlQuery
.
list
();
return
false
;
}
if
(
ptyLst
==
null
||
ptyLst
.
size
()
==
0
)
{
Map
ptyRs
=
ptyLst
.
get
(
0
);
return
false
;
String
ptyinr
=
(
String
)
ptyRs
.
get
(
"INR"
);
}
String
usrSql
=
"select inr,lgnnam,oprnam from usr where oid=? and ptyinr=?"
;
Map
ptyRs
=
ptyLst
.
get
(
0
);
sqlQuery
=
session
.
createSQLQuery
(
usrSql
);
String
ptyinr
=
(
String
)
ptyRs
.
get
(
"INR"
);
sqlQuery
.
setParameter
(
1
,
oid
);
String
usrSql
=
"select inr,lgnnam,oprnam from usr where oid=? and ptyinr=?"
;
sqlQuery
.
setParameter
(
2
,
ptyinr
);
sqlQuery
=
session
.
createSQLQuery
(
usrSql
);
sqlQuery
.
setResultTransformer
(
Transformers
.
ALIAS_TO_ENTITY_MAP
);
sqlQuery
.
setParameter
(
1
,
oid
);
List
<
Map
>
usrLst
=
sqlQuery
.
list
();
sqlQuery
.
setParameter
(
2
,
ptyinr
);
if
(
usrLst
==
null
||
usrLst
.
size
()
==
0
)
{
sqlQuery
.
setResultTransformer
(
Transformers
.
ALIAS_TO_ENTITY_MAP
);
return
false
;
List
<
Map
>
usrLst
=
sqlQuery
.
list
();
if
(
usrLst
==
null
||
usrLst
.
size
()
==
0
)
{
return
false
;
}
Map
usrRs
=
usrLst
.
get
(
0
);
USRINR
.
set
((
String
)
usrRs
.
get
(
"INR"
));
return
true
;
}
finally
{
if
(
session
!=
null
)
{
session
.
close
();
}
}
}
Map
usrRs
=
usrLst
.
get
(
0
);
USRINR
.
set
((
String
)
usrRs
.
get
(
"INR"
));
session
.
close
();
return
true
;
}
}
public
static
IModuleRoot
getModuleRoot
(
IContext
ctx
,
String
trnName
)
throws
Exception
{
public
static
IModuleRoot
getModuleRoot
(
IContext
ctx
,
String
trnName
)
throws
Exception
{
...
...
src/main/java/org/sss/presentation/noui/context/NoUiContextManager.java
View file @
6d498c6d
...
@@ -15,6 +15,7 @@ import org.sss.presentation.noui.util.StringUtil;
...
@@ -15,6 +15,7 @@ import org.sss.presentation.noui.util.StringUtil;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.UUID
;
import
java.util.UUID
;
public
class
NoUiContextManager
{
public
class
NoUiContextManager
{
...
@@ -55,6 +56,7 @@ public class NoUiContextManager {
...
@@ -55,6 +56,7 @@ public class NoUiContextManager {
noUiContext
.
setGui
(
new
NoUiPresentation
(
noUiContext
,
noUiRequest
));
noUiContext
.
setGui
(
new
NoUiPresentation
(
noUiContext
,
noUiRequest
));
noUiContext
.
setSession
(
session
);
noUiContext
.
setSession
(
session
);
noUiContext
.
setNoUiRequest
(
noUiRequest
);
noUiContext
.
setNoUiRequest
(
noUiRequest
);
noUiContext
.
setLocale
(
Locale
.
getDefault
());
log
.
debug
(
"Build context finished"
);
log
.
debug
(
"Build context finished"
);
return
noUiContext
;
return
noUiContext
;
}
}
...
...
src/main/java/org/sss/presentation/noui/controller/AbstractCommonController.java
View file @
6d498c6d
...
@@ -281,7 +281,7 @@ public abstract class AbstractCommonController {
...
@@ -281,7 +281,7 @@ public abstract class AbstractCommonController {
continue
;
continue
;
}
}
if
(
modifyEntry
.
getKey
()
==
null
)
{
if
(
modifyEntry
.
getKey
()
==
null
)
{
log
.
error
(
"
错误的modifymap:"
+
noUiRequest
.
getMappingUrl
()
+
"--"
+
modifyMap
);
log
.
error
(
"
modifymap中存在键为空的元素:"
+
noUiRequest
.
getMappingUrl
()
);
continue
;
continue
;
}
}
if
(
aliasPath
.
startsWith
(
modifyEntry
.
getKey
()))
{
if
(
aliasPath
.
startsWith
(
modifyEntry
.
getKey
()))
{
...
...
src/main/java/org/sss/presentation/noui/listener/NoUiApiInitListener.java
View file @
6d498c6d
...
@@ -14,38 +14,37 @@ import java.util.List;
...
@@ -14,38 +14,37 @@ import java.util.List;
public
class
NoUiApiInitListener
implements
ServletContextListener
{
public
class
NoUiApiInitListener
implements
ServletContextListener
{
protected
static
final
Log
log
=
LogFactory
.
getLog
(
NoUiApiInitListener
.
class
);
protected
static
final
Log
log
=
LogFactory
.
getLog
(
NoUiApiInitListener
.
class
);
private
static
final
String
DATABASE_SUPPORT_TYPE
=
"DbSupportType"
;
private
static
final
String
DATABASE_SUPPORT_TYPE
=
"DbSupportType"
;
private
static
final
String
NOUI_TIMEOUT
=
"nouiTimeout"
;
private
static
final
String
NOUI_TIMEOUT
=
"nouiTimeout"
;
private
static
final
String
LOGIN_CONTEXT_NAME
=
"loginContextName"
;
private
static
final
String
LOGIN_CONTEXT_NAME
=
"loginContextName"
;
private
static
final
String
OPEN_PREFIX
=
"openPrefix"
;
private
static
final
String
OPEN_PREFIX
=
"openPrefix"
;
private
static
final
String
OPEN_TRANS
=
"openTrans"
;
private
static
final
String
OPEN_TRANS
=
"openTrans"
;
private
static
final
int
ENDLESS_TIME
=
5
*
24
*
60
*
60
;
private
static
final
int
ENDLESS_TIME
=
5
*
24
*
60
*
60
;
@Override
@Override
public
void
contextDestroyed
(
ServletContextEvent
arg0
)
{
public
void
contextDestroyed
(
ServletContextEvent
arg0
)
{
}
}
@Override
@Override
public
void
contextInitialized
(
ServletContextEvent
contextEvent
)
{
public
void
contextInitialized
(
ServletContextEvent
contextEvent
)
{
ServletContext
context
=
contextEvent
.
getServletContext
();
ServletContext
context
=
contextEvent
.
getServletContext
();
String
dbType
=
context
.
getInitParameter
(
DATABASE_SUPPORT_TYPE
);
String
dbType
=
context
.
getInitParameter
(
DATABASE_SUPPORT_TYPE
);
NoUiContextManager
.
dbType
=
dbType
;
NoUiContextManager
.
dbType
=
dbType
;
NoUiContextManager
.
loginContextName
=
context
.
getInitParameter
(
LOGIN_CONTEXT_NAME
);
NoUiContextManager
.
loginContextName
=
context
.
getInitParameter
(
LOGIN_CONTEXT_NAME
);
String
openSource
=
context
.
getInitParameter
(
OPEN_PREFIX
);
String
openSource
=
context
.
getInitParameter
(
OPEN_PREFIX
);
if
(
openSource
!=
null
)
if
(
openSource
!=
null
)
NoUiContextManager
.
openSourcePrefix
=
openSource
;
NoUiContextManager
.
openSourcePrefix
=
openSource
;
String
trans
=
context
.
getInitParameter
(
OPEN_TRANS
);
String
trans
=
context
.
getInitParameter
(
OPEN_TRANS
);
if
(!
StringUtils
.
isEmpty
(
trans
))
if
(!
StringUtils
.
isEmpty
(
trans
))
{
{
List
<
String
>
openTrans
=
Arrays
.
asList
(
trans
.
split
(
","
));
List
<
String
>
openTrans
=
Arrays
.
asList
(
trans
.
split
(
","
));
NoUiContextManager
.
openTransactions
.
addAll
(
openTrans
);
NoUiContextManager
.
openTransactions
.
addAll
(
openTrans
);
log
.
debug
(
"开放"
+
openTrans
.
size
()
+
"个交易:"
+
trans
);
log
.
debug
(
"开放的交易:"
+
trans
+
";"
+
openTrans
);
}
}
}
}
}
}
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