Commit 480e7435 authored by libin's avatar libin

会员等级

parent 6d78d0f3
......@@ -7,6 +7,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo;
import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo;
import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO;
......@@ -14,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -21,7 +23,7 @@ import java.util.Set;
/**
* Created by ace on 2017/9/15.
*/
@FeignClient(name = "vehicle",contextId = "vh")
@FeignClient(name = "vehicle", contextId = "vh")
public interface VehicleFeign {
@GetMapping(value = "/vehicleModel/{id}")
public ObjectRestResponse<VehicleModel> get(@PathVariable(value = "id") int id);
......@@ -30,10 +32,10 @@ public interface VehicleFeign {
public ObjectRestResponse<Vehicle> get(@PathVariable(value = "id") String id);
@RequestMapping(value = "/vehicleInfo/findById", method = RequestMethod.GET)
public RestResponse<Vehicle> findById(@RequestParam(value = "id")String id);
public RestResponse<Vehicle> findById(@RequestParam(value = "id") String id);
@RequestMapping(value = "/vehicleInfo/getByIds", method = RequestMethod.GET)
public RestResponse< List<Vehicle>> getByIds(@RequestParam(value = "ids") List<String> id);
public RestResponse<List<Vehicle>> getByIds(@RequestParam(value = "ids") List<String> id);
//提车
@PostMapping("/active/small/departure")
......@@ -44,16 +46,16 @@ public interface VehicleFeign {
public RestResponse arrivalBySmall(@RequestBody VehicleArrivalVo arrivalVo);
@GetMapping(value = "/vehicleModel/app/unauth/findRandomVehicle")
public ObjectRestResponse findRandomVehicle(@RequestParam(value="number")Integer number);
public ObjectRestResponse findRandomVehicle(@RequestParam(value = "number") Integer number);
//修改评分
@RequestMapping(value = "/vehicleModel/app/addScore", method = RequestMethod.GET)
public RestResponse addScore(@RequestParam(value="id")Integer id, @RequestParam(value="score")Integer score);
public RestResponse addScore(@RequestParam(value = "id") Integer id, @RequestParam(value = "score") Integer score);
@RequestMapping(value = "/vehicleInfo/rent/book/vehicle", method = RequestMethod.POST)
public ObjectRestResponse<VehicleBookRecord> rentApplyVehicle(@RequestBody RentVehicleBookDTO rentVehicleBookDTO);
@RequestMapping(value ="/branchCompany/app/unauth/detail/{id}",method = RequestMethod.GET)
@RequestMapping(value = "/branchCompany/app/unauth/detail/{id}", method = RequestMethod.GET)
public ObjectRestResponse<CompanyDetail> getCompanyDetail(@PathVariable(value = "id") Integer id);
//租车拒绝预约
......@@ -71,28 +73,29 @@ public interface VehicleFeign {
//获取分公司列表
@GetMapping("/branchCompany/all")
public List<BranchCompany> companyAll(
@RequestParam(value = "dataAll")Integer dataAll,
@RequestParam(value = "dataCompany")String dataCompany,
@RequestParam(value = "dataZone")String dataZone);
@RequestParam(value = "dataAll") Integer dataAll,
@RequestParam(value = "dataCompany") String dataCompany,
@RequestParam(value = "dataZone") String dataZone);
@GetMapping("/branchCompany/entityList")
public ObjectRestResponse<List<BranchCompany>> branchCompanyEntityList(@RequestParam("entity") Map<String, Object> entity);
@RequestMapping(value = "/user/license/one", method = RequestMethod.GET)
public RestResponse<VehicleUserLicense> one(@RequestParam(value="id",defaultValue="0")Integer id) throws Exception;
public RestResponse<VehicleUserLicense> one(@RequestParam(value = "id", defaultValue = "0") Integer id) throws Exception;
@RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET)
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)
public ObjectRestResponse<List<VehicleUserLicense>> multi(@RequestBody QueryMultiDTO dto) throws Exception;
@GetMapping("/user/license/getVehicleLicenseList")
public ObjectRestResponse<List<VehicleUserLicense>> getVehicleLicenseList(@RequestParam(value="ids") String ids);
public ObjectRestResponse<List<VehicleUserLicense>> getVehicleLicenseList(@RequestParam(value = "ids") String ids);
/**
* 获取优质车型接口
*
* @param page
* @param limit
* @return 返回
......@@ -102,13 +105,16 @@ public interface VehicleFeign {
/**
* 根据一个id获取城市
*
* @param id
* @return
*/
@GetMapping("/sysRegion/getSysRegionById/{id}")
RestResponse getSysRegionById(@PathVariable(value = "id") Integer id);
/**
* 多个城市code获取城市代码
*
* @param idSet
* @return
*/
......@@ -117,12 +123,13 @@ public interface VehicleFeign {
/**
* 获取公司所在的城市
*
* @param zoneList
* @param companyList
* @return
*/
@GetMapping("/city/corporationCity")
ObjectRestResponse<Set<Integer>> corporationCity( @RequestParam(value = "zoneList") String zoneList,
ObjectRestResponse<Set<Integer>> corporationCity(@RequestParam(value = "zoneList") String zoneList,
@RequestParam(value = "companyList") String companyList);
......@@ -143,8 +150,10 @@ public interface VehicleFeign {
//cata
/**
* 查询当前车型拥有的标签
*
* @param ids
* @return
*/
......@@ -156,6 +165,7 @@ public interface VehicleFeign {
/**
* 根据位置查询
*
* @param branchCompanyFindDTO
* @return
*/
......@@ -163,9 +173,23 @@ public interface VehicleFeign {
PageDataVO<BranchCompanyListVO> findBranchCompanyWithPage(@RequestBody BranchCompanyFindDTO branchCompanyFindDTO);
@GetMapping("/vehicleInfo/findVehicleIds")
List<String> findbyPlateNumberAndVehicleCod(@RequestParam(value = "plateNumber") String plateNumber,@RequestParam(value = "vehicleCode") String vehicleCode);
List<String> findbyPlateNumberAndVehicleCod(@RequestParam(value = "plateNumber") String plateNumber, @RequestParam(value = "vehicleCode") String vehicleCode);
@RequestMapping(value = "/vehicleInfo/bookRecord/update", method = RequestMethod.POST)
public ObjectRestResponse update(@RequestBody BookRecordUpdateLog bookRecordUpdateLog);
/**
* 车型日历价格
* @param startDate
* @param endDate
* @param vehicleModelId
* @param userId
* @return
*/
@GetMapping("/vehicle_model/calendar_price/app/unauth/price")
List<VehicleModelCalendarPriceDTO> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Date startDate,
@RequestParam(value = "endDate") Date endDate,
@RequestParam(value = "vehicleModelId") Integer vehicleModelId,
@RequestParam(value = "userId") Integer userId);
}
......@@ -227,7 +227,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
* @param vehicleModelId
* @return
*/
public List<VehicleModelCalendarPriceDTO> findVehicleModelCalendarPrice(Date startDate, Date endDate, Integer vehicleModelId, Integer userId) {
private List<VehicleModelCalendarPriceDTO> findVehicleModelCalendarPrice(Date startDate, Date endDate, Integer vehicleModelId, Integer userId) {
List<VehicleModelCalendarPriceDTO> vehicleModelCalendarPriceVos = new ArrayList<>();
//默认折扣
Integer discount = DEFAULT_DISCOUNT;
......
......@@ -32,7 +32,7 @@ import java.util.List;
@RequestMapping("/vehicle_model/calendar_price/app/unauth")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(tags = "车型日历价格")
public class VehicleModelCalendarPriceController{
public class VehicleModelCalendarPriceController {
private final VehicleModelCalendarPriceBiz vehicleModelCalendarPriceBiz;
......@@ -41,16 +41,26 @@ public class VehicleModelCalendarPriceController{
@GetMapping("/list/{vehicleModelId}")
@IgnoreUserToken
@SneakyThrows
public ObjectRestResponse<VehicleModelCalendarPriceDTO> listVehicleModelCalendarPriceByDateAndVehicleModelId(@RequestParam(value = "start",required = false) String start,
@RequestParam(value = "end",required = false) String end,
public ObjectRestResponse<VehicleModelCalendarPriceDTO> listVehicleModelCalendarPriceByDateAndVehicleModelId(@RequestParam(value = "start", required = false) String start,
@RequestParam(value = "end", required = false) String end,
@PathVariable(value = "vehicleModelId") Integer vehicleModelId,
AppUserDTO appUserDTO){
if (StringUtils.isEmpty(start) || StringUtils.isEmpty(end)){
AppUserDTO appUserDTO) {
if (StringUtils.isEmpty(start) || StringUtils.isEmpty(end)) {
throw new BaseException("缺少开始时间或结束时间");
}
Date startDate= Date.from(LocalDate.parse(start).atStartOfDay(ZoneId.systemDefault()).toInstant());
Date endDate= Date.from(LocalDate.parse(end).atStartOfDay(ZoneId.systemDefault()).toInstant());
List<VehicleModelCalendarPriceDTO> vehicleModelCalendarPriceVos = vehicleModelCalendarPriceBiz.listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId(startDate,endDate,vehicleModelId,appUserDTO.getUserid());
Date startDate = Date.from(LocalDate.parse(start).atStartOfDay(ZoneId.systemDefault()).toInstant());
Date endDate = Date.from(LocalDate.parse(end).atStartOfDay(ZoneId.systemDefault()).toInstant());
List<VehicleModelCalendarPriceDTO> vehicleModelCalendarPriceVos = vehicleModelCalendarPriceBiz.listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId(startDate, endDate, vehicleModelId, appUserDTO.getUserid());
return ObjectRestResponse.succ(vehicleModelCalendarPriceVos);
}
@GetMapping("/price")
public List<VehicleModelCalendarPriceDTO> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Date startDate,
@RequestParam(value = "endDate") Date endDate,
@RequestParam(value = "vehicleModelId") Integer vehicleModelId,
@RequestParam(value = "userId") Integer userId) {
startDate = Date.from(startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
endDate = Date.from(endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
return vehicleModelCalendarPriceBiz.findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId(startDate, endDate, vehicleModelId, userId);
}
}
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