Browse Source

课表数据同步更新

dzx 2 months ago
parent
commit
153d74e602
1 changed files with 9 additions and 7 deletions
  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;
             }