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
19a89992
Commit
19a89992
authored
Jul 21, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加缓存
parent
3cf6a524
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
BizCommonConstant.java
...in/amos/boot/module/tcm/api/common/BizCommonConstant.java
+7
-0
AmosTcmApplication.java
...iz/src/main/java/com/yeejoin/amos/AmosTcmApplication.java
+6
-0
RegUnitInfoServiceImpl.java
...dule/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+14
-1
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/common/BizCommonConstant.java
View file @
19a89992
...
...
@@ -16,4 +16,11 @@ public interface BizCommonConstant {
* 所有区划企业数据redisKey
*/
String
REGION_TREE_REDIS_KEY
=
"REGION_TREE_TCM"
;
/**
* 企业类型数据redisKey
*/
String
UNIT_TYPE_LIST_REDIS_KEY
=
"UNIT_TYPE_LIST_REDIS_KEY"
;
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/AmosTcmApplication.java
View file @
19a89992
...
...
@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.tcm.biz.service.impl.EquipmentCategoryServic
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.tcm.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.service.IUnitInfoService
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.UnitInfoServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
...
...
@@ -94,6 +95,9 @@ public class AmosTcmApplication {
@Autowired
UnitInfoServiceImpl
unitInfoService
;
@Autowired
RegUnitInfoServiceImpl
regUnitInfoService
;
public
static
void
main
(
String
[]
args
)
throws
UnknownHostException
{
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
AmosTcmApplication
.
class
,
args
);
...
...
@@ -132,6 +136,8 @@ public class AmosTcmApplication {
equipmentCategoryService
.
creatTree
();
//4.区域放redis缓存(依赖1)
unitInfoService
.
getAllRegionTree
();
//5.企业类型放redis缓存(依赖1)
regUnitInfoService
.
setAndGetUnitTypeList
();
}
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
19a89992
...
...
@@ -446,6 +446,19 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
return
iDataDictionaryService
.
getByType
(
DICT_TYPE_UNIT_TYPE
);
}
public
List
<
DataDictionary
>
setAndGetUnitTypeList
()
{
List
<
DataDictionary
>
dataDictionaries
;
if
(
redisUtil
.
hasKey
(
BizCommonConstant
.
UNIT_TYPE_LIST_REDIS_KEY
)){
dataDictionaries
=
JSONObject
.
parseArray
(
redisUtil
.
get
(
BizCommonConstant
.
UNIT_TYPE_LIST_REDIS_KEY
).
toString
(),
DataDictionary
.
class
);
}
else
{
dataDictionaries
=
iDataDictionaryService
.
getByType
(
DICT_TYPE_UNIT_TYPE
);
redisUtil
.
set
(
BizCommonConstant
.
UNIT_TYPE_LIST_REDIS_KEY
,
JSONObject
.
toJSONString
(
dataDictionaries
));
}
return
dataDictionaries
;
}
@Override
public
Collection
getManagementUnitTree
(
String
orgCode
)
{
List
<
LinkedHashMap
>
companyModels
=
(
List
<
LinkedHashMap
>)
redisUtil
.
get
(
BizCommonConstant
.
COMPANY_TREE_REDIS_KEY
);
...
...
@@ -672,7 +685,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
Set
<
String
>
appCodesSet
=
new
HashSet
<>();
Map
<
Long
,
List
<
Long
>>
roleSeqMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
List
<
DataDictionary
>
unitTypeList
=
g
etUnitTypeList
();
List
<
DataDictionary
>
unitTypeList
=
setAndG
etUnitTypeList
();
Map
<
String
,
DataDictionary
>
dataDictionaryMap
=
unitTypeList
.
stream
().
collect
(
Collectors
.
toMap
(
DataDictionary:
:
getCode
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
for
(
String
typeCode
:
units
)
{
DataDictionary
unitType
=
dataDictionaryMap
.
get
(
typeCode
);
...
...
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