Ver código fonte

2025-01-25 代码备份

年前代码备份
zhaiy 2 meses atrás
pai
commit
9d285028b3
19 arquivos alterados com 167 adições e 61 exclusões
  1. 1 0
      .idea/gradle.xml
  2. 0 1
      .idea/misc.xml
  3. 17 0
      .idea/runConfigurations.xml
  4. 3 0
      app/src/main/java/com/pan_american/android/OASystem.kt
  5. 0 1
      app/src/main/java/com/pan_american/android/base/BaseRequest.kt
  6. 4 0
      app/src/main/java/com/pan_american/android/data/model/common/entity/Selector.kt
  7. 2 1
      app/src/main/java/com/pan_american/android/data/model/group_management/entry_and_exit_fee_detail/network/EntryAndExitDetailRequest.kt
  8. 2 1
      app/src/main/java/com/pan_american/android/data/model/group_management/entry_and_exit_fee_detail/network/EntryAndExitGroupListRequest.kt
  9. 3 1
      app/src/main/java/com/pan_american/android/data/model/group_management/entry_and_exit_fee_detail/network/EntryAndExitPaymentTypeRequest.kt
  10. 1 1
      app/src/main/java/com/pan_american/android/data/network/ServiceCreator.kt
  11. 0 9
      app/src/main/java/com/pan_american/android/ui/group_invite_official/official_visits/AddOfficialVisitsActivity.kt
  12. 10 3
      app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/EntryAndExitFeeGroupListActivity.kt
  13. 17 1
      app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/EntryAndExitPaymentListFragment.kt
  14. 79 42
      app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/InBoardFeeFragment.kt
  15. 19 0
      app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/InternationalTravelFeeFragment.kt
  16. 4 0
      app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/OtherPaymentFragment.kt
  17. 2 0
      app/src/main/java/com/pan_american/android/ui/workspace/WorkspaceActivity.kt
  18. 1 0
      app/src/main/res/layout/fragment_in_board_fee.xml
  19. 2 0
      app/src/main/res/values/strings.xml

+ 1 - 0
.idea/gradle.xml

@@ -4,6 +4,7 @@
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
+        <option name="testRunner" value="CHOOSE_PER_TEST" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
         <option name="gradleJvm" value="21" />
         <option name="modules">

+ 0 - 1
.idea/misc.xml

@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="EntryPointsManager">
     <list size="2">

+ 17 - 0
.idea/runConfigurations.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
+        <option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
+        <option value="com.intellij.execution.junit.PatternConfigurationProducer" />
+        <option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
+        <option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
+        <option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
+        <option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
+        <option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

+ 3 - 0
app/src/main/java/com/pan_american/android/OASystem.kt

