Commit 65362f81 authored by hanfeng's avatar hanfeng

Merge remote-tracking branch 'origin/dev' into dev

parents ad97f753 b6172a51
......@@ -149,10 +149,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
}
if (StringUtils.isNotBlank(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds())) {
try {
QueryMultiDTO queryMultiDTO = new QueryMultiDTO();
queryMultiDTO.setIds(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds());
List<VehicleUserLicense> orderUserLicenses = vehicleFeign.multi(queryMultiDTO).getData();
List<VehicleUserLicense> orderUserLicenses = vehicleFeign.getVehicleLicenseList(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds()).getData();
if (orderUserLicenses != null && orderUserLicenses.size() > 0) {
OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto();
orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getIdCard());
......@@ -163,6 +160,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
}
} catch (Exception e) {
log.info("获取驾驶人信息失败!");
e.printStackTrace();
}
}
......
......@@ -119,7 +119,7 @@ public interface TourFeign {
ObjectRestResponse getOne(@PathVariable Integer id);
//首页旅游列表
@GetMapping(value = "/gw/app/shopList")
@GetMapping(value = "/gw/shopList")
List<GoodDataVO> goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit);
......
......@@ -47,9 +47,11 @@ public class VehicleModelController extends CommonBaseController {
@RequestMapping(value = "/detail/{name}", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<VModelDetailVO> detail(@PathVariable("name") @ApiParam("车型名称") String name) {
return vehicleFeign.detailByParam(BeanUtil.beanToMap(new VehicleModel(){{
ObjectRestResponse<VModelDetailVO> objectRestResponse = vehicleFeign.detailByParam(BeanUtil.beanToMap(new VehicleModel(){{
setName(name);
}}, false, true));
objectRestResponse.getData().setUccnCataList(initUccnCataCollect(objectRestResponse.getData().getConfig()));
return objectRestResponse;
}
/**
......@@ -65,21 +67,26 @@ public class VehicleModelController extends CommonBaseController {
ObjectRestResponse<PageDataVO<VehicleModelVo>> objectRestResponse = vehicleFeign.findVehicleModelPageUnauthfind(vmqc);
PageDataVO<VehicleModelVo> pageDataVOs = objectRestResponse.getData();
pageDataVOs.getData().forEach( v -> {
List<VehiclePlatCata> vehiclePlatCataList = vehicleFeign.getCatasByIds(v.getConfig()).getData();
StrUtil.splitToInt("14,7,11", ",");
v.setUccnCataList(vehiclePlatCataList.parallelStream().filter(v1 -> {return ArrayUtil.contains(StrUtil.splitToInt("14,7,11", ","), v1.getParentId());}).sorted(Comparator.comparing(VehiclePlatCata::getParentId, (x, y) -> {
int xx = 0,yy = 0;
int[] array = StrUtil.splitToInt("14,7,11", ",");
for(int i = 0; i < array.length; i++) {
if(x == array[i]) {
xx = i;
}else if(y == array[i]) {
yy = i;
}
}
return (xx - yy);
})).collect(Collectors.toList()));
v.setUccnCataList(initUccnCataCollect(v.getConfig()));
});
return objectRestResponse;
}
private List<VehiclePlatCata> initUccnCataCollect(String modelConfig) {
List<VehiclePlatCata> vehiclePlatCataList = vehicleFeign.getCatasByIds(modelConfig).getData();
int[] array = StrUtil.splitToInt("14,7,11", ",");
return vehiclePlatCataList.parallelStream()
.filter(v1 -> {return ArrayUtil.contains(array, v1.getParentId());})
.sorted(Comparator.comparing(VehiclePlatCata::getParentId, (x, y) -> {
int xx = 0,yy = 0;
for(int i = 0; i < array.length; i++) {
if(x == array[i]) {
xx = i;
}else if(y == array[i]) {
yy = i;
}
}
return (xx - yy);
})).collect(Collectors.toList());
}
}
......@@ -83,8 +83,12 @@ public interface VehicleFeign {
@RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET)
public RestResponse<VehicleUserLicense> getOne(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception ;
@RequestMapping(value = "/user/license/multi", method = RequestMethod.GET)
public ObjectRestResponse<List<VehicleUserLicense>> multi(QueryMultiDTO dto) throws Exception;
public ObjectRestResponse<List<VehicleUserLicense>> multi(@RequestBody QueryMultiDTO dto) throws Exception;
@GetMapping("/user/license/getVehicleLicenseList")
public ObjectRestResponse<List<VehicleUserLicense>> getVehicleLicenseList(@RequestParam(value="ids") String ids);
/**
* 获取优质车型接口
......
......@@ -19,4 +19,9 @@ public class VModelDetailVO extends VehicleModel {
@ApiModelProperty("会员列表")
List<BaseUserMemberLevel> userMemberLevel;
/**
* 官网需要显示的配置列表
*/
List<VehiclePlatCata> UccnCataList;
}
\ No newline at end of file
......@@ -48,6 +48,9 @@ public class VehicleModelVo extends VehicleModel implements Serializable {
@ApiModelProperty(value = "品牌")
private String brandName;
/**
* 官网需要显示的配置列表
*/
List<VehiclePlatCata> UccnCataList;
}
......@@ -445,7 +445,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
DateTime endDay = DateTime.parse(bookVehicleVo.getBookEndDate(), DATE_TIME_FORMATTER);
//转换日期范围为列表,并检查是否合法
fillDateList4DatePeriod(yearMonthAndDate, DateTime.parse(startDay.toString(DEFAULT_DATE_TIME_FORMATTER), DEFAULT_DATE_TIME_FORMATTER), DateTime.parse(endDay.toString(DEFAULT_DATE_TIME_FORMATTER), DEFAULT_DATE_TIME_FORMATTER));
if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月
if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月
throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH);
}
......
......@@ -15,10 +15,12 @@ import com.xxfc.platform.vehicle.pojo.VehicleUserLicenseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -70,12 +72,32 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
@RequestMapping(value = "/license/multi", method = RequestMethod.GET)
public ObjectRestResponse<List<VehicleUserLicense>> multi(QueryMultiDTO dto) throws Exception {
// BaseContextHandler.getUserID()
log.info("获取驾驶人信息:", dto.toString());
List<VehicleUserLicense> list = baseBiz.selectByExample(new Example.Builder(VehicleUserLicense.class)
.where(WeekendSqls.<VehicleUserLicense>custom()
.andIn(VehicleUserLicense::getId, Arrays.asList(dto.getIds().split(",")))).build());
return ObjectRestResponse.succ().data(list);
}
@GetMapping("/license/getVehicleLicenseList")
public ObjectRestResponse<List<VehicleUserLicense>> getVehicleLicenseList(String ids){
// BaseContextHandler.getUserID()
log.info("获取驾驶人信息:", ids);
List<VehicleUserLicense> list = new ArrayList<>();
if(StringUtils.isNotBlank(ids)) {
List<String> idList = Arrays.asList(ids.split(","));
for(String id : idList) {
VehicleUserLicense vehicleUserLicense = baseBiz.selectById(id);
if(vehicleUserLicense != null) {
list.add(vehicleUserLicense);
}
}
}
return ObjectRestResponse.succ().data(list);
}
@RequestMapping(value = "/license/del", method = RequestMethod.GET)
public RestResponse del(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception {
......
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