Commit 2843c9fc authored by 周健威's avatar 周健威

修改申请

parent e4373605
......@@ -396,8 +396,16 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty(value = "车辆隶属企业id")
private Long vehicleBranchId;
public void setVehicleBranchId(Long vehicleBranchId) {
this.vehicleBranchId = vehicleBranchId;
}
public void setVehicleCompanyId(Integer vehicleCompanyId) {
this.vehicleCompanyId = vehicleCompanyId;
}
@Column(name = "vehicle_company_id")
@ApiModelProperty(value = "车辆公司(门店)id")
@ApiModelProperty(value = "车辆隶属公司(门店)id")
private Integer vehicleCompanyId;
@Column(name = "vehicle_deposit")
......@@ -408,6 +416,14 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty(value = "交通违章押金")
private BigDecimal trafficDeposit;
@Column(name = "vehicle_manage_branch_id")
@ApiModelProperty(value = "车辆隶属企业id")
private Long vehicleManageBranchId;
@Column(name = "vehicle_manage_company_id")
@ApiModelProperty(value = "车辆隶属公司(门店)id")
private Integer vehicleManageCompanyId;
/**
* 商品押金方式 1--线上;2--线下
*/
......
......@@ -10,7 +10,6 @@ import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import static com.xxfc.platform.order.config.RabbitDelayConfig.*;
import static com.xxfc.platform.order.config.RabbitDelayConfig.APPLY_CANCEL_KEY;
/**
* rabbitMq生产者类
......@@ -58,5 +57,21 @@ public class RabbitProduct {
log.info("{}ms后执行", delayTime);
}
public void sendApplyRequireDelayMessage(ShuntApply shuntApply, Long delayTime) {
//这里的消息可以是任意对象,无需额外配置,直接传即可
log.info("===============延时队列生产消息====================");
log.info("发送时间:{},发送内容:{}", LocalDateTime.now(), shuntApply.toString());
this.rabbitTemplate.convertAndSend(
APPLY_REQUIRE_CANCEL_EXC,
APPLY_REQUIRE_CANCEL_KEY,
shuntApply,
message -> {
//注意这里时间可以使long,而且是设置header
message.getMessageProperties().setHeader("x-delay", delayTime);
return message;
}
);
log.info("{}ms后执行", delayTime);
}
}
......@@ -185,6 +185,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
if(null != bo.getVehicleId()) {
Vehicle vehicle = vehicleFeign.get(bo.getVehicleId()).getData();
bo.setVehicleCompanyId(vehicle.getSubordinateBranch());
bo.setVehicleManageCompanyId(vehicle.getManageCompanyId());
List<BranchCompany> companyDetails = vehicleFeign.branchCompanyEntityList(
BeanUtil.beanToMap(new BranchCompany(){{
......@@ -195,6 +196,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
bo.setVehicleBranchId(companyDetails.get(0).getCompanyId());
}
List<BranchCompany> companyDetails2 = vehicleFeign.branchCompanyEntityList(
BeanUtil.beanToMap(new BranchCompany(){{
setId(bo.getVehicleManageCompanyId());
}}, false, true)).getData();
if(null != companyDetails2 && companyDetails2.size() > 0) {
bo.setVehicleManageBranchId(companyDetails2.get(0).getCompanyId());
}
//商品类型
bo.getOrder().setGoodsType(vehicle.getGoodsType());
bo.setVehicle(vehicle);
......@@ -719,6 +729,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
depositAmount = depositAmount.add(detail.getTrafficDeposit());
}
orderAmount = orderAmount.add(goodsAmount).add(depositAmount);
realAmount = orderAmount.subtract(couponAmount);
//生成订单明细
RentVehiclePriceVO rvp = new RentVehiclePriceVO();
......
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