|  |  |  | 
|---|
|  |  |  | import com.doumee.config.annotation.CloudRequiredPermission; | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformBooks; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformReason; | 
|---|
|  |  |  | import com.doumee.dao.web.reqeust.PlatformBooksApplyDTO; | 
|---|
|  |  |  | import com.doumee.dao.web.reqeust.PlatformBooksCheckNumDTO; | 
|---|
|  |  |  | import com.doumee.dao.web.response.DriverHomeVO; | 
|---|
|  |  |  | import com.doumee.service.business.PlatformBooksService; | 
|---|
|  |  |  | import com.doumee.service.business.PlatformReasonService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID删除") | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformbooks:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id) { | 
|---|
|  |  |  | platformBooksService.deleteById(id); | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | platformBooksService.deleteById(id,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/apply") | 
|---|
|  |  |  | public ApiResponse<Integer> apply (@RequestBody PlatformBooksApplyDTO platformBooksApplyDTO , @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = getLoginUser(token); | 
|---|
|  |  |  | if(Objects.isNull(loginUserInfo.getMemberId())){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非内部人员无法进行该操作"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | platformBooksApplyDTO.setUserId(loginUserInfo.getMemberId()); | 
|---|
|  |  |  | platformBooksApplyDTO.setDriverId(loginUserInfo.getMemberId()); | 
|---|
|  |  |  | return ApiResponse.success(platformBooksService.apply(platformBooksApplyDTO)); | 
|---|