Skip to content

Commit 8a605a8

Browse files
committed
优化代码
1 parent ade7cb4 commit 8a605a8

File tree

2 files changed

+37
-123
lines changed

2 files changed

+37
-123
lines changed

java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -416,70 +416,6 @@
416416
where b.floor_id = a.floor_id
417417
) feeRoomCount,
418418
(
419-
select ifnull(sum(t.received_amount),0.0) receivedFee
420-
from pay_fee_detail t
421-
INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
422-
LEFT JOIN building_room br on pf.payer_obj_id = br.room_id and br.status_cd = '0'
423-
left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
424-
where
425-
1=1
426-
and bu.floor_id = a.floor_id
427-
and t.status_cd = '0'
428-
and t.community_id= a.community_id
429-
and t.create_time > #{startDate}
430-
and t.create_time < #{endDate}
431-
<if test="configIds !=null ">
432-
and pf.config_id in
433-
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
434-
#{item}
435-
</foreach>
436-
</if>
437-
<if test="feeTypeCd != null and feeTypeCd != ''">
438-
and pf.fee_type_cd = #{feeTypeCd}
439-
</if>
440-
) receivedFee,
441-
(
442-
select ifnull(sum(t.received_amount),0.0) preReceivedFee
443-
from pay_fee_detail_month t
444-
where
445-
1=1
446-
and t.obj_fpc_id = a.floor_id
447-
and t.status_cd = '0'
448-
and t.community_id= a.community_id
449-
and t.pay_fee_time &gt; #{startDate}
450-
and t.pay_fee_time &lt; #{endDate}
451-
and t.cur_month_time &gt;= #{endDate}
452-
<if test="configIds !=null ">
453-
and t.config_id in
454-
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
455-
#{item}
456-
</foreach>
457-
</if>
458-
<if test="feeTypeCd != null and feeTypeCd != ''">
459-
and t.fee_type_cd = #{feeTypeCd}
460-
</if>
461-
) preReceivedFee,
462-
(
463-
select ifnull(sum(t.receivable_amount),0.0) hisOweFee
464-
from pay_fee_detail_month t
465-
where
466-
1=1
467-
and t.obj_fpc_id = a.floor_id
468-
and t.status_cd = '0'
469-
and t.community_id= a.community_id
470-
and t.detail_id = '-1'
471-
and t.cur_month_time &lt; #{startDate}
472-
<if test="configIds !=null ">
473-
and t.config_id in
474-
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
475-
#{item}
476-
</foreach>
477-
</if>
478-
<if test="feeTypeCd != null and feeTypeCd != ''">
479-
and t.fee_type_cd = #{feeTypeCd}
480-
</if>
481-
) hisOweFee,
482-
(
483419
select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
484420
from pay_fee_detail_month t
485421
where
@@ -519,29 +455,7 @@
519455
<if test="feeTypeCd != null and feeTypeCd != ''">
520456
and t.fee_type_cd = #{feeTypeCd}
521457
</if>
522-
) curReceivedFee,
523-
(
524-
select ifnull(sum(t.received_amount),0.0) hisReceivedFee
525-
from pay_fee_detail_month t
526-
where
527-
1=1
528-
and t.obj_fpc_id = a.floor_id
529-
and t.status_cd = '0'
530-
and t.community_id= a.community_id
531-
and t.pay_fee_time &gt; #{startDate}
532-
and t.pay_fee_time &lt; #{endDate}
533-
and t.cur_month_time &lt; #{startDate}
534-
and t.detail_id != '-1'
535-
<if test="configIds !=null ">
536-
and t.config_id in
537-
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
538-
#{item}
539-
</foreach>
540-
</if>
541-
<if test="feeTypeCd != null and feeTypeCd != ''">
542-
and t.fee_type_cd = #{feeTypeCd}
543-
</if>
544-
) hisReceivedFee
458+
) curReceivedFee
545459
from f_floor a
546460
where 1=1
547461
and a.status_cd = '0'

service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -63,45 +63,45 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso
6363
}
6464

6565
//todo 查询楼栋
66-
FloorDto floorDto = new FloorDto();
67-
floorDto.setCommunityId(reqJson.getString("communityId"));
68-
if(reqJson.containsKey("page")) {
69-
floorDto.setPage(reqJson.getIntValue("page"));
70-
floorDto.setRow(reqJson.getIntValue("row"));
71-
}
72-
List<FloorDto> floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto);
73-
74-
if (ListUtil.isNull(floorDtos)) {
75-
context.setResponseEntity(ResultVo.createResponseEntity(new ArrayList<>()));
76-
return;
77-
}
78-
79-
List<Map> datas = new ArrayList<>();
80-
Java110ThreadPoolFactory java110ThreadPoolFactory = null;
81-
try {
82-
java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(5);
83-
for (FloorDto floorDto1 : floorDtos) {
84-
queryStatisticsDto.setFloorId(floorDto1.getFloorId());
85-
QueryStatisticsDto tmpQueryStatisticsDto = BeanConvertUtil.covertBean(queryStatisticsDto,QueryStatisticsDto.class);
86-
java110ThreadPoolFactory.submit(() -> {
87-
//todo 欠费户数
88-
List<Map> floorDatas = feeStatisticsImpl.getFloorFeeSummary(tmpQueryStatisticsDto);
89-
if (!ListUtil.isNull(floorDatas)) {
90-
datas.add(floorDatas.get(0));
91-
}
92-
return datas;
93-
});
94-
}
95-
java110ThreadPoolFactory.get();
96-
} finally {
97-
if (java110ThreadPoolFactory != null) {
98-
java110ThreadPoolFactory.stop();
99-
}
100-
}
66+
// FloorDto floorDto = new FloorDto();
67+
// floorDto.setCommunityId(reqJson.getString("communityId"));
68+
// if(reqJson.containsKey("page")) {
69+
// floorDto.setPage(reqJson.getIntValue("page"));
70+
// floorDto.setRow(reqJson.getIntValue("row"));
71+
// }
72+
// List<FloorDto> floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto);
73+
//
74+
// if (ListUtil.isNull(floorDtos)) {
75+
// context.setResponseEntity(ResultVo.createResponseEntity(new ArrayList<>()));
76+
// return;
77+
// }
78+
79+
// List<Map> datas = new ArrayList<>();
80+
// Java110ThreadPoolFactory java110ThreadPoolFactory = null;
81+
// try {
82+
// java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(5);
83+
// for (FloorDto floorDto1 : floorDtos) {
84+
// queryStatisticsDto.setFloorId(floorDto1.getFloorId());
85+
// QueryStatisticsDto tmpQueryStatisticsDto = BeanConvertUtil.covertBean(queryStatisticsDto,QueryStatisticsDto.class);
86+
// java110ThreadPoolFactory.submit(() -> {
87+
// //todo 欠费户数
88+
// List<Map> floorDatas = feeStatisticsImpl.getFloorFeeSummary(tmpQueryStatisticsDto);
89+
// if (!ListUtil.isNull(floorDatas)) {
90+
// datas.add(floorDatas.get(0));
91+
// }
92+
// return datas;
93+
// });
94+
// }
95+
// java110ThreadPoolFactory.get();
96+
// } finally {
97+
// if (java110ThreadPoolFactory != null) {
98+
// java110ThreadPoolFactory.stop();
99+
// }
100+
// }
101101

102102
//todo 拼接数据
103103

104-
//List<Map> datas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto);
104+
List<Map> datas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto);
105105

106106
if (datas == null || datas.size() < 1) {
107107
context.setResponseEntity(ResultVo.createResponseEntity(datas));

0 commit comments

Comments
 (0)