feat:订单查询,同步免押字段

This commit is contained in:
yangqingyuan
2024-09-03 15:44:02 +08:00
parent 252aac6e82
commit 79075bdebe
2 changed files with 19 additions and 3 deletions

View File

@@ -80,8 +80,19 @@ public class OrderPayController extends BaseController {
PageParam<OrderPay, OrderPayParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
//return success(orderPayService.list(page.getOrderWrapper()));
List<OrderPay> orderPays = orderPayService.listRel(param);
if (null != param.getRentOrderId() && 0 != param.getRentOrderId()) {//如果是单个查询
Order order = orderService.getById(param.getRentOrderId());
if (null != order && !orderPays.isEmpty()) {
orderPays.forEach(orderPay -> {
orderPay.setIsCreditAuth(order.getIsCreditAuth());//小程序端用于判断是否显示芝麻信用免押
orderPay.setIsFreeze(order.getIsFreeze());
});
}
}
// 使用关联查询
return success(orderPayService.listRel(param));
return success(orderPays);
}
@GetMapping("/{id}")
@@ -166,6 +177,7 @@ public class OrderPayController extends BaseController {
orderPayService.save(one);
}
one.setIsFreeze(order.getIsFreeze());
one.setIsCreditAuth(order.getIsCreditAuth());
one.setIsRenew(isRenew);
if (isRenew == null || isRenew == 0) {
@@ -236,9 +248,9 @@ public class OrderPayController extends BaseController {
order.setExpirationTime(orderPay.getExpirationTime());
orderService.updateById(order);
OrderPay olderPay = orderPayService.getOne(Wrappers.lambdaQuery(OrderPay.class).eq(OrderPay::getOrderNo,orderPay.getOrderNo()));
OrderPay olderPay = orderPayService.getOne(Wrappers.lambdaQuery(OrderPay.class).eq(OrderPay::getOrderNo, orderPay.getOrderNo()));
OrderPay newOrderPay = new OrderPay();
BeanCopier.create(olderPay, newOrderPay, CopyOptions.create().ignoreNullValue().setIgnoreProperties("id","orderNo")).copy();
BeanCopier.create(olderPay, newOrderPay, CopyOptions.create().ignoreNullValue().setIgnoreProperties("id", "orderNo")).copy();
newOrderPay.setOrderPrice(BigDecimal.valueOf(orderPay.getOrderPriceInt()));

View File

@@ -184,6 +184,10 @@ public class OrderPay implements Serializable {
@TableField(exist = false)
private Integer isFreeze;
@ApiModelProperty(value = "信用预授权,即免押模式0非免押1免押")
@TableField(exist = false)
private Integer isCreditAuth;
@ApiModelProperty(value = "是否续费单")
@TableField(exist = false)
private Integer isRenew;