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

Commit b491603e authored by jiangxiulong's avatar jiangxiulong

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

parents aed17656 8bb6aaa3
......@@ -25,6 +25,8 @@ public enum DragonErrorCodeEnum {
TRADE_ALIPAY_SIGN_ERROR("PAY0010009","支付宝签名异常!"),
TRADE_ALIPAY_QUERY_ERROR("PAY0010010","支付宝订单查询失败!"),
TRADE_WEPAY_SIGN_ERROR("PAY0020001","微信签名异常!");
private String code;
......
......@@ -7,6 +7,7 @@ import com.liquidnet.service.dragon.biz.DragonServiceCommonBiz;
import com.liquidnet.service.dragon.bo.PayNotifyReqBo;
import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.dto.DragonOrdersDto;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import com.liquidnet.service.dragon.dto.PayNotifyDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.NameValuePair;
......@@ -63,6 +64,23 @@ public class DragonPayBiz {
return payNotifyReqBo;
}
public DragonPayOrderQueryRespDto buildPayOrderQueryRespDto(DragonOrdersDto ordersDto){
DragonPayOrderQueryRespDto queryRespDto = new DragonPayOrderQueryRespDto();
queryRespDto.setStatus(ordersDto.getStatus());
queryRespDto.setType(ordersDto.getType());
queryRespDto.setCode(ordersDto.getCode());
queryRespDto.setPaymentId(ordersDto.getPaymentId());
queryRespDto.setOrderCode(ordersDto.getOrderCode());
queryRespDto.setPrice(ordersDto.getPrice());
queryRespDto.setPaymentType(ordersDto.getPaymentType());
if(StringUtil.isNotNull(ordersDto.getPaymentAt())){
queryRespDto.setPaymentAt(DateUtil.Formatter.yyyyMMddHHmmss.format(ordersDto.getPaymentAt()));
}else{
queryRespDto.setPaymentAt("");
}
return queryRespDto;
}
// public void sendNotifyBackup(PayNotifyReqBo payNotifyReqBo){
// PayNotifyDto payNotifyDto = payNotifyReqBo.getPayNotifyDto();
......
......@@ -145,12 +145,15 @@ public class PayChannelStrategyAlipayImpl extends AbstractPayChannelStrategyImpl
@Override
public DragonPayOrderQueryRespDto checkOrderStatus(String code) {
DragonOrdersDto ordersDto = dataUtils.getPayOrderByCode(code);
Map<String, Object> resultMap = alipayBiz.tradeQuery(code);
DragonPayOrderQueryRespDto respDto = new DragonPayOrderQueryRespDto();
if ("10000".equals(resultMap.get("code"))) {
}else{
DragonPayOrderQueryRespDto respDto = dragonPayBiz.buildPayOrderQueryRespDto(ordersDto);
if (!"10000".equals(resultMap.get("code"))) {
throw new LiquidnetServiceException(DragonErrorCodeEnum.TRADE_ALIPAY_QUERY_ERROR.getCode(),DragonErrorCodeEnum.TRADE_ALIPAY_QUERY_ERROR.getMessage());
}
// 当返回状态为“TRADE_FINISHED”交易成功结束和“TRADE_SUCCESS”支付成功时更新交易状态
if ("TRADE_SUCCESS".equals(resultMap.get("tradeStatus")) || "TRADE_FINISHED".equals(resultMap.get("tradeStatus"))) {
respDto.setStatus(Integer.valueOf(DragonConstant.PayStatusEnum.STATUS_PAID.getCode()));
}
return respDto;
}
......
......@@ -9,7 +9,6 @@ import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......@@ -31,8 +30,6 @@ public class WepayBiz{
@Value("${liquidnet.dragon.wepay.merchantId}")
private String merchantId;
@Autowired
private WepayBiz wepayBiz;
/**
* 订单查询
*
......
......@@ -4,7 +4,6 @@ import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.dragon.biz.DragonServiceCommonBiz;
import com.liquidnet.service.dragon.channel.strategy.biz.DragonPayBiz;
import com.liquidnet.service.dragon.channel.wepay.biz.WepayBiz;
import com.liquidnet.service.dragon.channel.wepay.constant.WepayConstant;
import com.liquidnet.service.dragon.channel.wepay.resp.WepayOrderQueryRespDto;
......@@ -44,9 +43,6 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
@Autowired
private WepayBiz wepayBiz;
@Autowired
private DragonPayBiz dragonPayBiz;
@Autowired
private DragonServiceCommonBiz dragonServiceCommonBiz;
......
package com.liquidnet.service.dragon.service.impl;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
......@@ -58,20 +57,7 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
}
//如果已支付 直接返回结果
if(!ordersDto.getStatus().toString().equals(DragonConstant.PayStatusEnum.STATUS_UNPAID.getCode())){
DragonPayOrderQueryRespDto queryRespDto = new DragonPayOrderQueryRespDto();
queryRespDto.setStatus(ordersDto.getStatus());
queryRespDto.setType(ordersDto.getType());
queryRespDto.setCode(ordersDto.getCode());
queryRespDto.setPaymentId(ordersDto.getPaymentId());
queryRespDto.setOrderCode(ordersDto.getOrderCode());
queryRespDto.setPrice(ordersDto.getPrice());
queryRespDto.setPaymentType(ordersDto.getPaymentType());
if(StringUtil.isNotNull(ordersDto.getPaymentAt())){
queryRespDto.setPaymentAt(DateUtil.Formatter.yyyyMMddHHmmss.format(ordersDto.getPaymentAt()));
}else{
queryRespDto.setPaymentAt("");
}
return queryRespDto;
return dragonPayBiz.buildPayOrderQueryRespDto(ordersDto);
}
//如果未支付进行三方查询
String payType = DragonConstant.PayTypeEnum.getEnumByCode(ordersDto.getPaymentType()).getPayType();
......
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