|
|
@@ -228,27 +228,26 @@ public class DataUtil {
|
|
|
JsonParser jsonParser = new JsonParser();
|
|
|
|
|
|
Map<String, String> idMap = new HashMap<>();
|
|
|
- for (Map<String, Object> userMap : xjrUsers) {
|
|
|
- XjrUser user = SqlRunnerAdapterUtil.convertMapToEntity(userMap, XjrUser.class);
|
|
|
+ for (Map<String, Object> user : xjrUsers) {
|
|
|
String url = ScheduleUtil.apiUrl + "teacher/create";
|
|
|
JsonObject paramJson = new JsonObject();
|
|
|
- paramJson.addProperty("jobNumber", user.getUserName());
|
|
|
- if("SB10001".equals(user.getGender())){
|
|
|
+ paramJson.addProperty("jobNumber", user.get("user_name").toString());
|
|
|
+ if("SB10001".equals(user.get("gender").toString())){
|
|
|
paramJson.addProperty("gender", 1);
|
|
|
- }else if("SB10002".equals(user.getGender())){
|
|
|
+ }else if("SB10002".equals(user.get("gender").toString())){
|
|
|
paramJson.addProperty("gender", 2);
|
|
|
}
|
|
|
|
|
|
- paramJson.addProperty("name", user.getName());
|
|
|
- paramJson.addProperty("alias", user.getNickName());
|
|
|
- paramJson.addProperty("extendId", user.getId().toString());
|
|
|
+ paramJson.addProperty("name", user.get("name").toString());
|
|
|
+ paramJson.addProperty("alias", user.get("nick_name").toString());
|
|
|
+ paramJson.addProperty("extendId", user.get("id").toString());
|
|
|
//获取时间戳
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
//生成签名
|
|
|
String sign = ScheduleUtil.createSign(timestamp);
|
|
|
- if(ids != null && ids.get(user.getId().toString()) != null){
|
|
|
+ if(ids != null && ids.get(user.get("id").toString()) != null){
|
|
|
url = ScheduleUtil.apiUrl + "teacher/update";
|
|
|
- paramJson.addProperty("serialNo", ids.get(user.getId().toString()));
|
|
|
+ paramJson.addProperty("serialNo", ids.get(user.get("id").toString()));
|
|
|
ScheduleUtil.doPost(url, paramJson.toString(), sign, timestamp);
|
|
|
continue;
|
|
|
}
|
|
|
@@ -258,7 +257,7 @@ public class DataUtil {
|
|
|
continue;
|
|
|
}
|
|
|
JsonObject resultJson = jsonParser.parse(result).getAsJsonObject();
|
|
|
- idMap.put(user.getId().toString(), resultJson.get("data").getAsString());
|
|
|
+ idMap.put(user.get("id").toString(), resultJson.get("data").getAsString());
|
|
|
}
|
|
|
//插入记录表
|
|
|
insertRecord(tableName, idMap);
|