Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
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
s_guodong
gjjs-bd-common
Commits
089a82bc
Commit
089a82bc
authored
May 26, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
9a48b71f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
23 deletions
+19
-23
Platform.java
...iness/src/main/java/com/ceb/gjjs/mda/global/Platform.java
+5
-2
Rcvp.java
...s/src/main/java/com/ceb/gjjs/mda/manager/module/Rcvp.java
+0
-4
AuthInterceptor.java
...s/src/main/java/com/ceb/gjjs/mda/web/AuthInterceptor.java
+14
-17
No files found.
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/global/Platform.java
View file @
089a82bc
...
...
@@ -4,7 +4,7 @@ import java.util.*;
import
java.math.BigDecimal
;
import
com.brilliance.mda.runtime.mda.*
;
import
com.brilliance.mda.runtime.mda.impl.*
;
import
com.brilliance.mda.
runtime.annotation
.*
;
import
com.brilliance.mda.
support.mybatis
.*
;
import
com.brilliance.mda.runtime.mda.driver.*
;
import
static
com
.
brilliance
.
mda
.
runtime
.
mda
.
Constants
.*;
import
com.brilliance.mda.runtime.mda.util.*
;
...
...
@@ -1709,6 +1709,8 @@ public class Platform
if
(
db
!=
null
)
{
ctx
.
storeData
(
"LastDB."
+
Platform
.
getModuleRoot
(),
db
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
db
);
}
}
...
...
@@ -1928,7 +1930,8 @@ public class Platform
if
(
db
!=
null
)
{
ctx
.
storeData
(
"DefaultDB."
+
Platform
.
getModuleRoot
(),
db
);
log
.
debug
(
"{}"
,
"DefaultDB change to "
+
db
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
db
);
log
.
debug
(
"{}"
,
"DefaultDB change to "
+
db
);
}
}
...
...
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/manager/module/Rcvp.java
View file @
089a82bc
...
...
@@ -11,7 +11,6 @@ import com.brilliance.mda.runtime.mda.impl.AbstractModule;
import
com.brilliance.mda.runtime.mda.impl.Argument
;
import
com.brilliance.mda.runtime.mda.impl.StreamImpl
;
import
com.brilliance.mda.runtime.mda.util.MdaUtils
;
import
com.brilliance.mda.support.mybatis.DynamicDataSourceContextHolder
;
import
com.ceb.gjjs.mda.bo.Chn
;
import
com.ceb.gjjs.mda.bo.Wanrec
;
import
com.ceb.gjjs.mda.global.Platform
;
...
...
@@ -832,13 +831,11 @@ public class Rcvp extends AbstractModule{
//20190827新增电子信用证查询语句
else
if
(
"exl"
.
equals
(
this
.
getMsgtyp
()))
{
DynamicDataSourceContextHolder
.
setDataSourceType
(
"datasource2"
);
// sql = " WHERE m1.inr=m2.inr AND m1.dir='>' AND m1.pntinr IS NULL AND m2.subtyp<>'990' and m2.subtyp<>'900'";
sql
=
" WHERE m1.inr=m2.inr AND m1.dir='>' AND m1.pntinr IS NULL AND m2.subtyp<>'990'"
;
}
else
{
DynamicDataSourceContextHolder
.
setDataSourceType
(
"datasource1"
);
//sql = " WHERE m1.inr=m2.inr AND m1.dir='>' AND m1.pntinr IS NULL AND m2.subtyp<>'601' AND m2.subtyp<>'900' ";
sql
=
" WHERE m1.inr=m2.inr AND m1.dir='>' AND m1.pntinr IS NULL AND m2.subtyp<>'NCK' AND m2.subtyp<>'ACK' AND m2.subtyp<>'010' AND m2.subtyp<>'020' "
;
}
...
...
@@ -1794,7 +1791,6 @@ public class Rcvp extends AbstractModule{
MdaUtils
.
clear
(
this
.
getSmpmod
().
getMps
());
MdaUtils
.
clear
(
this
.
getSmpmod
().
getMpi
());
MdaUtils
.
clear
(
this
.
getSmpmod
().
getSmh
());
/* int errorcode = Platform.errorCode();
if(errorcode != NO_ERROR)
{
...
...
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/web/AuthInterceptor.java
View file @
089a82bc
...
...
@@ -3,14 +3,11 @@ package com.ceb.gjjs.mda.web;
import
com.brilliance.mda.runtime.mda.IAuthInfo
;
import
com.brilliance.mda.runtime.mda.IContext
;
import
com.brilliance.mda.runtime.mda.driver.MdaEnv
;
import
com.brilliance.mda.runtime.mda.util.Datas
;
import
com.brilliance.mda.runtime.mda.util.Systems
;
import
com.brilliance.mda.runtime.request.BaseVO
;
import
com.brilliance.mda.support.cache.ICache
;
import
com.brilliance.mda.support.mybatis.DynamicDataSourceContextHolder
;
import
com.brilliance.mda.support.td.TDAuthInfo
;
import
com.ceb.gjjs.mda.bo.Etg
;
import
com.ceb.gjjs.mda.bo.Ety
;
import
com.ceb.gjjs.mda.bo.Usr
;
import
com.ceb.gjjs.mda.dao.EtgMapper
;
import
com.ceb.gjjs.mda.dao.EtyMapper
;
import
com.ceb.gjjs.mda.dao.UsrMapper
;
...
...
@@ -24,9 +21,6 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
brilliance
.
mda
.
runtime
.
mda
.
Constants
.
tdContextLASTUSERACTIONTIME
;
...
...
@@ -50,25 +44,25 @@ public class AuthInterceptor implements HandlerInterceptor {
private
ICache
<
String
,
IAuthInfo
>
authInfoICache
;
//简单生成Token Key
private
String
getTokenKey
(
HttpServletRequest
request
){
private
String
getTokenKey
(
HttpServletRequest
request
)
{
String
logName
=
request
.
getHeader
(
"token"
);
if
(
logName
==
null
||
"undefined"
.
equals
(
logName
))
if
(
logName
==
null
||
"undefined"
.
equals
(
logName
))
logName
=
"sun123"
;
//现在仅仅以userId这个来实现
return
logName
;
}
private
IAuthInfo
getOrCreateAuthInfo
(
String
tokenKey
,
String
userId
)
{
private
IAuthInfo
getOrCreateAuthInfo
(
String
tokenKey
,
String
userId
)
{
IAuthInfo
authInfo
=
authInfoICache
.
get
(
tokenKey
);
if
(
authInfo
==
null
)
{
synchronized
(
authInfoICache
)
{
authInfo
=
authInfoICache
.
get
(
tokenKey
);
if
(
authInfo
==
null
)
{
if
(
authInfo
==
null
)
{
TDAuthInfo
tdAuthInfo
=
new
TDAuthInfo
(
userId
);
authInfo
=
tdAuthInfo
;
authInfoICache
.
store
(
tokenKey
,
authInfo
);
authInfoICache
.
store
(
tokenKey
,
authInfo
);
//构造authInfo,本该在登录里面做
// initAuthInfo(userId,authInfo);
// initAuthInfo(userId,authInfo);
}
}
}
...
...
@@ -76,7 +70,7 @@ public class AuthInterceptor implements HandlerInterceptor {
return
authInfo
;
}
private
void
initAuthInfo
(
String
logName
,
IAuthInfo
authInfo
)
{
private
void
initAuthInfo
(
String
logName
,
IAuthInfo
authInfo
)
{
// Map<String,Object> argsMap = new HashMap<>();
// argsMap.put("sql","select * from usr where extkey='"+logName+"'");
// List<Usr> usrList = usrMapper.dyncRead(argsMap);
...
...
@@ -104,14 +98,14 @@ public class AuthInterceptor implements HandlerInterceptor {
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
String
logName
=
request
.
getHeader
(
"userId"
);
if
(
logName
==
null
||
"undefined"
.
equals
(
logName
))
if
(
logName
==
null
||
"undefined"
.
equals
(
logName
))
logName
=
"sun123"
;
String
token
=
getTokenKey
(
request
);
//目前采用自动登录模式认证
getOrCreateAuthInfo
(
token
,
logName
);
getOrCreateAuthInfo
(
token
,
logName
);
//设置一些系统参数
String
actionTime
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
).
format
(
new
Date
());
Systems
.
setContext
(
tdContextLASTUSERACTIONTIME
,
actionTime
);
Systems
.
setContext
(
tdContextLASTUSERACTIONTIME
,
actionTime
);
return
true
;
}
...
...
@@ -139,5 +133,8 @@ public class AuthInterceptor implements HandlerInterceptor {
MdaEnv
.
removeAttrs
();
MdaEnv
.
clearContext
();
MdaEnv
.
removeGridData
();
// 资源释放
DynamicDataSourceContextHolder
.
clearDataSourceType
();
}
}
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