增加接触免押状态
This commit is contained in:
@ -14,6 +14,7 @@ public enum PayStatusEnum {
|
|||||||
INIT("INIT", "初始化"),
|
INIT("INIT", "初始化"),
|
||||||
USERPAYING("USERPAYING", "用户支付中"),
|
USERPAYING("USERPAYING", "用户支付中"),
|
||||||
SUCCESS("SUCCESS", "支付成功"),
|
SUCCESS("SUCCESS", "支付成功"),
|
||||||
|
UNFREEZE_SUCCESS("UNFREEZE_SUCCESS", "解除免押成功"),
|
||||||
PAYERROR("PAYERROR", "支付失败"),
|
PAYERROR("PAYERROR", "支付失败"),
|
||||||
REFUNDING("REFUNDING", "退款中"),
|
REFUNDING("REFUNDING", "退款中"),
|
||||||
REFUND_SUCCESS("REFUND_SUCCESS", "退款成功"),
|
REFUND_SUCCESS("REFUND_SUCCESS", "退款成功"),
|
||||||
|
|||||||
@ -17,10 +17,7 @@ import com.sczx.order.service.OrderDistribService;
|
|||||||
import com.sczx.order.service.OrderService;
|
import com.sczx.order.service.OrderService;
|
||||||
import com.sczx.order.service.PayService;
|
import com.sczx.order.service.PayService;
|
||||||
import com.sczx.order.thirdpart.dto.*;
|
import com.sczx.order.thirdpart.dto.*;
|
||||||
import com.sczx.order.thirdpart.dto.req.AlipayCloseRequest;
|
import com.sczx.order.thirdpart.dto.req.*;
|
||||||
import com.sczx.order.thirdpart.dto.req.AlipayFundFreezeRequest;
|
|
||||||
import com.sczx.order.thirdpart.dto.req.AlipayQueryFreezeRequest;
|
|
||||||
import com.sczx.order.thirdpart.dto.req.CarQueryConditionReq;
|
|
||||||
import com.sczx.order.thirdpart.integration.CarInteg;
|
import com.sczx.order.thirdpart.integration.CarInteg;
|
||||||
import com.sczx.order.thirdpart.integration.PayInteg;
|
import com.sczx.order.thirdpart.integration.PayInteg;
|
||||||
import com.sczx.order.thirdpart.integration.StoreInteg;
|
import com.sczx.order.thirdpart.integration.StoreInteg;
|
||||||
@ -1074,6 +1071,9 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
if(!orderMainPO.getStoreId().equals(carDTO.getStoreId())){
|
if(!orderMainPO.getStoreId().equals(carDTO.getStoreId())){
|
||||||
throw new BizException("此车辆不属于当前门店");
|
throw new BizException("此车辆不属于当前门店");
|
||||||
}
|
}
|
||||||
|
if(!Objects.equals(orderMainPO.getCarModelId(), carDTO.getModelId())){
|
||||||
|
throw new BizException("不能绑定此车型:"+carDTO.getModelName()+",的车辆");
|
||||||
|
}
|
||||||
if(!orderMainPO.getOrderStatus().equals(OrderStatusEnum.WAIT_PICK.getCode())){
|
if(!orderMainPO.getOrderStatus().equals(OrderStatusEnum.WAIT_PICK.getCode())){
|
||||||
throw new BizException("订单状态异常,非待取车状态");
|
throw new BizException("订单状态异常,非待取车状态");
|
||||||
}
|
}
|
||||||
@ -1341,6 +1341,29 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
orderSubRepo.save(fdSubOrder);
|
orderSubRepo.save(fdSubOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//免押订单,则还需要解除免押
|
||||||
|
orderSubWrapper = new LambdaQueryWrapper<>();
|
||||||
|
orderSubWrapper.eq(OrderSubPO::getOrderId, orderDTO.getOrderId())
|
||||||
|
.eq(OrderSubPO::getDelFlag, "0")
|
||||||
|
.eq(OrderSubPO::getSuborderType, SubOrderTypeEnum.NO_DEPOSIT.getCode())
|
||||||
|
.eq(OrderSubPO::getPayStatus, PayStatusEnum.SUCCESS).last(" limit 1");
|
||||||
|
OrderSubPO noDepositOrder = orderSubRepo.getOne(orderSubWrapper);
|
||||||
|
if (Objects.nonNull(noDepositOrder)) {
|
||||||
|
AlipayFinishFreezeRequest alipayFinishFreezeRequest = new AlipayFinishFreezeRequest();
|
||||||
|
alipayFinishFreezeRequest.setCompanyId(orderDTO.getOperatorId().toString());
|
||||||
|
alipayFinishFreezeRequest.setAuthNo(noDepositOrder.getTransactionId());
|
||||||
|
alipayFinishFreezeRequest.setOutRequestNo(noDepositOrder.getPaymentId());
|
||||||
|
alipayFinishFreezeRequest.setAmount(noDepositOrder.getAmount().toString());
|
||||||
|
AlipayResponse result = payInteg.finishFreeze(alipayFinishFreezeRequest);
|
||||||
|
if (result.isSuccess()) {
|
||||||
|
//解冻成功更新状态为解冻成功
|
||||||
|
LambdaUpdateWrapper<OrderSubPO> updatenoDepositWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updatenoDepositWrapper.set(OrderSubPO::getPayStatus, PayStatusEnum.UNFREEZE_SUCCESS.getCode())
|
||||||
|
.eq(OrderSubPO::getSuborderId, noDepositOrder.getSuborderId());
|
||||||
|
orderSubRepo.update(updatenoDepositWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
return orderDTO;
|
return orderDTO;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user