| | |
| | | package com.doumee.cloud.web; |
| | | |
| | | import cn.hutool.http.useragent.Platform; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.config.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.model.PlatformBooks; |
| | | import com.doumee.dao.business.model.PlatformJob; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.web.reqeust.*; |
| | | import com.doumee.dao.web.response.DriverHomeVO; |
| | | import com.doumee.dao.web.response.LineUpVO; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | @Autowired |
| | | private PlatformBooksService platformBooksService; |
| | | |
| | | @Autowired |
| | | private PlatformReasonService platformReasonService; |
| | | |
| | | |
| | | |
| | | @ApiOperation("入园原因") |
| | | @GetMapping("/platformReasonList") |
| | | public ApiResponse<List<PlatformReason>> platformReasonList (@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | List<PlatformReason> platformReasons = platformReasonService.findList(null); |
| | | return ApiResponse.success(platformReasons); |
| | | } |
| | | |
| | | @ApiOperation("司机首页信息") |
| | | @GetMapping("/driverHome") |
| | | public ApiResponse<DriverHomeVO> driverHome (@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | DriverHomeVO driverHomeVO = platformJobService.getDriverHome(getLoginUser(token).getMemberId()); |
| | | DriverHomeVO driverHomeVO = platformJobService.getDriverHome(getLoginUser(token)); |
| | | return ApiResponse.success(driverHomeVO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("查询可预约量") |
| | | @PostMapping("/checkSurplusNum") |
| | |
| | | @ApiOperation("物流车预约") |
| | | @PostMapping("/apply") |
| | | public ApiResponse<Integer> apply (@RequestBody PlatformBooksApplyDTO platformBooksApplyDTO , @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | platformBooksApplyDTO.setUserId(getLoginUser(token).getMemberId()); |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | platformBooksApplyDTO.setUserId(loginUserInfo.getMemberId()); |
| | | platformBooksApplyDTO.setDriverId(loginUserInfo.getMemberId()); |
| | | return ApiResponse.success(platformBooksService.apply(platformBooksApplyDTO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("物流车预约修改") |
| | | @PostMapping("/applyEdit") |
| | | public ApiResponse<Integer> applyEdit (@RequestBody PlatformBooksApplyDTO platformBooksApplyDTO , @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | platformBooksApplyDTO.setUserId(loginUserInfo.getMemberId()); |
| | | platformBooksApplyDTO.setDriverId(loginUserInfo.getMemberId()); |
| | | return ApiResponse.success(platformBooksService.edit(platformBooksApplyDTO)); |
| | | } |
| | | |
| | | @ApiOperation("物流车预约记录") |
| | | @PostMapping("/page") |
| | | public ApiResponse<PageData<PlatformBooks>> findPage (@RequestBody PageWrap<PlatformBooks> pageWrap, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = this.getLoginUser(token); |
| | | pageWrap.getModel().setQueryDate(DateUtil.getBeforDay(new Date(),30)); |
| | | pageWrap.getModel().setDriverPhone(loginUserInfo.getMobile()); |
| | | return ApiResponse.success(platformBooksService.findPage(pageWrap)); |
| | | } |
| | | |
| | |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | |
| | | /******************************************************司机任务接口************************************************************************/ |
| | | @ApiOperation("任务确认") |
| | | @PostMapping("/confirmTask") |
| | | public ApiResponse confirmTask (@RequestBody ConfirmTaskDTO confirmTaskDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | confirmTaskDTO.setLoginUserInfo(getLoginUser(token)); |
| | | platformJobService.confirmTask(confirmTaskDTO); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | @ApiOperation("任务签到") |
| | | @PostMapping("/signIn") |
| | |
| | | return ApiResponse.success(platformJobService.getDetail(jobDetailDTO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("查询排队情况") |
| | | @PostMapping("/jobDetail") |
| | | @PostMapping("/lineUpDetail") |
| | | public ApiResponse<LineUpVO> lineUpDetail (@RequestBody LineUpDetailDTO lineUpDetailDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(platformJobService.lineUpDetail(lineUpDetailDTO)); |
| | | } |
| | | |
| | | |
| | | } |