|
@@ -68,6 +68,8 @@ public class CheckTask {
|
|
|
*/
|
|
|
public void singleTask() throws IOException {
|
|
|
List<Object> modifiedUsers = new ArrayList<>();
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ sb.append("用户地市变化:");
|
|
|
try (CSVParser parser = CSVFormat.DEFAULT.builder().build()
|
|
|
.parse(new InputStreamReader(Files.newInputStream(Paths.get(taskConfig.getDistinctFilename())),
|
|
|
StandardCharsets.UTF_8))) {
|
|
@@ -75,15 +77,17 @@ public class CheckTask {
|
|
|
Map<Object, Map<String, Object>> userMap = getUserMap();
|
|
|
for (CSVRecord t : parser) {
|
|
|
String loginName = t.get(0);
|
|
|
- String orgName = t.get(2);
|
|
|
String cityId = t.get(8);
|
|
|
// loginNames.add(loginName);
|
|
|
- checkUserInfoChanged(modifiedUsers, userMap, orgName, loginName, cityId);
|
|
|
+ checkUserInfoChanged(sb,modifiedUsers, userMap, loginName, cityId);
|
|
|
}
|
|
|
// checkDeletedUser(loginNames);
|
|
|
checkRoleCity();
|
|
|
if (!CollectionUtils.isEmpty(modifiedUsers)) {
|
|
|
- log.error("信息变化用户: {}", JSON.toJSONString(modifiedUsers));
|
|
|
+ log.warn("信息变化用户: {}", JSON.toJSONString(modifiedUsers));
|
|
|
+ XxlJobHelper.log("信息变化用户: {}", JSON.toJSONString(modifiedUsers));
|
|
|
+ log.error(sb.toString());
|
|
|
+ XxlJobHelper.log(sb.toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -106,14 +110,14 @@ public class CheckTask {
|
|
|
/**
|
|
|
* 检查用户信息改变了
|
|
|
*
|
|
|
+ * @param sb 用户信息变化
|
|
|
* @param modifiedUsers 修改用户
|
|
|
* @param userMap 用户映射
|
|
|
- * @param orgName 组织名字
|
|
|
* @param loginName 登录名
|
|
|
* @param cityId 城市标识
|
|
|
*/
|
|
|
- private void checkUserInfoChanged(List<Object> modifiedUsers, Map<Object, Map<String, Object>> userMap,
|
|
|
- String orgName, String loginName, String cityId) {
|
|
|
+ private void checkUserInfoChanged(StringBuilder sb, List<Object> modifiedUsers,
|
|
|
+ Map<Object, Map<String, Object>> userMap, String loginName, String cityId) {
|
|
|
// 检查用户信息变化
|
|
|
Map<String, Object> user = userMap.get(loginName);
|
|
|
// boolean infoChanged = user != null
|
|
@@ -122,10 +126,10 @@ public class CheckTask {
|
|
|
&& !cityId.equals(String.valueOf(user.get("city_id")));
|
|
|
if (infoChanged) {
|
|
|
modifiedUsers.add(user.get("user_id"));
|
|
|
- log.warn("用户 {} 信息变化: {} -> {}, {} -> {}", user.get("user_id"), user.get("city_id"), cityId,
|
|
|
- user.get("org"), orgName);
|
|
|
- XxlJobHelper.log("用户 {} 信息变化: {} -> {}, {} -> {}", user.get("user_id"),
|
|
|
- user.get("city_id"), cityId, user.get("org"), orgName);
|
|
|
+ sb.append(loginName).append(":").append(user.get("city_id")).append("->").append(cityId).append(",");
|
|
|
+ log.warn("用户 {} 信息变化: {} -> {}", user.get("user_id"), user.get("city_id"), cityId);
|
|
|
+ XxlJobHelper.log("用户 {} 信息变化: {} -> {}", user.get("user_id"),
|
|
|
+ user.get("city_id"), cityId);
|
|
|
}
|
|
|
}
|
|
|
|