| @@ -98,6 +98,28 @@ public class WxBillAllController extends BaseController { | |||||
| } | } | ||||
| /** | |||||
| * 应收、承付商户列表 | |||||
| * @param wxBillAll | |||||
| * @param pageNum | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("receiveAndPayMerchantlist") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "费用收缴数据-欠缴商户列表") | |||||
| public ResultData receiveAndPayMerchantlist(@ModelAttribute WxBillAll wxBillAll, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillAllController::receiveAndPayMerchantlist"); | |||||
| if (null == wxBillAll) { | |||||
| wxBillAll = new WxBillAll(); | |||||
| } | |||||
| wxBillAll.setTenantId(getTenantId()); | |||||
| Map<String, Object> result = wxBillAllService.getReceiveAndPayBillAsPage(wxBillAll, pageNum, pageSize); | |||||
| return new ResultData(result); | |||||
| } | |||||
| @ApiOperation("导出欠缴商户列表") | @ApiOperation("导出欠缴商户列表") | ||||
| @GetMapping("/exportOweMerchantlist") | @GetMapping("/exportOweMerchantlist") | ||||
| @SystemControllerLog(description = "费用收缴数据-欠缴商户列表-导出") | @SystemControllerLog(description = "费用收缴数据-欠缴商户列表-导出") | ||||
| @@ -133,4 +133,8 @@ public class WxBillAll extends BaseEntity { | |||||
| @Transient | @Transient | ||||
| private Long newLatePrice; | private Long newLatePrice; | ||||
| @Transient | |||||
| @SortColumn(column = "payOut") | |||||
| private Integer payOut; | |||||
| } | } | ||||
| @@ -42,4 +42,11 @@ public interface WxBillAllMapper { | |||||
| */ | */ | ||||
| List<Map<String, Object>> getOweBillAsPage(WxBillAll record); | List<Map<String, Object>> getOweBillAsPage(WxBillAll record); | ||||
| /** | |||||
| * 应收和承付商户分页列表 | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| List<Map<String, Object>> getReceiveAndPayBillAsPage(WxBillAll record); | |||||
| } | } | ||||
| @@ -48,6 +48,15 @@ public interface WxBillAllService { | |||||
| */ | */ | ||||
| Map<String, Object> getOweBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize); | Map<String, Object> getOweBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize); | ||||
| /** | |||||
| * 应收和承付商户分页列表 | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| Map<String, Object> getReceiveAndPayBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize); | |||||
| void exportOweMerchant(WxBillAll record, HttpServletRequest request, HttpServletResponse response); | void exportOweMerchant(WxBillAll record, HttpServletRequest request, HttpServletResponse response); | ||||
| void exportWaitMerchant(WxBillAll record, HttpServletRequest request, HttpServletResponse response); | void exportWaitMerchant(WxBillAll record, HttpServletRequest request, HttpServletResponse response); | ||||
| @@ -1528,6 +1528,14 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| return result; | return result; | ||||
| } | } | ||||
| @Override | |||||
| 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<>(); | |||||
| result.put("pageInfo", pageInfo); | |||||
| return result; | |||||
| } | |||||
| /** | /** | ||||
| * 使用java正则表达式去掉多余的.与0 | * 使用java正则表达式去掉多余的.与0 | ||||
| * | * | ||||
| @@ -619,5 +619,60 @@ | |||||
| <if test=" null == sortColumns"> order by totalOwe desc </if> | <if test=" null == sortColumns"> order by totalOwe desc </if> | ||||
| </select> | </select> | ||||
| <select id="getReceiveAndPayBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap"> | |||||
| select m.id,m.name,ws.shop_number shopNumber,ws.type,m.link_person linkPerson,m.link_line_phone linkPhone, | |||||
| 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) receivePay, | |||||
| 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) payOut | |||||
| 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 | |||||
| <if test=" null != tenantId"> and m.tenant_id = #{tenantId} </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by m.id desc </if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||