Browse Source

2024-07-29 新增 / 修改

新增:
1. 商邀费用录入-添加/修改界面-右上角添加成本展示

修改:
1. OP费用录入-OP费用详细-显示成本和web端同步
zhaiy 8 months ago
parent
commit
ebe918dc67

+ 1 - 14
.idea/deploymentTargetDropDown.xml

@@ -6,20 +6,7 @@
         <State />
       </entry>
       <entry key="app">
-        <State>
-          <runningDeviceTargetSelectedWithDropDown>
-            <Target>
-              <type value="RUNNING_DEVICE_TARGET" />
-              <deviceKey>
-                <Key>
-                  <type value="SERIAL_NUMBER" />
-                  <value value="3bb3c424" />
-                </Key>
-              </deviceKey>
-            </Target>
-          </runningDeviceTargetSelectedWithDropDown>
-          <timeTargetWasSelectedWithDropDown value="2024-07-11T08:07:17.966626Z" />
-        </State>
+        <State />
       </entry>
     </value>
   </component>

+ 18 - 0
app/src/main/java/com/pan_american/android/data/model/group_invite_official/invite_official_payment_insert/entity/InviteOfficialPaymentCost.kt

@@ -0,0 +1,18 @@
+package com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.entity
+
+import com.bin.david.form.annotation.SmartColumn
+import com.bin.david.form.annotation.SmartTable
+
+@SmartTable(name = "商邀费用成本")
+class InviteOfficialPaymentCost {
+    @SmartColumn(id = 1, name = "日期", fixed = true)
+    var date = ""
+    @SmartColumn(id = 2, name = "公务活动费")
+    var officialActivitiesFee = 0.0
+    @SmartColumn(id = 3, name = "公务翻译费")
+    var officialTransFee = 0.0
+    @SmartColumn(id = 4, name = "邀请函费用")
+    var invitationFee = 0.0
+    @SmartColumn(id = 5, name = "会务费")
+    var activitiesFee = 0.0
+}

+ 9 - 0
app/src/main/java/com/pan_american/android/data/model/group_invite_official/invite_official_payment_insert/network/InviteOfficialCostDataRequest.kt

@@ -0,0 +1,9 @@
+package com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network
+
+import com.pan_american.android.OASystem
+
+class InviteOfficialCostDataRequest(val diId: Int, val cTable: Int) {
+
+    val userId = OASystem.userInfo.userId
+
+}

+ 11 - 0
app/src/main/java/com/pan_american/android/data/model/group_invite_official/invite_official_payment_insert/network/InviteOfficialCostDataResponse.kt

@@ -0,0 +1,11 @@
+package com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network
+
+import com.pan_american.android.base.BaseResponse
+import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.entity.InviteOfficialPaymentCost
+
+class InviteOfficialCostDataResponse(val data: Data): BaseResponse() {
+
+    inner class Data (val modulePromptInfos: ArrayList<InviteOfficialCostDetail>)
+
+    inner class InviteOfficialCostDetail (val currencyCode: String, val rate: Double, val data: ArrayList<InviteOfficialPaymentCost>)
+}

+ 45 - 13
app/src/main/java/com/pan_american/android/data/model/group_op/ground_convey_payment_insert/entity/GroundConveyCost.kt

