| | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.dingTalk.DingTalk; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.EventSubRequest; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | |
| | | if(Constants.equalsInteger(model.getStatus(),param.getStatus())){ |
| | | return; |
| | | } |
| | | if(StringUtils.isNotBlank(param.getCode())&&Constants.equalsInteger(model.getType(),Constants.ZERO)||Constants.equalsInteger(model.getType(),Constants.ONE)){ |
| | | |
| | | if(StringUtils.isNotBlank(model.getCode())&&(Constants.equalsInteger(model.getType(),Constants.ZERO)||Constants.equalsInteger(model.getType(),Constants.ONE))){ |
| | | EventSubRequest eventParam = new EventSubRequest(); |
| | | String path =systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_PUSH_URL).getCode(); |
| | | eventParam.setEventDest(path+"/notice"); |
| | |
| | | } |
| | | HKService.cancelEventSub(eventParam);//先取消 |
| | | if(Constants.equalsInteger(param.getStatus(),Constants.ONE)){ |
| | | HKService.eventSub(eventParam);//安防事件 |
| | | BaseResponse response = HKService.eventSub(eventParam);//安防事件 |
| | | if(Objects.nonNull(response)&&StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | model.setSubscribeStatus(Constants.ONE); |
| | | }else{ |
| | | model.setSubscribeStatus(Constants.TWO); |
| | | model.setSubscribeInfo(response.getMsg()); |
| | | } |
| | | }else{ |
| | | model.setSubscribeStatus(Constants.ZERO); |
| | | } |
| | | } |
| | | |
| | | |
| | | model.setStatus(param.getStatus()); |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(param.getLoginUserInfo().getId()); |