|  |  |  | 
|---|
|  |  |  | package com.doumee.service.business.impl.hksync; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 
|---|
|  |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.HKConstants; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.BaseListPageResponse; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.BaseResponse; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.request.*; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.respose.*; | 
|---|
|  |  |  | import com.doumee.core.haikang.service.HKService; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.core.utils.DateUtil; | 
|---|
|  |  |  | import com.doumee.dao.business.DeviceMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Device; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.data.redis.core.RedisTemplate; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.net.URLEncoder; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.concurrent.TimeUnit; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 设备信息表Service实现 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private DeviceMapper deviceMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private RedisTemplate<String, Object> redisTemplate; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  | ctgtParam.setUserCode(param.getUsername()); | 
|---|
|  |  |  | ctgtParam.setLoginType("2"); | 
|---|
|  |  |  | BaseResponse<ApplyCTGTResponse> response = HKService.applyCTGT(ctgtParam); | 
|---|
|  |  |  | if(response !=null && StringUtils.equals(response.getCode(),HKConstants.RESPONSE_SUCCEE) &&response.getData()!=null &&StringUtils.isNotBlank(response.getData().getCTGT())){ | 
|---|
|  |  |  | if(response !=null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) &&response.getData()!=null &&StringUtils.isNotBlank(response.getData().getCTGT())){ | 
|---|
|  |  |  | //处理新增成功的数据,修改海康同步状态 | 
|---|
|  |  |  | String ctgt = response.getData().getCTGT(); | 
|---|
|  |  |  | ApplySTequest stParam = new ApplySTequest(); | 
|---|
|  |  |  | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,登录组件失败,请稍后重试!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,登录组件失败,请稍后重试!"); | 
|---|
|  |  |  | } | 
|---|