| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.haikang.model.param.request.*; |
| | | import com.doumee.core.haikang.model.param.request.event.acs.EventAcsRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventParkRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventPlatformCarsRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventPlatformRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitIccmRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DESUtil; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.service.business.impl.hksync.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | private HkSyncPushServiceImpl hkSyncPushService; |
| | | @Autowired |
| | | private HkSyncLoginAuthServiceImpl hkSyncLoginAuthService; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String,Object> redisTemplate; |
| | | |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】全量同步月台信息接口") |
| | | @PostMapping("/syncPlatforms") |
| | |
| | | String result = hkSyncPushService.dealParkEvent(param,response); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @ApiOperation("【海康】月台工作状态事件订阅推送对接处理接口") |
| | | @PostMapping("/push/platform/workstatus") |
| | | @LoginNoRequired |
| | | public ApiResponse pushPlatformStatus(@RequestBody EventPlatformRequest param, HttpServletResponse response ){ |
| | | String result = hkSyncPushService.dealPlatformStatusEvent(param,response); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @ApiOperation("【海康】月台车辆状态事件订阅推送对接处理接口") |
| | | @PostMapping("/push/platform/carstatus") |
| | | @LoginNoRequired |
| | | public ApiResponse pushPlatformCarStatus(@RequestBody EventPlatformCarsRequest param, HttpServletResponse response ){ |
| | | String result = hkSyncPushService.dealPlatformCarsEvent(param,response); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】取消订阅事件") |
| | | @PostMapping("/cancelEventSub") |
| | |
| | | hkSyncPushService.cancelEventSub(); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | /** |
| | | * 访客来访配置 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取安防平台系统免密菜单调整地址" ) |
| | | @GetMapping("/getHkMenuLink") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "type",example = "0",value = "菜单类型", required = true), |
| | | }) |
| | | public ApiResponse<String> getHkMenuLink(Integer type,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | LoginUserInfo loginUserInfo = this.getLoginUser(token); |
| | | String hkToken = DESUtil.generateTokenToHk(loginUserInfo.getUsername(),Integer.valueOf( |
| | | systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_TOKEN_VALIDITY).getCode() |
| | | ),redisTemplate); |
| | | return ApiResponse.success( HKService.getMenuUrl(type,hkToken)); |
| | | } |
| | | |
| | | } |