Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/V1' into V1

zhengqiang 5 anni fa
parent
commit
74d0ebf07d

+ 3 - 2
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceLogServiceImpl.java

@@ -84,11 +84,12 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
             log.error("保存图片路径错误" + e.getMessage());
         }
 
+        Integer personId = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
 
         PersonDeviceLog personDeviceLog = new PersonDeviceLog();
         personDeviceLog.setId(UUID.randomUUID().toString());
         personDeviceLog.setDeviceNo(deviceNo);
-        personDeviceLog.setPersonId(LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo));
+        personDeviceLog.setPersonId(personId);
 
         personDeviceLog.setTemperature(temperature);
         if (StringUtils.isNotBlank(libMatInfoListJson.getStr("MatchStatus"))) {
@@ -109,7 +110,7 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
         //人员识别成功,温度超过限定时发送模板消息给监管者
         new Thread(()->{
             try {
-                if (personDeviceLog.getPersonId() != 0) {
+                if (personId != 0) {
                     sendTemperatureAlarmsyncTask(personDeviceLog);
                 }
             }

+ 158 - 130
common/src/main/java/com/jpsoft/smart/modules/lapi/service/impl/LapiServiceImpl.java

@@ -95,48 +95,63 @@ public class LapiServiceImpl implements ILapiService {
 
         List<LapiResult> lapiResultList = new ArrayList<>();
         for (DeviceInfo deviceInfo : deviceList) {
-            HashMap<String, Object> map = new HashMap<>();
-            map.put("Num", 1L);
-            HashMap<String, Object> map1 = new HashMap<>();
-            map1.put("PersonID", personInfo.getId());
-            map1.put("LastChange", new Date().getTime());
-            map1.put("PersonCode", personInfo.getId().toString());
-            map1.put("PersonName", personInfo.getName() + "_" + personInfo.getId().toString());
-            map1.put("Remarks", companyInfo.getName());
-
-            //TimeTemplateNum 首字符必须大写
-            map1.put("TimeTemplateNum", 0L);
-
-            map1.put("IdentificationNum", 1L);
-            HashMap<String, Object> map2 = new HashMap<>();
-            List listMap2 = new ArrayList();
-            listMap2.add(map2);
-            map2.put("Type", 0L);
-            map2.put("Number", personInfo.getIdCard());
-            map1.put("IdentificationList", listMap2);
-            map1.put("ImageNum", 1L);
-
-            HashMap<String, Object> map3 = new HashMap<>();
-            map3.put("FaceID", personInfo.getId());
-            map3.put("Name", personInfo.getId() + ".jpg");
-
-            //照片base64长度
-            Integer imageSize = base64Data.length();
-            map3.put("Size", imageSize);
-            map3.put("Data", base64Data);
-            List listMap3 = new ArrayList();
-            listMap3.add(map3);
-            map1.put("ImageList", listMap3);
-            List listMap1 = new ArrayList();
-            listMap1.add(map1);
-            map.put("PersonInfoList", listMap1);
-
             try {
-                //照片字节大小
-                Integer fileSize = imageSize - (imageSize/8)*2;
-                if (fileSize > 512 * 1024 || fileSize < 10 * 1024) {
-                    throw new Exception("人员照片大小限定为10k~512k");
+                HashMap<String, Object> map = new HashMap<>();
+                map.put("Num", 1L);
+                HashMap<String, Object> map1 = new HashMap<>();
+                map1.put("PersonID", personInfo.getId());
+                map1.put("LastChange", new Date().getTime());
+                map1.put("PersonCode", personInfo.getId().toString());
+                map1.put("PersonName", personInfo.getName() + "_" + personInfo.getId().toString());
+                map1.put("Remarks", companyInfo.getName());
+
+                //TimeTemplateNum 首字符必须大写
+                map1.put("TimeTemplateNum", 0L);
+
+                map1.put("IdentificationNum", 1L);
+                HashMap<String, Object> map2 = new HashMap<>();
+                List listMap2 = new ArrayList();
+                listMap2.add(map2);
+                map2.put("Type", 0L);
+                map2.put("Number", personInfo.getIdCard());
+                map1.put("IdentificationList", listMap2);
+
+
+                HashMap<String, Object> map3 = new HashMap<>();
+
+
+                if (StringUtils.isNotBlank(base64Data)){
+
+                    Integer imageSize = base64Data.length();
+                    //照片字节大小
+                    Integer fileSize = imageSize - (imageSize / 8) * 2;
+                    if (fileSize > 512 * 1024 || fileSize < 10 * 1024) {
+                        throw new Exception("人员照片大小限定为10k~512k");
+                    }
+                    map3.put("Size", imageSize);
+                    map3.put("Data", base64Data);
+                    map3.put("FaceID", personInfo.getId());
+                    map3.put("Name", personInfo.getId() + ".jpg");
+                }
+                else {
+                    map1.put("ImageNum", 0);
+                    map3.put("FaceID", 0);
+                    map3.put("Name", "");
+                    map3.put("Size", 0);
+                    map3.put("Data", "");
                 }
+
+                //照片base64长度
+
+                List listMap3 = new ArrayList();
+                listMap3.add(map3);
+                map1.put("ImageList", listMap3);
+                List listMap1 = new ArrayList();
+                listMap1.add(map1);
+                map.put("PersonInfoList", listMap1);
+
+
+
                 //获取人员人脸库id
                 String faceDbId = getFaceDbId(deviceInfo, companyInfo.getName());
 
@@ -144,18 +159,18 @@ public class LapiServiceImpl implements ILapiService {
                 JSONObject dataJson = jsonObject.getJSONObject("Response");
                 JSONObject response = LApiUtil.getResponse(dataJson);
                 if (dataJson.getInteger("ResponseCode") == 0 && dataJson.getInteger("StatusCode") == 0) {
-                    Boolean success = isSuccessAddPerson(personInfo,deviceInfo,faceDbId);
-                    HashMap<String,Object> dataMap = new HashMap<>();
-                    dataMap.put("deviceId",deviceInfo.getId());
-                    dataMap.put("deviceAliasName",deviceInfo.getAliasName());
-                    dataMap.put("personName",personInfo.getName());
+                    Boolean success = isSuccessAddPerson(personInfo, deviceInfo, faceDbId);
+                    HashMap<String, Object> dataMap = new HashMap<>();
+                    dataMap.put("deviceId", deviceInfo.getId());
+                    dataMap.put("deviceAliasName", deviceInfo.getAliasName());
+                    dataMap.put("personName", personInfo.getName());
                     LapiResult lapiResult = new LapiResult();
-                    if (success){
+                    if (success) {
                         lapiResult.setMsg("绑定成功");
                         lapiResult.setSuccess(true);
                         lapiResult.setData(dataMap);
                         lapiResultList.add(lapiResult);
-                    }else {
+                    } else {
                         lapiResult.setMsg("绑定失败");
                         lapiResult.setSuccess(false);
                         lapiResult.setData(dataMap);
@@ -165,13 +180,13 @@ public class LapiServiceImpl implements ILapiService {
                 }
             } catch (Exception e) {
                 log.error(e.getMessage());
-                HashMap<String,Object> dataMap = new HashMap<>();
-                dataMap.put("deviceId",deviceInfo.getId());
-                dataMap.put("deviceAliasName",deviceInfo.getAliasName());
-                dataMap.put("personName",personInfo.getName());
+                HashMap<String, Object> dataMap = new HashMap<>();
+                dataMap.put("deviceId", deviceInfo.getId());
+                dataMap.put("deviceAliasName", deviceInfo.getAliasName());
+                dataMap.put("personName", personInfo.getName());
                 LapiResult lapiResult = new LapiResult();
                 lapiResult.setSuccess(false);
-                lapiResult.setMsg(e.getMessage().contains("timed out")?"设备连接超时":e.getMessage());
+                lapiResult.setMsg(e.getMessage().contains("timed out") ? "设备连接超时" : e.getMessage());
                 lapiResult.setData(dataMap);
                 lapiResultList.add(lapiResult);
             }
@@ -182,7 +197,7 @@ public class LapiServiceImpl implements ILapiService {
 
     @Override
     public List<LapiResult> addPersonForDeviceIds(Long id, String deviceIds) throws Exception {
-        if (StringUtils.isBlank(deviceIds)){
+        if (StringUtils.isBlank(deviceIds)) {
             throw new Exception("设备为空");
         }
         PersonInfo personInfo = personInfoService.get(id);
@@ -192,97 +207,111 @@ public class LapiServiceImpl implements ILapiService {
         List<String> deviceIdList = Arrays.asList(deviceIds.split(","));
         List<LapiResult> lapiResultList = new ArrayList<>();
 
-            for (String deviceId : deviceIdList) {
-                DeviceInfo deviceInfo = deviceInfoService.get(deviceId);
-                try {
-                    HashMap<String, Object> map = new HashMap<>();
-                    map.put("Num", 1L);
-                    HashMap<String, Object> map1 = new HashMap<>();
-                    map1.put("PersonID", personInfo.getId());
-                    map1.put("LastChange", new Date().getTime());
-                    map1.put("PersonCode", personInfo.getId().toString());
-                    map1.put("PersonName", personInfo.getName() + "_" + personInfo.getId().toString());
-                    map1.put("Remarks", companyInfo.getName());
-
-                    //TimeTemplateNum 首字符必须大写
-                    map1.put("TimeTemplateNum", 0L);
-
-                    map1.put("IdentificationNum", 1L);
-                    HashMap<String, Object> map2 = new HashMap<>();
-                    List listMap2 = new ArrayList();
-                    listMap2.add(map2);
-                    map2.put("Type", 0L);
-                    map2.put("Number", personInfo.getIdCard());
-                    map1.put("IdentificationList", listMap2);
-                    map1.put("ImageNum", 1L);
+        for (String deviceId : deviceIdList) {
+            DeviceInfo deviceInfo = deviceInfoService.get(deviceId);
+            try {
+                HashMap<String, Object> map = new HashMap<>();
+                map.put("Num", 1L);
+                HashMap<String, Object> map1 = new HashMap<>();
+                map1.put("PersonID", personInfo.getId());
+                map1.put("LastChange", new Date().getTime());
+                map1.put("PersonCode", personInfo.getId().toString());
+                map1.put("PersonName", personInfo.getName() + "_" + personInfo.getId().toString());
+                map1.put("Remarks", companyInfo.getName());
+
+                //TimeTemplateNum 首字符必须大写
+                map1.put("TimeTemplateNum", 0L);
+
+                map1.put("IdentificationNum", 1L);
+                HashMap<String, Object> map2 = new HashMap<>();
+                List listMap2 = new ArrayList();
+                listMap2.add(map2);
+                map2.put("Type", 0L);
+                map2.put("Number", personInfo.getIdCard());
+                map1.put("IdentificationList", listMap2);
+
+
+                HashMap<String, Object> map3 = new HashMap<>();
+
 
-                    HashMap<String, Object> map3 = new HashMap<>();
-                    map3.put("FaceID", personInfo.getId());
-                    map3.put("Name", personInfo.getId() + ".jpg");
 
+                if (StringUtils.isNotBlank(base64Data)){
+                    map1.put("ImageNum", 1L);
                     //照片base64长度
                     Integer imageSize = base64Data.length();
+                    map3.put("Name", personInfo.getId() + ".jpg");
                     map3.put("Size", imageSize);
                     map3.put("Data", base64Data);
-                    List listMap3 = new ArrayList();
-                    listMap3.add(map3);
-                    map1.put("ImageList", listMap3);
-                    List listMap1 = new ArrayList();
-                    listMap1.add(map1);
-                    map.put("PersonInfoList", listMap1);
+                    map3.put("FaceID", personInfo.getId());
 
                     //照片字节大小
-                    Integer fileSize = imageSize - (imageSize/8)*2;
+                    Integer fileSize = imageSize - (imageSize / 8) * 2;
 
                     if (fileSize > 512 * 1024 || fileSize < 10 * 1024) {
                         throw new Exception("人员照片大小限定为10k~512k");
                     }
-                    //获取人员人脸库id
-                    String faceDbId = getFaceDbId(deviceInfo, companyInfo.getName());
-
-                    JSONObject jsonObject = LApiUtil.PostRequest(deviceInfo.getIpAddress() + ":" + deviceInfo.getPort() + LApiConstant.ADDPERSON + faceDbId + "/People", map);
-                    JSONObject dataJson = jsonObject.getJSONObject("Response");
-                    JSONObject response = LApiUtil.getResponse(dataJson);
-                    if (dataJson.getInteger("ResponseCode") == 0 && dataJson.getInteger("StatusCode") == 0) {
-                        Boolean success = isSuccessAddPerson(personInfo,deviceInfo,faceDbId);
-                        HashMap<String,Object> dataMap = new HashMap<>();
-                        dataMap.put("deviceId",deviceInfo.getId());
-                        dataMap.put("deviceAliasName",deviceInfo.getAliasName());
-                        dataMap.put("personName",personInfo.getName());
-                        LapiResult lapiResult = new LapiResult();
-                        if (success){
-                            lapiResult.setMsg("绑定成功");
-                            lapiResult.setSuccess(true);
-                            lapiResult.setData(dataMap);
-                            lapiResultList.add(lapiResult);
-                        }else {
-                            lapiResult.setMsg("绑定失败");
-                            lapiResult.setSuccess(false);
-                            lapiResult.setData(dataMap);
-                            lapiResultList.add(lapiResult);
-                        }
+                }
+                else {
+                    map1.put("ImageNum", 0);
+                    map3.put("FaceID", 0);
+                    map3.put("Name", "");
+                    map3.put("Size", 0);
+                    map3.put("Data", "");
+                }
 
+                List listMap3 = new ArrayList();
+                listMap3.add(map3);
+                map1.put("ImageList", listMap3);
+                List listMap1 = new ArrayList();
+                listMap1.add(map1);
+                map.put("PersonInfoList", listMap1);
 
-                    }
 
+                //获取人员人脸库id
+                String faceDbId = getFaceDbId(deviceInfo, companyInfo.getName());
 
-                }catch (Exception e){
-                    log.error(e.getMessage());
-                    HashMap<String,Object> dataMap = new HashMap<>();
-                    dataMap.put("deviceId",deviceInfo.getId());
-                    dataMap.put("deviceAliasName",deviceInfo.getAliasName());
-                    dataMap.put("personName",personInfo.getName());
+                JSONObject jsonObject = LApiUtil.PostRequest(deviceInfo.getIpAddress() + ":" + deviceInfo.getPort() + LApiConstant.ADDPERSON + faceDbId + "/People", map);
+                JSONObject dataJson = jsonObject.getJSONObject("Response");
+                JSONObject response = LApiUtil.getResponse(dataJson);
+                if (dataJson.getInteger("ResponseCode") == 0 && dataJson.getInteger("StatusCode") == 0) {
+                    Boolean success = isSuccessAddPerson(personInfo, deviceInfo, faceDbId);
+                    HashMap<String, Object> dataMap = new HashMap<>();
+                    dataMap.put("deviceId", deviceInfo.getId());
+                    dataMap.put("deviceAliasName", deviceInfo.getAliasName());
+                    dataMap.put("personName", personInfo.getName());
                     LapiResult lapiResult = new LapiResult();
-                    lapiResult.setSuccess(false);
-                    lapiResult.setMsg(e.getMessage().contains("timed out")?"设备连接超时":e.getMessage());
-                    lapiResult.setData(dataMap);
-                    lapiResultList.add(lapiResult);
+                    if (success) {
+                        lapiResult.setMsg("绑定成功");
+                        lapiResult.setSuccess(true);
+                        lapiResult.setData(dataMap);
+                        lapiResultList.add(lapiResult);
+                    } else {
+                        lapiResult.setMsg("绑定失败");
+                        lapiResult.setSuccess(false);
+                        lapiResult.setData(dataMap);
+                        lapiResultList.add(lapiResult);
+                    }
+
+
                 }
 
 
+            } catch (Exception e) {
+                log.error(e.getMessage());
+                HashMap<String, Object> dataMap = new HashMap<>();
+                dataMap.put("deviceId", deviceInfo.getId());
+                dataMap.put("deviceAliasName", deviceInfo.getAliasName());
+                dataMap.put("personName", personInfo.getName());
+                LapiResult lapiResult = new LapiResult();
+                lapiResult.setSuccess(false);
+                lapiResult.setMsg(e.getMessage().contains("timed out") ? "设备连接超时" : e.getMessage());
+                lapiResult.setData(dataMap);
+                lapiResultList.add(lapiResult);
             }
 
 
+        }
+
 
         return lapiResultList;
     }
@@ -322,8 +351,7 @@ public class LapiServiceImpl implements ILapiService {
 
 
             }
-        }
-        else {
+        } else {
             faceDbId = getDefaultLib(deviceInfo.getId());
         }
 
@@ -691,11 +719,11 @@ public class LapiServiceImpl implements ILapiService {
     }
 
     @Override
-    public Boolean isSuccessAddPerson(PersonInfo personInfo,DeviceInfo deviceInfo,String faceDbId) {
+    public Boolean isSuccessAddPerson(PersonInfo personInfo, DeviceInfo deviceInfo, String faceDbId) {
         HashMap map = new HashMap();
         map.put("Num", 1);
-        map.put("Limit",3);
-        map.put("Offset",0);
+        map.put("Limit", 3);
+        map.put("Offset", 0);
         List list = new ArrayList();
         HashMap map1 = new HashMap();
         map1.put("QryType", 27);
@@ -703,15 +731,15 @@ public class LapiServiceImpl implements ILapiService {
         map1.put("QryData", personInfo.getId().toString());
         list.add(map1);
         map.put("QueryInfos", list);
-        try{
-            JSONObject jsonObject = LApiUtil.PostRequest(deviceInfo.getIpAddress() + ":" + deviceInfo.getPort() + LApiConstant.ADDPERSON +faceDbId +"/People/Info", map);
+        try {
+            JSONObject jsonObject = LApiUtil.PostRequest(deviceInfo.getIpAddress() + ":" + deviceInfo.getPort() + LApiConstant.ADDPERSON + faceDbId + "/People/Info", map);
             JSONObject dataJson = jsonObject.getJSONObject("Response");
             JSONObject response = LApiUtil.getResponse(dataJson);
             Integer num = response.getInteger("Total");
-            if (num >0){
+            if (num > 0) {
                 return true;
             }
-        }catch (Exception e){
+        } catch (Exception e) {
 
             return false;
         }

+ 61 - 61
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonDeviceRelationController.java

@@ -95,19 +95,19 @@ public class PersonDeviceRelationController {
                 //往设备库传输人脸信息
                 PersonInfo personInfo = personInfoService.get(personDeviceRelation.getPersonId());
                 //如果人员照片不为空
-                if(StringUtils.isNotEmpty(personInfo.getFaceImageUrl())){
-                    List<LapiResult> lapiResults = lapiService.addPersonForDeviceIds(personDeviceRelation.getPersonId(),personDeviceRelation.getDeviceId());
-                    for (int i = 0; i < lapiResults.size(); i++) {
-                        LapiResult lapiMsgResult = lapiResults.get(i);
-                        if (lapiMsgResult.isSuccess()) {
-                            msgResult.setResult(true);
-                        }else{
-                            throw new Exception("添加失败:" + lapiMsgResult.getMsg());
+                //if(StringUtils.isNotEmpty(personInfo.getFaceImageUrl())){
+                List<LapiResult> lapiResults = lapiService.addPersonForDeviceIds(personDeviceRelation.getPersonId(),personDeviceRelation.getDeviceId());
+                for (int i = 0; i < lapiResults.size(); i++) {
+                    LapiResult lapiMsgResult = lapiResults.get(i);
+                    if (lapiMsgResult.isSuccess()) {
+                        msgResult.setResult(true);
+                    }else{
+                        throw new Exception("添加失败:" + lapiMsgResult.getMsg());
                     }
-                    }
-                }else{
-                    throw new Exception("添加失败:人员没有上传照片" );
                 }
+                //}else{
+                    //throw new Exception("添加失败:人员没有上传照片" );
+                //}
                 msgResult.setResult(true);
                 msgResult.setData(personDeviceRelation);
             } else {
@@ -167,39 +167,39 @@ public class PersonDeviceRelationController {
                 //往设备库传输人脸信息
                 PersonInfo personInfo = personInfoService.get(personId);
                 //如果人员照片不为空
-                if(StringUtils.isNotEmpty(personInfo.getFaceImageUrl())) {
-                    List<LapiResult> lapiResults = lapiService.addPerson(personId);
-                    for (int i = 0; i < lapiResults.size(); i++) {
-                        LapiResult lapiResult = lapiResults.get(i);
-                        if (lapiResult.isSuccess()) {
-                            msgResult.setResult(true);
-                        } else {
-                            String personName = "";
-                            if (personInfo != null) {
-                                personName = personInfo.getName();
-                            }
-                            Map resultMap = (Map) lapiResult.getData();
-                            HSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1);
-                            HSSFCell cell1 = row.createCell(0);
-                            cell1.setCellValue(personName);
-                            HSSFCell cell2 = row.createCell(1);
-                            cell2.setCellValue(resultMap.get("deviceAliasName").toString());
-                            HSSFCell cell3 = row.createCell(2);
-                            cell3.setCellValue("添加失败:");
-                            HSSFCell cell4 = row.createCell(3);
-                            cell4.setCellValue(lapiResult.getMsg());
-
-                            //删除绑定关系
-                            PersonDeviceRelation personDeviceRelation = personDeviceRelationService.findByDeviceIdAndPersonId(resultMap.get("deviceId").toString(), personId);
-                            personDeviceRelation.setDelFlag(true);
-                            personDeviceRelation.setUpdateBy(subject);
-                            personDeviceRelation.setUpdateTime(new Date());
-
-                            personDeviceRelationService.update(personDeviceRelation);
-                            addCount++;
+                //if(StringUtils.isNotEmpty(personInfo.getFaceImageUrl())) {
+                List<LapiResult> lapiResults = lapiService.addPerson(personId);
+                for (int i = 0; i < lapiResults.size(); i++) {
+                    LapiResult lapiResult = lapiResults.get(i);
+                    if (lapiResult.isSuccess()) {
+                        msgResult.setResult(true);
+                    } else {
+                        String personName = "";
+                        if (personInfo != null) {
+                            personName = personInfo.getName();
                         }
+                        Map resultMap = (Map) lapiResult.getData();
+                        HSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1);
+                        HSSFCell cell1 = row.createCell(0);
+                        cell1.setCellValue(personName);
+                        HSSFCell cell2 = row.createCell(1);
+                        cell2.setCellValue(resultMap.get("deviceAliasName").toString());
+                        HSSFCell cell3 = row.createCell(2);
+                        cell3.setCellValue("添加失败:");
+                        HSSFCell cell4 = row.createCell(3);
+                        cell4.setCellValue(lapiResult.getMsg());
+
+                        //删除绑定关系
+                        PersonDeviceRelation personDeviceRelation = personDeviceRelationService.findByDeviceIdAndPersonId(resultMap.get("deviceId").toString(), personId);
+                        personDeviceRelation.setDelFlag(true);
+                        personDeviceRelation.setUpdateBy(subject);
+                        personDeviceRelation.setUpdateTime(new Date());
+
+                        personDeviceRelationService.update(personDeviceRelation);
+                        addCount++;
                     }
                 }
+                //}
 //
 
 
@@ -276,26 +276,26 @@ public class PersonDeviceRelationController {
                         //往设备库传输人脸信息
                         //批量操作
 
-                        PersonInfo personInfo = personInfoService.get(personId);
-                        //如果人员照片为空
-                        if(StringUtils.isEmpty(personInfo.getFaceImageUrl())){
-                            HSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1);
-                            HSSFCell cell1 = row.createCell(0);
-                            cell1.setCellValue(personInfo.getName());
-                            HSSFCell cell2 = row.createCell(1);
-                            cell2.setCellValue("");
-                            HSSFCell cell3 = row.createCell(2);
-                            cell3.setCellValue("添加失败:");
-                            HSSFCell cell4 = row.createCell(3);
-                            cell4.setCellValue("人员没有上传照片");
-                            addCount++;
-                            //删除绑定关系
-                            item.setDelFlag(true);
-                            item.setUpdateBy(subject);
-                            item.setUpdateTime(new Date());
-                            personDeviceRelationService.update(item);
-                            continue;
-                        }
+//                        PersonInfo personInfo = personInfoService.get(personId);
+//                        //如果人员照片为空
+//                        if(StringUtils.isEmpty(personInfo.getFaceImageUrl())){
+//                            HSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1);
+//                            HSSFCell cell1 = row.createCell(0);
+//                            cell1.setCellValue(personInfo.getName());
+//                            HSSFCell cell2 = row.createCell(1);
+//                            cell2.setCellValue("");
+//                            HSSFCell cell3 = row.createCell(2);
+//                            cell3.setCellValue("添加失败:");
+//                            HSSFCell cell4 = row.createCell(3);
+//                            cell4.setCellValue("人员没有上传照片");
+//                            addCount++;
+//                            //删除绑定关系
+//                            item.setDelFlag(true);
+//                            item.setUpdateBy(subject);
+//                            item.setUpdateTime(new Date());
+//                            personDeviceRelationService.update(item);
+//                            continue;
+//                        }
 
                         List<LapiResult> lapiResults = lapiService.addPersonForDeviceIds(personId,deviceId);