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
6b672855
Commit
6b672855
authored
Oct 27, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
c07939bc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
103 additions
and
21 deletions
+103
-21
TzsTwoStaffingMapper.java
...amos/boot/module/tcm/api/mapper/TzsTwoStaffingMapper.java
+4
-0
ITzsTwoStaffingService.java
...s/boot/module/tcm/api/service/ITzsTwoStaffingService.java
+6
-0
TzsTwoStaffingMapper.xml
...cm-api/src/main/resources/mapper/TzsTwoStaffingMapper.xml
+3
-0
TzsTwoStaffingController.java
...t/module/tcm/biz/controller/TzsTwoStaffingController.java
+37
-0
TzsUserInfoController.java
...boot/module/tcm/biz/controller/TzsUserInfoController.java
+2
-21
TzsTwoStaffingServiceImpl.java
...odule/tcm/biz/service/impl/TzsTwoStaffingServiceImpl.java
+30
-0
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+21
-0
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/mapper/TzsTwoStaffingMapper.java
View file @
6b672855
...
@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper;
...
@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* Mapper 接口
* Mapper 接口
...
@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
TzsTwoStaffingMapper
extends
BaseMapper
<
TzsTwoStaffing
>
{
public
interface
TzsTwoStaffingMapper
extends
BaseMapper
<
TzsTwoStaffing
>
{
List
<
TzsTwoStaffing
>
getListByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"type"
)
String
type
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/ITzsTwoStaffingService.java
View file @
6b672855
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
api
.
service
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
/**
/**
* 接口类
* 接口类
*
*
...
@@ -9,4 +14,5 @@ package com.yeejoin.amos.boot.module.tcm.api.service;
...
@@ -9,4 +14,5 @@ package com.yeejoin.amos.boot.module.tcm.api.service;
*/
*/
public
interface
ITzsTwoStaffingService
{
public
interface
ITzsTwoStaffingService
{
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzsTwoStaffingMapper.xml
View file @
6b672855
...
@@ -2,4 +2,7 @@
...
@@ -2,4 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper"
>
<select
id=
"getListByOrgCode"
resultType=
"com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing"
>
</select>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzsTwoStaffingController.java
View file @
6b672855
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
@RestController
@RestController
@Api
(
tags
=
"统计"
)
@Api
(
tags
=
"统计"
)
...
@@ -15,4 +33,23 @@ public class TzsTwoStaffingController extends BaseController {
...
@@ -15,4 +33,23 @@ public class TzsTwoStaffingController extends BaseController {
@Autowired
@Autowired
private
ITzsTwoStaffingService
tzsTwoStaffingService
;
private
ITzsTwoStaffingService
tzsTwoStaffingService
;
private
static
final
String
REGULATOR_UNIT_TREE
=
"REGULATOR_UNIT_TREE"
;
@Autowired
private
TzsUserInfoServiceImpl
tzsUserInfoServiceImpl
;
@Autowired
RedisUtils
redisUtils
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过组id查询组及组内人员信息"
,
notes
=
"通过组id查询组及组内人员信息"
)
public
ResponseModel
<
Object
>
getGroupAndPersonInfo
(
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
)
{
List
<
LinkedHashMap
>
data
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
REGULATOR_UNIT_TREE
);
ArrayList
<
LinkedHashMap
>
result
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
list
=
tzsUserInfoServiceImpl
.
screenData
(
result
,
data
,
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
tzsTwoStaffingService
.
getStatisticsMessage
(
list
));
}
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzsUserInfoController.java
View file @
6b672855
...
@@ -330,7 +330,7 @@ public class TzsUserInfoController extends BaseController {
...
@@ -330,7 +330,7 @@ public class TzsUserInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getTree"
)
@GetMapping
(
value
=
"/getTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
通过组id查询组及组内人员信息"
,
notes
=
"通过组id查询组及组内人员信息
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
根据当前登录人获取监管机构"
,
notes
=
"根据当前登录人获取监管机构
"
)
public
ResponseModel
<
Object
>
getGroupAndPersonInfo
()
{
public
ResponseModel
<
Object
>
getGroupAndPersonInfo
()
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
...
@@ -339,27 +339,8 @@ public class TzsUserInfoController extends BaseController {
...
@@ -339,27 +339,8 @@ public class TzsUserInfoController extends BaseController {
Long
id
=
reginParams
.
getCompany
().
getSequenceNbr
();
Long
id
=
reginParams
.
getCompany
().
getSequenceNbr
();
List
<
LinkedHashMap
>
data
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
REGULATOR_UNIT_TREE
);
List
<
LinkedHashMap
>
data
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
REGULATOR_UNIT_TREE
);
ArrayList
<
LinkedHashMap
>
result
=
new
ArrayList
<>();
ArrayList
<
LinkedHashMap
>
result
=
new
ArrayList
<>();
return
ResponseHelper
.
buildResponse
(
screenData
(
result
,
data
,
id
.
toString
()));
return
ResponseHelper
.
buildResponse
(
tzsUserInfoServiceImpl
.
screenData
(
result
,
data
,
id
.
toString
()));
}
}
private
List
<
LinkedHashMap
>
screenData
(
List
<
LinkedHashMap
>
result
,
List
<
LinkedHashMap
>
data
,
String
id
)
{
if
(!
ObjectUtils
.
isEmpty
(
result
))
{
return
result
;
}
List
<
LinkedHashMap
>
list
=
data
.
stream
().
filter
(
item
->
item
.
get
(
"sequenceNbr"
).
toString
().
equals
(
id
)).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
return
list
;
}
for
(
LinkedHashMap
item
:
data
)
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
get
(
"children"
)))
{
List
<
LinkedHashMap
>
children
=
screenData
(
result
,
(
List
<
LinkedHashMap
>)
item
.
get
(
"children"
),
id
);
if
(!
ObjectUtils
.
isEmpty
(
children
))
{
result
=
children
;
break
;
}
}
}
return
result
;
}
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzsTwoStaffingServiceImpl.java
View file @
6b672855
...
@@ -4,9 +4,14 @@ import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing;
...
@@ -4,9 +4,14 @@ import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -30,4 +35,28 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto,Tzs
...
@@ -30,4 +35,28 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto,Tzs
public
List
<
TzsTwoStaffingDto
>
queryForTzsTwoStaffingList
()
{
public
List
<
TzsTwoStaffingDto
>
queryForTzsTwoStaffingList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
}
@Override
public
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
)
{
ArrayList
<
TzsTwoStaffing
>
tzsTwoStaffings
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
supervisory
=
treeToList
(
new
ArrayList
<>(),
list
);
for
(
LinkedHashMap
map
:
supervisory
)
{
TzsTwoStaffing
tzsTwoStaffing
=
new
TzsTwoStaffing
();
tzsTwoStaffing
.
setSupervisoryUnitId
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
)));
tzsTwoStaffing
.
setSupervisoryUnitName
(
String
.
valueOf
(
map
.
get
(
"companyName"
)));
tzsTwoStaffing
.
setSupervisoryUnitOrgcode
(
String
.
valueOf
(
map
.
get
(
"orgCode"
)));
tzsTwoStaffings
.
add
(
tzsTwoStaffing
);
}
return
tzsTwoStaffings
;
}
private
List
<
LinkedHashMap
>
treeToList
(
List
<
LinkedHashMap
>
result
,
List
<
LinkedHashMap
>
list
){
if
(!
ObjectUtils
.
isEmpty
(
list
)
&&
!
ObjectUtils
.
isEmpty
(
list
.
get
(
0
).
get
(
"children"
))){
result
.
addAll
((
List
<
LinkedHashMap
>)
list
.
get
(
0
).
get
(
"children"
));
}
else
{
result
.
add
(
list
.
get
(
0
));
}
return
result
;
}
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
View file @
6b672855
...
@@ -524,4 +524,25 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
...
@@ -524,4 +524,25 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
}
}
}
public
List
<
LinkedHashMap
>
screenData
(
List
<
LinkedHashMap
>
result
,
List
<
LinkedHashMap
>
data
,
String
id
)
{
if
(!
ObjectUtils
.
isEmpty
(
result
))
{
return
result
;
}
List
<
LinkedHashMap
>
list
=
data
.
stream
().
filter
(
item
->
item
.
get
(
"sequenceNbr"
).
toString
().
equals
(
id
)).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
return
list
;
}
for
(
LinkedHashMap
item
:
data
)
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
get
(
"children"
)))
{
List
<
LinkedHashMap
>
children
=
screenData
(
result
,
(
List
<
LinkedHashMap
>)
item
.
get
(
"children"
),
id
);
if
(!
ObjectUtils
.
isEmpty
(
children
))
{
result
=
children
;
break
;
}
}
}
return
result
;
}
}
}
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