Commit 4d214ba6 authored by 周健威's avatar 周健威

添加代码

parent f991582a
......@@ -67,9 +67,13 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
return w;
});
if(list.size() > 0) {
if(list.size() > 0 ) {
for(SpecialRent specialRent : list) {
if(specialRent.getStartCompanyId().equals(specialRent.getEndCompanyId())) {
return Boolean.TRUE;
}
}
}
return Boolean.FALSE;
}
......@@ -128,7 +132,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
specialRent.setEndCityCode(companyDetail.getAddrCity());
}
if(null != specialRent.getCategoryId()) {
VehicleCategory vehicleCategory = vehicleFeign.getVehicleCategory(specialRent.getEndCompanyId()).getData();
VehicleCategory vehicleCategory = vehicleFeign.getVehicleCategory(specialRent.getCategoryId()).getData();
specialRent.setBrandName(vehicleCategory.getBrandName());
specialRent.setCategoryName(vehicleCategory.getName());
}
......
......@@ -76,16 +76,35 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
return ObjectRestResponse.succ();
}
@RequestMapping(value = "/appBusiness/cnlRent", method = RequestMethod.POST)
@RequestMapping(value = "/appBusiness/cnlRent", method = RequestMethod.DELETE)
@ResponseBody
@ApiOperation(value = "取消发布特惠租车")
public ObjectRestResponse appBusinessCnlRent(@RequestBody SpecialRent specialRent) {
UserDTO userDTO = getBusinessUserByAppUser();
//查询
SpecialRent specialRentDB = baseBiz.selectById(specialRent.getId());
AssertUtils.isBlank(specialRentDB);
if(SpecialRent.STATUS_CRT != specialRentDB.getStatus()) {
throw new BaseException(ResultCode.AJAX_WECHAT_NOTEXIST_CODE);
}
//拒绝原来的预约
orderRentVehicleService.errorRejectVehicle(new RentVehicleBO(){{
setBookRecordId(specialRent.getBookRecordId());
setBookRecordId(specialRentDB.getBookRecordId());
}});
//设置车辆上架
ObjectRestResponse restResponse = vehicleFeign.updVehicleFeign(new Vehicle(){{
setId(specialRentDB.getVehicleId());
setState(STATE_UP);
}});
baseBiz.updateSelectiveById(new SpecialRent(){{
setId(specialRentDB.getId());
setStatus(SpecialRent.STATUS_CNL);
}});
return ObjectRestResponse.succ();
}
......
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