Browse Source

2024-11-19 修改

修改:
1. 财务模块 - 收款账单 bug 修改
zhaiy 1 month ago
parent
commit
b459c2bdc7

+ 2 - 2
app/src/main/java/com/pan_american/android/data/model/financial_module/collection_bill/network/UpdateCollectionBillRequest.kt

@@ -1,9 +1,9 @@
 package com.pan_american.android.data.model.financial_module.collection_bill.network
 
 import com.pan_american.android.OASystem
-import com.pan_american.android.base.BaseRequest
 
 data class UpdateCollectionBillRequest(
+    val portType: Int = 2,
     var diId: Int =  0,
     var userId: Int = OASystem.userInfo.userId,
     var id: Int = 0,
@@ -16,4 +16,4 @@ data class UpdateCollectionBillRequest(
     var currency: Int = 0,
     var addingWay: Int = 0,
     var remark: String = ""
-): BaseRequest()
+)

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

@@ -78,7 +78,6 @@ import com.pan_american.android.data.model.financial_module.collection_bill.netw
 import com.pan_american.android.data.model.financial_module.collection_bill.network.CollectionBillGroupDetailPaymentListResponse
 import com.pan_american.android.data.model.financial_module.collection_bill.network.CollectionBillGroupListRequest
 import com.pan_american.android.data.model.financial_module.collection_bill.network.CollectionBillGroupListResponse
-import com.pan_american.android.data.model.financial_module.collection_bill.network.ImportThreePublicExpenseResponse
 import com.pan_american.android.data.model.financial_module.collection_bill.network.UpdateCollectionBillRequest
 import com.pan_american.android.data.model.financial_module.daily_payment.network.AddDailyPaymentRequest
 import com.pan_american.android.data.model.financial_module.daily_payment.network.DailyPaymentDetailRequest
@@ -1212,7 +1211,7 @@ interface APIService {
      * 收款账单,导入三公费用
      */
     @GET("/api/Groups/NationalTravelFeeImportReceivables/{id}")
-    fun importThreePublicExpense(@Query("id") groupId: Int, @Header("accept") headerValue: String = OASystem.token): Call<ImportThreePublicExpenseResponse>
+    fun importThreePublicExpense(@Path("id") groupId: Int, @Header("Authorization") headerValue: String = OASystem.token): Call<BaseResponse>
 
     /**
      * 收款账单,获取导出收款账单FileList

+ 7 - 2
app/src/main/java/com/pan_american/android/ui/financial_module/collection_bill/AddCollectionBillPaymentActivity.kt

@@ -3,6 +3,7 @@ package com.pan_american.android.ui.financial_module.collection_bill
 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.widget.EditText
@@ -12,6 +13,7 @@ import android.widget.TextView
 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
@@ -50,12 +52,12 @@ class AddCollectionBillPaymentActivity : BaseActivity<ActivityAddCollectionBillP
 
         intent.apply {
             fromList = getBooleanExtra("fromList", false)
+            collectionBillItem.diid = getIntExtra("groupId", 0)
         }
 
         if (fromList) {
             intent.apply {
                 collectionBillItem.let {
-                    it.diid = getIntExtra("groupId", 0)
                     it.id = getIntExtra("paymentId", 0)
                     it.priceName = getStringExtra("paymentName").toString()
                     it.addingWay = getIntExtra("paymentMode", 0)
@@ -289,7 +291,7 @@ class AddCollectionBillPaymentActivity : BaseActivity<ActivityAddCollectionBillP
                             selectorList[position].apply {
                                 binding.paymentCurrency.text = name
 
-                                currencyId = id
+                                collectionBillItem.currency = id
 
                                 popupWindow.dismiss()
                             }
@@ -430,6 +432,9 @@ class AddCollectionBillPaymentActivity : BaseActivity<ActivityAddCollectionBillP
                 it.remark = remark
             }
         }
+
+        Log.e("request", Gson().toJson(updateCollectionBillRequest))
+
         apiService.updateCollectionBillPayment(updateCollectionBillRequest).enqueue(object : Callback<BaseResponse> {
             override fun onResponse(p0: Call<BaseResponse>, response: Response<BaseResponse>) {
 

+ 12 - 18
app/src/main/java/com/pan_american/android/ui/financial_module/collection_bill/CollectionBillPaymentListActivity.kt

@@ -24,7 +24,6 @@ import com.pan_american.android.data.model.financial_module.collection_bill.netw
 import com.pan_american.android.data.model.financial_module.collection_bill.network.CollectionBillFileDownloadResponse
 import com.pan_american.android.data.model.financial_module.collection_bill.network.CollectionBillGroupDetailPaymentListRequest
 import com.pan_american.android.data.model.financial_module.collection_bill.network.CollectionBillGroupDetailPaymentListResponse
-import com.pan_american.android.data.model.financial_module.collection_bill.network.ImportThreePublicExpenseResponse
 import com.pan_american.android.data.network.APIService
 import com.pan_american.android.data.network.ServiceCreator
 import com.pan_american.android.databinding.ActivityCollectionBillPaymentListBinding
@@ -197,7 +196,10 @@ class CollectionBillPaymentListActivity : BaseActivity<ActivityCollectionBillPay
         }
 
         binding.addPaymentItem.setOnClickListener {
-            val intent = Intent(OASystem.context, AddCollectionBillPaymentActivity::class.java)
+            val intent = Intent(OASystem.context, AddCollectionBillPaymentActivity::class.java).apply {
+                putExtra("fromList", false)
+                putExtra("groupId", groupId)
+            }
             startActivity(intent)
         }
     }
@@ -364,38 +366,30 @@ class CollectionBillPaymentListActivity : BaseActivity<ActivityCollectionBillPay
     }
 
     private fun importThreePublicExpense() {
-        apiService.importThreePublicExpense(groupId).enqueue(object : Callback<ImportThreePublicExpenseResponse> {
+        apiService.importThreePublicExpense(groupId).enqueue(object : Callback<BaseResponse> {
             override fun onResponse(
-                call: Call<ImportThreePublicExpenseResponse>,
-                response: Response<ImportThreePublicExpenseResponse>
+                call: Call<BaseResponse>,
+                response: Response<BaseResponse>
             ) {
 
                 val listResponse = response.body()
 
-                Log.e("response", Gson().toJson(listResponse))
-
                 if (listResponse != null) {
                     if (listResponse.code == 200) {
+                        showMessage(resources.getString(R.string.three_public_expense_import_success))
 
-                        if (listResponse.data.size == 0) {
-                            showMessage(resources.getString(R.string.three_public_expense_no_data))
-                        } else {
-
-                            showMessage(resources.getString(R.string.three_public_expense_import_success))
+                        binding.groupPaymentList.adapter!!.notifyItemRangeRemoved(0, collectionBillPaymentList.size)
 
-                            binding.groupPaymentList.adapter!!.notifyItemRangeRemoved(0, collectionBillPaymentList.size)
+                        collectionBillPaymentList.clear()
 
-                            collectionBillPaymentList.clear()
-
-                            getGroupDetailAndPaymentList()
-                        }
+                        getGroupDetailAndPaymentList()
                     } else {
                         showMessage(listResponse.msg)
                     }
                 }
             }
 
-            override fun onFailure(p0: Call<ImportThreePublicExpenseResponse>, p1: Throwable) {
+            override fun onFailure(p0: Call<BaseResponse>, p1: Throwable) {
                 p1.printStackTrace()
                 showErrorInfo(R.string.three_public_expense_get_error)
             }