From f77bf50a9c210e2554d7b7cd1f6d8ab4015214ae Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 15 Jan 2024 07:18:24 +0000 Subject: [PATCH 01/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E6=94=B6=E8=B4=B9=EF=BC=8C=E5=AF=BC=E5=85=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=9A=E9=81=8D=E6=97=B6=20=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../mapper/report/ReportCommunityServiceDaoImplMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml index 5601e4283d..e72ebaa1c8 100755 --- a/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml @@ -249,7 +249,7 @@ select count(1) feeRoomCount from ( - select t.payer_obj_id - from report_owe_fee t - inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - - left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' - - where - 1=1 - and t.payer_obj_type = '3333' - and t.community_id= #{communityId} - and t.end_time < #{endDate} - - and bu.floor_id = #{floorId} - - - and t.config_id = #{configId} - - - and t.payer_obj_name like concat('%',#{objName},'%') - - - and t.owner_name like concat('%',#{ownerName},'%') - - - and t.owner_tel = #{link} - - - and t.config_id in - - #{item} - - - - and pfc.fee_type_cd = #{feeTypeCd} - - group by t.payer_obj_id + select t.payer_obj_id + from report_owe_fee t + inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' + left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' + + left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' + + where + 1=1 + and t.payer_obj_type = '3333' + and t.community_id= #{communityId} + and t.end_time < #{endDate} + + and bu.floor_id = #{floorId} + + + and t.config_id = #{configId} + + + and t.payer_obj_name like concat('%',#{objName},'%') + + + and t.owner_name like concat('%',#{ownerName},'%') + + + and t.owner_tel = #{link} + + + and t.config_id in + + #{item} + + + + and pfc.fee_type_cd = #{feeTypeCd} + + group by t.payer_obj_id ) a @@ -390,55 +390,55 @@ select a.floor_id floorId,a.floor_num floorNum,a.name floorName, ( select count(1) from ( - select bu.floor_id,t.payer_obj_id - from report_owe_fee t + select bu.floor_id,t.payer_obj_id + from report_owe_fee t inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - - left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' - - where - 1=1 - and t.payer_obj_type = '3333' - and t.community_id= #{communityId} - and t.end_time <= #{endDate} - and t.amount_owed != 0 - - and t.config_id in - - #{item} - - - - and pfc.fee_type_cd = #{feeTypeCd} - - group by bu.floor_id,t.payer_obj_id + left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' + + left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' + + where + 1=1 + and t.payer_obj_type = '3333' + and t.community_id= #{communityId} + and t.end_time <= #{endDate} + and t.amount_owed != 0 + + and t.config_id in + + #{item} + + + + and pfc.fee_type_cd = #{feeTypeCd} + + group by bu.floor_id,t.payer_obj_id ) b where b.floor_id = a.floor_id ) oweRoomCount, ( select count(1) from ( - select bu.floor_id,t.payer_obj_id - from report_owe_fee t - inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001' + select bu.floor_id,t.payer_obj_id + from report_owe_fee t + inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001' inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where - 1=1 - and t.payer_obj_type = '3333' - and t.community_id= #{communityId} - and pf.community_id= #{communityId} - and t.end_time <= #{endDate} - - and t.config_id in - - #{item} - - - - and pf.fee_type_cd = #{feeTypeCd} - - group by bu.floor_id,t.payer_obj_id + left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' + where + 1=1 + and t.payer_obj_type = '3333' + and t.community_id= #{communityId} + and pf.community_id= #{communityId} + and t.end_time <= #{endDate} + + and t.config_id in + + #{item} + + + + and pf.fee_type_cd = #{feeTypeCd} + + group by bu.floor_id,t.payer_obj_id ) b where b.floor_id = a.floor_id ) feeRoomCount, @@ -446,11 +446,9 @@ select ifnull(sum(t.received_amount),0.0) receivedFee from pay_fee_detail t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - LEFT JOIN building_room br on pf.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' where 1=1 - and bu.floor_id = a.floor_id + and t.obj_fpc_id = a.floor_id and t.status_cd = '0' and t.community_id= a.community_id and t.create_time > #{startDate} @@ -462,18 +460,16 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} ) receivedFee, ( select ifnull(sum(t.received_amount),0.0) preReceivedFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' where 1=1 - and bu.floor_id = a.floor_id + and t.obj_fpc_id = a.floor_id and t.status_cd = '0' and t.community_id= a.community_id and t.pay_fee_time > #{startDate} @@ -486,18 +482,16 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} ) preReceivedFee, ( select ifnull(sum(t.receivable_amount),0.0) hisOweFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' where 1=1 - and bu.floor_id = a.floor_id + and t.obj_fpc_id = a.floor_id and t.status_cd = '0' and t.community_id= a.community_id and t.detail_id = '-1' @@ -509,18 +503,16 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} ) hisOweFee, ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' where 1=1 - and bu.floor_id = a.floor_id + and t.obj_fpc_id = a.floor_id and t.status_cd = '0' and t.community_id= a.community_id and t.cur_month_time >= #{startDate} @@ -532,18 +524,16 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} ) curReceivableFee, ( select ifnull(sum(t.receivable_amount),0.0) curReceivedFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' where 1=1 - and bu.floor_id = a.floor_id + and t.obj_fpc_id = a.floor_id and t.status_cd = '0' and t.community_id= a.community_id and t.cur_month_time >= #{startDate} @@ -556,18 +546,16 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} ) curReceivedFee, ( select ifnull(sum(t.received_amount),0.0) hisReceivedFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' where 1=1 - and bu.floor_id = a.floor_id + and t.obj_fpc_id = a.floor_id and t.status_cd = '0' and t.community_id= a.community_id and t.pay_fee_time > #{startDate} @@ -581,7 +569,7 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} ) hisReceivedFee from f_floor a @@ -595,27 +583,27 @@ select a.name, ( select count(1) from ( - select pfc.fee_type_cd,t.payer_obj_id - from report_owe_fee t + select pfc.fee_type_cd,t.payer_obj_id + from report_owe_fee t inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' - where - 1=1 - and t.payer_obj_type = '3333' - and t.community_id= #{communityId} - and t.end_time <= #{endDate} - and t.amount_owed != 0 - - and t.config_id in - - #{item} - - - - and pfc.fee_type_cd = #{feeTypeCd} - - group by pfc.fee_type_cd,t.payer_obj_id + left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' + left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' + where + 1=1 + and t.payer_obj_type = '3333' + and t.community_id= #{communityId} + and t.end_time <= #{endDate} + and t.amount_owed != 0 + + and t.config_id in + + #{item} + + + + and pfc.fee_type_cd = #{feeTypeCd} + + group by pfc.fee_type_cd,t.payer_obj_id ) b where b.fee_type_cd = a.status_cd ) oweRoomCount, @@ -674,14 +662,10 @@ select ifnull(sum(t.received_amount),0.0) preReceivedFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.status_cd = '0' and t.community_id= #{communityId} @@ -695,20 +679,16 @@ #{item} - and pf.fee_type_cd = a.status_cd + and t.fee_type_cd = a.status_cd ) preReceivedFee, ( select ifnull(sum(t.receivable_amount),0.0) hisOweFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.status_cd = '0' and t.community_id= #{communityId} @@ -720,20 +700,16 @@ #{item} - and pf.fee_type_cd = a.status_cd + and t.fee_type_cd = a.status_cd ) hisOweFee, ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.status_cd = '0' and t.community_id= #{communityId} @@ -745,20 +721,16 @@ #{item} - and pf.fee_type_cd = a.status_cd + and t.fee_type_cd = a.status_cd ) curReceivableFee, ( select ifnull(sum(t.receivable_amount),0.0) curReceivedFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.status_cd = '0' and t.community_id= #{communityId} @@ -771,20 +743,16 @@ #{item} - and pf.fee_type_cd = a.status_cd + and t.fee_type_cd = a.status_cd ) curReceivedFee, ( select ifnull(sum(t.received_amount),0.0) hisReceivedFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.status_cd = '0' and t.community_id= #{communityId} @@ -798,7 +766,7 @@ #{item} - and pf.fee_type_cd = a.status_cd + and t.fee_type_cd = a.status_cd ) hisReceivedFee from t_dict a where 1=1 @@ -810,17 +778,17 @@ select count(1) feeRoomCount from ( - select t.payer_ob_id - from report_owe_fee t - inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001' + select t.payer_ob_id + from report_owe_fee t + inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001' inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where - 1=1 - and t.payer_obj_type = '3333' - and t.community_id= #{communityId} - and pf.community_id= #{communityId} - group by a.payer_ob_id + left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' + where + 1=1 + and t.payer_obj_type = '3333' + and t.community_id= #{communityId} + and pf.community_id= #{communityId} + group by a.payer_ob_id ) b @@ -831,24 +799,21 @@ select ifnull(sum(t.receivable_amount),0.0) hisOweFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - inner join pay_fee_config pfc1 on pfc1.config_id = t.config_id and pfc1.status_cd = '0' - where t.obj_id = a.obj_id - and t.status_cd = '0' + where t.status_cd = '0' and t.detail_id = '-1' and t.community_id= a.community_id and t.obj_id = a.obj_id - and pfc1.fee_type_cd = pfc.fee_type_cd + and t.fee_type_cd = a.fee_type_cd and t.cur_month_time < #{endDate} ) oweFee, ( select ifnull(sum(t.received_amount),0.0) receivedFee from pay_fee_detail t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - inner join pay_fee_config pfc1 on pfc1.config_id = pf.config_id and pfc1.status_cd = '0' where pf.payer_obj_id = a.obj_id and t.status_cd = '0' and t.community_id= a.community_id - and pfc1.fee_type_cd = pfc.fee_type_cd + and t.fee_type_cd = a.fee_type_cd and t.create_time > #{startDate} and t.create_time < #{endDate} ) receivedFee @@ -869,24 +834,22 @@ select ifnull(sum(t.receivable_amount),0.0) hisOweFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - inner join pay_fee_config pfc1 on pfc1.config_id = t.config_id and pfc1.status_cd = '0' where 1=1 and t.status_cd = '0' and t.detail_id = '-1' and t.community_id= a.community_id and t.owner_id = a.owner_id - and pfc1.fee_type_cd = pfc.fee_type_cd + and t.fee_type_cd = a.fee_type_cd and t.cur_month_time < #{endDate} ) oweFee, ( select ifnull(sum(t.received_amount),0.0) receivedFee from pay_fee_detail_month t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - inner join pay_fee_config pfc1 on pfc1.config_id = t.config_id and pfc1.status_cd = '0' where t.owner_id = a.owner_id and t.status_cd = '0' and t.community_id= a.community_id - and pfc1.fee_type_cd = pfc.fee_type_cd + and t.fee_type_cd = a.fee_type_cd and t.pay_fee_time > #{startDate} and t.pay_fee_time < #{endDate} ) receivedFee @@ -1089,35 +1052,35 @@ ) roomCount, ( select count(1) from ( - select bu.floor_id,br.room_id - from report_owe_fee t - inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001' + select bu.floor_id,br.room_id + from report_owe_fee t + inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001' inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where - 1=1 - and t.payer_obj_type = '3333' - and t.community_id= #{communityId} + left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' + where + 1=1 + and t.payer_obj_type = '3333' + and t.community_id= #{communityId} and pf.community_id= #{communityId} - and t.end_time < #{endDate} - group by bu.floor_id,br.room_id + and t.end_time < #{endDate} + group by bu.floor_id,br.room_id ) b where b.floor_id = a.floor_id ) feeRoomCount, ( select count(1) from ( - select bu.floor_id,br.room_id - from report_owe_fee t + select bu.floor_id,br.room_id + from report_owe_fee t inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' - where - 1=1 - and t.payer_obj_type = '3333' - and t.community_id= #{communityId} - and t.end_time < #{endDate} - and t.amount_owed != 0 - group by bu.floor_id,br.room_id + left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' + left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' + where + 1=1 + and t.payer_obj_type = '3333' + and t.community_id= #{communityId} + and t.end_time < #{endDate} + and t.amount_owed != 0 + group by bu.floor_id,br.room_id ) b where b.floor_id = a.floor_id ) oweRoomCount, @@ -1235,7 +1198,7 @@ LEFT JOIN building_room br on pf.payer_obj_id = br.room_id and br.status_cd = '0' left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' where 1=1 - and bu.floor_id = #{floorId} + and bu.floor_id = #{floorId} and t.community_id = #{communityId} and pf.community_id= #{communityId} and t.pay_fee_time > #{startDate} diff --git a/java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml index 7f612f29c5..52038917f9 100755 --- a/java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml @@ -130,7 +130,7 @@ t.owner_id ownerId,t.b_id,t.b_id bId,t.user_id,t.user_id userId,t.car_id,t.car_id carId ,t.create_time createTime,t.community_id communityId,bow.name ownerName,bow.id_card idCard,bow.link,t2.name stateName, t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.state, - t.car_type_cd,t.car_type_cd carTypeCd,t.member_id,t.member_id memberId,ps.num,pa.num areaNum,t.lease_type + t.car_type_cd,t.car_type_cd carTypeCd,t.member_id,t.member_id memberId,ps.num,pa.num areaNum,pa.pa_id paId,t.lease_type leaseType, t3.name leaseTypeName,t4.name carTypeCdName diff --git a/java110-interface/src/main/java/com/java110/intf/fee/IPayFeeDetailMonthInnerServiceSMO.java b/java110-interface/src/main/java/com/java110/intf/fee/IPayFeeDetailMonthInnerServiceSMO.java index 47098bafc3..77a93d3937 100644 --- a/java110-interface/src/main/java/com/java110/intf/fee/IPayFeeDetailMonthInnerServiceSMO.java +++ b/java110-interface/src/main/java/com/java110/intf/fee/IPayFeeDetailMonthInnerServiceSMO.java @@ -25,17 +25,17 @@ public interface IPayFeeDetailMonthInnerServiceSMO { @RequestMapping(value = "/savePayFeeDetailMonth", method = RequestMethod.POST) - public int savePayFeeDetailMonth(@RequestBody PayFeeDetailMonthPo payFeeDetailMonthPo); + int savePayFeeDetailMonth(@RequestBody PayFeeDetailMonthPo payFeeDetailMonthPo); @RequestMapping(value = "/savePayFeeDetailMonths", method = RequestMethod.POST) - public int savePayFeeDetailMonths(@RequestBody List payFeeDetailMonthPos); + int savePayFeeDetailMonths(@RequestBody List payFeeDetailMonthPos); @RequestMapping(value = "/updatePayFeeDetailMonth", method = RequestMethod.POST) - public int updatePayFeeDetailMonth(@RequestBody PayFeeDetailMonthPo payFeeDetailMonthPo); + int updatePayFeeDetailMonth(@RequestBody PayFeeDetailMonthPo payFeeDetailMonthPo); @RequestMapping(value = "/deletePayFeeDetailMonth", method = RequestMethod.POST) - public int deletePayFeeDetailMonth(@RequestBody PayFeeDetailMonthPo payFeeDetailMonthPo); + int deletePayFeeDetailMonth(@RequestBody PayFeeDetailMonthPo payFeeDetailMonthPo); /** *

查询小区楼信息

diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java index 8e92b02cef..4e8c6386e1 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java @@ -2,15 +2,22 @@ import com.java110.core.factory.GenerateCodeFactory; import com.java110.core.smo.IComputeFeeSMO; +import com.java110.dto.contract.ContractDto; import com.java110.dto.fee.FeeAttrDto; import com.java110.dto.fee.FeeDetailDto; import com.java110.dto.fee.FeeDto; +import com.java110.dto.owner.OwnerCarDto; import com.java110.dto.payFee.PayFeeDetailMonthDto; import com.java110.dto.payFee.PayFeeMonthOwnerDto; +import com.java110.dto.room.RoomDto; import com.java110.intf.community.IRoomInnerServiceSMO; import com.java110.intf.fee.IPayFeeDetailMonthInnerServiceSMO; +import com.java110.intf.store.IContractInnerServiceSMO; +import com.java110.intf.user.IOwnerCarInnerServiceSMO; import com.java110.po.payFee.PayFeeDetailMonthPo; import com.java110.utils.util.DateUtil; +import com.java110.utils.util.ListUtil; +import com.java110.utils.util.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -23,6 +30,12 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { @Autowired private IRoomInnerServiceSMO roomInnerServiceSMOImpl; + @Autowired + private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl; + + @Autowired + private IContractInnerServiceSMO contractInnerServiceSMOImpl; + @Autowired private IComputeFeeSMO computeFeeSMOImpl; @@ -38,6 +51,39 @@ public PayFeeMonthOwnerDto generatorOwnerRoom(FeeDto feeDto) { payFeeMonthOwnerDto.setLink(FeeAttrDto.getFeeAttrValue(feeDto, FeeAttrDto.SPEC_CD_OWNER_LINK)); payFeeMonthOwnerDto.setObjName(FeeAttrDto.getFeeAttrValue(feeDto, FeeAttrDto.SPEC_CD_PAY_OBJECT_NAME)); payFeeMonthOwnerDto.setObjId(feeDto.getPayerObjId()); + payFeeMonthOwnerDto.setObjFpcId("-1"); + + if(StringUtil.isEmpty(feeDto.getPayerObjId())){ + return payFeeMonthOwnerDto; + } + + // 如果是房屋 + if(FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())){ + + RoomDto roomDto = new RoomDto(); + roomDto.setRoomId(feeDto.getPayerObjId()); + roomDto.setCommunityId(feeDto.getCommunityId()); + List roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); + if(!ListUtil.isNull(roomDtos)){ + payFeeMonthOwnerDto.setObjFpcId(roomDtos.get(0).getFloorId()); + } + }else if(FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())){ + + OwnerCarDto ownerCarDto = new OwnerCarDto(); + ownerCarDto.setMemberId(feeDto.getPayerObjId()); + ownerCarDto.setCommunityId(feeDto.getCommunityId()); + List ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); + if(!ListUtil.isNull(ownerCarDtos)){ + payFeeMonthOwnerDto.setObjFpcId(ownerCarDtos.get(0).getPaId()); + } + }else { + ContractDto contractDto = new ContractDto(); + contractDto.setContractId(feeDto.getPayerObjId()); + List contractDtos = contractInnerServiceSMOImpl.queryContracts(contractDto); + if(!ListUtil.isNull(contractDtos)){ + payFeeMonthOwnerDto.setObjFpcId(contractDtos.get(0).getContractType()); + } + } return payFeeMonthOwnerDto; } @@ -168,12 +214,12 @@ public void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOw // todo 如果不是整月,则转换为按天计算 // if (curDay != curMonthMaxDay) { - //todo 周期性费用 日应收重新算 - if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { - dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - } - // todo 计算 应收 - curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + //todo 周期性费用 日应收重新算 + if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { + dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + } + // todo 计算 应收 + curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); // } else { // todo 如果是整月 那就按月计算,以免 转换成天再 乘以天数后的误差 // curMonthReceivableAmount = receivableAmount; // } @@ -332,6 +378,11 @@ private void toSavePayFeeDetailMonth(double receivableAmount, tmpPayFeeDetailMonthPo.setState("W"); // todo 这里暂时写死,目前用不到,算是预留字段 tmpPayFeeDetailMonthPo.setFeeName(feeDto.getFeeName()); tmpPayFeeDetailMonthPo.setConfigId(feeDto.getConfigId()); + tmpPayFeeDetailMonthPo.setFeeTypeCd(feeDto.getFeeTypeCd()); + + //todo 查询obj_fpc_id + tmpPayFeeDetailMonthPo.setObjFpcId(payFeeMonthOwnerDto.getObjFpcId()); + payFeeDetailMonthPos.add(tmpPayFeeDetailMonthPo); } diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java index 815878d53b..a216c3fbb5 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java @@ -176,9 +176,9 @@ public void doGeneratorOweFees(List feeIds, String communityId) { feeDto.setFeeId(feeId); List tmpFeeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); - if(tmpFeeDtos == null || tmpFeeDtos.size() < 1){ - continue; - } + if(tmpFeeDtos == null || tmpFeeDtos.size() < 1){ + continue; + } generatorOweFeeInnerServiceSMOImpl.computeOweFee(tmpFeeDtos.get(0)); } } From 6caf02bfd3eafe80c0b37ac4ad04077ea549dc92 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Thu, 22 Feb 2024 15:02:53 +0800 Subject: [PATCH 15/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/db/tt.sql | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/db/tt.sql b/docs/db/tt.sql index 55a3798ba5..9fffcc408f 100644 --- a/docs/db/tt.sql +++ b/docs/db/tt.sql @@ -28949,8 +28949,8 @@ CREATE TABLE `pay_fee_detail_month` ( `fee_id` varchar(30) NOT NULL COMMENT '费用ID', `detail_id` varchar(30) NOT NULL COMMENT '费用明细ID', `community_id` varchar(30) NOT NULL COMMENT '小区ID', - `detail_year` int(11) NOT NULL COMMENT '年', - `detail_month` int(11) NOT NULL COMMENT '月', + `detail_year` int NOT NULL COMMENT '年', + `detail_month` int NOT NULL COMMENT '月', `receivable_amount` decimal(10,4) NOT NULL COMMENT '应收金额', `received_amount` decimal(10,4) NOT NULL COMMENT '应收金额', `discount_amount` decimal(10,4) NOT NULL DEFAULT '0.0000' COMMENT '折扣金额', @@ -28968,19 +28968,22 @@ CREATE TABLE `pay_fee_detail_month` ( `fee_name` varchar(64) DEFAULT NULL COMMENT '费用名称', `config_id` varchar(30) NOT NULL COMMENT '标准ID', `deadline_time` date NOT NULL DEFAULT '1000-01-01' COMMENT '缴费截止时间', + `obj_fpc_id` varchar(30) NOT NULL COMMENT '对象目录,房屋时 floor_id 车辆时 pa_id 合同时 contract_type_id', + `fee_type_cd` varchar(30) NOT NULL COMMENT '费用大类', PRIMARY KEY (`month_id`), KEY `i_pfdm_community_id` (`community_id`), KEY `i_pfdm_cur_month_time` (`cur_month_time`), KEY `i_pfdm_fee_id` (`fee_id`), KEY `i_pfdm_obj_id` (`obj_id`), KEY `i_pfdm_config_id` (`config_id`), - KEY `i_pfdm_owner_id` (`owner_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + KEY `i_pfdm_owner_id` (`owner_id`), + KEY `i_obj_fac_id` (`obj_fpc_id`), + KEY `i_fee_type_cd` (`fee_type_cd`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 -- ---------------------------- -- Records of pay_fee_detail_month -- ---------------------------- -INSERT INTO `pay_fee_detail_month` VALUES ('79202401081920015305000055', '902024010804100039', '912024010830450050', '2024010802740034', '2024', '1', '120.0000', '120.0000', '0.0000', '程序计算生成', '2024-01-08 19:20:01', '0', '1-1-1001', '752024010827870016', '测试业主', '772024010866770019', '18109711443', 'W', '2024-01-08 19:19:47', '2024-01-01 00:00:00', '物业费', '922024010877430036', '2024-02-01'); -- ---------------------------- -- Table structure for pay_fee_qrcode From e934b7ddaf26a2731531cd9687f656178a507396 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Thu, 22 Feb 2024 15:11:19 +0800 Subject: [PATCH 16/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/ReportFeeStatisticsServiceDaoImplMapper.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index 0e5e8a3b7c..a6ea3b4976 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -446,9 +446,11 @@ select ifnull(sum(t.received_amount),0.0) receivedFee from pay_fee_detail t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' + LEFT JOIN building_room br on pf.payer_obj_id = br.room_id and br.status_cd = '0' + left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' where 1=1 - and t.obj_fpc_id = a.floor_id + and bu.floor_id = a.floor_id and t.status_cd = '0' and t.community_id= a.community_id and t.create_time > #{startDate} @@ -460,7 +462,7 @@
- and t.fee_type_cd = #{feeTypeCd} + and pf.fee_type_cd = #{feeTypeCd} ) receivedFee, ( @@ -810,10 +812,11 @@ select ifnull(sum(t.received_amount),0.0) receivedFee from pay_fee_detail t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' + inner join pay_fee_config pfc1 on pfc1.config_id = pf.config_id and pfc1.status_cd = '0' where pf.payer_obj_id = a.obj_id and t.status_cd = '0' and t.community_id= a.community_id - and t.fee_type_cd = a.fee_type_cd + and pfc1.fee_type_cd = pfc.fee_type_cd and t.create_time > #{startDate} and t.create_time < #{endDate} ) receivedFee From b8bfea24a0e97dd3b3220e8ba69c5c60b34c5579 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Thu, 22 Feb 2024 16:12:04 +0800 Subject: [PATCH 17/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eportFeeStatisticsServiceDaoImplMapper.xml | 72 +++++-------------- 1 file changed, 16 insertions(+), 56 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index a6ea3b4976..b9636de9e8 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -8,15 +8,10 @@ select ifnull(sum(t.receivable_amount),0.0) curOweFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.config_id = #{configId} @@ -78,7 +68,7 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} and t.status_cd = '0' and t.detail_id = '-1' @@ -90,15 +80,10 @@ select ifnull(sum(t.receivable_amount),0.0) curReceivableFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - + where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.config_id = #{configId} @@ -160,7 +141,7 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} and t.status_cd = '0' and t.community_id= #{communityId} @@ -172,15 +153,11 @@ select ifnull(sum(t.received_amount),0.0) preReceivedFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - + where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.config_id = #{configId} @@ -243,7 +216,7 @@ - and pf.fee_type_cd = #{feeTypeCd} + and t.fee_type_cd = #{feeTypeCd} and t.status_cd = '0' and t.community_id= #{communityId} @@ -267,7 +240,7 @@ where 1=1 - and bu.floor_id = #{floorId} + and t.obj_fpc_id = #{floorId} and t.config_id = #{configId} @@ -468,7 +441,6 @@ ( select ifnull(sum(t.received_amount),0.0) preReceivedFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 and t.obj_fpc_id = a.floor_id @@ -490,7 +462,6 @@ ( select ifnull(sum(t.receivable_amount),0.0) hisOweFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 and t.obj_fpc_id = a.floor_id @@ -511,7 +482,6 @@ ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 and t.obj_fpc_id = a.floor_id @@ -532,7 +502,6 @@ ( select ifnull(sum(t.receivable_amount),0.0) curReceivedFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 and t.obj_fpc_id = a.floor_id @@ -554,7 +523,6 @@ ( select ifnull(sum(t.received_amount),0.0) hisReceivedFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 and t.obj_fpc_id = a.floor_id @@ -663,7 +631,6 @@ ( select ifnull(sum(t.received_amount),0.0) preReceivedFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 @@ -686,7 +653,6 @@ ( select ifnull(sum(t.receivable_amount),0.0) hisOweFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 @@ -707,7 +673,6 @@ ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 @@ -728,7 +693,6 @@ ( select ifnull(sum(t.receivable_amount),0.0) curReceivedFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 @@ -750,7 +714,6 @@ ( select ifnull(sum(t.received_amount),0.0) hisReceivedFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 @@ -800,7 +763,6 @@ ( select ifnull(sum(t.receivable_amount),0.0) hisOweFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where t.status_cd = '0' and t.detail_id = '-1' and t.community_id= a.community_id @@ -836,7 +798,6 @@ ( select ifnull(sum(t.receivable_amount),0.0) hisOweFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where 1=1 and t.status_cd = '0' and t.detail_id = '-1' @@ -848,7 +809,6 @@ ( select ifnull(sum(t.received_amount),0.0) receivedFee from pay_fee_detail_month t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' where t.owner_id = a.owner_id and t.status_cd = '0' and t.community_id= a.community_id From 32fa18c46eb80ee39aca95dd4581c9fd68d7024a Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Thu, 22 Feb 2024 17:13:06 +0800 Subject: [PATCH 18/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index b9636de9e8..fa04b0f435 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -240,7 +240,7 @@ where 1=1 - and t.obj_fpc_id = #{floorId} + and bu.floor_id = #{floorId} and t.config_id = #{configId} From 7ec49b173d0acbb465554dc6fac3fc0e7b76f55e Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Thu, 22 Feb 2024 18:29:57 +0800 Subject: [PATCH 19/37] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=B9=B6=E5=8F=91?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QueryReportFeeSummaryCmd.java | 111 ++++++++++++------ 1 file changed, 74 insertions(+), 37 deletions(-) diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java index eb4b310465..65b8e04271 100644 --- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java +++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java @@ -6,6 +6,7 @@ import com.java110.core.context.ICmdDataFlowContext; import com.java110.core.event.cmd.Cmd; import com.java110.core.event.cmd.CmdEvent; +import com.java110.core.factory.Java110ThreadPoolFactory; import com.java110.dto.report.QueryStatisticsDto; import com.java110.report.statistics.IBaseDataStatistics; import com.java110.report.statistics.IFeeStatistics; @@ -60,7 +61,7 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso queryStatisticsDto.setCommunityId(reqJson.getString("communityId")); queryStatisticsDto.setStartDate(reqJson.getString("startDate")); queryStatisticsDto.setEndDate(reqJson.getString("endDate")); - if(reqJson.containsKey("endDate") && !reqJson.getString("endDate").contains(":")) { + if (reqJson.containsKey("endDate") && !reqJson.getString("endDate").contains(":")) { queryStatisticsDto.setEndDate(reqJson.getString("endDate") + " 23:59:59"); } queryStatisticsDto.setConfigId(reqJson.getString("configId")); @@ -70,47 +71,83 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso queryStatisticsDto.setOwnerName(reqJson.getString("ownerName")); queryStatisticsDto.setLink(reqJson.getString("link")); - if(reqJson.containsKey("configIds")){ + if (reqJson.containsKey("configIds")) { queryStatisticsDto.setConfigIds(reqJson.getString("configIds").split(",")); } - //todo 查询历史欠费 - double hisOweFee = feeStatisticsImpl.getHisMonthOweFee(queryStatisticsDto); - - //todo 查询 单月欠费 - double curOweFee = feeStatisticsImpl.getCurMonthOweFee(queryStatisticsDto); - - //todo 查询当月应收 - double curReceivableFee = feeStatisticsImpl.getCurReceivableFee(queryStatisticsDto); - - //todo 查询 欠费追回 - double hisReceivedFee = feeStatisticsImpl.getHisReceivedFee(queryStatisticsDto); - - //todo 查询 预交费用 - double preReceivedFee = feeStatisticsImpl.getPreReceivedFee(queryStatisticsDto); - - //todo 查询实收 - double receivedFee = feeStatisticsImpl.getReceivedFee(queryStatisticsDto); - - //todo 房屋数 - long roomCount = baseDataStatisticsImpl.getRoomCount(queryStatisticsDto); - - //todo 收费房屋数 - long feeRoomCount = feeStatisticsImpl.getFeeRoomCount(queryStatisticsDto); - - //todo 欠费户数 - int oweRoomCount = feeStatisticsImpl.getOweRoomCount(queryStatisticsDto); JSONObject data = new JSONObject(); - data.put("hisOweFee", MoneyUtil.computePriceScale(hisOweFee)); - data.put("curOweFee", MoneyUtil.computePriceScale(curOweFee)); - data.put("hisReceivedFee", MoneyUtil.computePriceScale(hisReceivedFee)); - data.put("preReceivedFee", MoneyUtil.computePriceScale(preReceivedFee)); - data.put("receivedFee", MoneyUtil.computePriceScale(receivedFee)); - data.put("roomCount", roomCount); - data.put("feeRoomCount", feeRoomCount); - data.put("oweRoomCount", oweRoomCount); - data.put("curReceivableFee", MoneyUtil.computePriceScale(curReceivableFee)); + + Java110ThreadPoolFactory java110ThreadPoolFactory = null; + try { + java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(9); + java110ThreadPoolFactory.submit(() -> { + //todo 查询历史欠费 + double hisOweFee = feeStatisticsImpl.getHisMonthOweFee(queryStatisticsDto); + data.put("hisOweFee", MoneyUtil.computePriceScale(hisOweFee)); + return hisOweFee; + }); + + java110ThreadPoolFactory.submit(() -> { + //todo 查询 单月欠费 + double curOweFee = feeStatisticsImpl.getCurMonthOweFee(queryStatisticsDto); + data.put("curOweFee", MoneyUtil.computePriceScale(curOweFee)); + return curOweFee; + }); + + java110ThreadPoolFactory.submit(() -> { + //todo 查询当月应收 + double curReceivableFee = feeStatisticsImpl.getCurReceivableFee(queryStatisticsDto); + data.put("curReceivableFee", MoneyUtil.computePriceScale(curReceivableFee)); + return curReceivableFee; + }); + + java110ThreadPoolFactory.submit(() -> { + //todo 查询 欠费追回 + double hisReceivedFee = feeStatisticsImpl.getHisReceivedFee(queryStatisticsDto); + data.put("hisReceivedFee", MoneyUtil.computePriceScale(hisReceivedFee)); + return hisReceivedFee; + }); + + java110ThreadPoolFactory.submit(() -> { + //todo 查询 预交费用 + double preReceivedFee = feeStatisticsImpl.getPreReceivedFee(queryStatisticsDto); + data.put("preReceivedFee", MoneyUtil.computePriceScale(preReceivedFee)); + return preReceivedFee; + }); + + java110ThreadPoolFactory.submit(() -> { + //todo 查询实收 + double receivedFee = feeStatisticsImpl.getReceivedFee(queryStatisticsDto); + data.put("receivedFee", MoneyUtil.computePriceScale(receivedFee)); + return receivedFee; + }); + + java110ThreadPoolFactory.submit(() -> { + //todo 房屋数 + long roomCount = baseDataStatisticsImpl.getRoomCount(queryStatisticsDto); + data.put("roomCount", roomCount); + return roomCount; + }); + java110ThreadPoolFactory.submit(() -> { + //todo 收费房屋数 + long feeRoomCount = feeStatisticsImpl.getFeeRoomCount(queryStatisticsDto); + data.put("feeRoomCount", feeRoomCount); + return feeRoomCount; + }); + java110ThreadPoolFactory.submit(() -> { + //todo 欠费户数 + int oweRoomCount = feeStatisticsImpl.getOweRoomCount(queryStatisticsDto); + data.put("oweRoomCount", oweRoomCount); + return oweRoomCount; + }); + + java110ThreadPoolFactory.get(); + } finally { + if (java110ThreadPoolFactory != null) { + java110ThreadPoolFactory.stop(); + } + } JSONArray datas = new JSONArray(); datas.add(data); From 6898f137ec1262d8b4fa77efcdffea2e8cdfb492 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 01:53:08 +0800 Subject: [PATCH 20/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A5=BC=E6=A0=8B?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/report/QueryStatisticsDto.java | 18 ++ .../report/ReportFloorFeeStatisticsDto.java | 123 ++++++++++ ...eportFeeStatisticsServiceDaoImplMapper.xml | 12 +- ...FloorFeeStatisticsServiceDaoImplMapper.xml | 230 ++++++++++++++++++ ...portFloorFeeStatisticsInnerServiceSMO.java | 103 ++++++++ .../QueryReportFloorFeeSummaryCmd.java | 182 ++++++++++++-- .../IReportFloorFeeStatisticsServiceDao.java | 26 ++ ...eportFloorFeeStatisticsServiceDaoImpl.java | 74 ++++++ ...FloorFeeStatisticsInnerServiceSMOImpl.java | 80 ++++++ .../statistics/IFloorFeeStatistics.java | 91 +++++++ .../impl/FloorFeeStatisticsImpl.java | 57 +++++ 11 files changed, 973 insertions(+), 23 deletions(-) create mode 100644 java110-bean/src/main/java/com/java110/dto/report/ReportFloorFeeStatisticsDto.java create mode 100644 java110-db/src/main/resources/mapper/report/ReportFloorFeeStatisticsServiceDaoImplMapper.xml create mode 100644 java110-interface/src/main/java/com/java110/intf/report/IReportFloorFeeStatisticsInnerServiceSMO.java create mode 100644 service-report/src/main/java/com/java110/report/dao/IReportFloorFeeStatisticsServiceDao.java create mode 100644 service-report/src/main/java/com/java110/report/dao/impl/ReportFloorFeeStatisticsServiceDaoImpl.java create mode 100644 service-report/src/main/java/com/java110/report/smo/impl/ReportFloorFeeStatisticsInnerServiceSMOImpl.java create mode 100644 service-report/src/main/java/com/java110/report/statistics/IFloorFeeStatistics.java create mode 100644 service-report/src/main/java/com/java110/report/statistics/impl/FloorFeeStatisticsImpl.java diff --git a/java110-bean/src/main/java/com/java110/dto/report/QueryStatisticsDto.java b/java110-bean/src/main/java/com/java110/dto/report/QueryStatisticsDto.java index e919e35c7f..22a40ad1e8 100644 --- a/java110-bean/src/main/java/com/java110/dto/report/QueryStatisticsDto.java +++ b/java110-bean/src/main/java/com/java110/dto/report/QueryStatisticsDto.java @@ -17,6 +17,7 @@ public class QueryStatisticsDto extends PageDto implements Serializable { private String endDate; private String floorId; + private String[] floorIds; private String configId; @@ -29,6 +30,7 @@ public class QueryStatisticsDto extends PageDto implements Serializable { private String link; private String feeTypeCd; + private String[] feeTypeCds; private String[] unitIds; @@ -159,4 +161,20 @@ public String getHisDate() { public void setHisDate(String hisDate) { this.hisDate = hisDate; } + + public String[] getFloorIds() { + return floorIds; + } + + public void setFloorIds(String[] floorIds) { + this.floorIds = floorIds; + } + + public String[] getFeeTypeCds() { + return feeTypeCds; + } + + public void setFeeTypeCds(String[] feeTypeCds) { + this.feeTypeCds = feeTypeCds; + } } diff --git a/java110-bean/src/main/java/com/java110/dto/report/ReportFloorFeeStatisticsDto.java b/java110-bean/src/main/java/com/java110/dto/report/ReportFloorFeeStatisticsDto.java new file mode 100644 index 0000000000..5dde85712b --- /dev/null +++ b/java110-bean/src/main/java/com/java110/dto/report/ReportFloorFeeStatisticsDto.java @@ -0,0 +1,123 @@ +package com.java110.dto.report; + +public class ReportFloorFeeStatisticsDto { + + private String floorId; + + private String floorNum; + + private String floorName; + private String oweRoomCount; + private String feeRoomCount; + private String receivedFee; + private String preReceivedFee; + private String hisOweFee; + private String curReceivableFee; + private String curReceivedFee; + private String hisReceivedFee; + + //todo 欠费房屋数 oweRoomCount + + //todo 收费房屋数 feeRoomCount + + //todo 实收金额 receivedFee + + //todo 预收金额 preReceivedFee + + //todo 历史欠费金额 hisOweFee + + //todo 当期应收金额 curReceivableFee + + //todo 当期实收金额 curReceivedFee + + //todo 欠费追回 hisReceivedFee + + + public String getFloorId() { + return floorId; + } + + public void setFloorId(String floorId) { + this.floorId = floorId; + } + + public String getFloorNum() { + return floorNum; + } + + public void setFloorNum(String floorNum) { + this.floorNum = floorNum; + } + + public String getFloorName() { + return floorName; + } + + public void setFloorName(String floorName) { + this.floorName = floorName; + } + + public String getOweRoomCount() { + return oweRoomCount; + } + + public void setOweRoomCount(String oweRoomCount) { + this.oweRoomCount = oweRoomCount; + } + + public String getFeeRoomCount() { + return feeRoomCount; + } + + public void setFeeRoomCount(String feeRoomCount) { + this.feeRoomCount = feeRoomCount; + } + + public String getReceivedFee() { + return receivedFee; + } + + public void setReceivedFee(String receivedFee) { + this.receivedFee = receivedFee; + } + + public String getPreReceivedFee() { + return preReceivedFee; + } + + public void setPreReceivedFee(String preReceivedFee) { + this.preReceivedFee = preReceivedFee; + } + + public String getHisOweFee() { + return hisOweFee; + } + + public void setHisOweFee(String hisOweFee) { + this.hisOweFee = hisOweFee; + } + + public String getCurReceivableFee() { + return curReceivableFee; + } + + public void setCurReceivableFee(String curReceivableFee) { + this.curReceivableFee = curReceivableFee; + } + + public String getCurReceivedFee() { + return curReceivedFee; + } + + public void setCurReceivedFee(String curReceivedFee) { + this.curReceivedFee = curReceivedFee; + } + + public String getHisReceivedFee() { + return hisReceivedFee; + } + + public void setHisReceivedFee(String hisReceivedFee) { + this.hisReceivedFee = hisReceivedFee; + } +} diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index fa04b0f435..dd2b7a48aa 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -759,7 +759,7 @@ diff --git a/java110-db/src/main/resources/mapper/report/ReportFloorFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFloorFeeStatisticsServiceDaoImplMapper.xml new file mode 100644 index 0000000000..2e87da96ab --- /dev/null +++ b/java110-db/src/main/resources/mapper/report/ReportFloorFeeStatisticsServiceDaoImplMapper.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java110-interface/src/main/java/com/java110/intf/report/IReportFloorFeeStatisticsInnerServiceSMO.java b/java110-interface/src/main/java/com/java110/intf/report/IReportFloorFeeStatisticsInnerServiceSMO.java new file mode 100644 index 0000000000..df867feafb --- /dev/null +++ b/java110-interface/src/main/java/com/java110/intf/report/IReportFloorFeeStatisticsInnerServiceSMO.java @@ -0,0 +1,103 @@ +package com.java110.intf.report; + +import com.java110.config.feign.FeignConfiguration; +import com.java110.dto.report.QueryStatisticsDto; +import com.java110.dto.report.ReportFloorFeeStatisticsDto; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import java.util.List; + +/** + * @ClassName IReportFeeStatisticsInnerServiceSMO + * @Description 费用统计类 服务类 + * @Author wuxw + * @Date 2019/4/24 9:04 + * @Version 1.0 + * add by wuxw 2019/4/24 + **/ +@FeignClient(name = "report-service", configuration = {FeignConfiguration.class}) +@RequestMapping("/reportFloorFeeStatisticsApi") +public interface IReportFloorFeeStatisticsInnerServiceSMO { + + + + + /** + * 查询 //todo 欠费房屋数 oweRoomCount + * @param queryStatisticsDto + * @return + */ + @RequestMapping(value = "/getFloorOweRoomCount", method = RequestMethod.POST) + List getFloorOweRoomCount(@RequestBody QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 收费房屋数 feeRoomCount + * @param queryStatisticsDto + * @return + */ + @RequestMapping(value = "/getFloorFeeRoomCount", method = RequestMethod.POST) + List getFloorFeeRoomCount(@RequestBody QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 实收金额 receivedFee + * @param queryStatisticsDto + * @return + */ + @RequestMapping(value = "/getFloorReceivedFee", method = RequestMethod.POST) + List getFloorReceivedFee(@RequestBody QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 预收金额 preReceivedFee + * @param queryStatisticsDto + * @return + */ + @RequestMapping(value = "/getFloorPreReceivedFee", method = RequestMethod.POST) + List getFloorPreReceivedFee(@RequestBody QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 历史欠费金额 hisOweFee + * @param queryStatisticsDto + * @return + */ + @RequestMapping(value = "/getFloorHisOweFee", method = RequestMethod.POST) + List getFloorHisOweFee(@RequestBody QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 当期应收金额 curReceivableFee + * @param queryStatisticsDto + * @return + */ + @RequestMapping(value = "/getFloorCurReceivableFee", method = RequestMethod.POST) + List getFloorCurReceivableFee(@RequestBody QueryStatisticsDto queryStatisticsDto); + + + + + + + /** + * 查询 //todo 当期实收金额 curReceivedFee + * @param queryStatisticsDto + * @return + */ + @RequestMapping(value = "/getFloorCurReceivedFee", method = RequestMethod.POST) + List getFloorCurReceivedFee(@RequestBody QueryStatisticsDto queryStatisticsDto); + + + + /** + * 查询 //todo 欠费追回 hisReceivedFee + * @param queryStatisticsDto + * @return + */ + @RequestMapping(value = "/getFloorHisReceivedFee", method = RequestMethod.POST) + List getFloorHisReceivedFee(@RequestBody QueryStatisticsDto queryStatisticsDto); +} diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java index d85921a66a..5ed2f2acf3 100644 --- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java +++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java @@ -5,15 +5,22 @@ import com.java110.core.context.ICmdDataFlowContext; import com.java110.core.event.cmd.Cmd; import com.java110.core.event.cmd.CmdEvent; +import com.java110.dto.floor.FloorDto; import com.java110.dto.report.QueryStatisticsDto; +import com.java110.dto.report.ReportFloorFeeStatisticsDto; +import com.java110.intf.community.IFloorInnerServiceSMO; import com.java110.report.statistics.IFeeStatistics; +import com.java110.report.statistics.IFloorFeeStatistics; import com.java110.utils.exception.CmdException; import com.java110.utils.util.Assert; +import com.java110.utils.util.ListUtil; import com.java110.vo.ResultVo; import org.springframework.beans.factory.annotation.Autowired; import java.math.BigDecimal; import java.text.ParseException; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -24,7 +31,10 @@ public class QueryReportFloorFeeSummaryCmd extends Cmd { @Autowired - private IFeeStatistics feeStatisticsImpl; + private IFloorFeeStatistics floorFeeStatisticsImpl; + + @Autowired + private IFloorInnerServiceSMO floorInnerServiceSMOImpl; @Override public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { @@ -39,17 +49,67 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso queryStatisticsDto.setCommunityId(reqJson.getString("communityId")); queryStatisticsDto.setStartDate(reqJson.getString("startDate")); queryStatisticsDto.setEndDate(reqJson.getString("endDate")); - if(reqJson.containsKey("endDate") && !reqJson.getString("endDate").contains(":")) { + if (reqJson.containsKey("endDate") && !reqJson.getString("endDate").contains(":")) { queryStatisticsDto.setEndDate(reqJson.getString("endDate") + " 23:59:59"); } queryStatisticsDto.setFeeTypeCd(reqJson.getString("feeTypeCd")); - if(reqJson.containsKey("configIds")){ + if (reqJson.containsKey("configIds")) { queryStatisticsDto.setConfigIds(reqJson.getString("configIds").split(",")); } - List datas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); + //todo 查询楼栋 + FloorDto floorDto = new FloorDto(); + floorDto.setCommunityId(reqJson.getString("communityId")); + List floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto); + + if (ListUtil.isNull(floorDtos)) { + context.setResponseEntity(ResultVo.createResponseEntity(new ArrayList<>())); + return; + } + + List floorIds = new ArrayList<>(); + List datas = new ArrayList<>(); + Map dataInfo = null; + for(FloorDto floorDto1:floorDtos){ + floorIds.add(floorDto1.getFloorId()); + dataInfo = new HashMap<>(); + dataInfo.put("floorId",floorDto1.getFloorId()); + dataInfo.put("floorName",floorDto1.getFloorName()); + dataInfo.put("floorNum",floorDto1.getFloorNum()); + datas.add(dataInfo); + } + queryStatisticsDto.setFloorIds(floorIds.toArray(new String[floorIds.size()])); + + //todo 欠费房屋数 oweRoomCount + List oweRoomCounts = floorFeeStatisticsImpl.getFloorOweRoomCount(queryStatisticsDto); + + //todo 收费房屋数 feeRoomCount + List feeRoomCounts = floorFeeStatisticsImpl.getFloorFeeRoomCount(queryStatisticsDto); + + //todo 实收金额 receivedFee + List receivedFees = floorFeeStatisticsImpl.getFloorReceivedFee(queryStatisticsDto); + + //todo 预收金额 preReceivedFee + List preReceivedFees = floorFeeStatisticsImpl.getFloorPreReceivedFee(queryStatisticsDto); - if(datas == null || datas.size() < 1){ + //todo 历史欠费金额 hisOweFee + List hisOweFees = floorFeeStatisticsImpl.getFloorHisOweFee(queryStatisticsDto); + + //todo 当期应收金额 curReceivableFee + List curReceivableFees = floorFeeStatisticsImpl.getFloorCurReceivableFee(queryStatisticsDto); + + //todo 当期实收金额 curReceivedFee + List curReceivedFees = floorFeeStatisticsImpl.getFloorCurReceivedFee(queryStatisticsDto); + + //todo 欠费追回 hisReceivedFee + List hisReceivedFees = floorFeeStatisticsImpl.getFloorHisOweFee(queryStatisticsDto); + + //todo 拼接数据 + computeData(datas,oweRoomCounts,feeRoomCounts,receivedFees,preReceivedFees,hisOweFees,curReceivableFees,curReceivedFees,hisReceivedFees); + + //List datas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); + + if (datas == null || datas.size() < 1) { context.setResponseEntity(ResultVo.createResponseEntity(datas)); return; } @@ -58,29 +118,119 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso BigDecimal feeRoomRate = null; BigDecimal curReceivedFee = null; BigDecimal curReceivableFee = null; - for(Map data:datas){ + for (Map data : datas) { //todo 计算 户收费率 - if(Double.parseDouble(data.get("feeRoomCount").toString())>0){ + if (Double.parseDouble(data.get("feeRoomCount").toString()) > 0) { feeRoomCountDec = new BigDecimal(Double.parseDouble(data.get("feeRoomCount").toString())); oweRoomCountDec = new BigDecimal(Double.parseDouble(data.get("oweRoomCount").toString())); - feeRoomRate = feeRoomCountDec.subtract(oweRoomCountDec).divide(feeRoomCountDec,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP); - data.put("feeRoomRate",feeRoomRate.doubleValue()); - }else{ - data.put("feeRoomRate",0.0); + feeRoomRate = feeRoomCountDec.subtract(oweRoomCountDec).divide(feeRoomCountDec, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP); + data.put("feeRoomRate", feeRoomRate.doubleValue()); + } else { + data.put("feeRoomRate", 0.0); } //todo 计算 收费率 curReceivedFee = new BigDecimal(Double.parseDouble(data.get("curReceivedFee").toString())); curReceivableFee = new BigDecimal(Double.parseDouble(data.get("curReceivableFee").toString())); - if(curReceivableFee.doubleValue()> 0){ - feeRoomRate = curReceivedFee.divide(curReceivableFee,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP); - data.put("feeRate",feeRoomRate.doubleValue()); - }else{ - data.put("feeRate",0.0); + if (curReceivableFee.doubleValue() > 0) { + feeRoomRate = curReceivedFee.divide(curReceivableFee, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP); + data.put("feeRate", feeRoomRate.doubleValue()); + } else { + data.put("feeRate", 0.0); } } context.setResponseEntity(ResultVo.createResponseEntity(datas)); } + + private void computeData(List datas, List oweRoomCounts, + List feeRoomCounts, + List receivedFees, + List preReceivedFees, + List hisOweFees, + List curReceivableFees, + List curReceivedFees, + List hisReceivedFees) { + //todo 欠费房屋数 oweRoomCount + for(Map data :datas){ + data.put("oweRoomCount","0"); + for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:oweRoomCounts){ + if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ + data.put("oweRoomCount",reportFloorFeeStatisticsDto.getOweRoomCount()); + } + } + } + + //todo 收费房屋数 feeRoomCount + for(Map data :datas){ + data.put("feeRoomCount","0"); + for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:feeRoomCounts){ + if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ + data.put("feeRoomCount",reportFloorFeeStatisticsDto.getFeeRoomCount()); + } + } + } + + //todo 实收金额 receivedFee + for(Map data :datas){ + data.put("receivedFee","0"); + for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:receivedFees){ + if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ + data.put("receivedFee",reportFloorFeeStatisticsDto.getReceivedFee()); + } + } + } + + //todo 预收金额 preReceivedFee + for(Map data :datas){ + data.put("preReceivedFee","0"); + for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:preReceivedFees){ + if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ + data.put("preReceivedFee",reportFloorFeeStatisticsDto.getPreReceivedFee()); + } + } + } + + + //todo 历史欠费金额 hisOweFee + for(Map data :datas){ + data.put("hisOweFee","0"); + for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:hisOweFees){ + if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ + data.put("hisOweFee",reportFloorFeeStatisticsDto.getHisOweFee()); + } + } + } + + //todo 当期应收金额 curReceivableFee + for(Map data :datas){ + data.put("curReceivableFee","0"); + for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:curReceivableFees){ + if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ + data.put("curReceivableFee",reportFloorFeeStatisticsDto.getCurReceivableFee()); + } + } + } + + //todo 当期实收金额 curReceivedFee + + for(Map data :datas){ + data.put("curReceivedFee","0"); + for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:curReceivedFees){ + if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ + data.put("curReceivedFee",reportFloorFeeStatisticsDto.getCurReceivedFee()); + } + } + } + //todo 欠费追回 hisReceivedFee + for(Map data :datas){ + data.put("hisReceivedFee","0"); + for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:hisReceivedFees){ + if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ + data.put("hisReceivedFee",reportFloorFeeStatisticsDto.getHisReceivedFee()); + } + } + } + } } diff --git a/service-report/src/main/java/com/java110/report/dao/IReportFloorFeeStatisticsServiceDao.java b/service-report/src/main/java/com/java110/report/dao/IReportFloorFeeStatisticsServiceDao.java new file mode 100644 index 0000000000..e206ced24e --- /dev/null +++ b/service-report/src/main/java/com/java110/report/dao/IReportFloorFeeStatisticsServiceDao.java @@ -0,0 +1,26 @@ +package com.java110.report.dao; + +import java.util.List; +import java.util.Map; + +/** + * 费用统计 dao 层 + */ +public interface IReportFloorFeeStatisticsServiceDao { + + List getFloorOweRoomCount(Map info); + + List getFloorFeeRoomCount(Map info); + + List getFloorReceivedFee(Map info); + + List getFloorPreReceivedFee(Map info); + + List getFloorHisOweFee(Map info); + + List getFloorCurReceivableFee(Map info); + + List getFloorCurReceivedFee(Map info); + + List getFloorHisReceivedFee(Map info); +} diff --git a/service-report/src/main/java/com/java110/report/dao/impl/ReportFloorFeeStatisticsServiceDaoImpl.java b/service-report/src/main/java/com/java110/report/dao/impl/ReportFloorFeeStatisticsServiceDaoImpl.java new file mode 100644 index 0000000000..e5b079ab0d --- /dev/null +++ b/service-report/src/main/java/com/java110/report/dao/impl/ReportFloorFeeStatisticsServiceDaoImpl.java @@ -0,0 +1,74 @@ +package com.java110.report.dao.impl; + +import com.java110.core.base.dao.BaseServiceDao; +import com.java110.core.log.LoggerFactory; +import com.java110.report.dao.IReportFloorFeeStatisticsServiceDao; +import org.slf4j.Logger; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName ReportCommunityServiceDaoImpl + * @Description TODO + * @Author wuxw + * @Date 2020/10/15 22:15 + * @Version 1.0 + * add by wuxw 2020/10/15 + **/ +@Service("reportFloorFeeStatisticsServiceDaoImpl") +public class ReportFloorFeeStatisticsServiceDaoImpl extends BaseServiceDao implements IReportFloorFeeStatisticsServiceDao { + + private static Logger logger = LoggerFactory.getLogger(ReportFloorFeeStatisticsServiceDaoImpl.class); + + + + @Override + public List getFloorOweRoomCount(Map info) { + List infos = sqlSessionTemplate.selectList("reportFloorFeeStatisticsServiceDaoImpl.getFloorOweRoomCount", info); + return infos; + } + + @Override + public List getFloorFeeRoomCount(Map info) { + List infos = sqlSessionTemplate.selectList("reportFloorFeeStatisticsServiceDaoImpl.getFloorFeeRoomCount", info); + return infos; + } + + @Override + public List getFloorReceivedFee(Map info) { + List infos = sqlSessionTemplate.selectList("reportFloorFeeStatisticsServiceDaoImpl.getFloorReceivedFee", info); + return infos; + } + + @Override + public List getFloorPreReceivedFee(Map info) { + List infos = sqlSessionTemplate.selectList("reportFloorFeeStatisticsServiceDaoImpl.getFloorPreReceivedFee", info); + return infos; + } + + @Override + public List getFloorHisOweFee(Map info) { + List infos = sqlSessionTemplate.selectList("reportFloorFeeStatisticsServiceDaoImpl.getFloorHisOweFee", info); + return infos; + } + + @Override + public List getFloorCurReceivableFee(Map info) { + List infos = sqlSessionTemplate.selectList("reportFloorFeeStatisticsServiceDaoImpl.getFloorCurReceivableFee", info); + return infos; + } + + @Override + public List getFloorCurReceivedFee(Map info) { + List infos = sqlSessionTemplate.selectList("reportFloorFeeStatisticsServiceDaoImpl.getFloorCurReceivedFee", info); + return infos; + } + + @Override + public List getFloorHisReceivedFee(Map info) { + List infos = sqlSessionTemplate.selectList("reportFloorFeeStatisticsServiceDaoImpl.getFloorHisReceivedFee", info); + return infos; + } +} diff --git a/service-report/src/main/java/com/java110/report/smo/impl/ReportFloorFeeStatisticsInnerServiceSMOImpl.java b/service-report/src/main/java/com/java110/report/smo/impl/ReportFloorFeeStatisticsInnerServiceSMOImpl.java new file mode 100644 index 0000000000..5f3d5e0cc4 --- /dev/null +++ b/service-report/src/main/java/com/java110/report/smo/impl/ReportFloorFeeStatisticsInnerServiceSMOImpl.java @@ -0,0 +1,80 @@ +package com.java110.report.smo.impl; + + +import com.java110.core.base.smo.BaseServiceSMO; +import com.java110.dto.report.QueryStatisticsDto; +import com.java110.dto.report.ReportFloorFeeStatisticsDto; +import com.java110.intf.report.IReportFloorFeeStatisticsInnerServiceSMO; +import com.java110.report.dao.IReportFloorFeeStatisticsServiceDao; +import com.java110.utils.util.BeanConvertUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName ReportFeeStatisticsInnerServiceSMOImpl + * @Description 费用统计类 + * @Author wuxw + * @Date 2019/4/24 9:20 + * @Version 1.0 + * add by wuxw 2019/4/24 + **/ +@RestController +public class ReportFloorFeeStatisticsInnerServiceSMOImpl extends BaseServiceSMO implements IReportFloorFeeStatisticsInnerServiceSMO { + + @Autowired + private IReportFloorFeeStatisticsServiceDao reportFloorFeeStatisticsServiceDaoImpl; + + + + @Override + public List getFloorOweRoomCount(@RequestBody QueryStatisticsDto queryStatisticsDto) { + List data = reportFloorFeeStatisticsServiceDaoImpl.getFloorOweRoomCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto)); + return BeanConvertUtil.covertBeanList(data, ReportFloorFeeStatisticsDto.class); + } + + @Override + public List getFloorFeeRoomCount(@RequestBody QueryStatisticsDto queryStatisticsDto) { + List data = reportFloorFeeStatisticsServiceDaoImpl.getFloorFeeRoomCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto)); + return BeanConvertUtil.covertBeanList(data, ReportFloorFeeStatisticsDto.class); + } + + @Override + public List getFloorReceivedFee(@RequestBody QueryStatisticsDto queryStatisticsDto) { + List data = reportFloorFeeStatisticsServiceDaoImpl.getFloorReceivedFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto)); + return BeanConvertUtil.covertBeanList(data, ReportFloorFeeStatisticsDto.class); + } + + @Override + public List getFloorPreReceivedFee(@RequestBody QueryStatisticsDto queryStatisticsDto) { + List data = reportFloorFeeStatisticsServiceDaoImpl.getFloorPreReceivedFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto)); + return BeanConvertUtil.covertBeanList(data, ReportFloorFeeStatisticsDto.class); + } + + @Override + public List getFloorHisOweFee(@RequestBody QueryStatisticsDto queryStatisticsDto) { + List data = reportFloorFeeStatisticsServiceDaoImpl.getFloorHisOweFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto)); + return BeanConvertUtil.covertBeanList(data, ReportFloorFeeStatisticsDto.class); + } + + @Override + public List getFloorCurReceivableFee(@RequestBody QueryStatisticsDto queryStatisticsDto) { + List data = reportFloorFeeStatisticsServiceDaoImpl.getFloorCurReceivableFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto)); + return BeanConvertUtil.covertBeanList(data, ReportFloorFeeStatisticsDto.class); + } + + @Override + public List getFloorCurReceivedFee(@RequestBody QueryStatisticsDto queryStatisticsDto) { + List data = reportFloorFeeStatisticsServiceDaoImpl.getFloorCurReceivedFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto)); + return BeanConvertUtil.covertBeanList(data, ReportFloorFeeStatisticsDto.class); + } + + @Override + public List getFloorHisReceivedFee(@RequestBody QueryStatisticsDto queryStatisticsDto) { + List data = reportFloorFeeStatisticsServiceDaoImpl.getFloorHisReceivedFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto)); + return BeanConvertUtil.covertBeanList(data, ReportFloorFeeStatisticsDto.class); + } +} diff --git a/service-report/src/main/java/com/java110/report/statistics/IFloorFeeStatistics.java b/service-report/src/main/java/com/java110/report/statistics/IFloorFeeStatistics.java new file mode 100644 index 0000000000..05793cb0f4 --- /dev/null +++ b/service-report/src/main/java/com/java110/report/statistics/IFloorFeeStatistics.java @@ -0,0 +1,91 @@ +package com.java110.report.statistics; + +import com.java110.dto.report.QueryStatisticsDto; +import com.java110.dto.report.ReportFloorFeeStatisticsDto; + +import java.util.List; + +/** + * 楼栋费用统计 + */ +public interface IFloorFeeStatistics { + + /** + * 查询 //todo 欠费房屋数 oweRoomCount + * @param queryStatisticsDto + * @return + */ + List getFloorOweRoomCount(QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 收费房屋数 feeRoomCount + * @param queryStatisticsDto + * @return + */ + List getFloorFeeRoomCount(QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 实收金额 receivedFee + * @param queryStatisticsDto + * @return + */ + List getFloorReceivedFee(QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 预收金额 preReceivedFee + * @param queryStatisticsDto + * @return + */ + List getFloorPreReceivedFee(QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 历史欠费金额 hisOweFee + * @param queryStatisticsDto + * @return + */ + List getFloorHisOweFee(QueryStatisticsDto queryStatisticsDto); + + + /** + * 查询 //todo 当期应收金额 curReceivableFee + * @param queryStatisticsDto + * @return + */ + List getFloorCurReceivableFee(QueryStatisticsDto queryStatisticsDto); + + + + + + + /** + * 查询 //todo 当期实收金额 curReceivedFee + * @param queryStatisticsDto + * @return + */ + List getFloorCurReceivedFee(QueryStatisticsDto queryStatisticsDto); + + + + /** + * 查询 //todo 欠费追回 hisReceivedFee + * @param queryStatisticsDto + * @return + */ + List getFloorHisReceivedFee(QueryStatisticsDto queryStatisticsDto); + + + + + + + + + + + +} diff --git a/service-report/src/main/java/com/java110/report/statistics/impl/FloorFeeStatisticsImpl.java b/service-report/src/main/java/com/java110/report/statistics/impl/FloorFeeStatisticsImpl.java new file mode 100644 index 0000000000..db23f7204b --- /dev/null +++ b/service-report/src/main/java/com/java110/report/statistics/impl/FloorFeeStatisticsImpl.java @@ -0,0 +1,57 @@ +package com.java110.report.statistics.impl; + +import com.java110.dto.report.QueryStatisticsDto; +import com.java110.dto.report.ReportFloorFeeStatisticsDto; +import com.java110.intf.report.IReportFloorFeeStatisticsInnerServiceSMO; +import com.java110.report.statistics.IFloorFeeStatistics; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FloorFeeStatisticsImpl implements IFloorFeeStatistics { + @Autowired + private IReportFloorFeeStatisticsInnerServiceSMO reportFloorFeeStatisticsInnerServiceSMOImpl; + @Override + public List getFloorOweRoomCount(QueryStatisticsDto queryStatisticsDto) { + return reportFloorFeeStatisticsInnerServiceSMOImpl.getFloorOweRoomCount(queryStatisticsDto); + } + + @Override + public List getFloorFeeRoomCount(QueryStatisticsDto queryStatisticsDto) { + return reportFloorFeeStatisticsInnerServiceSMOImpl.getFloorFeeRoomCount(queryStatisticsDto); + } + + @Override + public List getFloorReceivedFee(QueryStatisticsDto queryStatisticsDto) { + return reportFloorFeeStatisticsInnerServiceSMOImpl.getFloorReceivedFee(queryStatisticsDto); + + } + + @Override + public List getFloorPreReceivedFee(QueryStatisticsDto queryStatisticsDto) { + return reportFloorFeeStatisticsInnerServiceSMOImpl.getFloorPreReceivedFee(queryStatisticsDto); + } + + @Override + public List getFloorHisOweFee(QueryStatisticsDto queryStatisticsDto) { + return reportFloorFeeStatisticsInnerServiceSMOImpl.getFloorHisOweFee(queryStatisticsDto); + + } + + @Override + public List getFloorCurReceivableFee(QueryStatisticsDto queryStatisticsDto) { + return reportFloorFeeStatisticsInnerServiceSMOImpl.getFloorCurReceivableFee(queryStatisticsDto); + } + + @Override + public List getFloorCurReceivedFee(QueryStatisticsDto queryStatisticsDto) { + return reportFloorFeeStatisticsInnerServiceSMOImpl.getFloorCurReceivedFee(queryStatisticsDto); + } + + @Override + public List getFloorHisReceivedFee(QueryStatisticsDto queryStatisticsDto) { + return reportFloorFeeStatisticsInnerServiceSMOImpl.getFloorHisReceivedFee(queryStatisticsDto); + } +} From 288213ec6f39905321bd02c5e6acb80a74fcb8e3 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 02:44:42 +0800 Subject: [PATCH 21/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8C=89=E6=B5=81?= =?UTF-8?q?=E5=8A=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eportFeeStatisticsServiceDaoImplMapper.xml | 3 + .../QueryReportFloorFeeSummaryCmd.java | 125 +++++++----------- 2 files changed, 53 insertions(+), 75 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index dd2b7a48aa..4858eeaeeb 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -546,6 +546,9 @@ where 1=1 and a.status_cd = '0' and a.community_id = #{communityId} + + and a.floor_id = #{floorId} + order by a.seq diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java index 5ed2f2acf3..6cbb08af31 100644 --- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java +++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java @@ -33,6 +33,9 @@ public class QueryReportFloorFeeSummaryCmd extends Cmd { @Autowired private IFloorFeeStatistics floorFeeStatisticsImpl; + @Autowired + private IFeeStatistics feeStatisticsImpl; + @Autowired private IFloorInnerServiceSMO floorInnerServiceSMOImpl; @@ -67,45 +70,17 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso return; } - List floorIds = new ArrayList<>(); List datas = new ArrayList<>(); - Map dataInfo = null; - for(FloorDto floorDto1:floorDtos){ - floorIds.add(floorDto1.getFloorId()); - dataInfo = new HashMap<>(); - dataInfo.put("floorId",floorDto1.getFloorId()); - dataInfo.put("floorName",floorDto1.getFloorName()); - dataInfo.put("floorNum",floorDto1.getFloorNum()); - datas.add(dataInfo); - } - queryStatisticsDto.setFloorIds(floorIds.toArray(new String[floorIds.size()])); - - //todo 欠费房屋数 oweRoomCount - List oweRoomCounts = floorFeeStatisticsImpl.getFloorOweRoomCount(queryStatisticsDto); - - //todo 收费房屋数 feeRoomCount - List feeRoomCounts = floorFeeStatisticsImpl.getFloorFeeRoomCount(queryStatisticsDto); - - //todo 实收金额 receivedFee - List receivedFees = floorFeeStatisticsImpl.getFloorReceivedFee(queryStatisticsDto); - - //todo 预收金额 preReceivedFee - List preReceivedFees = floorFeeStatisticsImpl.getFloorPreReceivedFee(queryStatisticsDto); - - //todo 历史欠费金额 hisOweFee - List hisOweFees = floorFeeStatisticsImpl.getFloorHisOweFee(queryStatisticsDto); - - //todo 当期应收金额 curReceivableFee - List curReceivableFees = floorFeeStatisticsImpl.getFloorCurReceivableFee(queryStatisticsDto); - - //todo 当期实收金额 curReceivedFee - List curReceivedFees = floorFeeStatisticsImpl.getFloorCurReceivedFee(queryStatisticsDto); - //todo 欠费追回 hisReceivedFee - List hisReceivedFees = floorFeeStatisticsImpl.getFloorHisOweFee(queryStatisticsDto); + for (FloorDto floorDto1 : floorDtos) { + queryStatisticsDto.setFloorId(floorDto1.getFloorId()); + List floorDatas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); + if (!ListUtil.isNull(floorDatas)) { + datas.add(floorDatas.get(0)); + } + } //todo 拼接数据 - computeData(datas,oweRoomCounts,feeRoomCounts,receivedFees,preReceivedFees,hisOweFees,curReceivableFees,curReceivedFees,hisReceivedFees); //List datas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); @@ -153,82 +128,82 @@ private void computeData(List datas, List oweR List curReceivedFees, List hisReceivedFees) { //todo 欠费房屋数 oweRoomCount - for(Map data :datas){ - data.put("oweRoomCount","0"); - for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:oweRoomCounts){ - if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ - data.put("oweRoomCount",reportFloorFeeStatisticsDto.getOweRoomCount()); + for (Map data : datas) { + data.put("oweRoomCount", "0"); + for (ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto : oweRoomCounts) { + if (reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))) { + data.put("oweRoomCount", reportFloorFeeStatisticsDto.getOweRoomCount()); } } } //todo 收费房屋数 feeRoomCount - for(Map data :datas){ - data.put("feeRoomCount","0"); - for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:feeRoomCounts){ - if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ - data.put("feeRoomCount",reportFloorFeeStatisticsDto.getFeeRoomCount()); + for (Map data : datas) { + data.put("feeRoomCount", "0"); + for (ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto : feeRoomCounts) { + if (reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))) { + data.put("feeRoomCount", reportFloorFeeStatisticsDto.getFeeRoomCount()); } } } //todo 实收金额 receivedFee - for(Map data :datas){ - data.put("receivedFee","0"); - for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:receivedFees){ - if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ - data.put("receivedFee",reportFloorFeeStatisticsDto.getReceivedFee()); + for (Map data : datas) { + data.put("receivedFee", "0"); + for (ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto : receivedFees) { + if (reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))) { + data.put("receivedFee", reportFloorFeeStatisticsDto.getReceivedFee()); } } } //todo 预收金额 preReceivedFee - for(Map data :datas){ - data.put("preReceivedFee","0"); - for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:preReceivedFees){ - if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ - data.put("preReceivedFee",reportFloorFeeStatisticsDto.getPreReceivedFee()); + for (Map data : datas) { + data.put("preReceivedFee", "0"); + for (ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto : preReceivedFees) { + if (reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))) { + data.put("preReceivedFee", reportFloorFeeStatisticsDto.getPreReceivedFee()); } } } //todo 历史欠费金额 hisOweFee - for(Map data :datas){ - data.put("hisOweFee","0"); - for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:hisOweFees){ - if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ - data.put("hisOweFee",reportFloorFeeStatisticsDto.getHisOweFee()); + for (Map data : datas) { + data.put("hisOweFee", "0"); + for (ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto : hisOweFees) { + if (reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))) { + data.put("hisOweFee", reportFloorFeeStatisticsDto.getHisOweFee()); } } } //todo 当期应收金额 curReceivableFee - for(Map data :datas){ - data.put("curReceivableFee","0"); - for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:curReceivableFees){ - if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ - data.put("curReceivableFee",reportFloorFeeStatisticsDto.getCurReceivableFee()); + for (Map data : datas) { + data.put("curReceivableFee", "0"); + for (ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto : curReceivableFees) { + if (reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))) { + data.put("curReceivableFee", reportFloorFeeStatisticsDto.getCurReceivableFee()); } } } //todo 当期实收金额 curReceivedFee - for(Map data :datas){ - data.put("curReceivedFee","0"); - for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:curReceivedFees){ - if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ - data.put("curReceivedFee",reportFloorFeeStatisticsDto.getCurReceivedFee()); + for (Map data : datas) { + data.put("curReceivedFee", "0"); + for (ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto : curReceivedFees) { + if (reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))) { + data.put("curReceivedFee", reportFloorFeeStatisticsDto.getCurReceivedFee()); } } } //todo 欠费追回 hisReceivedFee - for(Map data :datas){ - data.put("hisReceivedFee","0"); - for(ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto:hisReceivedFees){ - if(reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))){ - data.put("hisReceivedFee",reportFloorFeeStatisticsDto.getHisReceivedFee()); + for (Map data : datas) { + data.put("hisReceivedFee", "0"); + for (ReportFloorFeeStatisticsDto reportFloorFeeStatisticsDto : hisReceivedFees) { + if (reportFloorFeeStatisticsDto.getFloorId().equals(data.get("floorId"))) { + data.put("hisReceivedFee", reportFloorFeeStatisticsDto.getHisReceivedFee()); } } } From 8fdf21bb51e894565e19078add363b39a4985c73 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 02:52:08 +0800 Subject: [PATCH 22/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8C=89=E6=B5=81?= =?UTF-8?q?=E5=8A=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QueryReportFloorFeeSummaryCmd.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java index 6cbb08af31..b8c60525d9 100644 --- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java +++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java @@ -5,6 +5,7 @@ import com.java110.core.context.ICmdDataFlowContext; import com.java110.core.event.cmd.Cmd; import com.java110.core.event.cmd.CmdEvent; +import com.java110.core.factory.Java110ThreadPoolFactory; import com.java110.dto.floor.FloorDto; import com.java110.dto.report.QueryStatisticsDto; import com.java110.dto.report.ReportFloorFeeStatisticsDto; @@ -71,12 +72,24 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso } List datas = new ArrayList<>(); - - for (FloorDto floorDto1 : floorDtos) { - queryStatisticsDto.setFloorId(floorDto1.getFloorId()); - List floorDatas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); - if (!ListUtil.isNull(floorDatas)) { - datas.add(floorDatas.get(0)); + Java110ThreadPoolFactory java110ThreadPoolFactory = null; + try { + java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(5); + for (FloorDto floorDto1 : floorDtos) { + queryStatisticsDto.setFloorId(floorDto1.getFloorId()); + java110ThreadPoolFactory.submit(() -> { + //todo 欠费户数 + List floorDatas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); + if (!ListUtil.isNull(floorDatas)) { + datas.add(floorDatas.get(0)); + } + return datas; + }); + } + java110ThreadPoolFactory.get(); + } finally { + if (java110ThreadPoolFactory != null) { + java110ThreadPoolFactory.stop(); } } From c36e5fe7a36a9ee736c15c9766795382aa11ede9 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 03:06:56 +0800 Subject: [PATCH 23/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8C=89=E6=B5=81?= =?UTF-8?q?=E5=8A=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QueryReportFloorFeeSummaryCmd.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java index b8c60525d9..fb35425b13 100644 --- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java +++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java @@ -64,6 +64,10 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso //todo 查询楼栋 FloorDto floorDto = new FloorDto(); floorDto.setCommunityId(reqJson.getString("communityId")); + if(reqJson.containsKey("page")) { + floorDto.setPage(reqJson.getIntValue("page")); + floorDto.setRow(reqJson.getIntValue("row")); + } List floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto); if (ListUtil.isNull(floorDtos)) { @@ -77,9 +81,10 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(5); for (FloorDto floorDto1 : floorDtos) { queryStatisticsDto.setFloorId(floorDto1.getFloorId()); + QueryStatisticsDto tmpQueryStatisticsDto = queryStatisticsDto; java110ThreadPoolFactory.submit(() -> { //todo 欠费户数 - List floorDatas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); + List floorDatas = feeStatisticsImpl.getFloorFeeSummary(tmpQueryStatisticsDto); if (!ListUtil.isNull(floorDatas)) { datas.add(floorDatas.get(0)); } From 05a7bd779ec83e2377ea88d631e462ca36efda0a Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 03:10:59 +0800 Subject: [PATCH 24/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8C=89=E6=B5=81?= =?UTF-8?q?=E5=8A=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QueryReportFloorFeeSummaryCmd.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java index fb35425b13..0c4e6da240 100644 --- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java +++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java @@ -14,6 +14,7 @@ import com.java110.report.statistics.IFloorFeeStatistics; import com.java110.utils.exception.CmdException; import com.java110.utils.util.Assert; +import com.java110.utils.util.BeanConvertUtil; import com.java110.utils.util.ListUtil; import com.java110.vo.ResultVo; import org.springframework.beans.factory.annotation.Autowired; @@ -81,7 +82,7 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(5); for (FloorDto floorDto1 : floorDtos) { queryStatisticsDto.setFloorId(floorDto1.getFloorId()); - QueryStatisticsDto tmpQueryStatisticsDto = queryStatisticsDto; + QueryStatisticsDto tmpQueryStatisticsDto = BeanConvertUtil.covertBean(queryStatisticsDto,QueryStatisticsDto.class); java110ThreadPoolFactory.submit(() -> { //todo 欠费户数 List floorDatas = feeStatisticsImpl.getFloorFeeSummary(tmpQueryStatisticsDto); From ade7cb42271e7f831494a185aa193d67bdac8b35 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 10:52:52 +0800 Subject: [PATCH 25/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java index 65b8e04271..fc6fcc6b05 100644 --- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java +++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java @@ -80,7 +80,7 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso Java110ThreadPoolFactory java110ThreadPoolFactory = null; try { - java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(9); + java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(5); java110ThreadPoolFactory.submit(() -> { //todo 查询历史欠费 double hisOweFee = feeStatisticsImpl.getHisMonthOweFee(queryStatisticsDto); From 8a605a8595ed3896b957d00a597310f373f653fc Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 11:12:14 +0800 Subject: [PATCH 26/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eportFeeStatisticsServiceDaoImplMapper.xml | 88 +------------------ .../QueryReportFloorFeeSummaryCmd.java | 72 +++++++-------- 2 files changed, 37 insertions(+), 123 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index 4858eeaeeb..8327b61f37 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -416,70 +416,6 @@ where b.floor_id = a.floor_id ) feeRoomCount, ( - select ifnull(sum(t.received_amount),0.0) receivedFee - from pay_fee_detail t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - LEFT JOIN building_room br on pf.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - where - 1=1 - and bu.floor_id = a.floor_id - and t.status_cd = '0' - and t.community_id= a.community_id - and t.create_time > #{startDate} - and t.create_time < #{endDate} - - and pf.config_id in - - #{item} - - - - and pf.fee_type_cd = #{feeTypeCd} - - ) receivedFee, - ( - select ifnull(sum(t.received_amount),0.0) preReceivedFee - from pay_fee_detail_month t - where - 1=1 - and t.obj_fpc_id = a.floor_id - and t.status_cd = '0' - and t.community_id= a.community_id - and t.pay_fee_time > #{startDate} - and t.pay_fee_time < #{endDate} - and t.cur_month_time >= #{endDate} - - and t.config_id in - - #{item} - - - - and t.fee_type_cd = #{feeTypeCd} - - ) preReceivedFee, - ( - select ifnull(sum(t.receivable_amount),0.0) hisOweFee - from pay_fee_detail_month t - where - 1=1 - and t.obj_fpc_id = a.floor_id - and t.status_cd = '0' - and t.community_id= a.community_id - and t.detail_id = '-1' - and t.cur_month_time < #{startDate} - - and t.config_id in - - #{item} - - - - and t.fee_type_cd = #{feeTypeCd} - - ) hisOweFee, - ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee from pay_fee_detail_month t where @@ -519,29 +455,7 @@ and t.fee_type_cd = #{feeTypeCd} - ) curReceivedFee, - ( - select ifnull(sum(t.received_amount),0.0) hisReceivedFee - from pay_fee_detail_month t - where - 1=1 - and t.obj_fpc_id = a.floor_id - and t.status_cd = '0' - and t.community_id= a.community_id - and t.pay_fee_time > #{startDate} - and t.pay_fee_time < #{endDate} - and t.cur_month_time < #{startDate} - and t.detail_id != '-1' - - and t.config_id in - - #{item} - - - - and t.fee_type_cd = #{feeTypeCd} - - ) hisReceivedFee + ) curReceivedFee from f_floor a where 1=1 and a.status_cd = '0' diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java index 0c4e6da240..0cbb8ac8dd 100644 --- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java +++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java @@ -63,45 +63,45 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso } //todo 查询楼栋 - FloorDto floorDto = new FloorDto(); - floorDto.setCommunityId(reqJson.getString("communityId")); - if(reqJson.containsKey("page")) { - floorDto.setPage(reqJson.getIntValue("page")); - floorDto.setRow(reqJson.getIntValue("row")); - } - List floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto); - - if (ListUtil.isNull(floorDtos)) { - context.setResponseEntity(ResultVo.createResponseEntity(new ArrayList<>())); - return; - } - - List datas = new ArrayList<>(); - Java110ThreadPoolFactory java110ThreadPoolFactory = null; - try { - java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(5); - for (FloorDto floorDto1 : floorDtos) { - queryStatisticsDto.setFloorId(floorDto1.getFloorId()); - QueryStatisticsDto tmpQueryStatisticsDto = BeanConvertUtil.covertBean(queryStatisticsDto,QueryStatisticsDto.class); - java110ThreadPoolFactory.submit(() -> { - //todo 欠费户数 - List floorDatas = feeStatisticsImpl.getFloorFeeSummary(tmpQueryStatisticsDto); - if (!ListUtil.isNull(floorDatas)) { - datas.add(floorDatas.get(0)); - } - return datas; - }); - } - java110ThreadPoolFactory.get(); - } finally { - if (java110ThreadPoolFactory != null) { - java110ThreadPoolFactory.stop(); - } - } +// FloorDto floorDto = new FloorDto(); +// floorDto.setCommunityId(reqJson.getString("communityId")); +// if(reqJson.containsKey("page")) { +// floorDto.setPage(reqJson.getIntValue("page")); +// floorDto.setRow(reqJson.getIntValue("row")); +// } +// List floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto); +// +// if (ListUtil.isNull(floorDtos)) { +// context.setResponseEntity(ResultVo.createResponseEntity(new ArrayList<>())); +// return; +// } + +// List datas = new ArrayList<>(); +// Java110ThreadPoolFactory java110ThreadPoolFactory = null; +// try { +// java110ThreadPoolFactory = Java110ThreadPoolFactory.getInstance().createThreadPool(5); +// for (FloorDto floorDto1 : floorDtos) { +// queryStatisticsDto.setFloorId(floorDto1.getFloorId()); +// QueryStatisticsDto tmpQueryStatisticsDto = BeanConvertUtil.covertBean(queryStatisticsDto,QueryStatisticsDto.class); +// java110ThreadPoolFactory.submit(() -> { +// //todo 欠费户数 +// List floorDatas = feeStatisticsImpl.getFloorFeeSummary(tmpQueryStatisticsDto); +// if (!ListUtil.isNull(floorDatas)) { +// datas.add(floorDatas.get(0)); +// } +// return datas; +// }); +// } +// java110ThreadPoolFactory.get(); +// } finally { +// if (java110ThreadPoolFactory != null) { +// java110ThreadPoolFactory.stop(); +// } +// } //todo 拼接数据 - //List datas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); + List datas = feeStatisticsImpl.getFloorFeeSummary(queryStatisticsDto); if (datas == null || datas.size() < 1) { context.setResponseEntity(ResultVo.createResponseEntity(datas)); From b43094848b1f2efe96d95c3506917c308ba01521 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 13:57:49 +0800 Subject: [PATCH 27/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index 8327b61f37..f4e239e73d 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -417,7 +417,7 @@ ) feeRoomCount, ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee - from pay_fee_detail_month t + from pay_fee_detail_month t force index(i_pay_fee_detail_co) where 1=1 and t.obj_fpc_id = a.floor_id @@ -437,7 +437,7 @@ ) curReceivableFee, ( select ifnull(sum(t.receivable_amount),0.0) curReceivedFee - from pay_fee_detail_month t + from pay_fee_detail_month t force index(i_pay_fee_detail_co) where 1=1 and t.obj_fpc_id = a.floor_id From 0ac5016216d02f0b15bf9425bc592494d452a8ae Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 14:22:37 +0800 Subject: [PATCH 28/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index f4e239e73d..8327b61f37 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -417,7 +417,7 @@ ) feeRoomCount, ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee - from pay_fee_detail_month t force index(i_pay_fee_detail_co) + from pay_fee_detail_month t where 1=1 and t.obj_fpc_id = a.floor_id @@ -437,7 +437,7 @@ ) curReceivableFee, ( select ifnull(sum(t.receivable_amount),0.0) curReceivedFee - from pay_fee_detail_month t force index(i_pay_fee_detail_co) + from pay_fee_detail_month t where 1=1 and t.obj_fpc_id = a.floor_id From 4298412d9bedb05235b16192309b74958d0ea783 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 14:38:34 +0800 Subject: [PATCH 29/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eportFeeStatisticsServiceDaoImplMapper.xml | 92 +------------------ 1 file changed, 2 insertions(+), 90 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index 8327b61f37..3510d19e47 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -520,73 +520,7 @@ ) b where b.fee_type_cd = a.status_cd ) feeRoomCount, - ( - select ifnull(sum(t.received_amount),0.0) receivedFee - from pay_fee_detail t - INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' - - LEFT JOIN building_room br on pf.payer_obj_id = br.room_id and br.status_cd = '0' - left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' - - where - 1=1 - - and bu.floor_id = #{floorId} - - and t.status_cd = '0' - and t.community_id= #{communityId} - and t.create_time > #{startDate} - and t.create_time < #{endDate} - - and pf.config_id in - - #{item} - - - and pf.fee_type_cd = a.status_cd - ) receivedFee, - ( - select ifnull(sum(t.received_amount),0.0) preReceivedFee - from pay_fee_detail_month t - where - 1=1 - - and t.obj_fpc_id = #{floorId} - - and t.status_cd = '0' - and t.community_id= #{communityId} - and t.pay_fee_time > #{startDate} - and t.pay_fee_time < #{endDate} - and t.cur_month_time >= #{endDate} - and t.detail_id != '-1' - - and t.config_id in - - #{item} - - - and t.fee_type_cd = a.status_cd - ) preReceivedFee, - ( - select ifnull(sum(t.receivable_amount),0.0) hisOweFee - from pay_fee_detail_month t - where - 1=1 - - and t.obj_fpc_id = #{floorId} - - and t.status_cd = '0' - and t.community_id= #{communityId} - and t.detail_id = '-1' - and t.cur_month_time < #{startDate} - - and t.config_id in - - #{item} - - - and t.fee_type_cd = a.status_cd - ) hisOweFee, + ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee from pay_fee_detail_month t @@ -627,29 +561,7 @@ and t.fee_type_cd = a.status_cd - ) curReceivedFee, - ( - select ifnull(sum(t.received_amount),0.0) hisReceivedFee - from pay_fee_detail_month t - where - 1=1 - - and t.obj_fpc_id = #{floorId} - - and t.status_cd = '0' - and t.community_id= #{communityId} - and t.pay_fee_time > #{startDate} - and t.pay_fee_time < #{endDate} - and t.cur_month_time < #{startDate} - and t.detail_id != '-1' - - and t.config_id in - - #{item} - - - and t.fee_type_cd = a.status_cd - ) hisReceivedFee + ) curReceivedFee from t_dict a where 1=1 and a.table_name = 'pay_fee_config' From bdbe0a7078fec90cc0828cecccbe6c1a0f639e5f Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 15:01:54 +0800 Subject: [PATCH 30/37] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index 3510d19e47..fea7f8316c 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -523,7 +523,7 @@ ( select ifnull(sum(t.receivable_amount),0.0) curReceivableFee - from pay_fee_detail_month t + from pay_fee_detail_month t force index(i_pay_fee_detail_fc) where 1=1 @@ -543,7 +543,7 @@ ) curReceivableFee, ( select ifnull(sum(t.receivable_amount),0.0) curReceivedFee - from pay_fee_detail_month t + from pay_fee_detail_month t force index(i_pay_fee_detail_fc) where 1=1 From 71972c9a3e400354e94cd7f1babc3542318ec43b Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 17:50:55 +0800 Subject: [PATCH 31/37] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index fea7f8316c..d2a11ff9f8 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -7,7 +7,7 @@ select ifnull(sum(t.receivable_amount),0.0) hisOweFee - from pay_fee_detail_month t force index(i_pfdm_cur_month_time) + from pay_fee_detail_month t where 1=1 From b0162e0b8ed77cf81bd52739e80497edd25abffa Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 23 Feb 2024 18:28:33 +0800 Subject: [PATCH 33/37] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eportFeeStatisticsServiceDaoImplMapper.xml | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml index fea7f8316c..cbbc791e47 100644 --- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml @@ -469,6 +469,47 @@