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
1f661eca
Commit
1f661eca
authored
Oct 27, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
e5195ea4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
15 deletions
+78
-15
TzsTwoStaffingMapper.java
...amos/boot/module/tcm/api/mapper/TzsTwoStaffingMapper.java
+1
-1
ITzsTwoStaffingService.java
...s/boot/module/tcm/api/service/ITzsTwoStaffingService.java
+1
-1
TzsTwoStaffingMapper.xml
...cm-api/src/main/resources/mapper/TzsTwoStaffingMapper.xml
+12
-0
TzsTwoStaffingController.java
...t/module/tcm/biz/controller/TzsTwoStaffingController.java
+6
-4
TzsTwoStaffingServiceImpl.java
...odule/tcm/biz/service/impl/TzsTwoStaffingServiceImpl.java
+58
-9
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 @
1f661eca
...
...
@@ -19,5 +19,5 @@ public interface TzsTwoStaffingMapper extends BaseMapper<TzsTwoStaffing> {
Page
<
TzsTwoStaffingCompanyDto
>
getCompanyList
(
@Param
(
"page"
)
Page
<
TzsTwoStaffingCompanyDto
>
page
,
@Param
(
"companyDto"
)
TzsTwoStaffingCompanyDto
companyDto
,
@Param
(
"orgCode"
)
String
orgCode
);
List
<
TzsTwoStaffing
>
getListByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"type"
)
String
type
);
List
<
TzsTwoStaffing
>
getListByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"type"
)
String
type
,
@Param
(
"level"
)
String
level
);
}
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 @
1f661eca
...
...
@@ -19,6 +19,6 @@ import java.util.List;
*/
public
interface
ITzsTwoStaffingService
{
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
);
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
,
String
type
,
String
level
);
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 @
1f661eca
...
...
@@ -28,5 +28,17 @@
</select>
<select
id=
"getListByOrgCode"
resultType=
"com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing"
>
select *
from tzs_two_staffing
where is_delete = 0
<if
test=
"orgCode != '' and orgCode != null"
>
and supervisory_unit_orgcode like concat('%',#{orgCode},'%')
</if>
<if
test=
"type != '' and type != null"
>
and unit_type = #{type}
</if>
<if
test=
"level != '' and level != null"
>
and supervisory_unit_level = #{type}
</if>
</select>
</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 @
1f661eca
...
...
@@ -71,13 +71,15 @@ public class TzsTwoStaffingController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过组id查询组及组内人员信息"
,
notes
=
"通过组id查询组及组内人员信息"
)
public
ResponseModel
<
Object
>
getGroupAndPersonInfo
(
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
)
{
@GetMapping
(
value
=
"/getStatisticsMessage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"监管单位统计信息"
,
notes
=
"监管单位统计信息"
)
public
ResponseModel
<
Object
>
getGroupAndPersonInfo
(
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"level"
)
String
level
)
{
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
));
return
ResponseHelper
.
buildResponse
(
tzsTwoStaffingService
.
getStatisticsMessage
(
list
,
type
,
level
));
}
}
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 @
1f661eca
...
...
@@ -46,18 +46,67 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz
}
@Override
public
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
)
{
ArrayList
<
TzsTwoStaffing
>
tzsTwoStaffings
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
supervisory
=
treeToList
(
new
ArrayList
<>(),
list
);
for
(
LinkedHashMap
map
:
supervisory
)
{
public
List
<
TzsTwoStaffing
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
,
String
type
,
String
level
)
{
// 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
;
if
(!
ObjectUtils
.
isEmpty
(
list
)
&&
!
ObjectUtils
.
isEmpty
(
list
.
get
(
0
)))
{
orgCode
=
String
.
valueOf
(
list
.
get
(
0
).
get
(
"orgCode"
));
}
if
(!
ObjectUtils
.
isEmpty
(
orgCode
))
{
List
<
TzsTwoStaffing
>
listByOrgCode
=
this
.
getBaseMapper
().
getListByOrgCode
(
orgCode
,
type
,
level
);
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"
)));
tzsTwoStaffing
.
setSupervisoryUnitName
(
"汇总"
);
listByOrgCode
.
stream
().
forEach
(
item
->
{
tzsTwoStaffing
.
setNumberOfUnits
(!
ObjectUtils
.
isEmpty
(
tzsTwoStaffing
.
getNumberOfUnits
())
?
tzsTwoStaffing
.
getNumberOfUnits
()
:
0
);
tzsTwoStaffing
.
setNumberOfCompletedUnits
(
item
.
getNumberOfCompletedUnits
()
+
(!
ObjectUtils
.
isEmpty
(
tzsTwoStaffing
.
getNumberOfCompletedUnits
())
?
tzsTwoStaffing
.
getNumberOfCompletedUnits
()
:
0
));
tzsTwoStaffing
.
setResponsibleUnitsAllocateNumber
(
item
.
getResponsibleUnitsAllocateNumber
()
+
(!
ObjectUtils
.
isEmpty
(
tzsTwoStaffing
.
getResponsibleUnitsAllocateNumber
())
?
tzsTwoStaffing
.
getResponsibleUnitsAllocateNumber
()
:
0
));
});
if
(
ObjectUtils
.
isEmpty
(
tzsTwoStaffing
.
getNumberOfCompletedUnits
())
||
ObjectUtils
.
isEmpty
(
tzsTwoStaffing
.
getNumberOfUnits
())
||
tzsTwoStaffing
.
getNumberOfUnits
()
==
0
||
tzsTwoStaffing
.
getNumberOfCompletedUnits
()
==
0
)
{
tzsTwoStaffing
.
setCompletionRatio
(
"0"
);
}
else
{
tzsTwoStaffing
.
setCompletionRatio
(
String
.
valueOf
(
tzsTwoStaffing
.
getNumberOfCompletedUnits
()
/
tzsTwoStaffing
.
getNumberOfUnits
()));
tzsTwoStaffings
.
add
(
tzsTwoStaffing
);
}
if
(
ObjectUtils
.
isEmpty
(
tzsTwoStaffing
.
getResponsiblePersonsNumber
())
||
tzsTwoStaffing
.
getResponsiblePersonsNumber
()
==
0
||
ObjectUtils
.
isEmpty
(
tzsTwoStaffing
.
getNumberOfUnits
())
||
tzsTwoStaffing
.
getNumberOfUnits
()
==
0
)
{
tzsTwoStaffing
.
setProportion
(
"0"
);
}
else
{
tzsTwoStaffing
.
setProportion
(
String
.
valueOf
(
tzsTwoStaffing
.
getResponsiblePersonsNumber
()
/
tzsTwoStaffing
.
getNumberOfUnits
()));
}
listByOrgCode
.
add
(
tzsTwoStaffing
);
return
listByOrgCode
;
}
return
tzsTwoStaffings
;
return
null
;
}
private
List
<
LinkedHashMap
>
treeToList
(
List
<
LinkedHashMap
>
result
,
List
<
LinkedHashMap
>
list
){
...
...
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