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
517be623
Commit
517be623
authored
Mar 24, 2023
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tzs注册新增配置文件is.ugp条件控制 是否同步至ugp库
parent
075cca45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
19 deletions
+32
-19
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+28
-19
application.properties
...-module-tzs-biz/src/main/resources/application.properties
+4
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
517be623
...
@@ -120,6 +120,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -120,6 +120,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Value
(
"${org.filter.group.seq}"
)
@Value
(
"${org.filter.group.seq}"
)
private
Long
groupSeq
;
private
Long
groupSeq
;
@Value
(
"${is.ugp}"
)
private
boolean
isUgp
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
RegUnitInfoDto
registerUnit
(
RegUnitInfoDto
model
)
{
public
RegUnitInfoDto
registerUnit
(
RegUnitInfoDto
model
)
{
...
@@ -136,22 +139,26 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -136,22 +139,26 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
// 3.2 自动创建:调用平台进行创建单位、用户信息
// 3.2 自动创建:调用平台进行创建单位、用户信息
this
.
createCompanyAndUser
(
regUnitInfo
);
this
.
createCompanyAndUser
(
regUnitInfo
);
//多线程同步ugp信息(tzs和ugp一起后放开)
//多线程同步ugp信息(tzs和ugp一起后放开)
// String token = RequestContext.getToken();
// String appKey = RequestContext.getAppKey();
FutureTask
<
ResponseModel
<
Boolean
>>
future
=
null
;
// String product = RequestContext.getProduct();
if
(
isUgp
)
{
// Callable callable = new Callable(){
String
token
=
RequestContext
.
getToken
();
// @Override
String
appKey
=
RequestContext
.
getAppKey
();
// public Object call() throws Exception {
String
product
=
RequestContext
.
getProduct
();
// RequestContext.setToken(token);
Callable
callable
=
new
Callable
()
{
// RequestContext.setAppKey(appKey);
@Override
// RequestContext.setProduct(product);
public
Object
call
()
throws
Exception
{
// //同步企业至ugp,成功返回true,失败返回false
RequestContext
.
setToken
(
token
);
// return ugpServiceFeignClient.syncCompany(model);
RequestContext
.
setAppKey
(
appKey
);
// }
RequestContext
.
setProduct
(
product
);
// };
//同步企业至ugp,成功返回true,失败返回false
// FutureTask<ResponseModel<Boolean>> future = new FutureTask(callable);
return
ugpServiceFeignClient
.
syncCompany
(
model
);
// Thread thread = new Thread(future);
}
// thread.start();
};
future
=
new
FutureTask
(
callable
);
Thread
thread
=
new
Thread
(
future
);
thread
.
start
();
}
// 1.插入单位注册许可信息表:tz_base_unit_licence
// 1.插入单位注册许可信息表:tz_base_unit_licence
...
@@ -190,9 +197,11 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -190,9 +197,11 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
model
.
setRegUnitIc
(
Bean
.
toModel
(
regUnitIc
,
new
RegUnitIcDto
()));
model
.
setRegUnitIc
(
Bean
.
toModel
(
regUnitIc
,
new
RegUnitIcDto
()));
//获取多线程执行结果 true成功 false失败(tzs和ugp一起后放开)
//获取多线程执行结果 true成功 false失败(tzs和ugp一起后放开)
// if(!future.get().getResult()){
if
(
isUgp
)
{
// throw new Exception("UGP信息同步失败");
if
(!
future
.
get
().
getResult
())
{
// }
throw
new
Exception
(
"UGP信息同步失败"
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/application.properties
View file @
517be623
...
@@ -166,3 +166,6 @@ appCode.gasBottle.image=studio_normalapp_3404491,upload/tzs/amos_studio/9C968B74
...
@@ -166,3 +166,6 @@ appCode.gasBottle.image=studio_normalapp_3404491,upload/tzs/amos_studio/9C968B74
# 特种设备安全追溯
# 特种设备安全追溯
appCode.safety.image
=
studio_normalapp_4391091,upload/tzs/amos_studio/-28367904-1135092464.png
appCode.safety.image
=
studio_normalapp_4391091,upload/tzs/amos_studio/-28367904-1135092464.png
# 若tzs和ugp一起,则true
is.ugp
=
false
\ No newline at end of file
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