@@ -9,22 +9,54 @@ class GroundConveyCost {
     var date = ""
     @SmartColumn(id = 2, name = "车费用")
     var carFee = 0.0
-    @SmartColumn(id = 3, name = "导游费用")
+    @SmartColumn(id = 3, name = "车型")
+    var carType = ""
+    @SmartColumn(id = 4, name = "司机工资")
+    var driverFee = 0.0
+    @SmartColumn(id = 5, name = "司机小费")
+    var driverTipFee = 0.0
+    @SmartColumn(id = 6, name = "司机餐补")
+    var driverMealSubsidy = 0.0
+    @SmartColumn(id = 7, name = "司机超时费用")
+    var driverOvertimeFee = 0.0
+    @SmartColumn(id = 8, name = "导游费用")
     var guideFee = 0.0
-    @SmartColumn(id = 4, name = "餐食费")
-    var mealFee = 0.0
-    @SmartColumn(id = 5, name = "门票费")
+    @SmartColumn(id = 9, name = "导游超时费用")
+    var guideOvertimeFee = 0.0
+    @SmartColumn(id = 10, name = "导游餐补")
+    var guideMealSubsidy = 0.0
+    @SmartColumn(id = 11, name = "导游房补")
+    var guideRoomSubsidy = 0.0
+    @SmartColumn(id = 12, name = "导游交通费")
+    var guideCarFare = 0.0
+    @SmartColumn(id = 13, name = "导游景点费")
+    var guideSpotFee = 0.0
+    @SmartColumn(id = 14, name = "导游小费")
+    var guideTipsFee = 0.0
+    @SmartColumn(id = 15, name = "早餐费")
+    var breakfast = 0.0
+    @SmartColumn(id = 16, name = "午餐费")
+    var lumch = 0.0
+    @SmartColumn(id = 17, name = "晚餐费")
+    var dinner = 0.0
+    @SmartColumn(id = 18, name = "公务活动费")
+    var officialActivitiesFee = 0.0
+    @SmartColumn(id = 19, name = "公务翻译费")
+    var officialTransFee = 0.0
+    @SmartColumn(id = 20, name = "邀请函费用")
+    var invitationFee = 0.0
+    @SmartColumn(id = 21, name = "门票费")
     var ticketFee = 0.0
-    @SmartColumn(id = 6, name = "小费")
-    var tipFee = 0.0
-    @SmartColumn(id = 7, name = "饮料零食水果")
+    @SmartColumn(id = 22, name = "门票费描述")
+    var ticketRemark = ""
+    @SmartColumn(id = 23, name = "饮料零食水果")
     var drinksSnacksFruitFee = 0.0
-    @SmartColumn(id = 8, name = "出行物资")
+    @SmartColumn(id = 24, name = "出行物资")
     var travelSupplies = 0.0
-    @SmartColumn(id = 10, name = "领队费")
+    @SmartColumn(id = 25, name = "零用金")
+    var spentCash = 0.0
+    @SmartColumn(id = 26, name = "领队费")
     var leadersFee = 0.0
-    @SmartColumn(id = 12, name = "车型")
-    var carType = ""
-    @SmartColumn(id = 13, name = "零用金")
-    var spentCash = 0.00
+    @SmartColumn(id = 27, name = "会务费")
+    var activitiesFee = 0.0
 }

+ 8 - 0
app/src/main/java/com/pan_american/android/data/network/APIService.kt

@@ -105,6 +105,8 @@ import com.pan_american.android.data.model.group_invite_official.invite_data.net
 import com.pan_american.android.data.model.group_invite_official.invite_data.network.InviteDataResourceResponse
 import com.pan_american.android.data.model.group_invite_official.invite_data.network.UpdateInviteDetailRequest
 import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialBaseDataResponse
+import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialCostDataRequest
+import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialCostDataResponse
 import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialDetailRequest
 import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialDetailResponse
 import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialListRequest
@@ -448,6 +450,12 @@ interface APIService {
     @POST("/api/Groups/InvitationOfficialActivityInitBasicData")
     fun getInviteOfficialBaseData(): Call<InviteOfficialBaseDataResponse>
 
+    /**
+     * OP费用录入,团组成本
+     */
+    @POST("/api/Groups/PostGroupCostModulePrompt")
+    fun getInviteOfficialCostData(@Body inviteOfficialCostDataRequest: InviteOfficialCostDataRequest): Call<InviteOfficialCostDataResponse>
+
     /**
      * 商邀公务费用,根据团ID获取简单费用List
      */

+ 85 - 0
app/src/main/java/com/pan_american/android/ui/group_invite_official/invite_official_payment_insert/AddInvitePaymentActivity.kt

@@ -3,9 +3,14 @@ package com.pan_american.android.ui.group_invite_official.invite_official_paymen
 import android.os.Bundle
 import android.text.Editable
 import android.text.TextWatcher
+import android.view.Gravity
 import android.view.View
+import android.view.ViewGroup
+import android.widget.PopupWindow
 import android.widget.TextView
 import androidx.core.content.res.ResourcesCompat
+import com.bin.david.form.core.SmartTable
+import com.bin.david.form.data.style.FontStyle
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
 import com.pan_american.android.base.BaseActivity
@@ -14,7 +19,10 @@ 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.network.GroupCurrencyRequest
 import com.pan_american.android.data.model.common.network.GroupCurrencyResponse
+import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.entity.InviteOfficialPaymentCost
 import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialBaseDataResponse
+import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialCostDataRequest
+import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialCostDataResponse
 import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialDetailRequest
 import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.InviteOfficialDetailResponse
 import com.pan_american.android.data.model.group_invite_official.invite_official_payment_insert.network.UpdateInviteOfficialRequest
@@ -94,6 +102,14 @@ class AddInvitePaymentActivity : BaseActivity<ActivityAddInvitePaymentBinding>()
 
     private var isAudit = -1
 
+    private var invitePaymentCostInit = false
+
+    private var invitePaymentCostCurrency = ""
+
+    private var invitePaymentCostExchangeRate = 0.0
+
+    private var invitePaymentCostList = ArrayList<InviteOfficialPaymentCost>()
+
     override fun getViewBinding() = ActivityAddInvitePaymentBinding.inflate(layoutInflater)
 
     override fun onCreate(savedInstanceState: Bundle?) {
@@ -140,9 +156,78 @@ class AddInvitePaymentActivity : BaseActivity<ActivityAddInvitePaymentBinding>()
                 }
             }
 
