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
be81bc61
Commit
be81bc61
authored
Jan 19, 2021
by
WeiCong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
e294df89
8122ae89
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
2 deletions
+31
-2
AbstractCache.java
...n/java/org/sss/presentation/noui/cache/AbstractCache.java
+18
-0
NoUiPresentationUtil.java
.../org/sss/presentation/noui/util/NoUiPresentationUtil.java
+13
-2
eibs-container-3.5.0.jar
src/main/webapp/WEB-INF/lib/eibs-container-3.5.0.jar
+0
-0
eibs-hibernatesupport-2.0.0.jar
src/main/webapp/WEB-INF/lib/eibs-hibernatesupport-2.0.0.jar
+0
-0
eibs-pojosupport-2.0.0.jar
src/main/webapp/WEB-INF/lib/eibs-pojosupport-2.0.0.jar
+0
-0
No files found.
src/main/java/org/sss/presentation/noui/cache/AbstractCache.java
View file @
be81bc61
...
@@ -3,12 +3,16 @@ package org.sss.presentation.noui.cache;
...
@@ -3,12 +3,16 @@ package org.sss.presentation.noui.cache;
import
org.hibernate.Criteria
;
import
org.hibernate.Criteria
;
import
org.hibernate.Query
;
import
org.hibernate.Query
;
import
org.sss.common.model.CacheController
;
import
org.sss.common.model.CacheController
;
import
org.sss.common.model.IModuleList
;
import
org.sss.presentation.noui.common.Constants
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
abstract
class
AbstractCache
implements
CacheController
{
public
abstract
class
AbstractCache
implements
CacheController
{
protected
final
String
cacheName
;
protected
final
String
cacheName
;
final
String
SPLIT
=
"__"
;
final
String
SPLIT
=
"__"
;
public
static
final
ThreadLocal
paginationMap
=
new
ThreadLocal
();
public
AbstractCache
(
String
redis_cache
)
{
public
AbstractCache
(
String
redis_cache
)
{
this
.
cacheName
=
redis_cache
;
this
.
cacheName
=
redis_cache
;
...
@@ -59,6 +63,20 @@ public abstract class AbstractCache implements CacheController {
...
@@ -59,6 +63,20 @@ public abstract class AbstractCache implements CacheController {
return
sb
.
toString
();
return
sb
.
toString
();
}
}
@Override
public
void
prepareReadset
(
IModuleList
moduleList
)
{
Map
<
String
,
Map
<
String
,
Integer
>>
paginationCache
=
(
Map
<
String
,
Map
<
String
,
Integer
>>)
paginationMap
.
get
();
if
(
paginationCache
==
null
)
return
;
Map
<
String
,
Integer
>
paginationItem
=
paginationCache
.
remove
(
moduleList
.
getUrl
());
if
(
paginationCache
.
size
()
==
0
)
paginationMap
.
remove
();
if
(
paginationItem
==
null
)
return
;
moduleList
.
setPageSize
(
paginationItem
.
get
(
Constants
.
PAGINATION_PAGESIZE
));
moduleList
.
setPage
(
paginationItem
.
get
(
Constants
.
PAGINATION_INDEX
));
}
protected
abstract
List
doCacheRead
(
String
key
);
protected
abstract
List
doCacheRead
(
String
key
);
protected
abstract
void
doCacheWrite
(
String
key
,
List
lst
,
long
keepAlive
);
protected
abstract
void
doCacheWrite
(
String
key
,
List
lst
,
long
keepAlive
);
...
...
src/main/java/org/sss/presentation/noui/util/NoUiPresentationUtil.java
View file @
be81bc61
...
@@ -11,6 +11,7 @@ import org.sss.presentation.noui.api.exception.NoUiException;
...
@@ -11,6 +11,7 @@ import org.sss.presentation.noui.api.exception.NoUiException;
import
org.sss.presentation.noui.api.model.Alias
;
import
org.sss.presentation.noui.api.model.Alias
;
import
org.sss.presentation.noui.api.request.NoUiRequest
;
import
org.sss.presentation.noui.api.request.NoUiRequest
;
import
org.sss.presentation.noui.api.response.ErrorCodes
;
import
org.sss.presentation.noui.api.response.ErrorCodes
;
import
org.sss.presentation.noui.cache.AbstractCache
;
import
org.sss.presentation.noui.common.Constants
;
import
org.sss.presentation.noui.common.Constants
;
import
org.sss.presentation.noui.context.NoUiContext
;
import
org.sss.presentation.noui.context.NoUiContext
;
import
org.sss.presentation.noui.context.NoUiPresentation
;
import
org.sss.presentation.noui.context.NoUiPresentation
;
...
@@ -93,8 +94,7 @@ public class NoUiPresentationUtil {
...
@@ -93,8 +94,7 @@ public class NoUiPresentationUtil {
//处理分页信息
//处理分页信息
IModuleList
moduleList
=
(
IModuleList
)
baseObject
;
IModuleList
moduleList
=
(
IModuleList
)
baseObject
;
Map
<
String
,
Integer
>
paginationItem
=
(
Map
<
String
,
Integer
>)
paginationMap
.
get
(
aliasKey
);
Map
<
String
,
Integer
>
paginationItem
=
(
Map
<
String
,
Integer
>)
paginationMap
.
get
(
aliasKey
);
moduleList
.
setPageSize
(
paginationItem
.
get
(
Constants
.
PAGINATION_PAGESIZE
));
putPaginationCache
(
paginationItem
,
moduleList
);
moduleList
.
setPage
(
paginationItem
.
get
(
Constants
.
PAGINATION_INDEX
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Pagination command error"
,
e
);
log
.
error
(
"Pagination command error"
,
e
);
throw
new
NoUiException
(
"Pagination command error"
,
e
);
throw
new
NoUiException
(
"Pagination command error"
,
e
);
...
@@ -103,6 +103,17 @@ public class NoUiPresentationUtil {
...
@@ -103,6 +103,17 @@ public class NoUiPresentationUtil {
}
}
private
static
void
putPaginationCache
(
Map
<
String
,
Integer
>
paginationItem
,
IModuleList
moduleList
)
{
Map
<
String
,
Map
<
String
,
Integer
>>
paginationCache
=
(
Map
<
String
,
Map
<
String
,
Integer
>>)
AbstractCache
.
paginationMap
.
get
();
if
(
paginationCache
==
null
)
{
paginationCache
=
new
HashMap
<>();
AbstractCache
.
paginationMap
.
set
(
paginationCache
);
}
paginationCache
.
put
(
moduleList
.
getUrl
(),
paginationItem
);
}
private
static
void
handleDatafield
(
IContext
context
,
IDatafield
<
Object
>
dataField
,
Object
value
)
{
private
static
void
handleDatafield
(
IContext
context
,
IDatafield
<
Object
>
dataField
,
Object
value
)
{
if
(
null
==
value
||
dataField
==
null
)
if
(
null
==
value
||
dataField
==
null
)
return
;
return
;
...
...
src/main/webapp/WEB-INF/lib/eibs-container-3.5.0.jar
View file @
be81bc61
No preview for this file type
src/main/webapp/WEB-INF/lib/eibs-hibernatesupport-2.0.0.jar
View file @
be81bc61
No preview for this file type
src/main/webapp/WEB-INF/lib/eibs-pojosupport-2.0.0.jar
View file @
be81bc61
No preview for this file type
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