Browse Source

2024-12-13 新增 / 修改

新增:
1. 市场客户资料 - 新增 / 修改客户资料 根据客户级别更新客户类别选项

修改:
1. UI bug修改
2. 部分UI逻辑修改
zhaiy 3 weeks ago
parent
commit
345b9fcba7

+ 2 - 2
.idea/deploymentTargetSelector.xml

@@ -4,10 +4,10 @@
     <selectionStates>
       <SelectionState runConfigName="app">
         <option name="selectionMode" value="DROPDOWN" />
-        <DropdownSelection timestamp="2024-10-17T04:36:02.189566800Z">
+        <DropdownSelection timestamp="2024-12-13T03:26:39.843416600Z">
           <Target type="DEFAULT_BOOT">
             <handle>
-              <DeviceId pluginId="PhysicalDevice" identifier="serial=f9ef1bdf" />
+              <DeviceId pluginId="PhysicalDevice" identifier="serial=9P5D89RGQCRWBM8X" />
             </handle>
           </Target>
         </DropdownSelection>

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

@@ -2,7 +2,7 @@ package com.pan_american.android.data.model.group_management.entry_and_exit_fee_
 
 import com.pan_american.android.data.model.common.entity.Selector
 
-data class EntryAndExitDetailResponse (val id: Int = 0, val diId: Int = 0, val currencys:ArrayList<Selector> = arrayListOf()){
+data class EntryAndExitDetailResponse (val id: Int = 0, var diId: Int = 0, val currencys:ArrayList<Selector> = arrayListOf()){
     var choiceOne = 0
     var choiceOneTotalCost = 0.0
 

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

@@ -4,5 +4,5 @@ import com.pan_american.android.base.BaseResponse
 
 data class UpdateInBoardPaymentResponse(val data: Data): BaseResponse() {
 
-    inner class Data (val itemTotal: Double)
+    inner class Data (val parentId: Int, val itemTotal: Double)
 }

+ 37 - 6
app/src/main/java/com/pan_american/android/ui/customer_resource/company_customer/AddNewCustomerActivity.kt

@@ -31,11 +31,13 @@ import com.pan_american.android.base.BaseResponse
 import com.pan_american.android.base.ListAdapter
 import com.pan_american.android.data.model.common.entity.Selector
 import com.pan_american.android.data.model.common.entity.SiftListItem
+import com.pan_american.android.data.model.common.network.SelectorResponse
 import com.pan_american.android.data.model.customer_resource.company_customer.entity.MarketCustomer
 import com.pan_american.android.data.model.customer_resource.company_customer.network.BusinessCardInfoRequest
 import com.pan_american.android.data.model.customer_resource.company_customer.network.BusinessCardInfoResponse
 import com.pan_american.android.data.model.customer_resource.company_customer.network.MarketCustomerDetailRequest
 import com.pan_american.android.data.model.customer_resource.company_customer.network.MarketCustomerDetailResponse
+import com.pan_american.android.data.model.customer_resource.company_customer.network.UpdateClientTypeRequest
 import com.pan_american.android.data.network.APIService
 import com.pan_american.android.data.network.ServiceCreator
 import com.pan_american.android.databinding.ActivityAddNewCustomerBinding
@@ -235,7 +237,11 @@ class AddNewCustomerActivity : BaseActivity<ActivityAddNewCustomerBinding>() {
         }
 
         binding.customerClassify.setOnClickListener {
-            initCustomerClassifySelector()
+            if (marketCustomer.lvlid == 0) {
+                showMessage(resources.getString(R.string.customer_level_select_hint))
+            } else {
+                initCustomerClassifySelector()
+            }
         }
 
         binding.customerLeader.setOnClickListener {
@@ -315,11 +321,6 @@ class AddNewCustomerActivity : BaseActivity<ActivityAddNewCustomerBinding>() {
             customerLevel.add(item)
         }
 
-        for (item in OASystem.customerClass) {
-            item.isChecked = false
-            customerClass.add(item)
-        }
-
         for (item in OASystem.serviceClass) {
             item.isChecked = false
             customerServiceClass.add(item)
@@ -476,6 +477,12 @@ class AddNewCustomerActivity : BaseActivity<ActivityAddNewCustomerBinding>() {
                         binding.customerLevel.text = customerLevel[position].name
                         marketCustomer.lvlid = customerLevel[position].id
 
+                        binding.customerClassify.text = ""
+                        marketCustomer.category = 0
+
+                        customerClass.clear()
+                        getCustomerClassWithLevelId(marketCustomer.lvlid)
+
                         popupWindow.dismiss()
                     }
                 }
@@ -938,4 +945,28 @@ class AddNewCustomerActivity : BaseActivity<ActivityAddNewCustomerBinding>() {
                 }
             })
     }
