Commit 41fd4a7a authored by hezhen's avatar hezhen

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents 85f0800a 19982643
...@@ -22,11 +22,21 @@ public class ObjectRestResponse<T> extends BaseResponse { ...@@ -22,11 +22,21 @@ public class ObjectRestResponse<T> extends BaseResponse {
return this; return this;
} }
public ObjectRestResponse data(T data) { public ObjectRestResponse data(T data) {
this.setData(data); this.setData(data);
return this; return this;
} }
public ObjectRestResponse status(Integer status) {
this.setStatus(status);
return this;
}
public ObjectRestResponse msg(String msg) {
this.setMessage(msg);
return this;
}
public T getData() { public T getData() {
return data; return data;
} }
...@@ -35,5 +45,4 @@ public class ObjectRestResponse<T> extends BaseResponse { ...@@ -35,5 +45,4 @@ public class ObjectRestResponse<T> extends BaseResponse {
this.data = data; this.data = data;
} }
} }
...@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.common.context.BaseContextHandler; ...@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.common.context.BaseContextHandler;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.msg.TableResultResponse; import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.Query; import com.github.wxiaoqi.security.common.util.Query;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -24,6 +25,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro ...@@ -24,6 +25,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
@Autowired @Autowired
protected Biz baseBiz; protected Biz baseBiz;
@ApiOperation("添加")
@RequestMapping(value = "",method = RequestMethod.POST) @RequestMapping(value = "",method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ObjectRestResponse<Entity> add(@RequestBody Entity entity){ public ObjectRestResponse<Entity> add(@RequestBody Entity entity){
...@@ -31,6 +33,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro ...@@ -31,6 +33,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
return new ObjectRestResponse<Entity>(); return new ObjectRestResponse<Entity>();
} }
@ApiOperation("查询")
@RequestMapping(value = "/{id}",method = RequestMethod.GET) @RequestMapping(value = "/{id}",method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ObjectRestResponse<Entity> get(@PathVariable int id){ public ObjectRestResponse<Entity> get(@PathVariable int id){
...@@ -40,12 +43,15 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro ...@@ -40,12 +43,15 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
return entityObjectRestResponse; return entityObjectRestResponse;
} }
@ApiOperation("修改")
@RequestMapping(value = "/{id}",method = RequestMethod.PUT) @RequestMapping(value = "/{id}",method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ObjectRestResponse<Entity> update(@RequestBody Entity entity){ public ObjectRestResponse<Entity> update(@RequestBody Entity entity){
baseBiz.updateSelectiveById(entity); baseBiz.updateSelectiveById(entity);
return new ObjectRestResponse<Entity>(); return new ObjectRestResponse<Entity>();
} }
@ApiOperation("删除")
@RequestMapping(value = "/{id}",method = RequestMethod.DELETE) @RequestMapping(value = "/{id}",method = RequestMethod.DELETE)
@ResponseBody @ResponseBody
public ObjectRestResponse<Entity> remove(@PathVariable int id){ public ObjectRestResponse<Entity> remove(@PathVariable int id){
...@@ -53,12 +59,14 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro ...@@ -53,12 +59,14 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
return new ObjectRestResponse<Entity>(); return new ObjectRestResponse<Entity>();
} }
@ApiOperation("查询所有")
@RequestMapping(value = "/all",method = RequestMethod.GET) @RequestMapping(value = "/all",method = RequestMethod.GET)
@ResponseBody @ResponseBody
public List<Entity> all(){ public List<Entity> all(){
return baseBiz.selectListAll(); return baseBiz.selectListAll();
} }
@ApiOperation("查询分页")
@RequestMapping(value = "/page",method = RequestMethod.GET) @RequestMapping(value = "/page",method = RequestMethod.GET)
@ResponseBody @ResponseBody
public TableResultResponse<Entity> list(@RequestParam Map<String, Object> params){ public TableResultResponse<Entity> list(@RequestParam Map<String, Object> params){
......
...@@ -5,6 +5,7 @@ import java.math.BigDecimal; ...@@ -5,6 +5,7 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import javax.persistence.*; import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -31,111 +32,6 @@ public class VehicleModel implements Serializable { ...@@ -31,111 +32,6 @@ public class VehicleModel implements Serializable {
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
private String name; private String name;
//牌照
@Column(name = "license_plate")
@ApiModelProperty(value = "牌照")
private String licensePlate;
//厂家
@Column(name = "factory")
@ApiModelProperty(value = "厂家")
private Integer factory;
//车型
@Column(name = "category")
@ApiModelProperty(value = "车型")
private Integer category;
//长度mm
@Column(name = "length")
@ApiModelProperty(value = "长度mm")
private Integer length;
//宽度mm
@Column(name = "width")
@ApiModelProperty(value = "宽度mm")
private Integer width;
//高度mm
@Column(name = "high")
@ApiModelProperty(value = "高度mm")
private Integer high;
//乘坐人数
@Column(name = "seating")
@ApiModelProperty(value = "乘坐人数")
private Integer seating;
//离地空隙mm
@Column(name = "above_ground")
@ApiModelProperty(value = "离地空隙mm")
private Integer aboveGround;
//排量
@Column(name = "displacement")
@ApiModelProperty(value = "排量")
private Integer displacement;
//燃油类型
@Column(name = "fuel_type")
@ApiModelProperty(value = "燃油类型")
private Integer fuelType;
//功率
@Column(name = "power")
@ApiModelProperty(value = "功率")
private Integer power;
//最大扭矩
@Column(name = "max_torque")
@ApiModelProperty(value = "最大扭矩")
private Integer maxTorque;
//驱动形式
@Column(name = "drive_type")
@ApiModelProperty(value = "驱动形式")
private Integer driveType;
//变速箱
@Column(name = "gearbox")
@ApiModelProperty(value = "变速箱")
private Integer gearbox;
//油箱大小
@Column(name = "fuel_tank_size")
@ApiModelProperty(value = "油箱大小")
private Integer fuelTankSize;
//排放标准
@Column(name = "emission_standard")
@ApiModelProperty(value = "排放标准")
private Integer emissionStandard;
//最高车速
@Column(name = "max_speed")
@ApiModelProperty(value = "最高车速")
private Integer maxSpeed;
//清水箱大小
@Column(name = "water_tank_size")
@ApiModelProperty(value = "清水箱大小")
private Integer waterTankSize;
//灰水箱大小
@Column(name = "grey_water_tank_size")
@ApiModelProperty(value = "灰水箱大小")
private Integer greyWaterTankSize;
//黑水箱大小
@Column(name = "black_water_tank_size")
@ApiModelProperty(value = "黑水箱大小")
private Integer blackWaterTankSize;
//马 桶
@Column(name = "closestool")
@ApiModelProperty(value = "马 桶")
private Integer closestool;
//配置,code逗号分割 //配置,code逗号分割
@Column(name = "config") @Column(name = "config")
@ApiModelProperty(value = "配置,code逗号分割") @ApiModelProperty(value = "配置,code逗号分割")
...@@ -145,11 +41,16 @@ public class VehicleModel implements Serializable { ...@@ -145,11 +41,16 @@ public class VehicleModel implements Serializable {
@Column(name = "keyword") @Column(name = "keyword")
@ApiModelProperty(value = "关键字,code逗号分割") @ApiModelProperty(value = "关键字,code逗号分割")
private String keyword; private String keyword;
//评分 //房车展示
@Column(name = "point") @Column(name = "model_show")
@ApiModelProperty(value = "评分") @ApiModelProperty(value = "房车展示")
private Integer point; private String modelShow;
//参数
@Column(name = "model_param")
@ApiModelProperty(value = "参数")
private String modelParam;
//图片地址 多张为逗号分割 //图片地址 多张为逗号分割
@Column(name = "picture") @Column(name = "picture")
......
package com.xxfc.platform.vehicle.vo;
import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.entity.VehiclePlatCata;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class VModelDetailVO extends VehicleModel {
@ApiModelProperty("类型列表")
List<VehiclePlatCata> vehiclePlatCatas;
}
\ No newline at end of file
...@@ -24,4 +24,5 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper,VehicleModel> { ...@@ -24,4 +24,5 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper,VehicleModel> {
model.setScore(score); model.setScore(score);
updateSelectiveById(model); updateSelectiveById(model);
} }
} }
\ No newline at end of file
...@@ -7,23 +7,29 @@ import com.alibaba.fastjson.JSONObject; ...@@ -7,23 +7,29 @@ import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.RedisKey; import com.xxfc.platform.vehicle.constant.RedisKey;
import com.xxfc.platform.vehicle.entity.VehicleCata;
import com.xxfc.platform.vehicle.entity.VehiclePlatCata; import com.xxfc.platform.vehicle.entity.VehiclePlatCata;
import com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper; import com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper;
import com.xxfc.platform.vehicle.vo.CataVo; import com.xxfc.platform.vehicle.vo.CataVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePlatCata> { public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePlatCata> {
@Autowired
VehicleCataBiz vehicleCataBiz;
//更新 //更新
...@@ -89,13 +95,26 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl ...@@ -89,13 +95,26 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
return mapper.selectByExample(example); return mapper.selectByExample(example);
} }
/**
* 根据车型获取
* @param modelId
* @return
*/
public List<VehiclePlatCata> getByModelId(Integer modelId){
List<VehicleCata> vehicleCatas = vehicleCataBiz.selectByExample(new Example.Builder(VehicleCata.class)
.where(WeekendSqls.<VehicleCata>custom().andEqualTo(VehicleCata::getVehicleModelId, modelId)).build());
if(vehicleCatas.isEmpty()) {
return new ArrayList<VehiclePlatCata>();
}else {
List<VehiclePlatCata> VehiclePlatCatas = this.selectByExample(new Example.Builder(VehiclePlatCata.class)
.where(WeekendSqls.<VehiclePlatCata>custom().andIn(VehiclePlatCata::getId
, vehicleCatas.parallelStream().map(VehicleCata::getCataId).distinct()
.collect(Collectors.toList()))).build());
return VehiclePlatCatas;
}
}
// public List
} }
...@@ -14,6 +14,7 @@ import com.xxfc.platform.vehicle.feign.dto.UserDTO; ...@@ -14,6 +14,7 @@ import com.xxfc.platform.vehicle.feign.dto.UserDTO;
import com.xxfc.platform.vehicle.vo.BranchCompanyVo; import com.xxfc.platform.vehicle.vo.BranchCompanyVo;
import com.xxfc.platform.vehicle.vo.CompanySearchDTO; import com.xxfc.platform.vehicle.vo.CompanySearchDTO;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -28,6 +29,7 @@ import java.util.List; ...@@ -28,6 +29,7 @@ import java.util.List;
@Slf4j @Slf4j
@IgnoreClientToken @IgnoreClientToken
@IgnoreUserToken @IgnoreUserToken
@Api(value="公司controller",tags={"公司操作接口"})
public class BranchCompanyController extends BaseController<BranchCompanyBiz> { public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
private static Integer MAX_DRIVING_LICENSE_SIZE = 10*1024*1024;//10M private static Integer MAX_DRIVING_LICENSE_SIZE = 10*1024*1024;//10M
......
...@@ -7,6 +7,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken; ...@@ -7,6 +7,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig; import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.context.BaseContextHandler; import com.github.wxiaoqi.security.common.context.BaseContextHandler;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.BaseResponse; import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
...@@ -295,6 +296,8 @@ public class VehicleController extends BaseController<VehicleBiz> { ...@@ -295,6 +296,8 @@ public class VehicleController extends BaseController<VehicleBiz> {
PageDataVO<Vehicle> pageDataVO = vehicleBiz.searchUsableVehicle(dto); PageDataVO<Vehicle> pageDataVO = vehicleBiz.searchUsableVehicle(dto);
bookVehicleVo.setVehicle(pageDataVO.getData().get(0).getId()); bookVehicleVo.setVehicle(pageDataVO.getData().get(0).getId());
// new ObjectRestResponse<>().data();
return baseBiz.applyVehicle4Employee(operatorId, bookVehicleVo, userName); return baseBiz.applyVehicle4Employee(operatorId, bookVehicleVo, userName);
} }
} }
package com.xxfc.platform.vehicle.rest; package com.xxfc.platform.vehicle.rest;
import cn.hutool.core.bean.BeanUtil;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.biz.VehicleModelBiz; import com.xxfc.platform.vehicle.biz.VehicleModelBiz;
import com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode; import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.VehicleCata;
import com.xxfc.platform.vehicle.entity.VehicleModel; import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.entity.VehiclePlatCata;
import com.xxfc.platform.vehicle.entity.VehicleUserLicense; import com.xxfc.platform.vehicle.entity.VehicleUserLicense;
import com.xxfc.platform.vehicle.feign.dto.AppUserDTO; import com.xxfc.platform.vehicle.feign.dto.AppUserDTO;
import com.xxfc.platform.vehicle.vo.VModelDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import java.util.List;
@Controller @Controller
@RequestMapping("vehicleModel") @RequestMapping("vehicleModel")
@Api(value="车型controller",tags={"车型操作接口"})
public class VehicleModelController extends BaseController<VehicleModelBiz,VehicleModel> { public class VehicleModelController extends BaseController<VehicleModelBiz,VehicleModel> {
@Autowired
VehiclePlatCataBiz vehiclePlatCataBiz;
//修改评分 //修改评分
@RequestMapping(value = "/app/addScore", method = RequestMethod.GET) @RequestMapping(value = "/app/addScore", method = RequestMethod.GET)
public RestResponse addScore( public RestResponse addScore(
...@@ -26,4 +45,19 @@ public class VehicleModelController extends BaseController<VehicleModelBiz,Vehic ...@@ -26,4 +45,19 @@ public class VehicleModelController extends BaseController<VehicleModelBiz,Vehic
return RestResponse.suc(); return RestResponse.suc();
} }
//订单
@ApiOperation("车型详情")
@RequestMapping(value = "/app/unauth/detail/{id}", method = RequestMethod.GET)
@ResponseBody
public ObjectRestResponse<VModelDetailVO> detail(@PathVariable("id") @ApiParam("车型id") Integer id){
//查询车型信息,车型类型关系
//,公司信息,系统信息(购车须知,预定须知)
VehicleModel vm = baseBiz.selectById(id);
if(null == vm)
throw new BaseException(ResultCode.NOTEXIST_CODE);
VModelDetailVO vModelDetailVO = BeanUtil.toBean(vm, VModelDetailVO.class);
vModelDetailVO.setVehiclePlatCatas(vehiclePlatCataBiz.getByModelId(vm.getId()));
return new ObjectRestResponse().data(vModelDetailVO);
}
} }
\ No newline at end of file
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