新增支付订单接口

master
yqyg16603827325@126.com 3 years ago
parent e546c984cc
commit 88d7498563

@ -1,16 +1,17 @@
package com.hchbox.module.controller;
import com.hchbox.module.entity.PayTwoOrder;
import com.hchbox.module.entity.RechargeOrder;
import com.hchbox.model.param.CommonResult;
import com.hchbox.module.entity.SellerAccount;
import com.hchbox.module.entity.vo.AliPayPcVo;
import com.hchbox.module.service.AccountRechargeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -52,4 +53,10 @@ public class RechargeController {
public CommonResult<String> frontRcvResponseTwo(HttpServletRequest request) {
return accountRechargeService.pcTwoNotifyResponse(request);
}
@GetMapping("/orderSnList")
@ApiOperation("查询同步数据支付数据")
public CommonResult<Page<PayTwoOrder>> getOrderSnAll(@RequestParam(value = "nickName", required = false) String nickName, Pageable pageable) {
return accountRechargeService.getOrderSnAll(nickName, pageable);
}
}

@ -0,0 +1,13 @@
package com.hchbox.module.entity.vo;
import com.hchbox.annotaion.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PayTwoOrderVo {
@Query(type = Query.Type.INNER_LIKE, propName = "nickname")
@ApiModelProperty("nickname")
private String nickname;
}

@ -3,7 +3,10 @@ package com.hchbox.module.service;
import com.hchbox.module.entity.PayTwoOrder;
import com.hchbox.module.entity.RechargeOrder;
import com.hchbox.model.param.CommonResult;
import com.hchbox.module.entity.SellerAccount;
import com.hchbox.module.entity.vo.AliPayPcVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletRequest;
@ -50,4 +53,11 @@ public interface AccountRechargeService {
* @return
*/
CommonResult<String> aliPayPcTwo(PayTwoOrder payTwoOrder);
/**
*
* @param nickName
* @return
*/
CommonResult<Page<PayTwoOrder>> getOrderSnAll(String nickName, Pageable pageable);
}

@ -21,10 +21,15 @@ import com.hchbox.module.entity.RechargeOrder;
import com.hchbox.module.entity.SellerAccount;
import com.hchbox.exception.TaoMiCommException;
import com.hchbox.model.param.CommonResult;
import com.hchbox.module.entity.vo.PayTwoOrderVo;
import com.hchbox.module.service.AccountRechargeService;
import com.hchbox.util.GenerateIdUtils;
import com.hchbox.util.PageUtil;
import com.hchbox.util.QueryHelp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alipay.easysdk.factory.Factory;
@ -39,6 +44,7 @@ import java.nio.charset.StandardCharsets;
import java.time.LocalTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* @author wjt
@ -227,6 +233,19 @@ public class AccountRechargeServiceImpl implements AccountRechargeService {
return new CommonResult<String>().forbidden(StatusEnum.PAYMENT_FAILED.getDesc());
}
@Override
public CommonResult<Page<PayTwoOrder>> getOrderSnAll(String nickName, Pageable pageable) {
PayTwoOrderVo payTwoOrderVo = new PayTwoOrderVo();
if (!Objects.equals(nickName, "") && nickName != null) {
payTwoOrderVo.setNickname(nickName);
}
Page<PayTwoOrder> payTwoOrders = payTwoOrderRepository.findAll(
((root, criteriaQuery, cb) ->
QueryHelp.getPredicate(root, payTwoOrderVo, cb)), pageable);
return new CommonResult<Page<PayTwoOrder>>().success(
PageUtil.toPage(payTwoOrders.getContent(), payTwoOrders.getTotalElements()));
}
@Override
public CommonResult<String> pcTwoNotifyResponse(HttpServletRequest request) {
int i = 0;

Loading…
Cancel
Save