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

Commit 0009168a authored by jiangxiulong's avatar jiangxiulong

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

parents 4f463adc 65c07fcc
package com.liquidnet.service.kylin.dto.param;
import lombok.Data;
@Data
public class SyncOrderDtoParam {
private String code;
private String message;
private SyncOrderParam data;
}
......@@ -14,12 +14,12 @@ public class SyncOrderParam {
private String type;
@ApiModelProperty(value = "code")
private String code;
@ApiModelProperty(value = "payment_id")
private String payment_id;
@ApiModelProperty(value = "order_code")
private String order_code;
@ApiModelProperty(value = "paymentId")
private String paymentId;
@ApiModelProperty(value = "orderCode")
private String orderCode;
@ApiModelProperty(value = "price")
private BigDecimal price;
@ApiModelProperty(value = "payment_type")
private String payment_type;
@ApiModelProperty(value = "paymentType")
private String paymentType;
}
......@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.param.PayAgainParam;
import com.liquidnet.service.kylin.dto.param.PayOrderParam;
import com.liquidnet.service.kylin.dto.param.SyncOrderDtoParam;
import com.liquidnet.service.kylin.dto.param.SyncOrderParam;
import com.liquidnet.service.kylin.dto.vo.returns.*;
......
......@@ -364,16 +364,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
String outRefundNo = info.getOutRefundNo();
String refundAt = info.getSuccessTime();
try {
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"),
new Object[]{outRefundNo, info.getRefundRequestSource(), JSON.toJSONString(info), nowTime, nowTime},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_success.update"),
new Object[]{nowTime, refundAt, DragonConstant.RefundStatusEnum.STATUS_REFUNDED.getCode(), outRefundNo},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
NotifyUrlDto dto = new NotifyUrlDto();
if (info.getRefundStatus().equalsIgnoreCase("SUCCESS")) {
......@@ -387,6 +377,17 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundAt(refundAt);
dto.setRefundError(callBackDto.getReturnMsg());
sendNotifyUrl(dto);
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"),
new Object[]{outRefundNo, info.getRefundRequestSource(), JSON.toJSONString(info), nowTime, nowTime},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_success.update"),
new Object[]{nowTime, refundAt, DragonConstant.RefundStatusEnum.STATUS_REFUNDED.getCode(), outRefundNo},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
} catch (Exception e) {
e.printStackTrace();
......@@ -417,18 +418,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
if (response.isSuccess()) {
try {
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"),
new Object[]{response.getOutRequestNo(), response.getRefundReason(), jsonStr, nowTime, nowTime},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
log.debug("SEND MQ INSERT");
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_success.update"),
new Object[]{nowTime, callBackDto.getGmtRefund(), DragonConstant.RefundStatusEnum.STATUS_REFUNDED.getCode(), response.getOutRequestNo()},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
log.debug("SEND MQ UPDATE");
NotifyUrlDto dto = new NotifyUrlDto();
if (response.getMsg().equalsIgnoreCase("SUCCESS")) {
dto.setStatus(1);
......@@ -443,6 +433,19 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundError("");
log.debug("SEND NOTIFTURL = "+ JSON.toJSONString(dto));
sendNotifyUrl(dto);
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"),
new Object[]{response.getOutRequestNo(), response.getRefundReason(), jsonStr, nowTime, nowTime},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
log.debug("SEND MQ INSERT");
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_success.update"),
new Object[]{nowTime, callBackDto.getGmtRefund(), DragonConstant.RefundStatusEnum.STATUS_REFUNDED.getCode(), response.getOutRequestNo()},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
log.debug("SEND MQ UPDATE");
return "success";
} catch (Exception e) {
e.printStackTrace();
......
......@@ -7,6 +7,7 @@ import com.liquidnet.service.base.codec.annotation.DecryptAndVerify;
import com.liquidnet.service.base.codec.vo.EncryptedReq;
import com.liquidnet.service.kylin.dto.param.PayAgainParam;
import com.liquidnet.service.kylin.dto.param.PayOrderParam;
import com.liquidnet.service.kylin.dto.param.SyncOrderDtoParam;
import com.liquidnet.service.kylin.dto.param.SyncOrderParam;
import com.liquidnet.service.kylin.dto.vo.returns.*;
import com.liquidnet.service.kylin.service.IKylinOrderTicketsOrderService;
......
......@@ -13,6 +13,7 @@ import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dto.param.PayAgainParam;
import com.liquidnet.service.kylin.dto.param.PayOrderParam;
import com.liquidnet.service.kylin.dto.param.SyncOrderDtoParam;
import com.liquidnet.service.kylin.dto.param.SyncOrderParam;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketVo;
......@@ -721,13 +722,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
log.debug("SYNC PARAM = " + syncOrderParam.toString());
//支付时间
LocalDateTime now = LocalDateTime.now();
String lock = "order_lock:" + syncOrderParam.getOrder_code();
String lock = "order_lock:" + syncOrderParam.getOrderCode();
if (!redisLockUtil.tryLock(lock, 1, 5)) {
return "fail";//参数错误
}
String timePay = DateUtil.Formatter.yyyyMMddHHmmss.format(now);
KylinOrderTicketVo orderTicketData = mongoTemplate.findOne(Query.query(Criteria.where("orderCode").is(syncOrderParam.getOrder_code())), KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName());
KylinOrderTicketVo orderTicketData = mongoTemplate.findOne(Query.query(Criteria.where("orderCode").is(syncOrderParam.getOrderCode())), KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName());
if (orderTicketData == null) {
redisLockUtil.unlock(lock);
return "fail";//订单不存在
......@@ -764,18 +765,18 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if (orderTicketData.getStatus() == 2) {
orderUtils.resetOrderListVo(orderTicketData.getUserId(), 2, orderTicketData.getOrderTicketsId(), null);
log.error("订单号位 {} 的订单超时支付", syncOrderParam.getOrder_code());
log.error("订单号位 {} 的订单超时支付", syncOrderParam.getOrderCode());
orderRefundsCallbackService.refundApply(orderTicketData.getOrderTicketsId());
} else if (orderTicketData.getStatus() == 3 || orderTicketData.getStatus() == 4) {
log.error("订单号位 {} 的订单正在退款 或者已退款", syncOrderParam.getOrder_code());
log.error("订单号位 {} 的订单正在退款 或者已退款", syncOrderParam.getOrderCode());
} else {
orderTickets.setOrderTicketsId(orderTicketData.getOrderTicketsId());
orderTickets.setPaymentType(syncOrderParam.getPayment_type());
orderTickets.setPaymentType(syncOrderParam.getPaymentType());
orderTickets.setPayCode(syncOrderParam.getCode());
orderTickets.setTimePay(timePay);
orderTickets.setQrCode(IDGenerator.ticketQrCode(orderTicketData.getOrderTicketsId()));
orderTickets.setUpdatedAt(now);
orderTickets.setPaymentId(syncOrderParam.getPayment_id());
orderTickets.setPaymentId(syncOrderParam.getPaymentId());
sqls.add(SqlMapping.get("kylin_order_ticket.synPay"));
sqlsDataA.add(orderTickets.getSynOrderObject(strTime, strTime));
......@@ -900,8 +901,10 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
return ResponseDto.failure(ErrorMapping.get("20024"));
} else {
String returnCheckData = HttpUtil.get(checkUrl + "?code=" + orderTicketData.getPayCode(), null);
PayResultVo checkVo = JsonUtils.fromJson(returnCheckData, PayResultVo.class);
if (checkVo.getData().getStatus() == 1) {
SyncOrderDtoParam syncOrderDtoParam = JsonUtils.fromJson(returnCheckData, SyncOrderDtoParam.class);
if (syncOrderDtoParam.getData().getStatus() == 1) {
//处理订单
syncOrder(syncOrderDtoParam.getData());
return ResponseDto.success(1);
} else {
return ResponseDto.success(0);
......
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