Commit 8c7993f4 authored by 周健威's avatar 周健威

添加特惠租车

parent df8ba7f9
...@@ -239,4 +239,8 @@ public class SpecialRent implements Serializable { ...@@ -239,4 +239,8 @@ public class SpecialRent implements Serializable {
@Column(name = "category_name") @Column(name = "category_name")
@ApiModelProperty("型号名称") @ApiModelProperty("型号名称")
private String categoryName; private String categoryName;
@Column(name = "is_del")
private Integer isDel;
} }
...@@ -138,6 +138,8 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> { ...@@ -138,6 +138,8 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
} }
specialRent.setPublishUserId(userDTO.getId()); specialRent.setPublishUserId(userDTO.getId());
specialRent.setCrtUser(userDTO.getId().toString());
specialRent.setUpdUser(userDTO.getId().toString());
specialRent.setStatus(STATUS_CRT); specialRent.setStatus(STATUS_CRT);
RentVehicleBO detail = new RentVehicleBO(); RentVehicleBO detail = new RentVehicleBO();
......
...@@ -29,6 +29,8 @@ import lombok.Data; ...@@ -29,6 +29,8 @@ import lombok.Data;
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.*;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.order.entity.SpecialRent.STATUS_CRT; import static com.xxfc.platform.order.entity.SpecialRent.STATUS_CRT;
@RestController @RestController
...@@ -95,6 +97,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia ...@@ -95,6 +97,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
baseBiz.updateSelectiveById(new SpecialRent(){{ baseBiz.updateSelectiveById(new SpecialRent(){{
setId(specialRentDB.getId()); setId(specialRentDB.getId());
setStatus(SpecialRent.STATUS_CNL); setStatus(SpecialRent.STATUS_CNL);
setUpdUser(userDTO.getId().toString());
}}); }});
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
...@@ -109,7 +112,6 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia ...@@ -109,7 +112,6 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
if (StrUtil.isBlank(getCurrentUserId())) { if (StrUtil.isBlank(getCurrentUserId())) {
throw new BaseException(ResultCode.AJAX_WECHAT_NOTEXIST_CODE); throw new BaseException(ResultCode.AJAX_WECHAT_NOTEXIST_CODE);
} }
dto.setUserId(getCurrentUserIdInt());
Query query = new Query(dto); Query query = new Query(dto);
PageDataVO<SpecialRentVO> pages = PageDataVO.pageInfo(query, () -> baseBiz.selectByWeekend(w -> { PageDataVO<SpecialRentVO> pages = PageDataVO.pageInfo(query, () -> baseBiz.selectByWeekend(w -> {
w.andEqualTo(SpecialRent::getStatus, STATUS_CRT); w.andEqualTo(SpecialRent::getStatus, STATUS_CRT);
...@@ -119,7 +121,26 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia ...@@ -119,7 +121,26 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
return ObjectRestResponse.succ(pages); return ObjectRestResponse.succ(pages);
} }
@RequestMapping(value = "/appBusiness/specialOrder", method = RequestMethod.POST) @RequestMapping(value = "/appBusiness/myList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "分页查询我发布的特惠租车")
public ObjectRestResponse<SpecialRentVO> myList(QueryDTO dto) {
//查询列表数据
if (StrUtil.isBlank(getCurrentUserId())) {
throw new BaseException(ResultCode.AJAX_WECHAT_NOTEXIST_CODE);
}
UserDTO userDTO = getBusinessUserByAppUser();
Query query = new Query(dto);
PageDataVO<SpecialRentVO> pages = PageDataVO.pageInfo(query, () -> baseBiz.selectByWeekend(w -> {
w.andEqualTo(SpecialRent::getIsDel, SYS_FALSE);
w.andEqualTo(SpecialRent::getPublishUserId, userDTO.getId());
return w;
}, " crt_time desc "), SpecialRentVO.class);
return ObjectRestResponse.succ(pages);
}
@RequestMapping(value = "/app/specialOrder", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "特惠租车下单") @ApiOperation(value = "特惠租车下单")
public ObjectRestResponse specialOrder(@RequestBody SpecialOrderDTO dto) { public ObjectRestResponse specialOrder(@RequestBody SpecialOrderDTO dto) {
......
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