فهرست منبع

用户管理BUG修复

bfzgs 2 سال پیش
والد
کامیت
b894891540

+ 32 - 0
app/src/main/java/org/brynhild/graduation/activity/admin/UserDetailInfoActivity.kt

@@ -275,6 +275,38 @@ class UserDetailInfoActivity : BaseActivity() {
                 dialogLayout.name.setText(user.name)
                 dialogLayout.sex.setText(user.sex)
                 dialogLayout.tel.setText(user.tel)
+                dialogLayout.departmentNo.setText("${user.departmentId}")
+
+
+                dialogLayout.type.setText( when (user.type) {
+                    AccountConstant.USER -> {
+                        "学生"
+                    }
+                    AccountConstant.TEACHER -> {
+                        "教师"
+                    }
+                    AccountConstant.ADMIN -> {
+                        "管理员"
+                    }
+                    else -> {
+                        "错误的类型"
+                    }
+                })
+
+                dialogLayout.state.setText(when (user.state) {
+                    UserStateConstant.NOT_ACTIVE -> {
+                        "未激活"
+                    }
+                    UserStateConstant.READY -> {
+                        "正常"
+                    }
+                    UserStateConstant.FORBIDDEN -> {
+                        "已禁用"
+                    }
+                    else -> {
+                        "错误的状态"
+                    }
+                })
 
                 AlertDialog.Builder(this)
                     .setTitle("修改信息")

+ 2 - 1
app/src/main/java/org/brynhild/graduation/common/constant/FileStorageConstant.kt

@@ -8,8 +8,9 @@ object FileStorageConstant {
         "${Environment.getExternalStorageDirectory().absolutePath}" + File.separator + "FinalProject"
 
     //TODO 服务器文件上传下载的路径
-    private val SERVER_UPLOAD_PATH = "http://192.168.110.1:8100/file/upload/single"
+    private val SERVER_UPLOAD_PATH = "http://192.168.137.1:8100/file/upload/single"
     private val SERVER_DOWNLOAD_PATH_ID = "http://192.168.137.1:8100/file/download/id/"
+    const val BASE_URL = "http://192.168.137.1:8100/"
 
     private val PICTURE_PATH = "$ROOT_PATH${File.separator}Pictures"
     private val VIDEO_PATH = "$ROOT_PATH${File.separator}Videos"

+ 3 - 2
app/src/main/java/org/brynhild/graduation/common/transfer/utils/ServiceCreator.kt

@@ -1,15 +1,16 @@
 package org.brynhild.graduation.common.transfer.utils
 
+import org.brynhild.graduation.common.constant.FileStorageConstant
 import retrofit2.Retrofit
 import retrofit2.converter.gson.GsonConverterFactory
 
 object ServiceCreator {
     //TODO HTTP请求需要更改服务器路径
-    private const val BASE_URL = "http://192.168.110.1:8100/"
+
 
     //    private const val BASE_URL = "http://192.168.8.102:8085/api/android/"
     private val retrofit = Retrofit.Builder()
-        .baseUrl(BASE_URL)
+        .baseUrl(FileStorageConstant.BASE_URL)
         .addConverterFactory(GsonConverterFactory.create())
         .build()
 

+ 7 - 7
app/src/main/java/org/brynhild/graduation/network/adapter/CourseAdapter.kt

@@ -27,13 +27,13 @@ class CourseAdapter(private val context: Context, private val courseList: List<C
         val view = LayoutInflater.from(context).inflate(R.layout.course_item, parent, false)
         val holder = ViewHolder(view)
         holder.itemView.setOnClickListener {
-            val position = holder.adapterPosition
-            val course = courseList[position]
-            val intent = Intent(MyApplication.context, CourseDetailInfoActivity::class.java)
-            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
-            val gson = Gson()
-            intent.putExtra("course", gson.toJson(course))
-            MyApplication.context.startActivity(intent)
+//            val position = holder.adapterPosition
+//            val course = courseList[position]
+//            val intent = Intent(MyApplication.context, CourseDetailInfoActivity::class.java)
+//            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+//            val gson = Gson()
+//            intent.putExtra("course", gson.toJson(course))
+//            MyApplication.context.startActivity(intent)
         }
         return holder
     }

+ 4 - 4
app/src/main/res/layout/activity_class_detail_info.xml

@@ -109,28 +109,28 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginRight="10dp"
-            android:text="批量录入" />
+            android:text="录入" />
 
         <Button
             android:id="@+id/admin_class_batch_push"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginRight="10dp"
-            android:text="批量推送" />
+            android:text="推送" />
 
         <Button
             android:id="@+id/queryTimeTable"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginRight="10dp"
-            android:text="查看课表" />
+            android:text="课表" />
 
         <Button
             android:id="@+id/admin_class_statistic"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginRight="10dp"
-            android:text="考勤数据" />
+            android:text="考勤" />
 
 
     </LinearLayout>