Browse Source

转移ICC

yang 3 years ago
parent
commit
7a7aecb387
51 changed files with 3681 additions and 1 deletions
  1. 40 0
      huimv-farm-video/pom.xml
  2. 59 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/BaseController/SysTelecomController.java
  3. 222 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/BaseController/SysTelecomEventController.java
  4. 94 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/BaseController/VideoRecorController.java
  5. 69 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/ClientAccidentController.java
  6. 65 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/ClientCarManageController.java
  7. 276 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/ClientEventController.java
  8. 126 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/ClientPersonManageController.java
  9. 103 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/GetPicture.java
  10. 26 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/GetToken.java
  11. 71 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenAlarmCountByDay.java
  12. 142 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenCarController.java
  13. 64 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenIndexDataController.java
  14. 145 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenPersonController.java
  15. 311 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenSiZhuController.java
  16. 34 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/BaseTelecomRoom.java
  17. 35 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/IccChannel.java
  18. 96 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/IccEventRecord.java
  19. 45 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysTelecom.java
  20. 40 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysTelecomEvent.java
  21. 19 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/TelecomDto.java
  22. 17 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/TelecomVo.java
  23. 20 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/CommonConstant.java
  24. 21 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/IccDemo.java
  25. 19 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/IccUtil.java
  26. 17 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/BaseTelecomRoomMapper.java
  27. 18 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/IccChannelMapper.java
  28. 18 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/IccEventRecordMapper.java
  29. 10 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysTelecomEventMapper.java
  30. 19 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysTelecomMapper.java
  31. 53 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/R.java
  32. 48 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/RRException.java
  33. 116 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/RRExceptionHandler.java
  34. 17 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IBaseTelecomRoomService.java
  35. 17 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IIccChannelService.java
  36. 19 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IIccEventRecordService.java
  37. 15 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysTelecomEventService.java
  38. 21 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysTelecomService.java
  39. 21 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/BaseTelecomRoomServiceImpl.java
  40. 21 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/IccChannelServiceImpl.java
  41. 22 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/IccEventRecordServiceImpl.java
  42. 27 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysTelecomEventServiceImpl.java
  43. 34 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysTelecomServiceImpl.java
  44. 24 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/GetPastTime.java
  45. 487 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/GetResponse.java
  46. 376 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/HttpClient.java
  47. 68 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/Result.java
  48. 41 0
      huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/ResultCode.java
  49. 0 0
      huimv-farm-video/src/main/java/com/huimv/video/security/readme
  50. 0 1
      huimv-farm-video/src/main/resources/application-dev.yml
  51. 13 0
      huimv-farm-video/src/main/resources/config/iccSdk.properties

+ 40 - 0
huimv-farm-video/pom.xml

@@ -11,5 +11,45 @@
 
     <artifactId>huimv-farm-video</artifactId>
 
+    <dependencies>
+
+    <dependency>
+        <groupId>com.dahuatech.icc</groupId>
+        <artifactId>java-sdk-oauth</artifactId>
+        <version>1.0.8</version>
+    </dependency>
+
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpmime</artifactId>
+            <version>4.5</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.13</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.4.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpmime</artifactId>
+            <version>4.5.12</version>
+        </dependency>
+    </dependencies>
+
+
 
 </project>

+ 59 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/BaseController/SysTelecomController.java

@@ -0,0 +1,59 @@
+package com.huimv.video.dhicc.BaseController;
+
+
+import com.huimv.common.utils.Result;
+import com.huimv.video.dhicc.entity.SysTelecom;
+import com.huimv.video.dhicc.entity.TelecomDto;
+import com.huimv.video.dhicc.service.ISysTelecomService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import java.text.DecimalFormat;
+import java.util.Map;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+@RestController
+@RequestMapping("/device")
+public class SysTelecomController {
+    @Autowired
+    private ISysTelecomService telecomService;
+
+    @PostMapping("/deviceResponse")
+    public String deviceResponse(@RequestBody TelecomDto telecomDto) {
+        Map<String, Integer> payload = telecomDto.getPayload();
+
+        SysTelecom telecom = new SysTelecom();
+        telecom.setDeviceId(telecomDto.getDeviceId());
+        telecom.setFarmId(1);
+        telecom.setTimestamp(telecomDto.getTimestamp());
+        Integer rssi = payload.get("RSSI");
+        Integer STC = payload.get("STC");
+        Integer HUMI = payload.get("HUMI");
+        Integer TEMP = payload.get("TEMP");
+        telecom.setRssi(rssi);
+        telecom.setStc(STC);
+
+        telecom.setHumi(HUMI);
+        DecimalFormat df = new DecimalFormat("0.0");
+        telecom.setTemp( df.format(TEMP*0.1));
+
+        telecomService.save(telecom);
+        return "200";
+    }
+
+
+    @PostMapping("/listByRoom")
+    public Result listByRoom(@RequestBody Map map) {
+        return telecomService.listByRoom(map);
+    }
+
+}

+ 222 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/BaseController/SysTelecomEventController.java

@@ -0,0 +1,222 @@
+package com.huimv.video.dhicc.BaseController;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+import com.huimv.common.utils.StringUtilsWork;
+
+import com.huimv.video.dhicc.entity.BaseTelecomRoom;
+import com.huimv.video.dhicc.entity.SysTelecom;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+import com.huimv.video.dhicc.entity.TelecomVo;
+import com.huimv.video.dhicc.mapper.BaseTelecomRoomMapper;
+import com.huimv.video.dhicc.mapper.SysTelecomMapper;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/telecom")
+public class SysTelecomEventController {
+
+    @Autowired
+    private BaseTelecomRoomMapper baseTelecomRoomMapper;
+
+    @Autowired
+    private SysTelecomMapper sysTelecomMapper;
+
+    @Autowired
+    private ISysTelecomEventService sysTelecomEventService;
+    //传入机器编码  返回这个机器下的所有事件 带分页
+    @GetMapping("/listevent")
+    public Result list(@RequestParam(name = "deviceId", required = false) String deviceId    ,
+                       @RequestParam(name = "startTimeString", required = false) String startTimeString ,
+                       @RequestParam(name = "endTimeString", required = false) String endTimeString,
+                       @RequestParam(name = "current", required = false) Integer current,//当前页
+                       @RequestParam(name = "size", required = false) Long size,
+                       @RequestParam(name = "farmId") Integer farmId  //分页大小
+
+    ) throws ParseException {
+        //如果传入的开始时间是默认的今天的 就返回最近三天的 --前端说改起来比较麻烦
+
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date();
+        Date startTime = fmt.parse(startTimeString);
+        Date endTime = fmt.parse(endTimeString);
+
+         long timeGap = date.getTime()-startTime.getTime();
+        QueryWrapper<SysTelecomEvent> wrapper = new QueryWrapper<>();
+        wrapper.eq("farm_id", farmId);
+        if(StringUtilsWork.isNotBlank(deviceId)){
+            wrapper.eq("device_id", deviceId);
+        }
+        if (timeGap<1000*60*60*72){
+            startTime = new Date(endTime.getTime()-1000*60*60*100);
+        }
+        wrapper.between("event_time", startTime, endTime);
+        wrapper.orderByDesc( "event_time" );
+        Page<SysTelecomEvent> page = sysTelecomEventService.page(new Page< >(current, size), wrapper);
+        //本要写SQL 现在没时间  这样处理一下问题不大
+        List<SysTelecomEvent> records = page.getRecords();
+        List<TelecomVo> TelecomVoRecords = new ArrayList<>();
+        Page<TelecomVo> page1 = new Page< >(current, size);
+        page1.setTotal(page.getTotal());
+        for (SysTelecomEvent record : records) {
+            TelecomVo telecomVo = new TelecomVo();
+            telecomVo.setDeviceId(record.getDeviceId());
+            telecomVo.setEventTime(record.getEventTime());
+            //效率很低  暂且这样
+            LambdaQueryWrapper<BaseTelecomRoom> wrapper3 = Wrappers.lambdaQuery();
+            wrapper3.eq(BaseTelecomRoom::getDeviceId, record.getDeviceId());
+            BaseTelecomRoom baseTelecomRoom = baseTelecomRoomMapper.selectOne(wrapper3);
+            telecomVo.setLocation(baseTelecomRoom.getDeviceRoom());
+            TelecomVoRecords.add(telecomVo);
+        }
+        return new Result(ResultCode.SUCCESS,page1.setRecords(TelecomVoRecords));
+    }
+        //判断时间   有传时间返回时间范围  没有时间
+
+    @GetMapping("/listeventdetail")
+    public Result listeventdetail(@RequestParam(name = "deviceId", required = false) String deviceId ,
+                                  @RequestParam(name = "eventTimeString", required = false) String eventTimeString
+    ) throws ParseException {
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date eventTime = fmt.parse(eventTimeString);
+        Calendar c1 = Calendar.getInstance();
+        c1.setTime(eventTime);
+        c1.add(Calendar.MINUTE, -60);
+        Date began = c1.getTime();
+        String startTime = format.format(began);
+        c1.add(Calendar.MINUTE, +150);
+        Date endTime11 = c1.getTime();
+        String endTime = format.format(endTime11);
+        //这儿就直接拿温度了----还是不行的  温度和时间都是需要的
+        Map map1 = new HashMap();
+        List<String> timeList = new ArrayList<>();
+        List<String> tempList = new ArrayList<>();
+        LambdaQueryWrapper<SysTelecom> lambdaQueryWrapper =
+                new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(SysTelecom::getDeviceId ,deviceId).between(SysTelecom::getTimestamp ,startTime,endTime);
+        List<SysTelecom> sysTelecoms = sysTelecomMapper.selectList(lambdaQueryWrapper);
+        for (SysTelecom sysTelecom : sysTelecoms) {
+            timeList.add(fmt.format(sysTelecom.getTimestamp()));
+            tempList.add(sysTelecom.getTemp());
+        }
+        map1.put("timeList",timeList);
+        map1.put("tempList",tempList);
+        return new Result(ResultCode.SUCCESS,map1);
+    }
+
+    //过去几个小时的车辆烘干次数的----后面可以做成定时任务存表  防止断网就没数据
+    @GetMapping("/listeventByHoure")
+    public Result listeventByHoure( ) throws ParseException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.add(Calendar.DATE, +1);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.DATE, -1);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        c.add(Calendar.DATE, -1);
+        Date C = c.getTime();
+        String formatC = format.format(C);
+
+        c.add(Calendar.DATE, -1);
+        Date D = c.getTime();
+        String formatD = format.format(D);
+
+        c.add(Calendar.DATE, -1);
+        Date E = c.getTime();
+        String formatE = format.format(E);
+
+        c.add(Calendar.DATE, -1);
+        Date F = c.getTime();
+        String formatF = format.format(F);
+
+        c.add(Calendar.DATE, -1);
+        Date G = c.getTime();
+        String formatG = format.format(G);
+
+        c.add(Calendar.DATE, -1);
+        Date H = c.getTime();
+        String formatH = format.format(H);
+
+        List result = new ArrayList();
+
+
+        Map map1  = new HashMap();
+        map1.put("time",splitTime(B));
+        map1.put("value",sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatB, formatA)));
+
+        Map map2  = new HashMap();
+        map2.put("time",splitTime(C));
+        map2.put("value",sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatC, formatB)));
+
+        Map map3  = new HashMap();
+        map3.put("time",splitTime(D));
+        map3.put("value",sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatD, formatC)));
+
+        Map map4  = new HashMap();
+        map4.put("time",splitTime(E));
+        map4.put("value",sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatE, formatD)));
+
+
+        Map map5  = new HashMap();
+        map5.put("time",splitTime(F));
+        map5.put("value",sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatF, formatE)));
+
+
+        Map map6  = new HashMap();
+        map6.put("time",splitTime(G));
+        map6.put("value",sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatG, formatF)));
+
+        Map map7  = new HashMap();
+        map7.put("time",splitTime(H));
+        map7.put("value",sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatH, formatG)));
+        result.add(map1);
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        result.add(map5);
+        result.add(map6);
+        result.add(map7);
+        //翻转
+        Collections.reverse(result);
+        return  new Result(ResultCode.SUCCESS,result);
+    }
+
+    public String splitTime(Date date){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        String date1 = calendar.get(Calendar.MONTH)+1+"/"+calendar.get(Calendar.DATE);
+        return date1;
+    }
+
+}

+ 94 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/BaseController/VideoRecorController.java

