Bladeren bron

课表数据同步更新

dzx 2 maanden geleden
bovenliggende
commit
153d74e602
1 gewijzigde bestanden met toevoegingen van 9 en 7 verwijderingen
  1. 9 7
      src/main/java/com/xjrsoft/module/schedule/util/DataUtil.java

+ 9 - 7
src/main/java/com/xjrsoft/module/schedule/util/DataUtil.java

@@ -237,10 +237,12 @@ public class DataUtil {
             String url  = ScheduleUtil.apiUrl + "teacher/create";
             JsonObject paramJson = new JsonObject();
             paramJson.addProperty("jobNumber", user.get("user_name").toString());
-            if("SB10001".equals(user.get("gender").toString())){
-                paramJson.addProperty("gender", 1);
-            }else if("SB10002".equals(user.get("gender").toString())){
-                paramJson.addProperty("gender", 2);
+            if(user.get("gender") != null){
+                if("SB10001".equals(user.get("gender").toString())){
+                    paramJson.addProperty("gender", 1);
+                }else if("SB10002".equals(user.get("gender").toString())){
+                    paramJson.addProperty("gender", 2);
+                }
             }
 
             paramJson.addProperty("name", user.get("name").toString());
@@ -666,9 +668,9 @@ public class DataUtil {
             if(oldDataMap.get(onlyKey) != null){
                 String updSql = "update course_table set teacher_serial_no = '" + teacher_serial_no + "'" +
                         ", teacher_id = " + teacherId
-                        + ", teacher_name = '" + teacherName + "'" +
-                        " where course_id = " + courseClassId +
-                        " and class_id = " + classId + " and time_number = " + timeNumber + ";";
+                        + ", teacher_name = '" + teacherName + "', modify_date = now()" +
+                        " ,course_id = " + courseClassId +
+                        " where schedule_date = '" + scheduleDate + "'and class_id = " + classId + " and time_number = " + timeNumber + ";";
                 updateSqlList.add(updSql);
                 continue;
             }