Commit 6cb105d3 authored by hezhen's avatar hezhen

Merge branch 'dev-chw' of http://113.105.137.151:22280/youjj/cloud-platform into dev-chw

parents 7038c739 486f7673
......@@ -216,4 +216,14 @@ public class ShuntApply implements Serializable {
@Column(name = "goods_type")
@ApiModelProperty("商品类型 1--房车;2--机车;3--游艇")
private Integer goodsType;
@Column(name = "brand_name")
@ApiModelProperty("品牌名称")
private Integer brandName;
@Column(name = "category_name")
@ApiModelProperty("型号名称")
private Integer categoryName;
}
......@@ -90,10 +90,22 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
*/
private String endDateStr;
/**
* 开始时间字符串
*/
private String startDateTimeStr;
/**
* 结束时间字符串
*/
private String endDateTimeStr;
public void initDate() {
this.startDate = DateUtil.date(getStartTime());
this.endDate = DateUtil.date(getEndTime());
this.startDateStr = DateUtil.formatDate(this.startDate);
this.endDateStr = DateUtil.formatDate(this.endDate);
this.startDateTimeStr = DateUtil.formatDateTime(this.startDate);
this.endDateTimeStr = DateUtil.formatDateTime(this.endDate);
}
}
......@@ -176,6 +176,29 @@ public class VehicleItemDTO extends OrderItem {
return mapFreeDays;
}
public void initDetail() {
if(StrUtil.isNotBlank(getDetail())) {
List<VehicleModelCalendarPriceDTO> metaList = JSONUtil.toList(JSONUtil.parseArray(getDetail()), VehicleModelCalendarPriceDTO.class);
//计算消费金额
List<VMCalendarPriceCostDTO> list = Convert.toList(VMCalendarPriceCostDTO.class, metaList);
// ParamDTO paramDTO = initParam(ableFreeDays, list);
BigDecimal tempUnitPrice = null;
this.sameUnitPrice = 1;
for(VMCalendarPriceCostDTO dto : list) {
if(null == tempUnitPrice) {
tempUnitPrice = dto.getPrice();
}else if( !tempUnitPrice.equals(dto.getPrice())) {
this.sameUnitPrice = 0;
}
//直接设置价格
dto.setFreeAndConsumeAmount(dto.getPrice(), BigDecimal.ZERO);
}
setCutNum(0);
setOffsetNum(0);
setDetail(JSONUtil.parseArray(list).toString());
}
}
public void initDetail(Integer ableFreeDays) {
if(StrUtil.isNotBlank(getDetail())) {
List<VehicleModelCalendarPriceDTO> metaList = JSONUtil.toList(JSONUtil.parseArray(getDetail()), VehicleModelCalendarPriceDTO.class);
......
......@@ -28,6 +28,8 @@ import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.order.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO;
import com.xxfc.platform.order.service.OrderRentVehicleService;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleBrand;
import com.xxfc.platform.vehicle.entity.VehicleCategory;
import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
......@@ -93,6 +95,13 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
if(null != shuntApply.getEndCompanyId()) {
shuntApply.setEndCityCode(vehicleFeign.getCompanyDetail(shuntApply.getEndCompanyId()).getData().getAddrCity());
}
// if(null != shuntApply.getCategoryId()) {
// VehicleCategory vehicleCategory = vehicleFeign.getVehicleCategory(shuntApply.getCategoryId()).getData();
// shuntApply.setCategoryName(vehicleCategory.getName());
// }else if{
//
// }
shuntApply.setUserId(getCurrentUserIdInt());
shuntApply.setStatus(STATUS_CRT);
return add(shuntApply);
......@@ -134,11 +143,11 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
w.andEqualTo(ShuntApply::getUserId, dto.getUserId());
return w;
}, " crt_time desc "), ShuntApplyVO.class);
pages.getData().forEach(data -> {
if(null != data.getCategoryId()) {
data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
}
});
// pages.getData().forEach(data -> {
// if(null != data.getCategoryId()) {
// data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
// }
// });
return ObjectRestResponse.succ(pages);
}
......@@ -193,6 +202,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
// VehicleModel vehicleModel;
OrderPageVO orderPageVO;
VehicleCategory vehicleCategory;
VehicleBrand vehicleBrand;
}
@Data
......@@ -222,11 +232,11 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
return w;
}, " crt_time desc "), StewardShuntApply.class);
list.getData().forEach(data -> {
if(null != data.getCategoryId()) {
data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
}
});
// list.getData().forEach(data -> {
// if(null != data.getCategoryId()) {
// data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
// }
// });
return ObjectRestResponse.succ(list);
}
......@@ -352,9 +362,9 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
}), ShuntApplyController.ShuntApplyVO.class);
pages.getData().forEach(data -> {
if(null != data.getCategoryId()) {
data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
}
// if(null != data.getCategoryId()) {
// data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
// }
if(StrUtil.isNotBlank(data.getOrderNo())) {
Map<String, Object> map = CollUtil.newHashMap();
......@@ -390,5 +400,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
public static class StewardShuntApply extends ShuntApply {
List<UsableVeicleVO> vehicles;
VehicleCategory vehicleCategory;
VehicleBrand vehicleBrand;
}
}
\ No newline at end of file
......@@ -216,9 +216,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
bo.getOrder().setStatus(OrderStatusEnum.ORDER_UNPAY.getCode());
//设置订单图片
bo.getOrder().setPicture(StrUtil.isNotBlank(bo.getVehicleModel().getCoverPic())? bo.getVehicleModel().getCoverPic(): bo.getVehicleModel().getPicture());
bo.getOrder().setPicture(StrUtil.isNotBlank(bo.getVehicle().getCover())? bo.getVehicle().getCover(): bo.getVehicle().getPicture());
//设置订单名称
bo.getOrder().setName(bo.getVehicleModel().getName());
bo.getOrder().setName(bo.getVehicle().getName());
//分布式事务执行标记
Integer cloudTransact = 0;
......@@ -626,7 +626,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
// vmcpds = vehicleOrderItem.getVehicleDetail();
// detail.setFreeDays(freeDayNum);
vehicleOrderItem.initDetail(0);
vehicleOrderItem.initDetail();
vmcpds = vehicleOrderItem.getVehicleDetail();
vehicleHourNum = detail.getHourNum();
//计算价格
......
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