记得上下班打卡 | git大法好,push需谨慎

Commit 16b26d7f authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/dev' into dev

parents bc2d6855 bcab995d
...@@ -60,9 +60,12 @@ public class DragonServiceCommonBiz { ...@@ -60,9 +60,12 @@ public class DragonServiceCommonBiz {
DragonOrdersDto ordersDto = new DragonOrdersDto(); DragonOrdersDto ordersDto = new DragonOrdersDto();
BeanUtil.copy(orders,ordersDto); BeanUtil.copy(orders,ordersDto);
long startTime = System.currentTimeMillis();
//放到redis缓存中 //放到redis缓存中
dataUtils.createPayOrder(orders.getCode(),ordersDto); dataUtils.createPayOrder(orders.getCode(),ordersDto);
log.info("redis-createPayOrder->耗时:{}",(System.currentTimeMillis() - startTime)+"毫秒");
// 持久化到数据库 // 持久化到数据库
startTime = System.currentTimeMillis();
boolean insertResult = mqHandleUtil.sendMySqlRedis( boolean insertResult = mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_orders.insert"), SqlMapping.get("dragon_orders.insert"),
new Object[]{orders.getOrderId(),orders.getStatus(), orders.getCode(), orders.getType() new Object[]{orders.getOrderId(),orders.getStatus(), orders.getCode(), orders.getType()
...@@ -74,6 +77,7 @@ public class DragonServiceCommonBiz { ...@@ -74,6 +77,7 @@ public class DragonServiceCommonBiz {
, orders.getUpdatedAt(),orders.getDeletedAt()} , orders.getUpdatedAt(),orders.getDeletedAt()}
,DragonConstant.MysqlRedisQueueEnum.DRAGON_PAY_KEY.getCode() ,DragonConstant.MysqlRedisQueueEnum.DRAGON_PAY_KEY.getCode()
); );
log.info("redis-queue-sendMySqlRedis->耗时:{}",(System.currentTimeMillis() - startTime)+"毫秒");
return orders; return orders;
} }
......
...@@ -54,8 +54,10 @@ public abstract class AbstractAlipayStrategy implements IAlipayStrategy { ...@@ -54,8 +54,10 @@ public abstract class AbstractAlipayStrategy implements IAlipayStrategy {
alipayTradePayReq.setNotifyUrl(this.getNotifyUrl()); alipayTradePayReq.setNotifyUrl(this.getNotifyUrl());
alipayTradePayReq.setTimestamp(dragonPayBaseReqDto.getCreateDate()); alipayTradePayReq.setTimestamp(dragonPayBaseReqDto.getCreateDate());
//调用支付 //调用支付
long startTime = System.currentTimeMillis();
Map<String, Object> result = this.executePay(alipayTradePayReq); Map<String, Object> result = this.executePay(alipayTradePayReq);
log.info("dragonPay:alipay:"+dragonPayBaseReqDto.getDeviceFrom()+" response xmlStr: {} ", JSON.toJSONString(result)); log.info("dragonPay:alipay:"+dragonPayBaseReqDto.getDeviceFrom()+" response xmlStr: {} ", JSON.toJSONString(result));
log.info("alipay-dragonPay->耗时:{}",(System.currentTimeMillis() - startTime)+"毫秒");
//拼接返回参数 //拼接返回参数
DragonPayBaseRespDto respDto = buildCommonRespDto(dragonPayBaseReqDto); DragonPayBaseRespDto respDto = buildCommonRespDto(dragonPayBaseReqDto);
respDto = this.buildResponseDto(respDto,result); respDto = this.buildResponseDto(respDto,result);
......
...@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -11,6 +11,7 @@ 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 io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import lombok.extern.slf4j.Slf4j;
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.*;
...@@ -28,6 +29,7 @@ import java.util.Map; ...@@ -28,6 +29,7 @@ import java.util.Map;
* @Copyright: LightNet @ Copyright (c) 2021 * @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/9 12:29 * @date 2021/7/9 12:29
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("pay") @RequestMapping("pay")
public class PayController { public class PayController {
...@@ -72,6 +74,7 @@ public class PayController { ...@@ -72,6 +74,7 @@ public class PayController {
// @RequestParam(value = "code",required = false) String code, // @RequestParam(value = "code",required = false) String code,
@RequestParam(value = "createDate",required = true) String createDate, @RequestParam(value = "createDate",required = true) String createDate,
@RequestParam(value = "expireTime",required = true) String expireTime){ @RequestParam(value = "expireTime",required = true) String expireTime){
long startTime = System.currentTimeMillis();
//为什么在js和applet中才需要判断open_id? //为什么在js和applet中才需要判断open_id?
if(payType.equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())){ if(payType.equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())){
if(deviceFrom.equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode())||deviceFrom.equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) { if(deviceFrom.equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode())||deviceFrom.equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) {
...@@ -97,7 +100,9 @@ public class PayController { ...@@ -97,7 +100,9 @@ public class PayController {
// dragonPayBaseReqDto.setCode(code); // dragonPayBaseReqDto.setCode(code);
dragonPayBaseReqDto.setCreateDate(createDate); dragonPayBaseReqDto.setCreateDate(createDate);
dragonPayBaseReqDto.setExpireTime(expireTime); dragonPayBaseReqDto.setExpireTime(expireTime);
return dragonOrdersService.dragonPay(dragonPayBaseReqDto); ResponseDto<DragonPayBaseRespDto> responseDto = dragonOrdersService.dragonPay(dragonPayBaseReqDto);
log.info("dragonPay->总耗时:{}",(System.currentTimeMillis() - startTime)+"毫秒");
return responseDto;
} }
@GetMapping("/checkOrder") @GetMapping("/checkOrder")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment