| | |
| | | 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.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | 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.dao.business.model.Cars; |
| | | import com.doumee.service.business.CarsService; |
| | | import com.doumee.service.business.ParkBookService; |
| | | import com.doumee.service.business.impl.hksync.fhk.HkSyncVehicleFromHKServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private CarsService carsService; |
| | | @Autowired |
| | | private ParkBookService parkBookService; |
| | | @Autowired |
| | | private HkSyncVehicleFromHKServiceImpl hkSyncVehicleFromHKService; |
| | | |
| | |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(carsService.findById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆信息导入" ,notes = "车辆信息导入") |
| | | @PostMapping("/importExcel") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), |
| | | }) |
| | | @CloudRequiredPermission("business:cars:create") |
| | | public ApiResponse<String> importExcel (@ApiParam(value = "file") MultipartFile file, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | List<Cars> carsList = carsService.importBatch(file,this.getLoginUser(token)); |
| | | //异步更新车辆授权数据 |
| | | carsService.dealCarsAuthBiz(carsList); |
| | | return ApiResponse.success("导入成功"); |
| | | } |
| | | } |