From a5c990ebc7c0ecaada64febad04c4b4ade8bea7e Mon Sep 17 00:00:00 2001 From: winter Date: Wed, 8 May 2024 11:50:47 +0800 Subject: [PATCH] fix --- .../controller/rent/WxBillAllController.java | 177 +++++++++--------- .../domain/po/base/WxBillBaseEntity.java | 5 +- 2 files changed, 93 insertions(+), 89 deletions(-) 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 116e40683..f4d1fbaf1 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java @@ -261,31 +261,50 @@ public class WxBillAllController extends BaseController { return new ResultData(tmap); } + /** - * 欠缴账单统计-红灯区 + * 欠缴账单列表 * @param wxBillAll * @param pageNum * @param pageSize * @return */ - @GetMapping("oweBillHot") - public ResultData oweBillHot() { - return new ResultData(getHots(null)); + @GetMapping("oweBillList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData oweBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, Integer pageNum, Integer pageSize) { + if (null == billType) { + return new ResultData(Result.ERROR,"请选择分类"); + } + EnumBillAllType btype = EnumBillAllType.getEnum(billType); + if (null == btype) { + return new ResultData(Result.ERROR,"分类非法"); + } + return new ResultData(getBillList(wxMerchant, btype, null, pageNum, pageSize)); } - //临期 - @GetMapping("nearBillHot") - public ResultData nearBillHot() { + @GetMapping("nearBillList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData nearBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, Integer pageNum, Integer pageSize) { + if (null == billType) { + return new ResultData(Result.ERROR,"请选择分类"); + } + EnumBillAllType btype = EnumBillAllType.getEnum(billType); + if (null == btype) { + return new ResultData(Result.ERROR,"分类非法"); + } SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo()); Integer nearBillBeforeDays = Constant.bill_near_default_days ; if (null != lqconfig) { nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); } - return new ResultData(getHots(nearBillBeforeDays)); + return new ResultData(getBillList(wxMerchant, btype, nearBillBeforeDays, pageNum, pageSize)); } - private List getHots(Integer nearBillBeforeDays) { - WxMerchant wxMerchant = new WxMerchant(); + private PageInfo getBillList(WxMerchant wxMerchant,EnumBillAllType btype,Integer nearBillBeforeDays, Integer pageNum, Integer pageSize) { wxMerchant.updateTenantInfo(getTenantInfo()); WxUserDataRule dataRule = this.getCurrentDataFloors(); if (null != dataRule) { @@ -299,47 +318,80 @@ public class WxBillAllController extends BaseController { } wxMerchant.setOweBillBeforeDays(oweBillBeforeDays); wxMerchant.setNearBillBeforeDays(nearBillBeforeDays); - return billAllHelper.getHotNotify(wxMerchant); + + return billAllHelper.getBillList(btype, wxMerchant,pageNum,pageSize); } /** - * 欠缴账单统计 + * 欠缴账单列表 * @param wxBillAll * @param pageNum * @param pageSize * @return */ - @GetMapping("oweBillSum") - public ResultData oweBillSum(@ModelAttribute WxMerchant wxMerchant,Integer billType) { + @GetMapping("exportOweBillList") + public void oweBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, HttpServletRequest request, HttpServletResponse response) { if (null == billType) { - return new ResultData(Result.ERROR,"请选择分类"); + return ; } EnumBillAllType btype = EnumBillAllType.getEnum(billType); if (null == btype) { - return new ResultData(Result.ERROR,"分类非法"); + return ; } - return new ResultData(getBillSum(wxMerchant, btype, null)); + PageInfo page = getBillList(wxMerchant, btype, null, 1, 10000); + if (null == page) { + return; + } + excelService.exportExcel(page.getList(), null, "逾期账单列表", WxBillBaseEntity.class, "商户欠缴账单_"+btype.getMessage()+".xlsx", response, false); } - //临期账单金额 - @GetMapping("nearBillSum") - public ResultData nearBillSum(@ModelAttribute WxMerchant wxMerchant,Integer billType) { + //临期 + @GetMapping("exportNearBillList") + public void exportNearBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, HttpServletRequest request, HttpServletResponse response) { if (null == billType) { - return new ResultData(Result.ERROR,"请选择分类"); + return ; } EnumBillAllType btype = EnumBillAllType.getEnum(billType); if (null == btype) { - return new ResultData(Result.ERROR,"分类非法"); + return ; } SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo()); Integer nearBillBeforeDays = Constant.bill_near_default_days ; if (null != lqconfig) { nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); } - return new ResultData(getBillSum(wxMerchant, btype, nearBillBeforeDays)); + PageInfo page = getBillList(wxMerchant, btype, nearBillBeforeDays, 1, 10000); + if (null == page) { + return; + } + excelService.exportExcel(page.getList(), null, "临期账单列表", WxBillBaseEntity.class, "商户临期账单_"+btype.getMessage()+".xlsx", response, false); } - private WxBillSum getBillSum(WxMerchant wxMerchant,EnumBillAllType btype,Integer nearBillBeforeDays) { + /** + * 欠缴账单统计-红灯区 + * @param wxBillAll + * @param pageNum + * @param pageSize + * @return + */ + @GetMapping("oweBillHot") + public ResultData oweBillHot() { + return new ResultData(getHots(null)); + } + + //临期 + @GetMapping("nearBillHot") + public ResultData nearBillHot() { + SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo()); + Integer nearBillBeforeDays = Constant.bill_near_default_days ; + if (null != lqconfig) { + nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); + } + return new ResultData(getHots(nearBillBeforeDays)); + } + + private List getHots(Integer nearBillBeforeDays) { + WxMerchant wxMerchant = new WxMerchant(); wxMerchant.updateTenantInfo(getTenantInfo()); WxUserDataRule dataRule = this.getCurrentDataFloors(); if (null != dataRule) { @@ -353,23 +405,18 @@ public class WxBillAllController extends BaseController { } wxMerchant.setOweBillBeforeDays(oweBillBeforeDays); wxMerchant.setNearBillBeforeDays(nearBillBeforeDays); - Date starttime = wxMerchant.getStarttime(); - Date enttime = wxMerchant.getEndtime(); - return billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime); + return billAllHelper.getHotNotify(wxMerchant); } /** - * 欠缴账单列表 + * 欠缴账单统计 * @param wxBillAll * @param pageNum * @param pageSize * @return */ - @GetMapping("oweBillList") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) - public ResultData oweBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, Integer pageNum, Integer pageSize) { + @GetMapping("oweBillSum") + public ResultData oweBillSum(@ModelAttribute WxMerchant wxMerchant,Integer billType) { if (null == billType) { return new ResultData(Result.ERROR,"请选择分类"); } @@ -377,14 +424,12 @@ public class WxBillAllController extends BaseController { if (null == btype) { return new ResultData(Result.ERROR,"分类非法"); } - return new ResultData(getBillList(wxMerchant, btype, null, pageNum, pageSize)); + return new ResultData(getBillSum(wxMerchant, btype, null)); } - @GetMapping("nearBillList") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) - public ResultData nearBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, Integer pageNum, Integer pageSize) { + //临期账单金额 + @GetMapping("nearBillSum") + public ResultData nearBillSum(@ModelAttribute WxMerchant wxMerchant,Integer billType) { if (null == billType) { return new ResultData(Result.ERROR,"请选择分类"); } @@ -397,10 +442,10 @@ public class WxBillAllController extends BaseController { if (null != lqconfig) { nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); } - return new ResultData(getBillList(wxMerchant, btype, nearBillBeforeDays, pageNum, pageSize)); + return new ResultData(getBillSum(wxMerchant, btype, nearBillBeforeDays)); } - private PageInfo getBillList(WxMerchant wxMerchant,EnumBillAllType btype,Integer nearBillBeforeDays, Integer pageNum, Integer pageSize) { + private WxBillSum getBillSum(WxMerchant wxMerchant,EnumBillAllType btype,Integer nearBillBeforeDays) { wxMerchant.updateTenantInfo(getTenantInfo()); WxUserDataRule dataRule = this.getCurrentDataFloors(); if (null != dataRule) { @@ -414,53 +459,9 @@ public class WxBillAllController extends BaseController { } wxMerchant.setOweBillBeforeDays(oweBillBeforeDays); wxMerchant.setNearBillBeforeDays(nearBillBeforeDays); - - return billAllHelper.getBillList(btype, wxMerchant,pageNum,pageSize); - } - - /** - * 欠缴账单列表 - * @param wxBillAll - * @param pageNum - * @param pageSize - * @return - */ - @GetMapping("exportOweBillList") - public void oweBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, HttpServletRequest request, HttpServletResponse response) { - if (null == billType) { - return ; - } - EnumBillAllType btype = EnumBillAllType.getEnum(billType); - if (null == btype) { - return ; - } - PageInfo page = getBillList(wxMerchant, btype, null, 1, 10000); - if (null == page) { - return; - } - excelService.exportExcel(page.getList(), null, "逾期账单列表", WxBillBaseEntity.class, "商户欠缴账单_"+btype.getMessage()+".xlsx", response, false); - } - - //临期 - @GetMapping("exportNearBillList") - public void exportNearBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, HttpServletRequest request, HttpServletResponse response) { - if (null == billType) { - return ; - } - EnumBillAllType btype = EnumBillAllType.getEnum(billType); - if (null == btype) { - return ; - } - SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo()); - Integer nearBillBeforeDays = Constant.bill_near_default_days ; - if (null != lqconfig) { - nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); - } - PageInfo page = getBillList(wxMerchant, btype, nearBillBeforeDays, 1, 10000); - if (null == page) { - return; - } - excelService.exportExcel(page.getList(), null, "临期账单列表", WxBillBaseEntity.class, "商户临期账单_"+btype.getMessage()+".xlsx", response, false); + Date starttime = wxMerchant.getStarttime(); + Date enttime = wxMerchant.getEndtime(); + return billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime); } /** diff --git a/mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java index 2386d7ea4..037dd7c7c 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java @@ -61,7 +61,10 @@ public class WxBillBaseEntity extends TenantEntity { protected String owe; public String getOwe() { - return new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString(); + if (StringUtils.isNotBlank(receivePay) && StringUtils.isNotBlank(pay)) { + return new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString(); + } + return "0"; } @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "10")