Commit 1141ccff authored by hezhen's avatar hezhen

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

parents 9aa20fb4 ce20f0d3
package com.xxfc.platform.vehicle.rest; package com.xxfc.platform.vehicle.rest;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.vehicle.biz.VehicleBiz; import com.xxfc.platform.vehicle.biz.VehicleBiz;
import com.xxfc.platform.vehicle.biz.VehicleHolidayPriceInfoBiz; import com.xxfc.platform.vehicle.biz.VehicleHolidayPriceInfoBiz;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleHolidayPriceInfo; import com.xxfc.platform.vehicle.entity.VehicleHolidayPriceInfo;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO; import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehicleVO; import com.xxfc.platform.vehicle.pojo.vo.VehicleVO;
...@@ -53,18 +50,18 @@ public class VehicleHolidayPriceInfoController extends BaseController<VehicleHol ...@@ -53,18 +50,18 @@ public class VehicleHolidayPriceInfoController extends BaseController<VehicleHol
Integer userId = Integer.valueOf(getCurrentUserId()); Integer userId = Integer.valueOf(getCurrentUserId());
List<VehicleVO> vehicleVOS = CollUtil.newArrayList(); List<VehicleVO> vehicleVOS = CollUtil.newArrayList();
if(StrUtil.isNotBlank(vehicleIds)) { // if(StrUtil.isNotBlank(vehicleIds)) {
String[] strs = StrUtil.split(vehicleIds, ","); // String[] strs = StrUtil.split(vehicleIds, ",");
List<Vehicle> vehicleList = vehicleBiz.selectByWeekend(w -> { // List<Vehicle> vehicleList = vehicleBiz.selectByWeekend(w -> {
w.andIn(Vehicle::getId, CollUtil.toList(strs)); // w.andIn(Vehicle::getId, CollUtil.toList(strs));
return w; // return w;
}); // });
for (Vehicle vehicle : vehicleList) { // for (Vehicle vehicle : vehicleList) {
VehicleVO vehicleVO = BeanUtil.toBean(vehicle, VehicleVO.class); // VehicleVO vehicleVO = BeanUtil.toBean(vehicle, VehicleVO.class);
vehicleVO.setPriceDTOS(baseBiz.getSynthesizePrice(vehicle.getId(), startDate, endDate, userId, companyId)); // vehicleVO.setPriceDTOS(baseBiz.getSynthesizePrice(vehicle.getId(), startDate, endDate, userId, companyId));
vehicleVOS.add(vehicleVO); // vehicleVOS.add(vehicleVO);
} // }
} // }
return ObjectRestResponse.succ(vehicleVOS); return ObjectRestResponse.succ(vehicleVOS);
} }
......
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
<mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleHolidayPriceInfoMapper"> <mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleHolidayPriceInfoMapper">
<select id="getAll" resultType=" com.xxfc.platform.vehicle.pojo.vo.VehicleHolidayPriceInfoVo"> <select id="getAll" resultType="com.xxfc.platform.vehicle.pojo.vo.VehicleHolidayPriceInfoVo">
select festival_id, festival_day, MIN(festival_date) as startTime, MAX(festival_date) as endTime, rent_price, rent_free_day from vehicle_holiday_price_info select festival_id, festival_day, MIN(festival_date) as startTime, MAX(festival_date) as endTime, rent_price, rent_free_day from vehicle_holiday_price_info
GROUP BY festival_id,festival_day,rent_price, rent_free_day GROUP BY festival_id,festival_day,rent_price, rent_free_day
HAVING festival_id = #{festivalId} <if test="festivalId != null">
HAVING festival_id = #{festivalId}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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