| @@ -0,0 +1,55 @@ | |||||
| package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxCardSpend; | |||||
| import com.iformall.service.WxCardSpendService; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxOrderService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| /** | |||||
| * @author Stormeye Wu wuguoqiang@iformall.com | |||||
| */ | |||||
| @RestController | |||||
| @Api(description = "C端扫B端商户码储值卡支付") | |||||
| @RequestMapping("/api/cardPay") | |||||
| public class WxCardPayController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| WxOrderService wxOrderService; | |||||
| @Autowired | |||||
| WxCardSpendService wxCardSpendService; | |||||
| @ApiOperation("C端扫B端储值卡交易流水列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData cardOrderList(@ModelAttribute WxCardSpend wxCardSpend, Integer pageNum, Integer pageSize) { | |||||
| String ipStr = getIpAddr(); | |||||
| logger.info("cardOrderList: " + ipStr + " :" + wxCardSpend.toString()); | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | |||||
| MallUserInfo user = getUser(); | |||||
| wxCardSpend.setTenantId(user.getTenantId()); | |||||
| final PageInfo<WxCardSpend> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,51 @@ | |||||
| package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.service.WxCardSpendService; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxOrderService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| /** | |||||
| * @author Stormeye Wu wuguoqiang@iformall.com | |||||
| */ | |||||
| @RestController | |||||
| @Api(description = "C端扫B端商户码储值卡支付") | |||||
| @RequestMapping("/api/carday") | |||||
| public class WxCardPayController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| WxOrderService wxOrderService; | |||||
| @Autowired | |||||
| WxCardSpendService wxCardSpendService; | |||||
| @ApiOperation("C端扫B端储值卡交易流水列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData cardOrderList(@ModelAttribute WxCardSpend wxCardSpend, Integer pageNum, Integer pageSize) { | |||||
| String ipStr = getIpAddr(); | |||||
| logger.info("saveCardPayOrder: " + ipStr + " :" + wxCardSpend.toString()); | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | |||||
| WxMerchantBUser user = getUser(); | |||||
| wxCardSpend.setTenantId(user.getTenantId()); | |||||
| final PageInfo<WxCardSpend> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | |||||
| @@ -1,12 +1,15 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -36,11 +39,11 @@ public class WxCardPayController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCardSpendService wxCardSpendService; | WxCardSpendService wxCardSpendService; | ||||
| @ApiOperation(value = "C端扫B端商户码支付订单", notes = "params:{\"cardId\":\"String\",\"merchantCode\":\"String\",\"totalFee\":\"String\"}") | |||||
| @ApiOperation(value = "C端扫B端储值卡支付订单", notes = "params:{\"cardId\":\"String\",\"merchantCode\":\"String\",\"totalFee\":\"String\"}") | |||||
| @PostMapping("order_create") | @PostMapping("order_create") | ||||
| public ResultData saveCardPayOrder(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { | public ResultData saveCardPayOrder(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { | ||||
| String ipStr = getIpAddr(); | String ipStr = getIpAddr(); | ||||
| logger.info("saveCardPayOrder: " + ipStr + " :"+ paramMap.toString()); | |||||
| logger.info("saveCardPayOrder: " + ipStr + " :" + paramMap.toString()); | |||||
| String cardIdStr = paramMap.get("cardId"); | String cardIdStr = paramMap.get("cardId"); | ||||
| String merchantCode = paramMap.get("merchantCode"); | String merchantCode = paramMap.get("merchantCode"); | ||||
| String totalFeeStr = paramMap.get("totalFee"); | String totalFeeStr = paramMap.get("totalFee"); | ||||
| @@ -112,4 +115,19 @@ public class WxCardPayController extends BaseController { | |||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @ApiOperation("C端扫B端储值卡交易流水列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData cardOrderList(@ModelAttribute WxCardSpend wxCardSpend, Integer pageNum, Integer pageSize) { | |||||
| String ipStr = getIpAddr(); | |||||
| logger.info("saveCardPayOrder: " + ipStr + " :" + wxCardSpend.toString()); | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | |||||
| WxCUser user = getUser(); | |||||
| wxCardSpend.setTenantId(user.getTenantId()); | |||||
| final PageInfo<WxCardSpend> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | } | ||||