|
|
@@ -13,6 +13,7 @@ import com.tzld.piaoquan.wecom.utils.HttpPoolClient;
|
|
|
import com.tzld.piaoquan.wecom.utils.page.Page;
|
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.checkerframework.checker.units.qual.A;
|
|
|
@@ -26,6 +27,7 @@ import java.util.List;
|
|
|
|
|
|
import static com.tzld.piaoquan.wecom.common.constant.WeComConstant.*;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Component
|
|
|
public class WeComUserDataJob {
|
|
|
|
|
|
@@ -76,6 +78,7 @@ public class WeComUserDataJob {
|
|
|
int sum = 0;
|
|
|
for (int i = 0; i < page; i++) {
|
|
|
String res = getUser(size, i * size, startTime, endTime, staff.getStaffExtId());
|
|
|
+ log.info("insertAllUser size={}, i={}, staffExtId = {}, startTime={}, endTime={}, res={}", size, i, staff.getStaffExtId(), startTime, endTime, res);
|
|
|
if (ObjectUtils.isEmpty(res)) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -112,13 +115,13 @@ public class WeComUserDataJob {
|
|
|
}
|
|
|
if (jsonArray.size() < size) {
|
|
|
if (total > sum) {
|
|
|
- System.out.println("插入数量不足");
|
|
|
+ log.error("insertAllUser插入数量不足 total = {}, sum={}", total, sum);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error("insertAllUser error", e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -175,6 +178,7 @@ public class WeComUserDataJob {
|
|
|
int sum = 0;
|
|
|
for (int i = 0; i < page; i++) {
|
|
|
String res = getUpdateUser(size, i * size, startTime, endTime, staff.getStaffExtId());
|
|
|
+ log.info("updateUser size={}, i={}, staffExtId = {}, startTime={}, endTime={}, res={}", size, i, staff.getStaffExtId(), startTime, endTime, res);
|
|
|
if (ObjectUtils.isEmpty(res)) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -215,16 +219,13 @@ public class WeComUserDataJob {
|
|
|
}
|
|
|
if (jsonArray.size() < size) {
|
|
|
if (total > sum) {
|
|
|
-
|
|
|
- System.out.println(total);
|
|
|
- System.out.println(sum);
|
|
|
- System.out.println("插入数量不足");
|
|
|
+ log.error("updateUser插入数量不足 total = {}, sum={}", total, sum);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error("updateUser error", e);
|
|
|
}
|
|
|
}
|
|
|
|