@@ -0,0 +1,94 @@
+package com.huimv.video.dhicc.BaseController;
+
+//拿视频回放
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+
+import com.huimv.video.dhicc.entity.IccChannel;
+import com.huimv.video.dhicc.mapper.IccChannelMapper;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.IIccChannelService;
+import net.sf.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+//方便前端操作   传入的是  事件时间  还有通道编号就可以播放了
+@RestController
+@RequestMapping("/video")
+
+public class VideoRecorController {
+
+    @Autowired
+     private IIccChannelService iIccChannelService;
+
+    @Autowired
+    private IccChannelMapper iccChannelMapper  ;
+
+    @RequestMapping("/getVideoRecord")
+    public R getVideoRecord(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
+        String happendTime = (String) params1.get("happendTime");
+        String channelNmae = (String) params1.get("channelName");
+        LambdaQueryWrapper<IccChannel> wrapper3 = Wrappers.lambdaQuery();
+        wrapper3.eq(IccChannel::getChannelName, channelNmae);
+        IccChannel iccChannel = iccChannelMapper.selectOne(wrapper3);
+        String URL = "/evo-apigw/admin/API/SS/Playback/StartPlaybackByTime";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        System.out.println("开始执行");
+        Map<String, Object> params = new HashMap<>();
+        Map<String, Object> value = new HashMap<>();
+        value.put("nvrId","");
+        value.put("optional","/evo-apigw/admin/API/SS/Playback/StartPlaybackByTime");
+        value.put("recordType","1");
+        value.put("streamType","1");
+        value.put("recordSource","2");
+        value.put("channelId",iccChannel.getChannelId());
+        System.out.println(iccChannel.toString());
+         //开始结束时间代为处理
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        //格式化传入的时间---拿传入时间前后五分钟的视频
+        Date Time = fmt.parse(happendTime);   //事件时间
+        Date GapTimeBefor_gap = new Date(Time.getTime() -1000*10);//star   事件十秒之前
+        Date GapAfter = new Date(Time.getTime() +1000*60*5);// end   事件五分钟之后
+        String befor= String.valueOf(GapTimeBefor_gap.getTime() /1000);
+        String after= String.valueOf(GapAfter.getTime() /1000);
+        value.put("endTime",after);
+        value.put("startTime",befor);
+        params.put("clientMac","30:9c:23:79:40:08");
+        params.put("clientPushId","");
+        params.put("project","PSDK");
+        params.put("method","SS.Playback.StartPlaybackByTime");
+        params.put("data",value);
+        generalRequest.body(JSON.toJSONString(params));
+        System.out.println(JSON.toJSONString(params));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        String url = (String) JSONObject.fromObject(data).get("url");
+        String token = (String) JSONObject.fromObject(data).get("token");
+        // "|"  特殊字符需要加转义字符
+        String[] sourceStrArray = url.split("\\|");
+        String recordUrl = sourceStrArray[1]+"?token="+token+"&trackID=701";
+        return  R.ok("请求成功").put("URL",recordUrl );
+    }
+}

+ 69 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/ClientAccidentController.java

