|
@@ -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)
|
|
|
}
|