|
|
@@ -281,9 +281,9 @@ public class DataUtil {
|
|
|
paramJson.addProperty("personId", objectMap.get("id").toString());
|
|
|
paramJson.addProperty("personName", objectMap.get("name").toString());
|
|
|
paramJson.addProperty("orgIndexCode", objectMap.get("orgIndexCode").toString());
|
|
|
- paramJson.addProperty("phoneNo", objectMap.get("mobile").toString());
|
|
|
+ paramJson.addProperty("phoneNo", objectMap.get("mobile")==null?"":objectMap.get("mobile").toString());
|
|
|
paramJson.addProperty("jobNo", objectMap.get("user_name").toString());
|
|
|
- paramJson.addProperty("birthday", objectMap.get("birthday").toString());
|
|
|
+ paramJson.addProperty("birthday", objectMap.get("birthday")==null?"":objectMap.get("birthday").toString());
|
|
|
paramJson.addProperty("personType", 2);
|
|
|
|
|
|
int gender;
|
|
|
@@ -321,7 +321,7 @@ public class DataUtil {
|
|
|
return idMap;
|
|
|
}
|
|
|
|
|
|
- public Map<String, String> insertStudent(String tableName, Map<String, String> tableData) throws Exception {
|
|
|
+ public Map<String, String> insertStudent(String tableName, Map<String, String> tableData) {
|
|
|
String sql = "SELECT t1.id,t1.name,CONCAT(t3.id,'-',t4.name,'-',t3.class_type,'-',t2.stduy_status)," +
|
|
|
" t1.user_name,t1.gender,t1.birth_date,t1.mobile,t1.email,t1.credential_type,t1.credential_number FROM xjr_user t1" +
|
|
|
" INNER JOIN base_student_school_roll t2 ON t1.id = t2.user_id" +
|
|
|
@@ -407,22 +407,22 @@ public class DataUtil {
|
|
|
JsonArray paramArray = new JsonArray();
|
|
|
Map<Integer, String> clientMap = new HashMap<>();
|
|
|
for(int i = 0; i < list.size(); i ++){
|
|
|
- String[] el = SqlRunnerAdapterUtil.convertMapToStringArray(list.get(i));
|
|
|
- if(tableData != null && tableData.containsKey(el[0])){
|
|
|
+ Map<String, Object> objectMap = list.get(i);
|
|
|
+ if(tableData != null && tableData.containsKey(objectMap.get("id").toString())){
|
|
|
continue;
|
|
|
}
|
|
|
JsonObject paramJson = new JsonObject();
|
|
|
paramJson.addProperty("clientId", i);
|
|
|
- paramJson.addProperty("personId", el[0]);
|
|
|
- paramJson.addProperty("personName", el[1]);
|
|
|
- paramJson.addProperty("orgIndexCode", deptMap.get(el[3]));
|
|
|
- paramJson.addProperty("phoneNo", el[5]);
|
|
|
- paramJson.addProperty("jobNo", el[9]);
|
|
|
- paramJson.addProperty("birthday", el[4]);
|
|
|
+ paramJson.addProperty("personId", objectMap.get("id").toString());
|
|
|
+ paramJson.addProperty("personName", objectMap.get("name").toString());
|
|
|
+ paramJson.addProperty("orgIndexCode", objectMap.get("dept_id").toString());
|
|
|
+ paramJson.addProperty("phoneNo", objectMap.get("mobile")==null?"":objectMap.get("mobile").toString());
|
|
|
+ paramJson.addProperty("jobNo", objectMap.get("user_name").toString());
|
|
|
+ paramJson.addProperty("birthday", objectMap.get("birth_date")==null?"":objectMap.get("birth_date").toString());
|
|
|
paramJson.addProperty("personType", 1);
|
|
|
|
|
|
int gender;
|
|
|
- switch (el[2]) {
|
|
|
+ switch (objectMap.get("gender").toString()) {
|
|
|
case "SB10001":
|
|
|
gender = 1;
|
|
|
break;
|
|
|
@@ -436,7 +436,7 @@ public class DataUtil {
|
|
|
paramJson.addProperty("gender", gender);
|
|
|
paramArray.add(paramJson);
|
|
|
|
|
|
- clientMap.put(i, el[0]);
|
|
|
+ clientMap.put(i, objectMap.get("id").toString());
|
|
|
}
|
|
|
|
|
|
String apiPath = "/api/resource/v1/person/batch/add";
|