Parcourir la source

Merge branch 'master' of D:\idea\huimv.farm.datacenter with conflicts.

zhuoning il y a 3 ans
Parent
commit
a36cf5d3e3

+ 31 - 2
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientAllEventController.java

@@ -2,6 +2,7 @@ package com.huimv.video.dhicc.controller.ClientController;
 
 
 import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.HttpRequest;
 import com.dahuatech.hutool.http.Method;
 import com.dahuatech.icc.exception.ClientException;
 import com.dahuatech.icc.oauth.http.DefaultClient;
@@ -11,13 +12,16 @@ import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
 import com.huimv.common.utils.StringUtilsWork;
 import com.huimv.video.dhicc.icc.CommonConstant;
 import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.IClientAllEventService;
 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.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
@@ -29,10 +33,11 @@ import java.util.Map;
 @RestController
 @RequestMapping("/client/event")
 public class ClientAllEventController {
-
-
     @Autowired
     private ISysTelecomEventService sysTelecomEventService;
+    @Autowired
+    private IClientAllEventService iClientAllEventService;
+
     //所有的事件接口
     @RequestMapping("/ListAllEvent")
     public R SiZhuList(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
@@ -116,6 +121,30 @@ public class ClientAllEventController {
         return jsonObject.get("value").toString();
     }
 
+    /**
+     * @Method      : getEventBySort
+     * @Description : 分类查看事件
+     * @Params      : [farmId, sort, startDateText, endDateText, pageNum, pageSize, request]
+     * @Return      : com.huimv.video.dhicc.result.R
+     * 
+     * @Author      : ZhuoNing
+     * @Date        : 2021/12/24       
+     * @Time        : 13:34
+     */
+    @RequestMapping(value = "/getEventBySort",method = RequestMethod.GET)
+    public R getEventBySort(Integer farmId, Integer sort, String startDateText, String endDateText, Integer pageNum, Integer pageSize, HttpServletRequest request) throws ClientException {
+        //牧场id
+        if(farmId != 1){
+            return  R.ok("当前牧场无数据。").put("data",null);
+        }
+        //事件分类
+        if(sort == null){
+            return  R.ok("请选择事件分类。").put("data",null);
+        }
+        //
+        return iClientAllEventService.getEventBySort(farmId,sort,startDateText,endDateText,pageNum,pageSize,request);
+    }
+    
 
 }
 

Fichier diff supprimé car celui-ci est trop grand
+ 3 - 15
huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/CommonConstant.java


+ 34 - 8
huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/ClientAllEventServiceImpl.java

@@ -62,6 +62,18 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
                 System.out.println("死猪通道事件输入参数>>"+paramsMap.toString());
                 return getDeadPigChannel(paramsMap);
             case 4:
+                //熏蒸事件
+                paramsMap.put("alarmStartDateString",startDateText);
+                paramsMap.put("alarmEndDateString",endDateText);
+                System.out.println("熏蒸事件输入参数>>"+paramsMap.toString());
+                return getFumigateChannel(paramsMap);
+            case 5:
+                //卖猪事件
+                paramsMap.put("alarmStartDateString",startDateText);
+                paramsMap.put("alarmEndDateString",endDateText);
+                System.out.println("卖猪事件输入参数>>"+paramsMap.toString());
+                return getSellPigsChannel(paramsMap);
+            case 6:
                 //人员门禁事件
                 paramsMap.put("startSwingTime",startDateText);
                 paramsMap.put("endSwingTime",endDateText);
@@ -78,27 +90,41 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
     //大门事件
     private R getGateEvent(Map<String, Object> paramsMap) throws ClientException {
         //绑定大门通道
-        String[] doorChannle = CommonConstant.DoorChannle;
-        return R.ok("请求成功").put("data", getEventList(paramsMap, doorChannle)).put("total", CountTimes(paramsMap, doorChannle));
+        String[] doorChannel = CommonConstant.DoorChannle;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, doorChannel)).put("total", CountTimes(paramsMap, doorChannel)).put("isVideo",true);
     }
 
     //洗消事件
     private R getWashEvent(Map<String, Object> paramsMap) throws ClientException {
         //绑定大门通道
-        String[] washChannle = CommonConstant.XixiaoChannle;
-        return R.ok("请求成功").put("data", getEventList(paramsMap, washChannle)).put("total", CountTimes(paramsMap, washChannle));
+        String[] washChannel = CommonConstant.XixiaoChannle;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, washChannel)).put("total", CountTimes(paramsMap, washChannel)).put("isVideo",true);
     }
 
     //死猪事件
     private R getDeadPigChannel(Map<String, Object> paramsMap) throws ClientException {
-        String[] deadPigChannle = CommonConstant.SIZhuChannle;
-        return R.ok("请求成功").put("data", getEventList(paramsMap, deadPigChannle)).put("total", CountTimes(paramsMap, deadPigChannle));
+        String[] deadPigChannel = CommonConstant.SIZhuChannle;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, deadPigChannel)).put("total", CountTimes(paramsMap, deadPigChannel)).put("isVideo",true);
+    }
+
+    //熏蒸事件
+    private R getFumigateChannel(Map paramsMap) throws ClientException {
+        //绑定大门通道
+        String[] fumigateChannel = CommonConstant.FUMIGATE_CHANNEL;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, fumigateChannel)).put("total", CountTimes(paramsMap, fumigateChannel)).put("isVideo",true);
+    }
+
+    //卖猪事件
+    private R getSellPigsChannel(Map paramsMap) throws ClientException {
+        //卖猪通道
+        String[] sellPigsChannel = CommonConstant.SELL_PIGS_CHANNEL;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, sellPigsChannel)).put("total", CountTimes(paramsMap, sellPigsChannel)).put("isVideo",true);
     }
 
     //人员门禁事件
     private R getEntranceGuard(Map<String, Object> paramsMap) throws ClientException {
         //
-        return R.ok("请求成功").put("data", getAccidentRecord1(paramsMap)).put("total", parseTotal(get_person_record_totalpage(paramsMap).toString()));
+        return R.ok("请求成功").put("data", getAccidentRecord1(paramsMap)).put("total", parseTotal(get_person_record_totalpage(paramsMap).toString())).put("isVideo",false);
     }
 
     //解析总页码
@@ -112,7 +138,7 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
     private R getCarGateMachine(HttpServletRequest request, Map<String, Object> paramsMap) throws ClientException {
         Integer  farmId= (int) paramsMap.get("farmId");
         //
-        return R.ok("请求成功").put("data", getCarRecord(request,farmId));
+        return R.ok("请求成功").put("data", getCarRecord(request,farmId)).put("isVideo",false);
     }
 
     //查询车辆通行记录 by Yangdi

+ 0 - 1
huimv-farm-video/src/main/java/com/huimv/video/dhicc/timmer/SysTelcomEnentTimmer.java

@@ -153,6 +153,5 @@ public class SysTelcomEnentTimmer {
                     }
                }
            }
-
        }
 }