Commit e3cc0618 authored by jiaorz's avatar jiaorz

取消预定和出车的bug

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