Browse Source

'先新增修改然后同步'

yq 2 years ago
parent
commit
be5f0593ec
1 changed files with 10 additions and 10 deletions
  1. 10 10
      src/main/java/com/usky/dxtop/service/job/SmJob.java

+ 10 - 10
src/main/java/com/usky/dxtop/service/job/SmJob.java

@@ -9,8 +9,6 @@ import com.usky.dxtop.common.utils.StringUtils;
 import com.usky.dxtop.common.utils.http.HttpUtils;
 import com.usky.dxtop.model.Dept;
 import com.usky.dxtop.model.Staff;
-import com.usky.dxtop.model.SysDept;
-import com.usky.dxtop.model.SysUser;
 import com.usky.dxtop.service.DeptService;
 import com.usky.dxtop.service.StaffService;
 import com.usky.dxtop.service.api.SmApi;
@@ -72,20 +70,22 @@ public class SmJob {
                 try {
                     if (enhanceStaff(date,depts,userListByNames)){
                         checkStaffList.add(date);
-                        //发送人员信息
-                        if (StringUtils.isNotBlank(date.getCardId()) && Double.parseDouble(date.getCardId()) > 60000){
-                            staffService.personSendMessage(date,date.getAddOrUp());
-                            //发送人脸信息
-                            if (StringUtils.isNotBlank(date.getFaceId())){
-                                staffService.faceSendMessage(date);
-                            }
-                        }
                     }
                 }catch (Exception e){
                     log.error("smJob-person:"+e.getMessage());
                 }
             });
             staffService.saveOrUpdateBatch(checkStaffList);
+            checkStaffList.forEach(date -> {
+                //发送人员信息
+                if (StringUtils.isNotBlank(date.getCardId()) && Double.parseDouble(date.getCardId()) > 60000){
+                    staffService.personSendMessage(date,date.getAddOrUp());
+                    //发送人脸信息
+                    if (StringUtils.isNotBlank(date.getFaceId())){
+                        staffService.faceSendMessage(date);
+                    }
+                }
+            });
             checkStaffList.clear();
             return list.isEmpty();
         });