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
c9e2b923
Commit
c9e2b923
authored
Mar 07, 2023
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ugp同步tzs企业注册
parent
148227f3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
17 deletions
+126
-17
UgpServiceFeignClient.java
.../boot/module/tzs/flc/api/feign/UgpServiceFeignClient.java
+26
-0
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+40
-2
OrgEnum.java
...va/com/yeejoin/amos/boot/module/ugp/api/Enum/OrgEnum.java
+20
-13
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+20
-0
CompanyServiceImpl.java
.../boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
+0
-0
OrgServiceImpl.java
...amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
+15
-2
pom.xml
amos-boot-system-ugp/pom.xml
+5
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/feign/UgpServiceFeignClient.java
0 → 100644
View file @
c9e2b923
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
feign
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
@FeignClient
(
name
=
"UGP-ZYB"
,
path
=
"/ugp"
,
configuration
=
{
MultipartSupportConfig
.
class
})
public
interface
UgpServiceFeignClient
{
/**
* 调用ugp的接口
* @param object 公司信息
* @return
*/
@RequestMapping
(
value
=
"/company/syncCompany"
,
method
=
RequestMethod
.
POST
)
ResponseModel
<
Boolean
>
syncCompany
(
@RequestBody
Object
object
);
}
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 @
c9e2b923
...
@@ -11,16 +11,21 @@ import java.util.LinkedHashMap;
...
@@ -11,16 +11,21 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.FutureTask
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.UgpServiceFeignClient
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -53,6 +58,7 @@ import com.yeejoin.amos.feign.privilege.Privilege;
...
@@ -53,6 +58,7 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
/**
/**
* 单位注册信息表服务实现类
* 单位注册信息表服务实现类
...
@@ -87,6 +93,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -87,6 +93,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Autowired
@Autowired
AccessFeignService
accessFeignService
;
AccessFeignService
accessFeignService
;
@Autowired
UgpServiceFeignClient
ugpServiceFeignClient
;
@Autowired
@Autowired
StartPlatformTokenService
startPlatformTokenService
;
StartPlatformTokenService
startPlatformTokenService
;
...
@@ -123,6 +132,28 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -123,6 +132,28 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
Bean
.
copyExistPropertis
(
model
,
regUnitInfo
);
Bean
.
copyExistPropertis
(
model
,
regUnitInfo
);
regUnitInfo
.
setUnitType
(
StringUtils
.
join
(
model
.
getUnitTypeList
(),
","
));
regUnitInfo
.
setUnitType
(
StringUtils
.
join
(
model
.
getUnitTypeList
(),
","
));
regUnitInfo
.
setUnitTypeCode
(
StringUtils
.
join
(
model
.
getUnitTypeCodeList
(),
","
));
regUnitInfo
.
setUnitTypeCode
(
StringUtils
.
join
(
model
.
getUnitTypeCodeList
(),
","
));
// 3.2 自动创建:调用平台进行创建单位、用户信息
this
.
createCompanyAndUser
(
regUnitInfo
);
//多线程同步ugp信息
String
token
=
RequestContext
.
getToken
();
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
Callable
callable
=
new
Callable
(){
@Override
public
Object
call
()
throws
Exception
{
RequestContext
.
setToken
(
token
);
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
//同步企业至ugp,成功返回true,失败返回false
return
ugpServiceFeignClient
.
syncCompany
(
model
);
}
};
FutureTask
<
ResponseModel
<
Boolean
>>
future
=
new
FutureTask
(
callable
);
Thread
thread
=
new
Thread
(
future
);
thread
.
start
();
// 1.插入单位注册许可信息表:tz_base_unit_licence
// 1.插入单位注册许可信息表:tz_base_unit_licence
List
<
BaseUnitLicenceDto
>
unitLicenceDtos
=
model
.
getUnitLicences
();
List
<
BaseUnitLicenceDto
>
unitLicenceDtos
=
model
.
getUnitLicences
();
List
<
BaseUnitLicence
>
baseUnitLicences
=
unitLicenceDtos
.
stream
().
map
(
s
->
{
List
<
BaseUnitLicence
>
baseUnitLicences
=
unitLicenceDtos
.
stream
().
map
(
s
->
{
...
@@ -145,8 +176,8 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -145,8 +176,8 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
// if (UnitReviewStateEnum.NO_NEED_REVIEW.getCode().equals(model.getState())) {
// if (UnitReviewStateEnum.NO_NEED_REVIEW.getCode().equals(model.getState())) {
// 3.1 创建企业信息
// 3.1 创建企业信息
this
.
createBaseEnterpriseInfo
(
model
);
this
.
createBaseEnterpriseInfo
(
model
);
// 3.2 自动创建:调用平台进行创建单位、用户信息
this
.
createCompanyAndUser
(
regUnitInfo
);
// }
// }
// 4.插入注册单位基本信息表:tz_flc_reg_unit_info
// 4.插入注册单位基本信息表:tz_flc_reg_unit_info
this
.
save
(
regUnitInfo
);
this
.
save
(
regUnitInfo
);
...
@@ -157,6 +188,12 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -157,6 +188,12 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
model
.
setUnitLicences
(
Bean
.
toModels
(
baseUnitLicences
,
BaseUnitLicenceDto
.
class
));
model
.
setUnitLicences
(
Bean
.
toModels
(
baseUnitLicences
,
BaseUnitLicenceDto
.
class
));
// 5.3工商信息
// 5.3工商信息
model
.
setRegUnitIc
(
Bean
.
toModel
(
regUnitIc
,
new
RegUnitIcDto
()));
model
.
setRegUnitIc
(
Bean
.
toModel
(
regUnitIc
,
new
RegUnitIcDto
()));
//获取多线程执行结果 true成功 false失败
if
(!
future
.
get
().
getResult
()){
throw
new
Exception
(
"UGP信息同步失败"
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
// 失败后回滚:删除已经创建的企业信息
// 失败后回滚:删除已经创建的企业信息
...
@@ -180,6 +217,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -180,6 +217,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
return
model
;
return
model
;
}
}
public
void
createBaseEnterpriseInfo
(
RegUnitInfoDto
regUnitInfo
)
{
public
void
createBaseEnterpriseInfo
(
RegUnitInfoDto
regUnitInfo
)
{
// 1.查询管辖公司的信息
// 1.查询管辖公司的信息
FeignClientResult
<
CompanyModel
>
feignClientResult
=
Privilege
.
companyClient
FeignClientResult
<
CompanyModel
>
feignClientResult
=
Privilege
.
companyClient
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/OrgEnum.java
View file @
c9e2b923
...
@@ -9,19 +9,19 @@ import java.util.HashMap;
...
@@ -9,19 +9,19 @@ import java.util.HashMap;
@Getter
@Getter
@AllArgsConstructor
@AllArgsConstructor
public
enum
OrgEnum
{
public
enum
OrgEnum
{
公司
(
"COMPANY"
,
"244"
,
"公司"
,
1
,
"studio_normalapp_4403119"
),
公司
(
"COMPANY"
,
"244"
,
"公司"
,
1
,
"studio_normalapp_4403119"
,
""
),
部门
(
"DEPARTMENT"
,
"245"
,
"部门"
,
2
,
"studio_normalapp_4403119"
),
部门
(
"DEPARTMENT"
,
"245"
,
"部门"
,
2
,
"studio_normalapp_4403119"
,
""
),
普通人员
(
"PERSON"
,
"246"
,
"普通人员"
,
3
,
"studio_normalapp_4403119"
),
普通人员
(
"PERSON"
,
"246"
,
"普通人员"
,
3
,
"studio_normalapp_4403119"
,
""
),
焊工
(
"WELDER"
,
"247"
,
"焊工"
,
3
,
"studio_normalapp_4403119"
),
焊工
(
"WELDER"
,
"247"
,
"焊工"
,
3
,
"studio_normalapp_4403119"
,
""
),
管理员
(
"USER"
,
"945"
,
"管理员"
,
3
,
"ddd"
),
管理员
(
"USER"
,
"945"
,
"管理员"
,
3
,
"ddd"
,
""
),
建设单位负责人
(
"CHARGE"
,
"254"
,
"建设单位负责人"
,
3
,
"studio_normalapp_4403119"
),
建设单位负责人
(
"CHARGE"
,
"254"
,
"建设单位负责人"
,
3
,
"studio_normalapp_4403119"
,
""
),
企业管理员
(
"ADMIN"
,
"248"
,
"企业管理员"
,
3
,
"studio_normalapp_4403119"
),
企业管理员
(
"ADMIN"
,
"248"
,
"企业管理员"
,
3
,
"studio_normalapp_4403119"
,
""
),
建设单位
(
"CONSTRUCTION"
,
"249"
,
"建设单位"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4760213"
),
建设单位
(
"CONSTRUCTION"
,
"249"
,
"建设单位"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4760213"
,
"1232"
),
安装单位
(
"INSTALL"
,
"250"
,
"安装单位"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4760213"
),
安装单位
(
"INSTALL"
,
"250"
,
"安装单位"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4760213"
,
"1234"
),
设计单位
(
"DESIGN"
,
"251"
,
"设计单位"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4760213"
),
设计单位
(
"DESIGN"
,
"251"
,
"设计单位"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4760213"
,
"1235"
),
监察部门
(
"SUPERVISION"
,
"252"
,
"监察部门"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4761616"
),
监察部门
(
"SUPERVISION"
,
"252"
,
"监察部门"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4761616"
,
""
),
监检机构
(
"MONITORING"
,
"253"
,
"监检机构"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4761616"
),
监检机构
(
"MONITORING"
,
"253"
,
"监检机构"
,
1
,
"studio_normalapp_4403119,studio_normalapp_4761616"
,
"1233"
),
监理单位
(
"SUPERVISOR"
,
"254"
,
"监理单位"
,
1
,
""
);
监理单位
(
"SUPERVISOR"
,
"254"
,
"监理单位"
,
1
,
""
,
"1237"
);
private
String
key
;
private
String
key
;
private
String
code
;
private
String
code
;
...
@@ -31,13 +31,20 @@ public enum OrgEnum {
...
@@ -31,13 +31,20 @@ public enum OrgEnum {
*/
*/
private
Integer
type
;
private
Integer
type
;
private
String
appCode
;
private
String
appCode
;
/**
* tzs服务字典对应code
*/
private
String
dictionaryCode
;
public
static
HashMap
<
String
,
String
>
map
=
new
HashMap
();
public
static
HashMap
<
String
,
String
>
map
=
new
HashMap
();
public
static
HashMap
<
String
,
String
>
codeMap
=
new
HashMap
();
public
static
HashMap
<
String
,
String
>
codeMap
=
new
HashMap
();
public
static
HashMap
<
String
,
String
>
dictionaryCodeMap
=
new
HashMap
();
static
{
static
{
for
(
OrgEnum
orgPersonEnum:
OrgEnum
.
values
()){
for
(
OrgEnum
orgPersonEnum:
OrgEnum
.
values
()){
map
.
put
(
orgPersonEnum
.
getKey
(),
orgPersonEnum
.
getName
());
map
.
put
(
orgPersonEnum
.
getKey
(),
orgPersonEnum
.
getName
());
codeMap
.
put
(
orgPersonEnum
.
getKey
(),
orgPersonEnum
.
getAppCode
());
codeMap
.
put
(
orgPersonEnum
.
getKey
(),
orgPersonEnum
.
getAppCode
());
dictionaryCodeMap
.
put
(
orgPersonEnum
.
getDictionaryCode
(),
orgPersonEnum
.
getKey
());
}
}
}
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java
View file @
c9e2b923
...
@@ -106,6 +106,26 @@ public class CompanyController extends BaseController {
...
@@ -106,6 +106,26 @@ public class CompanyController extends BaseController {
@Autowired
@Autowired
SuperviseRuleServiceImpl
superviseRuleService
;
SuperviseRuleServiceImpl
superviseRuleService
;
/**
* tzs注册时同步ugp库
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/syncCompany"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"tzs注册时同步ugp库"
,
notes
=
"tzs注册时同步ugp库"
)
public
ResponseModel
<
Boolean
>
syncCompany
(
@RequestBody
Object
object
)
{
Boolean
bool
=
true
;
try
{
companyServiceImpl
.
syncCompany
(
object
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
bool
=
false
;
}
return
ResponseHelper
.
buildResponse
(
bool
);
}
/**
/**
* 新增企业信息表
* 新增企业信息表
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
View file @
c9e2b923
This diff is collapsed.
Click to expand it.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
View file @
c9e2b923
...
@@ -249,7 +249,11 @@ public class OrgServiceImpl {
...
@@ -249,7 +249,11 @@ public class OrgServiceImpl {
* 用户单位信息redis获取
* 用户单位信息redis获取
**/
**/
public
ReginParams
getReginParams
()
{
public
ReginParams
getReginParams
()
{
return
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
try
{
return
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
}
catch
(
Exception
e
)
{
return
null
;
}
}
}
/**
/**
...
@@ -542,7 +546,16 @@ public class OrgServiceImpl {
...
@@ -542,7 +546,16 @@ public class OrgServiceImpl {
orgUsrServiceImpl
.
deleteBySeq
(
Long
.
valueOf
(
sequencenNbr
));
orgUsrServiceImpl
.
deleteBySeq
(
Long
.
valueOf
(
sequencenNbr
));
}
}
/**
* 根据OrgUsr表的bizOrgName 查询
* @param bizOrgName
* @return
*/
public
OrgUsr
getInfoByName
(
String
bizOrgName
)
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getBizOrgName
,
bizOrgName
);
return
orgUsrServiceImpl
.
getOne
(
wrapper
);
}
/**
/**
...
...
amos-boot-system-ugp/pom.xml
View file @
c9e2b923
...
@@ -24,6 +24,11 @@
...
@@ -24,6 +24,11 @@
<artifactId>
amos-feign-workflow
</artifactId>
<artifactId>
amos-feign-workflow
</artifactId>
<version>
1.7.9-SNAPSHOT
</version>
<version>
1.7.9-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-privilege
</artifactId>
<version>
1.8.5-SNAPSHOT
</version>
</dependency>
<dependency>
<dependency>
<groupId>
fakepath
</groupId>
<groupId>
fakepath
</groupId>
...
...
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