+            rightTextField.apply {
+                visibility = View.VISIBLE
+                text = resources.getString(R.string.show_cost)
+            }
+
             backButton.setOnClickListener {
                 back()
             }
+
+            rightTextField.setOnClickListener {
+
+                val invitePaymentCostPopView = View.inflate(OASystem.context, R.layout.popup_cost_table, null)
+                popupWindow = PopupWindow(invitePaymentCostPopView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
+
+                showPopupWindow {
+
+                    val currencyAbbr = invitePaymentCostPopView.findViewById<TextView>(R.id.currency_abbr)
+                    val exchangeRate = invitePaymentCostPopView.findViewById<TextView>(R.id.exchange_rate)
+                    val inviteOfficialCostTable = invitePaymentCostPopView.findViewById<SmartTable<InviteOfficialPaymentCost>>(R.id.table)
+
+                    inviteOfficialCostTable.config.apply {
+                        isShowXSequence = false
+                        isShowYSequence = false
+                        minTableWidth = popupWindow.width
+                        tableTitleStyle = FontStyle(50, ResourcesCompat.getColor(resources, R.color.text_color, theme))
+                        contentStyle = FontStyle(40, ResourcesCompat.getColor(resources, R.color.text_color, theme))
+                    }
+
+                    if (!invitePaymentCostInit) {
+                        apiService.getInviteOfficialCostData(InviteOfficialCostDataRequest(groupId, OASystem.C_TABLE_GROUND_CONVEY)).enqueue(object : Callback<InviteOfficialCostDataResponse> {
+                            override fun onResponse(
+                                call: Call<InviteOfficialCostDataResponse>,
+                                response: Response<InviteOfficialCostDataResponse>
+                            ) {
+
+                                val costResponse = response.body()
+
+                                if (costResponse != null) {
+                                    if (costResponse.code == 200) {
+
+                                        invitePaymentCostCurrency = costResponse.data.modulePromptInfos[0].currencyCode
+                                        invitePaymentCostExchangeRate = costResponse.data.modulePromptInfos[0].rate
+
+                                        invitePaymentCostList = costResponse.data.modulePromptInfos[0].data
+
+                                        currencyAbbr.text = invitePaymentCostCurrency
+                                        exchangeRate.text = invitePaymentCostExchangeRate.toString()
+
+                                        inviteOfficialCostTable.setData(invitePaymentCostList)
+
+                                        invitePaymentCostInit = true
+
+                                    } else {
+                                        showMessage(costResponse.msg)
+                                    }
+                                }
+                            }
+
+                            override fun onFailure(call: Call<InviteOfficialCostDataResponse>, t: Throwable) {
+                                showErrorInfo(R.string.invite_official_payment_cost_get_failed)
+                            }
+                        })
+                    } else {
+                        currencyAbbr.text = invitePaymentCostCurrency
+                        exchangeRate.text = invitePaymentCostExchangeRate.toString()
+
+                        inviteOfficialCostTable.setData(invitePaymentCostList)
+                    }
+
+                    popupWindow.showAtLocation(binding.root, Gravity.BOTTOM, 0, 0)
+                }
+            }
         }
     }
 

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

@@ -569,6 +569,7 @@
 
     <!-- 商邀费用列表,错误信息 -->
     <string name="invite_official_payment_list_get_failed">商邀费用列表获取失败</string>
+    <string name="invite_official_payment_cost_get_failed">商邀费用成本获取失败</string>
 
     <!-- 新增商邀费用 -->
     <string name="add_new_invite_payment">新增商邀费用</string>