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
3db29f37
Commit
3db29f37
authored
Aug 11, 2022
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,树过滤不对
parent
73180c07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
11 deletions
+37
-11
IRegUnitInfoService.java
.../boot/module/tzs/flc/api/service/IRegUnitInfoService.java
+1
-1
RegUnitInfoController.java
.../module/tzs/flc/biz/controller/RegUnitInfoController.java
+2
-2
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+34
-8
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IRegUnitInfoService.java
View file @
3db29f37
...
@@ -42,7 +42,7 @@ public interface IRegUnitInfoService {
...
@@ -42,7 +42,7 @@ public interface IRegUnitInfoService {
* 获取管辖机构树
* 获取管辖机构树
* @return 组织架构中单位级别为:省级、地市级、区县级的单位
* @return 组织架构中单位级别为:省级、地市级、区县级的单位
*/
*/
Collection
<
CompanyModel
>
getManagementUnitTree
();
Collection
getManagementUnitTree
();
/**
/**
* 单位注销
* 单位注销
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/RegUnitInfoController.java
View file @
3db29f37
...
@@ -84,8 +84,8 @@ public class RegUnitInfoController extends BaseController {
...
@@ -84,8 +84,8 @@ public class RegUnitInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/management-unit/tree"
)
@GetMapping
(
value
=
"/management-unit/tree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"管辖机构树"
,
notes
=
"管辖机构树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"管辖机构树"
,
notes
=
"管辖机构树"
)
public
ResponseModel
<
Collection
<
CompanyModel
>
>
managementUnitTree
()
{
public
ResponseModel
<
Collection
>
managementUnitTree
()
{
Collection
<
CompanyModel
>
result
=
iRegUnitInfoService
.
getManagementUnitTree
();
Collection
result
=
iRegUnitInfoService
.
getManagementUnitTree
();
return
ResponseHelper
.
buildResponse
(
result
);
return
ResponseHelper
.
buildResponse
(
result
);
}
}
...
...
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 @
3db29f37
...
@@ -32,6 +32,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -32,6 +32,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
@@ -66,6 +67,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -66,6 +67,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Autowired
@Autowired
TzBaseEnterpriseInfoServiceImpl
tzBaseEnterpriseInfoService
;
TzBaseEnterpriseInfoServiceImpl
tzBaseEnterpriseInfoService
;
@Autowired
RestTemplate
restTemplate
;
/**
/**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1232
* 使用单位的类型,数据来源:cb_data_dictionary code = 1232
*/
*/
...
@@ -158,7 +162,18 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -158,7 +162,18 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
if
(
USE_UNIT_TYPE_CODE
.
equals
(
unitType
))
{
if
(
USE_UNIT_TYPE_CODE
.
equals
(
unitType
))
{
// 2.1 使用单位调用行政许可系统接口进行查询工商信息
// 2.1 使用单位调用行政许可系统接口进行查询工商信息
// MultiValueMap<String, String> headers = new HttpHeaders();
// headers.add("header-1","v1");
// headers.add("header-2","v2");
// RequestEntity requestEntity = new RequestEntity(
// null, //body部分数据
// headers, //头
// HttpMethod.GET,//请求方法
// URI.create("url"));
// ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(requestEntity,JSONObject.class);
// JSONObject result = responseEntity.getBody();
// 2.2 工商信息组装
// 2.2 工商信息组装
// regUnitInfoDto.setRegUnitIc();
}
else
{
}
else
{
RegUnitIc
regUnitIc
=
regUnitIcService
.
getOne
(
new
LambdaQueryWrapper
<
RegUnitIc
>().
eq
(
RegUnitIc:
:
getUnitCode
,
unitCode
));
RegUnitIc
regUnitIc
=
regUnitIcService
.
getOne
(
new
LambdaQueryWrapper
<
RegUnitIc
>().
eq
(
RegUnitIc:
:
getUnitCode
,
unitCode
));
regUnitInfoDto
.
setRegUnitIc
(
Bean
.
toModel
(
regUnitIc
,
new
RegUnitIcDto
()));
regUnitInfoDto
.
setRegUnitIc
(
Bean
.
toModel
(
regUnitIc
,
new
RegUnitIcDto
()));
...
@@ -175,12 +190,10 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -175,12 +190,10 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
}
}
@Override
@Override
public
Collection
<
CompanyModel
>
getManagementUnitTree
()
{
public
Collection
getManagementUnitTree
()
{
// 组织架构中单位级别为:省级、地市级、区县级的单位
// 组织架构中单位级别为:省级、地市级、区县级的单位
Collection
<
CompanyModel
>
companyModels
=
Privilege
.
companyClient
.
companyTreeWithoutAuth
().
getResult
();
Collection
<
CompanyModel
>
companyModels
=
Privilege
.
companyClient
.
companyTreeWithoutAuth
().
getResult
();
return
companyModels
.
stream
().
filter
(
c
->
"headquarter"
.
equals
(
c
.
getLevel
())
||
"prefecture-level"
.
equals
(
c
.
getLevel
())
||
"county"
.
equals
(
c
.
getLevel
())).
peek
(
n
->
{
return
companyModels
.
stream
().
filter
(
c
->
"headquarter"
.
equals
(
c
.
getLevel
())
||
"prefecture-level"
.
equals
(
c
.
getLevel
())
||
"county"
.
equals
(
c
.
getLevel
())).
map
(
this
::
dealChildCompany
).
collect
(
Collectors
.
toList
());
this
.
dealChildCompany
(
n
.
getChildren
());
}).
collect
(
Collectors
.
toList
());
}
}
@Override
@Override
...
@@ -213,13 +226,26 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -213,13 +226,26 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
private
void
dealChildCompany
(
Collection
children
)
{
private
CompanyModel
dealChildCompany
(
CompanyModel
cm
)
{
children
.
stream
().
filter
(
n
->
{
cm
.
setChildren
(
this
.
getFilterChild
(
cm
.
getChildren
()));
cm
.
getChildren
().
stream
().
filter
(
n
->
{
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
n
),
CompanyModel
.
class
);
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
n
),
CompanyModel
.
class
);
return
"headquarter"
.
equals
(
c
.
getLevel
())
||
"prefecture-level"
.
equals
(
c
.
getLevel
())
||
"county"
.
equals
(
c
.
getLevel
());
return
"headquarter"
.
equals
(
c
.
getLevel
())
||
"prefecture-level"
.
equals
(
c
.
getLevel
())
||
"county"
.
equals
(
c
.
getLevel
());
}).
peek
(
n
->
{
}).
map
(
n
->
{
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
n
),
CompanyModel
.
class
);
return
dealChildCompany
(
c
);
}).
collect
(
Collectors
.
toList
());
return
cm
;
}
private
List
getFilterChild
(
Collection
children
)
{
return
(
List
)
children
.
stream
().
filter
(
n
->
{
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
n
),
CompanyModel
.
class
);
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
n
),
CompanyModel
.
class
);
dealChildCompany
(
c
.
getChildren
()
!=
null
?
new
ArrayList
()
:
c
.
getChildren
());
return
"headquarter"
.
equals
(
c
.
getLevel
())
||
"prefecture-level"
.
equals
(
c
.
getLevel
())
||
"county"
.
equals
(
c
.
getLevel
());
}).
map
(
s
->{
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
s
),
CompanyModel
.
class
);
c
.
setChildren
(
this
.
getFilterChild
(
c
.
getChildren
()
!=
null
?
c
.
getChildren
()
:
new
ArrayList
()));
return
c
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
...
...
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