Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
1db4cdfb
Commit
1db4cdfb
authored
Oct 19, 2022
by
srx
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
225d91c9
c4528541
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
0 deletions
+154
-0
BusinessIdentify.java
.../amos/boot/module/ugp/biz/framework/BusinessIdentify.java
+18
-0
BusinessIdentifyAspect.java
...boot/module/ugp/biz/framework/BusinessIdentifyAspect.java
+77
-0
BusinessInfo.java
...join/amos/boot/module/ugp/biz/framework/BusinessInfo.java
+59
-0
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/framework/BusinessIdentify.java
0 → 100644
View file @
1db4cdfb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
framework
;
import
java.lang.annotation.*
;
/**
* @author Dell
*/
@Target
(
ElementType
.
METHOD
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
BusinessIdentify
{
/**
* 将业务信息提取存放
* @return
*/
boolean
isNeedIdentity
()
default
true
;
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/framework/BusinessIdentifyAspect.java
0 → 100644
View file @
1db4cdfb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
framework
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.exception.PermissionException
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.Map
;
/**
* @author DELL
*/
@Aspect
@Component
@ResponseBody
@Order
(
value
=
1
)
public
class
BusinessIdentifyAspect
{
@Autowired
RedisUtils
redisUtils
;
@Autowired
OrgUsrServiceImpl
orgUsrService
;
@Before
(
value
=
"@annotation(com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify) && @annotation(permission)"
)
public
void
personIdentity
(
JoinPoint
joinPoint
,
BusinessIdentify
permission
)
throws
PermissionException
{
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
permission
.
isNeedIdentity
()
&&
reginParam
!=
null
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
//company
Long
amosBizCode
=
reginParams
.
getCompany
().
getSequenceNbr
();
OrgUsr
companyOrgUsr
=
orgUsrService
.
getById
(
amosBizCode
);
String
companyName
=
companyOrgUsr
.
getBizOrgName
();
Long
companySequenceNbr
=
companyOrgUsr
.
getSequenceNbr
();
String
companyType
=
companyOrgUsr
.
getOrgExpandAttr1
();
if
(
ValidationUtil
.
isEmpty
(
companyType
))
{
companyType
=
companyOrgUsr
.
getBizOrgType
();
}
BusinessInfo
.
amosBizCode
=
amosBizCode
;
BusinessInfo
.
companySequenceNbr
=
companySequenceNbr
;
BusinessInfo
.
companyName
=
companyName
;
BusinessInfo
.
companyType
=
companyType
;
//User
Long
amosUserCode
=
reginParams
.
getUserModel
().
getSequenceNbr
();
OrgUsr
userOrgUsr
=
orgUsrService
.
getById
(
amosUserCode
);
String
userName
=
userOrgUsr
.
getBizOrgName
();
Long
userSequenceNbr
=
userOrgUsr
.
getSequenceNbr
();
String
userType
=
userOrgUsr
.
getOrgExpandAttr1
();
if
(
ValidationUtil
.
isEmpty
(
userType
))
{
userType
=
userOrgUsr
.
getBizOrgType
();
}
BusinessInfo
.
amosUserCode
=
amosUserCode
;
BusinessInfo
.
userName
=
userName
;
BusinessInfo
.
userSequenceNbr
=
userSequenceNbr
;
BusinessInfo
.
userType
=
userType
;
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/framework/BusinessInfo.java
0 → 100644
View file @
1db4cdfb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
framework
;
import
lombok.Data
;
/**
* 当前登陆人的业务库信息
* @author Dell
*/
@Data
public
class
BusinessInfo
{
/**
* 公司
* 平台存储的sequenceNbr
*/
public
static
Long
amosBizCode
;
/**
* 公司
* 业务存储的名称
*/
public
static
String
companyName
;
/**
* 公司
* 业务存储的sequenceNbr
*/
public
static
Long
companySequenceNbr
;
/**
* 公司
* 业务存储的类型
*/
public
static
String
companyType
;
/**
* 人员
* 平台存储的sequenceNbr
*/
public
static
Long
amosUserCode
;
/**
* 人员
* 业务存储的名称
*/
public
static
String
userName
;
/**
* 人员
* 业务存储的sequenceNbr
*/
public
static
Long
userSequenceNbr
;
/**
* 人员
* 业务存储的类型
*/
public
static
String
userType
;
}
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