jiangping
2024-09-20 e3895f634e85098fac4b9c017c65d662f14e9f2f
最新版本
已添加5个文件
已修改4个文件
246 ■■■■■ 文件已修改
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/HkInterfaceTestCloudController.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/NhEventPageListRequest.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/WxConfigInfoRequest.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/AuthItemListDetailResponse.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/NhEventPageListResponse.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/WxConfigInfoResponse.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/HkInterfaceTestCloudController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,76 @@
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.BaseResponse;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2023/11/30 15:33
 */
@Api(tags = "海康数据同步接口")
@RestController
@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/hktest")
public class HkInterfaceTestCloudController extends BaseController {
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @ApiOperation("【海康】测试LED显示屏")
    @PostMapping("/testLed")
    @LoginNoRequired
    public ApiResponse<BaseResponse> testLed(@RequestBody TransparentChannelBodyRequest request, HttpServletResponse response) {
        TransparentChannelHeadRequest head = new TransparentChannelHeadRequest();
        head.setAbility("cld");//固定值
        head.setTreatyType("haixuan_led_net");//固定值
        head.setDeviceIndexCode("6a5498e9df924befbb9530e467e5e809");
        return ApiResponse.success(HKService.transparentchannel(head,request));
    }
    @ApiOperation("【海康】测试广播播报")
    @PostMapping("/testBroadcast")
    @LoginNoRequired
    public ApiResponse<BaseResponse> testBroadcast(@RequestBody CustomBroadcastRequest request, HttpServletResponse response) {
        return ApiResponse.success(  HKService.customBroadcast(request));
    }
    @ApiOperation("【海康】测试获取微信公众号")
    @GetMapping("/testWxToken")
    @LoginNoRequired
    public ApiResponse<BaseResponse> testWxToken(@RequestParam String configId,@RequestParam String tageId, HttpServletResponse response) {
        return ApiResponse.success(  HKService.wxAccessToken(configId,tageId));
    }
    @ApiOperation("【海康】测试分页获取告警事件")
    @GetMapping("/testWxToken")
    @LoginNoRequired
    public ApiResponse<BaseResponse> nhEventPageList(@RequestBody NhEventPageListRequest param, HttpServletResponse response) {
        return ApiResponse.success(  HKService.nhEventPageList(param));
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
@@ -117,11 +117,14 @@
        String[] iccmUpdateAppointment= new String[]{"/api/iccm/v2/appointment/update","iccm访客登记修改"};//iccm访客登记修改
        String[] iccmCancelAppointment= new String[]{"/api/iccm/v1/appointment/cancel","iccm访客登记修改"};//iccm访客登记修改
        String[] iccmAppointmentMDJ= new String[]{"/api/iccm/v1/appointment/free/registration","iccm访客预约免登记"};//iccm访客预约免登记
        String[] privilegIccmeGroup= new String[]{"/api/iccm/v1/privilege/groups","查询访客权限组"};//查询访客权限组
        String[] iccmAppointmentRecords= new String[]{"/api/iccm/v2/appointment/records","iccm查询已预约登记"};//iccm查询已预约登记
        String[] wxAccessToken= new String[]{"/api/wx/v1/oa/get/accessToken","iccm查询已预约登记"};//1.9.1根据微信公众号信息获取AccessToken
        String[] wxAccessToken= new String[]{"/api/wx/v1/oa/get/accessToken","根据微信公众号信息获取AccessToken"};//1.9.1根据微信公众号信息获取AccessToken
        String[] getWxConfig= new String[]{"/api/wx/v1/oa/get/config","根据配置微信公众号编号查询微信公众号信息"};//根据配置微信公众号编号查询微信公众号信息
        String[] goMenuUrl= new String[]{"/xauthplus-plugin/thirdLogin?type=third&componentId=Infovision iPark Platform&componentMenuId=${menuId}&token=${token}","工作台菜单跳转地址"};
        String[] nhEventPageList= new String[]{"/api/ecm/warning/event/v1/pageList","分页获取告警事件"};//分页获取告警事件
        String[] nhRegionDataRanking= new String[]{"/api/ecm/v1/energy/regionDataRanking","根据时间维度获取区域用量排名"};//1.8.5根据时间维度获取区域用量排名
        String[] nhEnergyDistribution= new String[]{"/api/ecm/v1/energy/energyDistribution","根据时间维度获取能耗分布"};// æ ¹æ®æ—¶é—´ç»´åº¦èŽ·å–èƒ½è€—åˆ†å¸ƒ
    }
    /**
@@ -139,8 +142,7 @@
        // æž„造方法
        TASK_TYPE(int key, String name ) {
            this.name = name;
            this.key = key;
            this.name = name;this.key = key;
        }
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
@@ -369,6 +369,15 @@
        return  startDoPostStringArtemis(HKConstants.InterfacePath.visitCancel,body);
    }
    public static String startDoGetStringArtemis(String[] pathStr,Map<String,String> body ){
        Map<String, String> path = getPath(pathStr[0]);
        Map<String, String> header = new HashMap<>();
        header.put("tagId", UUID.randomUUID().toString().replace("-", ""));
        String result = ArtemisHttpUtil.doGetArtemis(path, body, null,  "application/json", header);// post请求application/json类型参数
        saveInterfaceLog(JSONObject.toJSONString(body),result,path,pathStr[1]);
        return result;
    }
    public static String startDoPostStringArtemis(String[] pathStr,String body ){
        Map<String, String> path = getPath(pathStr[0]);
        Map<String, String> header = new HashMap<>();
@@ -563,6 +572,22 @@
        return startDoPostStringArtemis(wxAccessToken,"");
    }
    /**
     *    æ ¹æ®é…ç½®å¾®ä¿¡å…¬ä¼—号编号查询微信公众号信息
     * @param body
     * @return
     */
    public static String getWxConfig(Map<String,String>  body) {
        return startDoGetStringArtemis(HKConstants.InterfacePath.getWxConfig,body);
    }
    /**
     *    æ ¹æ®é…ç½®å¾®ä¿¡å…¬ä¼—号编号查询微信公众号信息
     * @param body
     * @return
     */
    public static String nhEventPageList(Map<String,String> body) {
        return startDoGetStringArtemis(HKConstants.InterfacePath.nhEventPageList,body);
    }
    /**
     *    èŽ·å–å…¨é‡ç”¨æˆ·åˆ—è¡¨
     * @param body
     * @return
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/NhEventPageListRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package com.doumee.core.haikang.model.param.request;
import lombok.Data;
@Data
public class NhEventPageListRequest {
    private String   warningName    ;//Query    String    false    é¢„告警名称
    private String   nodeName    ;//Query    String    false    ç›‘测对象
    private String   warningLevel    ;//Query    Number    true    é¢„告警等级,0:全部,1:一般,2:严重,3:故障
    private String   ruleTypeId    ;//Query    String    false    é¢„告警类型ID,为空时表示所有
    private String   startDate    ;//Query    String    false    å‘生时间开始时间
    private String   endDate;//    Query    String    false    å‘生时间结束时间
    private String   handleStatus;//    Query    String    false    å¤„理状态:0:全部,1:未处理,2:已处理
    private String   pageNo;//    Query    Number    false    é¡µç 
    private String   pageSize;//    Query    Number    false    é¡µå¤§å°
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/WxConfigInfoRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
package com.doumee.core.haikang.model.param.request;
import lombok.Data;
@Data
public class WxConfigInfoRequest {
    private String      tagId;//        Query    String    false    æ ‡ç­¾
    private String     oaId;//        Query    String    false    å¾®ä¿¡å…¬ä¼—号配置编号
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/AuthItemListDetailResponse.java
@@ -6,18 +6,18 @@
@Data
public class AuthItemListDetailResponse {
   private String  personId    ;//string    False    äººå‘˜ID
  private String resourceIndexCode;//    string    False    èµ„源的唯一标识
  private Integer channelNo;//    number    False    é€šé“号
  private String channelIndexCode    ;//string    False    èµ„源通道唯一标识(在权限下载和配置接口入参时对应查询接口会返回,不作为查询接口的查询条件)
  private TimeRangeRequest templateConfigInfos;//    Object[]    False    è®¡åˆ’模板信息
  private Integer personStatus;//    number    False    äººå‘˜çŠ¶æ€,0:已配置未下载1:更新待下载2:更新待删除3:已下载4:未配置
  private Integer cardStatus    ;//number    False    å¡ç‰‡çŠ¶æ€,0:已配置未下载1:更新待下载2:更新待删除3:已下载4:未配置
  private Integer faceStatus    ;//number    False    äººè„¸çŠ¶æ€,0:已配置未下载1:更新待下载2:更新待删除3:已下载4:未配置
  private String cardJson    ;//string    False    è®°å½•已下载到设备的卡号(Map格式(卡号:状态),其中状态(0改变表示下载后卡片的信息又变化了,1已下载))
 private String configTime    ;//string    False    é…ç½®æ—¶é—´,采用ISO8601时间格式,最大长度32个字符,如2018-09-03T17:30:08.000+08:00
 private String startTime;//    string    False    äººå‘˜æƒé™æœ‰æ•ˆæœŸï¼ˆä»¥äººä¸ºä¸­å¿ƒè®¾å¤‡æ—¶ä½¿ç”¨ï¼‰,开始时间,采用ISO8601时间格式,最大长度32个字符,如2018-09-03T17:30:08.000+08:00
 private String endTime    ;//string    False    äººå‘˜æƒé™æœ‰æ•ˆæœŸï¼ˆä»¥äººä¸ºä¸­å¿ƒè®¾å¤‡æ—¶ä½¿ç”¨ï¼‰,开始日期,采用ISO8601时间格式,最大长度32个字符,如2018-09-03T17:30:08.000+08:00
 private String personExtendJson;//    body    string    å¦
      private String  personId    ;//string    False    äººå‘˜ID
      private String resourceIndexCode;//    string    False    èµ„源的唯一标识
      private Integer channelNo;//    number    False    é€šé“号
      private String channelIndexCode    ;//string    False    èµ„源通道唯一标识(在权限下载和配置接口入参时对应查询接口会返回,不作为查询接口的查询条件)
      private TimeRangeRequest templateConfigInfos;//    Object[]    False    è®¡åˆ’模板信息
      private Integer personStatus;//    number    False    äººå‘˜çŠ¶æ€,0:已配置未下载1:更新待下载2:更新待删除3:已下载4:未配置
      private Integer cardStatus    ;//number    False    å¡ç‰‡çŠ¶æ€,0:已配置未下载1:更新待下载2:更新待删除3:已下载4:未配置
      private Integer faceStatus    ;//number    False    äººè„¸çŠ¶æ€,0:已配置未下载1:更新待下载2:更新待删除3:已下载4:未配置
      private String cardJson    ;//string    False    è®°å½•已下载到设备的卡号(Map格式(卡号:状态),其中状态(0改变表示下载后卡片的信息又变化了,1已下载))
      private String configTime    ;//string    False    é…ç½®æ—¶é—´,采用ISO8601时间格式,最大长度32个字符,如2018-09-03T17:30:08.000+08:00
      private String startTime;//    string    False    äººå‘˜æƒé™æœ‰æ•ˆæœŸï¼ˆä»¥äººä¸ºä¸­å¿ƒè®¾å¤‡æ—¶ä½¿ç”¨ï¼‰,开始时间,采用ISO8601时间格式,最大长度32个字符,如2018-09-03T17:30:08.000+08:00
      private String endTime    ;//string    False    äººå‘˜æƒé™æœ‰æ•ˆæœŸï¼ˆä»¥äººä¸ºä¸­å¿ƒè®¾å¤‡æ—¶ä½¿ç”¨ï¼‰,开始日期,采用ISO8601时间格式,最大长度32个字符,如2018-09-03T17:30:08.000+08:00
      private String personExtendJson;//    body    string    å¦
           
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/NhEventPageListResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package com.doumee.core.haikang.model.param.respose;
import lombok.Data;
@Data
public class NhEventPageListResponse {
      private String id    ;//String    false    é¢„告警事件唯一标识
      private String warningName    ;//String    false    é¢„告警名称
      private String nodeType    ;//Number    false    èŠ‚ç‚¹ç±»åž‹
      private String nodeId    ;//String    false    èŠ‚ç‚¹ID
      private String nodeName;//    String    false    èŠ‚ç‚¹åç§°
      private String nodePath;//    String    false    èŠ‚ç‚¹è·¯å¾„
      private String ruleType    ;//String    false    é¢„告警类型
      private String warningLevel    ;//Number    false    é¢„告警等级,1:一般,2:严重,3:故障
      private String warningValue    ;//String    false    æ•°æ®é¡¹å½“前值
      private String warningEventTip;//    String    false    å¼‚常原因
      private String createTime;//    String    false    å‘生时间
      private String benchmark;//    String    false    åŸºå‡†æ•°æ®
      private String handleStatus;//    Number    false    å¤„理状态:1:未处理,2:已处理
      private String note;//    String    false    å¤„理意见
      private String handleTime;//    String    false    å¤„理时间
      private String normal;//    Boolean    false    é¢„告警是否正常
      private String deviceId;//    String    false    è®¾å¤‡id
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/WxConfigInfoResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.doumee.core.haikang.model.param.respose;
import lombok.Data;
import java.util.List;
@Data
public class WxConfigInfoResponse {
      private String id;//    String    false    å¾®ä¿¡å…¬ä¼—号配置id
      private String appKey;//    String    false    å¾®ä¿¡å…¬ä¼—号app_key
      private String appSecret    ;//String    false    å¾®ä¿¡å…¬ä¼—号app_secret
      private String oaName;//    String    false    å¾®ä¿¡å…¬ä¼—号名称
      private String modelDataId    ;//String    false    pdms数据主键
      private String domainId    ;//String    false    æ‰€å±žç½‘络id
      private String netProtocol;//    String    false    ç½‘络协议
      private String port;//    String    false    ç«¯å£å·
      private String tagId;//    String    false    ç»„建标识
      private String templateUrl;//    String    false    æ¨¡æ¿æ¶ˆæ¯åœ°å€é…ç½®
      private String proxySwitch;//    String    false    æ˜¯å¦å¼€å¯ä»£ç†  1 å¼€  0 å…³
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -1,5 +1,6 @@
package com.doumee.core.haikang.service;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.doumee.core.haikang.model.HKConstants;
@@ -15,6 +16,7 @@
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import java.io.InputStream;
import java.lang.reflect.Field;
@@ -897,6 +899,43 @@
        return  null;
    }
    /**
     *根据配置微信公众号编号查询微信公众号信息
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<WxConfigInfoResponse>>   getWxConfig(WxConfigInfoRequest param){
        log.info("【海康根据配置微信公众号编号查询微信公众号信息】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.getWxConfig(toMap(param));
            TypeReference typeReference =
                    new TypeReference<BaseResponse<BaseListPageResponse<WxConfigInfoResponse>>>(){};
            BaseResponse<BaseListPageResponse<WxConfigInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康根据配置微信公众号编号查询微信公众号信息");
            return  result;
        }catch (Exception e){
            log.error("【海康根据配置微信公众号编号查询微信公众号信息】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *分页获取告警事件
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<NhEventPageListResponse>>   nhEventPageList(NhEventPageListRequest param){
        log.info("【海康分页获取告警事件】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.nhEventPageList(toMap(param));
            TypeReference typeReference =
                    new TypeReference<BaseResponse<BaseListPageResponse<NhEventPageListResponse>>>(){};
            BaseResponse<BaseListPageResponse<NhEventPageListResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康分页获取告警事件");
            return  result;
        }catch (Exception e){
            log.error("【海康分页获取告警事件】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *查询访客来访记录(已登记)(分页)
     * @return
     */