From 536f42a311867f0336bef439ca45bb09e2327cab Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 10 May 2019 18:34:16 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=BB=9F=E8=AE=A1][=E6=B7=BB=E5=8A=A0][?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=87=BA=E7=A7=9F=E7=8E=87=E8=B5=B0=E5=8A=BF?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/rent/WxBillAllController.java | 31 +++++++++++++++++++ .../main/resources/mapper/WxBillAllMapper.xml | 6 ++++ 2 files changed, 37 insertions(+) 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 702aadaa3..496f6af58 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java @@ -5,9 +5,11 @@ import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; import com.iformall.domain.vo.WxBillAll; import com.iformall.service.WxBillAllService; +import com.iformall.utils.DateUtils; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -17,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.Map; /** @@ -88,6 +92,15 @@ public class WxBillAllController extends BaseController { if (null == wxBillAll) { wxBillAll = new WxBillAll(); } + //默认查当月第一天到今天 + if(StringUtils.isNotBlank(wxBillAll.getEndtime())){ + wxBillAll.setEndtime(wxBillAll.getEndtime()+" 23:59:59"); + } + if(StringUtils.isBlank(wxBillAll.getEndtime()) && StringUtils.isBlank(wxBillAll.getStarttime())){ + SimpleDateFormat sb = new SimpleDateFormat("yyyy-MM-dd"); + wxBillAll.setStarttime(sb.format(DateUtils.getFirstDayForCurrMonth(new Date()))); + wxBillAll.setEndtime(sb.format(new Date())+" 23:59:59"); + } wxBillAll.setTenantId(getTenantId()); Map result = wxBillAllService.getOweBillAsPage(wxBillAll, pageNum, pageSize); return new ResultData(result); @@ -102,6 +115,15 @@ public class WxBillAllController extends BaseController { if (null == wxBillAll){ wxBillAll = new WxBillAll(); } + //默认查当月第一天到今天 + if(StringUtils.isNotBlank(wxBillAll.getEndtime())){ + wxBillAll.setEndtime(wxBillAll.getEndtime()+" 23:59:59"); + } + if(StringUtils.isBlank(wxBillAll.getEndtime()) && StringUtils.isBlank(wxBillAll.getStarttime())){ + SimpleDateFormat sb = new SimpleDateFormat("yyyy-MM-dd"); + wxBillAll.setStarttime(sb.format(DateUtils.getFirstDayForCurrMonth(new Date()))); + wxBillAll.setEndtime(sb.format(new Date())+" 23:59:59"); + } wxBillAll.setTenantId(getTenantId()); wxBillAllService.exportOweMerchant(wxBillAll, request, response); } @@ -114,6 +136,15 @@ public class WxBillAllController extends BaseController { if (null == wxBillAll){ wxBillAll = new WxBillAll(); } + //默认查当月第一天到今天 + if(StringUtils.isNotBlank(wxBillAll.getEndtime())){ + wxBillAll.setEndtime(wxBillAll.getEndtime()+" 23:59:59"); + } + if(StringUtils.isBlank(wxBillAll.getEndtime()) && StringUtils.isBlank(wxBillAll.getStarttime())){ + SimpleDateFormat sb = new SimpleDateFormat("yyyy-MM-dd"); + wxBillAll.setStarttime(sb.format(DateUtils.getFirstDayForCurrMonth(new Date()))); + wxBillAll.setEndtime(sb.format(new Date())+" 23:59:59"); + } wxBillAll.setTenantId(getTenantId()); wxBillAllService.exportWaitMerchant(wxBillAll, request, response); } diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index 934291a69..ef09a6252 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -589,6 +589,12 @@ and date_format(bill.receive_date,'%Y-%m')=#{month} + + and bill.receive_date >= #{starttime} + + + and bill.receive_date <= #{endtime} + order by ${sortColumns} order by totalOwe desc