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
ccd69ce1
Commit
ccd69ce1
authored
Oct 30, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改监管单位统计接口
parent
1f661eca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
35 deletions
+43
-35
SupervisoryEnum.java
...ejoin/amos/boot/module/tcm/api/enums/SupervisoryEnum.java
+33
-0
ITzsTwoStaffingService.java
...s/boot/module/tcm/api/service/ITzsTwoStaffingService.java
+1
-1
TzsTwoStaffingMapper.xml
...cm-api/src/main/resources/mapper/TzsTwoStaffingMapper.xml
+1
-1
TzsTwoStaffingController.java
...t/module/tcm/biz/controller/TzsTwoStaffingController.java
+2
-3
TzsTwoStaffingServiceImpl.java
...odule/tcm/biz/service/impl/TzsTwoStaffingServiceImpl.java
+6
-30
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/enums/SupervisoryEnum.java
0 → 100644
View file @
ccd69ce1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@AllArgsConstructor
@Getter
public
enum
SupervisoryEnum
{
/**
* 监管单位层级
*/
// 省
PROVINCE
(
"headquarter"
,
"prefecture-level"
),
// 市
CITY
(
"prefecture-level"
,
"county"
),
// 区县
DISTRICT
(
"county"
,
"organization"
),
// 所
PLACE
(
"organization"
,
"organization"
);
String
level
;
String
nextLevel
;
public
static
SupervisoryEnum
getEnumByLevel
(
String
level
)
{
for
(
SupervisoryEnum
value
:
SupervisoryEnum
.
values
())
{
if
(
value
.
getLevel
().
equals
(
level
))
{
return
value
;
}
}
return
null
;
}
}
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 @
ccd69ce1
...
@@ -19,6 +19,6 @@ import java.util.List;
...
@@ -19,6 +19,6 @@ import java.util.List;
*/
*/
public
interface
ITzsTwoStaffingService
{
public
interface
ITzsTwoStaffingService
{
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
,
String
type
,
String
level
);
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
,
String
type
);
Page
<
TzsTwoStaffingCompanyDto
>
getCompanyList
(
String
orgCode
,
TzsTwoStaffingCompanyDto
companyDto
,
Page
<
TzsTwoStaffingCompanyDto
>
page
);
Page
<
TzsTwoStaffingCompanyDto
>
getCompanyList
(
String
orgCode
,
TzsTwoStaffingCompanyDto
companyDto
,
Page
<
TzsTwoStaffingCompanyDto
>
page
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzsTwoStaffingMapper.xml
View file @
ccd69ce1
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
and unit_type = #{type}
and unit_type = #{type}
</if>
</if>
<if
test=
"level != '' and level != null"
>
<if
test=
"level != '' and level != null"
>
and supervisory_unit_level = #{
type
}
and supervisory_unit_level = #{
level
}
</if>
</if>
</select>
</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 @
ccd69ce1
...
@@ -74,12 +74,11 @@ public class TzsTwoStaffingController extends BaseController {
...
@@ -74,12 +74,11 @@ public class TzsTwoStaffingController extends BaseController {
@GetMapping
(
value
=
"/getStatisticsMessage"
)
@GetMapping
(
value
=
"/getStatisticsMessage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"监管单位统计信息"
,
notes
=
"监管单位统计信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"监管单位统计信息"
,
notes
=
"监管单位统计信息"
)
public
ResponseModel
<
Object
>
getGroupAndPersonInfo
(
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
public
ResponseModel
<
Object
>
getGroupAndPersonInfo
(
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"type"
)
String
type
)
{
@RequestParam
(
"level"
)
String
level
)
{
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
<>();
List
<
LinkedHashMap
>
list
=
tzsUserInfoServiceImpl
.
screenData
(
result
,
data
,
sequenceNbr
);
List
<
LinkedHashMap
>
list
=
tzsUserInfoServiceImpl
.
screenData
(
result
,
data
,
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
tzsTwoStaffingService
.
getStatisticsMessage
(
list
,
type
,
level
));
return
ResponseHelper
.
buildResponse
(
tzsTwoStaffingService
.
getStatisticsMessage
(
list
,
type
));
}
}
}
}
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 @
ccd69ce1
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.biz.service.impl;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.biz.service.impl;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing
;
import
com.yeejoin.amos.boot.module.tcm.api.enums.SupervisoryEnum
;
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
;
...
@@ -46,41 +47,16 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz
...
@@ -46,41 +47,16 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz
}
}
@Override
@Override
public
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
,
String
type
,
String
level
)
{
public
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
,
String
type
)
{
// 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")));
// List<TzsTwoStaffing> listByOrgCode = this.getBaseMapper().getListByOrgCode(String.valueOf(list.get(0).get("orgCode")), type, level);
// tzsTwoStaffing.setNumberOfUnits(listByOrgCode.size());
// if (!ObjectUtils.isEmpty(listByOrgCode)){
// listByOrgCode.stream().forEach(item ->{
// tzsTwoStaffing.setNumberOfCompletedUnits(tzsTwoStaffing.getNumberOfCompletedUnits() + item.getNumberOfCompletedUnits());
// tzsTwoStaffing.setCompletionRatio(tzsTwoStaffing.getCompletionRatio() + item.getCompletionRatio());
// tzsTwoStaffing.setResponsibleUnitsAllocateNumber(tzsTwoStaffing.getResponsibleUnitsAllocateNumber() + item.getResponsibleUnitsAllocateNumber());
// tzsTwoStaffing.setProportion("0");
// });
// }else {
// tzsTwoStaffing.setNumberOfCompletedUnits(0);
// tzsTwoStaffing.setCompletionRatio("0");
// tzsTwoStaffing.setResponsibleUnitsAllocateNumber(0);
// tzsTwoStaffing.setProportion("0");
// }
// tzsTwoStaffing.setResponsiblePersonsNumber(0);
// tzsTwoStaffing.setSafetyDirectorsNumber(0);
// tzsTwoStaffing.setSafetyOfficersNumber(0);
// tzsTwoStaffings.add(tzsTwoStaffing);
// }
// return tzsTwoStaffings;
String
orgCode
=
null
;
String
orgCode
=
null
;
String
nextLevel
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
list
)
&&
!
ObjectUtils
.
isEmpty
(
list
.
get
(
0
)))
{
if
(!
ObjectUtils
.
isEmpty
(
list
)
&&
!
ObjectUtils
.
isEmpty
(
list
.
get
(
0
)))
{
orgCode
=
String
.
valueOf
(
list
.
get
(
0
).
get
(
"orgCode"
));
orgCode
=
String
.
valueOf
(
list
.
get
(
0
).
get
(
"orgCode"
));
SupervisoryEnum
enumByLevel
=
SupervisoryEnum
.
getEnumByLevel
(
String
.
valueOf
(
list
.
get
(
0
).
get
(
"level"
)));
nextLevel
=
!
ObjectUtils
.
isEmpty
(
enumByLevel
)
?
enumByLevel
.
getNextLevel
()
:
null
;
}
}
if
(!
ObjectUtils
.
isEmpty
(
orgCode
))
{
if
(!
ObjectUtils
.
isEmpty
(
orgCode
))
{
List
<
TzsTwoStaffing
>
listByOrgCode
=
this
.
getBaseMapper
().
getListByOrgCode
(
orgCode
,
type
,
l
evel
);
List
<
TzsTwoStaffing
>
listByOrgCode
=
this
.
getBaseMapper
().
getListByOrgCode
(
orgCode
,
type
,
nextL
evel
);
TzsTwoStaffing
tzsTwoStaffing
=
new
TzsTwoStaffing
();
TzsTwoStaffing
tzsTwoStaffing
=
new
TzsTwoStaffing
();
tzsTwoStaffing
.
setSupervisoryUnitName
(
"汇总"
);
tzsTwoStaffing
.
setSupervisoryUnitName
(
"汇总"
);
listByOrgCode
.
stream
().
forEach
(
item
->
{
listByOrgCode
.
stream
().
forEach
(
item
->
{
...
...
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