From 88d7498563a8c5706c3688d2b2868ebebae17f53 Mon Sep 17 00:00:00 2001 From: "yqyg16603827325@126.com" Date: Mon, 15 Nov 2021 14:49:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=AF=E4=BB=98=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/controller/RechargeController.java | 15 +++++++++++---- .../module/entity/vo/PayTwoOrderVo.java | 13 +++++++++++++ .../service/AccountRechargeService.java | 10 ++++++++++ .../impl/AccountRechargeServiceImpl.java | 19 +++++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/entity/vo/PayTwoOrderVo.java diff --git a/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/controller/RechargeController.java b/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/controller/RechargeController.java index 2b01022..bbdccf2 100644 --- a/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/controller/RechargeController.java +++ b/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/controller/RechargeController.java @@ -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 frontRcvResponseTwo(HttpServletRequest request) { return accountRechargeService.pcTwoNotifyResponse(request); } + + @GetMapping("/orderSnList") + @ApiOperation("查询同步数据支付数据") + public CommonResult> getOrderSnAll(@RequestParam(value = "nickName", required = false) String nickName, Pageable pageable) { + return accountRechargeService.getOrderSnAll(nickName, pageable); + } } diff --git a/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/entity/vo/PayTwoOrderVo.java b/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/entity/vo/PayTwoOrderVo.java new file mode 100644 index 0000000..fcfcf08 --- /dev/null +++ b/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/entity/vo/PayTwoOrderVo.java @@ -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; +} diff --git a/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/service/AccountRechargeService.java b/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/service/AccountRechargeService.java index c979ed2..7277648 100644 --- a/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/service/AccountRechargeService.java +++ b/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/service/AccountRechargeService.java @@ -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 aliPayPcTwo(PayTwoOrder payTwoOrder); + + /** + * 查询同步数据支付数据 + * @param nickName + * @return + */ + CommonResult> getOrderSnAll(String nickName, Pageable pageable); } diff --git a/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/service/impl/AccountRechargeServiceImpl.java b/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/service/impl/AccountRechargeServiceImpl.java index 6993cf3..c041e15 100644 --- a/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/service/impl/AccountRechargeServiceImpl.java +++ b/service/trade-service-others/trade-service-others-account/src/main/java/com/hchbox/module/service/impl/AccountRechargeServiceImpl.java @@ -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().forbidden(StatusEnum.PAYMENT_FAILED.getDesc()); } + @Override + public CommonResult> getOrderSnAll(String nickName, Pageable pageable) { + PayTwoOrderVo payTwoOrderVo = new PayTwoOrderVo(); + if (!Objects.equals(nickName, "") && nickName != null) { + payTwoOrderVo.setNickname(nickName); + } + Page payTwoOrders = payTwoOrderRepository.findAll( + ((root, criteriaQuery, cb) -> + QueryHelp.getPredicate(root, payTwoOrderVo, cb)), pageable); + return new CommonResult>().success( + PageUtil.toPage(payTwoOrders.getContent(), payTwoOrders.getTotalElements())); + } + @Override public CommonResult pcTwoNotifyResponse(HttpServletRequest request) { int i = 0;