Commit 364189dd authored by 周健威's avatar 周健威

Merge branch 'master-chw-price' into dev-chw

parents 259f848a a1106348
...@@ -8,6 +8,8 @@ import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface; ...@@ -8,6 +8,8 @@ import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
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.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleCommonPriceInfo; import com.xxfc.platform.vehicle.entity.VehicleCommonPriceInfo;
import com.xxfc.platform.vehicle.entity.VehicleHolidayPriceInfo; import com.xxfc.platform.vehicle.entity.VehicleHolidayPriceInfo;
...@@ -36,7 +38,7 @@ import static cn.hutool.core.date.DateField.HOUR_OF_DAY; ...@@ -36,7 +38,7 @@ import static cn.hutool.core.date.DateField.HOUR_OF_DAY;
*/ */
@Service @Service
@Slf4j @Slf4j
public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoMapper, VehicleHolidayPriceInfo> implements UserRestInterface { public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoMapper, VehicleHolidayPriceInfo> implements UserRestInterface, CalculateInterface {
private static final Integer DEFAULT_DISCOUNT = 100; private static final Integer DEFAULT_DISCOUNT = 100;
private static final Integer DEFAULT_FREE_DAYS = 1; private static final Integer DEFAULT_FREE_DAYS = 1;
private static final Integer DEFAULT_MEMBER_LEVEL = 0; private static final Integer DEFAULT_MEMBER_LEVEL = 0;
...@@ -52,9 +54,15 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM ...@@ -52,9 +54,15 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
@Autowired @Autowired
VehicleBiz vehicleBiz; VehicleBiz vehicleBiz;
@Autowired
VehicleDaysPriceBiz vehicleDaysPriceBiz;
@Autowired @Autowired
UserFeign userFeign; UserFeign userFeign;
@Autowired
ThirdFeign thirdFeign;
@Autowired @Autowired
VehicleCommonPriceInfoBiz vehicleCommonPriceInfoBiz; VehicleCommonPriceInfoBiz vehicleCommonPriceInfoBiz;
...@@ -64,6 +72,11 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM ...@@ -64,6 +72,11 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
return userFeign; return userFeign;
} }
@Override
public ThirdFeign getThirdFeign() {
return thirdFeign;
}
public ObjectRestResponse addOrUpdate(VehicleHolidayPriceInfo vehicleHolidayPriceInfo ) { public ObjectRestResponse addOrUpdate(VehicleHolidayPriceInfo vehicleHolidayPriceInfo ) {
if (vehicleHolidayPriceInfo == null) { if (vehicleHolidayPriceInfo == null) {
return ObjectRestResponse.paramIsEmpty(); return ObjectRestResponse.paramIsEmpty();
...@@ -199,13 +212,14 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM ...@@ -199,13 +212,14 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
VehicleModelCalendarPriceDTO dto = new VehicleModelCalendarPriceDTO(){{ VehicleModelCalendarPriceDTO dto = new VehicleModelCalendarPriceDTO(){{
setDate(DateUtil.beginOfDay(finalCurrentDate)); setDate(DateUtil.beginOfDay(finalCurrentDate));
}}; }};
Vehicle vehicleP = vehicleDaysPriceBiz.getVehiclePrice(vehicleId, getIncludeDays(startDateTemp, endDateTemp));
if(currentDate.isWeekend()) { if(currentDate.isWeekend()) {
dto.setNo_discount_price(vehicle.getHolidayPrice()); dto.setNo_discount_price(vehicleP.getHolidayPrice());
dto.setPrice(vehicle.getHolidayPrice()); dto.setPrice(vehicleP.getHolidayPrice());
dto.setFreeDays(1); dto.setFreeDays(1);
}else { }else {
dto.setNo_discount_price(vehicle.getPrice()); dto.setNo_discount_price(vehicleP.getPrice());
dto.setPrice(vehicle.getPrice()); dto.setPrice(vehicleP.getPrice());
dto.setFreeDays(1); dto.setFreeDays(1);
} }
......
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