|
@@ -20,10 +20,12 @@ import org.brynhild.graduation.common.transfer.dto.FileInfo
|
|
|
import org.brynhild.graduation.common.transfer.handler.ResponseHandler
|
|
|
import org.brynhild.graduation.common.transfer.utils.ServiceCreator
|
|
|
import org.brynhild.graduation.common.transfer.vo.timetable.AdminQueryStudentStatistic
|
|
|
+import org.brynhild.graduation.common.transfer.vo.timetable.QueryTeachingCourseStatisticRequest
|
|
|
import org.brynhild.graduation.common.utils.FileDownloadUtil
|
|
|
import org.brynhild.graduation.common.utils.JsonUtils
|
|
|
import org.brynhild.graduation.databinding.FragmentSignInTeacherBinding
|
|
|
import org.brynhild.graduation.service.http.CommonService
|
|
|
+import org.brynhild.graduation.service.http.TeacherService
|
|
|
import retrofit2.Call
|
|
|
import retrofit2.Callback
|
|
|
import retrofit2.Response
|
|
@@ -31,9 +33,6 @@ import retrofit2.Response
|
|
|
class SignInFragment : Fragment() {
|
|
|
|
|
|
private var _binding: FragmentSignInTeacherBinding? = null
|
|
|
-
|
|
|
- // This property is only valid between onCreateView and
|
|
|
- // onDestroyView.
|
|
|
private val binding get() = _binding!!
|
|
|
|
|
|
@SuppressLint("SetJavaScriptEnabled")
|
|
@@ -45,7 +44,6 @@ class SignInFragment : Fragment() {
|
|
|
|
|
|
_binding = FragmentSignInTeacherBinding.inflate(inflater, container, false)
|
|
|
val root: View = binding.root
|
|
|
-
|
|
|
val webSettings: WebSettings = binding.backupChart.settings
|
|
|
webSettings.domStorageEnabled = true
|
|
|
webSettings.javaScriptEnabled = true
|
|
@@ -60,9 +58,7 @@ class SignInFragment : Fragment() {
|
|
|
loadStatisticInfo()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
bindOnClick()
|
|
|
-
|
|
|
return root
|
|
|
}
|
|
|
|
|
@@ -73,7 +69,7 @@ class SignInFragment : Fragment() {
|
|
|
|
|
|
private fun bindOnClick(){
|
|
|
binding.downloadStatistic.setOnClickListener {
|
|
|
- val service= ServiceCreator.create(CommonService::class.java)
|
|
|
+ val service= ServiceCreator.create(TeacherService::class.java)
|
|
|
val handler=object: Callback<Result> {
|
|
|
override fun onResponse(call: Call<Result>, response: Response<Result>) {
|
|
|
ResponseHandler.handle(response,{
|
|
@@ -98,21 +94,18 @@ class SignInFragment : Fragment() {
|
|
|
ResponseHandler.showMessage(it)
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
override fun onFailure(call: Call<Result>, t: Throwable) {
|
|
|
t.printStackTrace()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- val data= AdminQueryStudentStatistic(LoginConfiguration.userInfo!!.user.id)
|
|
|
- service.generateStudentStatistic(LoginConfiguration.userInfo!!.token,data).enqueue(handler)
|
|
|
-
|
|
|
+ val data= QueryTeachingCourseStatisticRequest(LoginConfiguration.userInfo!!.user.id)
|
|
|
+ service.generateTeachingCourseStatistic(LoginConfiguration.userInfo!!.token,data).enqueue(handler)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
private fun loadStatisticInfo() {
|
|
|
- val service= ServiceCreator.create(CommonService::class.java)
|
|
|
+ val service= ServiceCreator.create(TeacherService::class.java)
|
|
|
val handler=object: Callback<Result> {
|
|
|
override fun onResponse(call: Call<Result>, response: Response<Result>) {
|
|
|
ResponseHandler.handle(response,{
|
|
@@ -137,8 +130,8 @@ class SignInFragment : Fragment() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- val data= AdminQueryStudentStatistic(LoginConfiguration.userInfo!!.user.id)
|
|
|
- service.queryStudentStatistic(LoginConfiguration.userInfo!!.token,data).enqueue(handler)
|
|
|
+ val data= QueryTeachingCourseStatisticRequest(LoginConfiguration.userInfo!!.user.id)
|
|
|
+ service.queryTeachingCourseStatistic(LoginConfiguration.userInfo!!.token,data).enqueue(handler)
|
|
|
|
|
|
}
|
|
|
|