+
+    private fun getCustomerClassWithLevelId(position: Int) {
+        apiService.updateClientTypeList(UpdateClientTypeRequest(listOf(position))).enqueue(object : Callback<SelectorResponse> {
+            override fun onResponse(call: Call<SelectorResponse>, response: Response<SelectorResponse>) {
+                val selectorResponse = response.body()
+
+                if (selectorResponse != null) {
+                    if (selectorResponse.code == 200) {
+
+                        for (item in selectorResponse.data) {
+                            customerClass.add(item)
+                        }
+
+                    } else {
+                        showMessage(selectorResponse.msg)
+                    }
+                }
+            }
+
+            override fun onFailure(p0: Call<SelectorResponse>, p1: Throwable) {
+                showErrorInfo(R.string.interface_request_error)
+            }
+        })
+    }
 }

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

@@ -100,12 +100,22 @@ class EntryAndExitFeeTotalFragment : BaseFragment<FragmentEntryAndExitFeeTotalBi
                 otherExpensesTotalCost
             )
 
-            binding.economyClass.text =
+            binding.economyClass.text = if (choiceTwoJJ == 1) {
                 String.format(resources.getString(R.string.economy_class_price), outsideJJPay)
-            binding.businessClass.text =
+            } else {
+                String.format(resources.getString(R.string.economy_class_price), 0.0)
+            }
+            binding.businessClass.text = if (choiceTwoGW == 1) {
                 String.format(resources.getString(R.string.business_class_price), outsideGWPay)
-            binding.firstClass.text =
+            } else {
+                String.format(resources.getString(R.string.business_class_price), 0.0)
+            }
+            binding.firstClass.text = if (choiceTwoTD == 1) {
                 String.format(resources.getString(R.string.first_class_price), outsideTDPay)
+            } else {
+                String.format(resources.getString(R.string.first_class_price), 0.0)
+            }
+
 
             OASystem.entryAndExitDetailResponse.apply {
                 economyTotalPayment =

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

@@ -3,6 +3,7 @@ package com.pan_american.android.ui.group_management.entry_and_exit_fee_detail
 import android.os.Bundle
 import android.text.Editable
 import android.text.TextWatcher
+import android.util.Log
 import android.view.Gravity
 import android.view.View
 import android.view.ViewGroup
@@ -12,6 +13,7 @@ import android.widget.PopupWindow
 import android.widget.TextView
 import androidx.core.content.res.ResourcesCompat
 import androidx.recyclerview.widget.LinearLayoutManager
+import com.google.gson.Gson
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
 import com.pan_american.android.base.BaseActivity
@@ -461,6 +463,7 @@ class EntryAndExitPaymentDetailActivity : BaseActivity<ActivityEntryAndExitPayme
 
     private fun updateEntryAndExitPaymentDetail() {
 
+        Log.e("request", Gson().toJson(updateEntryAndExitPaymentDetailRequest))
         apiService.updateEntryAndExitPaymentDetail(updateEntryAndExitPaymentDetailRequest).enqueue(object : Callback<BaseResponse> {
             override fun onResponse(call: Call<BaseResponse>, response: Response<BaseResponse>) {
 

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

@@ -2,6 +2,7 @@ package com.pan_american.android.ui.group_management.entry_and_exit_fee_detail
 
 import android.content.Intent
 import android.os.Bundle
+import android.util.Log
 import android.view.Gravity
 import android.view.LayoutInflater
 import android.view.View
@@ -10,6 +11,7 @@ import android.widget.EditText
 import android.widget.PopupWindow
 import android.widget.TextView
 import androidx.recyclerview.widget.LinearLayoutManager
+import com.google.gson.Gson
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
 import com.pan_american.android.base.BaseFragment
@@ -143,6 +145,11 @@ class EntryAndExitPaymentListFragment : BaseFragment<FragmentEntryAndExitPayment
                 binding.title.text = resources.getString(R.string.training_fee)
             }
         }
+
+        binding.paymentTotal.text = String.format(
+            resources.getString(R.string.total_per_fee_format),
+            totalPayment
+        )
     }
 
     override fun initEvents() {
@@ -430,6 +437,12 @@ class EntryAndExitPaymentListFragment : BaseFragment<FragmentEntryAndExitPayment
     }
 
     private fun updateSelectStatus(status: Int) {
+        Log.e("request", Gson().toJson(UpdateEntryAndExitTypeStatusRequest(
+            id = paymentId,
+            diId = groupId,
+            itemType = typeId,
+            isSelected = status
+        )))
         apiService.updateEntryAndExitTypeStatus(
             UpdateEntryAndExitTypeStatusRequest(
                 id = paymentId,

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

@@ -1,9 +1,11 @@
 package com.pan_american.android.ui.group_management.entry_and_exit_fee_detail
 
 import android.os.Bundle
+import android.util.Log
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import com.google.gson.Gson
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
 import com.pan_american.android.base.BaseFragment
@@ -184,6 +186,7 @@ class InBoardFeeFragment : BaseFragment<FragmentInBoardFeeBinding>() {
     }
 
     private fun updateInBoardPayment(updateInBoardPaymentRequest: UpdateInBoardPaymentRequest) {
+        Log.e("request", Gson().toJson(updateInBoardPaymentRequest))
         apiService.updateInBoardPayment(updateInBoardPaymentRequest).enqueue(object : Callback<UpdateInBoardPaymentResponse> {
             override fun onResponse(
                 call: Call<UpdateInBoardPaymentResponse>,
@@ -198,7 +201,9 @@ class InBoardFeeFragment : BaseFragment<FragmentInBoardFeeBinding>() {
 
                         OASystem.entryAndExitDetailResponse.choiceOne = updateInBoardPaymentRequest.choiceOne
 
-                        showMessage(resources.getString(R.string.update))
+                        OASystem.entryAndExitDetailResponse.diId = updateResponse.data.parentId
+
+                        showMessage(resources.getString(R.string.update_success))
 
                         parentFragmentManager.popBackStack()
 

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

@@ -1,9 +1,11 @@
 package com.pan_american.android.ui.group_management.entry_and_exit_fee_detail
 
 import android.os.Bundle
+import android.util.Log
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import com.google.gson.Gson
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
 import com.pan_american.android.base.BaseFragment
@@ -17,6 +19,7 @@ import com.pan_american.android.data.network.APIService
 import com.pan_american.android.data.network.ServiceCreator
 import com.pan_american.android.databinding.FragmentInternationalTravelFeeBinding
 import com.pan_american.android.util.MoneyInputFilter
+import org.greenrobot.eventbus.EventBus
 import retrofit2.Call
 import retrofit2.Callback
 import retrofit2.Response
@@ -61,6 +64,10 @@ class InternationalTravelFeeFragment : BaseFragment<FragmentInternationalTravelF
     }
 
     private fun getInternationalTravelFeeDetail() {
+        Log.e("request", Gson().toJson(EntryAndExitPaymentTypeRequest(
+            diId = groupId,
+            subType = 2
+        )))
         apiService.getInternationalTravelFeeDetail(
             EntryAndExitPaymentTypeRequest(
                 diId = groupId,
@@ -213,6 +220,7 @@ class InternationalTravelFeeFragment : BaseFragment<FragmentInternationalTravelF
 
     private fun updateInternationalTravel(updateInternationalTravelRequest: UpdateInternationalTravelRequest) {
 
+        Log.e("request", Gson().toJson(updateInternationalTravelRequest))
         apiService.updateInternationalTravelPayment(updateInternationalTravelRequest)
             .enqueue(object : Callback<UpdateInternationalTravelResponse> {
                 override fun onResponse(
@@ -236,6 +244,8 @@ class InternationalTravelFeeFragment : BaseFragment<FragmentInternationalTravelF
                                 outsideTDPay = updateResponse.data.tdcItemTotal
                             }
 
+                            EventBus.getDefault().post(OASystem.entryAndExitDetailResponse)
+
                             parentFragmentManager.popBackStack()
 
                         } else {

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

@@ -3,8 +3,10 @@ package com.pan_american.android.ui.group_management.entry_and_exit_fee_detail
 import android.os.Bundle
 import android.text.Editable
 import android.text.TextWatcher
+import android.util.Log
 import android.widget.TextView
 import androidx.core.content.res.ResourcesCompat
+import com.google.gson.Gson
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
 import com.pan_american.android.base.BaseActivity
@@ -353,6 +355,7 @@ class OtherPaymentDetailActivity : BaseActivity<ActivityOtherPaymentDetailBindin
     }
 
     private fun updateOtherPayment() {
+        Log.e("request", Gson().toJson(updateOtherPaymentRequest))
         apiService.updateEntryAndExitOtherPayment(updateOtherPaymentRequest).enqueue(object : Callback<BaseResponse> {
             override fun onResponse(call: Call<BaseResponse>, response: Response<BaseResponse>) {
                 val updateResponse = response.body()