|
@@ -11,6 +11,7 @@ import com.tzld.piaoquan.wecom.service.AccessTokenService;
|
|
|
import com.tzld.piaoquan.wecom.service.UserService;
|
|
|
import com.tzld.piaoquan.wecom.utils.HttpClientUtil;
|
|
|
import com.tzld.piaoquan.wecom.utils.HttpPoolClient;
|
|
|
+import com.tzld.piaoquan.wecom.utils.LarkRobotUtil;
|
|
|
import com.tzld.piaoquan.wecom.utils.page.Page;
|
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
@@ -126,6 +127,7 @@ public class WeComUserDataJob1 {
|
|
|
cursor = nextCursor;
|
|
|
} while (StringUtils.isEmpty(cursor));
|
|
|
} catch (IOException e) {
|
|
|
+ LarkRobotUtil.sendMessage("updateUser error" + e);
|
|
|
log.error("updateUser error", e);
|
|
|
}
|
|
|
}
|
|
@@ -198,18 +200,22 @@ public class WeComUserDataJob1 {
|
|
|
}
|
|
|
|
|
|
@XxlJob("insertStaffWithUserJob1")
|
|
|
- public ReturnT<String> insertStaffWithUserJob(String param) throws IOException {
|
|
|
- StaffExample example = new StaffExample();
|
|
|
- List<Staff> staffList = staffMapper.selectByExample(example);
|
|
|
- for (Staff staff : staffList) {
|
|
|
- List<String> externalUserIds = getUserList(staff.getCarrierId());
|
|
|
- if (CollectionUtils.isEmpty(externalUserIds)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- for (String externalUserId : externalUserIds) {
|
|
|
- userService.insertStaffWithUser(externalUserId, staff);
|
|
|
+ public ReturnT<String> insertStaffWithUserJob(String param) {
|
|
|
+ try {
|
|
|
+ StaffExample example = new StaffExample();
|
|
|
+ List<Staff> staffList = staffMapper.selectByExample(example);
|
|
|
+ for (Staff staff : staffList) {
|
|
|
+ List<String> externalUserIds = getUserList(staff.getCarrierId());
|
|
|
+ if (CollectionUtils.isEmpty(externalUserIds)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (String externalUserId : externalUserIds) {
|
|
|
+ userService.insertStaffWithUser(externalUserId, staff);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+ }catch (Exception e){
|
|
|
+ LarkRobotUtil.sendMessage("insertStaffWithUserJob error" + e);
|
|
|
+ log.error("insertStaffWithUserJob error", e);
|
|
|
}
|
|
|
|
|
|
return ReturnT.SUCCESS;
|