| package com.doumee.api; | 
|   | 
| import com.doumee.service.business.third.model.ApiResponse; | 
| 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.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| /** | 
|  * @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("开启定时查询人员设备授权结果") | 
|     @PostMapping("/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("开启定时查询人员设备授权下载进度") | 
|     @PostMapping("/syncEmpowerResultData") | 
|     public ApiResponse syncEmpowerResultData() { | 
|         hkSyncEmpowerService.syncEmpowerResultData(0); | 
|         return ApiResponse.success("开启定时查询人员设备授权下载进度成功"); | 
|     } | 
|   | 
|     @ApiOperation("开启定时重新下发失败的授权数据") | 
|     @PostMapping("/syncEmpowerFailData") | 
|     public ApiResponse syncEmpowerFailData() { | 
|         hkSyncEmpowerService.syncEmpowerFailData(0); | 
|         return ApiResponse.success("开启定时重新下发失败的授权数据成功"); | 
|     } | 
|   | 
|     public static Integer endId = 0; | 
|     @Autowired | 
|     private HkSyncVehicleFromHKServiceImpl hkSyncVehicleFromHKService; | 
|     @ApiOperation("开启定时刷新人员设备授权") | 
|     @PostMapping("/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("开启定时刷新人员设备授权成功"); | 
|     } | 
|   | 
| } |