|
@@ -45,8 +45,7 @@ import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import static com.rongwei.wechat.system.utils.SaveConstans.PayType.SUCCESS;
|
|
|
-import static com.rongwei.wechat.system.utils.SaveConstans.PayType.WE_CHAT;
|
|
|
+import static com.rongwei.wechat.system.utils.SaveConstans.PayType.*;
|
|
|
|
|
|
/**
|
|
|
* PayMentServiceImpl class
|
|
@@ -260,12 +259,12 @@ public class PayMentServiceImpl implements PayMentService {
|
|
|
.eq(SwPaymentInitRecordDo::getOrderno, outTradeNo), false);
|
|
|
String zdIds = null;
|
|
|
if (paymentInitRecordDo != null) {
|
|
|
- zdIds =StringUtils.isBlank(paymentInitRecordDo.getBillid()) ? null : paymentInitRecordDo.getBillid();
|
|
|
+ zdIds = StringUtils.isBlank(paymentInitRecordDo.getBillid()) ? null : paymentInitRecordDo.getBillid();
|
|
|
swPaymentInitRecordService.update(new LambdaUpdateWrapper<SwPaymentInitRecordDo>()
|
|
|
- .eq(SwPaymentInitRecordDo::getId,paymentInitRecordDo.getId())
|
|
|
- .set(SwPaymentInitRecordDo::getState,SUCCESS)
|
|
|
- .set(SwPaymentInitRecordDo::getCallbackcontent,transaction.toString())
|
|
|
- .set(BaseDo::getModifydate,new Date())
|
|
|
+ .eq(SwPaymentInitRecordDo::getId, paymentInitRecordDo.getId())
|
|
|
+ .set(SwPaymentInitRecordDo::getState, SUCCESS)
|
|
|
+ .set(SwPaymentInitRecordDo::getCallbackcontent, transaction.toString())
|
|
|
+ .set(BaseDo::getModifydate, new Date())
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -284,4 +283,19 @@ public class PayMentServiceImpl implements PayMentService {
|
|
|
}
|
|
|
return ResponseEntity.status(HttpStatus.OK).body("");
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R cancel(String orderNo, String type) {
|
|
|
+ if (StringUtils.isBlank(orderNo) || StringUtils.isBlank(type)) {
|
|
|
+ log.error("订单取消参数异常");
|
|
|
+ }
|
|
|
+ swPaymentInitRecordService.update(new LambdaUpdateWrapper<SwPaymentInitRecordDo>()
|
|
|
+ .eq(SwPaymentInitRecordDo::getOrderno, orderNo)
|
|
|
+ .eq(SwPaymentInitRecordDo::getPaytype, type)
|
|
|
+ .set(SwPaymentInitRecordDo::getState, CANCEL)
|
|
|
+ .set(SwPaymentInitRecordDo::getCallbackcontent, "用户手动取消付款时间为:" + LocalDateTime.now())
|
|
|
+ .set(BaseDo::getModifydate, new Date())
|
|
|
+ );
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|