Commit aa4c25f8 by testdl

# 用户下单功能

parent 2f573997
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import com.jumeirah.api.app.entity.bo.PlainTypeBo;
import com.jumeirah.common.entity.PlainType; import com.jumeirah.common.entity.PlainType;
import com.jumeirah.common.service.PlainTypeService; import com.jumeirah.common.service.PlainTypeService;
import com.jumeirah.common.vo.PlainTypeQueryVo; import com.jumeirah.common.vo.PlainTypeQueryVo;
...@@ -12,6 +13,7 @@ import io.geekidea.springbootplus.framework.log.enums.OperationLogType; ...@@ -12,6 +13,7 @@ import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
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.collections.list.PredicatedList;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -51,13 +53,21 @@ public class PlainTypeController extends BaseController { ...@@ -51,13 +53,21 @@ public class PlainTypeController extends BaseController {
@GetMapping("/getAllMap") @GetMapping("/getAllMap")
@OperationLog(name = "分组获取飞机型号列表", type = OperationLogType.PAGE) @OperationLog(name = "分组获取飞机型号列表", type = OperationLogType.PAGE)
@ApiOperation(value = "分组获取飞机型号列表", response = PlainTypeQueryVo.class) @ApiOperation(value = "分组获取飞机型号列表", response = PlainTypeQueryVo.class)
public ApiResult<Map<String, List<PlainType>>> getAllMap() throws Exception { public ApiResult<List<PlainTypeBo>> getAllMap() throws Exception {
List<PlainType> plainTypeList = plainTypeService.getAllMap(); List<PlainType> plainTypeList = plainTypeService.getAllMap();
Map<String, List<PlainType>> resultList = new LinkedHashMap<>(); Map<Integer, List<PlainType>> resultMap;
List<PlainTypeBo> plainTypeBoList = new ArrayList<>();
if (!CollectionUtils.isEmpty(plainTypeList)) { if (!CollectionUtils.isEmpty(plainTypeList)) {
resultList = plainTypeList.stream().collect(Collectors.groupingBy(PlainType::getSeriesName)); resultMap = plainTypeList.stream().collect(Collectors.groupingBy(PlainType::getSeriesType));
PlainTypeBo plainTypeBo;
for (List<PlainType> listTemp: resultMap.values()) {
plainTypeBo = new PlainTypeBo();
plainTypeBo.setTitle(listTemp.get(0).getSeriesName())
.setPlainTypeList(listTemp);
plainTypeBoList.add(plainTypeBo);
}
} }
return ApiResult.ok(resultList); return ApiResult.ok(plainTypeBoList);
} }
} }
......
package com.jumeirah.api.app.entity.bo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.jumeirah.common.entity.PlainType;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 飞机型号表
*
* @author wei
* @since 2020-10-09
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "分组获取飞机类型对象")
public class PlainTypeBo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("系列名称")
private String title;
@ApiModelProperty("系列名称")
private List<PlainType> plainTypeList;
}
...@@ -44,8 +44,8 @@ public class StrokeAddBackAndForthVo extends BaseEntity { ...@@ -44,8 +44,8 @@ public class StrokeAddBackAndForthVo extends BaseEntity {
private Integer peopleMun; private Integer peopleMun;
@NotNull(message = "飞机型号ID不能为空") @NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID,多个中间用逗号隔开") @ApiModelProperty("飞机型号ID")
private String plainTypeIds; private Long plainTypeId;
@NotNull(message = "出发时间不能为空") @NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
......
...@@ -48,8 +48,8 @@ public class StrokeAddOneWayVo extends BaseEntity { ...@@ -48,8 +48,8 @@ public class StrokeAddOneWayVo extends BaseEntity {
private Integer peopleMun; private Integer peopleMun;
@NotNull(message = "飞机型号ID不能为空") @NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID,多个中间用逗号隔开") @ApiModelProperty("飞机型号ID")
private String plainTypeIds; private Long plainTypeId;
@NotNull(message = "出发时间不能为空") @NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
......
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