@@ -0,0 +1,69 @@
+package com.huimv.video.dhicc.ClientController;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+
+@RestController
+@RequestMapping("/accident")
+
+public class ClientAccidentController {
+
+    /**
+     * 洗消数据查询的接口,三个洗消的摄像头是固定的
+     *
+     * @param params
+     * @return
+     * @throws ClientException
+     */
+    @RequestMapping("/accident_record_xixiao")
+    public GeneralResponse getAccidentRecord(@RequestBody Map<String, Object> params) throws ClientException {
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+    /**
+     * 洗消数据查询的接口,三个洗消的摄像头是固定的
+     *
+     * @param params
+     * @return
+     * @throws ClientException
+     */
+    @RequestMapping("/accident_record_xixiao_totalpage")
+    public GeneralResponse getAccidentRecordTotalPage(@RequestBody Map<String, Object> params) throws ClientException {
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+}

+ 65 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/ClientCarManageController.java

@@ -0,0 +1,65 @@
+package com.huimv.video.dhicc.ClientController;
+
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+
+@RestController
+@RequestMapping("car")
+
+public class ClientCarManageController {
+        //过车的数据
+        /**
+         * 保存ntamade
+         */
+        @RequestMapping("/get_car_record")
+        public GeneralResponse getCarRecord(HttpServletRequest request ) throws ClientException {
+            System.out.println(request.getRequestURL()   );
+            System.out.println(request.getQueryString());
+            String queryString = request.getQueryString();
+            String URL = "/evo-apigw/ipms/carcapture/find/conditions?";  //获取事件URL    post请求
+            IClient iClient = new DefaultClient();
+            System.out.println("开始执行");
+            String newUrl = URL + queryString;
+            System.out.println(newUrl);
+            //这种已经在配置文件里面安排了账号ip以及密码    现在变了
+            GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
+            GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+            System.out.println("执行结束");
+            return generalResponse;
+        }
+
+
+
+
+
+        @RequestMapping("/get_person_detail")
+        public GeneralResponse getPersonDetail( @RequestBody Map<String, Object> params ) throws ClientException {
+            String URL = "/evo-apigw/evo-accesscontrol/${version}/card/accessControl/swingCardRecord/19241";  //获取事件URL    post请求
+            IClient iClient = new DefaultClient();
+            System.out.println("开始执行");
+            String URL_id = URL + params.get("id");
+            //这种已经在配置文件里面安排了账号ip以及密码
+            GeneralRequest generalRequest = new GeneralRequest(URL_id, Method.POST);
+            generalRequest.header("Content-Type", " application/json");
+            //发起请求处理应答
+            GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+            System.out.println("执行结束");
+            return generalResponse;
+        }
+
+
+
+
+
+}

+ 276 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/ClientEventController.java

@@ -0,0 +1,276 @@
+package com.huimv.video.dhicc.ClientController;
+
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.common.utils.StringUtilsWork;
+
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import net.sf.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@CrossOrigin
+@RestController
+@RequestMapping("/client/event")
+public class ClientEventController {
+
+
+    @Autowired
+    private ISysTelecomEventService sysTelecomEventService;
+
+     //
+    @RequestMapping("/ListAllEvent")
+    public R SiZhuList(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
+        return R.ok("请求成功").put("data", getAllKindEventList( params1  )).put("total" , CountTimes(params1));
+    }
+
+
+    //返回所有的事件 的集合  包括死猪和洗消和大门 --分页参数
+    public GeneralResponse getAllKindEventList( Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString",formatA);
+        params.put("alarmEndDateString",formatD);
+        if (StringUtilsWork.isNotEmpty( (String) params1.get("alarmStartDateString"))){
+            params.put("alarmStartDateString",(String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString",(String) params1.get("alarmEndDateString"));
+        }
+        params.put("pageNum",(Integer)params1.get("pageNum"));
+        params.put("pageSize",(Integer)params1.get("pageSize"));
+        params.put("alarmType",303);
+        params.put("dbType",0);
+        params.put("deviceCategory",1);
+        String[]  nodeCodeList=  new String[68];
+        nodeCodeList[0]="1002874$1$0$0";
+        nodeCodeList[1]="1002875$1$0$0";
+        nodeCodeList[0]="1002876$1$0$0";
+        nodeCodeList[0]="1002877$1$0$0";
+        nodeCodeList[0]="1002878$1$0$0";
+        nodeCodeList[0]="1002879$1$0$0";
+        nodeCodeList[0]="1002880$1$0$0";
+        nodeCodeList[0]="1002881$1$0$0";
+        nodeCodeList[0]="1002882$1$0$0";
+        nodeCodeList[0]="1002883$1$0$0";
+        nodeCodeList[10]="1002884$1$0$0";
+        nodeCodeList[11]="1002885$1$0$0";
+        nodeCodeList[12]="1002886$1$0$0";
+        nodeCodeList[13]="1002887$1$0$0";
+        nodeCodeList[14]="1002888$1$0$0";
+        nodeCodeList[15]="1002889$1$0$0";
+        nodeCodeList[16]="1002890$1$0$0";
+        nodeCodeList[17]="1002891$1$0$0";
+        nodeCodeList[18]="1002892$1$0$0";
+        nodeCodeList[19]="1002893$1$0$0";
+        nodeCodeList[20]="1002894$1$0$0";
+        nodeCodeList[21]="1002895$1$0$0";
+        nodeCodeList[22]="1002896$1$0$0";
+        nodeCodeList[23]="1002897$1$0$0";
+        nodeCodeList[24]="1002898$1$0$0";
+        nodeCodeList[25]="1002899$1$0$0";
+        nodeCodeList[26]="1002900$1$0$0";
+        nodeCodeList[27]= "1002901$1$0$0";
+        nodeCodeList[28]="1002902$1$0$0";
+        nodeCodeList[29]="1002903$1$0$0";
+        nodeCodeList[30]="1002904$1$0$0";
+        nodeCodeList[31]="1002905$1$0$0";
+        nodeCodeList[32]="1002906$1$0$0";
+        nodeCodeList[33]="1002907$1$0$0";
+        nodeCodeList[34]="1002908$1$0$0";
+        nodeCodeList[35]="1002909$1$0$0";
+        nodeCodeList[36]="1002910$1$0$0";
+        nodeCodeList[37]="1002911$1$0$0";
+        nodeCodeList[38]="1002912$1$0$0";
+        nodeCodeList[39]="1002913$1$0$0";
+        nodeCodeList[40]="1002939$1$0$0";
+        nodeCodeList[41]="1002939$1$0$1";
+        nodeCodeList[42]="1002939$1$0$2";
+        nodeCodeList[43]="1002939$1$0$3";
+        nodeCodeList[44]="1002939$1$0$4";
+        nodeCodeList[45]="1002939$1$0$5";
+        nodeCodeList[46]="1002939$1$0$6";
+        nodeCodeList[47]="1002939$1$0$7";
+        nodeCodeList[48]="1002939$1$0$8";
+        nodeCodeList[49]="1002939$1$0$9";
+        nodeCodeList[50]="1002940$1$0$0";
+        nodeCodeList[51]="1002940$1$0$1";
+        nodeCodeList[52]="1002940$1$0$2";
+        nodeCodeList[53]="1002940$1$0$3";
+        nodeCodeList[54]="1002940$1$0$4";
+        nodeCodeList[55]="1002940$1$0$5";
+        nodeCodeList[56]="1002940$1$0$6";
+        nodeCodeList[57]="1002940$1$0$7";
+        nodeCodeList[58]="1002939$1$0$10";
+        nodeCodeList[59]="1002939$1$0$11";
+        nodeCodeList[60]="1002939$1$0$12";
+        nodeCodeList[61]="1002939$1$0$13";
+        nodeCodeList[62]="1002939$1$0$14";
+        nodeCodeList[63]="1002939$1$0$15";
+        //洗消
+        nodeCodeList[64]="1002871$1$0$0";
+        nodeCodeList[65]="1002872$1$0$0";
+        nodeCodeList[66]="1002873$1$0$0";
+        //大门
+        nodeCodeList[67]="1003442$1$0$0";
+
+
+        params.put("nodeCodeList",nodeCodeList);
+        // String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page"; //获取事件URL    post请求
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return    generalResponse;
+    }
+
+
+    public String CountTimes(Map<String, Object> params1 ) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString",formatA);
+        params.put("alarmEndDateString",formatD);
+        if (StringUtilsWork.isNotEmpty( (String) params1.get("alarmStartDateString"))){
+            params.put("alarmStartDateString",(String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString",(String) params1.get("alarmEndDateString"));
+        }
+        params.put("alarmType",303);
+        params.put("dbType",0);
+        params.put("deviceCategory",1);
+        String[]  nodeCodeList=  new String[68];
+        nodeCodeList[0]="1002874$1$0$0";
+        nodeCodeList[1]="1002875$1$0$0";
+        nodeCodeList[0]="1002876$1$0$0";
+        nodeCodeList[0]="1002877$1$0$0";
+        nodeCodeList[0]="1002878$1$0$0";
+        nodeCodeList[0]="1002879$1$0$0";
+        nodeCodeList[0]="1002880$1$0$0";
+        nodeCodeList[0]="1002881$1$0$0";
+        nodeCodeList[0]="1002882$1$0$0";
+        nodeCodeList[0]="1002883$1$0$0";
+        nodeCodeList[10]="1002884$1$0$0";
+        nodeCodeList[11]="1002885$1$0$0";
+        nodeCodeList[12]="1002886$1$0$0";
+        nodeCodeList[13]="1002887$1$0$0";
+        nodeCodeList[14]="1002888$1$0$0";
+        nodeCodeList[15]="1002889$1$0$0";
+        nodeCodeList[16]="1002890$1$0$0";
+        nodeCodeList[17]="1002891$1$0$0";
+        nodeCodeList[18]="1002892$1$0$0";
+        nodeCodeList[19]="1002893$1$0$0";
+        nodeCodeList[20]="1002894$1$0$0";
+        nodeCodeList[21]="1002895$1$0$0";
+        nodeCodeList[22]="1002896$1$0$0";
+        nodeCodeList[23]="1002897$1$0$0";
+        nodeCodeList[24]="1002898$1$0$0";
+        nodeCodeList[25]="1002899$1$0$0";
+        nodeCodeList[26]="1002900$1$0$0";
+        nodeCodeList[27]= "1002901$1$0$0";
+        nodeCodeList[28]="1002902$1$0$0";
+        nodeCodeList[29]="1002903$1$0$0";
+        nodeCodeList[30]="1002904$1$0$0";
+        nodeCodeList[31]="1002905$1$0$0";
+        nodeCodeList[32]="1002906$1$0$0";
+        nodeCodeList[33]="1002907$1$0$0";
+        nodeCodeList[34]="1002908$1$0$0";
+        nodeCodeList[35]="1002909$1$0$0";
+        nodeCodeList[36]="1002910$1$0$0";
+        nodeCodeList[37]="1002911$1$0$0";
+        nodeCodeList[38]="1002912$1$0$0";
+        nodeCodeList[39]="1002913$1$0$0";
+        nodeCodeList[40]="1002939$1$0$0";
+        nodeCodeList[41]="1002939$1$0$1";
+        nodeCodeList[42]="1002939$1$0$2";
+        nodeCodeList[43]="1002939$1$0$3";
+        nodeCodeList[44]="1002939$1$0$4";
+        nodeCodeList[45]="1002939$1$0$5";
+        nodeCodeList[46]="1002939$1$0$6";
+        nodeCodeList[47]="1002939$1$0$7";
+        nodeCodeList[48]="1002939$1$0$8";
+        nodeCodeList[49]="1002939$1$0$9";
+        nodeCodeList[50]="1002940$1$0$0";
+        nodeCodeList[51]="1002940$1$0$1";
+        nodeCodeList[52]="1002940$1$0$2";
+        nodeCodeList[53]="1002940$1$0$3";
+        nodeCodeList[54]="1002940$1$0$4";
+        nodeCodeList[55]="1002940$1$0$5";
+        nodeCodeList[56]="1002940$1$0$6";
+        nodeCodeList[57]="1002940$1$0$7";
+        nodeCodeList[58]="1002939$1$0$10";
+        nodeCodeList[59]="1002939$1$0$11";
+        nodeCodeList[60]="1002939$1$0$12";
+        nodeCodeList[61]="1002939$1$0$13";
+        nodeCodeList[62]="1002939$1$0$14";
+        nodeCodeList[63]="1002939$1$0$15";
+        //洗消
+        nodeCodeList[64]="1002871$1$0$0";
+        nodeCodeList[65]="1002872$1$0$0";
+        nodeCodeList[66]="1002873$1$0$0";
+        //大门
+        nodeCodeList[67]="1003442$1$0$0";
+
+        params.put("nodeCodeList",nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL ;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+}
+

+ 126 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/ClientPersonManageController.java

@@ -0,0 +1,126 @@
+package com.huimv.video.dhicc.ClientController;
+
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+import java.util.Map;
+
+@RestController
+@RequestMapping("person")
+
+public class ClientPersonManageController {
+
+    /*
+         * @param params
+         *   下面是前端提交的参数 直接让她写死了   这个是查不同部门的人的接口
+         *{searchKey: "", pageNum: 1, pageSize: 10, departmentId: 4, isContain: true, statusList: [1, 2]}      维修部门
+          {searchKey: "", pageNum: 1, pageSize: 10, departmentId: 2, isContain: true, statusList: [1, 2]}      技术部门
+          {searchKey: "", pageNum: 1, pageSize: 10, departmentId: 5, isContain: true, statusList: [1, 2]}      基层部门
+         * @return
+         * @throws ClientException
+         */
+    @RequestMapping("/ge_person_list")
+    public GeneralResponse ge_person_list ( @RequestBody Map<String, Object> params ) throws ClientException {
+        String URL = "/evo-apigw/evo-brm/1.2.0/person/page; "  ;  // 人员列表的接口
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+    /**
+     * 人员通行记录 ---测试通过  ---参数说明见大华官网 https://open-icc.dahuatech.com/#/
+     * 此处只做了代理
+     *pageNum              	是	Integer	当前页
+     * pageSize	            是	Integer	分页大小
+     * startSwingTime	    否	String	查询开始时间
+     * endSwingTime	        否	String	查询结束时间
+     * openType          	否	Integer	开门类型
+     * category	           否	String	卡片类型, null-全部, 0-IC卡, 1-有源RFID, 2-CPU卡
+     * personName          	否	String	人员名称
+     * personCode	        否	String	人员编号
+     * channelCode	       否	String	通道编码
+     * deptIds	           否	String	部门ID, 部门间”, “分隔
+     * cardNumber       	否	String	卡号
+     * enterOrExit       	否	String	事件类型, null-全部, 1-进门, 2出门, 3-进/出门
+     * openResult	        否	Integer	开门结果, null-全部, 1-成功, 0-失败
+     * @param params
+     * @return
+     * @throws ClientException
+     */
+
+    @RequestMapping("/get_person_record")
+    public GeneralResponse getAccidentRecord( @RequestBody Map<String, Object> params ) throws ClientException {
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+   //总页数
+    @RequestMapping("/get_person_record_totalpage")
+    public GeneralResponse get_person_record_totalpage( @RequestBody Map<String, Object> params ) throws ClientException {
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String NewUrl = URL + aLong;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+    @RequestMapping("/get_person_detail")
+    public GeneralResponse getPersonDetail( @RequestBody Map<String, Object> params ) throws ClientException {
+        String URL = "/evo-apigw/evo-accesscontrol/${version}/card/accessControl/swingCardRecord/19241";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String URL_id = URL + params.get("id");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(URL_id, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+
+
+
+
+}

+ 103 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/GetPicture.java

@@ -0,0 +1,103 @@
+package com.huimv.video.dhicc.ClientController;
+
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.http.IccTokenResponse;
+import com.dahuatech.icc.oauth.profile.IccProfile;
+import com.huimv.common.utils.StringUtilsWork;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.net.ssl.SSLContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import static com.huimv.video.dhicc.icc.CommonConstant.IPAndPort;
+
+
+@RestController
+@RequestMapping("/picture")
+public class GetPicture {
+    @RequestMapping("/get")
+    public  void   getCarRecord(HttpServletRequest request, HttpServletResponse response  ,
+                               @RequestParam(name = "fileUrl" ,required = false) String fileUrl,
+                               @RequestParam(name = "alarmPicture", required = false) String alarmPicture
+                          ) throws IOException, ClientException {
+        String url;
+        IClient iClient = new DefaultClient();
+        //如果 fileURL不为空  就认为是拿摄像头抓拍图片
+        if(StringUtilsWork.isNotEmpty(fileUrl)){
+            url =IPAndPort+"/evo-apigw/ipms/imageConvert/originalImage?fileUrl="+fileUrl;
+        }else {
+            //IccProfile 授权类型,根据你的初始化使用的password,client_credentials
+            IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
+            url =IPAndPort+"/evo-pic/"+alarmPicture+"?token="+token.getAccess_token()+"&oss_addr=172.16.3.223:8925";
+        }
+        HttpResponse httpResponse = null;
+        try {
+            CloseableHttpClient buildSSLCloseableHttpClient = buildSSLCloseableHttpClient();
+            System.setProperty("jsse.enableSNIExtension", "false");
+            HttpGet httpGet = new HttpGet(url);
+            httpResponse = buildSSLCloseableHttpClient.execute(httpGet);
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        System.out.println("返回图片");
+        //response.setContentLength(285390);
+        response.setHeader("Content-Type"," image/jpeg");
+        response.setHeader("Accept-Ranges","bytes");
+        InputStream content = httpResponse.getEntity().getContent();
+        OutputStream out = null;
+        try {
+            out = response.getOutputStream();
+            int len = 0;
+            byte[] b = new byte[1024];
+            while ((len = content.read(b)) != -1) {
+                out.write(b, 0, len);
+            }
+            out.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private static CloseableHttpClient buildSSLCloseableHttpClient()
+            throws Exception {
+        SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null,
+                new TrustStrategy() {
+                    // 信任所有
+                    public boolean isTrusted(X509Certificate[] chain,
+                                             String authType) throws CertificateException {
+                        return true;
+                    }
+                }).build();
+        SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
+                sslContext, new String[] { "TLSv1.2" }, null,
+                SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+        return HttpClients.custom().setSSLSocketFactory(sslsf).build();
+    }
+
+}

+ 26 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ClientController/GetToken.java

@@ -0,0 +1,26 @@
+package com.huimv.video.dhicc.ClientController;
+
+
+import com.dahuatech.icc.exception.ClientException;
+import com.huimv.video.dhicc.icc.IccUtil;
+import com.huimv.video.dhicc.result.R;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * 事件信息的最终端口*/
+@RestController
+@RequestMapping("token")
+
+public class GetToken {
+        @RequestMapping("/getToken")
+        public R getAccidentRecordPicture(HttpServletRequest request
+        ) throws ClientException {
+            String token = new IccUtil().getToken();
+            return  R.ok("请求成功").put("token",token)   ;
+        }
+    }
+
+

+ 71 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenAlarmCountByDay.java

@@ -0,0 +1,71 @@
+package com.huimv.video.dhicc.ScreenController;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.dahuatech.icc.exception.ClientException;
+
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import com.huimv.video.dhicc.util.GetResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+
+@RestController
+@RequestMapping("/screen/alarmCount")
+
+public class ScreenAlarmCountByDay {
+
+    @Autowired
+    private ISysTelecomEventService sysTelecomEventService;
+
+
+     //四种事件统计
+    @RequestMapping("/CountByDay")
+    public R AlarmCountByDay(HttpServletRequest request) throws ClientException {
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.add(Calendar.DATE, -7);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        List result = new ArrayList();
+
+        //洗消 一周
+        Map map1 = new HashMap();
+        map1.put("name", "车辆洗消");
+        map1.put("value", getResponse.SendMassageXixiaoPerson(formatB, formatA));
+        //人员通过一周---异常
+        Map map2 = new HashMap();
+        map2.put("name", "人员违规");
+        map2.put("value", getResponse.SendMassageGetPagePersonAlarm(formatB, formatA));
+        //车辆一周
+        Map map3 = new HashMap();
+        map3.put("name","死猪运输");
+        map3.put("value", getResponse.SendMassageSiZhuRecord(formatB, formatA));
+        //烘干事件一周
+        Map map4 = new HashMap();
+        map4.put("name", "车辆烘干");
+        map4.put("value", sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatB, formatA))+"");
+        result.add(map1);
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        //翻转
+        Collections.reverse(result);
+        return R.ok("请求成功").put("data", result);
+
+
+    }
+}

+ 142 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenCarController.java

@@ -0,0 +1,142 @@
+package com.huimv.video.dhicc.ScreenController;
+
+
+import com.dahuatech.icc.exception.ClientException;
+
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/screen/car")
+
+//没有连接ICC的数据库 所以操作比较麻烦
+public class ScreenCarController {
+
+
+    //过车的数据//这个是车辆闸机的过车数据
+    /**
+     * 应该优化一下放到表里面去  不然的话这样请求一整页的数据会很慢
+     * 保存ntamade
+     * 通过开始结束时间来查页数
+     * &queryTimeBegin=2021-12-01+00%3A00%3A00&
+     * queryTimeEnd=2021-12-01+23%3A59%3A59&
+     */
+    // https://36.26.62.70:447/evo-apigw/ipms/carcapture/find/conditions?pageNum=1&pageSize=10&queryTimeBegin=2021-12-01+00%3A00%3A00&queryTimeEnd=2021-12-01+23%3A59%3A59&_=1638356246174
+    @RequestMapping("/count_car_record")
+    public R ddgetCarRecord(HttpServletRequest request ) throws ClientException {
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.DATE, +1);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.DATE, -1);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        c.add(Calendar.DATE, -1);
+        Date C = c.getTime();
+        String formatC = format.format(C);
+
+        c.add(Calendar.DATE, -1);
+        Date D = c.getTime();
+        String formatD = format.format(D);
+
+        c.add(Calendar.DATE, -1);
+        Date E = c.getTime();
+        String formatE = format.format(E);
+
+        c.add(Calendar.DATE, -1);
+        Date F = c.getTime();
+        String formatF = format.format(F);
+
+        c.add(Calendar.DATE, -1);
+        Date G = c.getTime();
+        String formatG = format.format(G);
+
+        c.add(Calendar.DATE, -1);
+        Date H = c.getTime();
+        String formatH = format.format(H);
+
+        List result = new ArrayList();
+
+        Map map1  = new HashMap();
+        map1.put("time",splitTime(B));
+        map1.put("value",getResponse.SendMassageGetPage( formatB , formatA ));
+
+        Map map2  = new HashMap();
+        map2.put("time",splitTime(C));
+        map2.put("value",getResponse.SendMassageGetPage( formatC , formatB));
+
+        Map map3  = new HashMap();
+        map3.put("time",splitTime(D));
+        map3.put("value",getResponse.SendMassageGetPage(formatD, formatC));
+
+        Map map4  = new HashMap();
+        map4.put("time",splitTime(E));
+        map4.put("value",getResponse.SendMassageGetPage(formatE , formatD));
+
+
+        Map map5  = new HashMap();
+        map5.put("time",splitTime(F));
+        map5.put("value",getResponse.SendMassageGetPage( formatF , formatE));
+
+
+        Map map6  = new HashMap();
+        map6.put("time",splitTime(G));
+        map6.put("value",getResponse.SendMassageGetPage( formatG , formatF));
+
+        Map map7  = new HashMap();
+        map7.put("time",splitTime(H));
+        map7.put("value",getResponse.SendMassageGetPage(formatH , formatG));
+
+        result.add(map1);
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        result.add(map5);
+        result.add(map6);
+        result.add(map7);
+        //翻转
+        Collections.reverse(result);
+        return  R.ok("请求成功").put("data", result );
+    }
+
+    public String splitTime(Date date){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        String date1 = calendar.get(Calendar.MONTH)+1+"/"+calendar.get(Calendar.DATE);
+        return date1;
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 64 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenIndexDataController.java

@@ -0,0 +1,64 @@
+package com.huimv.video.dhicc.ScreenController;
+
+
+import com.dahuatech.icc.exception.ClientException;
+
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/screen/index")
+public class ScreenIndexDataController {
+
+ //返回大屏首页的数据
+    @RequestMapping("/dataList")
+    public R indexDataList(HttpServletRequest request ) throws ClientException, ParseException {
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+         Map map  = new HashMap<>();
+             Calendar c = Calendar.getInstance();
+             Date date = new Date();
+             c.setTime(date);
+             c.set(Calendar.HOUR_OF_DAY, 0);
+             c.set(Calendar.MINUTE, 0);
+             c.set(Calendar.SECOND, 0);
+
+             c.add(Calendar.DATE, +1);
+             Date A = c.getTime();
+             String formatA = format.format(A);
+
+             c.add(Calendar.DATE, -1);
+             Date B = c.getTime();
+             String formatB = format.format(B);
+
+             c.add(Calendar.DATE, -6);
+             Date C = c.getTime();
+             String formatC = format.format(C);
+
+             System.out.println(formatA+formatB);
+             map.put("personPassSuccess",getResponse.SendMassageGetPagePerson( formatB , formatA ));
+             map.put("personPassFail",getResponse.SendMassageGetPagePersonAlarm( formatB , formatA));
+             map.put("carPassOut",getResponse.SendMassageCarOut( formatB , formatA));
+             map.put("carPassIn",getResponse.SendMassageCarIn( formatB , formatA));
+             map.put("tadaySiZhu",getResponse.SendCountSiZhu( formatB , formatA));
+             map.put("SevenDaySiZhu",getResponse.SendCountSiZhu( formatC , formatA));
+             map.put("tadayXiXiao",getResponse.SendMassageXixiaoPerson(formatB , formatA));
+             map.put("SevenDayXIxiao",getResponse.SendMassageXixiaoPerson(formatC , formatA));
+             map.put("SevenDayGate",getResponse.SendMassageGateCount(formatC , formatA));
+             map.put("tadayGate",getResponse.SendMassageGateCount(formatB, formatA));
+
+         //车分一下  进和出
+        return  R.ok("请求成功").put("data", map );
+
+    }
+}

+ 145 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenPersonController.java

@@ -0,0 +1,145 @@
+package com.huimv.video.dhicc.ScreenController;
+
+
+import com.dahuatech.icc.exception.ClientException;
+
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/screen/person")
+public class ScreenPersonController {
+
+    @RequestMapping("/count_person_record")
+    public R ddgetCarRecord(HttpServletRequest request ) throws ClientException, ParseException {
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.HOUR, +2);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.HOUR, -2);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        c.add(Calendar.HOUR, -2);
+        Date C = c.getTime();
+        String formatC = format.format(C);
+
+        c.add(Calendar.HOUR, -2);
+        Date D = c.getTime();
+        String formatD = format.format(D);
+
+        c.add(Calendar.HOUR, -2);
+        Date E = c.getTime();
+        String formatE = format.format(E);
+
+        c.add(Calendar.HOUR, -2);
+        Date F = c.getTime();
+        String formatF = format.format(F);
+
+        c.add(Calendar.HOUR, -2);
+        Date G = c.getTime();
+        String formatG = format.format(G);
+
+        c.add(Calendar.HOUR, -2);
+        Date H = c.getTime();
+        String formatH = format.format(H);
+
+        List result = new ArrayList();
+
+        Map map1  = new HashMap();
+        map1.put("time",splitTimeByHoure(B));
+        map1.put("value",getResponse.SendMassageGetPage( formatB , formatA ));
+
+        Map map2  = new HashMap();
+        map2.put("time",splitTimeByHoure(C));
+        map2.put("value",getResponse.SendMassageGetPage( formatC , formatB));
+
+        Map map3  = new HashMap();
+        map3.put("time",splitTimeByHoure(D));
+        map3.put("value",getResponse.SendMassageGetPage(formatD, formatC));
+
+        Map map4  = new HashMap();
+        map4.put("time",splitTimeByHoure(E));
+        map4.put("value",getResponse.SendMassageGetPage(formatE , formatD));
+
+
+        Map map5  = new HashMap();
+        map5.put("time",splitTimeByHoure(F));
+        map5.put("value",getResponse.SendMassageGetPage( formatF , formatE));
+
+
+        Map map6  = new HashMap();
+        map6.put("time",splitTimeByHoure(G));
+        map6.put("value",getResponse.SendMassageGetPage( formatG , formatF));
+
+        Map map7  = new HashMap();
+        map7.put("time",splitTimeByHoure(H));
+        map7.put("value",getResponse.SendMassageGetPage(formatH , formatG));
+
+        result.add(map1);
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        result.add(map5);
+        result.add(map6);
+        result.add(map7);
+        //翻转
+        Collections.reverse(result);
+        return  R.ok("请求成功").put("data", result );
+    }
+
+
+     //人员正常通行与异常通行的数据
+    @RequestMapping("/count_person_record_fail_success")
+    public  R  count_person_record_fail_success(HttpServletRequest request ) throws ClientException, ParseException {
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.DATE, +1);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.DATE, -1);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        System.out.println(formatA+formatB);
+
+        Map map1  = new HashMap();
+        map1.put("value1",getResponse.SendMassageGetPagePerson( formatB , formatA ));
+        map1.put("value2",getResponse.SendMassageGetPagePersonAlarm( formatB , formatA));
+
+        System.out.println();
+        return  R.ok("请求成功").put("data", map1 );
+
+    }
+
+
+    public String splitTimeByHoure(Date date) throws ParseException {
+        SimpleDateFormat df = new SimpleDateFormat("HH:mm");//设置日期格式,这里只取出小时和分钟
+        String format = df.format(date);
+        return format;
+    }
+
+}

+ 311 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/ScreenController/ScreenSiZhuController.java

@@ -0,0 +1,311 @@
+package com.huimv.video.dhicc.ScreenController;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import net.sf.json.JSONObject;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/screen/sizhu")
+
+public class ScreenSiZhuController {
+        /**
+         * xuyao   直接都写在这里了
+         *
+         * @param request
+         * @return
+         * @throws ClientException
+         * @throws ParseException
+         */
+        @RequestMapping("/count_sizhu_record")
+        public R count_sizhu_record(HttpServletRequest request) throws ClientException, ParseException {
+            List result = new ArrayList();
+            Map map1 = new HashMap();
+            map1.put("value1", getPastSevenDay());
+            map1.put("value2", getDay());
+            map1.put("value3", getLatestOne());
+            return R.ok("请求成功").put("data", map1);
+        }
+
+
+
+
+
+    /**
+     * xuyao   直接都写在这里了
+     *
+     * @param request
+     * @return  查询事件
+     * @throws ClientException
+     * @throws ParseException
+     * 写一个查左右的  事件都拿过来 存起来 建新的表来处理
+     */
+    @RequestMapping("/SiZhuList")
+    public R SiZhuList(HttpServletRequest request) throws ClientException, ParseException {
+        return R.ok("请求成功").put("data", getSiZhuList());
+    }
+
+
+         //过去七天的值
+        public String getPastSevenDay(  ) throws ClientException {
+            GetResponse getResponse = new GetResponse();
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Calendar c = Calendar.getInstance();
+            Date date = new Date();
+            c.setTime(date);
+            c.set(Calendar.MINUTE, 0);
+            c.set(Calendar.SECOND, 0);
+
+            c.add(Calendar.DATE, 0);
+            Date A = c.getTime();
+            String formatA = format.format(A);
+            c.add(Calendar.DATE, -7);
+            Date B = c.getTime();
+            String formatB = format.format(B);
+            return  getResponse.SendMassageXixiaoPerson(formatB, formatA);
+        }
+
+
+         //今天的数据
+         public String getDay() throws ClientException {
+             GetResponse getResponse = new GetResponse();
+             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+             Calendar c = Calendar.getInstance();
+             Date date = new Date();
+             c.setTime(date);
+             c.set(Calendar.MINUTE, 0);
+             c.set(Calendar.SECOND, 0);
+
+             c.add(Calendar.DATE, 0);
+             Date A = c.getTime();
+             String formatA = format.format(A);
+             c.add(Calendar.DATE, -1);
+             Date B = c.getTime();
+             String formatB = format.format(B);
+             return  getResponse.SendMassageXixiaoPerson(formatB, formatA);
+         }
+
+
+             //最新一条的数据
+             public String getLatestOne( ) throws ClientException {
+                 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                 Calendar c = Calendar.getInstance();
+                 Date date = new Date();
+                 c.setTime(date);
+                 c.set(Calendar.HOUR, 0);
+                 c.set(Calendar.MINUTE, 0);
+                 c.set(Calendar.SECOND, 0);
+                 Date A = c.getTime();
+                 String formatA = format.format(A);
+                 c.set(Calendar.HOUR, +24);
+                 Date d = c.getTime();
+                 String formatD = format.format(d);
+                 Map<String, Object> params = new HashMap<>();
+                 params.put("alarmStartDateString",formatA);
+                 params.put("alarmEndDateString",formatD);
+                 params.put("pageNum",1);
+                 params.put("pageSize",1);
+                 params.put("alarmType",303);
+                 params.put("dbType",0);
+                 params.put("deviceCategory",1);
+                 String[]  nodeCodeList=  new String[64];
+                 nodeCodeList[0]="1002874$1$0$0"    ;
+                 nodeCodeList[1]="1002875$1$0$0"      ;
+                 nodeCodeList[0]="1002876$1$0$0"     ;
+                 nodeCodeList[0]="1002877$1$0$0"       ;
+                 nodeCodeList[0]="1002878$1$0$0"      ;
+                 nodeCodeList[0]="1002879$1$0$0"     ;
+                 nodeCodeList[0]="1002880$1$0$0"      ;
+                 nodeCodeList[0]="1002881$1$0$0"      ;
+                 nodeCodeList[0]="1002882$1$0$0"     ;
+                 nodeCodeList[0]="1002883$1$0$0"    ;
+                 nodeCodeList[10]="1002884$1$0$0"   ;
+                 nodeCodeList[11]="1002885$1$0$0"   ;
+                 nodeCodeList[12]="1002886$1$0$0"      ;
+                 nodeCodeList[13]="1002887$1$0$0"     ;
+                 nodeCodeList[14]="1002888$1$0$0"     ;
+                 nodeCodeList[15]="1002889$1$0$0"   ;
+                 nodeCodeList[16]="1002890$1$0$0"   ;
+                 nodeCodeList[17]="1002891$1$0$0"   ;
+                 nodeCodeList[18]="1002892$1$0$0"   ;
+                 nodeCodeList[19]="1002893$1$0$0"     ;
+                 nodeCodeList[20]="1002894$1$0$0"     ;
+                 nodeCodeList[21]="1002895$1$0$0"    ;
+                 nodeCodeList[22]="1002896$1$0$0"      ;
+                 nodeCodeList[23]="1002897$1$0$0"      ;
+                 nodeCodeList[24]="1002898$1$0$0"   ;
+                 nodeCodeList[25]="1002899$1$0$0"     ;
+                 nodeCodeList[26]="1002900$1$0$0"      ;
+                 nodeCodeList[27]= "1002901$1$0$0"     ;
+                 nodeCodeList[28]="1002902$1$0$0"       ;
+                 nodeCodeList[29]="1002903$1$0$0"     ;
+                 nodeCodeList[30]="1002904$1$0$0"     ;
+                 nodeCodeList[31]="1002905$1$0$0"    ;
+                 nodeCodeList[32]="1002906$1$0$0"     ;
+                 nodeCodeList[33]="1002907$1$0$0"     ;
+                 nodeCodeList[34]="1002908$1$0$0"     ;
+                 nodeCodeList[35]="1002909$1$0$0"    ;
+                 nodeCodeList[36]="1002910$1$0$0"     ;
+                 nodeCodeList[37]="1002911$1$0$0"    ;
+                 nodeCodeList[38]="1002912$1$0$0"    ;
+                 nodeCodeList[39]="1002913$1$0$0"    ;
+                 nodeCodeList[40]="1002939$1$0$0"     ;
+                 nodeCodeList[41]="1002939$1$0$1"   ;
+                 nodeCodeList[42]="1002939$1$0$2"   ;
+                 nodeCodeList[43]="1002939$1$0$3"    ;
+                 nodeCodeList[44]="1002939$1$0$4"    ;
+                 nodeCodeList[45]="1002939$1$0$5"     ;
+                 nodeCodeList[46]="1002939$1$0$6"      ;
+                 nodeCodeList[47]="1002939$1$0$7"   ;
+                 nodeCodeList[48]="1002939$1$0$8"   ;
+                 nodeCodeList[49]="1002939$1$0$9"    ;
+                 nodeCodeList[50]="1002940$1$0$0"     ;
+                 nodeCodeList[51]="1002940$1$0$1"   ;
+                 nodeCodeList[52]="1002940$1$0$2";
+                 nodeCodeList[53]="1002940$1$0$3";
+                 nodeCodeList[54]="1002940$1$0$4";
+                 nodeCodeList[55]="1002940$1$0$5";
+                 nodeCodeList[56]="1002940$1$0$6";
+                 nodeCodeList[57]="1002940$1$0$7";
+                 nodeCodeList[58]="1002939$1$0$10";
+                 nodeCodeList[59]="1002939$1$0$11";
+                 nodeCodeList[60]="1002939$1$0$12";
+                 nodeCodeList[61]="1002939$1$0$13";
+                 nodeCodeList[62]="1002939$1$0$14";
+                 nodeCodeList[63]="1002939$1$0$15";
+                 params.put("nodeCodeList",nodeCodeList);
+                 String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page"; //获取事件URL    post请求
+                 IClient iClient = new DefaultClient();
+                 String NewUrl = URL ;
+                 //这种已经在配置文件里面安排了账号ip以及密码
+                 GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+                 System.out.println(NewUrl);
+                 generalRequest.header("Content-Type", " application/json");
+                 generalRequest.body(JSON.toJSONString(params));
+                 GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+                 JSONObject jsondata = (JSONObject)  JSONObject.fromObject(generalResponse.getResult()).get("data");
+                 JSONObject jsonObject1 = JSONObject.fromObject(jsondata.get("pageData").toString().substring(1, jsondata.get("pageData").toString().length() - 1));
+                 Object alarmDate = jsonObject1.get("alarmDate");
+                return alarmDate.toString();
+             }
+
+
+
+    //返回所有的死猪事件
+    public GeneralResponse getSiZhuList( ) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString",formatA);
+        params.put("alarmEndDateString",formatD);
+        params.put("pageNum",1);
+        params.put("pageSize",10);
+        params.put("alarmType",303);
+        params.put("dbType",0);
+        params.put("deviceCategory",1);
+        String[]  nodeCodeList=  new String[64];
+        nodeCodeList[0]="1002874$1$0$0";
+        nodeCodeList[1]="1002875$1$0$0";
+        nodeCodeList[0]="1002876$1$0$0";
+        nodeCodeList[0]="1002877$1$0$0";
+        nodeCodeList[0]="1002878$1$0$0";
+        nodeCodeList[0]="1002879$1$0$0";
+        nodeCodeList[0]="1002880$1$0$0";
+        nodeCodeList[0]="1002881$1$0$0";
+        nodeCodeList[0]="1002882$1$0$0";
+        nodeCodeList[0]="1002883$1$0$0";
+        nodeCodeList[10]="1002884$1$0$0";
+        nodeCodeList[11]="1002885$1$0$0";
+        nodeCodeList[12]="1002886$1$0$0";
+        nodeCodeList[13]="1002887$1$0$0";
+        nodeCodeList[14]="1002888$1$0$0";
+        nodeCodeList[15]="1002889$1$0$0";
+        nodeCodeList[16]="1002890$1$0$0";
+        nodeCodeList[17]="1002891$1$0$0";
+        nodeCodeList[18]="1002892$1$0$0";
+        nodeCodeList[19]="1002893$1$0$0";
+        nodeCodeList[20]="1002894$1$0$0";
+        nodeCodeList[21]="1002895$1$0$0";
+        nodeCodeList[22]="1002896$1$0$0";
+        nodeCodeList[23]="1002897$1$0$0";
+        nodeCodeList[24]="1002898$1$0$0";
+        nodeCodeList[25]="1002899$1$0$0";
+        nodeCodeList[26]="1002900$1$0$0";
+        nodeCodeList[27]= "1002901$1$0$0";
+        nodeCodeList[28]="1002902$1$0$0";
+        nodeCodeList[29]="1002903$1$0$0";
+        nodeCodeList[30]="1002904$1$0$0";
+        nodeCodeList[31]="1002905$1$0$0";
+        nodeCodeList[32]="1002906$1$0$0";
+        nodeCodeList[33]="1002907$1$0$0";
+        nodeCodeList[34]="1002908$1$0$0";
+        nodeCodeList[35]="1002909$1$0$0";
+        nodeCodeList[36]="1002910$1$0$0"     ;
+        nodeCodeList[37]="1002911$1$0$0"    ;
+        nodeCodeList[38]="1002912$1$0$0"    ;
+        nodeCodeList[39]="1002913$1$0$0"    ;
+        nodeCodeList[40]="1002939$1$0$0"     ;
+        nodeCodeList[41]="1002939$1$0$1"   ;
+        nodeCodeList[42]="1002939$1$0$2"   ;
+        nodeCodeList[43]="1002939$1$0$3"    ;
+        nodeCodeList[44]="1002939$1$0$4"    ;
+        nodeCodeList[45]="1002939$1$0$5"     ;
+        nodeCodeList[46]="1002939$1$0$6"      ;
+        nodeCodeList[47]="1002939$1$0$7"   ;
+        nodeCodeList[48]="1002939$1$0$8"   ;
+        nodeCodeList[49]="1002939$1$0$9"    ;
+        nodeCodeList[50]="1002940$1$0$0"     ;
+        nodeCodeList[51]="1002940$1$0$1"   ;
+        nodeCodeList[52]="1002940$1$0$2";
+        nodeCodeList[53]="1002940$1$0$3";
+        nodeCodeList[54]="1002940$1$0$4";
+        nodeCodeList[55]="1002940$1$0$5";
+        nodeCodeList[56]="1002940$1$0$6";
+        nodeCodeList[57]="1002940$1$0$7";
+        nodeCodeList[58]="1002939$1$0$10";
+        nodeCodeList[59]="1002939$1$0$11";
+        nodeCodeList[60]="1002939$1$0$12";
+        nodeCodeList[61]="1002939$1$0$13";
+        nodeCodeList[62]="1002939$1$0$14";
+        nodeCodeList[63]="1002939$1$0$15";
+        params.put("nodeCodeList",nodeCodeList);
+       // String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page"; //获取事件URL    post请求
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return    generalResponse;
+    }
+}
+
+
+

+ 34 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/BaseTelecomRoom.java

@@ -0,0 +1,34 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class BaseTelecomRoom extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "device_id")
+    private String deviceId;
+
+    private String deviceName;
+
+    private String deviceRoom;
+
+    private Integer farmId;
+
+
+}

+ 35 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/IccChannel.java

@@ -0,0 +1,35 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class IccChannel extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String channelName;
+
+    private String channelId;
+
+    private String remark;
+
+
+}

+ 96 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/IccEventRecord.java

@@ -0,0 +1,96 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class IccEventRecord extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer eventId;
+
+    @TableField("alarmStat")
+    private Integer alarmStat;
+
+    @TableField("alarmTypeName")
+    private String alarmTypeName;
+
+    @TableField("alarmDate")
+    private LocalDateTime alarmDate;
+
+    @TableField("handleStat")
+    private Integer handleStat;
+
+    @TableField("alarmCode")
+    private String alarmCode;
+
+    @TableField("orgName")
+    private String orgName;
+
+    @TableField("alarmPosition")
+    private Integer alarmPosition;
+
+    @TableField("linkNames")
+    private String linkNames;
+
+    @TableField("alarmGrade")
+    private Integer alarmGrade;
+
+    @TableField("nodeCode")
+    private String nodeCode;
+
+    @TableField("alarmType")
+    private Integer alarmType;
+
+    @TableField("isEvent")
+    private Integer isEvent;
+
+    @TableField("alarmPicture")
+    private String alarmPicture;
+
+    @TableField("deviceCategory")
+    private Integer deviceCategory;
+
+    @TableField("orgCode")
+    private String orgCode;
+
+    @TableField("taskWebName")
+    private String taskWebName;
+
+    @TableField("alarmWebUrl")
+    private String alarmWebUrl;
+
+    @TableField("alarmAppUrl")
+    private String alarmAppUrl;
+
+    @TableField("taskWebUrl")
+    private String taskWebUrl;
+
+    @TableField("taskAppUrl")
+    private String taskAppUrl;
+
+    private Integer handel;
+
+
+}

+ 45 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysTelecom.java

@@ -0,0 +1,45 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class SysTelecom extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer farmId;
+
+    private Date timestamp;
+
+    private String temp;
+
+    private Integer stc;
+
+    private Integer rssi;
+
+    private Integer humi;
+
+    private String deviceId;
+
+
+}

+ 40 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysTelecomEvent.java

@@ -0,0 +1,40 @@
+package com.huimv.video.dhicc.entity;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+
+//烘干事件生成的地方
+@Data
+@EqualsAndHashCode()
+@Accessors(chain = true)
+public class SysTelecomEvent {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer farmId;
+
+    private Integer eventId;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date eventTime;
+
+
+    private String deviceId;
+
+    private String remark;
+
+
+
+
+}

+ 19 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/TelecomDto.java

@@ -0,0 +1,19 @@
+package com.huimv.video.dhicc.entity;
+
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.Map;
+
+@Data
+public class TelecomDto {
+
+
+    private Date timestamp;
+
+    private String deviceId;
+
+    private Map<String, Integer> payload;
+
+}

+ 17 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/TelecomVo.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+@Data
+public class TelecomVo {
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date eventTime;
+
+    private String location;
+
+    private String deviceId;
+
+
+}

+ 20 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/CommonConstant.java

@@ -0,0 +1,20 @@
+package com.huimv.video.dhicc.icc;
+
+public class CommonConstant {
+
+    public static final String IPAndPort = "https://36.26.62.70:447";
+    //性别 0-女 1-男
+    public static final Integer GENDER_FEMALE = 0;
+    public static final Integer GENDER_MALE = 1;
+
+    //默认分页
+    //初始页面
+    public static final Integer PAGE_NUM = 1;
+    public static final String PAGE_NUM_STR = "1";
+
+
+    //一页数据量
+    public static final Integer PAGE_SIZE = 20;
+    public static final String PAGE_SIZE_STR = "20";
+
+}

+ 21 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/IccDemo.java

@@ -0,0 +1,21 @@
+package com.huimv.video.dhicc.icc;
+
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.http.IccTokenResponse;
+import com.dahuatech.icc.oauth.profile.GrantType;
+
+//测试拿token的接口
+public class IccDemo {
+
+    public static void main(String[] args) {
+        try {
+            IClient client = new DefaultClient("36.26.62.70:447", "huimv","1653d6c9-c611-4827-ac87-0bfd48deadd4");
+            IccTokenResponse.IccToken clientToken = client.getAccessToken(GrantType.client_credentials);
+            System.out.println(clientToken);
+        } catch (ClientException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 19 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/IccUtil.java

@@ -0,0 +1,19 @@
+package com.huimv.video.dhicc.icc;
+
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.http.IccTokenResponse;
+import com.dahuatech.icc.oauth.profile.IccProfile;
+
+public class IccUtil {
+    //获取token
+    public String getToken ()   throws ClientException {
+        IClient iClient = new DefaultClient();
+        //IccProfile 授权类型,根据你的初始化使用的password,client_credentials
+        IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
+        System.out.println(token);
+        System.out.println("获取到的Token为:"+token.getAccess_token());
+        return token.getAccess_token() ;
+    }
+}

+ 17 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/BaseTelecomRoomMapper.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.BaseTelecomRoom;
+
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-23
+ */
+public interface BaseTelecomRoomMapper extends BaseMapper<BaseTelecomRoom> {
+
+}

+ 18 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/IccChannelMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.dhicc.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.IccChannel;
+
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+public interface IccChannelMapper extends BaseMapper<IccChannel> {
+
+}

+ 18 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/IccEventRecordMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.dhicc.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.IccEventRecord;
+
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+public interface IccEventRecordMapper extends BaseMapper<IccEventRecord> {
+
+}

+ 10 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysTelecomEventMapper.java

@@ -0,0 +1,10 @@
+package com.huimv.video.dhicc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+
+
+public interface SysTelecomEventMapper extends BaseMapper<SysTelecomEvent> {
+
+
+}

+ 19 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysTelecomMapper.java

@@ -0,0 +1,19 @@
+package com.huimv.video.dhicc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import com.huimv.video.dhicc.entity.SysTelecom;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+@Repository
+public interface SysTelecomMapper extends BaseMapper<SysTelecom> {
+
+}

+ 53 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/R.java

@@ -0,0 +1,53 @@
+package com.huimv.video.dhicc.result;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class R extends HashMap<String, Object> {
+
+    private static final long serialVersionUID = 1L;
+
+    public R() {
+        put("code", 0);
+        put("msg", "success");
+    }
+
+    public static R error() {
+        return error(500, "未知异常,请联系管理员");
+    }
+
+    public static R error(String msg) {
+        return error(500, msg);
+    }
+
+    public static R error(int code, String msg) {
+        R r = new R();
+        r.put("code", code);
+        r.put("msg", msg);
+        return r;
+    }
+
+    public static R ok(String msg) {
+        R r = new R();
+        r.put("msg", msg);
+        return r;
+    }
+
+    public static R ok(Map<String, Object> map) {
+        R r = new R();
+        r.putAll(map);
+        return r;
+    }
+
+    public static R ok() {
+        return new R();
+    }
+
+    @Override
+    public R put(String key, Object value) {
+        super.put(key, value);
+        return this;
+    }
+
+}

+ 48 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/RRException.java

@@ -0,0 +1,48 @@
+package com.huimv.video.dhicc.result;
+
+public class RRException extends RuntimeException {
+	private static final long serialVersionUID = 1L;
+	
+    private String msg;
+    private int code = 500;
+    
+    public RRException(String msg) {
+		super(msg);
+		this.msg = msg;
+	}
+	
+	public RRException(String msg, Throwable e) {
+		super(msg, e);
+		this.msg = msg;
+	}
+	
+	public RRException(String msg, int code) {
+		super(msg);
+		this.msg = msg;
+		this.code = code;
+	}
+	
+	public RRException(String msg, int code, Throwable e) {
+		super(msg, e);
+		this.msg = msg;
+		this.code = code;
+	}
+
+	public String getMsg() {
+		return msg;
+	}
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+	
+	
+}

+ 116 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/RRExceptionHandler.java

@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) 2016-2019 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.huimv.video.dhicc.result;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.validation.FieldError;
+import org.springframework.validation.ObjectError;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.NoHandlerFoundException;
+
+/**
+ * 异常处理器
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@RestControllerAdvice
+public class RRExceptionHandler {
+	private Logger logger = LoggerFactory.getLogger(getClass());
+
+	/**
+	 * 处理自定义异常
+	 */
+	@ExceptionHandler(RRException.class)
+	public R handleRRException(RRException e){
+		R r = new R();
+		r.put("code", e.getCode());
+		r.put("msg", e.getMessage());
+		logger.error(e.getMsg(),e);
+		return r;
+	}
+
+	@ExceptionHandler(NoHandlerFoundException.class)
+	public R handlerNoFoundException(Exception e) {
+		logger.error(e.getMessage(), e);
+		return R.error(404, "路径不存在,请检查路径是否正确");
+	}
+
+	@ExceptionHandler(DuplicateKeyException.class)
+	public R handleDuplicateKeyException(DuplicateKeyException e){
+		logger.error(e.toString());
+		String message = e.getCause().getMessage();
+		String[] s = message.split(" ");
+		return R.error(600,s[2].replace("'","") + " 已经存在!");
+	}
+
+//	@ExceptionHandler(AuthorizationException.class)
+//	public R handleAuthorizationException(AuthorizationException e){
+//		logger.error(e.getMessage(), e);
+//		return R.error("没有权限,请联系管理员授权");
+//	}
+//
+//	@ExceptionHandler(value = LimitAccessException.class)
+//	public R handleLimitAccessException(LimitAccessException e) {
+//		logger.error("LimitAccessException", e);
+//		return  R.error(429,e.getMessage());
+//	}
+
+	//当校验失败时,会抛出MethodArgumentNotValidException
+	//输出错误原因到前端
+	@ExceptionHandler(MethodArgumentNotValidException.class)
+	public R handleMethodArgumentNotValidException(MethodArgumentNotValidException ex) {
+		logger.error(ex.getMessage(),ex);
+		StringBuilder sb = new StringBuilder();
+		for(ObjectError error : ex.getBindingResult().getAllErrors()){
+			if(error instanceof FieldError){
+				FieldError e = (FieldError) error;
+				sb.append(e.getField()).append(e.getDefaultMessage()).append(" ");
+			}
+		}
+		return R.error(1001,sb.toString());
+	}
+
+//	@ExceptionHandler(ConstraintViolationException.class)
+//	public R handleConstraintViolationException(ConstraintViolationException e) {
+//		logger.error(e.getMessage(),e);
+//		StringBuilder sb = new StringBuilder();
+//		e.getConstraintViolations().forEach(constraintViolation -> sb.append(constraintViolation.getMessage()).append(" "));
+//		return R.error(1001,sb.toString().substring(0,sb.length() - 1));
+//	}
+
+	@ExceptionHandler(MissingServletRequestParameterException.class)
+	public R handMissingServletRequestParameterException(MissingServletRequestParameterException e) {
+		logger.error(e.getMessage(),e);
+		return R.error(1001,e.getMessage());
+	}
+
+	@ExceptionHandler(DataIntegrityViolationException.class)
+	public R handDataIntegrityViolationException(DataIntegrityViolationException e) {
+		logger.error(e.getMessage(),e);
+		return R.error(1001,e.getCause().getMessage());
+	}
+
+	@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
+	public R handHttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) {
+		logger.error(e.getMessage(), e);
+		return R.error(1001, e.getMessage());
+	}
+	@ExceptionHandler(Exception.class)
+	public R handleException(Exception e){
+		logger.error(e.getMessage(), e);
+		return R.error();
+	}
+}

+ 17 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IBaseTelecomRoomService.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.dhicc.entity.BaseTelecomRoom;
+
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-23
+ */
+public interface IBaseTelecomRoomService extends IService<BaseTelecomRoom> {
+
+}

+ 17 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IIccChannelService.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.dhicc.entity.IccChannel;
+
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+public interface IIccChannelService extends IService<IccChannel> {
+
+}

+ 19 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IIccEventRecordService.java

@@ -0,0 +1,19 @@
+package com.huimv.video.dhicc.service;
+
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.dhicc.entity.IccEventRecord;
+
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+public interface IIccEventRecordService extends IService<IccEventRecord> {
+
+}

+ 15 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysTelecomEventService.java

@@ -0,0 +1,15 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.common.utils.Result;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+
+
+import java.util.Map;
+
+
+public interface ISysTelecomEventService extends IService<SysTelecomEvent> {
+
+    Result listByRoom(Map map);
+
+}

+ 21 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysTelecomService.java

@@ -0,0 +1,21 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.common.utils.Result;
+import com.huimv.video.dhicc.entity.SysTelecom;
+
+
+import java.util.Map;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+public interface ISysTelecomService extends IService<SysTelecom> {
+
+    Result listByRoom(Map map);
+}

+ 21 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/BaseTelecomRoomServiceImpl.java

@@ -0,0 +1,21 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import com.huimv.video.dhicc.entity.BaseTelecomRoom;
+import com.huimv.video.dhicc.mapper.BaseTelecomRoomMapper;
+import com.huimv.video.dhicc.service.IBaseTelecomRoomService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-23
+ */
+@Service
+public class BaseTelecomRoomServiceImpl extends ServiceImpl<BaseTelecomRoomMapper, BaseTelecomRoom> implements IBaseTelecomRoomService {
+
+}

+ 21 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/IccChannelServiceImpl.java

@@ -0,0 +1,21 @@
+package com.huimv.video.dhicc.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.video.dhicc.entity.IccChannel;
+import com.huimv.video.dhicc.mapper.IccChannelMapper;
+import com.huimv.video.dhicc.service.IIccChannelService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+@Service
+public class IccChannelServiceImpl extends ServiceImpl<IccChannelMapper, IccChannel> implements IIccChannelService {
+
+}

+ 22 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/IccEventRecordServiceImpl.java

@@ -0,0 +1,22 @@
+package com.huimv.video.dhicc.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import com.huimv.video.dhicc.entity.IccEventRecord;
+import com.huimv.video.dhicc.mapper.IccEventRecordMapper;
+import com.huimv.video.dhicc.service.IIccEventRecordService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+@Service
+public class IccEventRecordServiceImpl extends ServiceImpl<IccEventRecordMapper, IccEventRecord> implements IIccEventRecordService {
+
+}

+ 27 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysTelecomEventServiceImpl.java

@@ -0,0 +1,27 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+import com.huimv.video.dhicc.mapper.SysTelecomEventMapper;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+@Service
+public class SysTelecomEventServiceImpl extends ServiceImpl<SysTelecomEventMapper, SysTelecomEvent> implements ISysTelecomEventService {
+
+    @Override
+    public Result listByRoom(Map map) {
+        String deviceId = (String)map.get("deviceId");
+        QueryWrapper<SysTelecomEvent> wrapper = new QueryWrapper<>();
+        wrapper.eq("device_id",deviceId);
+        this.list(wrapper);
+        return new Result(ResultCode.SUCCESS,wrapper);
+    }
+
+}

+ 34 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysTelecomServiceImpl.java

@@ -0,0 +1,34 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+
+import com.huimv.video.dhicc.entity.SysTelecom;
+import com.huimv.video.dhicc.mapper.SysTelecomMapper;
+import com.huimv.video.dhicc.service.ISysTelecomService;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+@Service
+public class SysTelecomServiceImpl extends ServiceImpl<SysTelecomMapper, SysTelecom> implements ISysTelecomService {
+
+    @Override
+    public Result listByRoom(Map map) {
+        String deviceId = (String)map.get("deviceId");
+        QueryWrapper<SysTelecom> wrapper = new QueryWrapper<>();
+        wrapper.eq("device_id",deviceId);
+        this.list(wrapper);
+        return new Result(ResultCode.SUCCESS,wrapper);
+    }
+}

+ 24 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/GetPastTime.java

@@ -0,0 +1,24 @@
+package com.huimv.video.dhicc.util;
+
+import java.util.Date;
+
+public class GetPastTime {
+
+     //拿过去的时间  这个接口其实可以抽象出来
+    public Date getTimeBefor(       ){
+
+
+
+
+       return   new Date();
+
+    }
+
+
+
+
+
+
+
+
+}

+ 487 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/GetResponse.java

@@ -0,0 +1,487 @@
+package com.huimv.video.dhicc.util;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+
+import com.huimv.video.dhicc.result.R;
+import net.sf.json.JSONObject;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+public class GetResponse {
+
+
+
+    /**
+     *  //查车辆通行数量的接口**不分进出
+     * @param begin  开始时间
+     * @param end  结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGetPage(String begin, String end  ) throws ClientException {
+        String param = "queryTimeBegin=" + begin + "&queryTimeEnd=" + end;
+        String Url = "/evo-apigw/ipms/carcapture/find/conditions?";
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = Url + param;
+        System.out.println(newUrl);
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject   bject = JSONObject.fromObject(data);
+        Object data1 = bject.get("totalRows"); //打印 2390
+        return data1.toString();
+
+    }
+
+    /**
+     *  //查车辆通行数量的接口**出去记录
+     * @param begin  开始时间
+     * @param end  结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageCarOut(String begin, String end  ) throws ClientException {
+        String param = "queryTimeBegin=" + begin + "&queryTimeEnd=" + end+"&carDirect=9";
+        String Url = "/evo-apigw/ipms/carcapture/find/conditions?";
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = Url + param;
+        System.out.println(newUrl);
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject   bject = JSONObject.fromObject(data);
+        Object data1 = bject.get("totalRows"); //打印 2390
+        return data1.toString();
+
+    }
+
+
+
+
+
+    /**
+     *  //查车辆通行数量的接口**进入的记录----车辆闸机
+     * @param begin  开始时间
+     * @param end  结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageCarIn(String begin, String end  ) throws ClientException {
+        String param = "queryTimeBegin=" + begin + "&queryTimeEnd=" + end+"&carDirect=8";
+        String Url = "/evo-apigw/ipms/carcapture/find/conditions?";
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = Url + param;
+        System.out.println(newUrl);
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject   bject = JSONObject.fromObject(data);
+        Object data1 = bject.get("totalRows"); //打印 2390
+        return data1.toString();
+
+    }
+
+
+
+    /**
+     *  //查人员通过过去几个小时的接口---正常通过次数
+     * @param begin   开始时间
+     * @param end     结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGetPagePerson(String begin, String end  ) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("startSwingTime",begin);
+        params.put("endSwingTime",end);
+        params.put("openType",61);
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String NewUrl = URL + aLong;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        return data.toString();
+    }
+
+
+
+
+    /**
+     *  //查人员通过过去几个小时的接口---异常通过次数接口
+     * @param begin   开始时间
+     * @param end     结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGetPagePersonAlarm(String begin, String end  ) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("startSwingTime",begin);
+        params.put("endSwingTime",end);
+        params.put("containDomain","1");
+        params.put("openResult",0);
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String NewUrl = URL + aLong;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        return data.toString();
+    }
+
+
+
+
+    /**
+     *  //查洗消 ---时间次数的接口-----
+     * @param begin   开始时间
+     * @param end     结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageXixiaoPerson(String begin, String end  ) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString",begin);
+        params.put("alarmEndDateString",end);
+        params.put("alarmType",303);
+        params.put("dbType",0);
+        params.put("deviceCategory",1);
+        String[]  nodeCodeList=  new String[3];
+        nodeCodeList[0]=     "1002871$1$0$0"    ;
+        nodeCodeList[1]=   "1002872$1$0$0"      ;
+        nodeCodeList[2]=    "1002873$1$0$0"     ;
+        params.put("nodeCodeList",nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL ;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+
+    /**
+     *  //查大门 ---时间次数的接口-----
+     * @param begin   开始时间
+     * @param end     结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGateCount(String begin, String end  ) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString",begin);
+        params.put("alarmEndDateString",end);
+        params.put("alarmType",303);
+        params.put("dbType",0);
+        params.put("deviceCategory",1);
+        String[]  nodeCodeList=  new String[1];
+        nodeCodeList[0]="1003442$1$0$0";   //大门的通道
+        params.put("nodeCodeList",nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL ;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+
+
+
+    /**
+     *  //查死猪 ---时间次数的接口-----
+     * @param begin   开始时间
+     * @param end     结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendCountSiZhu(String begin, String end  ) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString",begin);
+        params.put("alarmEndDateString",end);
+        params.put("alarmType",303);
+        params.put("dbType",0);
+        params.put("deviceCategory",1);
+        String[]  nodeCodeList=  new String[64];
+        nodeCodeList[0]="1002874$1$0$0";
+        nodeCodeList[1]="1002875$1$0$0";
+        nodeCodeList[0]="1002876$1$0$0";
+        nodeCodeList[0]="1002877$1$0$0";
+        nodeCodeList[0]="1002878$1$0$0";
+        nodeCodeList[0]="1002879$1$0$0";
+        nodeCodeList[0]="1002880$1$0$0";
+        nodeCodeList[0]="1002881$1$0$0";
+        nodeCodeList[0]="1002882$1$0$0";
+        nodeCodeList[0]="1002883$1$0$0";
+        nodeCodeList[10]="1002884$1$0$0";
+        nodeCodeList[11]="1002885$1$0$0";
+        nodeCodeList[12]="1002886$1$0$0";
+        nodeCodeList[13]="1002887$1$0$0";
+        nodeCodeList[14]="1002888$1$0$0";
+        nodeCodeList[15]="1002889$1$0$0";
+        nodeCodeList[16]="1002890$1$0$0";
+        nodeCodeList[17]="1002891$1$0$0";
+        nodeCodeList[18]="1002892$1$0$0";
+        nodeCodeList[19]="1002893$1$0$0";
+        nodeCodeList[20]="1002894$1$0$0";
+        nodeCodeList[21]="1002895$1$0$0";
+        nodeCodeList[22]="1002896$1$0$0";
+        nodeCodeList[23]="1002897$1$0$0";
+        nodeCodeList[24]="1002898$1$0$0";
+        nodeCodeList[25]="1002899$1$0$0";
+        nodeCodeList[26]="1002900$1$0$0";
+        nodeCodeList[27]="1002901$1$0$0";
+        nodeCodeList[28]="1002902$1$0$0";
+        nodeCodeList[29]="1002903$1$0$0";
+        nodeCodeList[30]="1002904$1$0$0";
+        nodeCodeList[31]="1002905$1$0$0";
+        nodeCodeList[32]="1002906$1$0$0";
+        nodeCodeList[33]="1002907$1$0$0";
+        nodeCodeList[34]="1002908$1$0$0";
+        nodeCodeList[35]="1002909$1$0$0";
+        nodeCodeList[36]="1002910$1$0$0";
+        nodeCodeList[37]="1002911$1$0$0";
+        nodeCodeList[38]="1002912$1$0$0";
+        nodeCodeList[39]="1002913$1$0$0";
+        nodeCodeList[40]="1002939$1$0$0";
+        nodeCodeList[41]="1002939$1$0$1";
+        nodeCodeList[42]="1002939$1$0$2";
+        nodeCodeList[43]="1002939$1$0$3";
+        nodeCodeList[44]="1002939$1$0$4";
+        nodeCodeList[45]="1002939$1$0$5";
+        nodeCodeList[46]="1002939$1$0$6";
+        nodeCodeList[47]="1002939$1$0$7";
+        nodeCodeList[48]="1002939$1$0$8";
+        nodeCodeList[49]="1002939$1$0$9";
+        nodeCodeList[50]="1002940$1$0$0";
+        nodeCodeList[51]="1002940$1$0$1";
+        nodeCodeList[52]="1002940$1$0$2";
+        nodeCodeList[53]="1002940$1$0$3";
+        nodeCodeList[54]="1002940$1$0$4";
+        nodeCodeList[55]="1002940$1$0$5";
+        nodeCodeList[56]="1002940$1$0$6";
+        nodeCodeList[57]="1002940$1$0$7";
+        nodeCodeList[58]="1002939$1$0$10";
+        nodeCodeList[59]="1002939$1$0$11";
+        nodeCodeList[60]="1002939$1$0$12";
+        nodeCodeList[61]="1002939$1$0$13";
+        nodeCodeList[62]="1002939$1$0$14";
+        nodeCodeList[63]="1002939$1$0$15";
+
+        params.put("nodeCodeList",nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL ;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+
+
+
+    /**
+     *  //查洗消死猪事件的时间-----次数的接口-----
+     * @param begin   开始时间
+     * @param end     结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageSiZhuRecord(String begin, String end  ) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString",begin);
+        params.put("alarmEndDateString",end);
+        params.put("alarmType",303);
+        params.put("dbType",0);
+        params.put("deviceCategory",1);
+        String[]  nodeCodeList=  new String[64];
+        nodeCodeList[0]="1002874$1$0$0";
+        nodeCodeList[1]="1002875$1$0$0";
+        nodeCodeList[0]="1002876$1$0$0";
+        nodeCodeList[0]="1002877$1$0$0";
+        nodeCodeList[0]="1002878$1$0$0";
+        nodeCodeList[0]="1002879$1$0$0";
+        nodeCodeList[0]="1002880$1$0$0";
+        nodeCodeList[0]="1002881$1$0$0";
+        nodeCodeList[0]="1002882$1$0$0";
+        nodeCodeList[0]="1002883$1$0$0";
+        nodeCodeList[10]="1002884$1$0$0";
+        nodeCodeList[11]="1002885$1$0$0";
+        nodeCodeList[12]="1002886$1$0$0";
+        nodeCodeList[13]="1002887$1$0$0";
+        nodeCodeList[14]="1002888$1$0$0";
+        nodeCodeList[15]="1002889$1$0$0";
+        nodeCodeList[16]="1002890$1$0$0";
+        nodeCodeList[17]="1002891$1$0$0";
+        nodeCodeList[18]="1002892$1$0$0";
+        nodeCodeList[19]="1002893$1$0$0";
+        nodeCodeList[20]="1002894$1$0$0";
+        nodeCodeList[21]="1002895$1$0$0";
+        nodeCodeList[22]="1002896$1$0$0";
+        nodeCodeList[23]="1002897$1$0$0";
+        nodeCodeList[24]="1002898$1$0$0";
+        nodeCodeList[25]="1002899$1$0$0";
+        nodeCodeList[26]="1002900$1$0$0";
+        nodeCodeList[27]="1002901$1$0$0";
+        nodeCodeList[28]="1002902$1$0$0";
+        nodeCodeList[29]="1002903$1$0$0";
+        nodeCodeList[30]="1002904$1$0$0";
+        nodeCodeList[31]="1002905$1$0$0";
+        nodeCodeList[32]="1002906$1$0$0";
+        nodeCodeList[33]="1002907$1$0$0";
+        nodeCodeList[34]="1002908$1$0$0";
+        nodeCodeList[35]="1002909$1$0$0";
+        nodeCodeList[36]="1002910$1$0$0";
+        nodeCodeList[37]="1002911$1$0$0";
+        nodeCodeList[38]="1002912$1$0$0";
+        nodeCodeList[39]="1002913$1$0$0";
+        nodeCodeList[40]="1002939$1$0$0";
+        nodeCodeList[41]="1002939$1$0$1";
+        nodeCodeList[42]="1002939$1$0$2";
+        nodeCodeList[43]="1002939$1$0$3";
+        nodeCodeList[44]="1002939$1$0$4";
+        nodeCodeList[45]="1002939$1$0$5";
+        nodeCodeList[46]="1002939$1$0$6";
+        nodeCodeList[47]="1002939$1$0$7";
+        nodeCodeList[48]="1002939$1$0$8";
+        nodeCodeList[49]="1002939$1$0$9";
+        nodeCodeList[50]="1002940$1$0$0";
+        nodeCodeList[51]="1002940$1$0$1";
+        nodeCodeList[52]="1002940$1$0$2";
+        nodeCodeList[53]="1002940$1$0$3";
+        nodeCodeList[54]="1002940$1$0$4";
+        nodeCodeList[55]="1002940$1$0$5";
+        nodeCodeList[56]="1002940$1$0$6";
+        nodeCodeList[57]="1002940$1$0$7";
+        nodeCodeList[58]="1002939$1$0$10";
+        nodeCodeList[59]="1002939$1$0$11";
+        nodeCodeList[60]="1002939$1$0$12";
+        nodeCodeList[61]="1002939$1$0$13";
+        nodeCodeList[62]="1002939$1$0$14";
+        nodeCodeList[63]="1002939$1$0$15";
+
+        params.put("nodeCodeList",nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL ;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+
+
+
+
+    public Object SendMassagePost(String param , String Url , String chooseMethod   ) throws ClientException {
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = Url + param;
+        //这种已经在配置文件里面安排了账号ip以及密码    现在变了
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.POST);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return  R.ok("请求成功").put("token",generalResponse);
+
+    }
+
+
+
+
+
+
+
+}

+ 376 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/HttpClient.java

@@ -0,0 +1,376 @@
+package com.huimv.video.dhicc.util;
+
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.http.*;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.*;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.mime.HttpMultipartMode;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.protocol.HTTP;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.net.ssl.SSLContext;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/*****
+ * @Author:  yangdi  hm
+ * @Description: entity
+ ****/
+public   class HttpClient {
+    private String url;
+    private Map<String, String> param;
+    private int statusCode;
+    private String content;
+    private String xmlParam;
+    private boolean isHttps;
+
+    public boolean isHttps() {
+        return isHttps;
+    }
+
+    public  void   setHttps(boolean isHttps) {
+        this.isHttps = isHttps;
+    }
+
+    public String getXmlParam() {
+        return xmlParam;
+    }
+
+    public void setXmlParam(String xmlParam) {
+        this.xmlParam = xmlParam;
+    }
+
+    public HttpClient(String url, Map<String, String> param) {
+        this.url = url;
+        this.param = param;
+    }
+
+
+
+    public HttpClient(String url) {
+        this.url = url;
+    }
+
+    public void setParameter(Map<String, String> map) {
+        param = map;
+    }
+
+
+
+    public void addParameter(String key, String value) {
+        if (param == null)
+            param = new HashMap<String, String>();
+        param.put(key, value);
+    }
+
+
+
+    public void post() throws ClientProtocolException, IOException {
+        HttpPost http = new HttpPost(url);
+        setEntity(http);
+        execute(http);
+    }
+
+    public void put() throws ClientProtocolException, IOException {
+        HttpPut http = new HttpPut(url);
+        setEntity(http);
+        execute(http);
+    }
+
+
+
+    public void get() throws ClientProtocolException, IOException {
+        if (param != null) {
+            StringBuilder url = new StringBuilder(this.url);
+            boolean isFirst = true;
+            for (String key : param.keySet()) {
+                if (isFirst) {
+                    url.append("?");
+                }else {
+                    url.append("&");
+                }
+                url.append(key).append("=").append(param.get(key));
+            }
+            this.url = url.toString();
+        }
+        HttpGet http = new HttpGet(url);
+        execute(http);
+    }
+
+    /**
+     * set http post,put param
+     */
+    private void setEntity(HttpEntityEnclosingRequestBase http) {
+        if (param != null) {
+            List<NameValuePair> nvps = new LinkedList<NameValuePair>();
+            for (String key : param.keySet()) {
+                nvps.add(new BasicNameValuePair(key, param.get(key))); // 参数
+            }
+            http.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8)); // 设置参数
+        }
+        if (xmlParam != null) {
+            http.setEntity(new StringEntity(xmlParam, Consts.UTF_8));
+        }
+    }
+
+    private void execute(HttpUriRequest http) throws ClientProtocolException,
+            IOException {
+        CloseableHttpClient httpClient = null;
+        try {
+            if (isHttps) {
+                SSLContext sslContext = new SSLContextBuilder()
+                        .loadTrustMaterial(null, new TrustStrategy() {
+                            // 信任所有
+                            @Override
+                            public boolean isTrusted(X509Certificate[] chain,
+                                                     String authType)
+                                    throws CertificateException {
+                                return true;
+                            }
+                        }).build();
+                SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
+                        sslContext);
+                httpClient = HttpClients.custom().setSSLSocketFactory(sslsf)
+                        .build();
+            } else {
+                httpClient = HttpClients.createDefault();
+            }
+            CloseableHttpResponse response = httpClient.execute(http);
+            try {
+                if (response != null) {
+                    if (response.getStatusLine() != null) {
+                        statusCode = response.getStatusLine().getStatusCode();
+                    }
+                    HttpEntity entity = response.getEntity();
+                    // 响应内容
+                    content = EntityUtils.toString(entity, Consts.UTF_8);
+                }
+            } finally {
+                response.close();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            httpClient.close();
+        }
+    }
+
+
+    public static String httpClientPostSetBody(String url, Map<String, String> parmaMap1) throws IOException {
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String result = "";
+        HttpPost httpPost= new  HttpPost(url);
+        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+        ContentType contentType = ContentType.create(HTTP.PLAIN_TEXT_TYPE, HTTP.UTF_8);
+        builder.setCharset(Charset.forName("utf-8"));
+        builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+        builder.setCharset(StandardCharsets.UTF_8);
+        if (MapUtils.isNotEmpty(parmaMap1)) {
+            for (Map.Entry<String, String> entry : parmaMap1.entrySet()) {
+                System.out.println(entry.getKey());
+                System.out.println(entry.getValue());
+                builder.addTextBody(entry.getKey(), entry.getValue(), contentType);
+                System.out.println("正在循环");
+            }
+        }
+        System.out.println(builder.toString());
+        HttpEntity entity = builder.build();
+        httpPost.setEntity(entity);
+        // 执行提交
+        HttpResponse response = httpClient.execute(httpPost);
+        HttpEntity responseEntity = response.getEntity();
+        if (responseEntity != null) {
+            // 将响应内容转换为字符串
+            result = EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
+        }
+        httpClient.close();
+        return result;
+    }
+
+
+
+
+
+
+    public static String httpClientUploadFilePut(String url, Map<String, String> parma1) throws IOException {
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String result = "";
+
+          HttpPut httpPut = new  HttpPut(url);
+            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+            //设置文本字符编码为UTF-8
+            //中间是格式
+            //ContentType contentType= ContentType.create("application/x-www-form-urlencoded", Charset.forName("UTF-8"));
+            ContentType contentType = ContentType.create(HTTP.PLAIN_TEXT_TYPE, HTTP.UTF_8);
+            builder.setCharset(Charset.forName("utf-8"));
+            builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+            builder.setCharset(StandardCharsets.UTF_8);
+            // 文件流  应该写成可以复用的工具类
+            //builder.addBinaryBody("photo",file.getBytes());
+           // builder.addBinaryBody(file.getName(), file.getInputStream(), ContentType.MULTIPART_FORM_DATA, file.getName());// 文件流
+            System.out.println("获取文件成功");
+            //暂时无法封装成工具
+
+            System.out.println("name="+parma1.get("name"));
+            builder.addTextBody("id", parma1.get("id"),contentType);
+            builder.addTextBody("name",parma1.get("name"),contentType);
+            builder.addTextBody("mark",parma1.get("mark"),contentType);
+            System.out.println(builder.toString());
+            HttpEntity entity = builder.build();
+            httpPut.setEntity(entity);
+            // 执行提交
+            HttpResponse response = httpClient.execute(httpPut);
+            HttpEntity responseEntity = response.getEntity();
+            if (responseEntity != null) {
+                // 将响应内容转换为字符串
+                result = EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
+            }
+                httpClient.close();
+
+        return result;
+    }
+
+
+    public static String doDelete(String url) {
+
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        HttpDelete httpDelete = new HttpDelete(url);
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build();
+        httpDelete.setConfig(requestConfig);
+        httpDelete.setHeader("Content-type", "application/json");
+        httpDelete.setHeader("DataEncoding", "UTF-8");
+       // httpDelete.setHeader("token", token);
+
+        CloseableHttpResponse httpResponse = null;
+        try {
+            httpResponse = httpClient.execute(httpDelete);
+            HttpEntity entity = httpResponse.getEntity();
+            String result = EntityUtils.toString(entity);
+            return result;
+        } catch (ClientProtocolException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } finally {
+            if (httpResponse != null) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return null;
+    }
+
+
+
+
+
+
+
+
+    public static String httpClientUploadFilePost(String url, MultipartFile file, Map<String, String> header, Map<String, String> parma1) throws IOException {
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String result = "";
+        try {
+
+            HttpPost httpPost = new HttpPost(url);
+            //请求头,women
+            if (MapUtils.isNotEmpty(header)) {
+                for (Map.Entry<String, String> entry : header.entrySet()) {
+                    httpPost.addHeader(entry.getKey(), entry.getValue());
+                }
+            }
+            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+            System.out.println("jinlai");
+            //设置文本字符编码为UTF-8
+            //中间是格式
+            //ContentType contentType= ContentType.create("application/x-www-form-urlencoded", Charset.forName("UTF-8"));
+            ContentType contentType = ContentType.create(HTTP.PLAIN_TEXT_TYPE, HTTP.UTF_8);
+            builder.setCharset(Charset.forName("utf-8"));
+            builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+            builder.setCharset(StandardCharsets.UTF_8);
+            // 文件流  应该写成可以复用的工具类
+            //builder.addBinaryBody("photo",file.getBytes());
+            builder.addBinaryBody(file.getName(), file.getInputStream(), ContentType.MULTIPART_FORM_DATA, file.getName());// 文件流
+            System.out.println("获取文件成功");
+            //暂时无法封装成工具
+             String group_id =parma1.get("group_id");
+             String name =parma1.get("name");
+             String idcard =parma1.get("idcard");
+            System.out.println("name="+parma1.get("name"));
+        builder.addTextBody("group_id", group_id);
+        builder.addTextBody("name",parma1.get("name"),contentType);
+        builder.addTextBody("idcard",idcard);
+
+            System.out.println(builder.toString());
+            HttpEntity entity = builder.build();
+            httpPost.setEntity(entity);
+            // 执行提交
+            HttpResponse response = httpClient.execute(httpPost);
+            HttpEntity responseEntity = response.getEntity();
+            if (responseEntity != null) {
+                // 将响应内容转换为字符串
+                result = EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
+            }
+
+        } catch (Exception e) {
+            System.out.println("baocuo");
+        } finally {
+            try {
+                httpClient.close();
+
+            } catch (IOException e) {
+                System.out.println("baocu");
+            }
+        }
+        return result;
+    }
+
+
+
+
+
+
+
+
+
+
+    public int getStatusCode() {
+        return statusCode;
+    }
+    public String getContent() throws ParseException, IOException {
+        return content;
+    }
+}

+ 68 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/Result.java

@@ -0,0 +1,68 @@
+package com.huimv.video.dhicc.util;
+
+import java.io.Serializable;
+
+public class Result implements Serializable {
+
+    private boolean success;
+    private Integer code;
+    private String message;
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    private Object data;
+
+    //不需要返回数据时使用
+    public Result(ResultCode code) {
+        this.success = code.success;
+        this.code = code.code;
+        this.message = code.message;
+    }
+
+    public Result(ResultCode code, Object data) {
+        this.success = code.success;
+        this.code = code.code;
+        this.message = code.message;
+        this.data = data;
+    }
+
+    public Result(Integer code, String message, boolean success) {
+        this.code = code;
+        this.message = message;
+        this.success = success;
+    }
+
+    /*
+     * 调用ResultCode类封装常用的返回数据
+     */
+}

+ 41 - 0
huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/ResultCode.java

@@ -0,0 +1,41 @@
+package com.huimv.video.dhicc.util;
+
+public enum ResultCode {
+    SUCCESS(true,10000,"操作成功!"),
+    //---系统错误返回码-----
+    FAIL(false,10001,"操作失败"),
+    UNAUTHENTICATED(false,10002,"您还未登录"),
+    UNAUTHORISE(false,10003,"权限不足"),
+    SERVER_ERROR(false,99999,"抱歉,系统繁忙,请稍后重试!"),
+
+    //---用户操作返回码  2xxxx----
+    MOBILEORPASSWORDERROR(false,20001,"用户名或密码错误");
+    //---企业操作返回码  3xxxx----
+    //---权限操作返回码----
+    //---其他操作返回码----
+
+    //操作是否成功
+    boolean success;
+    //操作代码
+    int code;
+    //提示信息
+    String message;
+
+    ResultCode(boolean success, int code, String message){
+        this.success = success;
+        this.code = code;
+        this.message = message;
+    }
+
+    public boolean success() {
+        return success;
+    }
+
+    public int code() {
+        return code;
+    }
+
+    public String message() {
+        return message;
+    }
+}

+ 0 - 0
huimv-farm-video/src/main/java/com/huimv/video/security/readme


+ 0 - 1
huimv-farm-video/src/main/resources/application-dev.yml

@@ -14,7 +14,6 @@ spring:
     hibernate:
       ddl-auto: update
     database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
-
 # Socket配置
 socket:
   # 监听端口 9001

+ 13 - 0
huimv-farm-video/src/main/resources/config/iccSdk.properties

@@ -0,0 +1,13 @@
+# host
+icc.sdk.host=36.26.62.70:447
+# 客户端模式
+icc.sdk.clientId=huimv
+icc.sdk.clientSecret=1653d6c9-c611-4827-ac87-0bfd48deadd4
+# 1653d6c9-c611-4827-ac87-0bfd48deadd4
+# 密码校验模式
+icc.sdk.pwdClientId=huimv
+icc.sdk.pwdClientSecret=1653d6c9-c611-4827-ac87-0bfd48deadd4
+icc.sdk.username=system
+icc.sdk.password=admin123.
+# 使用授权类型password,client_credentials
+icc.sdk.grantType=password