| package com.doumee.api; | 
|   | 
| import com.doumee.api.BaseController; | 
| import com.doumee.config.annotation.LoginNoRequired; | 
| 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.dao.business.model.Cars; | 
| import com.doumee.service.business.CarsService; | 
| import com.doumee.service.business.impl.hksync.HkSyncEmpowerServiceImpl; | 
| import com.doumee.service.business.impl.hksync.fhk.HkSyncVehicleFromHKServiceImpl; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiOperation; | 
| import org.apache.shiro.authz.annotation.RequiresPermissions; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.scheduling.annotation.Scheduled; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| import javax.servlet.http.HttpServletResponse; | 
| import java.util.ArrayList; | 
| import java.util.List; | 
|   | 
| /** | 
|  * @author 江蹄蹄 | 
|  * @date 2023/11/30 15:33 | 
|  */ | 
| @Api(tags = "人员设备授权定时器接口") | 
| @RestController | 
| @RequestMapping("/timer/empower") | 
| public class HkEmpowerTimerController extends BaseController { | 
|     @Autowired | 
|     private HkSyncEmpowerServiceImpl hkSyncEmpowerService; | 
|   | 
|   | 
|     public static Integer endId2 = 0; | 
|     @ApiOperation("开启定时查询人员设备授权结果") | 
|     @GetMapping("/syncEmpowerDetailData") | 
|     public ApiResponse syncEmpowerDetailData() { | 
|         if(endId2 ==null){ | 
|             endId2 =0; | 
|         } | 
|         endId2 =  hkSyncEmpowerService.syncEmpowerDetailData(endId2); | 
|         for (int i = 0; i < 9; i++) { | 
|             if(endId2!=null){ | 
|                 endId2 =  hkSyncEmpowerService.syncEmpowerDetailData(endId2); | 
|             } | 
|         } | 
|         return ApiResponse.success("开启定时查询人员设备授权结果成功"); | 
|     } | 
|     @ApiOperation("开启定时查询人员设备授权下载进度") | 
|     @GetMapping("/syncEmpowerResultData") | 
|     public ApiResponse syncEmpowerResultData() { | 
|         hkSyncEmpowerService.syncEmpowerResultData(0); | 
|         return ApiResponse.success("开启定时查询人员设备授权下载进度成功"); | 
|     } | 
|   | 
|     @ApiOperation("开启定时重新下发失败的授权数据") | 
|     @GetMapping("/syncEmpowerFailData") | 
|     public ApiResponse syncEmpowerFailData() { | 
|         hkSyncEmpowerService.syncEmpowerFailData(0); | 
|         return ApiResponse.success("开启定时重新下发失败的授权数据成功"); | 
|     } | 
|   | 
|     public static Integer endId = 0; | 
|     @Autowired | 
|     private HkSyncVehicleFromHKServiceImpl hkSyncVehicleFromHKService; | 
|     @ApiOperation("开启定时刷新人员设备授权") | 
|     @GetMapping("/syncEmpowerData") | 
|     public ApiResponse syncEmpowerData() { | 
|         if(endId ==null){ | 
|             endId =0; | 
|         } | 
|         endId = hkSyncEmpowerService.syncEmpowerData(endId); | 
|         for (int i = 0; i < 9; i++) { | 
|             if(endId!=null){ | 
|                 endId = hkSyncEmpowerService.syncEmpowerData(endId); | 
|             } | 
|         } | 
|         return ApiResponse.success("开启定时刷新人员设备授权成功"); | 
|     } | 
|   | 
| } |