From 39432c0b0a8fe0e20e1a50d7a3328d8e38685f22 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Dec 2018 17:07:22 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=A1=A5=E8=B4=B4][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E8=A1=A5=E8=B4=B4=E6=B5=81=E6=B0=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WxMerchantSubsidyController.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxMerchantSubsidyController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxMerchantSubsidyController.java index bfe8647be..7b235155d 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxMerchantSubsidyController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxMerchantSubsidyController.java @@ -1,12 +1,13 @@ package com.iformall.controller; import com.github.pagehelper.PageInfo; +import com.iformall.common.ErrorCode; import com.iformall.common.ResultData; import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.WxMerchantSubsidy; -import com.iformall.domain.vo.WxCardSpendVo; import com.iformall.domain.vo.WxMerchantSubsidyVo; import com.iformall.enums.EnumMerchantSubsidyStatus; +import com.iformall.exception.MallinkException; import com.iformall.service.WxMerchantSubsidyService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -39,7 +40,9 @@ public class WxMerchantSubsidyController extends BaseController { public ResultData count(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy) { String ipStr = getIpAddr(); logger.info("subsidy/sum: " + ipStr + " :" + wxMerchantSubsidy.toString()); - if (wxMerchantSubsidy == null) wxMerchantSubsidy = new WxMerchantSubsidy(); + if (wxMerchantSubsidy == null) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件为空"); + } MallUserInfo user = getUser(); wxMerchantSubsidy.setTenantId(user.getTenantId()); if(StringUtils.isNotBlank(wxMerchantSubsidy.getStatusStr())) { @@ -64,7 +67,9 @@ public class WxMerchantSubsidyController extends BaseController { public ResultData listMonth(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy, Integer pageNum, Integer pageSize) { String ipStr = getIpAddr(); logger.info("subsidy/list: " + ipStr + " :" + wxMerchantSubsidy.toString()); - if (wxMerchantSubsidy == null) wxMerchantSubsidy = new WxMerchantSubsidy(); + if (wxMerchantSubsidy == null) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件为空"); + } MallUserInfo user = getUser(); wxMerchantSubsidy.setTenantId(user.getTenantId()); if(StringUtils.isNotBlank(wxMerchantSubsidy.getStatusStr())) { @@ -86,7 +91,9 @@ public class WxMerchantSubsidyController extends BaseController { public ResultData updateSubsidied(@RequestBody WxMerchantSubsidy wxMerchantSubsidy) { String ipStr = getIpAddr(); logger.info("subsidy/update: " + ipStr + " :" + wxMerchantSubsidy.toString()); - if (wxMerchantSubsidy == null) wxMerchantSubsidy = new WxMerchantSubsidy(); + if (wxMerchantSubsidy == null) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件为空"); + } MallUserInfo user = getUser(); wxMerchantSubsidy.setTenantId(user.getTenantId()); wxMerchantSubsidy.setStatus(EnumMerchantSubsidyStatus.MANUAL_SUBSIDIED.getCode()); @@ -99,6 +106,9 @@ public class WxMerchantSubsidyController extends BaseController { @GetMapping("/exportData") public void exportData(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy, HttpServletRequest request, HttpServletResponse response) { logger.info("[" + getIpAddr() + "] subsidy/exportData"); + if (wxMerchantSubsidy == null) { + throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件不能为空"); + } wxMerchantSubsidy.setTenantId(getTenantId()); if(StringUtils.isNotBlank(wxMerchantSubsidy.getStatusStr())) { String [] statusAttr = wxMerchantSubsidy.getStatusStr().split(",");