From 7dcbd445ad33d7abc0689f80ba56f5b3f7e21e4d Mon Sep 17 00:00:00 2001
From: 张磊磊 <201175954@qq.com>
Date: 星期三, 01 十一月 2023 16:41:48 +0800
Subject: [PATCH] 接收数据/ai接口

---
 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java |   80 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java
index 6ab68f7..f167c84 100644
--- a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java
+++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java
@@ -1,5 +1,6 @@
 package com.thhy.materials.modules.biz.helmet.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.thhy.general.common.BasicResult;
@@ -135,9 +136,9 @@
     }
 
     @Override
-    public void smockInsert(TDataSmock tDataSmock) {
+    public void smockIn(TDataSmock tDataSmock) {
         System.out.println("参数为---"+tDataSmock.toString());
-        helmetMapper.smockInsert(tDataSmock);
+        helmetMapper.smockIn(tDataSmock);
     }
 
     @Override
@@ -159,4 +160,79 @@
         PageInfo<TDataValue> tDataValuePageInfo = new PageInfo<>(dataSmocks);
         return BasicResult.success(tDataValuePageInfo);
     }
+
+    @Override
+    public BasicResult dataBox(JSONObject result) {
+
+        Integer type = Integer.valueOf(result.get("type").toString());
+
+        TDataAi tDataAi = new TDataAi();
+        //公共参数
+        tDataAi.setType(type);
+        tDataAi.setTypeName(result.get("typeName").toString());
+        tDataAi.setRtspUrl(result.getString("rtspUrl"));
+        tDataAi.setBoxId(Integer.valueOf(result.get("boxId").toString()));
+        tDataAi.setBoxName(result.get("boxName").toString());
+        tDataAi.setDeviceName(result.get("deviceName").toString());
+        tDataAi.setDeviceId(result.get("deviceId").toString());
+        tDataAi.setEnterName(result.get("enterName").toString());
+        tDataAi.setEnterCode(result.get("enterCode").toString());
+        //图片上传
+
+        //上边缺少图片处理
+        tDataAi.setSignTime(result.get("signTime").toString());
+        tDataAi.setChannelNo(result.get("channelNo").toString());
+        tDataAi.setX(result.getIntValue("x"));
+        tDataAi.setY(result.getIntValue("y"));
+        tDataAi.setW(result.getIntValue("w"));
+        tDataAi.setH(result.getIntValue("h"));
+
+        if(type==1){//人脸
+            tDataAi.setAge(result.getIntValue("age"));
+            tDataAi.setGender(result.getIntValue("gender"));
+            tDataAi.setGlasses(result.getIntValue("glasses"));
+            tDataAi.setMask(result.getIntValue("mask"));
+            //人脸照片 base64 (需要解密)
+            tDataAi.setCertifiedAvatarUrl(result.getString("certifiedAvatarURL"));
+
+            tDataAi.setFaceId(result.getIntValue("faceId"));
+            tDataAi.setPersonType(result.getIntValue("personType"));
+            tDataAi.setFaceMaxSorce(result.getString("faceMaxSorce"));
+            tDataAi.setPersonName(result.getString("personName"));
+
+
+        }else if(type==2){//人体
+
+
+
+
+        }else if(type==3){//车辆
+            tDataAi.setLicensePlateNumber(result.getString("licensePlateNumber"));
+            tDataAi.setIllegalParking(result.getIntValue("illegalParking"));
+
+        }else if(type==4){//电动车
+            tDataAi.setEBike(result.getIntValue("eBike"));
+        }else if(type==5){//烟火
+            tDataAi.setSmoke(result.getIntValue("smoke"));
+            tDataAi.setFire(result.getIntValue("fire"));
+
+        }else if(type==6){//离岗
+            tDataAi.setIsExist(result.getIntValue("isExist"));
+        }else if(type==8){//灭火器
+            tDataAi.setExt(result.getIntValue("ext"));
+        }else if(type==10){//油罐车
+            tDataAi.setTanker(result.getIntValue("tanker"));
+        }else if(type==16){//睡岗
+            //
+
+        } else if(type==23){//杂物堆积
+            tDataAi.setSudire(result.getIntValue("sudire"));
+        }else if(type==24){//摄像头遮挡
+            tDataAi.setCover(result.getIntValue("cover"));
+        }else if(type==26){//消防通道占用
+            tDataAi.setFireControl(result.getIntValue("fireControl"));
+        }
+        helmetMapper.dataBox(tDataAi);
+        return BasicResult.success();
+    }
 }

--
Gitblit v1.9.3