| | |
| | | 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.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.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.DeviceService; |
| | | import com.doumee.service.business.impl.hksync.*; |
| | | import com.doumee.service.business.impl.hksync.ferp.HkSyncOrgUserToHKServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | 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.*; |
| | |
| | | private HkSyncPrivilegeServiceImpl hkSyncPrivilegeService; |
| | | @Autowired |
| | | private HkSyncPushServiceImpl hkSyncPushService; |
| | | @Autowired |
| | | private HkSyncOrgUserToHKServiceImpl hkSyncOrgUserToHKService; |
| | | @Autowired |
| | | private HkSyncNoticeServiceImpl hkSyncNoticeService; |
| | | @Autowired |
| | | private HkSyncLoginAuthServiceImpl hkSyncLoginAuthService; |
| | | |
| | |
| | | //同步广播 |
| | | result = hkSyncDeviceService.syncHkBroadcast(param); |
| | | } |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】保存海康用户绑定openid") |
| | | @PostMapping("/saveHkUserOpenid") |
| | | public ApiResponse syncHkUserOpenid( @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | String result = hkSyncOrgUserToHKService.syncHkUserOpenid(this.getLoginUser(token).getId()); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】清空海康用户绑定openid") |
| | | @PostMapping("/delHkUserOpenid") |
| | | @LoginNoRequired |
| | | public ApiResponse delHkUserOpenid( @RequestBody UserOpenidSaveRequest param){ |
| | | String result = hkSyncOrgUserToHKService.delHkUserOpenid(param); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取安防平台系统免密菜单调整地址" ) |
| | | @GetMapping("/getHkMenuLink") |
| | | @PostMapping("/getHkMenuLink/{type}") |
| | | @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){ |
| | | public ApiResponse<String> getHkMenuLink(@PathVariable 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); |
| | | String url = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_HTTPS).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_HOST).getCode() |
| | | String url = (type==6?"":(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_HTTPS).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_HOST).getCode())) |
| | | + HKService.getMenuUrl(type,hkToken); |
| | | try { |
| | | if(redisTemplate!=null&& jwtProperties!=null){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("【海康】代办消息数据集合对接处理接口") |
| | | @PostMapping("/notice/getList") |
| | | public ApiResponse getNoticeList( HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token ){ |
| | | String result = hkSyncNoticeService.syncHkNotices(this.getLoginUser(token).getUsername()); |
| | | return ApiResponse.success(result); |
| | | } |
| | | |
| | | |
| | | |