@@ -362,6 +362,9 @@ class OASystem : Application() {
 
         //三公费用 返回体
         var entryAndExitDetailResponse = EntryAndExitDetailResponse()
+
+        //三公费用 是否可编辑
+        var entryAndExitDetailCanBeEdit = false
     }
 
     override fun onCreate() {

+ 0 - 1
app/src/main/java/com/pan_american/android/base/BaseRequest.kt

@@ -1,7 +1,6 @@
 package com.pan_american.android.base
 
 open class BaseRequest {
-
     val portType = 2
     var pageIndex = 0
     var pageSize = 0

+ 4 - 0
app/src/main/java/com/pan_american/android/data/model/common/entity/Selector.kt

@@ -37,4 +37,8 @@ class Selector {
     var companyId = 0
 
     var text = ""
+
+    var isNull = false
+    var isEdit = false
+    var isView = false
 }

+ 2 - 1
app/src/main/java/com/pan_american/android/data/model/group_management/entry_and_exit_fee_detail/network/EntryAndExitDetailRequest.kt

@@ -1,5 +1,6 @@
 package com.pan_american.android.data.model.group_management.entry_and_exit_fee_detail.network
 
+import com.pan_american.android.OASystem
 import com.pan_american.android.base.BaseRequest
 
-data class EntryAndExitDetailRequest(val diId: Int = 0): BaseRequest()
+data class EntryAndExitDetailRequest(val diId: Int = 0, val currUserId: Int = OASystem.userInfo.userId): BaseRequest()

+ 2 - 1
app/src/main/java/com/pan_american/android/data/model/group_management/entry_and_exit_fee_detail/network/EntryAndExitGroupListRequest.kt

@@ -1,5 +1,6 @@
 package com.pan_american.android.data.model.group_management.entry_and_exit_fee_detail.network
 
+import com.pan_american.android.OASystem
 import com.pan_american.android.base.BaseRequest
 
-data class EntryAndExitGroupListRequest(var groupName: String = ""): BaseRequest()
+data class EntryAndExitGroupListRequest(var groupName: String = "", val currUserId: Int = OASystem.userInfo.userId): BaseRequest()

+ 3 - 1
app/src/main/java/com/pan_american/android/data/model/group_management/entry_and_exit_fee_detail/network/EntryAndExitPaymentTypeRequest.kt

@@ -1,3 +1,5 @@
 package com.pan_american.android.data.model.group_management.entry_and_exit_fee_detail.network
 
-data class EntryAndExitPaymentTypeRequest(val portType: Int = 2, val diId: Int, val subType: Int)
+import com.pan_american.android.OASystem
+
+data class EntryAndExitPaymentTypeRequest(val portType: Int = 2, val diId: Int, val subType: Int, val currUserId: Int = OASystem.userInfo.userId)

+ 1 - 1
app/src/main/java/com/pan_american/android/data/network/ServiceCreator.kt

@@ -5,7 +5,7 @@ import retrofit2.converter.gson.GsonConverterFactory
 
 object ServiceCreator {
 
-    private const val BASE_URL = "http://132.232.92.186:9001"
+    private const val BASE_URL = "http://132.232.92.186:8888"
 
     private val retrofit = Retrofit.Builder().apply {
         baseUrl(BASE_URL)

+ 0 - 9
app/src/main/java/com/pan_american/android/ui/group_invite_official/official_visits/AddOfficialVisitsActivity.kt

@@ -9,7 +9,6 @@ import android.os.Bundle
 import android.provider.MediaStore
 import android.text.Editable
 import android.text.TextWatcher
-import android.util.Log
 import android.view.Gravity
 import android.view.View
 import android.view.ViewGroup
@@ -26,7 +25,6 @@ import androidx.core.content.ContextCompat
 import androidx.core.content.res.ResourcesCompat
 import androidx.recyclerview.widget.LinearLayoutManager
 import androidx.recyclerview.widget.RecyclerView
-import com.google.gson.Gson
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
 import com.pan_american.android.base.BaseActivity
@@ -868,11 +866,6 @@ class AddOfficialVisitsActivity : BaseActivity<ActivityAddOfficialVisitsBinding>
 
     private fun getOfficialVisitsDetail() {
 
-        Log.e("request", Gson().toJson(GetOfficialVisitDetailRequest(
-            officialVisitId,
-            groupId
-        )))
-
         apiService.getOfficialVisitDetailById(
             GetOfficialVisitDetailRequest(
                 officialVisitId,
@@ -1045,8 +1038,6 @@ class AddOfficialVisitsActivity : BaseActivity<ActivityAddOfficialVisitsBinding>
 
                             checkCommitType = confirmTheInvitation
 
-                            Log.e("type", checkCommitType.toString())
-
                             when (checkCommitType) {
                                 0 -> {
                                     binding.checkCommit.setText(resources.getString(R.string.check_commit))

+ 10 - 3
app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/EntryAndExitFeeGroupListActivity.kt

@@ -163,10 +163,17 @@ class EntryAndExitFeeGroupListActivity : BaseActivity<ActivityEntryAndExitGroupL
 
         adapter.onRecyclerViewItemClick = object : ListAdapter.OnRecyclerViewItemClick<Selector> {
             override fun onItemClick(position: Int) {
-                val intent = Intent(OASystem.context, EntryAndExitDetailActivity::class.java).apply {
-                    putExtra("groupId", groupNameList[position].id)
+                if (groupNameList[position].isView || groupNameList[position].isNull) {
+                    val intent = Intent(OASystem.context, EntryAndExitDetailActivity::class.java).apply {
+                        putExtra("groupId", groupNameList[position].id)
+                    }
+                    startActivity(intent)
+
+                    OASystem.entryAndExitDetailCanBeEdit = groupNameList[position].isEdit
+
+                } else {
+                    showMessage(resources.getString(R.string.view_permission_denied_hint))
                 }
-                startActivity(intent)
             }
         }
 

+ 17 - 1
app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/EntryAndExitPaymentListFragment.kt

@@ -131,6 +131,11 @@ class EntryAndExitPaymentListFragment : BaseFragment<FragmentEntryAndExitPayment
     }
 
     override fun initViews() {
+//        if (!OASystem.entryAndExitDetailCanBeEdit) {
+//            binding.isSelected.isEnabled = false
+//            binding.addPayment.visibility = View.GONE
+//        }
+
         when (typeId) {
             3 -> {
                 binding.title.text = resources.getString(R.string.accommodation_fee)
@@ -186,7 +191,7 @@ class EntryAndExitPaymentListFragment : BaseFragment<FragmentEntryAndExitPayment
 
         val adapter = CardAdapter.Builder<EntryAndExitPaymentListItem>().apply {
             setData(paymentList)
-            setCanDelete(true)
+            setCanDelete(OASystem.entryAndExitDetailCanBeEdit)
             setLayoutId(R.layout.item_entry_and_exit_payment)
             addBindView { itemView, data ->
                 itemView.findViewById<TextView>(R.id.days).text =
@@ -378,6 +383,11 @@ class EntryAndExitPaymentListFragment : BaseFragment<FragmentEntryAndExitPayment
             jpyCurrency.filters = arrayOf(MoneyInputFilter(4))
             hkdCurrency.filters = arrayOf(MoneyInputFilter(4))
 
+            if (!OASystem.entryAndExitDetailCanBeEdit) {
+                commit.text = resources.getString(R.string.back)
+                cancel.visibility = View.GONE
+            }
+
             for (item in OASystem.entryAndExitDetailResponse.currencys) {
                 when (item.currencyCode) {
                     "USD" -> usdCurrency.setText(item.rate.toString())
@@ -397,6 +407,12 @@ class EntryAndExitPaymentListFragment : BaseFragment<FragmentEntryAndExitPayment
             }
 
             commit.setOnClickListener {
+
+                if (!OASystem.entryAndExitDetailCanBeEdit) {
+                    popupWindow.dismiss()
+                    return@setOnClickListener
+                }
+
                 if (usdCurrency.text.toString().endsWith('.') || usdCurrency.text.toString()
                         .isBlank()
                 ) {

+ 79 - 42
app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/InBoardFeeFragment.kt

@@ -17,6 +17,7 @@ import com.pan_american.android.data.network.APIService
 import com.pan_american.android.data.network.ServiceCreator
 import com.pan_american.android.databinding.FragmentInBoardFeeBinding
 import com.pan_american.android.util.MoneyInputFilter
+import org.greenrobot.eventbus.EventBus
 import retrofit2.Call
 import retrofit2.Callback
 import retrofit2.Response
@@ -55,6 +56,20 @@ class InBoardFeeFragment : BaseFragment<FragmentInBoardFeeBinding>() {
         binding.insurancePrice.filters = arrayOf(MoneyInputFilter(2))
         binding.ticketPrice.filters = arrayOf(MoneyInputFilter(2))
 
+//        if (!OASystem.entryAndExitDetailCanBeEdit) {
+//            binding.isSelected.isEnabled = false
+//            binding.visaPrice.isEnabled = false
+//            binding.getNewestVisaPayment.visibility = View.GONE
+//            binding.visaDescription.isEnabled = false
+//            binding.vaccinePrice.isEnabled = false
+//            binding.nucleicAcidTestingPrice.isEnabled = false
+//            binding.servicePrice.isEnabled = false
+//            binding.insurancePrice.isEnabled = false
+//            binding.ticketPrice.isEnabled = false
+//
+//            binding.commit.text = resources.getString(R.string.back)
+//        }
+
         getInBoardFeeDetail()
     }
 
@@ -64,7 +79,12 @@ class InBoardFeeFragment : BaseFragment<FragmentInBoardFeeBinding>() {
             return
         }
 
-        apiService.getInBoardPaymentDetail(EntryAndExitPaymentTypeRequest(diId = groupId, subType = 1)).enqueue(object : Callback<InBoardDetailResponse> {
+        apiService.getInBoardPaymentDetail(
+            EntryAndExitPaymentTypeRequest(
+                diId = groupId,
+                subType = 1
+            )
+        ).enqueue(object : Callback<InBoardDetailResponse> {
             override fun onResponse(
                 call: Call<InBoardDetailResponse>,
                 response: Response<InBoardDetailResponse>
@@ -106,6 +126,12 @@ class InBoardFeeFragment : BaseFragment<FragmentInBoardFeeBinding>() {
         }
 
         binding.commit.setOnClickListener {
+
+            if (!OASystem.entryAndExitDetailCanBeEdit) {
+                parentFragmentManager.popBackStack()
+                return@setOnClickListener
+            }
+
             if (binding.visaPrice.text.isBlank() || binding.visaPrice.text.endsWith('.')) {
                 showMessage(resources.getString(R.string.visa_price_input_hint))
                 return@setOnClickListener
@@ -116,7 +142,10 @@ class InBoardFeeFragment : BaseFragment<FragmentInBoardFeeBinding>() {
                 return@setOnClickListener
             }
 
-            if (binding.nucleicAcidTestingPrice.text.isBlank() || binding.nucleicAcidTestingPrice.text.endsWith('.')) {
+            if (binding.nucleicAcidTestingPrice.text.isBlank() || binding.nucleicAcidTestingPrice.text.endsWith(
+                    '.'
+                )
+            ) {
                 showMessage(resources.getString(R.string.nucleic_acid_testing_payment_input_hint))
                 return@setOnClickListener
             }
@@ -163,34 +192,35 @@ class InBoardFeeFragment : BaseFragment<FragmentInBoardFeeBinding>() {
             return
         }
 
-        apiService.getNewestVisaPayment(EntryAndExitTipsRequest(groupId = groupId, tipsType = 2)).enqueue(object : Callback<NewestVisaPaymentResponse> {
-            override fun onResponse(
-                call: Call<NewestVisaPaymentResponse>,
-                response: Response<NewestVisaPaymentResponse>
-            ) {
-                val detailResponse = response.body()
+        apiService.getNewestVisaPayment(EntryAndExitTipsRequest(groupId = groupId, tipsType = 2))
+            .enqueue(object : Callback<NewestVisaPaymentResponse> {
+                override fun onResponse(
+                    call: Call<NewestVisaPaymentResponse>,
+                    response: Response<NewestVisaPaymentResponse>
+                ) {
+                    val detailResponse = response.body()
 
-                if (detailResponse != null) {
-                    if (detailResponse.code == 200) {
+                    if (detailResponse != null) {
+                        if (detailResponse.code == 200) {
 
-                        detailResponse.data.apply {
-                            binding.visaPrice.setText(feeTotal.toString())
+                            detailResponse.data.apply {
+                                binding.visaPrice.setText(feeTotal.toString())
 
-                            binding.visaDescription.setText(remark)
+                                binding.visaDescription.setText(remark)
 
-                            showMessage(resources.getString(R.string.update_success))
-                        }
+                                showMessage(resources.getString(R.string.update_success))
+                            }
 
-                    } else {
-                        showMessage(detailResponse.msg)
+                        } else {
+                            showMessage(detailResponse.msg)
+                        }
                     }
                 }
-            }
 
-            override fun onFailure(p0: Call<NewestVisaPaymentResponse>, p1: Throwable) {
-                showErrorInfo(R.string.newest_visa_payment_get_error)
-            }
-        })
+                override fun onFailure(p0: Call<NewestVisaPaymentResponse>, p1: Throwable) {
+                    showErrorInfo(R.string.newest_visa_payment_get_error)
+                }
+            })
     }
 
     private fun updateInBoardPayment(updateInBoardPaymentRequest: UpdateInBoardPaymentRequest) {
@@ -199,35 +229,42 @@ class InBoardFeeFragment : BaseFragment<FragmentInBoardFeeBinding>() {
             return
         }
 
-        apiService.updateInBoardPayment(updateInBoardPaymentRequest).enqueue(object : Callback<UpdateInBoardPaymentResponse> {
-            override fun onResponse(
-                call: Call<UpdateInBoardPaymentResponse>,
-                response: Response<UpdateInBoardPaymentResponse>
-            ) {
-                val updateResponse = response.body()
+        apiService.updateInBoardPayment(updateInBoardPaymentRequest)
+            .enqueue(object : Callback<UpdateInBoardPaymentResponse> {
+                override fun onResponse(
+                    call: Call<UpdateInBoardPaymentResponse>,
+                    response: Response<UpdateInBoardPaymentResponse>
+                ) {
+                    val updateResponse = response.body()
 
-                if (updateResponse != null) {
-                    if (updateResponse.code == 200) {
+                    if (updateResponse != null) {
+                        if (updateResponse.code == 200) {
 
-                        OASystem.entryAndExitDetailResponse.choiceOneTotalCost = updateResponse.data.itemTotal
+                            OASystem.entryAndExitDetailResponse.choiceOneTotalCost =
+                                updateResponse.data.itemTotal
 
-                        OASystem.entryAndExitDetailResponse.choiceOne = updateInBoardPaymentRequest.choiceOne
+                            OASystem.entryAndExitDetailResponse.choiceOne =
+                                if (binding.isSelected.isChecked) {
+                                    1
+                                } else {
+                                    0
+                                }
 
-                        OASystem.entryAndExitDetailResponse.diId = updateResponse.data.parentId
+                            EventBus.getDefault().post(OASystem.entryAndExitDetailResponse)
 
-                        showMessage(resources.getString(R.string.update_success))
+                            showMessage(resources.getString(R.string.update_success))
 
-                        parentFragmentManager.popBackStack()
+                            parentFragmentManager.popBackStack()
 
-                    } else {
-                        showMessage(updateResponse.msg)
+                        } else {
+                            showMessage(updateResponse.msg)
+                        }
                     }
                 }
-            }
 
-            override fun onFailure(p0: Call<UpdateInBoardPaymentResponse>, p1: Throwable) {
-                showErrorInfo(R.string.update_error)
-            }
-        })
+                override fun onFailure(p0: Call<UpdateInBoardPaymentResponse>, p1: Throwable) {
+                    showErrorInfo(R.string.update_error)
+                }
+            })
     }
 }

+ 19 - 0
app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/InternationalTravelFeeFragment.kt

@@ -58,6 +58,19 @@ class InternationalTravelFeeFragment : BaseFragment<FragmentInternationalTravelF
         binding.businessClassPrice.filters = arrayOf(MoneyInputFilter(2))
         binding.firstClassPrice.filters = arrayOf(MoneyInputFilter(2))
 
+//        if (!OASystem.entryAndExitDetailCanBeEdit)  {
+//            binding.economyClassSelected.isEnabled = false
+//            binding.economyClassPrice.isEnabled = false
+//            binding.businessClassSelected.isEnabled = false
+//            binding.businessClassPrice.isEnabled = false
+//            binding.firstClassSelected.isEnabled = false
+//            binding.firstClassPrice.isEnabled = false
+//            binding.cityTrafficPayment.isEnabled = false
+//            binding.putIn.visibility = View.GONE
+//
+//            binding.commit.text = resources.getString(R.string.back)
+//        }
+
         getInternationalTravelFeeDetail()
     }
 
@@ -164,6 +177,12 @@ class InternationalTravelFeeFragment : BaseFragment<FragmentInternationalTravelF
         }
 
         binding.commit.setOnClickListener {
+
+            if (!OASystem.entryAndExitDetailCanBeEdit) {
+                parentFragmentManager.popBackStack()
+                return@setOnClickListener
+            }
+
             if (binding.economyClassPrice.text.isBlank() || binding.economyClassPrice.text.endsWith(
                     '.'
                 )

+ 4 - 0
app/src/main/java/com/pan_american/android/ui/group_management/entry_and_exit_fee_detail/OtherPaymentFragment.kt

@@ -133,6 +133,10 @@ class OtherPaymentFragment : BaseFragment<FragmentOtherPaymentBinding>() {
 
     override fun initViews() {
         binding.title.text = resources.getString(R.string.other_fee)
+//
+//        if (!OASystem.entryAndExitDetailCanBeEdit) {
+//
+//        }
     }
 
     override fun initEvents() {

+ 2 - 0
app/src/main/java/com/pan_american/android/ui/workspace/WorkspaceActivity.kt

@@ -112,6 +112,8 @@ class WorkspaceActivity : BaseActivity<ActivityWorkspaceBinding>() {
         initBottomNavigation()
 
         createNotificationChannel()
+
+//        window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
     }
 
     override fun onStart() {

+ 1 - 0
app/src/main/res/layout/fragment_in_board_fee.xml

@@ -123,6 +123,7 @@
                         android:padding="@dimen/common_padding_small"
                         android:text="@string/get_newest_visa_payment"
                         android:textColor="@color/white"
+                        android:visibility="gone"
                         android:textSize="@dimen/text_size_small" />
 
                 </LinearLayout>

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -161,6 +161,8 @@
 
     <string name="notification_permission_denied_hint">检测到未开启通知权限,请前往设置页面开启</string>
 
+    <string name="view_permission_denied_hint">无查看权限</string>
+
     <!-- 网络错误 -->
     <string name="network_error">%s,请检查网络设置</string>
     <string name="base_resource_data_get_failed">基础数据源获取失败</string>