| @@ -148,6 +148,8 @@ public class Test { | |||||
| WxBillAll wxBillAll = new WxBillAll(); | WxBillAll wxBillAll = new WxBillAll(); | ||||
| wxBillAll.setTenantId("456"); | wxBillAll.setTenantId("456"); | ||||
| wxBillAll.setMerchantId(324754110547066880l); | wxBillAll.setMerchantId(324754110547066880l); | ||||
| wxBillAll.setPageIndex(1); | |||||
| wxBillAll.setPageSize(6); | |||||
| System.out.println("--------"+JsonUtil.obj2Json(wxBillAllService.listBill(wxBillAll))); | System.out.println("--------"+JsonUtil.obj2Json(wxBillAllService.listBill(wxBillAll))); | ||||
| } | } | ||||
| } | } | ||||
| @@ -191,6 +191,16 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| if (wxBillAll.getPageIndex() != null && wxBillAll.getPageIndex() != null) { | if (wxBillAll.getPageIndex() != null && wxBillAll.getPageIndex() != null) { | ||||
| PageHelper.startPage(wxBillAll.getPageIndex(), wxBillAll.getPageSize()); | PageHelper.startPage(wxBillAll.getPageIndex(), wxBillAll.getPageSize()); | ||||
| List<Map<String, Object>> maps = wxBillAllMapper.listData(wxBillAll); | List<Map<String, Object>> maps = wxBillAllMapper.listData(wxBillAll); | ||||
| for (Map<String, Object> map:maps) { | |||||
| Integer billType = ((Long)map.get("billTypeValue")).intValue(); | |||||
| if(EnumBillType.SETTLE.getCode().equals(billType)){ | |||||
| BigDecimal rp = (BigDecimal)map.get("receivePay"); | |||||
| WxBillSettle query = new WxBillSettle(); | |||||
| query.setId((Long)map.get("id")); | |||||
| Long sum = wxBillSettleRecordMapper.getSumMoneyBySettleId(query); | |||||
| map.put("owe",rp.subtract(new BigDecimal(sum))); | |||||
| } | |||||
| } | |||||
| PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(maps); | PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(maps); | ||||
| return new ResultData(pageInfo); | return new ResultData(pageInfo); | ||||
| } | } | ||||
| @@ -811,12 +811,11 @@ | |||||
| left join wx_rent_contract rc on(rc.merchant_id = m.id) | left join wx_rent_contract rc on(rc.merchant_id = m.id) | ||||
| where m.status=1 | where m.status=1 | ||||
| ) tt where 1=1 | ) tt where 1=1 | ||||
| <if test=" null != tenantId"> and tt.tenant_id = #{tenantId} </if> | <if test=" null != tenantId"> and tt.tenant_id = #{tenantId} </if> | ||||
| <if test=" null != merchantId"> and tt.id = #{merchantId} </if> | <if test=" null != merchantId"> and tt.id = #{merchantId} </if> | ||||
| <if test=" null != merchantName and ''!=merchantName">and tt.name like concat('%', #{merchantName},'%')</if> | <if test=" null != merchantName and ''!=merchantName">and tt.name like concat('%', #{merchantName},'%')</if> | ||||
| <if test=" null != rentShopType"> and tt.rent_shop_type = #{rentShopType} </if> | <if test=" null != rentShopType"> and tt.rent_shop_type = #{rentShopType} </if> | ||||
| and (receivePay >0 or payOut>0) | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| <if test=" null == sortColumns"> order by tt.id desc </if> | <if test=" null == sortColumns"> order by tt.id desc </if> | ||||
| </select> | </select> | ||||