Commit b4d9fbf8 authored by libin's avatar libin

小程序租车申请列表

parent 4c8d8ae6
...@@ -10,9 +10,13 @@ import com.xxfc.platform.vehicle.mapper.VehicleUserReserveMapper; ...@@ -10,9 +10,13 @@ import com.xxfc.platform.vehicle.mapper.VehicleUserReserveMapper;
import com.xxfc.platform.vehicle.pojo.dto.VehicleUserReserveDTO; import com.xxfc.platform.vehicle.pojo.dto.VehicleUserReserveDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehicleUserReserveVo; import com.xxfc.platform.vehicle.pojo.vo.VehicleUserReserveVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service @Service
...@@ -30,7 +34,24 @@ public class VehicleUserReserveBiz extends BaseBiz<VehicleUserReserveMapper, Veh ...@@ -30,7 +34,24 @@ public class VehicleUserReserveBiz extends BaseBiz<VehicleUserReserveMapper, Veh
if (reserveDTO.getLimit()!=null&&reserveDTO.getLimit()>0){ if (reserveDTO.getLimit()!=null&&reserveDTO.getLimit()>0){
limit=reserveDTO.getLimit(); limit=reserveDTO.getLimit();
} }
return ObjectRestResponse.succ(PageDataVO.pageInfo(page, limit, ()->mapper.getList(reserveDTO,userId)));
PageDataVO<VehicleUserReserveVo> dataVO = PageDataVO.pageInfo(page, limit, () -> mapper.getList(reserveDTO, userId));
if (CollectionUtils.isEmpty(dataVO.getData())){
dataVO.setData(Collections.EMPTY_LIST);
dataVO.setPageNum(reserveDTO.getPage());
dataVO.setPageSize(reserveDTO.getLimit());
return ObjectRestResponse.succ(dataVO);
}
List<VehicleUserReserveVo> data = dataVO.getData();
for (VehicleUserReserveVo userReserveVo : data) {
String vehiclePic = userReserveVo.getVehiclePic();
if (StringUtils.isNotEmpty(vehiclePic)){
String[] imgs = vehiclePic.split(",");
userReserveVo.setVehiclePic(imgs[0]);
}
}
dataVO.setData(data);
return ObjectRestResponse.succ(dataVO);
} }
//新增预定 //新增预定
......
...@@ -17,16 +17,16 @@ ...@@ -17,16 +17,16 @@
r.addr_city AS addrCity, r.addr_city AS addrCity,
r.city_name AS cityName, r.city_name AS cityName,
r.company_id AS companyId, r.company_id AS companyId,
CONCAT(bct.province_name,bct.city_name,bct.town_name,bct.addr_detail) AS `companyAddress`, CONCAT(IFNULL(bct.province_name," "),IFNULL(bct.city_name," "),IFNULL(bct.town_name," "),IFNULL(bct.addr_detail," ")) AS `companyAddress`,
r.arrival_companyId AS arrivalCompanyId, r.arrival_companyId AS arrivalCompanyId,
CONCAT(bcr.province_name,bcr.city_name,bcr.town_name,bcr.addr_detail) AS `arrivalcompanyAddress`, CONCAT(IFNULL(bcr.province_name," "),IFNULL(bcr.city_name," "),IFNULL(bcr.town_name," "),IFNULL(bcr.addr_detail," ")) AS `arrivalcompanyAddress`,
bct.NAME AS `companyName`, bct.NAME AS `companyName`,
bcr.NAME AS `arrivalCompanyName`, bcr.NAME AS `arrivalCompanyName`,
r.crt_time AS crtTime, r.crt_time AS crtTime,
r.upd_time AS updTime, r.upd_time AS updTime,
r.`status`, r.`status`,
m.`name` AS modelName, m.`name` AS modelName,
m.`cover_pic` AS `vehiclePic` m.`picture` AS `vehiclePic`
FROM FROM
vehicle_user_reserve r vehicle_user_reserve r
LEFT JOIN vehicle_model m ON r.mode_id = m.id LEFT JOIN vehicle_model m ON r.mode_id = m.id
......
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