diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java index a1495edd1..14d875380 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java @@ -97,28 +97,6 @@ public class WxBillAllController extends BaseController { return new ResultData(result); } - /** - * 代缴商户列表 - * @param wxBillAll - * @param pageNum - * @param pageSize - * @return - */ - @GetMapping("waitMerchantlist") - @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 waitMerchantlist(@ModelAttribute WxBillAll wxBillAll, Integer pageNum, Integer pageSize) { - logger.debug("[" + getIpAddr() + "] WxBillAllController::waitMerchantlist"); - if (null == wxBillAll) { - wxBillAll = new WxBillAll(); - } - wxBillAll.setTenantId(getTenantId()); - Map result = wxBillAllService.getWaitBillAsPage(wxBillAll, pageNum, pageSize); - return new ResultData(result); - } - @ApiOperation("导出欠缴商户列表") @GetMapping("/exportOweMerchantlist") diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java index 0aef0359f..66fdede14 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java @@ -42,9 +42,4 @@ public interface WxBillAllMapper { */ List> getOweBillAsPage(WxBillAll record); - /** - * 代缴商户分页列表 - * @return - */ - List> getWaitBillAsPage(WxBillAll record); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxBillAllService.java b/mallinkService/src/main/java/com/iformall/service/WxBillAllService.java index 73597752b..ad8e72a23 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxBillAllService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxBillAllService.java @@ -43,12 +43,6 @@ public interface WxBillAllService { */ Map getOweBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize); - /** - * 代缴商户分页列表 - * @return - */ - Map getWaitBillAsPage(WxBillAll record,Integer pageNum, Integer pageSize); - void exportOweMerchant(WxBillAll record, HttpServletRequest request, HttpServletResponse response); void updateBillStatus(WxBillAll record); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 25a386bec..16f1906f6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -755,23 +755,6 @@ public class WxBillAllServiceImpl implements WxBillAllService { return result; } - @Override - public Map getWaitBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) { - PageInfo> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBillAllMapper.getWaitBillAsPage(record)); - List> list = pageInfo.getList(); - for (Map map:list) { - map.put("rentOwe",subZeroAndDot(map.get("rentOwe").toString())); - map.put("propertyOwe",subZeroAndDot(map.get("propertyOwe").toString())); - map.put("depositOwe",subZeroAndDot(map.get("depositOwe").toString())); - map.put("otherOwe",subZeroAndDot(map.get("otherOwe").toString())); - map.put("totalOwe",subZeroAndDot(map.get("totalOwe").toString())); - } - pageInfo.setList(list); - Map result = new HashMap<>(); - result.put("pageInfo", pageInfo); - return result; - } - /** * 使用java正则表达式去掉多余的.与0 * @param s diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index 0eda35dfe..55276acb2 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -496,116 +496,82 @@ select bill.tenant_id tenantId,bill.merchant_id merchantId,m.name merchantName,bill.bill_type billType, m.link_phone managerPhone,m.`link_person` manager,m.email, bill.receive_date receiveDate,DATEDIFF(now(),bill.receive_date) expiredDay,ws.building,ws.floor, - round(bill.rentOwe/100,2) rentOwe,round(bill.propertyOwe/100,2) propertyOwe, - round(bill.depositOwe/100,2) depositOwe,round(bill.otherOwe/100,2) otherOwe, - round((bill.rentOwe+bill.propertyOwe+bill.depositOwe+bill.otherOwe)/100,2) totalOwe + round(bill.rentOwe/100,2) rentOwe, + round(bill.propertyOwe/100,2) propertyOwe, + round(bill.depositOwe/100,2) depositOwe, + round(bill.otherOwe/100,2) otherOwe, + round((bill.rentOwe+bill.propertyOwe+bill.depositOwe+bill.otherOwe)/100,2) totalOwe, + + + + round((bill.rentReceivePay-bill.rentPay)/100,2) rentReceivePay, + round((bill.propertyReceivePay-bill.propertyPay)/100,2) propertyReceivePay, + round((bill.depositReceivePay-bill.depositPay)/100,2) depositReceivePay, + round((bill.otherReceivePay-bill.otherPay)/100,2) otherReceivePay, + round((bill.rentReceivePay+bill.propertyReceivePay+bill.depositReceivePay+bill.otherReceivePay + -bill.rentPay-bill.propertyPay-bill.depositPay-bill.otherPay)/100,2) totalReceivePay + + + round(bill.rentReceivePay/100,2) rentReceivePay, + round(bill.propertyReceivePay/100,2) propertyReceivePay, + round(bill.depositReceivePay/100,2) depositReceivePay, + round(bill.otherReceivePay/100,2) otherReceivePay, + round((bill.rentOwe+bill.propertyOwe+bill.depositOwe+bill.otherOwe)/100,2) totalReceivePay + + + from ( select oweList.*, max(case oweList.bill_type when '租金' then oweList.owe else 0 end) rentOwe, max(case oweList.bill_type when '物业费' then oweList.owe else 0 end) propertyOwe, max(case oweList.bill_type when '欠缴押金' then oweList.owe else 0 end) depositOwe, - max(case oweList.bill_type when '其他费用' then oweList.owe else 0 end) otherOwe + max(case oweList.bill_type when '其他费用' then oweList.owe else 0 end) otherOwe, + + max(case oweList.bill_type when '租金' then oweList.receive_pay else 0 end) rentReceivePay, + max(case oweList.bill_type when '物业费' then oweList.receive_pay else 0 end) propertyReceivePay, + max(case oweList.bill_type when '欠缴押金' then oweList.receive_pay else 0 end) depositReceivePay, + max(case oweList.bill_type when '其他费用' then oweList.receive_pay else 0 end) otherReceivePay, + + max(case oweList.bill_type when '租金' then oweList.pay else 0 end) rentPay, + max(case oweList.bill_type when '物业费' then oweList.pay else 0 end) propertyPay, + max(case oweList.bill_type when '欠缴押金' then oweList.pay else 0 end) depositPay, + max(case oweList.bill_type when '其他费用' then oweList.pay else 0 end) otherPay from( - select bill.tenant_id,bill.merchant_id,bill.bill_type,sum(owe) owe,bill.receive_date,bill.expired_day from ( + select bill.tenant_id,bill.merchant_id,bill.bill_type,sum(owe) owe,bill.receive_date,bill.expired_day,bill.receive_pay,bill.pay from ( select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' - bill_type,need_pay,receive_pay,pay, - - - (receive_pay-pay) owe - - - owe - - - ,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' + bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent where is_preview = 0 and status = #{status} and tenant_id = #{tenantId} union select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' - bill_type,need_pay,receive_pay,pay, - - - (receive_pay-pay) owe - - - owe - - - ,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' + bill_type,need_pay,receive_pay,pay,(need_pay-pay),DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property where is_preview = 0 and status = #{status} and tenant_id = #{tenantId} union select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from( - select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金' - bill_type,need_pay,receive_pay,pay, - - - (receive_pay-pay) owe - - - owe - - - ,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' - endtime,rent_shop_type from wx_bill_rent_deposit where status = #{status} and tenant_id = #{tenantId} - union - select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金' - bill_type,need_pay,receive_pay,pay, - - - (receive_pay-pay) owe - - - owe - - - ,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' - endtime,rent_shop_type from wx_bill_property_deposit where status = #{status} and tenant_id = #{tenantId} - union - select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as - need_pay,receive_pay,pay, - - - (receive_pay-pay) owe - - - owe - - - ,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_other_deposit where status = #{status} and tenant_id = #{tenantId} + select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金' + bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' + endtime,rent_shop_type from wx_bill_rent_deposit where status = #{status} and tenant_id = #{tenantId} + union + select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金' + bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' + endtime,rent_shop_type from wx_bill_property_deposit where status = #{status} and tenant_id = #{tenantId} + union + select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as + need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type + from wx_bill_other_deposit where status = #{status} and tenant_id = #{tenantId} ) res union select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, - res.receive_pay,res.pay, - owe - ,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from( - select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as - need_pay,receive_pay,pay, - - - (receive_pay-pay) owe - - - owe - - - ,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_daily where type in(1,2) and status = #{status} and tenant_id = #{tenantId} - union - select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as - need_pay,receive_pay,pay, - - - (receive_pay-pay) owe - - - owe - - - ,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_other where status = #{status} and tenant_id = #{tenantId} + res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from( + select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as + need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type + from wx_bill_daily where type in(1,2) and status = #{status} and tenant_id = #{tenantId} + union + select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as + need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type + from wx_bill_other where status = #{status} and tenant_id = #{tenantId} ) res ) bill @@ -622,7 +588,6 @@ and date_format(bill.receive_date,'%Y-%m')=#{month} - order by ${sortColumns} order by totalOwe desc