Commit bd89ebf3 authored by 周健威's avatar 周健威

修改延迟还车

parent a1106348
......@@ -3,9 +3,11 @@ package com.xxfc.platform.order.biz.inner;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.common.util.AssertUtils;
import com.xxfc.platform.activity.entity.Coupon;
import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.app.feign.ConfigFeign;
......@@ -32,6 +34,7 @@ import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.universal.inter.CalculateInterface;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleDaysPrice;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import com.xxfc.platform.vehicle.pojo.dto.order.VMCalendarPriceCostDTO;
......@@ -313,7 +316,19 @@ public class OrderCalculateBiz implements CalculateInterface {
Integer overDays = 0 - realResidueDays;
String violateDesc = StrUtil.format(" 延迟{}天", overDays);
List<VMCalendarPriceCostDTO> overAmountList = orderItemBiz.getOverAmountList(realVmcpds.get(realVmcpds.size() - 1).getDate(), overDays, vehicleItemDTO.getGoodId(), baseOrder.getUserId());
VehicleDaysPrice vehicleDaysPrice = AssertUtils.isFeignSucc(vehicleFeign.getVehicleDaysInfo(vehicleItemDTO.getGoodId())).getData();
List<VMCalendarPriceCostDTO> overAmountList = CollUtil.newArrayList();
if(null != vehicleDaysPrice) {
VMCalendarPriceCostDTO dto = realVmcpds.get(realVmcpds.size() - 1);
for(int i = 0; i < overDays; i++) {
VMCalendarPriceCostDTO current = BeanUtil.toBean(dto, VMCalendarPriceCostDTO.class);
current.setDate(DateUtil.offsetDay(current.getDate(), 1));
overAmountList.add(current);
}
}else {
overAmountList = orderItemBiz.getOverAmountList(realVmcpds.get(realVmcpds.size() - 1).getDate(), overDays, vehicleItemDTO.getGoodId(), baseOrder.getUserId());
}
BigDecimal overAmount = overAmountList.parallelStream()
.map(VMCalendarPriceCostDTO::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add).multiply(new BigDecimal(2+ ""));
......
......@@ -269,4 +269,7 @@ public interface VehicleFeign {
@PostMapping("app/publishAeceive/app/unauth/updReceive")
ObjectRestResponse updReceive(@RequestBody VehiclePublishReceiveDTO publishReceiveDTO);
@GetMapping(value = "/app/unauth/getVehicleDaysInfo")
public ObjectRestResponse<VehicleDaysPrice> getVehicleDaysInfo(@RequestParam("vehicleId") String vehicleId);
}
......@@ -58,6 +58,9 @@ import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TR
@Api(value="车辆管理controller",tags={"车辆管理接口"})
public class VehicleController extends BaseController<VehicleBiz> implements UserRestInterface {
@Autowired
private VehicleDaysPriceBiz vehicleDaysPriceBiz;
@Autowired
private VehicleBookRecordBiz vehicleBookRecordBiz;
......@@ -737,6 +740,12 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return baseBiz.getAllVehicleById(vehicleFindAppDTO);
}
@GetMapping(value = "/app/unauth/getVehicleDaysInfo")
@IgnoreUserToken
public ObjectRestResponse<VehicleDaysPrice> getVehicleDaysInfo(@RequestParam("vehicleId") String vehicleId) {
return ObjectRestResponse.succ(vehicleDaysPriceBiz.getInfo(vehicleId));
}
@Data
static public class VehicleVO extends Vehicle {
private VehicleModel vehicleModel;
......
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