Commit e3cc0618 authored by jiaorz's avatar jiaorz

取消预定和出车的bug

parent 9d964acd
package com.xxfc.platform.order.entity; package com.xxfc.platform.order.entity;
import com.github.wxiaoqi.security.admin.vo.AppUserVo; import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.xxfc.platform.tour.entity.TourUser;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -245,5 +246,5 @@ public class OrderTourDetail implements Serializable { ...@@ -245,5 +246,5 @@ public class OrderTourDetail implements Serializable {
private Integer isOutside; private Integer isOutside;
@Transient @Transient
private List<AppUserVo> userVoList; private List<TourUser> userVoList;
} }
...@@ -26,6 +26,7 @@ import com.xxfc.platform.order.pojo.order.OrderPageVO; ...@@ -26,6 +26,7 @@ import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto; import com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto;
import com.xxfc.platform.order.pojo.order.QueryOrderDTO; import com.xxfc.platform.order.pojo.order.QueryOrderDTO;
import com.xxfc.platform.order.rest.BaseOrderController; import com.xxfc.platform.order.rest.BaseOrderController;
import com.xxfc.platform.tour.entity.TourUser;
import com.xxfc.platform.tour.feign.TourFeign; import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.universal.constant.DictionaryKey; import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.dto.SendMsgDTO; import com.xxfc.platform.universal.dto.SendMsgDTO;
...@@ -179,18 +180,11 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> { ...@@ -179,18 +180,11 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
orderPageVo.setVehicalNumberPlat(response.getData().getNumberPlate()); orderPageVo.setVehicalNumberPlat(response.getData().getNumberPlate());
} }
} else if (orderPageVo.getOrderTourDetail() != null) { } else if (orderPageVo.getOrderTourDetail() != null) {
List<Integer> ids = Lists.newArrayList(); if(StringUtils.isNotBlank(orderPageVo.getOrderTourDetail().getTourUserIds())) {
if (orderPageVo.getOrderTourDetail().getTourUserIds().contains(",")) { List<TourUser> list = tourFeign.getTourUsers(orderPageVo.getOrderTourDetail().getTourUserIds()).getData();
String[] strings = orderPageVo.getOrderTourDetail().getTourUserIds().split(",");
for (int i = 0; i < strings.length; i++) {
ids.add(Integer.parseInt(StringUtils.isNotBlank(strings[i]) ? strings[i] : "0"));
}
} else {
ids.add(Integer.parseInt(orderPageVo.getOrderTourDetail().getTourUserIds()));
}
List<AppUserVo> list = userFeign.getByUserIds(ids).getData();
orderPageVo.getOrderTourDetail().setUserVoList(list == null || list.size() <= 0 ? new ArrayList<>() : list); orderPageVo.getOrderTourDetail().setUserVoList(list == null || list.size() <= 0 ? new ArrayList<>() : list);
} }
}
//设置保留金 //设置保留金
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData(); Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
BigDecimal illegalReserve = new BigDecimal(dictionaryMap.get(APP_ORDER + "_" + DictionaryKey.ILLEGAL_RESERVE).getDetail()); BigDecimal illegalReserve = new BigDecimal(dictionaryMap.get(APP_ORDER + "_" + DictionaryKey.ILLEGAL_RESERVE).getDetail());
...@@ -268,19 +262,11 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> { ...@@ -268,19 +262,11 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
orderPageVo.setVehicalNumberPlat(restResponse.getData().getNumberPlate()); orderPageVo.setVehicalNumberPlat(restResponse.getData().getNumberPlate());
} }
} else if (orderPageVo.getOrderTourDetail() != null) { } else if (orderPageVo.getOrderTourDetail() != null) {
List<Integer> ids = Lists.newArrayList(); if(StringUtils.isNotBlank(orderPageVo.getOrderTourDetail().getTourUserIds())) {
if (orderPageVo.getOrderTourDetail().getTourUserIds().contains(",")) { List<TourUser> list = tourFeign.getTourUsers(orderPageVo.getOrderTourDetail().getTourUserIds()).getData();
String[] strings = orderPageVo.getOrderTourDetail().getTourUserIds().split(",");
for (int i = 0; i < strings.length; i++) {
ids.add(Integer.parseInt(StringUtils.isNotBlank(strings[i]) ? strings[i] : "0"));
}
} else {
ids.add(Integer.parseInt(orderPageVo.getOrderTourDetail().getTourUserIds()));
}
List<AppUserVo> list = userFeign.getByUserIds(ids).getData();
orderPageVo.getOrderTourDetail().setUserVoList(list == null || list.size() <= 0 ? new ArrayList<>() : list); orderPageVo.getOrderTourDetail().setUserVoList(list == null || list.size() <= 0 ? new ArrayList<>() : list);
} }
}
//设置保留金 //设置保留金
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData(); Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
BigDecimal illegalReserve = new BigDecimal(dictionaryMap.get(APP_ORDER + "_" + DictionaryKey.ILLEGAL_RESERVE).getDetail()); BigDecimal illegalReserve = new BigDecimal(dictionaryMap.get(APP_ORDER + "_" + DictionaryKey.ILLEGAL_RESERVE).getDetail());
......
...@@ -25,6 +25,8 @@ import com.xxfc.platform.order.entity.OrderRentVehicleDetail; ...@@ -25,6 +25,8 @@ import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.pojo.OrderAccompanyDTO; import com.xxfc.platform.order.pojo.OrderAccompanyDTO;
import com.xxfc.platform.order.pojo.order.*; import com.xxfc.platform.order.pojo.order.*;
import com.xxfc.platform.order.service.OrderRentVehicleService; import com.xxfc.platform.order.service.OrderRentVehicleService;
import com.xxfc.platform.tour.entity.TourUser;
import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus; import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
...@@ -78,6 +80,9 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -78,6 +80,9 @@ public class BackStageOrderController extends CommonBaseController implements Us
@Autowired @Autowired
UserFeign userFeign; UserFeign userFeign;
@Autowired
TourFeign tourFeign;
@Resource @Resource
VehicleFeign vehicleFeign; VehicleFeign vehicleFeign;
...@@ -180,10 +185,9 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -180,10 +185,9 @@ public class BackStageOrderController extends CommonBaseController implements Us
if (startResponse.getData() != null) { if (startResponse.getData() != null) {
orderPageVO.setStartCompanyName(startResponse.getData().getName()); orderPageVO.setStartCompanyName(startResponse.getData().getName());
} }
List<Integer> tourUserIds = Arrays.asList(orderPageVO.getOrderTourDetail().getTourUserIds().split(",")).parallelStream().map(s -> Integer.valueOf(s.trim())).collect(Collectors.toList()); if(StringUtils.isNotBlank(orderPageVO.getOrderTourDetail().getTourUserIds())) {
ObjectRestResponse<List<AppUserVo>> users = userFeign.getByUserIds(tourUserIds); List<TourUser> tourUsers = tourFeign.getTourUsers(orderPageVO.getOrderTourDetail().getTourUserIds()).getData();
if (users.getData() != null) { orderPageVO.getOrderTourDetail().setUserVoList(tourUsers == null || tourUsers.size() <= 0 ? new ArrayList<>() : tourUsers);
orderPageVO.getOrderTourDetail().setUserVoList(users.getData() == null? users.getData() : new ArrayList<>());
} }
} }
......
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