|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.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.business.vo.LargeScreenDataVO; | 
|---|
|  |  |  | import com.doumee.dao.web.reqeust.*; | 
|---|
|  |  |  | import com.doumee.dao.web.response.DriverHomeVO; | 
|---|
|  |  |  | import com.doumee.dao.web.response.LineUpVO; | 
|---|
|  |  |  | import com.doumee.dao.web.response.MemberVO; | 
|---|
|  |  |  | import com.doumee.dao.web.response.VisitRecordVO; | 
|---|
|  |  |  | import com.doumee.service.business.*; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by IntelliJ IDEA. | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private PlatformBooksService platformBooksService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private PlatformReasonService platformReasonService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private PlatformWmsJobService platformWmsJobService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @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().setDriverId(loginUserInfo.getMemberId()); | 
|---|
|  |  |  | 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)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("WMS运输单详情") | 
|---|
|  |  |  | @GetMapping("/wmsJobDetail") | 
|---|
|  |  |  | public ApiResponse<PlatformWmsJob> wmsJobDetail(@RequestParam Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(platformWmsJobService.findByDetailId(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @LoginNoRequired | 
|---|
|  |  |  | @ApiOperation("签到大屏数据") | 
|---|
|  |  |  | @GetMapping("/getLargeScreenData") | 
|---|
|  |  |  | public ApiResponse<LargeScreenDataVO> getLargeScreenData() { | 
|---|
|  |  |  | return ApiResponse.success(platformJobService.getLargeScreenData()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @LoginNoRequired | 
|---|
|  |  |  | @ApiOperation("月台任务测试定时方法") | 
|---|
|  |  |  | @GetMapping("/testTimer") | 
|---|
|  |  |  | public ApiResponse testTimer(Integer type) { | 
|---|
|  |  |  | if(Constants.equalsInteger(type ,1)){ | 
|---|
|  |  |  | platformJobService.timeOutWork(); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(type ,2)){ | 
|---|
|  |  |  | platformJobService.timeOutCallIn(); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(type ,3)){ | 
|---|
|  |  |  | platformJobService.timeOutReport(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|