fix:80462
This commit is contained in:
+2
@@ -34,4 +34,6 @@ public interface PayMeetingSituationMapper extends BaseMapper<PayMeetingSituatio
|
||||
IPage<MeetingPackStatistics> getMeetingPackStatistics(Page<PayMeetingSituation> page,@Param(Constants.WRAPPER) QueryWrapper<PayMeetingSituation> query);
|
||||
|
||||
List<MeetingPackStatistics> getMeetingPackStatistics(@Param(Constants.WRAPPER) QueryWrapper<PayMeetingSituation> query);
|
||||
|
||||
MeetingPackStatistics getMeetingPackStatisticsCount(@Param(Constants.WRAPPER) QueryWrapper<PayMeetingSituation> query);
|
||||
}
|
||||
|
||||
+9
@@ -186,4 +186,13 @@
|
||||
left join pay_confirm_payment_record p3 on p3.project_id = p1.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="getMeetingPackStatisticsCount" resultType="com.jero.statistics.entity.MeetingPackStatistics">
|
||||
select sum(amount_receivable ) AS allMoney,sum(confirm_amount ) AS confirm_amount, sum(invoice_amount ) AS billMoney,sum(paid_amount ) AS comeAllMoney from
|
||||
(
|
||||
select p1.amount_receivable, p1.confirm_amount, p1.invoice_amount, p1.paid_amount from pay_meeting_situation p1
|
||||
left join pay_meeting p2 on p1.meeting_id = p2.id
|
||||
left join pay_confirm_payment_record p3 on p3.project_id = p1.id
|
||||
${ew.customSqlSegment}
|
||||
) a
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+6
-10
@@ -1953,16 +1953,12 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
|
||||
// 查看汇总价格
|
||||
QueryWrapper<PayMeetingSituation> querySum = getPayMeetingSituationQueryWrapper(metingPackStatisticsSearch);
|
||||
querySum.select("case when sum( p1.amount_receivable ) is null then 0 else sum( p1.amount_receivable ) end AS allMoney,\n" +
|
||||
"\tcase when sum( p1.confirm_amount ) is null then 0 else sum( p1.confirm_amount ) end AS confirm_amount,\n" +
|
||||
"\tcase when sum( p1.invoice_amount ) is null then 0 else sum( p1.invoice_amount ) end AS billMoney,\n" +
|
||||
"\tcase when sum( p1.paid_amount ) is null then 0 else sum( p1.paid_amount ) end AS comeAllMoney ");
|
||||
List<MeetingPackStatistics> sumList = payMeetingSituationMapper.getMeetingPackStatistics(querySum);
|
||||
MeetingPackStatistics count = payMeetingSituationMapper.getMeetingPackStatisticsCount(querySum);
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("sumOfMoney", (CollectionUtils.isEmpty(sumList) || StringUtils.isBlank(sumList.get(0).getAllMoney())) ? 0 : sumList.get(0).getAllMoney());
|
||||
hashMap.put("sumOfReallyMoney", (CollectionUtils.isEmpty(sumList) || StringUtils.isBlank(sumList.get(0).getComeAllMoney())) ? 0 : sumList.get(0).getComeAllMoney());
|
||||
hashMap.put("sumOfBillMoney", (CollectionUtils.isEmpty(sumList) || StringUtils.isBlank(sumList.get(0).getBillMoney())) ? 0 : sumList.get(0).getBillMoney());
|
||||
hashMap.put("sumOfConfirmAmount", (CollectionUtils.isEmpty(sumList) || StringUtils.isBlank(sumList.get(0).getConfirmAmount())) ? 0 : sumList.get(0).getConfirmAmount());
|
||||
hashMap.put("sumOfMoney", (Objects.isNull(count) || StringUtils.isBlank(count.getAllMoney())) ? 0 : count.getAllMoney());
|
||||
hashMap.put("sumOfReallyMoney", (Objects.isNull(count) || StringUtils.isBlank(count.getComeAllMoney())) ? 0 : count.getComeAllMoney());
|
||||
hashMap.put("sumOfBillMoney", (Objects.isNull(count) || StringUtils.isBlank(count.getBillMoney())) ? 0 : count.getBillMoney());
|
||||
hashMap.put("sumOfConfirmAmount", (Objects.isNull(count) || StringUtils.isBlank(count.getConfirmAmount())) ? 0 : count.getConfirmAmount());
|
||||
hashMap.put("pageList", pageList);
|
||||
return hashMap;
|
||||
}
|
||||
@@ -1998,12 +1994,12 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
if (!StringUtils.isBlank(metingPackStatisticsSearch.getPaymentYear())) {
|
||||
query.eq("DATE_FORMAT(p3.payment_date,'%Y')", metingPackStatisticsSearch.getPaymentYear());
|
||||
}
|
||||
query.groupBy("p3.project_id");
|
||||
return query;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private void addOrder(MeetingPackStatisticsSearch metingPackStatisticsSearch,QueryWrapper<PayMeetingSituation> query) {
|
||||
query.groupBy("p3.project_id");
|
||||
query.select("p1.id,p1.meeting_id,p1.company_name,p1.company_contact_name,p1.amount_receivable as allMoney,p1.confirm_amount,\n" +
|
||||
" p1.invoice_amount as billMoney,p1.paid_amount as comeAllMoney,p2.meeting_name,p2.meeting_type,DATE_FORMAT(p3.payment_date,'%Y') as payment_year");
|
||||
// 排序
|
||||
|
||||
Reference in New Issue
Block a user