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
b670492e
Commit
b670492e
authored
Aug 14, 2023
by
吴佳
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/ejs-20230802' into ejs-20230802
parents
34706d4f
f47e12af
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
101 additions
and
65 deletions
+101
-65
AbstractCommonResource.java
...om/ceb/gjjs/mda/resource/base/AbstractCommonResource.java
+10
-1
DemoResultVo.java
...c/main/java/com/ceb/gjjs/mda/special/vo/DemoResultVo.java
+16
-0
DemoVo.java
...ess/src/main/java/com/ceb/gjjs/mda/special/vo/DemoVo.java
+16
-0
RequestBaseVo.java
.../main/java/com/ceb/gjjs/mda/special/vo/RequestBaseVo.java
+3
-1
RespondBaseVo.java
.../main/java/com/ceb/gjjs/mda/special/vo/RespondBaseVo.java
+11
-1
LoginConstants.java
...s/src/main/java/com/ceb/gjjs/mda/util/LoginConstants.java
+1
-0
AuthorizationRequestFilter.java
...java/com/ceb/gjjs/mda/web/AuthorizationRequestFilter.java
+25
-60
MyBatisDaoSession.java
...com/brilliance/mda/support/mybatis/MyBatisDaoSession.java
+6
-2
BDAuthInfo.java
...c/main/java/com/brilliance/mda/support/td/BDAuthInfo.java
+13
-0
No files found.
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/resource/base/AbstractCommonResource.java
View file @
b670492e
package
com
.
ceb
.
gjjs
.
mda
.
resource
.
base
;
import
com.brilliance.mda.runtime.mda.driver.MdaEnv
;
import
com.brilliance.mda.runtime.request.BaseVO
;
import
com.brilliance.mda.runtime.response.ResponseSet
;
import
com.brilliance.mda.support.service.ICommonService
;
import
com.brilliance.mda.support.td.BDAuthInfo
;
import
com.ceb.gjjs.mda.special.vo.RequestBaseVo
;
import
com.ceb.gjjs.mda.util.ReflectUtil
;
import
com.ceb.gjjs.mda.util.ValidatorUtil
;
...
...
@@ -18,7 +20,6 @@ import javax.ws.rs.PathParam;
* @create 2021-09-24 11:51
*/
public
abstract
class
AbstractCommonResource
<
V
extends
BaseVO
>
{
protected
abstract
ICommonService
getCommonService
();
protected
abstract
V
getVo
();
...
...
@@ -252,8 +253,16 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
if
(
src
.
length
()
>
12
)
{
return
"业务来源src不能超过12"
;
}
before
(
baseVO
);
return
""
;
}
private
void
before
(
V
baseVO
)
{
BDAuthInfo
authInfo
=
(
BDAuthInfo
)
MdaEnv
.
getAuthInfo
();
authInfo
.
setCifno
(
baseVO
.
getCifno
());
authInfo
.
setUsrInr
(
baseVO
.
getUserid
());
}
}
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/special/vo/DemoResultVo.java
0 → 100644
View file @
b670492e
package
com
.
ceb
.
gjjs
.
mda
.
special
.
vo
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/14
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
DemoResultVo
extends
RespondBaseVo
{
}
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/special/vo/DemoVo.java
0 → 100644
View file @
b670492e
package
com
.
ceb
.
gjjs
.
mda
.
special
.
vo
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/14
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
DemoVo
extends
RequestBaseVo
{
}
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/special/vo/RequestBaseVo.java
View file @
b670492e
...
...
@@ -7,6 +7,8 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
java.io.Serializable
;
/**
* @Description 请求定制vo的基类
* @Author s_guodong
...
...
@@ -15,7 +17,7 @@ import org.hibernate.validator.constraints.Length;
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
RequestBaseVo
{
public
class
RequestBaseVo
implements
Serializable
{
@Length
(
max
=
8
,
message
=
"长度最大8"
)
@Need
...
...
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/special/vo/RespondBaseVo.java
View file @
b670492e
package
com
.
ceb
.
gjjs
.
mda
.
special
.
vo
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Description 返回定制vo的基类
* @Author s_guodong
* @Date 2023/8/10
*/
public
class
RespondBaseVo
{
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
RespondBaseVo
implements
Serializable
{
}
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/util/LoginConstants.java
View file @
b670492e
...
...
@@ -16,6 +16,7 @@ public class LoginConstants {
//用户ID
public
static
final
String
usrinr
=
"usrinr"
;
public
static
final
String
cifno
=
"cifno"
;
public
static
final
String
ptyinr
=
"ptyinr"
;
public
static
final
String
errorText
=
"errorText"
;
...
...
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/web/AuthorizationRequestFilter.java
View file @
b670492e
...
...
@@ -6,7 +6,6 @@ import com.brilliance.mda.runtime.mda.driver.MdaEnv;
import
com.brilliance.mda.runtime.mda.util.Systems
;
import
com.brilliance.mda.support.cache.ICache
;
import
com.brilliance.mda.support.td.BDAuthInfo
;
import
com.ceb.gjjs.mda.bo.Usr
;
import
com.ceb.gjjs.mda.dao.PtyMapper
;
import
com.ceb.gjjs.mda.dao.UsrMapper
;
import
com.ceb.gjjs.mda.util.LoginConstants
;
...
...
@@ -17,7 +16,9 @@ import javax.ws.rs.container.ContainerRequestContext;
import
javax.ws.rs.container.ContainerRequestFilter
;
import
javax.ws.rs.ext.Provider
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
brilliance
.
mda
.
runtime
.
mda
.
Constants
.
tdContextLASTUSERACTIONTIME
;
...
...
@@ -50,19 +51,6 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
*/
@Override
public
void
filter
(
ContainerRequestContext
request
)
{
//String logName = request.getHeaderString("userId");
//客户核心编号
String
cid
=
request
.
getHeaderString
(
LoginConstants
.
cid
);
//逻辑修改补充在这里.....
Map
<
String
,
Object
>
argsMap
=
new
HashMap
<>();
argsMap
.
put
(
"sql"
,
"select * from usr where cid='"
+
cid
+
"'"
);
List
<
Usr
>
usrList
=
usrMapper
.
dyncRead
(
argsMap
);
if
(
usrList
.
size
()==
0
)
{
return
;
}
String
userId
=
usrList
.
get
(
0
).
getInr
();
//网银编号
String
ncid
=
request
.
getHeaderString
(
LoginConstants
.
ncid
);
String
CN
=
request
.
getHeaderString
(
LoginConstants
.
CN
);
...
...
@@ -72,20 +60,18 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
String
CERT
=
request
.
getHeaderString
(
LoginConstants
.
CERT
);
//errorText
String
errorText
=
request
.
getHeaderString
(
LoginConstants
.
errorText
);
Map
<
String
,
Object
>
headMap
=
new
HashMap
<>();
headMap
.
put
(
LoginConstants
.
usrinr
,
userId
);
headMap
.
put
(
LoginConstants
.
ncid
,
ncid
);
headMap
.
put
(
LoginConstants
.
errorText
,
errorText
);
headMap
.
put
(
LoginConstants
.
CN
,
CN
);
headMap
.
put
(
LoginConstants
.
needSign
,
needSign
);
headMap
.
put
(
LoginConstants
.
__terminalType
,
__terminalType
);
headMap
.
put
(
LoginConstants
.
algorithm
,
algorithm
);
headMap
.
put
(
LoginConstants
.
CERT
,
CERT
);
String
errorText
=
request
.
getHeaderString
(
LoginConstants
.
errorText
);
Map
<
String
,
Object
>
headMap
=
new
HashMap
<>();
headMap
.
put
(
LoginConstants
.
ncid
,
ncid
);
headMap
.
put
(
LoginConstants
.
errorText
,
errorText
);
headMap
.
put
(
LoginConstants
.
CN
,
CN
);
headMap
.
put
(
LoginConstants
.
needSign
,
needSign
);
headMap
.
put
(
LoginConstants
.
__terminalType
,
__terminalType
);
headMap
.
put
(
LoginConstants
.
algorithm
,
algorithm
);
headMap
.
put
(
LoginConstants
.
CERT
,
CERT
);
String
token
=
getTokenKey
(
request
);
//目前采用自动登录模式认证
getOrCreateAuthInfo
(
token
,
headMap
);
getOrCreateAuthInfo
(
headMap
);
//设置一些系统参数
String
actionTime
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
).
format
(
new
Date
());
Systems
.
setContext
(
tdContextLASTUSERACTIONTIME
,
actionTime
);
...
...
@@ -93,39 +79,18 @@ public class AuthorizationRequestFilter implements ContainerRequestFilter {
}
private
String
getTokenKey
(
ContainerRequestContext
request
)
{
/*String token = request.getHeaderString(LoginConstants.token);
if (token == null || "undefined".equals(token))
token = "test";
return token;*/
return
UUID
.
randomUUID
().
toString
();
}
private
IAuthInfo
getOrCreateAuthInfo
(
String
tokenKey
,
Map
<
String
,
Object
>
headMap
)
{
IAuthInfo
authInfo
=
authInfoICache
.
get
(
tokenKey
);
if
(
authInfo
==
null
)
{
synchronized
(
authInfoICache
)
{
authInfo
=
authInfoICache
.
get
(
tokenKey
);
if
(
authInfo
==
null
)
{
String
usrinr
=
headMap
.
get
(
LoginConstants
.
usrinr
)==
null
?
""
:
headMap
.
get
(
LoginConstants
.
usrinr
).
toString
();
String
ptyinr
=
headMap
.
get
(
LoginConstants
.
ptyinr
)==
null
?
""
:
headMap
.
get
(
LoginConstants
.
ncid
).
toString
();
String
errorText
=
headMap
.
get
(
LoginConstants
.
errorText
)==
null
?
""
:
headMap
.
get
(
LoginConstants
.
errorText
).
toString
();
String
CN
=
headMap
.
get
(
LoginConstants
.
CN
)==
null
?
""
:
headMap
.
get
(
LoginConstants
.
CN
).
toString
();
String
needSign
=
headMap
.
get
(
LoginConstants
.
needSign
)==
null
?
""
:
headMap
.
get
(
LoginConstants
.
needSign
).
toString
();
String
__terminalType
=
headMap
.
get
(
LoginConstants
.
__terminalType
)==
null
?
""
:
headMap
.
get
(
LoginConstants
.
__terminalType
).
toString
();
String
algorithm
=
headMap
.
get
(
LoginConstants
.
algorithm
)==
null
?
""
:
headMap
.
get
(
LoginConstants
.
algorithm
).
toString
();
String
CERT
=
headMap
.
get
(
LoginConstants
.
CERT
)==
null
?
""
:
headMap
.
get
(
LoginConstants
.
CERT
).
toString
();
BDAuthInfo
tdAuthInfo
=
new
BDAuthInfo
(
usrinr
,
ptyinr
,
errorText
,
__terminalType
,
needSign
,
CN
,
algorithm
,
CERT
);
authInfo
=
tdAuthInfo
;
authInfoICache
.
store
(
tokenKey
,
authInfo
);
//构造authInfo,本该在登录里面做
// initAuthInfo(userId,authInfo);
}
}
}
MdaEnv
.
setAuthInfo
(
authInfo
);
return
authInfo
;
private
IAuthInfo
getOrCreateAuthInfo
(
Map
<
String
,
Object
>
headMap
)
{
String
usrinr
=
headMap
.
get
(
LoginConstants
.
usrinr
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
usrinr
).
toString
();
String
ptyinr
=
headMap
.
get
(
LoginConstants
.
ptyinr
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
ncid
).
toString
();
String
errorText
=
headMap
.
get
(
LoginConstants
.
errorText
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
errorText
).
toString
();
String
CN
=
headMap
.
get
(
LoginConstants
.
CN
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
CN
).
toString
();
String
needSign
=
headMap
.
get
(
LoginConstants
.
needSign
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
needSign
).
toString
();
String
__terminalType
=
headMap
.
get
(
LoginConstants
.
__terminalType
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
__terminalType
).
toString
();
String
algorithm
=
headMap
.
get
(
LoginConstants
.
algorithm
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
algorithm
).
toString
();
String
CERT
=
headMap
.
get
(
LoginConstants
.
CERT
)
==
null
?
""
:
headMap
.
get
(
LoginConstants
.
CERT
).
toString
();
BDAuthInfo
bdAuthInfo
=
new
BDAuthInfo
(
usrinr
,
ptyinr
,
errorText
,
__terminalType
,
needSign
,
CN
,
algorithm
,
CERT
);
MdaEnv
.
setAuthInfo
(
bdAuthInfo
);
return
bdAuthInfo
;
}
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/MyBatisDaoSession.java
View file @
b670492e
...
...
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Component;
import
java.io.Serializable
;
import
java.lang.reflect.InvocationTargetException
;
import
java.math.BigDecimal
;
import
java.sql.SQLException
;
import
java.util.*
;
...
...
@@ -359,8 +360,11 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
}
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++)
{
Map
<
String
,
Object
>
map1
=
result
.
get
(
i
);
if
(
map1
.
get
(
"COUNT"
)
!=
null
)
{
map1
.
put
(
"COUNT"
,
Integer
.
valueOf
(
map1
.
get
(
"COUNT"
)
+
""
));
Set
<
Map
.
Entry
<
String
,
Object
>>
entries
=
map1
.
entrySet
();
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
entries
)
{
if
(
entry
.
getValue
()
instanceof
BigDecimal
)
{
entry
.
setValue
(((
BigDecimal
)
entry
.
getValue
()).
intValue
());
}
}
}
resultLocal
.
set
(
new
ResultSet
(
result
));
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/support/td/BDAuthInfo.java
View file @
b670492e
...
...
@@ -8,6 +8,7 @@ import java.util.List;
public
class
BDAuthInfo
implements
IAuthInfo
{
private
String
usrInr
;
private
String
cifno
;
private
String
ptyInr
;
private
String
errorText
;
private
String
terminalType
;
...
...
@@ -106,4 +107,16 @@ public class BDAuthInfo implements IAuthInfo {
}
}
}
public
void
setUsrInr
(
String
usrInr
)
{
this
.
usrInr
=
usrInr
;
}
public
String
getCifno
()
{
return
cifno
;
}
public
void
setCifno
(
String
cifno
)
{
this
.
cifno
=
cifno
;
}
}
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