| @@ -20,10 +20,12 @@ import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Objects; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/credit") | @RequestMapping("/api/credit") | ||||
| @@ -44,9 +46,9 @@ public class WxCreditHistoryController extends BaseController { | |||||
| @GetMapping("/findByMerchantIdAndSpend") | @GetMapping("/findByMerchantIdAndSpend") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="merchantId",value="商户ID",dataType="long", paramType = "query",required=true), | @ApiImplicitParam(name="merchantId",value="商户ID",dataType="long", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="spend",value="消费金额",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="spendStr",value="消费金额",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name = "userId", value = "会员Id", dataType = "long", paramType = "query", required = true)}) | @ApiImplicitParam(name = "userId", value = "会员Id", dataType = "long", paramType = "query", required = true)}) | ||||
| public ResultData findByMerchantIdAndSpend(@RequestParam Long merchantId, @RequestParam String spendStr,@RequestParam Long userId) { | |||||
| public ResultData findByMerchantIdAndSpend(Long merchantId, String spendStr,Long userId) { | |||||
| log.debug("[" + getIpAddr() + "] WxCreditHistoryController::findByMerchantIdAndSpend"); | log.debug("[" + getIpAddr() + "] WxCreditHistoryController::findByMerchantIdAndSpend"); | ||||
| WxMerchant wxMerchant = new WxMerchant(); | WxMerchant wxMerchant = new WxMerchant(); | ||||
| wxMerchant.setStatus(EnumYesOrNo.YES.getCode()); | wxMerchant.setStatus(EnumYesOrNo.YES.getCode()); | ||||
| @@ -56,6 +58,9 @@ public class WxCreditHistoryController extends BaseController { | |||||
| if (wxMerchant.getIsAdmin() != EnumYesOrNo.YES.getCode() && merchantId.longValue() != getUser().getMerchantId().longValue()) { | if (wxMerchant.getIsAdmin() != EnumYesOrNo.YES.getCode() && merchantId.longValue() != getUser().getMerchantId().longValue()) { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION); | return new ResultData(ErrorCode.USER_NO_PERMISSION); | ||||
| } | } | ||||
| if(Objects.isNull(merchantId)|| StringUtils.isEmpty(spendStr)||Objects.isNull(userId)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL) ; | |||||
| } | |||||
| return new ResultData(wxCreditHistoryService.findByMerchantIdAndSpend(merchantId,spendStr,userId,getTenantId())); | return new ResultData(wxCreditHistoryService.findByMerchantIdAndSpend(merchantId,spendStr,userId,getTenantId())); | ||||
| } | } | ||||