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 ...@@ -149,10 +149,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
} }
if (StringUtils.isNotBlank(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds())) { if (StringUtils.isNotBlank(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds())) {
try { try {
QueryMultiDTO queryMultiDTO = new QueryMultiDTO(); List<VehicleUserLicense> orderUserLicenses = vehicleFeign.getVehicleLicenseList(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds()).getData();
queryMultiDTO.setIds(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds());
List<VehicleUserLicense> orderUserLicenses = vehicleFeign.multi(queryMultiDTO).getData();
if (orderUserLicenses != null && orderUserLicenses.size() > 0) { if (orderUserLicenses != null && orderUserLicenses.size() > 0) {
OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto(); OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto();
orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getIdCard()); orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getIdCard());
...@@ -163,6 +160,7 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -163,6 +160,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
} }
} catch (Exception e) { } catch (Exception e) {
log.info("获取驾驶人信息失败!"); log.info("获取驾驶人信息失败!");
e.printStackTrace();
} }
} }
......
...@@ -119,7 +119,7 @@ public interface TourFeign { ...@@ -119,7 +119,7 @@ public interface TourFeign {
ObjectRestResponse getOne(@PathVariable Integer id); ObjectRestResponse getOne(@PathVariable Integer id);
//首页旅游列表 //首页旅游列表
@GetMapping(value = "/gw/app/shopList") @GetMapping(value = "/gw/shopList")
List<GoodDataVO> goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page, List<GoodDataVO> goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit); @RequestParam(value = "limit",defaultValue = "4") Integer limit);
......
...@@ -47,9 +47,11 @@ public class VehicleModelController extends CommonBaseController { ...@@ -47,9 +47,11 @@ public class VehicleModelController extends CommonBaseController {
@RequestMapping(value = "/detail/{name}", method = RequestMethod.GET) @RequestMapping(value = "/detail/{name}", method = RequestMethod.GET)
@IgnoreUserToken @IgnoreUserToken
public ObjectRestResponse<VModelDetailVO> detail(@PathVariable("name") @ApiParam("车型名称") String name) { 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); setName(name);
}}, false, true)); }}, false, true));
objectRestResponse.getData().setUccnCataList(initUccnCataCollect(objectRestResponse.getData().getConfig()));
return objectRestResponse;
} }
/** /**
...@@ -65,11 +67,18 @@ public class VehicleModelController extends CommonBaseController { ...@@ -65,11 +67,18 @@ public class VehicleModelController extends CommonBaseController {
ObjectRestResponse<PageDataVO<VehicleModelVo>> objectRestResponse = vehicleFeign.findVehicleModelPageUnauthfind(vmqc); ObjectRestResponse<PageDataVO<VehicleModelVo>> objectRestResponse = vehicleFeign.findVehicleModelPageUnauthfind(vmqc);
PageDataVO<VehicleModelVo> pageDataVOs = objectRestResponse.getData(); PageDataVO<VehicleModelVo> pageDataVOs = objectRestResponse.getData();
pageDataVOs.getData().forEach( v -> { pageDataVOs.getData().forEach( v -> {
List<VehiclePlatCata> vehiclePlatCataList = vehicleFeign.getCatasByIds(v.getConfig()).getData(); v.setUccnCataList(initUccnCataCollect(v.getConfig()));
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) -> { return objectRestResponse;
int xx = 0,yy = 0; }
private List<VehiclePlatCata> initUccnCataCollect(String modelConfig) {
List<VehiclePlatCata> vehiclePlatCataList = vehicleFeign.getCatasByIds(modelConfig).getData();
int[] array = StrUtil.splitToInt("14,7,11", ","); 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++) { for(int i = 0; i < array.length; i++) {
if(x == array[i]) { if(x == array[i]) {
xx = i; xx = i;
...@@ -78,8 +87,6 @@ public class VehicleModelController extends CommonBaseController { ...@@ -78,8 +87,6 @@ public class VehicleModelController extends CommonBaseController {
} }
} }
return (xx - yy); return (xx - yy);
})).collect(Collectors.toList())); })).collect(Collectors.toList());
});
return objectRestResponse;
} }
} }
...@@ -83,8 +83,12 @@ public interface VehicleFeign { ...@@ -83,8 +83,12 @@ public interface VehicleFeign {
@RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET) @RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET)
public RestResponse<VehicleUserLicense> getOne( public RestResponse<VehicleUserLicense> getOne(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception ; @RequestParam(value="id",defaultValue="0")Integer id) throws Exception ;
@RequestMapping(value = "/user/license/multi", method = RequestMethod.GET) @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 { ...@@ -19,4 +19,9 @@ public class VModelDetailVO extends VehicleModel {
@ApiModelProperty("会员列表") @ApiModelProperty("会员列表")
List<BaseUserMemberLevel> userMemberLevel; List<BaseUserMemberLevel> userMemberLevel;
/**
* 官网需要显示的配置列表
*/
List<VehiclePlatCata> UccnCataList;
} }
\ No newline at end of file
...@@ -48,6 +48,9 @@ public class VehicleModelVo extends VehicleModel implements Serializable { ...@@ -48,6 +48,9 @@ public class VehicleModelVo extends VehicleModel implements Serializable {
@ApiModelProperty(value = "品牌") @ApiModelProperty(value = "品牌")
private String brandName; private String brandName;
/**
* 官网需要显示的配置列表
*/
List<VehiclePlatCata> UccnCataList; List<VehiclePlatCata> UccnCataList;
} }
...@@ -15,10 +15,12 @@ import com.xxfc.platform.vehicle.pojo.VehicleUserLicenseVo; ...@@ -15,10 +15,12 @@ import com.xxfc.platform.vehicle.pojo.VehicleUserLicenseVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls; import tk.mybatis.mapper.weekend.WeekendSqls;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -70,12 +72,32 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen ...@@ -70,12 +72,32 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
@RequestMapping(value = "/license/multi", method = RequestMethod.GET) @RequestMapping(value = "/license/multi", method = RequestMethod.GET)
public ObjectRestResponse<List<VehicleUserLicense>> multi(QueryMultiDTO dto) throws Exception { public ObjectRestResponse<List<VehicleUserLicense>> multi(QueryMultiDTO dto) throws Exception {
// BaseContextHandler.getUserID() // BaseContextHandler.getUserID()
log.info("获取驾驶人信息:", dto.toString());
List<VehicleUserLicense> list = baseBiz.selectByExample(new Example.Builder(VehicleUserLicense.class) List<VehicleUserLicense> list = baseBiz.selectByExample(new Example.Builder(VehicleUserLicense.class)
.where(WeekendSqls.<VehicleUserLicense>custom() .where(WeekendSqls.<VehicleUserLicense>custom()
.andIn(VehicleUserLicense::getId, Arrays.asList(dto.getIds().split(",")))).build()); .andIn(VehicleUserLicense::getId, Arrays.asList(dto.getIds().split(",")))).build());
return ObjectRestResponse.succ().data(list); 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) @RequestMapping(value = "/license/del", method = RequestMethod.GET)
public RestResponse del( public RestResponse del(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception { @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