Просмотр исходного кода

[合同][修改][开发账单结算]

release_toaliyun_real
luozukai 6 лет назад
Родитель
Сommit
87b7b71275
2 измененных файлов: 44 добавлений и 18 удалений
  1. +0
    -17
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  2. +44
    -1
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml

+ 0
- 17
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Просмотреть файл

@@ -1532,7 +1532,6 @@ public class WxBillAllServiceImpl implements WxBillAllService {
public Map<String, Object> getReceiveAndPayBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) {
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBillAllMapper.getReceiveAndPayBillAsPage(record));
Map<String, Object> result = new HashMap<>();
initBalance(pageInfo.getList());
result.put("pageInfo", pageInfo);
return result;
}
@@ -1572,25 +1571,9 @@ public class WxBillAllServiceImpl implements WxBillAllService {
excelService.exportExcel(list, null, name, OweMerchantVo.class, name + ".xlsx", response, false);
}

public void initBalance(List<Map<String, Object>> data){
data.stream().forEach(e ->{
if(e.get("receivePay")==null){
e.put("receivePay",0);
}
if(e.get("payOut")==null){
e.put("payOut",0);
}
BigDecimal r = new BigDecimal(e.get("receivePay")==null?"0":e.get("receivePay").toString());
BigDecimal p = new BigDecimal(e.get("payOut")==null?"0":e.get("payOut").toString());
e.put("balance",r.subtract(p));
});
}

@Override
public void exportReceiveAndPayBillAsPage(WxBillAll record, HttpServletRequest request, HttpServletResponse response) {
List<Map<String, Object>> data = wxBillAllMapper.getReceiveAndPayBillAsPage(record);
initBalance(data);

List<ReceivedAndPayVo> list = new ArrayList<>();
for (Map<String, Object> map : data) {
ReceivedAndPayVo oweMerchantVo = new ReceivedAndPayVo();


+ 44
- 1
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml Просмотреть файл

@@ -663,7 +663,50 @@
left join wx_merchant mm on pso.merchant_id=mm.id
where pso.sharing_status !=5
)ss where ss.id = m.id
)/100,2) payOut
)/100,2) payOut,

(round(
(select sum(bill.receive_pay) from (
select merchant_id,receive_pay from wx_bill_rent where is_preview = 0 and status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_rent_deposit where status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_property where is_preview = 0 and status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_property_deposit where status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_daily where type in(1,2,3) and status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_other where status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_other_deposit where status not in(3,6)
) bill where bill.merchant_id = m.id
)/100,2)-
round(
(select sum(ss.money) from (
select ms.subsidy money,mm.id
from wx_merchant_subsidy ms
left join wx_coupon_order co on co.id = ms.coupon_order_id
left join wx_coupon c on c.id = co.coupon_id
left join wx_merchant mm on mm.id = ms.merchant_id
left join wx_card_spend cs on cs.order_id = ms.order_id
left join wx_c_user cu on cu.id = cs.owner_id
where ms.order_type in(3,0) and ms.status = 0
union all
select ms.subsidy money,mm.id
from wx_merchant_subsidy ms
left join wx_coupon_order co on co.id = ms.coupon_order_id
left join wx_coupon c on c.id = co.coupon_id
left join wx_merchant mm on mm.id = ms.merchant_id
left join wx_card_spend cs on cs.order_id = ms.order_id
left join wx_c_user cu on cu.id = cs.owner_id
where ms.order_type in(3,0) and ms.status = 0
union all
select pay_amount money,mm.id from wx_profit_sharing_order pso
left join wx_merchant mm on pso.merchant_id=mm.id
where pso.sharing_status !=5
)ss where ss.id = m.id
)/100,2)) balance

from wx_merchant m left join wx_merchant_shop wms on wms.merchant_id = m.id left join wx_shop ws on wms.shop_id = ws.id
where 1=1


Загрузка…
Отмена
Сохранить