yang 3 éve
szülő
commit
43b37beb9b

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

@@ -76,7 +76,9 @@ public class SysTelecomEventController {
             LambdaQueryWrapper<BaseTelecomRoom> wrapper3 = Wrappers.lambdaQuery();
             wrapper3.eq(BaseTelecomRoom::getDeviceId, record.getDeviceId());
             BaseTelecomRoom baseTelecomRoom = baseTelecomRoomMapper.selectOne(wrapper3);
+            //位置
             telecomVo.setLocation(baseTelecomRoom.getDeviceRoom());
+            telecomVo.setChekOk(record.getRemark());
             TelecomVoRecords.add(telecomVo);
         }
         return new Result(ResultCode.SUCCESS,page1.setRecords(TelecomVoRecords));

+ 8 - 25
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientAllEventController.java

@@ -33,8 +33,7 @@ public class ClientAllEventController {
 
     @Autowired
     private ISysTelecomEventService sysTelecomEventService;
-
-     //
+    //所有的事件接口
     @RequestMapping("/ListAllEvent")
     public R SiZhuList(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
         Integer farmId= (int) params1.get("farmId");
@@ -44,6 +43,7 @@ public class ClientAllEventController {
         return R.ok("请求成功").put("data", getEventList( params1  )).put("total" , CountTimes(params1));
     }
 
+
     //返回所有的事件 的集合  包括死猪和洗消和大门 --分页参数
     public GeneralResponse getEventList( Map<String, Object> params1) throws ClientException {
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -72,13 +72,9 @@ public class ClientAllEventController {
         params.put("deviceCategory",1);
         String[]  nodeCodeList= CommonConstant.AllChannle;
         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 generalRequest = new GeneralRequest(URL, Method.POST);
         generalRequest.header("Content-Type", " application/json");
         generalRequest.body(JSON.toJSONString(params));
         GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
@@ -103,34 +99,21 @@ public class ClientAllEventController {
         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("alarmStartDateString", params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", params1.get("alarmEndDateString"));
         }
         params.put("alarmType",303);
         params.put("dbType",0);
         params.put("deviceCategory",1);
         String[]  nodeCodeList= CommonConstant.AllChannle;
-
         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 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("执行结束");
-        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();
+        JSONObject jsonObject = JSONObject.fromObject(JSONObject.fromObject(iClient.doAction(generalRequest, generalRequest.getResponseClass()).getResult()).get("data"));
+        return jsonObject.get("value").toString();
     }
 }
 

+ 27 - 60
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientPersonManageController.java

@@ -25,6 +25,26 @@ import java.util.Map;
 @RestController
 @RequestMapping("person")
 public class ClientPersonManageController {
+    /**
+     * 人员通行记录 ---测试通过  ---参数说明见大华官网 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
+     */
 
 
     //刷脸失败记录
@@ -53,25 +73,14 @@ public class ClientPersonManageController {
         }
         params1.put("containDomain","1");
         params1.put("openResult",0); //刷脸失败
-        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined?";  //获取事件URL    post请求
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined?";
     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 generalRequest = new GeneralRequest(URL + Long.valueOf(String.valueOf((new Date()).getTime())), Method.POST);
         generalRequest.header("Content-Type", " application/json");
-        System.out.println(JSON.toJSONString(params1));
-    //里面是
         generalRequest.body(JSON.toJSONString(params1));
-    //发起请求处理应答
-    GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
-        System.out.println("执行结束");
-    JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
         GetResponse getResponse = new GetResponse();
-
         return  R.ok("请求成功").put("data", jsonObject ).put("total",  getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"),(String) params1.get("endSwingTime")));
 }
 
@@ -92,51 +101,23 @@ public class ClientPersonManageController {
             //返回为空数据
             return  null;
         }
-
-        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 generalRequest = new GeneralRequest("/evo-apigw/evo-brm/1.2.0/person/page", 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 getAccidentRecord1( @RequestBody Map<String, Object> params ) throws ClientException {
-
         Integer  farmId= (int) params.get("farmId");
         if(farmId!=1){
             //返回为空数据
             return  new GeneralResponse() ;
         }
-
         String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined";  //获取事件URL    post请求
         IClient iClient = new DefaultClient();
         System.out.println("开始执行");
@@ -144,9 +125,7 @@ public class ClientPersonManageController {
         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;
@@ -162,22 +141,14 @@ public class ClientPersonManageController {
             //返回为空数据
             return  new GeneralResponse() ;
         }
-        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";
         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 generalRequest = new GeneralRequest( URL + aLong, 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;
     }
 
@@ -196,14 +167,10 @@ public class ClientPersonManageController {
         }
         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;
     }
 

+ 2 - 16
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientXixiaoController.java

@@ -32,26 +32,19 @@ public class ClientXixiaoController {
             //返回为空数据
             return  null ;
         }
-
-
         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
@@ -64,19 +57,12 @@ public class ClientXixiaoController {
             //返回为空数据
             return  new GeneralResponse() ;
         }
-
         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;
     }
 }

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

@@ -6,14 +6,12 @@ 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

+ 1 - 24
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/FaceAIController/AiFaceController.java

@@ -5,29 +5,18 @@ package com.huimv.video.dhicc.controller.FaceAIController;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.dahuatech.icc.exception.ClientException;
-import com.dahuatech.icc.oauth.http.DefaultClient;
-import com.dahuatech.icc.oauth.http.IClient;
-import com.huimv.common.utils.Result;
-import com.huimv.common.utils.StringUtilsWork;
 import com.huimv.video.dhicc.result.R;
 import com.huimv.video.dhicc.util.GetResponse;
 import com.huimv.video.dhicc.util.HttpClient;
-import org.springframework.transaction.support.TransactionCallbackWithoutResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
-
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
-import static com.huimv.video.dhicc.icc.CommonConstant.IPAndPort;
-
 @RestController
 @RequestMapping("/AiFaceCount")
 public class AiFaceController {
@@ -53,35 +42,28 @@ public class AiFaceController {
 
         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();
 
@@ -126,15 +108,10 @@ public class AiFaceController {
         Collections.reverse(result);
         return  R.ok("请求成功").put("data", result ).put("namalCount",12).put("alarmCount",45);
     }
-
         public String   getCountByHoure(Date  startTime ,Date EndTime) throws IOException {
             long startTimes = startTime.getTime();
             long endTimes = EndTime.getTime();
-            //这儿直接写死了--只查那=南门口
-            //开始时间 结束时间
             String URL = "http://36.26.62.70:10080/api/pass_records?_t=1640069918983&start_page=1&page_count=3000&begin_time="+startTimes+"&end_time="+endTimes+"&camera_id=5";
-           // System.out.println(URL);
-            //发送请求
             HttpClient httpClient = new HttpClient(URL);
             httpClient.setHttps(false);
             httpClient.get();

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

@@ -42,7 +42,6 @@ public class ScreenAlarmCountByDay {
         c.add(Calendar.DATE, -7);
         Date B = c.getTime();
         String formatB = format.format(B);
-
         List result = new ArrayList();
 
         //洗消 一周

+ 1 - 2
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenIndexDataController.java

@@ -21,7 +21,7 @@ import java.util.Map;
 @RequestMapping("/screen/index")
 public class ScreenIndexDataController {
 
- //返回大屏首页的数据
+    //返回大屏首页的数据
     @RequestMapping("/dataList")
     public R indexDataList(HttpServletRequest request ,@RequestParam(name = "farmId") Integer farmId  ) throws ClientException, ParseException {
         if(farmId!=1){
@@ -63,7 +63,6 @@ public class ScreenIndexDataController {
              map.put("SevenDayGate",getResponse.SendMassageGateCount(formatC , formatA));
              map.put("tadayGate",getResponse.SendMassageGateCount(formatB, formatA));
 
-         //车分一下  进和出
         return  R.ok("请求成功").put("data", map );
 
     }

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

@@ -85,7 +85,6 @@ public class ScreenPersonController {
         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));
@@ -137,8 +136,6 @@ public class ScreenPersonController {
         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));

+ 1 - 3
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenSiZhuController.java

@@ -177,10 +177,8 @@ public class ScreenSiZhuController {
         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 generalRequest = new GeneralRequest(URL, Method.POST);
         generalRequest.header("Content-Type", " application/json");
         generalRequest.body(JSON.toJSONString(params));
         GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());

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

@@ -13,5 +13,6 @@ public class TelecomVo {
 
     private String deviceId;
 
+    private String  chekOk;
 
 }

+ 4 - 5
huimv-farm-video/src/main/java/com/huimv/video/dhicc/timmer/SysTelcomEnentTimmer.java

@@ -47,7 +47,7 @@ public class SysTelcomEnentTimmer {
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Calendar TimeDeviceId = Calendar.getInstance();
         TimeDeviceId.setTime(new Date());
-        TimeDeviceId.add(Calendar.HOUR_OF_DAY, -300);
+        TimeDeviceId.add(Calendar.HOUR_OF_DAY, -30);
         Date began1time = TimeDeviceId.getTime();
         String startTime1 = format.format(began1time);
         String endTime1 = format.format(new Date());
@@ -85,11 +85,12 @@ public class SysTelcomEnentTimmer {
                 }
             }
              if(   Double.parseDouble(sysThreshold.getBenconValue())<  count*5){
-               //  System.out.println("高于阈值温度时间"+count*5);
+                System.out.println("高于阈值温度时间"+count*5);
                  //正确烘干为1
+
                  sysTelecomEvent.setRemark("1");
              }else { sysTelecomEvent.setRemark("0");}
-
+            System.out.println("存储"+sysTelecomEvent.getRemark());
             sysTelecomEventService.updateById(sysTelecomEvent);
 
             //System.out.println("事件时间=" + EventStartTime + sysTelecoms);
@@ -155,6 +156,4 @@ public class SysTelcomEnentTimmer {
            }
 
        }
-
-
 }

+ 2 - 2
huimv-farm-video/src/main/resources/application-prod.yml

@@ -5,9 +5,9 @@ spring:
     name: pigfarm-local-device
   #------DataSource-----
   datasource:
-    url: jdbc:mysql://192.168.1.75:3309/huimv-farm-center?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://47.96.4.54:10052/huimv-farm-center?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
     username: root
-    password: root
+    password: hm123456789
     driver-class-name: com.mysql.cj.jdbc.Driver
   jpa:
     hibernate: