Commit 480e7435 authored by libin's avatar libin

会员等级

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