xiao547607 5 năm trước cách đây
mục cha
commit
b50ed76f11

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

@@ -289,6 +289,11 @@ public class PersonDeviceRelationController {
                             HSSFCell cell4 = row.createCell(3);
                             cell4.setCellValue("人员没有上传照片");
                             addCount++;
+                            //删除绑定关系
+                            item.setDelFlag(true);
+                            item.setUpdateBy(subject);
+                            item.setUpdateTime(new Date());
+                            personDeviceRelationService.update(item);
                             continue;
                         }
 
@@ -312,11 +317,10 @@ public class PersonDeviceRelationController {
                                 cell4.setCellValue(lapiMsgResult.getMsg());
 
                                 //删除绑定关系
-                                PersonDeviceRelation personDeviceRelation = personDeviceRelationService.findByDeviceIdAndPersonId(deviceId,personId);
-                                personDeviceRelation.setDelFlag(true);
-                                personDeviceRelation.setUpdateBy(subject);
-                                personDeviceRelation.setUpdateTime(new Date());
-                                personDeviceRelationService.update(personDeviceRelation);
+                                item.setDelFlag(true);
+                                item.setUpdateBy(subject);
+                                item.setUpdateTime(new Date());
+                                personDeviceRelationService.update(item);
                                 addCount ++;
                             }
                         }