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