Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
13ff529e
Commit
13ff529e
authored
Apr 29, 2021
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、外送自取頁面強制功能 2、報表時間問題 3、檢測版本接口更換、供應鏈代碼
parent
33afd942
Hide whitespace changes
Inline
Side-by-side
Showing
72 changed files
with
1254 additions
and
624 deletions
+1254
-624
component-coldchain/src/main/java/com/gingersoft/coldchain_module/mvp/ui/activity/OrderDetailsActivity.java
+3
-6
component-coldchain/src/main/java/com/gingersoft/coldchain_module/mvp/ui/adapter/OrderDetailsBtnAdapter.kt
+1
-1
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
+9
-5
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
+12
-12
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/OrderDetailsActivity.kt
+173
-90
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/adapter/OrderBtnAdapter.kt
+1
-1
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/adapter/OrderDetailsAdapter.kt
+1
-1
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/service/MainService.java
+1
-1
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/HomePresenter.java
+33
-37
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/NewMainPresenter.java
+33
-37
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
+1
-1
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/PaymentMethodReportFragment.java
+1
-1
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/SalesFragment.java
+2
-2
component-supply-chain/build.gradle
+2
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/di/component/WarehousingOrderListComponent.java
+42
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/di/module/WarehousingOrderListModule.java
+31
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/ConsumeWareHousingBean.java
+2
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseFoodBean.java
+0
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WareHouseListBean.java
+0
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WarehouseDetailsBean.java
+3
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WarehouseOrderBean.java
+18
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/content/SupplyShoppingCart.java
+45
-40
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/WarehousingOrderListContract.java
+29
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/model/WarehousingOrderListModel.java
+47
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/BuyIngredientsPresenter.java
+69
-39
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/OrderDetailsPresenter.java
+7
-3
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WareHouseListPresenter.java
+0
-7
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WarehousingOrderListPresenter.java
+53
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/activity/SupplyChainMainActivity.java
+0
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/BuyIngredientsAdapter.java
+5
-4
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/PurchasePageAdapter.java
+2
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/WareHousingDetailsAdapter.java
+28
-24
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/WarehousingOrderListAdapter.kt
+26
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/BuyIngredientsFragment.java
+14
-36
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/NewFoodIngredientsFragment.java
+2
-4
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/OrderDetailsFragment.java
+72
-73
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/ShoppingCatFragment.java
+7
-4
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WareHouseListFragment.java
+0
-11
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehouseDetailsFragment.java
+2
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingInventoryFragment.java
+0
-10
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingOrderListFragment.java
+62
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/InventoryConsumptionView.java
+12
-5
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ScanSnPopup.java
+8
-8
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ScanSnView.java
+20
-10
component-supply-chain/src/main/res/layout/fragment_order_content.xml
+2
-1
component-supply-chain/src/main/res/layout/fragment_ware_house_list.xml
+5
-5
component-supply-chain/src/main/res/layout/fragment_warehouse_details.xml
+1
-1
component-supply-chain/src/main/res/layout/fragment_warehousing_list.xml
+17
-0
component-supply-chain/src/main/res/layout/info_empty.xml
+1
-1
component-supply-chain/src/main/res/layout/item_buy_food_ingredient_double_row.xml
+17
-13
component-supply-chain/src/main/res/layout/item_order_details_food.xml
+5
-1
component-supply-chain/src/main/res/layout/item_warehouse_details.xml
+14
-7
component-supply-chain/src/main/res/layout/item_warehousing_order_list.xml
+98
-0
component-supply-chain/src/main/res/layout/layout_scan_sn.xml
+5
-5
component-supply-chain/src/main/res/values/strings.xml
+2
-0
library-base/src/main/java/com/jess/arms/utils/SoftHideKeyBoardUtil.java
+0
-3
library-common/src/main/java/com/gingersoft/gsa/cloud/common/constans/FunctionManagerConstants.java
+0
-45
library-common/src/main/java/com/gingersoft/gsa/cloud/common/constans/Takeaway.java
+78
-0
library-common/src/main/java/com/gingersoft/gsa/cloud/common/function/FunctionManager.java
+9
-2
library-common/src/main/java/com/gingersoft/gsa/cloud/common/function/click/BaseQueicItemClickAspect.java
+0
-1
library-common/src/main/res/layout/loadsir_custom.xml
+1
-1
library-common/src/main/res/layout/loadsir_empty.xml
+1
-1
library-common/src/main/res/layout/loadsir_no_network.xml
+1
-1
library-common/src/main/res/mipmap-hdpi/loadsir_empty.png
+0
-0
library-common/src/main/res/mipmap-mdpi/loadsir_empty.png
+0
-0
library-common/src/main/res/mipmap-xhdpi/loadsir_empty.png
+0
-0
library-common/src/main/res/mipmap-xxhdpi/loadsir_empty.png
+0
-0
library-common/src/main/res/mipmap-xxxhdpi/loadsir_empty.png
+0
-0
library-common/src/main/res/values/strings.xml
+12
-0
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/utils/AppDialog.java
+38
-36
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/utils/BtnBuilder.kt
+54
-17
library-ui/src/main/res/layout/dialog_tip.xml
+14
-5
No files found.
component-coldchain/src/main/java/com/gingersoft/coldchain_module/mvp/ui/activity/OrderDetailsActivity.java
View file @
13ff529e
...
@@ -6,9 +6,7 @@ import android.content.Intent;
...
@@ -6,9 +6,7 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.print.PrintManager
;
import
android.print.PrintManager
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.KeyEvent
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
...
@@ -33,10 +31,10 @@ import com.gingersoft.coldchain_module.mvp.ui.adapter.MyPrintDocumentAdapter;
...
@@ -33,10 +31,10 @@ import com.gingersoft.coldchain_module.mvp.ui.adapter.MyPrintDocumentAdapter;
import
com.gingersoft.coldchain_module.mvp.ui.adapter.OrderDetailsBtnAdapter
;
import
com.gingersoft.coldchain_module.mvp.ui.adapter.OrderDetailsBtnAdapter
;
import
com.gingersoft.coldchain_module.mvp.ui.adapter.OrderDetailsFoodAdapter
;
import
com.gingersoft.coldchain_module.mvp.ui.adapter.OrderDetailsFoodAdapter
;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.common.constans.
FunctionManagerConstants
;
import
com.gingersoft.gsa.cloud.common.constans.
Takeaway
;
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
;
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
;
import
com.gingersoft.gsa.cloud.common.function.FunctionManager
;
import
com.gingersoft.gsa.cloud.common.function.FunctionManager
;
import
com.gingersoft.gsa.cloud.
common.
ui.utils.BtnBuilder
;
import
com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
;
import
com.gingersoft.gsa.cloud.common.utils.ClipboardUtils
;
import
com.gingersoft.gsa.cloud.common.utils.ClipboardUtils
;
import
com.gingersoft.gsa.cloud.common.utils.CollectionUtils
;
import
com.gingersoft.gsa.cloud.common.utils.CollectionUtils
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
...
@@ -55,7 +53,6 @@ import com.qmuiteam.qmui.widget.QMUITopBar;
...
@@ -55,7 +53,6 @@ import com.qmuiteam.qmui.widget.QMUITopBar;
import
java.io.File
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.BindView
;
...
@@ -157,7 +154,7 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im
...
@@ -157,7 +154,7 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im
requestPermissions
(
null
);
requestPermissions
(
null
);
mPresenter
.
findOrderDetails
(
orderId
,
isRead
);
mPresenter
.
findOrderDetails
(
orderId
,
isRead
);
// mPresenter.download("https://labels.shipany.io/sbx2/325764d7-b2e2-4d8b-9a68-7f4473719f9c/2020-08-27/20200827171831451_SF5805023992121_144ac51b-5370-46db-9e8d-50904e33b1b7.pdf");
// mPresenter.download("https://labels.shipany.io/sbx2/325764d7-b2e2-4d8b-9a68-7f4473719f9c/2020-08-27/20200827171831451_SF5805023992121_144ac51b-5370-46db-9e8d-50904e33b1b7.pdf");
List
<
Function
>
functionByResModule
=
FunctionManager
.
getDefault
().
getFunctionByResModule
(
GsaCloudApplication
.
getAppContext
(),
FunctionManagerConstants
.
takeaway
.
class
,
FunctionManagerConstants
.
takeaway
.
orderDetails
,
"orderDetails/btn"
);
List
<
Function
>
functionByResModule
=
FunctionManager
.
getDefault
().
getFunctionByResModule
(
GsaCloudApplication
.
getAppContext
(),
Takeaway
.
ORDER_DETAILS_BTN_PERMISSION
,
Takeaway
.
TAKEAWAY_ORDER_DETAILS
);
btnBuilder
=
BtnBuilder
.
getInstance
(
functionByResModule
);
btnBuilder
=
BtnBuilder
.
getInstance
(
functionByResModule
);
}
}
...
...
component-coldchain/src/main/java/com/gingersoft/coldchain_module/mvp/ui/adapter/OrderDetailsBtnAdapter.kt
View file @
13ff529e
...
@@ -3,7 +3,7 @@ package com.gingersoft.coldchain_module.mvp.ui.adapter
...
@@ -3,7 +3,7 @@ package com.gingersoft.coldchain_module.mvp.ui.adapter
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.gingersoft.coldchain_module.R
import
com.gingersoft.coldchain_module.R
import
com.gingersoft.gsa.cloud.
common.
ui.utils.BtnBuilder
import
com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
class
OrderDetailsBtnAdapter
(
list
:
MutableList
<
BtnBuilder
.
BtnBean
>)
:
BaseQuickAdapter
<
BtnBuilder
.
BtnBean
,
BaseViewHolder
>(
R
.
layout
.
item_btn
,
list
)
{
class
OrderDetailsBtnAdapter
(
list
:
MutableList
<
BtnBuilder
.
BtnBean
>)
:
BaseQuickAdapter
<
BtnBuilder
.
BtnBean
,
BaseViewHolder
>(
R
.
layout
.
item_btn
,
list
)
{
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
View file @
13ff529e
...
@@ -13,14 +13,14 @@ import androidx.recyclerview.widget.GridLayoutManager
...
@@ -13,14 +13,14 @@ import androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.billy.cc.core.component.CC
import
com.billy.cc.core.component.CC
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
import
com.gingersoft.gsa.cloud.common.constans.AppConstans
import
com.gingersoft.gsa.cloud.common.constans.*
import
com.gingersoft.gsa.cloud.common.constans.FoodSummaryConstans
import
com.gingersoft.gsa.cloud.common.constans.PrintConstans
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails.Companion.verifiAmountTip
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails.Companion.verifiAmountTip
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails.Companion.verificationAmount
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails.Companion.verificationAmount
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
import
com.gingersoft.gsa.cloud.common.function.XFunctionManager
import
com.gingersoft.gsa.cloud.common.function.XFunctionViews
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
import
com.gingersoft.gsa.cloud.common.service.ICommandService
import
com.gingersoft.gsa.cloud.common.service.ICommandService
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
...
@@ -29,6 +29,7 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil
...
@@ -29,6 +29,7 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.component.ComponentName
import
com.gingersoft.gsa.cloud.component.ComponentName
import
com.gingersoft.gsa.cloud.database.bean.Function
import
com.gingersoft.gsa.cloud.order.order.TakeawayOrder
import
com.gingersoft.gsa.cloud.order.order.TakeawayOrder
import
com.gingersoft.gsa.cloud.pay.bean.PayMethod
import
com.gingersoft.gsa.cloud.pay.bean.PayMethod
import
com.gingersoft.gsa.cloud.print.bean.adapter.PrintContentAdapter
import
com.gingersoft.gsa.cloud.print.bean.adapter.PrintContentAdapter
...
@@ -39,7 +40,6 @@ import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.*
...
@@ -39,7 +40,6 @@ import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.*
import
com.gingersoft.gsa.delivery_pick_mode.ui.adapter.DeliveryAdapter
import
com.gingersoft.gsa.delivery_pick_mode.ui.adapter.DeliveryAdapter
import
com.gingersoft.gsa.delivery_pick_mode.util.OtherOrderUtils
import
com.gingersoft.gsa.delivery_pick_mode.util.OtherOrderUtils
import
com.jess.arms.utils.ArmsUtils
import
com.jess.arms.utils.ArmsUtils
import
kotlinx.android.synthetic.main.activity_other_order.*
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.withContext
import
kotlinx.coroutines.withContext
...
@@ -65,8 +65,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -65,8 +65,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
val
Transportation
=
1009
//修改運輸工具成功
val
Transportation
=
1009
//修改運輸工具成功
val
AmountError
=
1010
//訂單金額有錯
val
AmountError
=
1010
//訂單金額有錯
val
ErrorCode
=
1011
//報錯提示
val
ErrorCode
=
1011
//報錯提示
init
{
XFunctionManager
.
inJect
(
this
,
Takeaway
::
class
.
java
)
}
}
}
var
mEnforceBtn
:
List
<
Function
>
=
java
.
util
.
ArrayList
(
7
)
//餐廳id
//餐廳id
val
restaurantId
by
lazy
{
RestaurantInfoManager
.
newInstance
().
restaurantId
}
val
restaurantId
by
lazy
{
RestaurantInfoManager
.
newInstance
().
restaurantId
}
...
@@ -605,7 +610,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -605,7 +610,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
fun
closingBill
(
orderDetails
:
OrderDetails
.
DataBean
,
payMethods
:
List
<
PayMethod
>,
listener
:
(
Int
,
Boolean
)
->
Unit
)
{
fun
closingBill
(
orderDetails
:
OrderDetails
.
DataBean
,
payMethods
:
List
<
PayMethod
>,
listener
:
(
Int
,
Boolean
)
->
Unit
)
{
launch
({
launch
({
val
payMultiple
=
ArrayList
<
OrderDetails
.
DataBean
.
PayMultiple
>()
val
payMultiple
=
ArrayList
<
OrderDetails
.
DataBean
.
PayMultiple
>()
payMethods
.
forEach
{
payMethods
.
forEach
{
payMultiple
.
add
(
OrderDetails
.
DataBean
.
PayMultiple
(
it
.
payType
.
toString
(),
it
.
payMoney
,
it
.
payName
,
0.0
))
payMultiple
.
add
(
OrderDetails
.
DataBean
.
PayMultiple
(
it
.
payType
.
toString
(),
it
.
payMoney
,
it
.
payName
,
0.0
))
}
}
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
View file @
13ff529e
...
@@ -24,7 +24,7 @@ import com.billy.cc.core.component.CC
...
@@ -24,7 +24,7 @@ import com.billy.cc.core.component.CC
import
com.gingersoft.gsa.cloud.common.constans.AppConstans
import
com.gingersoft.gsa.cloud.common.constans.AppConstans
import
com.gingersoft.gsa.cloud.common.constans.ExpandConstant
import
com.gingersoft.gsa.cloud.common.constans.ExpandConstant
import
com.gingersoft.gsa.cloud.common.constans.FoodSummaryConstans.TAKEAWAY_TYPE
import
com.gingersoft.gsa.cloud.common.constans.FoodSummaryConstans.TAKEAWAY_TYPE
import
com.gingersoft.gsa.cloud.common.constans.
FunctionManagerConstants
import
com.gingersoft.gsa.cloud.common.constans.
Takeaway
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
import
com.gingersoft.gsa.cloud.common.function.FunctionManager
import
com.gingersoft.gsa.cloud.common.function.FunctionManager
...
@@ -92,7 +92,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
...
@@ -92,7 +92,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
//功能配置
//功能配置
private
val
functionByResModule
by
lazy
{
private
val
functionByResModule
by
lazy
{
FunctionManager
.
getDefault
().
getFunctionByResModule
(
this
,
FunctionManagerConstants
.
takeaway
::
class
.
java
,
FunctionManagerConstants
.
takeaway
.
takeawayMain
,
"btn"
)
FunctionManager
.
getDefault
().
getFunctionByResModule
(
this
,
Takeaway
.
TAKEAWAY_MAIN_BTN_PERMISSION
,
Takeaway
.
TAKEAWAY_BTN
)
}
}
//關閉心跳的廣播
//關閉心跳的廣播
...
@@ -396,7 +396,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
...
@@ -396,7 +396,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
val
notification
:
NotificationManagerCompat
=
NotificationManagerCompat
.
from
(
this
)
val
notification
:
NotificationManagerCompat
=
NotificationManagerCompat
.
from
(
this
)
if
(!
notification
.
areNotificationsEnabled
())
{
if
(!
notification
.
areNotificationsEnabled
())
{
//未開啟通知權限
//未開啟通知權限
AppDialog
().
showTipDialog
(
this
,
"檢測到通知權限未打開,建議打開,否則會影響正常使用!"
)
{
_
,
d
->
AppDialog
().
showTipDialog
(
this
,
"檢測到通知權限未打開,建議打開,否則會影響正常使用!"
)
{
->
val
intent
=
Intent
()
val
intent
=
Intent
()
when
{
when
{
SDK_INT
>=
Build
.
VERSION_CODES
.
O
->
{
SDK_INT
>=
Build
.
VERSION_CODES
.
O
->
{
...
@@ -451,12 +451,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
...
@@ -451,12 +451,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
if
(
type
==
3
||
type
==
4
||
type
==
5
if
(
type
==
3
||
type
==
4
||
type
==
5
||
type
==
6
||
type
==
7
)
{
||
type
==
6
||
type
==
7
)
{
//上次是未確認訂單,本次的提示還是未確認訂單,就不刷新本地頁面
//上次是未確認訂單,本次的提示還是未確認訂單,就不刷新本地頁面
if
(!(
lastMsgType
==
5
&&
type
==
5
))
{
getCurrentPageOrderList
()
getCurrentPageOrderList
()
// 刷新餘額
// 刷新餘額
pageViewModel
.
getBalance
(
RestaurantInfoManager
.
newInstance
().
brandId
)
pageViewModel
.
getBalance
(
RestaurantInfoManager
.
newInstance
().
brandId
)
}
lastMsgType
=
type
// 選擇了自動接單,有訂單來就接單
// 選擇了自動接單,有訂單來就接單
if
(
cb_takeaway_auto_receiving_orders
.
isChecked
)
{
if
(
cb_takeaway_auto_receiving_orders
.
isChecked
)
{
//查詢待確定的訂單id
//查詢待確定的訂單id
...
@@ -467,6 +464,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
...
@@ -467,6 +464,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
//查詢預約單和即時單數量
//查詢預約單和即時單數量
pageViewModel
.
getOrderStatistics
(
fragmentStatus
[
view_pager
.
currentItem
])
pageViewModel
.
getOrderStatistics
(
fragmentStatus
[
view_pager
.
currentItem
])
}
}
}
else
if
(
type
==
1
){
//長連接登陸成功,也刷新一下列表
getCurrentPageOrderList
()
}
}
}
}
})
})
...
@@ -545,9 +545,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
...
@@ -545,9 +545,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
*/
*/
private
fun
initAppTop
()
{
private
fun
initAppTop
()
{
//獲取功能權限
//獲取功能權限
val
newOrderFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
FunctionManagerConstants
.
t
akeaway
.
TAKEAWAY_NEW_ORDER
)
val
newOrderFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
T
akeaway
.
TAKEAWAY_NEW_ORDER
)
val
historyOrderFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
FunctionManagerConstants
.
t
akeaway
.
TAKEAWAY_HISTORY_ORDER
)
val
historyOrderFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
T
akeaway
.
TAKEAWAY_HISTORY_ORDER
)
val
openCashBoxFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
FunctionManagerConstants
.
t
akeaway
.
TAKEAWAY_OPEN_CASH_BOX
)
val
openCashBoxFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
T
akeaway
.
TAKEAWAY_OPEN_CASH_BOX
)
//顯示餐廳名
//顯示餐廳名
qm_other_order_bar
.
setTitle
(
RestaurantInfoManager
.
newInstance
().
restaurantName
)
qm_other_order_bar
.
setTitle
(
RestaurantInfoManager
.
newInstance
().
restaurantName
)
qm_other_order_bar
.
addLeftImageButton
(
R
.
drawable
.
icon_return
,
R
.
id
.
iv_left_back
).
setOnClickListener
{
finish
()
}
qm_other_order_bar
.
addLeftImageButton
(
R
.
drawable
.
icon_return
,
R
.
id
.
iv_left_back
).
setOnClickListener
{
finish
()
}
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/OrderDetailsActivity.kt
View file @
13ff529e
...
@@ -17,18 +17,18 @@ import androidx.recyclerview.widget.LinearLayoutManager
...
@@ -17,18 +17,18 @@ import androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.ethanhua.skeleton.Skeleton
import
com.ethanhua.skeleton.Skeleton
import
com.ethanhua.skeleton.ViewSkeletonScreen
import
com.ethanhua.skeleton.ViewSkeletonScreen
import
com.gingersoft.gsa.cloud.common.constans.
FunctionManagerConstants
import
com.gingersoft.gsa.cloud.common.constans.
Takeaway
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails.Companion.verifiAmountTip
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails.Companion.verifiAmountTip
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
import
com.gingersoft.gsa.cloud.common.function.FunctionManager
import
com.gingersoft.gsa.cloud.common.function.FunctionManager
import
com.gingersoft.gsa.cloud.common.ui.utils.BtnBuilder
import
com.gingersoft.gsa.cloud.common.utils.ClipboardUtils
import
com.gingersoft.gsa.cloud.common.utils.ClipboardUtils
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.ui.utils.AppDialog
import
com.gingersoft.gsa.cloud.ui.utils.AppDialog
import
com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
import
com.gingersoft.gsa.cloud.ui.utils.DialogUtils
import
com.gingersoft.gsa.cloud.ui.utils.DialogUtils
import
com.gingersoft.gsa.cloud.ui.view.AddKeyBoard
import
com.gingersoft.gsa.cloud.ui.view.AddKeyBoard
import
com.gingersoft.gsa.delivery_pick_mode.R
import
com.gingersoft.gsa.delivery_pick_mode.R
...
@@ -53,8 +53,11 @@ import com.gingersoft.gsa.delivery_pick_mode.util.getCustomColor
...
@@ -53,8 +53,11 @@ import com.gingersoft.gsa.delivery_pick_mode.util.getCustomColor
import
com.gingersoft.gsa.delivery_pick_mode.util.showSelectDialog
import
com.gingersoft.gsa.delivery_pick_mode.util.showSelectDialog
import
com.gingersoft.gsa.delivery_pick_mode.util.showWaringDialog
import
com.gingersoft.gsa.delivery_pick_mode.util.showWaringDialog
import
com.jess.arms.mvp.IPresenter
import
com.jess.arms.mvp.IPresenter
import
com.lxj.xpopup.XPopup
import
com.lxj.xpopup.interfaces.OnSelectListener
import
com.qmuiteam.qmui.widget.QMUITopBar
import
com.qmuiteam.qmui.widget.QMUITopBar
import
kotlinx.android.synthetic.main.activity_order_details.*
import
kotlinx.android.synthetic.main.activity_order_details.*
import
kotlinx.android.synthetic.main.activity_other_order.*
import
java.util.*
import
java.util.*
class
OrderDetailsActivity
:
BaseActivity
<
IPresenter
>()
{
class
OrderDetailsActivity
:
BaseActivity
<
IPresenter
>()
{
...
@@ -104,9 +107,8 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -104,9 +107,8 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
binding
=
DataBindingUtil
.
setContentView
(
this
,
R
.
layout
.
activity_order_details
)
binding
=
DataBindingUtil
.
setContentView
(
this
,
R
.
layout
.
activity_order_details
)
val
functionByResModule
=
FunctionManager
.
getDefault
().
getFunctionByResModule
(
this
,
FunctionManagerConstants
.
takeaway
::
class
.
java
,
FunctionManagerConstants
.
takeaway
.
orderDetails
,
"orderDetails/btn"
)
val
functionByResModule
=
FunctionManager
.
getDefault
().
getFunctionByResModule
(
this
,
Takeaway
.
ORDER_DETAILS_BTN_PERMISSION
,
Takeaway
.
TAKEAWAY_ORDER_DETAILS
)
btnBuilder
=
BtnBuilder
.
getInstance
(
functionByResModule
)
btnBuilder
=
BtnBuilder
.
getInstance
(
functionByResModule
)
val
rootView
=
findViewById
<
View
>(
R
.
id
.
scroll_order_info
)
val
rootView
=
findViewById
<
View
>(
R
.
id
.
scroll_order_info
)
thirdExpensesLayout
=
findViewById
(
R
.
id
.
layout_third_expenses
)
thirdExpensesLayout
=
findViewById
(
R
.
id
.
layout_third_expenses
)
rvThirdExpenses
=
findViewById
(
R
.
id
.
rv_third_expenses
)
rvThirdExpenses
=
findViewById
(
R
.
id
.
rv_third_expenses
)
...
@@ -129,6 +131,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -129,6 +131,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
//如果是未讀,調用設為已讀接口
//如果是未讀,調用設為已讀接口
updateIsRead
(
orderId
)
updateIsRead
(
orderId
)
}
}
mEnforceBtn
=
FunctionManager
.
getDefault
().
getFunctionByResModule
(
mContext
,
Takeaway
.
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
,
Takeaway
.
TAKEAWAY_ORDER_DETAILS_ENFORCE
)
//獲取訂單詳情
//獲取訂單詳情
getOrderDetails
(
orderId
,
binding
)
getOrderDetails
(
orderId
,
binding
)
}
}
...
@@ -157,9 +160,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -157,9 +160,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
ClipboardUtils
.
copyText
(
orderNo
)
ClipboardUtils
.
copyText
(
orderNo
)
showMessage
(
"複製成功"
)
showMessage
(
"複製成功"
)
}
}
qm_order_details_bar
.
addRightImageButton
(
R
.
drawable
.
ic_print
,
R
.
id
.
iv_prj_history
).
setOnClickListener
{
addTopBarMenuBtn
(
orderDetails
)
PrjQueryActivity
.
startPrjQueryActivity
(
this
@OrderDetailsActivity
,
orderNo
)
}
//總金額
//總金額
var
totalAmount
=
orderDetails
.
TOTAL_AMOUNT
!!
.
toDouble
()
var
totalAmount
=
orderDetails
.
TOTAL_AMOUNT
!!
.
toDouble
()
//合計:總金額減去餐盒費,配送費
//合計:總金額減去餐盒費,配送費
...
@@ -217,7 +218,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -217,7 +218,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
cancelLogistics
(
orderDetails
)
cancelLogistics
(
orderDetails
)
BtnBuilder
.
AssignDeliveryBtn
->
BtnBuilder
.
AssignDeliveryBtn
->
//指派送貨
//指派送貨
selectorDelivery
(
this
@OrderDetailsActivity
,
orderDetails
,
OrderDetails
.
appointDelivery
)
{
_
,
_
->
finish
()
}
assignDelivery
(
orderDetails
)
BtnBuilder
.
CancelBtn
->
BtnBuilder
.
CancelBtn
->
//取消訂單
//取消訂單
cancelOrder
(
orderDetails
)
cancelOrder
(
orderDetails
)
...
@@ -235,57 +236,10 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -235,57 +236,10 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
}
BtnBuilder
.
ClosingBtn
->
{
BtnBuilder
.
ClosingBtn
->
{
//只要不是貨到付款
//只要不是貨到付款
if
(
orderDetails
.
orderPayType
!=
OrderDetails
.
payOnDelivery
)
{
closingAccount
(
orderDetails
)
//如果是在線支付的訂單,就直接修改訂單狀態
gsUpdateOrderStatus
(
orderDetails
,
null
)
{
errorCode
,
isSuccess
->
when
{
isSuccess
->
{
finish
()
}
errorCode
==
PageViewModel
.
ErrorCode
->
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"出問題啦,請退出重試"
)
}
else
->
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"結賬失敗啦,請退出重試"
)
}
}
}
}
else
{
//跳轉到結賬頁面
if
(
OrderDetails
.
verificationAmount
(
orderDetails
))
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
verifiAmountTip
)
return
@setOnItemClickListener
}
val
intent
=
Intent
(
this
@OrderDetailsActivity
,
PayActivity
::
class
.
java
)
intent
.
putExtra
(
"orderDetails"
,
orderDetails
)
startActivityForResult
(
intent
,
1001
)
}
}
}
BtnBuilder
.
SureBtn
->
{
BtnBuilder
.
SureBtn
->
{
if
(
isBookingOrder
)
{
confirmOrder
(
orderDetails
)
//是預約單,其他都不做改變,只修改狀態為8
updateOrderAndPrint
(
restaurantId
,
orderDetails
,
8
,
false
,
listener
)
}
else
{
//確認訂單,判斷是本店還是zeek或是lalamove
if
(
orderDetails
.
orderType
==
OrderDetails
.
yourselfPickUp
)
{
//如果是自取單,將物流類型改為本店
orderDetails
.
companyType
=
OrderDetails
.
ourStoreDistribution
}
when
(
orderDetails
.
companyType
)
{
OrderDetails
.
ourStoreDistribution
,
OrderDetails
.
zeekDistribution
->
{
//本店配送和zeek
confirmOrder
(
orderDetails
)
}
OrderDetails
.
lalamoveDistribution
->
{
//lalamove
selectLalaMove
(
orderDetails
,
true
)
{
it
,
orderDetails
->
showIsUpdateTransportation
(
it
,
orderDetails
,
true
)
}
}
else
->
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"未知的物流類型"
)
}
}
}
}
BtnBuilder
.
PrintBtn
->
{
BtnBuilder
.
PrintBtn
->
{
//打印
//打印
...
@@ -293,18 +247,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -293,18 +247,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
}
BtnBuilder
.
ProductionCompletedBtn
->
{
BtnBuilder
.
ProductionCompletedBtn
->
{
//製作完成
//製作完成
updateOrderAndPrint
(
restaurantId
,
orderDetails
,
OrderDetails
.
appointDelivery
)
{
ProductionCompleted
(
orderDetails
)
if
(
it
.
success
)
{
finish
()
}
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
if
(
it
.
success
)
{
"製作完成"
}
else
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
it
.
errorMsg
))
{
it
.
errorMsg
}
else
{
"修改訂單狀態失敗"
})
}
}
}
BtnBuilder
.
AdditionalServiceChargeBtn
->
{
BtnBuilder
.
AdditionalServiceChargeBtn
->
{
//追加貼士
//追加貼士
...
@@ -312,7 +255,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -312,7 +255,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
}
else
->
{
else
->
{
showLoading
()
showLoading
()
confirmOrder
(
orderDetails
)
confirmOrder
DefaultParameters
(
orderDetails
)
}
}
}
}
}
}
...
@@ -346,6 +289,143 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -346,6 +289,143 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
})
})
}
}
private
fun
PageViewModel
.
ProductionCompleted
(
orderDetails
:
OrderDetails
.
DataBean
)
{
updateOrderAndPrint
(
restaurantId
,
orderDetails
,
OrderDetails
.
appointDelivery
)
{
if
(
it
.
success
)
{
finish
()
}
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
if
(
it
.
success
)
{
"製作完成"
}
else
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
it
.
errorMsg
))
{
it
.
errorMsg
}
else
{
"修改訂單狀態失敗"
})
}
}
private
fun
PageViewModel
.
closingAccount
(
orderDetails
:
OrderDetails
.
DataBean
)
{
if
(
orderDetails
.
orderPayType
!=
OrderDetails
.
payOnDelivery
)
{
//如果是在線支付的訂單,就直接修改訂單狀態
gsUpdateOrderStatus
(
orderDetails
,
null
)
{
errorCode
,
isSuccess
->
when
{
isSuccess
->
{
finish
()
}
errorCode
==
PageViewModel
.
ErrorCode
->
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"出問題啦,請退出重試"
)
}
else
->
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"結賬失敗啦,請退出重試"
)
}
}
}
}
else
{
//跳轉到結賬頁面
if
(
OrderDetails
.
verificationAmount
(
orderDetails
))
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
verifiAmountTip
)
return
}
val
intent
=
Intent
(
this
@OrderDetailsActivity
,
PayActivity
::
class
.
java
)
intent
.
putExtra
(
"orderDetails"
,
orderDetails
)
startActivityForResult
(
intent
,
1001
)
}
}
private
fun
assignDelivery
(
orderDetails
:
OrderDetails
.
DataBean
)
{
pageViewModel
.
selectorDelivery
(
this
@OrderDetailsActivity
,
orderDetails
,
OrderDetails
.
appointDelivery
)
{
_
,
_
->
finish
()
}
}
private
fun
confirmOrder
(
orderDetails
:
OrderDetails
.
DataBean
)
{
if
(
isBookingOrder
)
{
//是預約單,其他都不做改變,只修改狀態為8
pageViewModel
.
updateOrderAndPrint
(
restaurantId
,
orderDetails
,
8
,
false
,
listener
)
}
else
{
//確認訂單,判斷是本店還是zeek或是lalamove
if
(
orderDetails
.
orderType
==
OrderDetails
.
yourselfPickUp
)
{
//如果是自取單,將物流類型改為本店
orderDetails
.
companyType
=
OrderDetails
.
ourStoreDistribution
}
when
(
orderDetails
.
companyType
)
{
OrderDetails
.
ourStoreDistribution
,
OrderDetails
.
zeekDistribution
->
{
//本店配送和zeek
pageViewModel
.
confirmOrderDefaultParameters
(
orderDetails
)
}
OrderDetails
.
lalamoveDistribution
->
{
//lalamove
pageViewModel
.
selectLalaMove
(
orderDetails
,
true
)
{
it
,
orderDetails
->
pageViewModel
.
showIsUpdateTransportation
(
it
,
orderDetails
,
true
)
}
}
else
->
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"未知的物流類型"
)
}
}
}
private
fun
PageViewModel
.
confirmOrderDefaultParameters
(
orderDetails
:
OrderDetails
.
DataBean
,
trafficType
:
String
=
""
,
isPrint
:
Boolean
=
true
)
{
showLoading
()
confirmOrder
(
orderDetails
,
2
,
trafficType
,
restaurantId
,
if
(
isBookingOrder
)
false
else
isPrint
,
if
(
isBookingOrder
)
false
else
isPrint
,
listener
)
}
/**
* 添加頂部菜單按鈕
*/
private
fun
addTopBarMenuBtn
(
orderDetails
:
OrderDetails
.
DataBean
)
{
val
enforceBtn
=
arrayListOf
<
String
>()
for
(
function
in
pageViewModel
.
mEnforceBtn
)
{
enforceBtn
.
add
(
function
.
resName
)
}
enforceBtn
.
add
(
"打印查詢"
)
val
addRightImageButton
=
qm_order_details_bar
.
addRightImageButton
(
R
.
drawable
.
icon_topbar_overflow
,
R
.
id
.
topbar_right_change_button
);
addRightImageButton
.
setOnClickListener
{
XPopup
.
Builder
(
this
)
.
atView
(
addRightImageButton
)
.
hasShadowBg
(
false
)
.
asAttachList
(
enforceBtn
.
toTypedArray
(),
null
)
{
position
,
text
->
run
{
pageViewModel
.
apply
{
if
(
position
>=
pageViewModel
.
mEnforceBtn
.
size
)
{
PrjQueryActivity
.
startPrjQueryActivity
(
this
@OrderDetailsActivity
,
orderDetails
.
ORDER_NO
)
}
else
{
when
(
mEnforceBtn
[
position
].
resUrl
)
{
Takeaway
.
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
[
0
].
keyRes
->
{
//強制確認訂單
confirmOrder
(
orderDetails
)
}
Takeaway
.
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
[
1
].
keyRes
->
{
//強制製作完成
ProductionCompleted
(
orderDetails
)
}
Takeaway
.
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
[
2
].
keyRes
->
{
//強制取消訂單
cancelOrder
(
orderDetails
)
}
Takeaway
.
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
[
3
].
keyRes
->
{
//強制打印訂單
printOrder
(
PrintCode
,
orderDetails
)
{}
}
Takeaway
.
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
[
4
].
keyRes
->
{
//強制取消物流
cancelLogistics
(
orderDetails
)
}
Takeaway
.
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
[
5
].
keyRes
->
{
//強制指派送貨
assignDelivery
(
orderDetails
)
}
Takeaway
.
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
[
6
].
keyRes
->
{
//強制結賬
closingAccount
(
orderDetails
)
}
else
->
{
}
}
}
}
}
}.
show
()
}
}
/**
/**
* 初始化按鈕排列
* 初始化按鈕排列
*/
*/
...
@@ -472,21 +552,21 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -472,21 +552,21 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
* 製作中
* 製作中
*/
*/
private
fun
initMakingState
(
btnList
:
ArrayList
<
BtnBuilder
.
BtnBean
>,
orderDetails
:
OrderDetails
.
DataBean
):
String
{
private
fun
initMakingState
(
btnList
:
ArrayList
<
BtnBuilder
.
BtnBean
>,
orderDetails
:
OrderDetails
.
DataBean
):
String
{
btnBuilder
.
getSureBtn
()
?.
let
{
//
btnBuilder.getSureBtn()?.let {
btnList
.
add
(
it
)
//
btnList.add(it)
}
//
}
tv_order_state
.
setTextColor
(
getCustomColor
(
R
.
color
.
order_state0_color
))
//
tv_order_state.setTextColor(getCustomColor(R.color.order_state0_color))
if
(
orderDetails
.
isDelete
==
0
)
{
//
if (orderDetails.isDelete == 0) {
btnBuilder
.
getLogisticsBtn
()
?.
let
{
//
btnBuilder.getLogisticsBtn()?.let {
btnList
.
add
(
it
)
//
btnList.add(it)
}
//
}
//已超時,添加追加服務費的按鈕
//
//已超時,添加追加服務費的按鈕
if
(
isTimeOut
&&
orderDetails
.
companyType
==
2
)
{
//
if (isTimeOut && orderDetails.companyType == 2) {
btnBuilder
.
getAdditionalServiceChargeBtn
()
?.
let
{
//
btnBuilder.getAdditionalServiceChargeBtn()?.let {
btnList
.
add
(
it
)
//
btnList.add(it)
}
//
}
}
//
}
}
//
}
btnBuilder
.
getPrintBtn
()
?.
let
{
btnBuilder
.
getPrintBtn
()
?.
let
{
btnList
.
add
(
it
)
btnList
.
add
(
it
)
}
}
...
@@ -573,7 +653,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -573,7 +653,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
//默認交通工具,判斷價格是不是在這個金額範圍內,如果在,則不提示,如果不在,提示用戶修改交通工具
//默認交通工具,判斷價格是不是在這個金額範圍內,如果在,則不提示,如果不在,提示用戶修改交通工具
if
(
orderDetails
.
PAY_AMOUNT
>
value
.
amountUnder
&&
orderDetails
.
PAY_AMOUNT
<
value
.
amountOn
)
{
if
(
orderDetails
.
PAY_AMOUNT
>
value
.
amountUnder
&&
orderDetails
.
PAY_AMOUNT
<
value
.
amountOn
)
{
//價格在範圍內
//價格在範圍內
confirmOrder
(
orderDetails
,
value
.
type
.
toString
(),
isPrint
)
confirmOrder
DefaultParameters
(
orderDetails
,
value
.
type
.
toString
(),
isPrint
)
return
@getIsUpdateTransportation
return
@getIsUpdateTransportation
}
else
{
}
else
{
//價格不在默認交通工具範圍內,回到activity中彈出彈窗,讓用戶選擇交通工具
//價格不在默認交通工具範圍內,回到activity中彈出彈窗,讓用戶選擇交通工具
...
@@ -595,7 +675,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -595,7 +675,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
//不修改運輸工具,使用默認的
//不修改運輸工具,使用默認的
for
(
value
in
it
)
{
for
(
value
in
it
)
{
if
(
value
.
status
==
1
)
{
if
(
value
.
status
==
1
)
{
confirmOrder
(
orderDetails
,
value
.
type
.
toString
(),
isPrint
)
confirmOrder
DefaultParameters
(
orderDetails
,
value
.
type
.
toString
(),
isPrint
)
break
break
}
}
}
}
...
@@ -628,7 +708,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -628,7 +708,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
if
(
adapter
.
selectIndex
==
-
1
)
{
if
(
adapter
.
selectIndex
==
-
1
)
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"請選擇交通工具"
)
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"請選擇交通工具"
)
}
else
{
}
else
{
confirmOrder
(
orderDetails
,
transportationBeans
[
adapter
.
selectIndex
].
type
.
toString
(),
isPrint
)
confirmOrder
DefaultParameters
(
orderDetails
,
transportationBeans
[
adapter
.
selectIndex
].
type
.
toString
(),
isPrint
)
}
}
},
{
dialog
->
},
{
dialog
->
dialog
.
dismiss
()
dialog
.
dismiss
()
...
@@ -686,10 +766,13 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
...
@@ -686,10 +766,13 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
}
set
(
value
)
{}
set
(
value
)
{}
private
fun
PageViewModel
.
confirmOrder
(
orderDetails
:
OrderDetails
.
DataBean
,
trafficType
:
String
=
""
,
isPrint
:
Boolean
=
true
)
{
/**
* 確認訂單
*/
private
fun
confirmOrder
(
orderDetails
:
OrderDetails
.
DataBean
,
trafficType
:
String
=
""
,
isPrint
:
Boolean
=
true
)
{
showLoading
()
showLoading
()
val
status
=
2
val
status
=
2
confirmOrder
(
orderDetails
,
status
,
trafficType
,
restaurantId
,
if
(
isBookingOrder
)
false
else
isPrint
,
if
(
isBookingOrder
)
false
else
isPrint
,
listener
)
pageViewModel
.
confirmOrder
(
orderDetails
,
status
,
trafficType
,
restaurantId
,
if
(
isBookingOrder
)
false
else
isPrint
,
if
(
isBookingOrder
)
false
else
isPrint
,
listener
)
}
}
/**
/**
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/adapter/OrderBtnAdapter.kt
View file @
13ff529e
...
@@ -6,7 +6,7 @@ import android.widget.ImageView
...
@@ -6,7 +6,7 @@ import android.widget.ImageView
import
android.widget.LinearLayout
import
android.widget.LinearLayout
import
android.widget.TextView
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.gingersoft.gsa.cloud.
common.
ui.utils.BtnBuilder
import
com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
import
com.gingersoft.gsa.delivery_pick_mode.R
import
com.gingersoft.gsa.delivery_pick_mode.R
class
OrderBtnAdapter
(
var
list
:
MutableList
<
BtnBuilder
.
BtnBean
>)
:
RecyclerView
.
Adapter
<
OrderBtnAdapter
.
ViewHolder
>()
{
class
OrderBtnAdapter
(
var
list
:
MutableList
<
BtnBuilder
.
BtnBean
>)
:
RecyclerView
.
Adapter
<
OrderBtnAdapter
.
ViewHolder
>()
{
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/adapter/OrderDetailsAdapter.kt
View file @
13ff529e
...
@@ -2,7 +2,7 @@ package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
...
@@ -2,7 +2,7 @@ package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.gingersoft.gsa.cloud.
common.
ui.utils.BtnBuilder
import
com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
import
com.gingersoft.gsa.delivery_pick_mode.R
import
com.gingersoft.gsa.delivery_pick_mode.R
class
OrderDetailsAdapter
(
list
:
MutableList
<
BtnBuilder
.
BtnBean
>)
:
BaseQuickAdapter
<
BtnBuilder
.
BtnBean
,
BaseViewHolder
>(
R
.
layout
.
item_btn
,
list
)
{
class
OrderDetailsAdapter
(
list
:
MutableList
<
BtnBuilder
.
BtnBean
>)
:
BaseQuickAdapter
<
BtnBuilder
.
BtnBean
,
BaseViewHolder
>(
R
.
layout
.
item_btn
,
list
)
{
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/service/MainService.java
View file @
13ff529e
...
@@ -22,7 +22,7 @@ import retrofit2.http.Query;
...
@@ -22,7 +22,7 @@ import retrofit2.http.Query;
public
interface
MainService
{
public
interface
MainService
{
@Headers
({
"Domain-Name: update_version"
})
@Headers
({
"Domain-Name: update_version"
})
@GET
(
"system/checkAppVersion
Gsa
"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
"system/checkAppVersion"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
CheckVersionRequest
>
checkAppVersion
(
@Query
(
"version"
)
String
version
);
Observable
<
CheckVersionRequest
>
checkAppVersion
(
@Query
(
"version"
)
String
version
);
@FormUrlEncoded
@FormUrlEncoded
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/HomePresenter.java
View file @
13ff529e
...
@@ -162,43 +162,39 @@ public class HomePresenter extends BasePresenter<HomeContract.Model, HomeContrac
...
@@ -162,43 +162,39 @@ public class HomePresenter extends BasePresenter<HomeContract.Model, HomeContrac
}
}
public
void
checkAppVersion
()
{
public
void
checkAppVersion
()
{
// RequestBody requestBody = new FormBody.Builder()
mModel
.
checkAppVersion
(
DeviceUtils
.
getVersionName
(
mApplication
)
+
"|"
+
DeviceUtils
.
getVersionCode
(
mApplication
))
// .add("version", )
.
subscribeOn
(
Schedulers
.
io
())
// .add("type", "2")
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
// .build();
.
observeOn
(
AndroidSchedulers
.
mainThread
())
// mModel.checkAppVersion(DeviceUtils.getVersionName(mApplication) + "|" + DeviceUtils.getVersionCode(mApplication))
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
// .subscribeOn(Schedulers.io())
.
subscribe
(
new
ErrorHandleSubscriber
<
CheckVersionRequest
>(
mErrorHandler
)
{
// .subscribeOn(AndroidSchedulers.mainThread())
// .observeOn(AndroidSchedulers.mainThread())
@Override
// .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
public
void
onNext
(
@NonNull
CheckVersionRequest
info
)
{
// .subscribe(new ErrorHandleSubscriber<CheckVersionRequest>(mErrorHandler) {
if
(
info
!=
null
)
{
//
/**
// @Override
* 操作类型:
// public void onNext(@NonNull CheckVersionRequest info) {
* 1、不提示更新
// if (info != null) {
* 2、提示更新可选择更新
// /**
* 3、强行更新
// * 操作类型:
* 4、跳转goole play下载app 没安装goole play就用webview打开goole网页下载
// * 1、不提示更新
* 5、跳转goole play下载app 没安装goole play就用浏览器打开goole网页下载
// * 2、提示更新可选择更新
*/
// * 3、强行更新
int
operate
=
info
.
getOperate
();
// * 4、跳转goole play下载app 没安装goole play就用webview打开goole网页下载
if
(
operate
==
2
||
operate
==
3
||
operate
==
4
||
operate
==
5
)
{
// * 5、跳转goole play下载app 没安装goole play就用浏览器打开goole网页下载
String
updatePath
=
info
.
getUpdatePath
();
// */
if
(!
TextUtils
.
isEmpty
(
updatePath
)
&&
!
updatePath
.
equals
(
"null"
))
{
// int operate = info.getOperate();
updateAPK
(
operate
,
updatePath
);
// if (operate == 2 || operate == 3 || operate == 4 || operate == 5) {
}
else
{
// String updatePath = info.getUpdatePath();
if
(
operate
==
3
)
{
// if (!TextUtils.isEmpty(updatePath) && !updatePath.equals("null")) {
mAppManager
.
appExit
();
// updateAPK(operate, updatePath);
}
// } else {
}
// if (operate == 3) {
}
// mAppManager.appExit();
}
else
{
// }
}
// }
}
// }
});
// } else {
// }
// }
// });
}
}
public
void
loginOut
()
{
public
void
loginOut
()
{
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/NewMainPresenter.java
View file @
13ff529e
...
@@ -97,43 +97,39 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa
...
@@ -97,43 +97,39 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa
}
}
public
void
checkAppVersion
()
{
public
void
checkAppVersion
()
{
// RequestBody requestBody = new FormBody.Builder()
mModel
.
checkAppVersion
(
DeviceUtils
.
getVersionName
(
mApplication
)
+
"|"
+
DeviceUtils
.
getVersionCode
(
mApplication
))
// .add("version", )
.
subscribeOn
(
Schedulers
.
io
())
// .add("type", "2")
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
// .build();
.
observeOn
(
AndroidSchedulers
.
mainThread
())
// mModel.checkAppVersion(DeviceUtils.getVersionName(mApplication) + "|" + DeviceUtils.getVersionCode(mApplication))
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
// .subscribeOn(Schedulers.io())
.
subscribe
(
new
ErrorHandleSubscriber
<
CheckVersionRequest
>(
mErrorHandler
)
{
// .subscribeOn(AndroidSchedulers.mainThread())
// .observeOn(AndroidSchedulers.mainThread())
@Override
// .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
public
void
onNext
(
@NonNull
CheckVersionRequest
info
)
{
// .subscribe(new ErrorHandleSubscriber<CheckVersionRequest>(mErrorHandler) {
if
(
info
!=
null
)
{
//
/**
// @Override
* 操作类型:
// public void onNext(@NonNull CheckVersionRequest info) {
* 1、不提示更新
// if (info != null) {
* 2、提示更新可选择更新
// /**
* 3、强行更新
// * 操作类型:
* 4、跳转goole play下载app 没安装goole play就用webview打开goole网页下载
// * 1、不提示更新
* 5、跳转goole play下载app 没安装goole play就用浏览器打开goole网页下载
// * 2、提示更新可选择更新
*/
// * 3、强行更新
int
operate
=
info
.
getOperate
();
// * 4、跳转goole play下载app 没安装goole play就用webview打开goole网页下载
if
(
operate
==
2
||
operate
==
3
||
operate
==
4
||
operate
==
5
)
{
// * 5、跳转goole play下载app 没安装goole play就用浏览器打开goole网页下载
String
updatePath
=
info
.
getUpdatePath
();
// */
if
(!
TextUtils
.
isEmpty
(
updatePath
)
&&
!
updatePath
.
equals
(
"null"
))
{
// int operate = info.getOperate();
updateAPK
(
operate
,
updatePath
);
// if (operate == 2 || operate == 3 || operate == 4 || operate == 5) {
}
else
{
// String updatePath = info.getUpdatePath();
if
(
operate
==
3
)
{
// if (!TextUtils.isEmpty(updatePath) && !updatePath.equals("null")) {
mAppManager
.
appExit
();
// updateAPK(operate, updatePath);
}
// } else {
}
// if (operate == 3) {
}
// mAppManager.appExit();
}
else
{
// }
}
// }
}
// }
});
// } else {
// }
// }
// });
}
}
public
void
loginOut
()
{
public
void
loginOut
()
{
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
View file @
13ff529e
...
@@ -505,7 +505,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
...
@@ -505,7 +505,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
private
String
endTime
;
private
String
endTime
;
private
void
getInfo
()
{
private
void
getInfo
()
{
startTime
=
TimeUtils
.
getDatebyDate
(
mTvStartTime
.
getText
().
toString
(),
-
1
);
startTime
=
TimeUtils
.
getDatebyDate
(
mTvStartTime
.
getText
().
toString
(),
0
);
endTime
=
TimeUtils
.
getDatebyDate
(
mTvEndTime
.
getText
().
toString
(),
1
);
endTime
=
TimeUtils
.
getDatebyDate
(
mTvEndTime
.
getText
().
toString
(),
1
);
mPresenter
.
getRestaurantAmount
(
restaurantId
,
startTime
,
endTime
);
mPresenter
.
getRestaurantAmount
(
restaurantId
,
startTime
,
endTime
);
mPresenter
.
getRestaurantBusinessInfo
(
restaurantId
,
startTime
,
endTime
);
mPresenter
.
getRestaurantBusinessInfo
(
restaurantId
,
startTime
,
endTime
);
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/PaymentMethodReportFragment.java
View file @
13ff529e
...
@@ -136,7 +136,7 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
...
@@ -136,7 +136,7 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
}
}
private
void
getPayMenthInfo
()
{
private
void
getPayMenthInfo
()
{
String
startTime
=
TimeUtils
.
getDatebyDate
(
mTvStartTime
.
getText
().
toString
(),
-
1
);
String
startTime
=
TimeUtils
.
getDatebyDate
(
mTvStartTime
.
getText
().
toString
(),
0
);
String
endTime
=
TimeUtils
.
getDatebyDate
(
mTvEndTime
.
getText
().
toString
(),
1
);
String
endTime
=
TimeUtils
.
getDatebyDate
(
mTvEndTime
.
getText
().
toString
(),
1
);
mPresenter
.
getPaymentInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
mPresenter
.
getPaymentInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
}
}
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/SalesFragment.java
View file @
13ff529e
...
@@ -527,13 +527,13 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -527,13 +527,13 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
}
}
private
void
getSaleReport
()
{
private
void
getSaleReport
()
{
String
startTime
=
TimeUtils
.
getDatebyDate
(
mTvStartTime
.
getText
().
toString
(),
-
1
);
String
startTime
=
TimeUtils
.
getDatebyDate
(
mTvStartTime
.
getText
().
toString
(),
0
);
String
endTime
=
TimeUtils
.
getDatebyDate
(
mTvEndTime
.
getText
().
toString
(),
1
);
String
endTime
=
TimeUtils
.
getDatebyDate
(
mTvEndTime
.
getText
().
toString
(),
1
);
mPresenter
.
getSalesReportInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
mPresenter
.
getSalesReportInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
}
}
private
void
getDeliveryReport
(){
private
void
getDeliveryReport
(){
String
startTime
=
TimeUtils
.
getDatebyDate
(
startEndTimePickerView
.
getStartTime
(),
-
1
);
String
startTime
=
TimeUtils
.
getDatebyDate
(
startEndTimePickerView
.
getStartTime
(),
0
);
String
endTime
=
TimeUtils
.
getDatebyDate
(
startEndTimePickerView
.
getEndTime
(),
1
);
String
endTime
=
TimeUtils
.
getDatebyDate
(
startEndTimePickerView
.
getEndTime
(),
1
);
mPresenter
.
getDeliveryOrderCurveInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
mPresenter
.
getDeliveryOrderCurveInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
mPresenter
.
getDeliveryPersonnelReport
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
mPresenter
.
getDeliveryPersonnelReport
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
...
...
component-supply-chain/build.gradle
View file @
13ff529e
apply
from:
rootProject
.
file
(
'cc-settings.gradle'
)
apply
from:
rootProject
.
file
(
'cc-settings.gradle'
)
apply
plugin:
'com.jakewharton.butterknife'
apply
plugin:
'com.jakewharton.butterknife'
apply
plugin:
'android-aspectjx'
apply
plugin:
'android-aspectjx'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
android
{
android
{
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/di/component/WarehousingOrderListComponent.java
0 → 100644
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
di
.
component
;
import
dagger.BindsInstance
;
import
dagger.Component
;
import
com.jess.arms.di.component.AppComponent
;
import
com.gingersoft.supply_chain.di.module.WarehousingOrderListModule
;
import
com.gingersoft.supply_chain.mvp.contract.WarehousingOrderListContract
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WarehousingOrderListFragment
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 04/28/2021 19:21
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component
(
modules
=
WarehousingOrderListModule
.
class
,
dependencies
=
AppComponent
.
class
)
public
interface
WarehousingOrderListComponent
{
void
inject
(
WarehousingOrderListFragment
fragment
);
@Component
.
Builder
interface
Builder
{
@BindsInstance
WarehousingOrderListComponent
.
Builder
view
(
WarehousingOrderListContract
.
View
view
);
WarehousingOrderListComponent
.
Builder
appComponent
(
AppComponent
appComponent
);
WarehousingOrderListComponent
build
();
}
}
\ No newline at end of file
component-supply-chain/src/main/java/com/gingersoft/supply_chain/di/module/WarehousingOrderListModule.java
0 → 100644
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
di
.
module
;
import
com.jess.arms.di.scope.FragmentScope
;
import
dagger.Binds
;
import
dagger.Module
;
import
dagger.Provides
;
import
com.gingersoft.supply_chain.mvp.contract.WarehousingOrderListContract
;
import
com.gingersoft.supply_chain.mvp.model.WarehousingOrderListModel
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 04/28/2021 19:21
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public
abstract
class
WarehousingOrderListModule
{
@Binds
abstract
WarehousingOrderListContract
.
Model
bindWarehousingOrderListModel
(
WarehousingOrderListModel
model
);
}
\ No newline at end of file
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/ConsumeWareHousingBean.java
View file @
13ff529e
...
@@ -27,4 +27,6 @@ public class ConsumeWareHousingBean {
...
@@ -27,4 +27,6 @@ public class ConsumeWareHousingBean {
*/
*/
private
String
purchaseConsumeNoId
;
private
String
purchaseConsumeNoId
;
private
String
remarks
;
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseFoodBean.java
View file @
13ff529e
...
@@ -193,7 +193,6 @@ public class PurchaseFoodBean implements Serializable, QMUISection.Model<Purchas
...
@@ -193,7 +193,6 @@ public class PurchaseFoodBean implements Serializable, QMUISection.Model<Purchas
minimumInventory
==
that
.
minimumInventory
&&
minimumInventory
==
that
.
minimumInventory
&&
shelfLife
==
that
.
shelfLife
&&
shelfLife
==
that
.
shelfLife
&&
warningDays
==
that
.
warningDays
&&
warningDays
==
that
.
warningDays
&&
foodMarkSn
==
that
.
foodMarkSn
&&
Objects
.
equals
(
supplierName
,
that
.
supplierName
)
&&
Objects
.
equals
(
supplierName
,
that
.
supplierName
)
&&
Objects
.
equals
(
images
,
that
.
images
)
&&
Objects
.
equals
(
images
,
that
.
images
)
&&
Objects
.
equals
(
foodNo
,
that
.
foodNo
)
&&
Objects
.
equals
(
foodNo
,
that
.
foodNo
)
&&
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WareHouseListBean.java
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
import
lombok.Data
;
import
lombok.Data
;
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WarehouseDetailsBean.java
View file @
13ff529e
...
@@ -56,6 +56,8 @@ public class WarehouseDetailsBean implements Serializable {
...
@@ -56,6 +56,8 @@ public class WarehouseDetailsBean implements Serializable {
* 消耗狀態,1從未被消耗,2消耗了一部分,3完全消耗
* 消耗狀態,1從未被消耗,2消耗了一部分,3完全消耗
*/
*/
private
int
consumeStatus
;
private
int
consumeStatus
;
private
String
remarks
;
/**
/**
* 入庫詳情ids,逗號分隔
* 入庫詳情ids,逗號分隔
*/
*/
...
@@ -94,6 +96,7 @@ public class WarehouseDetailsBean implements Serializable {
...
@@ -94,6 +96,7 @@ public class WarehouseDetailsBean implements Serializable {
warehousingBean
.
supplierName
=
consumeWareHousingBean
.
getSupplierName
();
warehousingBean
.
supplierName
=
consumeWareHousingBean
.
getSupplierName
();
warehousingBean
.
purchaseConsumeNoId
=
consumeWareHousingBean
.
getPurchaseConsumeNoId
();
warehousingBean
.
purchaseConsumeNoId
=
consumeWareHousingBean
.
getPurchaseConsumeNoId
();
warehousingBean
.
warehousingOrderDetailsIds
=
consumeWareHousingBean
.
getWarehousingOrderDetailsIds
();
warehousingBean
.
warehousingOrderDetailsIds
=
consumeWareHousingBean
.
getWarehousingOrderDetailsIds
();
warehousingBean
.
remarks
=
consumeWareHousingBean
.
getRemarks
();
return
warehousingBean
;
return
warehousingBean
;
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WarehouseOrderBean.java
0 → 100644
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
/**
* @author 宇航. 1239658231@qq.com
* User: admin
* Date: 2021/4/28
* Time: 14:36
* Use:
*/
public
class
WarehouseOrderBean
{
public
String
orderNo
;
public
String
warehousingMember
;
public
String
warehousingTime
;
public
String
warehousingFoodName
;
public
int
warehousingSpecies
;
public
String
warehousingReason
;
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/content/SupplyShoppingCart.java
View file @
13ff529e
...
@@ -12,6 +12,7 @@ import java.util.HashMap;
...
@@ -12,6 +12,7 @@ import java.util.HashMap;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* @author 宇航.
* @author 宇航.
...
@@ -21,16 +22,17 @@ import java.util.Map;
...
@@ -21,16 +22,17 @@ import java.util.Map;
* Use: 供應鏈購物車,需要緩存用戶選中的食品
* Use: 供應鏈購物車,需要緩存用戶選中的食品
*/
*/
public
class
SupplyShoppingCart
{
public
class
SupplyShoppingCart
{
/**
* key為食品id
* value為食品信息
*/
private
static
List
<
PurchaseFoodBean
>
cartFoods
;
/**
/**
* 供應商信息map
* 供應商信息map
* 有時候PurchaseFoodBean中的供應商信息不可靠,比如:用戶將食品添加到購物車中,然後又去供應商列表修改供應商信息,這時候需要更新供應商信息
* 有時候PurchaseFoodBean中的供應商信息不可靠,比如:用戶將食品添加到購物車中,然後又去供應商列表修改供應商信息,這時候需要更新供應商信息
*/
*/
private
static
Map
<
Integer
,
SupplierInfoBean
>
supplierInfoBeanMap
;
private
static
Map
<
Integer
,
SupplierInfoBean
>
supplierInfoBeanMap
;
/**
* key為食品id
* value為食品信息
*/
private
static
Map
<
Integer
,
PurchaseFoodBean
>
foodBeanMap
;
private
static
SupplyShoppingCart
shoppingCart
;
private
static
SupplyShoppingCart
shoppingCart
;
...
@@ -42,10 +44,14 @@ public class SupplyShoppingCart {
...
@@ -42,10 +44,14 @@ public class SupplyShoppingCart {
}
}
public
List
<
PurchaseFoodBean
>
getCartFoods
()
{
public
List
<
PurchaseFoodBean
>
getCartFoods
()
{
if
(
cartFoods
==
null
)
{
return
new
ArrayList
<>(
getFoodBeanMap
().
values
());
cartFoods
=
new
ArrayList
<>();
}
public
Map
<
Integer
,
PurchaseFoodBean
>
getFoodBeanMap
()
{
if
(
foodBeanMap
==
null
)
{
foodBeanMap
=
new
HashMap
<>();
}
}
return
cartFoods
;
return
foodBeanMap
;
}
}
public
Map
<
Integer
,
SupplierInfoBean
>
getSupplierInfoBeanMap
()
{
public
Map
<
Integer
,
SupplierInfoBean
>
getSupplierInfoBeanMap
()
{
...
@@ -72,49 +78,48 @@ public class SupplyShoppingCart {
...
@@ -72,49 +78,48 @@ public class SupplyShoppingCart {
/**
/**
* 添加食品時記錄供應商信息,對供應商進行修改時,需要修改食材的供應商信息
* 添加食品時記錄供應商信息,對供應商進行修改時,需要修改食材的供應商信息
*
*
* @param purchaseFoodBean
* @param purchaseFoodBean
食品
*/
*/
public
void
addFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
public
void
addFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
addFood
(
getCartFoods
().
size
(),
purchaseFoodBean
);
getFoodBeanMap
().
put
(
purchaseFoodBean
.
getId
(),
purchaseFoodBean
);
}
public
void
addFood
(
int
index
,
PurchaseFoodBean
purchaseFoodBean
)
{
getCartFoods
().
add
(
index
,
purchaseFoodBean
);
if
(
getSupplierInfoBeanMap
().
get
(
purchaseFoodBean
.
getSupplierId
())
==
null
)
{
if
(
getSupplierInfoBeanMap
().
get
(
purchaseFoodBean
.
getSupplierId
())
==
null
)
{
getSupplierInfoBeanMap
().
put
(
purchaseFoodBean
.
getSupplierId
(),
SupplierInfoBean
.
generateSupplierByFood
(
purchaseFoodBean
));
getSupplierInfoBeanMap
().
put
(
purchaseFoodBean
.
getSupplierId
(),
SupplierInfoBean
.
generateSupplierByFood
(
purchaseFoodBean
));
}
}
}
}
/**
* 替換食品信息
*
* @param purchaseFoodBean 食品信息
*/
public
void
replaceFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
public
void
replaceFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
RxJavaUtils
.
doInIOThread
(
new
RxIOTask
<
Object
>(
1
)
{
//從食品緩衝中拿到這個食品
@Override
PurchaseFoodBean
mapFood
=
getFoodBeanMap
().
get
(
purchaseFoodBean
.
getId
());
public
Void
doInIOThread
(
Object
o
)
{
//食品不為空並且這個食品的供應商還存在
for
(
int
i
=
0
;
i
<
getCartFoods
().
size
();
i
++)
{
if
(
mapFood
!=
null
&&
getSupplierInfoBeanMap
().
get
(
purchaseFoodBean
.
getSupplierId
())
!=
null
)
{
PurchaseFoodBean
cartFood
=
getCartFoods
().
get
(
i
);
//將要替換的食品數量同步為當前緩存中的數量
//找到這個食品
purchaseFoodBean
.
setFoodQuantity
(
mapFood
.
getFoodQuantity
());
if
(
purchaseFoodBean
.
getId
().
equals
(
cartFood
.
getId
()))
{
//用新的食材數據替換掉舊的,避免有可能修改了其他信息
int
foodNum
=
cartFood
.
getFoodQuantity
();
getFoodBeanMap
().
put
(
purchaseFoodBean
.
getId
(),
purchaseFoodBean
);
purchaseFoodBean
.
setFoodQuantity
(
foodNum
);
}
if
(
getSupplierInfoBeanMap
().
get
(
purchaseFoodBean
.
getSupplierId
())
!=
null
)
{
}
//可能用戶修改了食品的供應商信息,但是這裡是沒有供應商的詳細,直接移除食品
getCartFoods
().
add
(
i
,
purchaseFoodBean
);
public
void
removeFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
}
getFoodBeanMap
().
remove
(
purchaseFoodBean
.
getId
());
cartFoods
.
remove
(
cartFood
);
break
;
}
}
return
null
;
}
});
}
}
public
void
clear
()
{
public
void
clear
()
{
if
(
cartFoods
==
null
)
{
getFoodBeanMap
().
clear
();
return
;
}
cartFoods
.
clear
();
}
}
public
PurchaseFoodBean
getFoodByFoodId
(
int
foodId
)
{
for
(
PurchaseFoodBean
cartFood
:
getCartFoods
())
{
if
(
cartFood
.
getId
()
==
foodId
)
{
return
cartFood
;
}
}
return
null
;
}
public
void
removeFoodsByFoodId
(
int
foodId
)
{
public
void
removeFoodsByFoodId
(
int
foodId
)
{
RxJavaUtils
.
doInIOThread
(
new
RxIOTask
<
Object
>(
0
)
{
RxJavaUtils
.
doInIOThread
(
new
RxIOTask
<
Object
>(
0
)
{
...
@@ -208,9 +213,9 @@ public class SupplyShoppingCart {
...
@@ -208,9 +213,9 @@ public class SupplyShoppingCart {
public
void
removeFoodsByCategoryTress
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
thirdCategory
)
{
public
void
removeFoodsByCategoryTress
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
thirdCategory
)
{
if
(
thirdCategory
!=
null
)
{
if
(
thirdCategory
!=
null
)
{
for
(
OrderCategoryBean
.
FoodCategoryTrees
trees
:
thirdCategory
)
{
for
(
OrderCategoryBean
.
FoodCategoryTrees
trees
:
thirdCategory
)
{
for
(
PurchaseFoodBean
cartFood
:
cartFoods
)
{
for
(
PurchaseFoodBean
cartFood
:
getCartFoods
()
)
{
if
(
cartFood
.
getFoodCategoryId
()
==
trees
.
getId
())
{
if
(
cartFood
.
getFoodCategoryId
()
==
trees
.
getId
())
{
cartFoods
.
remove
(
cartFood
);
getFoodBeanMap
().
remove
(
cartFood
.
getId
()
);
}
}
}
}
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/WarehousingOrderListContract.java
0 → 100644
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
mvp
.
contract
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 04/28/2021 19:21
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public
interface
WarehousingOrderListContract
{
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/model/WarehousingOrderListModel.java
0 → 100644
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
mvp
.
model
;
import
android.app.Application
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
com.jess.arms.di.scope.FragmentScope
;
import
javax.inject.Inject
;
import
com.gingersoft.supply_chain.mvp.contract.WarehousingOrderListContract
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 04/28/2021 19:21
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
public
class
WarehousingOrderListModel
extends
BaseModel
implements
WarehousingOrderListContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
@Inject
public
WarehousingOrderListModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
}
\ No newline at end of file
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/BuyIngredientsPresenter.java
View file @
13ff529e
...
@@ -31,9 +31,11 @@ import com.gingersoft.supply_chain.mvp.contract.BuyIngredientsContract;
...
@@ -31,9 +31,11 @@ import com.gingersoft.supply_chain.mvp.contract.BuyIngredientsContract;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -58,12 +60,11 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -58,12 +60,11 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
* 供應商信息轉為分類之後的緩存,之後加載就讀取這裡面的
* 供應商信息轉為分類之後的緩存,之後加載就讀取這裡面的
*/
*/
private
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
supplierTranCategoryCache
;
private
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
supplierTranCategoryCache
;
// /**
// * 用戶選購的食材列表
// */
// private Map<Integer, PurchaseFoodBean> purchaseFoodBeanMap = new HashMap<>();
/**
* 用戶選購的食材列表
*/
private
Map
<
Integer
,
PurchaseFoodBean
>
purchaseFoodBeanMap
=
new
HashMap
<>();
/**
/**
* 分類商品緩存,用於根據一級分類下標獲取下面的分類和食材
* 分類商品緩存,用於根據一級分類下標獲取下面的分類和食材
*/
*/
...
@@ -92,20 +93,33 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -92,20 +93,33 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
}
}
/**
/**
*
將購物車中的商品添加到緩存中
*
統計食品數量
*/
*/
public
int
tranShoppingCartToCache
()
{
public
int
statisticsFoodQuantity
()
{
purchaseFoodBeanMap
.
clear
();
List
<
PurchaseFoodBean
>
cartFoods
=
SupplyShoppingCart
.
getInstance
().
getCartFoods
();
List
<
PurchaseFoodBean
>
cartFoods
=
SupplyShoppingCart
.
getInstance
().
getCartFoods
();
int
foodSize
=
0
;
int
foodSize
=
0
;
for
(
PurchaseFoodBean
cartFood
:
cartFoods
)
{
for
(
PurchaseFoodBean
cartFood
:
cartFoods
)
{
foodSize
+=
cartFood
.
getFoodQuantity
();
foodSize
+=
cartFood
.
getFoodQuantity
();
purchaseFoodBeanMap
.
put
(
cartFood
.
getId
(),
cartFood
);
}
}
return
foodSize
;
return
foodSize
;
}
}
/**
/**
* 跟據供應商id統計食品數量
*/
public
int
statisticsFoodQuantityBySupplierId
(
int
supplierId
)
{
List
<
PurchaseFoodBean
>
cartFoods
=
SupplyShoppingCart
.
getInstance
().
getCartFoods
();
int
foodSize
=
0
;
for
(
PurchaseFoodBean
cartFood
:
cartFoods
)
{
if
(
cartFood
.
getSupplierId
()
==
supplierId
)
{
foodSize
+=
cartFood
.
getFoodQuantity
();
}
}
return
foodSize
;
}
/**
* 獲取分類的結構:所有分類和分類的子分類都有
* 獲取分類的結構:所有分類和分類的子分類都有
*/
*/
public
void
getCategoryTrees
()
{
public
void
getCategoryTrees
()
{
...
@@ -225,7 +239,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -225,7 +239,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
int
categoryFoodSize
=
0
;
int
categoryFoodSize
=
0
;
for
(
PurchaseFoodBean
foodBean
:
foodBeans
)
{
for
(
PurchaseFoodBean
foodBean
:
foodBeans
)
{
//將食品按分類隔開
//將食品按分類隔開
PurchaseFoodBean
cachePurchaseFoodBean
=
purchaseFoodBeanMap
.
get
(
foodBean
.
getId
());
PurchaseFoodBean
cachePurchaseFoodBean
=
SupplyShoppingCart
.
getInstance
().
getFoodByFoodId
(
foodBean
.
getId
());
if
(
cachePurchaseFoodBean
!=
null
)
{
if
(
cachePurchaseFoodBean
!=
null
)
{
foodBean
.
setFoodQuantity
(
cachePurchaseFoodBean
.
getFoodQuantity
());
foodBean
.
setFoodQuantity
(
cachePurchaseFoodBean
.
getFoodQuantity
());
categoryFoodSize
++;
categoryFoodSize
++;
...
@@ -263,16 +277,15 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -263,16 +277,15 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
for
(
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTree
:
foodCategoryTrees
)
{
for
(
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTree
:
foodCategoryTrees
)
{
foodCategoryTree
.
setSize
(
0
);
foodCategoryTree
.
setSize
(
0
);
}
}
for
(
Map
.
Entry
<
Integer
,
PurchaseFoodBean
>
integerPurchaseFoodBeanEntry
:
purchaseFoodBeanMap
.
entrySet
())
{
for
(
PurchaseFoodBean
cartFood
:
SupplyShoppingCart
.
getInstance
().
getCartFoods
())
{
PurchaseFoodBean
value
=
integerPurchaseFoodBeanEntry
.
getValue
();
int
size
=
foodCategoryTrees
.
size
();
int
size
=
foodCategoryTrees
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
OrderCategoryBean
.
FoodCategoryTrees
categoryTrees
=
foodCategoryTrees
.
get
(
i
);
OrderCategoryBean
.
FoodCategoryTrees
categoryTrees
=
foodCategoryTrees
.
get
(
i
);
if
(
value
.
getFoodCategoryId
()
==
categoryTrees
.
getId
())
{
if
(
cartFood
.
getFoodCategoryId
()
==
categoryTrees
.
getId
())
{
categoryTrees
.
setSize
(
categoryTrees
.
getSize
()
+
1
);
categoryTrees
.
setSize
(
categoryTrees
.
getSize
()
+
1
);
break
;
break
;
}
else
{
}
else
{
initCategorySize
(
categoryTrees
,
categoryTrees
.
getFoodCategoryTrees
(),
value
);
initCategorySize
(
categoryTrees
,
categoryTrees
.
getFoodCategoryTrees
(),
cartFood
);
}
}
}
}
}
}
...
@@ -357,7 +370,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -357,7 +370,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
//第一次需要初始化每個供應商下已採購的食品數量
//第一次需要初始化每個供應商下已採購的食品數量
initSupplierGoodsSize
(
supplierTranCategoryCache
);
initSupplierGoodsSize
(
supplierTranCategoryCache
);
mRootView
.
initCategoryInfo
(
supplierTranCategoryCache
);
mRootView
.
initCategoryInfo
(
supplierTranCategoryCache
);
mRootView
.
loadFood
(
showFoods
,
false
,
true
);
loadFood
(
showFoods
.
get
(
0
)
,
false
,
true
);
}
}
}
}
}
}
...
@@ -374,12 +387,11 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -374,12 +387,11 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
for
(
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTree
:
foodCategoryTrees
)
{
for
(
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTree
:
foodCategoryTrees
)
{
foodCategoryTree
.
setSize
(
0
);
foodCategoryTree
.
setSize
(
0
);
}
}
for
(
Map
.
Entry
<
Integer
,
PurchaseFoodBean
>
integerPurchaseFoodBeanEntry
:
purchaseFoodBeanMap
.
entrySet
())
{
for
(
PurchaseFoodBean
cartFood
:
SupplyShoppingCart
.
getInstance
().
getCartFoods
())
{
PurchaseFoodBean
value
=
integerPurchaseFoodBeanEntry
.
getValue
();
int
size
=
foodCategoryTrees
.
size
();
int
size
=
foodCategoryTrees
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
OrderCategoryBean
.
FoodCategoryTrees
categoryTrees
=
foodCategoryTrees
.
get
(
i
);
OrderCategoryBean
.
FoodCategoryTrees
categoryTrees
=
foodCategoryTrees
.
get
(
i
);
if
(
value
.
getSupplierId
()
==
categoryTrees
.
getId
())
{
if
(
cartFood
.
getSupplierId
()
==
categoryTrees
.
getId
())
{
categoryTrees
.
setSize
(
categoryTrees
.
getSize
()
+
1
);
categoryTrees
.
setSize
(
categoryTrees
.
getSize
()
+
1
);
}
}
}
}
...
@@ -402,7 +414,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -402,7 +414,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
int
foodSize
=
0
;
int
foodSize
=
0
;
for
(
PurchaseFoodBean
foodBean
:
purchaseFoodListVOS
)
{
for
(
PurchaseFoodBean
foodBean
:
purchaseFoodListVOS
)
{
//將食品按分類隔開
//將食品按分類隔開
PurchaseFoodBean
cachePurchaseFoodBean
=
purchaseFoodBeanMap
.
get
(
foodBean
.
getId
());
PurchaseFoodBean
cachePurchaseFoodBean
=
SupplyShoppingCart
.
getInstance
().
getFoodByFoodId
(
foodBean
.
getId
());
if
(
cachePurchaseFoodBean
!=
null
)
{
if
(
cachePurchaseFoodBean
!=
null
)
{
foodBean
.
setFoodQuantity
(
cachePurchaseFoodBean
.
getFoodQuantity
());
foodBean
.
setFoodQuantity
(
cachePurchaseFoodBean
.
getFoodQuantity
());
foodSize
++;
foodSize
++;
...
@@ -449,14 +461,18 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -449,14 +461,18 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
BuyIngredientsBean
buyIngredientsBean
=
conversionSupplierToShowInfo
(
foodCategoryTrees
,
purchaseFoodListVOS
);
BuyIngredientsBean
buyIngredientsBean
=
conversionSupplierToShowInfo
(
foodCategoryTrees
,
purchaseFoodListVOS
);
supplierFoods
.
set
(
position
,
buyIngredientsBean
);
supplierFoods
.
set
(
position
,
buyIngredientsBean
);
showFoods
.
add
(
addToHead
?
0
:
showFoods
.
size
(),
buyIngredientsBean
);
showFoods
.
add
(
addToHead
?
0
:
showFoods
.
size
(),
buyIngredientsBean
);
ArrayList
<
BuyIngredientsBean
>
buyIngredientsBeans
=
new
ArrayList
<>();
loadFood
(
buyIngredientsBean
,
addToHead
,
isReset
);
buyIngredientsBeans
.
add
(
buyIngredientsBean
);
mRootView
.
loadFood
(
buyIngredientsBeans
,
addToHead
,
isReset
);
}
}
}
}
});
});
}
}
private
void
loadFood
(
BuyIngredientsBean
buyIngredientsBean
,
boolean
addToHead
,
boolean
isReset
)
{
ArrayList
<
BuyIngredientsBean
>
buyIngredientsBeans
=
new
ArrayList
<>();
buyIngredientsBeans
.
add
(
buyIngredientsBean
);
mRootView
.
loadFood
(
buyIngredientsBeans
,
addToHead
,
isReset
);
}
/**
/**
* 刪除食品
* 刪除食品
*
*
...
@@ -477,18 +493,9 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -477,18 +493,9 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
public
void
onNext
(
BaseResult
baseResult
)
{
public
void
onNext
(
BaseResult
baseResult
)
{
if
(
baseResult
.
isSuccess
())
{
if
(
baseResult
.
isSuccess
())
{
//需要在供應商和分類的緩存中這個食品移除
//需要在供應商和分類的緩存中這個食品移除
// if (categoryPosition == -1) {
// //頁面顯示供應商,那就把所有分類的數據清空
// clearCategoryFoods();
// supplierFoods.get(groupPosition).purchaseFoodList.remove(position);
// } else {
// categoryFoods.get(categoryPosition).get(groupPosition).purchaseFoodList.remove(position);
// clearSupplierFoods();
// }
showFoods
.
get
(
groupPosition
).
purchaseFoodList
.
remove
(
position
);
showFoods
.
get
(
groupPosition
).
purchaseFoodList
.
remove
(
position
);
//移除在購物車中的緩存
//移除在購物車中的緩存
SupplyShoppingCart
.
getInstance
().
removeFoodsByFoodId
(
foodId
);
SupplyShoppingCart
.
getInstance
().
removeFoodsByFoodId
(
foodId
);
// mRootView.onDeleteFoodSuccess(position);
mRootView
.
loadFood
(
showFoods
,
true
,
true
);
mRootView
.
loadFood
(
showFoods
,
true
,
true
);
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
baseResult
.
getErrMsg
()))
{
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
baseResult
.
getErrMsg
()))
{
mRootView
.
showMessage
(
baseResult
.
getErrMsg
());
mRootView
.
showMessage
(
baseResult
.
getErrMsg
());
...
@@ -513,7 +520,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -513,7 +520,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
* @return 用戶採購的食材
* @return 用戶採購的食材
*/
*/
public
List
<
PurchaseFoodBean
>
getPurchaseFood
()
{
public
List
<
PurchaseFoodBean
>
getPurchaseFood
()
{
return
new
ArrayList
<>(
purchaseFoodBeanMap
.
values
()
);
return
SupplyShoppingCart
.
getInstance
().
getCartFoods
(
);
}
}
/**
/**
...
@@ -523,9 +530,13 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -523,9 +530,13 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
*/
*/
public
void
addFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
public
void
addFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
if
(
purchaseFoodBean
.
getFoodQuantity
()
==
0
)
{
if
(
purchaseFoodBean
.
getFoodQuantity
()
==
0
)
{
purchaseFoodBeanMap
.
remove
(
purchaseFoodBean
.
getId
());
// purchaseFoodBeanMap.remove(purchaseFoodBean.getId());
SupplyShoppingCart
.
getInstance
().
removeFoodsByFoodId
(
purchaseFoodBean
.
getId
());
}
else
{
}
else
{
purchaseFoodBeanMap
.
put
(
purchaseFoodBean
.
getId
(),
purchaseFoodBean
);
// purchaseFoodBeanMap.put(purchaseFoodBean.getId(), purchaseFoodBean);
if
(!
SupplyShoppingCart
.
getInstance
().
getCartFoods
().
contains
(
purchaseFoodBean
))
{
SupplyShoppingCart
.
getInstance
().
addFood
(
purchaseFoodBean
);
}
}
}
}
}
...
@@ -551,7 +562,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -551,7 +562,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
}
}
/**
/**
* 清除
分類
食材緩存
* 清除
供應商
食材緩存
*/
*/
public
void
clearSupplierFoods
()
{
public
void
clearSupplierFoods
()
{
int
size
=
supplierFoods
.
size
();
int
size
=
supplierFoods
.
size
();
...
@@ -711,10 +722,29 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -711,10 +722,29 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
if
(
isSupplier
)
{
if
(
isSupplier
)
{
BuyIngredientsBean
buyIngredientsBean
=
supplierFoods
.
get
(
position
);
BuyIngredientsBean
buyIngredientsBean
=
supplierFoods
.
get
(
position
);
if
(
buyIngredientsBean
!=
null
)
{
if
(
buyIngredientsBean
!=
null
)
{
showFoods
.
add
(
addToHead
?
0
:
showFoods
.
size
(),
buyIngredientsBean
);
if
(
showFoods
.
contains
(
buyIngredientsBean
))
{
List
<
BuyIngredientsBean
>
buyIngredientsBeans
=
new
ArrayList
<>();
//如果列表中已经有这个分类的数据,则加载上一个分类
buyIngredientsBeans
.
add
(
buyIngredientsBean
);
position
-=
1
;
mRootView
.
loadFood
(
buyIngredientsBeans
,
addToHead
,
isReset
);
if
(
position
>=
0
&&
position
<
categoryFoods
.
size
())
{
loadCacheFood
(
isSupplier
,
position
,
addToHead
,
isReset
);
}
else
{
mRootView
.
finishLoad
(
false
);
}
}
else
{
Log
.
e
(
"eee"
,
"加载供應商缓存"
);
List
<
BuyIngredientsBean
>
food
=
new
ArrayList
<>();
food
.
add
(
supplierFoods
.
get
(
position
));
if
(
addToHead
)
{
showFoods
.
addAll
(
0
,
food
);
}
else
{
showFoods
.
addAll
(
food
);
}
mRootView
.
loadFood
(
food
,
addToHead
,
isReset
);
}
}
else
{
Log
.
e
(
"eee"
,
"没有供應商缓存"
+
position
);
//需要通过接口
getFoodsBySupplier
(
position
,
supplierTranCategoryCache
.
get
(
position
),
addToHead
,
isReset
);
}
}
}
else
{
}
else
{
List
<
BuyIngredientsBean
>
buyIngredientsBeans
=
categoryFoods
.
get
(
position
);
List
<
BuyIngredientsBean
>
buyIngredientsBeans
=
categoryFoods
.
get
(
position
);
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/OrderDetailsPresenter.java
View file @
13ff529e
...
@@ -77,7 +77,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
...
@@ -77,7 +77,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
/**
/**
* 所上傳的圖片路徑集合
* 所上傳的圖片路徑集合
*/
*/
private
List
<
String
>
imgs
;
private
List
<
Object
>
imgs
;
/**
/**
* 逗號分隔符
* 逗號分隔符
*/
*/
...
@@ -340,7 +340,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
...
@@ -340,7 +340,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
OrderWareHouseBean
.
PurchaseWarehousingOrder
purchaseWarehousingOrder
=
new
OrderWareHouseBean
.
PurchaseWarehousingOrder
();
OrderWareHouseBean
.
PurchaseWarehousingOrder
purchaseWarehousingOrder
=
new
OrderWareHouseBean
.
PurchaseWarehousingOrder
();
if
(
imgs
!=
null
)
{
if
(
imgs
!=
null
)
{
StringBuilder
files
=
new
StringBuilder
();
StringBuilder
files
=
new
StringBuilder
();
for
(
String
img
:
imgs
)
{
for
(
Object
img
:
imgs
)
{
files
.
append
(
img
).
append
(
COMMA_SEPARATED
);
files
.
append
(
img
).
append
(
COMMA_SEPARATED
);
}
}
String
substring
=
files
.
substring
(
0
,
files
.
length
());
String
substring
=
files
.
substring
(
0
,
files
.
length
());
...
@@ -579,13 +579,17 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
...
@@ -579,13 +579,17 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
});
});
}
}
public
List
<
Object
>
getImgs
()
{
return
imgs
;
}
public
void
deletePic
(
int
position
)
{
public
void
deletePic
(
int
position
)
{
if
(
imgs
!=
null
&&
position
<
imgs
.
size
())
{
if
(
imgs
!=
null
&&
position
<
imgs
.
size
())
{
imgs
.
remove
(
position
);
imgs
.
remove
(
position
);
}
}
}
}
public
String
getPic
(
int
position
)
{
public
Object
getPic
(
int
position
)
{
if
(
imgs
!=
null
&&
position
<
imgs
.
size
())
{
if
(
imgs
!=
null
&&
position
<
imgs
.
size
())
{
return
imgs
.
get
(
position
);
return
imgs
.
get
(
position
);
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WareHouseListPresenter.java
View file @
13ff529e
...
@@ -129,18 +129,11 @@ public class WareHouseListPresenter extends BasePresenter<WareHouseListContract.
...
@@ -129,18 +129,11 @@ public class WareHouseListPresenter extends BasePresenter<WareHouseListContract.
@Override
@Override
public
void
onNext
(
WareHouseListBean
wareHouseListBean
)
{
public
void
onNext
(
WareHouseListBean
wareHouseListBean
)
{
if
(
wareHouseListBean
.
isSuccess
())
{
if
(
wareHouseListBean
.
isSuccess
())
{
// if (data == null || pageIndex == 0) {
// data = new WareHouseListBean.WareHousingDataBean();
// data.setPurchaseWarehousingOrderDetailsVOS(new ArrayList<>());
// data.getPurchaseWarehousingOrderDetailsVOS().add(new PurchaseWarehousingOrderDetailsVO());
// }
// data.setTotal(wareHouseListBean.getData().getTotal());
if
(
CollectionUtils
.
isNullOrEmpty
(
wareHouseListBean
.
getData
().
getPurchaseWarehousingOrderDetailsVOS
()))
{
if
(
CollectionUtils
.
isNullOrEmpty
(
wareHouseListBean
.
getData
().
getPurchaseWarehousingOrderDetailsVOS
()))
{
mRootView
.
finishLoadNoMoreData
();
mRootView
.
finishLoadNoMoreData
();
}
else
{
}
else
{
mRootView
.
loadWarehousingInfo
(
wareHouseListBean
.
getData
());
mRootView
.
loadWarehousingInfo
(
wareHouseListBean
.
getData
());
}
}
// data.getPurchaseWarehousingOrderDetailsVOS().addAll(wareHouseListBean.getData().getPurchaseWarehousingOrderDetailsVOS());
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
wareHouseListBean
.
getErrMsg
()))
{
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
wareHouseListBean
.
getErrMsg
()))
{
mRootView
.
showMessage
(
wareHouseListBean
.
getErrMsg
());
mRootView
.
showMessage
(
wareHouseListBean
.
getErrMsg
());
mRootView
.
loadFail
();
mRootView
.
loadFail
();
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WarehousingOrderListPresenter.java
0 → 100644
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
mvp
.
presenter
;
import
android.app.Application
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.jess.arms.mvp.BasePresenter
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
javax.inject.Inject
;
import
com.gingersoft.supply_chain.mvp.contract.WarehousingOrderListContract
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 04/28/2021 19:21
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
public
class
WarehousingOrderListPresenter
extends
BasePresenter
<
WarehousingOrderListContract
.
Model
,
WarehousingOrderListContract
.
View
>
{
@Inject
RxErrorHandler
mErrorHandler
;
@Inject
Application
mApplication
;
@Inject
ImageLoader
mImageLoader
;
@Inject
AppManager
mAppManager
;
@Inject
public
WarehousingOrderListPresenter
(
WarehousingOrderListContract
.
Model
model
,
WarehousingOrderListContract
.
View
rootView
)
{
super
(
model
,
rootView
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mErrorHandler
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/activity/SupplyChainMainActivity.java
View file @
13ff529e
...
@@ -47,7 +47,6 @@ public class SupplyChainMainActivity extends BaseFragmentActivity<SupplyChainMai
...
@@ -47,7 +47,6 @@ public class SupplyChainMainActivity extends BaseFragmentActivity<SupplyChainMai
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
SoftHideKeyBoardUtil
.
assistActivity
(
this
);
SoftHideKeyBoardUtil
.
assistActivity
(
this
);
}
}
@Override
@Override
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/BuyIngredientsAdapter.java
View file @
13ff529e
...
@@ -7,6 +7,7 @@ import android.widget.EditText;
...
@@ -7,6 +7,7 @@ import android.widget.EditText;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.glide.GlideUtils
;
import
com.gingersoft.gsa.cloud.common.utils.glide.GlideUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.threadPool.ThreadPoolManager
;
import
com.gingersoft.gsa.cloud.common.utils.threadPool.ThreadPoolManager
;
...
@@ -100,7 +101,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
...
@@ -100,7 +101,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_supplier_name
,
purchaseFoodBean
.
getSupplierName
());
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_supplier_name
,
purchaseFoodBean
.
getSupplierName
());
itemViewHolder
.
setImageResource
(
R
.
id
.
iv_food_ingredient_img
,
R
.
drawable
.
img_small_default
);
itemViewHolder
.
setImageResource
(
R
.
id
.
iv_food_ingredient_img
,
R
.
drawable
.
img_small_default
);
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
purchaseFoodBean
.
getImages
()))
{
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
purchaseFoodBean
.
getImages
()))
{
GlideUtils
.
display
(
mContext
,
(
ImageView
)
itemViewHolder
.
get
(
R
.
id
.
iv_food_ingredient_img
),
purchaseFoodBean
.
getImages
());
GlideUtils
.
display
(
mContext
,
itemViewHolder
.
get
(
R
.
id
.
iv_food_ingredient_img
),
purchaseFoodBean
.
getImages
());
}
}
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_no
,
purchaseFoodBean
.
getFoodNo
());
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_no
,
purchaseFoodBean
.
getFoodNo
());
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_name
,
purchaseFoodBean
.
getName
());
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_name
,
purchaseFoodBean
.
getName
());
...
@@ -110,7 +111,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
...
@@ -110,7 +111,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
}
else
{
}
else
{
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_unit
,
purchaseFoodBean
.
getBasicUnitName
());
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_unit
,
purchaseFoodBean
.
getBasicUnitName
());
}
}
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_price
,
String
.
format
(
mContext
.
getString
(
R
.
string
.
amount_string
),
purchaseFoodBean
.
getUnitPrice
(
)));
itemViewHolder
.
setText
(
R
.
id
.
tv_food_item_price
,
String
.
format
(
mContext
.
getString
(
R
.
string
.
amount_string
_s
),
MoneyUtil
.
formatDouble
(
purchaseFoodBean
.
getUnitPrice
()
)));
EditText
edNumberInput
=
itemViewHolder
.
get
(
R
.
id
.
ed_food_ingredient_number
);
EditText
edNumberInput
=
itemViewHolder
.
get
(
R
.
id
.
ed_food_ingredient_number
);
edNumberInput
.
setText
(
String
.
valueOf
(
purchaseFoodBean
.
getFoodQuantity
()),
TextView
.
BufferType
.
EDITABLE
);
edNumberInput
.
setText
(
String
.
valueOf
(
purchaseFoodBean
.
getFoodQuantity
()),
TextView
.
BufferType
.
EDITABLE
);
//如果數量小於等於0,就不顯示減號和數量
//如果數量小於等於0,就不顯示減號和數量
...
@@ -148,7 +149,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
...
@@ -148,7 +149,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
setDisplayStateByType
(
itemViewHolder
,
true
,
false
,
false
);
setDisplayStateByType
(
itemViewHolder
,
true
,
false
,
false
);
}
else
if
(
adapterType
==
BuyIngredientsFragment
.
ADD_ORDER
)
{
}
else
if
(
adapterType
==
BuyIngredientsFragment
.
ADD_ORDER
)
{
//創建採購單頁面,隱藏編輯和刪除,顯示加減和數量
//創建採購單頁面,隱藏編輯和刪除,顯示加減和數量
setDisplayStateByType
(
itemViewHolder
,
false
,
true
,
true
);
setDisplayStateByType
(
itemViewHolder
,
false
,
purchaseFoodBean
.
getFoodQuantity
()
>
0
,
true
);
}
else
if
(
adapterType
==
BuyIngredientsFragment
.
GET_FOOD_BY_SUPPLIER
)
{
}
else
if
(
adapterType
==
BuyIngredientsFragment
.
GET_FOOD_BY_SUPPLIER
)
{
//供應商商品列表,編輯和數量都顯示
//供應商商品列表,編輯和數量都顯示
setDisplayStateByType
(
itemViewHolder
,
true
,
purchaseFoodBean
.
getFoodQuantity
()
>
0
,
true
);
setDisplayStateByType
(
itemViewHolder
,
true
,
purchaseFoodBean
.
getFoodQuantity
()
>
0
,
true
);
...
@@ -181,7 +182,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
...
@@ -181,7 +182,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
*/
*/
private
void
setSubAndNumShow
(
BaseViewHolder
viewHolder
,
boolean
showOrHide
)
{
private
void
setSubAndNumShow
(
BaseViewHolder
viewHolder
,
boolean
showOrHide
)
{
viewHolder
.
setVisible
(
R
.
id
.
btn_food_operation_sub
,
!
showOrHide
);
viewHolder
.
setVisible
(
R
.
id
.
btn_food_operation_sub
,
!
showOrHide
);
viewHolder
.
set
Invisible
(
R
.
id
.
ed_food_ingredient_number
,
showOrHide
);
viewHolder
.
set
Visible
(
R
.
id
.
ed_food_ingredient_number
,
!
showOrHide
);
}
}
/**
/**
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/PurchasePageAdapter.java
View file @
13ff529e
...
@@ -16,10 +16,12 @@
...
@@ -16,10 +16,12 @@
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
android.text.Layout
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.LinearLayout
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/WareHousingDetailsAdapter.java
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -9,7 +7,7 @@ import androidx.core.content.ContextCompat;
...
@@ -9,7 +7,7 @@ import androidx.core.content.ContextCompat;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.common.utils.
Money
Util
;
import
com.gingersoft.gsa.cloud.common.utils.
other.Text
Util
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.mvp.bean.WarehouseDetailsBean
;
import
com.gingersoft.supply_chain.mvp.bean.WarehouseDetailsBean
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WarehouseDetailsFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WarehouseDetailsFragment
;
...
@@ -44,52 +42,58 @@ public class WareHousingDetailsAdapter extends BaseQuickAdapter<WarehouseDetails
...
@@ -44,52 +42,58 @@ public class WareHousingDetailsAdapter extends BaseQuickAdapter<WarehouseDetails
}
}
@Override
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
WarehouseDetailsBean
purchaseWarehousingOrderDetailsContentsBean
)
{
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
WarehouseDetailsBean
item
)
{
//食品名
//食品名
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_name
,
purchaseWarehousingOrderDetailsContentsBean
.
getName
());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_name
,
item
.
getName
());
//入庫單位
//入庫單位
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_unit
,
purchaseWarehousingOrderDetailsContentsBean
.
getUnitName
());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_unit
,
item
.
getUnitName
());
//入庫食品數量
//入庫食品數量
// if (
purchaseWarehousingOrderDetailsContentsBean
.getFoodQuantity() > 0) {
// if (
item
.getFoodQuantity() > 0) {
if
(
type
==
WarehouseDetailsFragment
.
WAREHOUSE_TYPE
)
{
if
(
type
==
WarehouseDetailsFragment
.
WAREHOUSE_TYPE
)
{
// 入庫,顯示+
// 入庫,顯示+
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getFoodQuantity
()
>=
0
)
{
if
(
item
.
getFoodQuantity
()
>=
0
)
{
//如果大於0,前面顯示+號
//如果大於0,前面顯示+號
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_num
,
String
.
format
(
getContext
().
getString
(
R
.
string
.
str_format_positive_int
),
purchaseWarehousingOrderDetailsContentsBean
.
getFoodQuantity
()));
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_num
,
String
.
format
(
getContext
().
getString
(
R
.
string
.
str_format_positive_int
),
item
.
getFoodQuantity
()));
}
else
{
}
else
{
//小於0,直接顯示負數
//小於0,直接顯示負數
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_num
,
String
.
valueOf
(
purchaseWarehousingOrderDetailsContentsBean
.
getFoodQuantity
()));
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_num
,
String
.
valueOf
(
item
.
getFoodQuantity
()));
}
}
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_time_text
,
false
);
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_time_text
,
false
);
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_order_time_text
,
"下單日期:"
);
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_order_time_text
,
"下單日期:"
);
//入庫日期
//入庫日期
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_time
,
purchaseWarehousingOrderDetailsContentsBean
.
getWarehousingTime
());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_time
,
item
.
getWarehousingTime
());
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_details_time
,
false
);
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_details_time
,
false
);
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_details_remarks
,
true
);
}
else
{
}
else
{
//出庫,顯示-
//出庫,顯示-
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getFoodQuantity
()
>=
0
)
{
if
(
item
.
getFoodQuantity
()
>=
0
)
{
//如果大於0,前面顯示-號
//如果大於0,前面顯示-號
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_num
,
String
.
format
(
getContext
().
getString
(
R
.
string
.
str_format_less
),
purchaseWarehousingOrderDetailsContentsBean
.
getFoodQuantity
()
+
""
));
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_num
,
String
.
format
(
getContext
().
getString
(
R
.
string
.
str_format_less
),
item
.
getFoodQuantity
()
+
""
));
}
else
{
}
else
{
//小於0,顯示正數,負負得正
//小於0,顯示正數,負負得正
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_num
,
String
.
format
(
getContext
().
getString
(
R
.
string
.
str_format_positive
),
Math
.
abs
(
purchaseWarehousingOrderDetailsContentsBean
.
getFoodQuantity
())
+
""
));
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_food_num
,
String
.
format
(
getContext
().
getString
(
R
.
string
.
str_format_positive
),
Math
.
abs
(
item
.
getFoodQuantity
())
+
""
));
}
}
// 入庫顯示消耗日期,不顯示入庫日期
// 入庫顯示消耗日期,不顯示入庫日期
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_time_text
,
true
);
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_time_text
,
true
);
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_details_time
,
true
);
//消耗日期
//消耗日期
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_order_time_text
,
"消耗日期:"
);
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_order_time_text
,
"消耗日期:"
);
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_details_time
,
true
);
//顯示備註
viewHolder
.
setGone
(
R
.
id
.
tv_warehouse_details_remarks
,
false
);
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
item
.
getRemarks
()))
{
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_remarks
,
String
.
format
(
getContext
().
getString
(
R
.
string
.
str_format_remark_colon
),
item
.
getRemarks
()));
}
}
}
//下單時間
//下單時間
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_order_time
,
purchaseWarehousingOrderDetailsContentsBean
.
getPurchaseTime
());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_order_time
,
item
.
getPurchaseTime
());
//供應商
//供應商
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_supplier
,
purchaseWarehousingOrderDetailsContentsBean
.
getSupplierName
());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_supplier
,
item
.
getSupplierName
());
//入庫來源
//入庫來源
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_reason
,
purchaseWarehousingOrderDetailsContentsBean
.
getPurchase
());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_reason
,
item
.
getPurchase
());
//設置狀態
//設置狀態
TextView
tvState
=
viewHolder
.
getView
(
R
.
id
.
tv_warehouse_state
);
TextView
tvState
=
viewHolder
.
getView
(
R
.
id
.
tv_warehouse_state
);
TextView
tvExpiresTime
=
viewHolder
.
getView
(
R
.
id
.
tv_warehouse_expires_time
);
TextView
tvExpiresTime
=
viewHolder
.
getView
(
R
.
id
.
tv_warehouse_expires_time
);
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getConsumeStatus
()
==
WarehouseDetailsBean
.
WAREHOUSE_STATE_ALL_CONSUMED
)
{
if
(
item
.
getConsumeStatus
()
==
WarehouseDetailsBean
.
WAREHOUSE_STATE_ALL_CONSUMED
)
{
//全部消耗了
//全部消耗了
tvState
.
setText
(
"庫存已使用"
);
tvState
.
setText
(
"庫存已使用"
);
tvState
.
setTextColor
(
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
required_color
));
tvState
.
setTextColor
(
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
required_color
));
...
@@ -98,26 +102,26 @@ public class WareHousingDetailsAdapter extends BaseQuickAdapter<WarehouseDetails
...
@@ -98,26 +102,26 @@ public class WareHousingDetailsAdapter extends BaseQuickAdapter<WarehouseDetails
tvExpiresTime
.
setVisibility
(
View
.
GONE
);
tvExpiresTime
.
setVisibility
(
View
.
GONE
);
}
else
{
}
else
{
//部分消耗
//部分消耗
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getConsumeStatus
()
==
WarehouseDetailsBean
.
WAREHOUSE_STATE_PART_CONSUMED
)
{
if
(
item
.
getConsumeStatus
()
==
WarehouseDetailsBean
.
WAREHOUSE_STATE_PART_CONSUMED
)
{
tvState
.
setText
(
"部分使用"
);
tvState
.
setText
(
"部分使用"
);
tvState
.
setTextColor
(
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
bright_orange
));
tvState
.
setTextColor
(
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
bright_orange
));
tvState
.
setVisibility
(
View
.
VISIBLE
);
tvState
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
}
else
{
tvState
.
setVisibility
(
View
.
INVISIBLE
);
tvState
.
setVisibility
(
View
.
INVISIBLE
);
}
}
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
()
>=
0
)
{
if
(
item
.
getDistanceExpiresTime
()
>=
0
)
{
//即將過期天數大於等於0
//即將過期天數大於等於0
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getWarningDays
()
>
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
())
{
if
(
item
.
getWarningDays
()
>
item
.
getDistanceExpiresTime
())
{
//在預警天數內
//在預警天數內
//顯示即將過期
//顯示即將過期
setExpiresTime
(
tvExpiresTime
,
R
.
drawable
.
shape_oval_bright_orange
,
"即将過期:"
,
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
());
setExpiresTime
(
tvExpiresTime
,
R
.
drawable
.
shape_oval_bright_orange
,
"即将過期:"
,
item
.
getDistanceExpiresTime
());
}
else
{
}
else
{
tvExpiresTime
.
setVisibility
(
View
.
GONE
);
tvExpiresTime
.
setVisibility
(
View
.
GONE
);
tvState
.
setVisibility
(
View
.
GONE
);
tvState
.
setVisibility
(
View
.
GONE
);
}
}
}
else
{
}
else
{
//天數為負,則是已過期
//天數為負,則是已過期
setExpiresTime
(
tvExpiresTime
,
R
.
drawable
.
shape_oval_red_wine
,
"已過期:"
,
Math
.
abs
(
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
()));
setExpiresTime
(
tvExpiresTime
,
R
.
drawable
.
shape_oval_red_wine
,
"已過期:"
,
Math
.
abs
(
item
.
getDistanceExpiresTime
()));
}
}
}
}
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/WarehousingOrderListAdapter.kt
0 → 100644
View file @
13ff529e
package
com.gingersoft.supply_chain.mvp.ui.adapter
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.gingersoft.supply_chain.R
import
com.gingersoft.supply_chain.mvp.bean.WarehouseOrderBean
/**
* @author 宇航. 1239658231@qq.com
* User: admin
* Date: 2021/4/28
* Time: 14:19
* Use:
*/
class
WarehousingOrderListAdapter
(
data
:
MutableList
<
WarehouseOrderBean
>?)
:
BaseQuickAdapter
<
WarehouseOrderBean
,
BaseViewHolder
>(
R
.
layout
.
item_warehousing_order_list
,
data
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
WarehouseOrderBean
)
{
holder
.
setText
(
R
.
id
.
tv_warehousing_order_no
,
item
.
orderNo
)
holder
.
setText
(
R
.
id
.
tv_warehousing_order_createTime
,
item
.
warehousingTime
)
holder
.
setText
(
R
.
id
.
tv_warehousing_order_species
,
item
.
warehousingSpecies
)
holder
.
setText
(
R
.
id
.
tv_warehousing_order_createMember
,
item
.
warehousingMember
)
holder
.
setText
(
R
.
id
.
tv_warehousing_order_foods
,
item
.
warehousingFoodName
)
holder
.
setText
(
R
.
id
.
tv_warehousing_order_createReason
,
item
.
warehousingReason
)
}
}
\ No newline at end of file
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/BuyIngredientsFragment.java
View file @
13ff529e
...
@@ -141,7 +141,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -141,7 +141,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
* true 是 false 否,顯示分類食材
* true 是 false 否,顯示分類食材
*/
*/
private
boolean
isShowSupplier
=
false
;
private
boolean
isShowSupplier
=
false
;
private
LoadService
fullRegister
;
private
LoadService
fullRegister
;
/**
/**
* 頁面類型
* 頁面類型
...
@@ -218,7 +217,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -218,7 +217,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
if
(
i
>=
0
)
{
if
(
i
>=
0
)
{
loadFirstCategoryInfo
(
i
,
true
,
false
);
loadFirstCategoryInfo
(
i
,
true
,
false
);
}
else
{
}
else
{
Log
.
e
(
"eee"
,
"没有更多数据了"
+
i
);
setRefreshState
(
false
);
setRefreshState
(
false
);
}
}
}).
setOnLoadMoreListener
(
refreshLayout
->
{
}).
setOnLoadMoreListener
(
refreshLayout
->
{
...
@@ -228,7 +226,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -228,7 +226,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
//判斷是否有緩存,把緩存拿出來,看看有沒有加載到列表中,如果已經加載了,繼續獲取下一個分類,一直到沒有加載的那個
//判斷是否有緩存,把緩存拿出來,看看有沒有加載到列表中,如果已經加載了,繼續獲取下一個分類,一直到沒有加載的那個
mPresenter
.
loadNextCategoryFood
(
isShowSupplier
,
i
,
firstLevelCategoryAdapter
.
getData
());
mPresenter
.
loadNextCategoryFood
(
isShowSupplier
,
i
,
firstLevelCategoryAdapter
.
getData
());
}
else
{
}
else
{
Log
.
e
(
"eee"
,
"没有更多数据了"
+
i
);
finishLoad
(
true
);
finishLoad
(
true
);
}
}
}).
setEnableOverScrollBounce
(
false
).
setEnableAutoLoadMore
(
true
);
}).
setEnableOverScrollBounce
(
false
).
setEnableAutoLoadMore
(
true
);
...
@@ -238,7 +235,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -238,7 +235,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
private
void
loadDataByType
()
{
private
void
loadDataByType
()
{
//將購物車中的食品數據導出
//將購物車中的食品數據導出
//初始化購物車數量
//初始化購物車數量
setTvShoppingCartNum
(
mPresenter
.
tranShoppingCartToCache
());
setTvShoppingCartNum
(
mPresenter
.
statisticsFoodQuantity
());
if
(
pageType
==
GET_FOOD_BY_SUPPLIER
)
{
if
(
pageType
==
GET_FOOD_BY_SUPPLIER
)
{
Bundle
arguments
=
getArguments
();
Bundle
arguments
=
getArguments
();
if
(
arguments
!=
null
)
{
if
(
arguments
!=
null
)
{
...
@@ -252,18 +249,11 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -252,18 +249,11 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
layoutIngredientsLeft
.
setVisibility
(
View
.
GONE
);
layoutIngredientsLeft
.
setVisibility
(
View
.
GONE
);
//將顯示模式設置為顯示供應商
//將顯示模式設置為顯示供應商
isShowSupplier
=
true
;
isShowSupplier
=
true
;
//設置供應商信息
// this.supplierId = supplierId;
// setCurrentSupplierName(supplierName);
//將當前供應商信息緩存到緩存中
// mPresenter.addToSupplierCacheInfo(supplierId, supplierName);
//獲取該供應商數據
// getFoodsBySupplierId();
//隱藏二級分類
//隱藏二級分類
setSecondCategoryShowState
(
View
.
GONE
);
setSecondCategoryShowState
(
View
.
GONE
);
mPresenter
.
initSupplierFoods
(
1
);
mPresenter
.
initSupplierFoods
(
1
);
//在一級分類中加載食品信息
initCategoryInfo
(
Collections
.
singletonList
(
supplierToCategory
));
initCategoryInfo
(
Collections
.
singletonList
(
supplierToCategory
));
mPresenter
.
getFoodsBySupplier
(
0
,
supplierToCategory
,
false
,
true
);
}
else
{
}
else
{
killMyself
();
killMyself
();
}
}
...
@@ -383,7 +373,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -383,7 +373,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
return
;
return
;
}
}
int
currentStickyGroup
=
stickyHeaderLayout
.
getCurrentStickyGroup
();
int
currentStickyGroup
=
stickyHeaderLayout
.
getCurrentStickyGroup
();
Log
.
e
(
"eee"
,
dy
+
"當前組下標:"
+
currentStickyGroup
);
//手指往上滑動,獲取下一個分類數據
//手指往上滑動,獲取下一個分類數據
//記錄當前滑動到哪個header,如果和上次不一致,頂部的分類就切換選中
//記錄當前滑動到哪個header,如果和上次不一致,頂部的分類就切換選中
if
(
currentStickyGroup
!=
lastIndex
)
{
if
(
currentStickyGroup
!=
lastIndex
)
{
...
@@ -396,12 +385,10 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -396,12 +385,10 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
if
(
headerDataByPosition
==
null
)
{
if
(
headerDataByPosition
==
null
)
{
return
;
return
;
}
}
Log
.
e
(
"eee"
,
"當前分類名稱:"
+
headerDataByPosition
.
categoryName
);
//頂部懸浮顯示的是一級分類
//頂部懸浮顯示的是一級分類
if
(
headerDataByPosition
.
parentId
==
0
)
{
if
(
headerDataByPosition
.
parentId
==
0
)
{
//找到這個一級分類,左側一級分類切換到選中,頂部二級分類切換顯示
//找到這個一級分類,左側一級分類切換到選中,頂部二級分類切換顯示
int
firstLevelCategoryIndex
=
firstLevelCategoryAdapter
.
getItemPosition
(
new
OrderCategoryBean
.
FoodCategoryTrees
(
headerDataByPosition
.
id
,
headerDataByPosition
.
categoryName
,
headerDataByPosition
.
parentId
));
int
firstLevelCategoryIndex
=
firstLevelCategoryAdapter
.
getItemPosition
(
new
OrderCategoryBean
.
FoodCategoryTrees
(
headerDataByPosition
.
id
,
headerDataByPosition
.
categoryName
,
headerDataByPosition
.
parentId
));
Log
.
e
(
"eee"
,
"一級分類下標:"
+
firstLevelCategoryIndex
);
if
(
firstLevelCategoryIndex
>
-
1
)
{
if
(
firstLevelCategoryIndex
>
-
1
)
{
//判斷這個分類是否已經被加載了,如果已經加載過了,就需要往下找,一直找到沒有被加載那個
//判斷這個分類是否已經被加載了,如果已經加載過了,就需要往下找,一直找到沒有被加載那個
selectFirstCategoryByIndex
(
firstLevelCategoryIndex
);
selectFirstCategoryByIndex
(
firstLevelCategoryIndex
);
...
@@ -410,23 +397,18 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -410,23 +397,18 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
//二級或三級分類,同時也要判斷是否要切換一級分類
//二級或三級分類,同時也要判斷是否要切換一級分類
OrderCategoryBean
.
FoodCategoryTrees
currentStickyCategory
=
new
OrderCategoryBean
.
FoodCategoryTrees
(
headerDataByPosition
.
id
,
headerDataByPosition
.
categoryName
,
headerDataByPosition
.
parentId
);
OrderCategoryBean
.
FoodCategoryTrees
currentStickyCategory
=
new
OrderCategoryBean
.
FoodCategoryTrees
(
headerDataByPosition
.
id
,
headerDataByPosition
.
categoryName
,
headerDataByPosition
.
parentId
);
int
secondLevelCategoryIndex
=
secondCategoryAdapter
.
getItemPosition
(
currentStickyCategory
);
int
secondLevelCategoryIndex
=
secondCategoryAdapter
.
getItemPosition
(
currentStickyCategory
);
Log
.
e
(
"eee"
,
"二級分類下標:"
+
secondLevelCategoryIndex
);
if
(
secondLevelCategoryIndex
>=
0
)
{
if
(
secondLevelCategoryIndex
>=
0
)
{
secondCategorySelect
(
secondLevelCategoryIndex
,
true
);
secondCategorySelect
(
secondLevelCategoryIndex
,
true
);
}
else
{
}
else
{
//沒有這個二級或三級分類,判斷是否切換了一級分類
//沒有這個二級或三級分類,判斷是否切換了一級分類
BuyIngredientsBean
firstCategory
=
mPresenter
.
getFirstCategoryByIndex
(
currentStickyGroup
);
BuyIngredientsBean
firstCategory
=
mPresenter
.
getFirstCategoryByIndex
(
currentStickyGroup
);
if
(
firstCategory
!=
null
)
{
if
(
firstCategory
!=
null
)
{
Log
.
e
(
"eee"
,
"一級分類:"
+
firstCategory
.
categoryName
);
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTrees
=
new
OrderCategoryBean
.
FoodCategoryTrees
(
firstCategory
.
id
,
firstCategory
.
categoryName
,
firstCategory
.
parentId
);
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTrees
=
new
OrderCategoryBean
.
FoodCategoryTrees
(
firstCategory
.
id
,
firstCategory
.
categoryName
,
firstCategory
.
parentId
);
int
firstCategoryIndex
=
firstLevelCategoryAdapter
.
getItemPosition
(
foodCategoryTrees
);
int
firstCategoryIndex
=
firstLevelCategoryAdapter
.
getItemPosition
(
foodCategoryTrees
);
Log
.
e
(
"eee"
,
"一級分類下標:"
+
firstCategoryIndex
);
if
(
firstCategoryIndex
!=
firstLevelCategoryAdapter
.
getSelectedIndex
())
{
if
(
firstCategoryIndex
!=
firstLevelCategoryAdapter
.
getSelectedIndex
())
{
if
(
firstCategoryIndex
>=
0
&&
firstCategoryIndex
!=
firstLevelCategoryAdapter
.
getSelectedIndex
()
&&
firstCategoryIndex
<
firstLevelCategoryAdapter
.
getItemCount
())
{
if
(
firstCategoryIndex
>=
0
&&
firstCategoryIndex
!=
firstLevelCategoryAdapter
.
getSelectedIndex
()
&&
firstCategoryIndex
<
firstLevelCategoryAdapter
.
getItemCount
())
{
//切換一級分類
selectFirstCategoryByIndex
(
firstCategoryIndex
);
selectFirstCategoryByIndex
(
firstCategoryIndex
);
//切換一級分類後,再切換二級分類
// int secondLevelCategoryIndex2 = secondCategoryAdapter.getItemPosition(currentStickyCategory);
// secondCategorySelect(secondLevelCategoryIndex2, secondLevelCategoryIndex2 >= 0);
}
}
}
}
}
}
...
@@ -503,9 +485,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -503,9 +485,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
* 確認,進入購物車頁面
* 確認,進入購物車頁面
*/
*/
private
void
confirm
()
{
private
void
confirm
()
{
SupplyShoppingCart
.
getInstance
().
clear
();
List
<
PurchaseFoodBean
>
purchaseFood
=
mPresenter
.
getPurchaseFood
();
List
<
PurchaseFoodBean
>
purchaseFood
=
mPresenter
.
getPurchaseFood
();
SupplyShoppingCart
.
getInstance
().
addAllFood
(
mPresenter
.
getPurchaseFood
());
if
(
CollectionUtils
.
isNotNullOrEmpty
(
purchaseFood
))
{
if
(
CollectionUtils
.
isNotNullOrEmpty
(
purchaseFood
))
{
startForResult
(
ShoppingCatFragment
.
newInstance
(),
TO_SHOPPING_CART_REQUEST_CODE
);
startForResult
(
ShoppingCatFragment
.
newInstance
(),
TO_SHOPPING_CART_REQUEST_CODE
);
}
else
{
}
else
{
...
@@ -548,8 +528,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -548,8 +528,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
private
void
loadFirstCategoryInfo
(
int
position
,
boolean
addToHead
,
boolean
isReset
)
{
private
void
loadFirstCategoryInfo
(
int
position
,
boolean
addToHead
,
boolean
isReset
)
{
//切換右側顯示的二級分類和食材
//切換右側顯示的二級分類和食材
// 现在改为在滑動事件中切換
// 现在改为在滑動事件中切換
// selectFirstCategoryByIndex(position);
Log
.
e
(
"eee"
,
"loadFirstCategoryInfo:"
+
position
);
if
(!
mPresenter
.
isHasLocationInfo
(
isShowSupplier
,
position
))
{
if
(!
mPresenter
.
isHasLocationInfo
(
isShowSupplier
,
position
))
{
//本地沒有緩衝才去查找
//本地沒有緩衝才去查找
//獲取點擊的分類的所有食材
//獲取點擊的分類的所有食材
...
@@ -558,17 +536,14 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -558,17 +536,14 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
}
else
{
}
else
{
mPresenter
.
getFoodByCategory
(
position
,
firstLevelCategoryAdapter
.
getItem
(
position
),
addToHead
,
isReset
);
mPresenter
.
getFoodByCategory
(
position
,
firstLevelCategoryAdapter
.
getItem
(
position
),
addToHead
,
isReset
);
}
}
Log
.
e
(
"eee"
,
"没有缓存"
);
}
else
{
}
else
{
//本地有緩存,拿緩存中的數據
//本地有緩存,拿緩存中的數據
Log
.
e
(
"eee"
,
"讀緩存:"
+
position
);
mPresenter
.
loadCacheFood
(
isShowSupplier
,
position
,
addToHead
,
isReset
);
mPresenter
.
loadCacheFood
(
isShowSupplier
,
position
,
addToHead
,
isReset
);
}
}
}
}
@Override
@Override
public
void
selectFirstCategoryByIndex
(
int
position
)
{
public
void
selectFirstCategoryByIndex
(
int
position
)
{
Log
.
e
(
"eee"
,
"selectFirstCategoryByIndex"
);
firstLevelCategoryAdapter
.
setSelectedIndex
(
position
);
firstLevelCategoryAdapter
.
setSelectedIndex
(
position
);
loadSecondCategory
(
firstLevelCategoryAdapter
.
getItem
(
position
).
getFoodCategoryTrees
());
loadSecondCategory
(
firstLevelCategoryAdapter
.
getItem
(
position
).
getFoodCategoryTrees
());
ViewUtils
.
moveToCenterByVertical
(
rvFirstCategory
,
position
);
ViewUtils
.
moveToCenterByVertical
(
rvFirstCategory
,
position
);
...
@@ -622,7 +597,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -622,7 +597,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
*/
*/
private
void
loadSecondCategory
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
)
{
private
void
loadSecondCategory
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
)
{
if
(
secondCategoryAdapter
!=
null
&&
CollectionUtils
.
isNullOrEmpty
(
foodCategoryTrees
))
{
if
(
secondCategoryAdapter
!=
null
&&
CollectionUtils
.
isNullOrEmpty
(
foodCategoryTrees
))
{
Log
.
e
(
"eee"
,
"沒有二級分類"
);
secondCategoryAdapter
.
setNewInstance
(
null
);
secondCategoryAdapter
.
setNewInstance
(
null
);
return
;
return
;
}
}
...
@@ -644,9 +618,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -644,9 +618,6 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
}
else
{
}
else
{
secondCategoryAdapter
.
setNewInstance
(
foodCategoryTrees
);
secondCategoryAdapter
.
setNewInstance
(
foodCategoryTrees
);
}
}
// Log.e("eee", "二級分類加載完成" + foodCategoryTrees.size());
//默認選中第0個
// secondCategorySelect(0, foodCategoryTrees != null && foodCategoryTrees.size() > 0);
setSecondCategoryShowState
(
View
.
VISIBLE
);
setSecondCategoryShowState
(
View
.
VISIBLE
);
}
}
...
@@ -663,6 +634,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -663,6 +634,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
return
;
return
;
}
}
}
}
fullRegister
.
showSuccess
();
if
(
adapter
==
null
)
{
if
(
adapter
==
null
)
{
adapter
=
new
BuyIngredientsAdapter
(
requireContext
(),
buyIngredientsBeans
,
pageType
);
adapter
=
new
BuyIngredientsAdapter
(
requireContext
(),
buyIngredientsBeans
,
pageType
);
rvFoodIngredients
.
setAdapter
(
adapter
);
rvFoodIngredients
.
setAdapter
(
adapter
);
...
@@ -723,6 +695,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -723,6 +695,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
endIndex
+=
startIndex
;
endIndex
+=
startIndex
;
Log
.
e
(
"eee"
,
"開始:"
+
startIndex
+
"結束:"
+
endIndex
);
Log
.
e
(
"eee"
,
"開始:"
+
startIndex
+
"結束:"
+
endIndex
);
adapter
.
addData
(
addToHead
?
0
:
adapter
.
getData
().
size
(),
buyIngredientsBeans
,
startIndex
,
endIndex
);
adapter
.
addData
(
addToHead
?
0
:
adapter
.
getData
().
size
(),
buyIngredientsBeans
,
startIndex
,
endIndex
);
// adapter.setList(buyIngredientsBeans);
}
}
}
}
}
}
...
@@ -773,13 +746,14 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -773,13 +746,14 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
private
void
setTvShoppingCartNum
(
int
num
)
{
private
void
setTvShoppingCartNum
(
int
num
)
{
//食材管理頁面,這個tvShoppingCart為空
//食材管理頁面,這個tvShoppingCart為空
if
(
tvShoppingCart
!=
null
)
{
if
(
tvShoppingCart
!=
null
)
{
tvShoppingCart
.
setText
(
String
.
valueOf
(
shoppingCartN
um
));
tvShoppingCart
.
setText
(
String
.
valueOf
(
n
um
));
if
(
num
>
0
)
{
if
(
num
>
0
)
{
tvShoppingCart
.
setVisibility
(
View
.
VISIBLE
);
tvShoppingCart
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
}
else
{
tvShoppingCart
.
setVisibility
(
View
.
GONE
);
tvShoppingCart
.
setVisibility
(
View
.
GONE
);
}
}
}
}
shoppingCartNum
=
num
;
}
}
private
void
setRefreshState
(
boolean
noMoreData
)
{
private
void
setRefreshState
(
boolean
noMoreData
)
{
...
@@ -819,16 +793,20 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
...
@@ -819,16 +793,20 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
private
void
refreshAllData
()
{
private
void
refreshAllData
()
{
//之前去到購物車頁面,現在回到這個頁面
//之前去到購物車頁面,現在回到這個頁面
//購物車食材數量發生了變化,需要刷新當前頁面的食材數量
mPresenter
.
tranShoppingCartToCache
();
//如果修改了供應商和分類信息,可以清除掉緩存再獲取,就能刷新頁面
//如果修改了供應商和分類信息,可以清除掉緩存再獲取,就能刷新頁面
//購物車食材數量發生了變化,需要刷新當前頁面的食材數量
setTvShoppingCartNum
(
mPresenter
.
statisticsFoodQuantity
());
mPresenter
.
clearShowFoods
();
mPresenter
.
clearShowFoods
();
mPresenter
.
clearCategoryFoods
();
mPresenter
.
clearCategoryFoods
();
mPresenter
.
clearSupplierFoods
();
mPresenter
.
clearSupplierFoods
();
mPresenter
.
clearSupplierCache
();
mPresenter
.
clearSupplierCache
();
mPresenter
.
clearCategoryTreesCache
();
mPresenter
.
clearCategoryTreesCache
();
if
(
isShowSupplier
)
{
if
(
isShowSupplier
)
{
mPresenter
.
loadFoodIngredientsData
(-
1
,
true
);
if
(
pageType
==
GET_FOOD_BY_SUPPLIER
)
{
mPresenter
.
getFoodsBySupplier
(
0
,
firstLevelCategoryAdapter
.
getItem
(
0
),
false
,
true
);
}
else
{
mPresenter
.
loadFoodIngredientsData
(-
1
,
true
);
}
}
else
{
}
else
{
mPresenter
.
getCategoryTrees
();
mPresenter
.
getCategoryTrees
();
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/NewFoodIngredientsFragment.java
View file @
13ff529e
...
@@ -142,7 +142,7 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
...
@@ -142,7 +142,7 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
purchaseFoodBean
=
(
PurchaseFoodBean
)
arguments
.
getSerializable
(
FOOD_INFO_KEY
);
purchaseFoodBean
=
(
PurchaseFoodBean
)
arguments
.
getSerializable
(
FOOD_INFO_KEY
);
if
(
purchaseFoodBean
==
null
)
{
if
(
purchaseFoodBean
==
null
)
{
isUpdate
=
false
;
isUpdate
=
false
;
initTopBar
(
topbarNewFoodIngredients
,
"新增食材"
);
initTopBar
(
topbarNewFoodIngredients
,
getString
(
R
.
string
.
str_new_add_ingredients
)
);
purchaseFoodBean
=
new
PurchaseFoodBean
();
purchaseFoodBean
=
new
PurchaseFoodBean
();
purchaseFoodBean
.
setFoodMarkSn
(-
1
);
purchaseFoodBean
.
setFoodMarkSn
(-
1
);
//拿到分類集合
//拿到分類集合
...
@@ -303,9 +303,7 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
...
@@ -303,9 +303,7 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
public
boolean
onBackPressedSupport
()
{
public
boolean
onBackPressedSupport
()
{
if
(
mPresenter
.
isUpdate
(
infoMultiAdapter
.
getData
())
&&
!
isLeave
)
{
if
(
mPresenter
.
isUpdate
(
infoMultiAdapter
.
getData
())
&&
!
isLeave
)
{
//用戶修改了數據,提示是否保存
//用戶修改了數據,提示是否保存
AppDialog
.
getInstance
().
showTipDialog
(
requireContext
(),
getString
(
R
.
string
.
str_about_to_leave
),
getString
(
R
.
string
.
str_yes
),
getString
(
R
.
string
.
str_no
),
(
view
,
dialog
)
->
{
AppDialog
.
getInstance
().
showTipDialog
(
requireContext
(),
getString
(
R
.
string
.
str_about_to_leave
),
getString
(
R
.
string
.
str_yes
),
getString
(
R
.
string
.
str_no
),
this
::
saveGoodsInfo
,
()
->
{
saveGoodsInfo
();
},
(
view
,
dialog
)
->
{
isLeave
=
true
;
isLeave
=
true
;
killMyself
();
killMyself
();
});
});
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/OrderDetailsFragment.java
View file @
13ff529e
...
@@ -32,6 +32,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
...
@@ -32,6 +32,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import
com.gingersoft.gsa.cloud.common.utils.CollectionUtils
;
import
com.gingersoft.gsa.cloud.common.utils.CollectionUtils
;
import
com.gingersoft.gsa.cloud.common.utils.FileUtils
;
import
com.gingersoft.gsa.cloud.common.utils.FileUtils
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.glide.GlideUtils
;
import
com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils
;
import
com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
...
@@ -60,7 +61,6 @@ import com.gingersoft.supply_chain.mvp.utils.ViewUtils;
...
@@ -60,7 +61,6 @@ import com.gingersoft.supply_chain.mvp.utils.ViewUtils;
import
com.google.android.material.checkbox.MaterialCheckBox
;
import
com.google.android.material.checkbox.MaterialCheckBox
;
import
com.google.android.material.textfield.TextInputLayout
;
import
com.google.android.material.textfield.TextInputLayout
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.lxj.xpopup.XPopup
;
import
com.lxj.xpopup.XPopup
;
import
com.lxj.xpopup.enums.PopupPosition
;
import
com.lxj.xpopup.enums.PopupPosition
;
import
com.lxj.xpopup.interfaces.OnSelectListener
;
import
com.lxj.xpopup.interfaces.OnSelectListener
;
...
@@ -71,6 +71,7 @@ import com.yalantis.ucrop.UCrop;
...
@@ -71,6 +71,7 @@ import com.yalantis.ucrop.UCrop;
import
java.io.File
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
...
@@ -176,7 +177,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
...
@@ -176,7 +177,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
tvOrderDetailsReceipt
.
setVisibility
(
isShow
);
tvOrderDetailsReceipt
.
setVisibility
(
isShow
);
mPresenter
.
getOrderDetailsById
(
orderId
);
mPresenter
.
getOrderDetailsById
(
orderId
);
}
else
{
}
else
{
showMessage
(
"未獲取到訂單編號,請重試"
);
showMessage
(
"未獲取到訂單編號,請
退出
重試"
);
killMyself
();
killMyself
();
}
}
}
}
...
@@ -233,7 +234,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
...
@@ -233,7 +234,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
for
(
PurchaseOrderDetailsBean
.
PurchaseOrderDetailsInfoVosBean
data
:
orderDetailsFoodAdapter
.
getData
())
{
for
(
PurchaseOrderDetailsBean
.
PurchaseOrderDetailsInfoVosBean
data
:
orderDetailsFoodAdapter
.
getData
())
{
//只要有一個是選中的,就不循環了,開始收貨
//只要有一個是選中的,就不循環了,開始收貨
if
(
data
.
isChecked
())
{
if
(
data
.
isChecked
())
{
AppDialog
.
getInstance
().
showTipDialog
(
requireContext
(),
getString
(
R
.
string
.
str_confirm_receipt
),
(
view
,
dialog
)
->
{
AppDialog
.
getInstance
().
showTipDialog
(
requireContext
(),
getString
(
R
.
string
.
str_confirm_receipt
),
()
->
{
mPresenter
.
addWarehouse
(
state
,
edRemark
.
getText
()
+
""
,
totalAmount
,
orderDetailsFoodAdapter
.
getData
());
mPresenter
.
addWarehouse
(
state
,
edRemark
.
getText
()
+
""
,
totalAmount
,
orderDetailsFoodAdapter
.
getData
());
setFragmentResult
(
RESULT_OK
,
null
);
setFragmentResult
(
RESULT_OK
,
null
);
});
});
...
@@ -251,7 +252,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
...
@@ -251,7 +252,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
}
else
if
(
position
==
1
)
{
}
else
if
(
position
==
1
)
{
//刪除訂單
//刪除訂單
if
(
orderDetailsFoodAdapter
!=
null
&&
!
mPresenter
.
allWaitReceived
(
orderDetailsFoodAdapter
.
getData
()))
{
if
(
orderDetailsFoodAdapter
!=
null
&&
!
mPresenter
.
allWaitReceived
(
orderDetailsFoodAdapter
.
getData
()))
{
showMessage
(
"有已收
货食材,不可删除订单
"
);
showMessage
(
"有已收
貨食材,訂單不可刪除
"
);
return
;
return
;
}
}
AppDialog
.
getInstance
().
showWaringDialog
(
mContext
,
"是否刪除訂單"
,
(
view1
,
dialog
)
->
mPresenter
.
deleteOrder
());
AppDialog
.
getInstance
().
showWaringDialog
(
mContext
,
"是否刪除訂單"
,
(
view1
,
dialog
)
->
mPresenter
.
deleteOrder
());
...
@@ -390,8 +391,9 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
...
@@ -390,8 +391,9 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
@Override
@Override
public
void
nextFood
()
{
public
void
nextFood
()
{
currentFoodIndex
++;
hideSoftInput
();
checkAllForEach
();
// currentFoodIndex++;
// checkAllForEach();
}
}
@Override
@Override
...
@@ -406,15 +408,12 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
...
@@ -406,15 +408,12 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
mPresenter
.
deletePic
(
position
);
mPresenter
.
deletePic
(
position
);
}
else
if
(
view
.
getId
()
==
R
.
id
.
iv_img
)
{
}
else
if
(
view
.
getId
()
==
R
.
id
.
iv_img
)
{
//預覽大圖
//預覽大圖
String
pic
=
mPresenter
.
getPic
(
position
);
new
XPopup
.
Builder
(
requireContext
())
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
pic
))
{
.
isDestroyOnDismiss
(
true
)
new
XPopup
.
Builder
(
requireContext
())
.
isDarkTheme
(
false
)
.
isDestroyOnDismiss
(
true
)
.
enableDrag
(
false
)
.
isDarkTheme
(
true
)
.
asImageViewer
((
ImageView
)
view
,
position
,
mPresenter
.
getImgs
(),
false
,
false
,
Color
.
parseColor
(
"#f1f1f1"
),
-
1
,
-
1
,
false
,
Color
.
parseColor
(
"#f0f0f0"
),
null
,
new
ImageLoader
())
.
enableDrag
(
false
)
.
show
();
.
asImageViewer
((
ImageView
)
view
,
pic
,
true
,
Color
.
parseColor
(
"#f1f1f1"
),
-
1
,
-
1
,
false
,
-
1
,
new
ImageLoader
())
.
show
();
}
}
}
});
});
}
}
...
@@ -591,69 +590,69 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
...
@@ -591,69 +590,69 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
}
}
}
}
}
}
})
});
// .setMinCodeSize((int) infoVosBean.getShowUnit().getDeputyValue())
scanSnPopup
.
setOnScanResultListener
((
popup
,
scanResult
)
->
{
.
setOnScanResultListener
((
popup
,
scanResult
)
->
{
//當前食材infoVosBean裡面有個sn碼集合,將scanResult添加進去
//當前食材infoVosBean裡面有個sn碼集合,將scanResult添加進去
if
(
scanResult
!=
null
&&
scanResult
.
size
()
>
0
)
{
if
(
scanResult
!=
null
&&
scanResult
.
size
()
>
0
)
{
//过滤出新增的
//过滤出新增的
List
<
PurchaseFoodEncodeSn
>
newAddSnCodes
=
new
ArrayList
<>(
scanResult
.
size
());
List
<
PurchaseFoodEncodeSn
>
newAddSnCodes
=
new
ArrayList
<>(
scanResult
.
size
());
for
(
PurchaseFoodEncodeSn
purchaseFoodEncodeSn
:
scanResult
)
{
for
(
PurchaseFoodEncodeSn
purchaseFoodEncodeSn
:
scanResult
)
{
if
(
foodEncodeSns
==
null
||
(
purchaseFoodEncodeSn
.
newAdd
&&
!
foodEncodeSns
.
contains
(
purchaseFoodEncodeSn
)))
{
if
(
foodEncodeSns
==
null
||
(
purchaseFoodEncodeSn
.
newAdd
&&
!
foodEncodeSns
.
contains
(
purchaseFoodEncodeSn
)))
{
//判斷這個snCode是不是已經收過貨了,沒收過貨,新增的就為true
//判斷這個snCode是不是已經收過貨了,沒收過貨,新增的就為true
PurchaseFoodEncodeSn
newSnCodeBean
=
new
PurchaseFoodEncodeSn
();
PurchaseFoodEncodeSn
newSnCodeBean
=
new
PurchaseFoodEncodeSn
();
newSnCodeBean
.
setEncodeFoodNo
(
infoVosBean
.
getFoodNo
());
newSnCodeBean
.
setEncodeFoodNo
(
infoVosBean
.
getFoodNo
());
newSnCodeBean
.
setEncodeOrderNo
(
infoVosBean
.
getOrderNo
());
newSnCodeBean
.
setEncodeOrderNo
(
infoVosBean
.
getOrderNo
());
newSnCodeBean
.
setEncodeSnNo
(
purchaseFoodEncodeSn
.
getEncodeSnNo
());
newSnCodeBean
.
setEncodeSnNo
(
purchaseFoodEncodeSn
.
getEncodeSnNo
());
newSnCodeBean
.
newAdd
=
true
;
newSnCodeBean
.
newAdd
=
true
;
newAddSnCodes
.
add
(
newSnCodeBean
);
newAddSnCodes
.
add
(
newSnCodeBean
);
}
}
}
}
if
(
CollectionUtils
.
isNotNullOrEmpty
(
foodEncodeSns
))
{
if
(
CollectionUtils
.
isNotNullOrEmpty
(
foodEncodeSns
))
{
//扫描完后的所有sn和之前的sn比较,如果之前的sn没了,说明删除了,就从食品对象中移除掉
//扫描完后的所有sn和之前的sn比较,如果之前的sn没了,说明删除了,就从食品对象中移除掉
Iterator
<
PurchaseFoodEncodeSn
>
iterator
=
foodEncodeSns
.
iterator
();
Iterator
<
PurchaseFoodEncodeSn
>
iterator
=
foodEncodeSns
.
iterator
();
while
(
iterator
.
hasNext
())
{
while
(
iterator
.
hasNext
())
{
PurchaseFoodEncodeSn
next
=
iterator
.
next
();
PurchaseFoodEncodeSn
next
=
iterator
.
next
();
if
(!
scanResult
.
contains
(
next
))
{
if
(!
scanResult
.
contains
(
next
))
{
//将不存在的移除掉
//将不存在的移除掉
iterator
.
remove
();
iterator
.
remove
();
}
}
}
//添加到食品中去
if
(
foodEncodeSns
!=
null
)
{
foodEncodeSns
.
addAll
(
newAddSnCodes
);
}
else
{
infoVosBean
.
setPurchaseFoodEncodeSns
(
newAddSnCodes
);
}
int
newAddSize
=
0
;
//在這裡遍歷,防止用戶多次添加,卻沒有點擊收貨
for
(
PurchaseFoodEncodeSn
purchaseFoodEncodeSn
:
infoVosBean
.
getPurchaseFoodEncodeSns
())
{
if
(
purchaseFoodEncodeSn
.
newAdd
)
{
newAddSize
++;
}
}
}
//本次收貨數量=新增掃sn碼數量
DeputyUnitBean
showUnit
=
infoVosBean
.
getShowUnit
();
// if (newAddSize != showUnit.getDeputyValue()) {
// showMessage("新增SN数量必须和入库数一致");
// return;
// }
showUnit
.
setDeputyValue
(
newAddSize
);
setFoodCheckState
(
orderDetailsFoodAdapter
,
position
,
infoVosBean
);
popup
.
dismiss
();
}
else
{
showMessage
(
"請掃描食材sn碼"
);
}
}
});
}
//添加到食品中去
if
(
foodEncodeSns
!=
null
)
{
foodEncodeSns
.
addAll
(
newAddSnCodes
);
}
else
{
infoVosBean
.
setPurchaseFoodEncodeSns
(
newAddSnCodes
);
}
int
newAddSize
=
0
;
//在這裡遍歷,防止用戶多次添加,卻沒有點擊收貨
for
(
PurchaseFoodEncodeSn
purchaseFoodEncodeSn
:
infoVosBean
.
getPurchaseFoodEncodeSns
())
{
if
(
purchaseFoodEncodeSn
.
newAdd
)
{
newAddSize
++;
}
}
//本次收貨數量=新增掃sn碼數量
DeputyUnitBean
showUnit
=
infoVosBean
.
getShowUnit
();
showUnit
.
setDeputyValue
(
newAddSize
);
if
(
newAddSize
>
0
)
{
setFoodCheckState
(
orderDetailsFoodAdapter
,
position
,
infoVosBean
);
}
else
{
showMessage
(
"收貨數量必須大於0"
);
}
scanSnPopup
.
dismissOrHideSoftInput
();
if
(!
scanSnPopup
.
isDismiss
())
{
scanSnPopup
.
dismiss
();
}
}
else
{
showMessage
(
"請掃描食材sn碼"
);
}
});
new
XPopup
.
Builder
(
requireContext
())
new
XPopup
.
Builder
(
requireContext
())
.
hasShadowBg
(
false
)
.
asCustom
(
scanSnPopup
)
.
asCustom
(
scanSnPopup
)
.
show
();
.
show
();
if
(!
singerFood
)
{
//
if (!singerFood) {
scanSnPopup
.
setOnDismissListener
(
this
::
nextFood
);
//
scanSnPopup.setOnDismissListener(this::nextFood);
}
//
}
}
}
/**
/**
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/ShoppingCatFragment.java
View file @
13ff529e
...
@@ -118,9 +118,7 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
...
@@ -118,9 +118,7 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
if
(
viewId
==
R
.
id
.
tv_order_content_complete
)
{
if
(
viewId
==
R
.
id
.
tv_order_content_complete
)
{
//完成,篩選出選擇的食品
//完成,篩選出選擇的食品
if
(
mPresenter
.
filterData
(
shoppingCartAdapter
.
getData
()))
{
if
(
mPresenter
.
filterData
(
shoppingCartAdapter
.
getData
()))
{
AppDialog
.
getInstance
().
showTipDialog
(
requireContext
(),
"確認創建訂單?"
,
(
view
,
dialog
)
->
{
AppDialog
.
getInstance
().
showTipDialog
(
requireContext
(),
"確認創建訂單?"
,
()
->
mPresenter
.
createOrder
(
shoppingCartAdapter
.
getData
()));
mPresenter
.
createOrder
(
shoppingCartAdapter
.
getData
());
});
}
}
}
else
if
(
viewId
==
R
.
id
.
btn_order_content_order_template
)
{
}
else
if
(
viewId
==
R
.
id
.
btn_order_content_order_template
)
{
//訂單模板
//訂單模板
...
@@ -139,7 +137,7 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
...
@@ -139,7 +137,7 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
shoppingCartAdapter
=
new
ShoppingCartAdapter
(
mContext
,
shoppingCartBeans
);
shoppingCartAdapter
=
new
ShoppingCartAdapter
(
mContext
,
shoppingCartBeans
);
shoppingCartAdapter
.
setOnFoodDeleteListener
((
supplierIndex
,
foodListVosBean
)
->
{
shoppingCartAdapter
.
setOnFoodDeleteListener
((
supplierIndex
,
foodListVosBean
)
->
{
//從購物車元數據移除掉這個食材
//從購物車元數據移除掉這個食材
SupplyShoppingCart
.
getInstance
().
getCartFoods
().
remove
(
foodListVosBean
);
SupplyShoppingCart
.
getInstance
().
removeFood
(
foodListVosBean
);
List
<
ShoppingCartBean
>
shoppingCartAdapterData
=
shoppingCartAdapter
.
getData
();
List
<
ShoppingCartBean
>
shoppingCartAdapterData
=
shoppingCartAdapter
.
getData
();
//購物車adapter移除這個供應商
//購物車adapter移除這個供應商
if
(
shoppingCartAdapterData
.
get
(
supplierIndex
).
getFoodList
().
size
()
<=
0
)
{
if
(
shoppingCartAdapterData
.
get
(
supplierIndex
).
getFoodList
().
size
()
<=
0
)
{
...
@@ -154,6 +152,9 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
...
@@ -154,6 +152,9 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
setAllSelect
(
shoppingCartAdapterData
);
setAllSelect
(
shoppingCartAdapterData
);
mPresenter
.
verificationMixAmount
(
shoppingCartAdapter
.
getData
());
mPresenter
.
verificationMixAmount
(
shoppingCartAdapter
.
getData
());
setFragmentResult
(
RESULT_OK
,
null
);
setFragmentResult
(
RESULT_OK
,
null
);
if
(
shoppingCartAdapter
.
getItemCount
()
<=
0
)
{
killMyself
();
}
});
});
rvOrderContent
.
setAdapter
(
shoppingCartAdapter
);
rvOrderContent
.
setAdapter
(
shoppingCartAdapter
);
setAllSelect
(
shoppingCartBeans
);
setAllSelect
(
shoppingCartBeans
);
...
@@ -193,6 +194,8 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
...
@@ -193,6 +194,8 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
@Override
@Override
public
void
addOrderSuccess
(
List
<
ConfirmOrderBean
.
PurchaseOrder
>
purchaseOrders
)
{
public
void
addOrderSuccess
(
List
<
ConfirmOrderBean
.
PurchaseOrder
>
purchaseOrders
)
{
setFragmentResult
(
RESULT_OK
,
null
);
SupplyShoppingCart
.
getInstance
().
clear
();
startWithPop
(
SendMsgFragment
.
newInstance
(
purchaseOrders
));
startWithPop
(
SendMsgFragment
.
newInstance
(
purchaseOrders
));
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WareHouseListFragment.java
View file @
13ff529e
...
@@ -65,18 +65,8 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList
...
@@ -65,18 +65,8 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList
TextView
tvLowInventoryFoodNum
;
TextView
tvLowInventoryFoodNum
;
@BindView
(
R2
.
id
.
tv_ingredients_cost_inventory
)
@BindView
(
R2
.
id
.
tv_ingredients_cost_inventory
)
TextView
tvIngredientsCostInventory
;
TextView
tvIngredientsCostInventory
;
// @BindView(R2.id.rv_warehouse_list)
// RecyclerView rvWarehouseList;
@BindView
(
R2
.
id
.
table_ware_housing_list
)
@BindView
(
R2
.
id
.
table_ware_housing_list
)
TableView
mTableView
;
TableView
mTableView
;
// @BindView(R2.id.sl_warehousing_list)
// SmartRefreshLayout smartRefreshLayout;
// @BindView(R2.id.tv_warehouse_item_unit_price)
// TextView tvUnitPrice;
// @BindView(R2.id.tv_warehouse_item_inventory_quantity)
// TextView tvWarehousingQuantity;
// @BindView(R2.id.tv_warehouse_item_total_amount)
// TextView tvTotalAmount;
private
int
SORT_TYPE
=
0
;
private
int
SORT_TYPE
=
0
;
/**
/**
...
@@ -111,7 +101,6 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList
...
@@ -111,7 +101,6 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
// smartRefreshLayout.setPrimaryColorsId(R.color.trans, R.color.black);
initTopBar
(
supplyTopBar
,
"庫存查詢"
);
initTopBar
(
supplyTopBar
,
"庫存查詢"
);
loadService
=
LoadSir
.
getDefault
().
register
(
mTableView
);
loadService
=
LoadSir
.
getDefault
().
register
(
mTableView
);
getWarehousing
();
getWarehousing
();
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehouseDetailsFragment.java
View file @
13ff529e
...
@@ -546,10 +546,10 @@ public class WarehouseDetailsFragment extends BaseSupplyChainFragment<WarehouseD
...
@@ -546,10 +546,10 @@ public class WarehouseDetailsFragment extends BaseSupplyChainFragment<WarehouseD
if
(
inventoryConsumptionView
!=
null
)
{
if
(
inventoryConsumptionView
!=
null
)
{
if
(
scanSnView
!=
null
&&
scanSnView
.
getSnSize
()
>
0
)
{
if
(
scanSnView
!=
null
&&
scanSnView
.
getSnSize
()
>
0
)
{
//當前顯示著掃SN碼消耗,判斷有沒有SN碼,有的話提示是否保存
//當前顯示著掃SN碼消耗,判斷有沒有SN碼,有的話提示是否保存
AppDialog
.
getInstance
().
showTipDialog
(
requireContext
(),
getString
(
R
.
string
.
str_info_not_save_about_to_leave
),
(
view
,
dialog
)
->
{
AppDialog
.
getInstance
().
showTipDialog
(
requireContext
(),
getString
(
R
.
string
.
str_info_not_save_about_to_leave
),
()
->
{
isLeave
=
true
;
isLeave
=
true
;
showList
(
View
.
VISIBLE
);
showList
(
View
.
VISIBLE
);
},
(
view
,
dialog
)
->
isLeave
=
false
);
},
()
->
isLeave
=
false
);
}
else
{
}
else
{
showList
(
View
.
VISIBLE
);
showList
(
View
.
VISIBLE
);
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingInventoryFragment.java
View file @
13ff529e
...
@@ -3,7 +3,6 @@ package com.gingersoft.supply_chain.mvp.ui.fragment.warehouse;
...
@@ -3,7 +3,6 @@ package com.gingersoft.supply_chain.mvp.ui.fragment.warehouse;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.text.TextWatcher
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
...
@@ -18,28 +17,21 @@ import androidx.annotation.NonNull;
...
@@ -18,28 +17,21 @@ import androidx.annotation.NonNull;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.common.loadsir.EmptyCallback
;
import
com.gingersoft.gsa.cloud.common.loadsir.EmptyCallback
;
import
com.gingersoft.gsa.cloud.common.utils.CollectionUtils
;
import
com.gingersoft.gsa.cloud.common.utils.CollectionUtils
;
import
com.gingersoft.gsa.cloud.common.utils.XPermissionUtils
;
import
com.gingersoft.gsa.cloud.common.utils.glide.GlideUtils
;
import
com.gingersoft.gsa.cloud.common.utils.glide.GlideUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
;
import
com.gingersoft.gsa.cloud.component.ComponentName
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerWarehousingInventoryComponent
;
import
com.gingersoft.supply_chain.di.component.DaggerWarehousingInventoryComponent
;
import
com.gingersoft.supply_chain.mvp.bean.InventoryRecordBean
;
import
com.gingersoft.supply_chain.mvp.bean.InventoryRecordBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodEncodeSn
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseWarehousingOrderDetailsVO
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseWarehousingOrderDetailsVO
;
import
com.gingersoft.supply_chain.mvp.contract.WarehousingInventoryContract
;
import
com.gingersoft.supply_chain.mvp.contract.WarehousingInventoryContract
;
import
com.gingersoft.supply_chain.mvp.presenter.WarehousingInventoryPresenter
;
import
com.gingersoft.supply_chain.mvp.presenter.WarehousingInventoryPresenter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.InventoryRecordAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.InventoryRecordAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment
;
import
com.gingersoft.supply_chain.mvp.ui.widget.ScanSnPopup
;
import
com.gingersoft.supply_chain.mvp.ui.widget.ScanSnView
;
import
com.gingersoft.supply_chain.mvp.ui.widget.ScanSnView
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.kingja.loadsir.LoadSirUtil
;
import
com.kingja.loadsir.callback.Callback
;
import
com.kingja.loadsir.callback.Callback
;
import
com.kingja.loadsir.core.LoadSir
;
import
com.kingja.loadsir.core.LoadSir
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
...
@@ -49,8 +41,6 @@ import com.scwang.smartrefresh.layout.SmartRefreshLayout;
...
@@ -49,8 +41,6 @@ import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import
java.util.List
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
cn.bingoogolapple.qrcode.core.BarcodeType
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
.
PurchaseFoodBean
.
HAS_SN
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
.
PurchaseFoodBean
.
HAS_SN
;
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingOrderListFragment.java
0 → 100644
View file @
13ff529e
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
warehouse
;
import
android.os.Bundle
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment
;
import
com.jess.arms.di.component.AppComponent
;
import
com.gingersoft.supply_chain.di.component.DaggerWarehousingOrderListComponent
;
import
com.gingersoft.supply_chain.mvp.contract.WarehousingOrderListContract
;
import
com.gingersoft.supply_chain.mvp.presenter.WarehousingOrderListPresenter
;
import
com.gingersoft.supply_chain.R
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 04/28/2021 19:21
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public
class
WarehousingOrderListFragment
extends
BaseSupplyChainFragment
<
WarehousingOrderListPresenter
>
implements
WarehousingOrderListContract
.
View
{
public
static
WarehousingOrderListFragment
newInstance
()
{
WarehousingOrderListFragment
fragment
=
new
WarehousingOrderListFragment
();
return
fragment
;
}
@Override
public
void
setupFragmentComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerWarehousingOrderListComponent
//如找不到该类,请编译一下项目
.
builder
()
.
appComponent
(
appComponent
)
.
view
(
this
)
.
build
()
.
inject
(
this
);
}
@Override
public
View
initView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
return
inflater
.
inflate
(
R
.
layout
.
fragment_warehousing_list
,
container
,
false
);
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/InventoryConsumptionView.java
View file @
13ff529e
...
@@ -126,10 +126,12 @@ public class InventoryConsumptionView extends FrameLayout {
...
@@ -126,10 +126,12 @@ public class InventoryConsumptionView extends FrameLayout {
edInput
.
setEnabled
(
enabled
);
edInput
.
setEnabled
(
enabled
);
return
this
;
return
this
;
}
}
public
InventoryConsumptionView
setHint
(
String
hint
)
{
public
InventoryConsumptionView
setHint
(
String
hint
)
{
edInput
.
setHint
(
hint
);
edInput
.
setHint
(
hint
);
return
this
;
return
this
;
}
}
public
InventoryConsumptionView
setOnConfirmClickListener
(
OnConfirmClickListener
onConfirmClickListener
)
{
public
InventoryConsumptionView
setOnConfirmClickListener
(
OnConfirmClickListener
onConfirmClickListener
)
{
this
.
onConfirmClickListener
=
onConfirmClickListener
;
this
.
onConfirmClickListener
=
onConfirmClickListener
;
return
this
;
return
this
;
...
@@ -178,20 +180,24 @@ public class InventoryConsumptionView extends FrameLayout {
...
@@ -178,20 +180,24 @@ public class InventoryConsumptionView extends FrameLayout {
int
i
=
Integer
.
parseInt
(
s
);
int
i
=
Integer
.
parseInt
(
s
);
if
(
i
>
0
)
{
if
(
i
>
0
)
{
if
(
i
>
maxConsumption
)
{
if
(
i
>
maxConsumption
)
{
edInput
.
setError
(
"不能超過當前庫存數量:"
+
maxConsumption
);
String
errMsg
=
"不能超過當前庫存數量:"
+
maxConsumption
;
edInput
.
setError
(
errMsg
);
ToastUtils
.
show
(
getContext
(),
errMsg
);
return
-
1
;
return
-
1
;
}
else
{
}
else
{
return
i
;
return
i
;
}
}
}
else
{
}
else
{
ToastUtils
.
show
(
getContext
(),
"請輸入消耗庫存數"
);
String
errMsg
=
"請輸入消耗庫存數"
;
edInput
.
setError
(
"請輸入消耗庫存數"
);
ToastUtils
.
show
(
getContext
(),
errMsg
);
edInput
.
setError
(
errMsg
);
return
-
1
;
return
-
1
;
}
}
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
ToastUtils
.
show
(
getContext
(),
"請輸入消耗庫存數"
);
String
errMsg
=
"請輸入消耗庫存數"
;
edInput
.
setError
(
"請輸入消耗庫存數"
);
ToastUtils
.
show
(
getContext
(),
errMsg
);
edInput
.
setError
(
errMsg
);
return
-
1
;
return
-
1
;
}
}
}
}
...
@@ -211,6 +217,7 @@ public class InventoryConsumptionView extends FrameLayout {
...
@@ -211,6 +217,7 @@ public class InventoryConsumptionView extends FrameLayout {
}
}
public
void
setConsumptionNumber
(
int
consumptionNumber
)
{
public
void
setConsumptionNumber
(
int
consumptionNumber
)
{
edInput
.
setError
(
null
);
edInput
.
setText
(
String
.
valueOf
(
consumptionNumber
));
edInput
.
setText
(
String
.
valueOf
(
consumptionNumber
));
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ScanSnPopup.java
View file @
13ff529e
...
@@ -13,6 +13,7 @@ import com.gingersoft.supply_chain.R2;
...
@@ -13,6 +13,7 @@ import com.gingersoft.supply_chain.R2;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodEncodeSn
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodEncodeSn
;
import
com.jess.arms.utils.DeviceUtils
;
import
com.jess.arms.utils.DeviceUtils
;
import
com.lxj.xpopup.core.BottomPopupView
;
import
com.lxj.xpopup.core.BottomPopupView
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -84,12 +85,16 @@ public class ScanSnPopup extends BottomPopupView {
...
@@ -84,12 +85,16 @@ public class ScanSnPopup extends BottomPopupView {
rootLayout
.
addView
(
new
ScanSnView
(
fragment
,
snCodes
)
rootLayout
.
addView
(
new
ScanSnView
(
fragment
,
snCodes
)
.
setOnScanResultListener
((
popup
,
scanResult
)
->
onScanResultListener
.
onScanResult
(
ScanSnPopup
.
this
,
scanResult
))
.
setOnScanResultListener
((
popup
,
scanResult
)
->
onScanResultListener
.
onScanResult
(
ScanSnPopup
.
this
,
scanResult
))
.
setOnDeleteSnCodeListener
(
onDeleteListener
)
.
setOnDeleteSnCodeListener
(
onDeleteListener
)
.
setOnCancelListener
(
this
::
dismiss
)
.
setMinCodeSize
(
minCodeSize
)
.
setMinCodeSize
(
minCodeSize
)
.
setMaxCodeSize
(
maxCodeSize
)
.
setMaxCodeSize
(
maxCodeSize
)
.
setOnSingerResultListener
((
isAdd
,
snCode
,
currentSnCodeNumber
)
->
{
.
setOnSingerResultListener
((
isAdd
,
snCode
,
currentSnCodeNumber
)
->
{
//每掃描出一個調用
//每掃描出一個調用
tvFoodInboundQuantity
.
setText
(
String
.
valueOf
(
currentSnCodeNumber
));
tvFoodInboundQuantity
.
setText
(
String
.
valueOf
(
currentSnCodeNumber
));
}).
setOnCancelListener
(()
->
{
dismissOrHideSoftInput
();
if
(!
isDismiss
())
{
dismiss
();
}
}).
init
()
}).
init
()
,
new
LinearLayout
.
LayoutParams
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
,
LinearLayout
.
LayoutParams
.
MATCH_PARENT
));
,
new
LinearLayout
.
LayoutParams
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
,
LinearLayout
.
LayoutParams
.
MATCH_PARENT
));
}
else
{
}
else
{
...
@@ -108,15 +113,10 @@ public class ScanSnPopup extends BottomPopupView {
...
@@ -108,15 +113,10 @@ public class ScanSnPopup extends BottomPopupView {
}
}
@Override
@Override
protected
int
get
Max
Height
()
{
protected
int
get
Popup
Height
()
{
return
(
int
)
(
DeviceUtils
.
getScreenHeight
(
getContext
())
/
2
)
;
return
QMUIDisplayHelper
.
getScreenHeight
(
getContext
())
/
2
;
}
}
// @Override
// protected int getPopupHeight() {
// return (int) (DeviceUtils.getScreenHeight(getContext()) / 2);
// }
public
interface
OnScanResultListener
{
public
interface
OnScanResultListener
{
/**
/**
* 掃完碼確認之後回調
* 掃完碼確認之後回調
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ScanSnView.java
View file @
13ff529e
...
@@ -7,6 +7,7 @@ import android.view.View;
...
@@ -7,6 +7,7 @@ import android.view.View;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.EditorInfo
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.FrameLayout
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -186,8 +187,7 @@ public class ScanSnView extends FrameLayout {
...
@@ -186,8 +187,7 @@ public class ScanSnView extends FrameLayout {
btnFoodIngredientsCancel
.
setOnClickListener
(
v
->
{
btnFoodIngredientsCancel
.
setOnClickListener
(
v
->
{
if
(
adapter
.
getData
().
size
()
!=
initCodeSize
)
{
if
(
adapter
.
getData
().
size
()
!=
initCodeSize
)
{
AppDialog
.
getInstance
().
showWaringDialog
(
getContext
(),
"關閉後不會保存SN碼記錄"
,
(
view
,
dialog
)
->
{
AppDialog
.
getInstance
().
showTipDialog
(
getContext
(),
"關閉後不會保存SN碼記錄"
,
()
->
{
dialog
.
dismiss
();
if
(
onCancelListener
!=
null
)
{
if
(
onCancelListener
!=
null
)
{
onCancelListener
.
onCancel
();
onCancelListener
.
onCancel
();
}
}
...
@@ -198,15 +198,19 @@ public class ScanSnView extends FrameLayout {
...
@@ -198,15 +198,19 @@ public class ScanSnView extends FrameLayout {
});
});
adapter
.
setOnItemChildClickListener
((
adapter1
,
view
,
position
)
->
{
adapter
.
setOnItemChildClickListener
((
adapter1
,
view
,
position
)
->
{
if
(
view
.
getId
()
==
R
.
id
.
iv_sn_code_delete
)
{
if
(
view
.
getId
()
==
R
.
id
.
iv_sn_code_delete
)
{
onSingerResultListener
.
onScanValue
(
false
,
adapter
.
getItem
(
position
),
adapter
.
getItemCount
());
if
(
onDeleteSnCodeListener
!=
null
)
{
onDeleteSnCodeListener
.
onDelete
(
adapter
.
getItem
(
position
),
position
);
}
if
(
adapter
.
getItem
(
position
).
newAdd
)
{
if
(
adapter
.
getItem
(
position
).
newAdd
)
{
newCodeSize
--;
onSingerResultListener
.
onScanValue
(
false
,
adapter
.
getItem
(
position
),
adapter
.
getItemCount
());
if
(
onDeleteSnCodeListener
!=
null
)
{
onDeleteSnCodeListener
.
onDelete
(
adapter
.
getItem
(
position
),
position
);
}
if
(
adapter
.
getItem
(
position
).
newAdd
)
{
newCodeSize
--;
}
adapter1
.
removeAt
(
position
);
setConfirmBtnState
();
}
else
{
ToastUtils
.
show
(
getContext
(),
"已入庫的SN碼不可刪除"
);
}
}
adapter1
.
removeAt
(
position
);
setConfirmBtnState
();
}
}
});
});
addView
(
rootView
);
addView
(
rootView
);
...
@@ -271,7 +275,7 @@ public class ScanSnView extends FrameLayout {
...
@@ -271,7 +275,7 @@ public class ScanSnView extends FrameLayout {
private
void
addSnCode
(
SnCodeAdapter
adapter
,
String
snCode
)
{
private
void
addSnCode
(
SnCodeAdapter
adapter
,
String
snCode
)
{
PurchaseFoodEncodeSn
purchaseFoodEncodeSn
=
new
PurchaseFoodEncodeSn
(
snCode
);
PurchaseFoodEncodeSn
purchaseFoodEncodeSn
=
new
PurchaseFoodEncodeSn
(
snCode
);
purchaseFoodEncodeSn
.
newAdd
=
true
;
purchaseFoodEncodeSn
.
newAdd
=
true
;
adapter
.
addData
(
purchaseFoodEncodeSn
);
adapter
.
addData
(
0
,
purchaseFoodEncodeSn
);
newCodeSize
++;
newCodeSize
++;
edInputSn
.
setText
(
""
);
edInputSn
.
setText
(
""
);
setConfirmBtnState
();
setConfirmBtnState
();
...
@@ -362,6 +366,12 @@ public class ScanSnView extends FrameLayout {
...
@@ -362,6 +366,12 @@ public class ScanSnView extends FrameLayout {
viewHolder
.
setTextColor
(
R
.
id
.
tv_sn_code
,
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_3c
));
viewHolder
.
setTextColor
(
R
.
id
.
tv_sn_code
,
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_3c
));
viewHolder
.
setTextColor
(
R
.
id
.
tv_serial_number
,
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_3c
));
viewHolder
.
setTextColor
(
R
.
id
.
tv_serial_number
,
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_3c
));
viewHolder
.
setGone
(
R
.
id
.
iv_sn_code_delete
,
false
);
viewHolder
.
setGone
(
R
.
id
.
iv_sn_code_delete
,
false
);
ImageView
ivDelete
=
viewHolder
.
getView
(
R
.
id
.
iv_sn_code_delete
);
if
(
s
.
newAdd
)
{
ivDelete
.
clearColorFilter
();
}
else
{
ivDelete
.
setColorFilter
(
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_ccc
));
}
viewHolder
.
setGone
(
R
.
id
.
it_sn_code_operating
,
true
);
viewHolder
.
setGone
(
R
.
id
.
it_sn_code_operating
,
true
);
viewHolder
.
setText
(
R
.
id
.
tv_serial_number
,
String
.
valueOf
(
viewHolder
.
getAdapterPosition
()
+
1
));
viewHolder
.
setText
(
R
.
id
.
tv_serial_number
,
String
.
valueOf
(
viewHolder
.
getAdapterPosition
()
+
1
));
if
(
viewHolder
.
getAdapterPosition
()
%
2
==
0
)
{
if
(
viewHolder
.
getAdapterPosition
()
%
2
==
0
)
{
...
...
component-supply-chain/src/main/res/layout/fragment_order_content.xml
View file @
13ff529e
...
@@ -45,7 +45,8 @@
...
@@ -45,7 +45,8 @@
android:id=
"@+id/rv_order_content"
android:id=
"@+id/rv_order_content"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_5"
android:paddingBottom=
"@dimen/dp_5"
android:layout_weight=
"1"
android:layout_weight=
"1"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
...
...
component-supply-chain/src/main/res/layout/fragment_ware_house_list.xml
View file @
13ff529e
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_6"
android:layout_marginTop=
"@dimen/dp_6"
tools:text=
"100
"
/>
android:text=
"@string/str_zero
"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_6"
android:layout_marginTop=
"@dimen/dp_6"
tools:text=
"3
"
/>
android:text=
"@string/str_zero
"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_6"
android:layout_marginTop=
"@dimen/dp_6"
tools:text=
"7
"
/>
android:text=
"@string/str_zero
"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
@@ -148,8 +148,8 @@
...
@@ -148,8 +148,8 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_6"
android:layout_marginTop=
"@dimen/dp_6"
android:text
Color=
"@color/required_color
"
android:text
=
"@string/str_zero
"
tools:text=
"¥10000.00
"
/>
android:textColor=
"@color/required_color
"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
component-supply-chain/src/main/res/layout/fragment_warehouse_details.xml
View file @
13ff529e
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:animateLayoutChanges=
"true"
android:background=
"@color/supply_chain_bg_color"
android:background=
"@color/supply_chain_bg_color"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -163,6 +162,7 @@
...
@@ -163,6 +162,7 @@
android:id=
"@+id/vp_warehouse_viewpager"
android:id=
"@+id/vp_warehouse_viewpager"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:clipChildren=
"true"
android:layout_marginTop=
"@dimen/dp_10"
/>
android:layout_marginTop=
"@dimen/dp_10"
/>
</LinearLayout>
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
...
...
component-supply-chain/src/main/res/layout/fragment_warehousing_list.xml
0 → 100644
View file @
13ff529e
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<include
layout=
"@layout/supply_chain_top_bar"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_second_category"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
</LinearLayout>
\ No newline at end of file
component-supply-chain/src/main/res/layout/info_empty.xml
View file @
13ff529e
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_marginBottom=
"@dimen/head_height"
android:layout_marginBottom=
"@dimen/head_height"
android:drawableTop=
"@
mipmap/loadsir_empty
"
android:drawableTop=
"@
drawable/ic_not_have_goods
"
android:drawablePadding=
"@dimen/dp_10"
android:drawablePadding=
"@dimen/dp_10"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"@string/emptyView_mode_desc_double"
android:text=
"@string/emptyView_mode_desc_double"
...
...
component-supply-chain/src/main/res/layout/item_buy_food_ingredient_double_row.xml
View file @
13ff529e
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
style=
"@style/Food_Ingredient_Info_TextStyle"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"
1
"
android:layout_weight=
"
0.5
"
android:textSize=
"@dimen/dp_12"
android:textSize=
"@dimen/dp_12"
tools:text=
"3KG/盒"
/>
tools:text=
"3KG/盒"
/>
...
@@ -97,8 +97,18 @@
...
@@ -97,8 +97,18 @@
android:textSize=
"@dimen/dp_12"
android:textSize=
"@dimen/dp_12"
android:textStyle=
"bold"
android:textStyle=
"bold"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_food_item_price"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"end"
android:textColor=
"@color/required_color"
android:textStyle=
"bold"
tools:text=
"$100.00"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
@@ -109,16 +119,10 @@
...
@@ -109,16 +119,10 @@
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
<View
android:id=
"@+id/tv_food_item_price"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
/>
android:textColor=
"@color/required_color"
android:textStyle=
"bold"
tools:text=
"$100.00"
/>
<!-- <LinearLayout-->
<!-- <LinearLayout-->
<!-- android:id="@+id/layout_operation_food_num"-->
<!-- android:id="@+id/layout_operation_food_num"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_width="wrap_content"-->
...
@@ -132,8 +136,8 @@
...
@@ -132,8 +136,8 @@
android:layout_height=
"@dimen/dp_26"
android:layout_height=
"@dimen/dp_26"
android:layout_marginLeft=
"@dimen/dp_5"
android:layout_marginLeft=
"@dimen/dp_5"
android:layout_marginRight=
"@dimen/dp_5"
android:layout_marginRight=
"@dimen/dp_5"
android:src=
"@drawable/ic_blue_edit"
android:padding=
"@dimen/dp_3"
android:padding=
"@dimen/dp_3"
android:src=
"@drawable/ic_blue_edit"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
<ImageView
<ImageView
...
@@ -162,7 +166,7 @@
...
@@ -162,7 +166,7 @@
android:focusableInTouchMode=
"true"
android:focusableInTouchMode=
"true"
android:gravity=
"center"
android:gravity=
"center"
android:inputType=
"number"
android:inputType=
"number"
android:maxLength=
"
5
"
android:maxLength=
"
4
"
android:maxLines=
"1"
android:maxLines=
"1"
android:paddingLeft=
"@dimen/dp_4"
android:paddingLeft=
"@dimen/dp_4"
android:paddingRight=
"@dimen/dp_4"
android:paddingRight=
"@dimen/dp_4"
...
...
component-supply-chain/src/main/res/layout/item_order_details_food.xml
View file @
13ff529e
...
@@ -112,6 +112,8 @@
...
@@ -112,6 +112,8 @@
android:layout_marginLeft=
"@dimen/dp_9"
android:layout_marginLeft=
"@dimen/dp_9"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@drawable/shape_border_bg_c8"
android:background=
"@drawable/shape_border_bg_c8"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
...
@@ -147,6 +149,8 @@
...
@@ -147,6 +149,8 @@
android:layout_marginLeft=
"@dimen/dp_9"
android:layout_marginLeft=
"@dimen/dp_9"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@drawable/shape_border_bg_c8"
android:background=
"@drawable/shape_border_bg_c8"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
...
@@ -164,10 +168,10 @@
...
@@ -164,10 +168,10 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/dp_5"
android:layout_marginLeft=
"@dimen/dp_5"
android:background=
"@null"
android:background=
"@null"
android:paddingRight=
"@dimen/dp_10"
android:gravity=
"end|center_vertical"
android:gravity=
"end|center_vertical"
android:inputType=
"numberDecimal"
android:inputType=
"numberDecimal"
android:maxLines=
"1"
android:maxLines=
"1"
android:paddingRight=
"@dimen/dp_10"
android:textColor=
"@color/color_3c"
android:textColor=
"@color/color_3c"
android:textCursorDrawable=
"@drawable/cursor_theme"
android:textCursorDrawable=
"@drawable/cursor_theme"
android:textSize=
"@dimen/dp_15"
android:textSize=
"@dimen/dp_15"
...
...
component-supply-chain/src/main/res/layout/item_warehouse_details.xml
View file @
13ff529e
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
tools:text=
"肥牛天地供應商"
/>
tools:text=
"肥牛天地供應商"
/>
</LinearLayout>
</LinearLayout>
<
Linear
Layout
<
Relative
Layout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/dp_6"
android:layout_marginBottom=
"@dimen/dp_6"
...
@@ -99,36 +99,43 @@
...
@@ -99,36 +99,43 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"入庫日期:"
android:text=
"入庫日期:"
android:textColor=
"@color/color_3c"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/sp_16"
/>
android:textSize=
"@dimen/sp_16"
android:visibility=
"gone"
/>
<TextView
<TextView
android:id=
"@+id/tv_warehouse_details_time"
android:id=
"@+id/tv_warehouse_details_time"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toLeftOf=
"@id/tv_warehouse_details_reason"
android:layout_toRightOf=
"@id/tv_warehouse_time_text"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:textColor=
"@color/color_3c"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/sp_16"
android:textSize=
"@dimen/sp_16"
android:visibility=
"gone"
tools:text=
"2020-11-20"
/>
tools:text=
"2020-11-20"
/>
<TextView
<TextView
android:id=
"@+id/tv_warehouse_details_remarks"
android:id=
"@+id/tv_warehouse_details_remarks"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_toLeftOf=
"@id/tv_warehouse_details_reason"
android:paddingRight=
"@dimen/dp_5"
android:textColor=
"@color/color_3c"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/sp_14"
android:textSize=
"@dimen/sp_14"
android:visibility=
"
gon
e"
android:visibility=
"
visibl
e"
tools:text=
"備註:
是打飛機死垃圾分類三代機福利社利社的
"
/>
tools:text=
"備註:"
/>
<TextView
<TextView
android:id=
"@+id/tv_warehouse_details_reason"
android:id=
"@+id/tv_warehouse_details_reason"
android:layout_width=
"0dp"
android:layout_width=
"wrap_content"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:gravity=
"end"
android:gravity=
"end"
android:textColor=
"@color/color_3c"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/sp_14"
android:textSize=
"@dimen/sp_14"
tools:text=
"採購入庫"
/>
tools:text=
"採購入庫"
/>
</
Linear
Layout>
</
Relative
Layout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
component-supply-chain/src/main/res/layout/item_warehousing_order_list.xml
0 → 100644
View file @
13ff529e
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_5"
android:layout_marginRight=
"@dimen/dp_10"
android:background=
"@drawable/shape_white_eight_corners_bg"
android:elevation=
"@dimen/dp_2"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_40"
android:layout_marginLeft=
"@dimen/dp_8"
android:layout_marginRight=
"@dimen/dp_8"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_warehousing_order_no"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:ellipsize=
"end"
android:gravity=
"center_vertical"
android:maxLines=
"1"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_17"
tools:text=
"入庫單號"
/>
<TextView
android:id=
"@+id/tv_warehousing_order_createTime"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:gravity=
"right"
android:maxLines=
"1"
tools:text=
"2020-11-20 12:00"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:padding=
"@dimen/dp_8"
>
<TextView
android:id=
"@+id/tv_warehousing_order_species"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"種類:12"
/>
<TextView
android:id=
"@+id/tv_warehousing_order_createMember"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:layout_weight=
"1"
android:gravity=
"end"
tools:text=
"入庫人"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:paddingLeft=
"@dimen/dp_8"
android:paddingRight=
"@dimen/dp_8"
android:paddingBottom=
"@dimen/dp_8"
>
<TextView
android:id=
"@+id/tv_warehousing_order_foods"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:singleLine=
"true"
tools:text=
"巴西肥牛、澳洲牛排"
/>
<TextView
android:id=
"@+id/tv_warehousing_order_createReason"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"調撥入庫"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
component-supply-chain/src/main/res/layout/layout_scan_sn.xml
View file @
13ff529e
...
@@ -8,17 +8,17 @@
...
@@ -8,17 +8,17 @@
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingTop=
"@dimen/dp_9"
android:background=
"@drawable/shape_white_top_border"
android:paddingBottom=
"@dimen/dp_6"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:background=
"@drawable/shape_white_top_border"
android:paddingLeft=
"@dimen/dp_19"
android:paddingLeft=
"@dimen/dp_19"
android:paddingRight=
"@dimen/dp_19"
>
android:paddingTop=
"@dimen/dp_9"
android:paddingRight=
"@dimen/dp_19"
android:paddingBottom=
"@dimen/dp_6"
>
<TextView
<TextView
style=
"@style/WareHouse_Title_TextStyle"
android:id=
"@+id/tv_hint_scan_sn"
android:id=
"@+id/tv_hint_scan_sn"
style=
"@style/WareHouse_Title_TextStyle"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/str_enter_scan_sn"
/>
android:text=
"@string/str_enter_scan_sn"
/>
...
...
component-supply-chain/src/main/res/values/strings.xml
View file @
13ff529e
...
@@ -56,5 +56,6 @@
...
@@ -56,5 +56,6 @@
<string
name=
"str_choice_category"
>
選擇類別
</string>
<string
name=
"str_choice_category"
>
選擇類別
</string>
<string
name=
"str_select_least_one_product"
>
至少選擇一個商品
</string>
<string
name=
"str_select_least_one_product"
>
至少選擇一個商品
</string>
<string
name=
"str_confirm_receipt"
>
是否確認收貨?
</string>
<string
name=
"str_confirm_receipt"
>
是否確認收貨?
</string>
<string
name=
"str_new_add_ingredients"
>
新增食材
</string>
</resources>
</resources>
\ No newline at end of file
library-base/src/main/java/com/jess/arms/utils/SoftHideKeyBoardUtil.java
View file @
13ff529e
...
@@ -57,10 +57,8 @@ public class SoftHideKeyBoardUtil {
...
@@ -57,10 +57,8 @@ public class SoftHideKeyBoardUtil {
if
(
usableHeightNow
!=
usableHeightPrevious
)
{
if
(
usableHeightNow
!=
usableHeightPrevious
)
{
//3、获取Activity中xml中布局在当前界面显示的高度
//3、获取Activity中xml中布局在当前界面显示的高度
int
usableHeightSansKeyboard
=
mChildOfContent
.
getRootView
().
getHeight
();
int
usableHeightSansKeyboard
=
mChildOfContent
.
getRootView
().
getHeight
();
Log
.
e
(
"eee"
,
"顯示高度:"
+
usableHeightSansKeyboard
);
//4、Activity中xml布局的高度-当前可用高度
//4、Activity中xml布局的高度-当前可用高度
int
heightDifference
=
usableHeightSansKeyboard
-
usableHeightNow
;
int
heightDifference
=
usableHeightSansKeyboard
-
usableHeightNow
;
Log
.
e
(
"eee"
,
"鍵盤高度:"
+
heightDifference
);
//5、高度差大于屏幕1/4时,说明键盘弹出
//5、高度差大于屏幕1/4时,说明键盘弹出
if
(
heightDifference
>
(
usableHeightSansKeyboard
/
4
))
{
if
(
heightDifference
>
(
usableHeightSansKeyboard
/
4
))
{
// 6、键盘弹出了,Activity的xml布局高度应当减去键盘高度
// 6、键盘弹出了,Activity的xml布局高度应当减去键盘高度
...
@@ -69,7 +67,6 @@ public class SoftHideKeyBoardUtil {
...
@@ -69,7 +67,6 @@ public class SoftHideKeyBoardUtil {
}
else
{
}
else
{
frameLayoutParams
.
height
=
usableHeightSansKeyboard
-
heightDifference
;
frameLayoutParams
.
height
=
usableHeightSansKeyboard
-
heightDifference
;
}
}
Log
.
e
(
"eee"
,
"頁面高度:"
+
frameLayoutParams
.
height
);
}
else
{
}
else
{
frameLayoutParams
.
height
=
contentHeight
;
frameLayoutParams
.
height
=
contentHeight
;
}
}
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/constans/FunctionManagerConstants.java
deleted
100644 → 0
View file @
33afd942
package
com
.
gingersoft
.
gsa
.
cloud
.
common
.
constans
;
import
com.gingersoft.gsa.cloud.common.function.FModule
;
public
class
FunctionManagerConstants
{
public
static
class
takeaway
{
public
static
final
String
CONFIRM_BTN_KEY
=
"takeaway/orderDetails/btn/confirmOrder"
;
public
static
final
String
PRODUCTION_COMPLETED_BTN_KEY
=
"takeaway/orderDetails/btn/ProductionCompleted"
;
public
static
final
String
CANCEL_ORDER_BTN_KEY
=
"takeaway/orderDetails/btn/cancelOrder"
;
public
static
final
String
PRINT_ORDER_BTN_KEY
=
"takeaway/orderDetails/btn/printOrder"
;
public
static
final
String
LOGISTICS_BTN_KEY
=
"takeaway/orderDetails/btn/logistics"
;
public
static
final
String
ASSIGNDELIVERY_BTN_KEY
=
"takeaway/orderDetails/btn/assignDelivery"
;
public
static
final
String
CLOSING_BTN_KEY
=
"takeaway/orderDetails/btn/closing"
;
public
static
final
String
TRANSPORTATION_BTN_KEY
=
"takeaway/orderDetails/btn/transportation"
;
public
static
final
String
ADDITIONALSERVICECHARGE_BTN_KEY
=
"takeaway/orderDetails/btn/additionalServiceCharge"
;
//新訂單
public
static
final
String
TAKEAWAY_NEW_ORDER
=
"takeaway/btn/newOrder"
;
//歷史訂單
public
static
final
String
TAKEAWAY_HISTORY_ORDER
=
"takeaway/btn/historyOrder"
;
//開錢箱
public
static
final
String
TAKEAWAY_OPEN_CASH_BOX
=
"takeaway/btn/openCashBox"
;
/** 外送/自取- 訂單詳情管理 */
public
static
final
FModule
[]
orderDetails
=
{
new
FModule
(
CONFIRM_BTN_KEY
,
0
,
0
),
new
FModule
(
PRODUCTION_COMPLETED_BTN_KEY
,
0
,
0
),
new
FModule
(
CANCEL_ORDER_BTN_KEY
,
0
,
0
),
new
FModule
(
PRINT_ORDER_BTN_KEY
,
0
,
0
),
new
FModule
(
LOGISTICS_BTN_KEY
,
0
,
0
),
new
FModule
(
ASSIGNDELIVERY_BTN_KEY
,
0
,
0
),
new
FModule
(
CLOSING_BTN_KEY
,
0
,
0
),
new
FModule
(
TRANSPORTATION_BTN_KEY
,
0
,
0
),
new
FModule
(
ADDITIONALSERVICECHARGE_BTN_KEY
,
0
,
0
)
};
/** 外送/自取- 首頁按鈕管理 */
public
static
final
FModule
[]
takeawayMain
=
{
new
FModule
(
TAKEAWAY_NEW_ORDER
,
0
,
0
)
};
}
}
library-common/src/main/java/com/gingersoft/gsa/cloud/common/constans/Takeaway.java
0 → 100644
View file @
13ff529e
package
com
.
gingersoft
.
gsa
.
cloud
.
common
.
constans
;
import
com.gingersoft.gsa.cloud.common.function.FModule
;
import
com.gingersoft.gsa.cloud.common.function.XFunctionItems
;
/**
* @author admin
* 外送按鈕功能權限
*/
public
class
Takeaway
{
public
static
final
String
TAKEAWAY_ORDER_DETAILS
=
"takeaway/orderDetails/btn/"
;
public
static
final
String
TAKEAWAY_ORDER_DETAILS_ENFORCE
=
"takeaway/orderDetails/btn/enforce/"
;
public
static
final
String
TAKEAWAY_BTN
=
"takeaway/btn/"
;
public
static
final
String
CONFIRM_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"confirmOrder"
;
public
static
final
String
PRODUCTION_COMPLETED_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"ProductionCompleted"
;
public
static
final
String
CANCEL_ORDER_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"cancelOrder"
;
public
static
final
String
PRINT_ORDER_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"printOrder"
;
public
static
final
String
LOGISTICS_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"logistics"
;
public
static
final
String
ASSIGN_DELIVERY_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"assignDelivery"
;
public
static
final
String
CLOSING_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"closing"
;
public
static
final
String
TRANSPORTATION_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"transportation"
;
public
static
final
String
ADDITIONAL_SERVICE_CHARGE_BTN_KEY
=
TAKEAWAY_ORDER_DETAILS
+
"additionalServiceCharge"
;
/**
* 新訂單
*/
public
static
final
String
TAKEAWAY_NEW_ORDER
=
TAKEAWAY_BTN
+
"newOrder"
;
/**
* 歷史訂單
*/
public
static
final
String
TAKEAWAY_HISTORY_ORDER
=
TAKEAWAY_BTN
+
"historyOrder"
;
/**
* 開錢箱
*/
public
static
final
String
TAKEAWAY_OPEN_CASH_BOX
=
TAKEAWAY_BTN
+
"openCashBox"
;
/**
* 外送/自取- 訂單詳情管理
*/
@XFunctionItems
(
TAKEAWAY_ORDER_DETAILS
)
public
static
final
FModule
[]
ORDER_DETAILS_BTN_PERMISSION
=
{
new
FModule
(
CONFIRM_BTN_KEY
,
0
,
0
),
new
FModule
(
PRODUCTION_COMPLETED_BTN_KEY
,
0
,
0
),
new
FModule
(
CANCEL_ORDER_BTN_KEY
,
0
,
0
),
new
FModule
(
PRINT_ORDER_BTN_KEY
,
0
,
0
),
new
FModule
(
LOGISTICS_BTN_KEY
,
0
,
0
),
new
FModule
(
ASSIGN_DELIVERY_BTN_KEY
,
0
,
0
),
new
FModule
(
CLOSING_BTN_KEY
,
0
,
0
),
new
FModule
(
TRANSPORTATION_BTN_KEY
,
0
,
0
),
new
FModule
(
ADDITIONAL_SERVICE_CHARGE_BTN_KEY
,
0
,
0
)
};
/**
* 外送/自取- 訂單詳情強制按鈕
*/
@XFunctionItems
(
TAKEAWAY_ORDER_DETAILS_ENFORCE
)
public
static
final
FModule
[]
ORDER_DETAILS_BTN_ENFORCE_PERMISSION
=
{
new
FModule
(
TAKEAWAY_ORDER_DETAILS_ENFORCE
+
"EnforceConfirmOrder"
,
0
,
0
),
//強制確認訂單
new
FModule
(
TAKEAWAY_ORDER_DETAILS_ENFORCE
+
"EnforceProductionCompleted"
,
0
,
0
),
//強制製作完成
new
FModule
(
TAKEAWAY_ORDER_DETAILS_ENFORCE
+
"EnforceCancelOrder"
,
0
,
0
),
//強制取消訂單
new
FModule
(
TAKEAWAY_ORDER_DETAILS_ENFORCE
+
"EnforcePrintOrder"
,
0
,
0
),
//強制打印訂單
new
FModule
(
TAKEAWAY_ORDER_DETAILS_ENFORCE
+
"EnforceCancelLogistics"
,
0
,
0
),
//強制取消物流
new
FModule
(
TAKEAWAY_ORDER_DETAILS_ENFORCE
+
"EnforceAssignDelivery"
,
0
,
0
),
//強制指派送貨
new
FModule
(
TAKEAWAY_ORDER_DETAILS_ENFORCE
+
"EnforceClosing"
,
0
,
0
)
//強制結賬
};
/**
* 外送/自取- 首頁按鈕管理
*/
@XFunctionItems
(
TAKEAWAY_BTN
)
public
static
final
FModule
[]
TAKEAWAY_MAIN_BTN_PERMISSION
=
{
new
FModule
(
TAKEAWAY_NEW_ORDER
,
0
,
0
),
new
FModule
(
TAKEAWAY_HISTORY_ORDER
,
0
,
0
),
new
FModule
(
TAKEAWAY_OPEN_CASH_BOX
,
0
,
0
)
};
}
library-common/src/main/java/com/gingersoft/gsa/cloud/common/function/FunctionManager.java
View file @
13ff529e
...
@@ -31,11 +31,18 @@ public class FunctionManager {
...
@@ -31,11 +31,18 @@ public class FunctionManager {
public
List
<
Function
>
getFunctionByResModule
(
Context
context
,
Class
c
,
FModule
[]
fModules
,
String
specific
)
{
public
List
<
Function
>
getFunctionByResModule
(
Context
context
,
Class
c
,
FModule
[]
fModules
,
String
specific
)
{
String
resLoction
=
c
.
getSimpleName
().
toLowerCase
()
+
"/"
+
specific
;
String
resLoc
a
tion
=
c
.
getSimpleName
().
toLowerCase
()
+
"/"
+
specific
;
FunctionDaoUtils
daoUtils
=
new
FunctionDaoUtils
(
context
);
FunctionDaoUtils
daoUtils
=
new
FunctionDaoUtils
(
context
);
List
<
Function
>
functionList
=
daoUtils
.
queryAllFunction
();
List
<
Function
>
functionList
=
daoUtils
.
queryAllFunction
();
return
filterFunctionByResLoction
(
functionList
,
fModules
,
resLoction
);
return
filterFunctionByResLoction
(
functionList
,
fModules
,
resLocation
);
}
public
List
<
Function
>
getFunctionByResModule
(
Context
context
,
FModule
[]
fModules
,
String
specific
)
{
String
resLocation
=
specific
;
FunctionDaoUtils
daoUtils
=
new
FunctionDaoUtils
(
context
);
List
<
Function
>
functionList
=
daoUtils
.
queryAllFunction
();
return
filterFunctionByResLoction
(
functionList
,
fModules
,
resLocation
);
}
}
private
List
<
Function
>
filterFunctionByResLoction
(
List
<
Function
>
functionList
,
FModule
[]
fModules
,
String
resLoction
)
{
private
List
<
Function
>
filterFunctionByResLoction
(
List
<
Function
>
functionList
,
FModule
[]
fModules
,
String
resLoction
)
{
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/function/click/BaseQueicItemClickAspect.java
View file @
13ff529e
...
@@ -34,7 +34,6 @@ public class BaseQueicItemClickAspect {
...
@@ -34,7 +34,6 @@ public class BaseQueicItemClickAspect {
*/
*/
@Around
(
"onItemSingleClickMethod()"
)
@Around
(
"onItemSingleClickMethod()"
)
public
void
doItemSingleClickMethod
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
public
void
doItemSingleClickMethod
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
Log
.
d
(
"SingleClickAspect"
,
"來了"
);
View
view
=
null
;
View
view
=
null
;
for
(
Object
arg
:
joinPoint
.
getArgs
())
{
for
(
Object
arg
:
joinPoint
.
getArgs
())
{
if
(
arg
instanceof
View
)
{
if
(
arg
instanceof
View
)
{
...
...
library-common/src/main/res/layout/loadsir_custom.xml
View file @
13ff529e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawableTop=
"@
mipmap/loadsir_empty
"
android:drawableTop=
"@
drawable/ic_not_have_goods
"
android:gravity=
"center"
android:gravity=
"center"
android:drawablePadding=
"@dimen/dp_10"
android:drawablePadding=
"@dimen/dp_10"
android:textColor=
"#999999"
android:textColor=
"#999999"
...
...
library-common/src/main/res/layout/loadsir_empty.xml
View file @
13ff529e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawableTop=
"@
mipmap/loadsir_empty
"
android:drawableTop=
"@
drawable/ic_not_have_goods
"
android:gravity=
"center"
android:gravity=
"center"
android:drawablePadding=
"@dimen/dp_10"
android:drawablePadding=
"@dimen/dp_10"
android:textColor=
"#999999"
android:textColor=
"#999999"
...
...
library-common/src/main/res/layout/loadsir_no_network.xml
View file @
13ff529e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawableTop=
"@
mipmap/loadsir_empty
"
android:drawableTop=
"@
drawable/ic_not_have_goods
"
android:gravity=
"center"
android:gravity=
"center"
android:drawablePadding=
"@dimen/dp_10"
android:drawablePadding=
"@dimen/dp_10"
android:textColor=
"#999999"
android:textColor=
"#999999"
...
...
library-common/src/main/res/mipmap-hdpi/loadsir_empty.png
deleted
100644 → 0
View file @
33afd942
10.6 KB
library-common/src/main/res/mipmap-mdpi/loadsir_empty.png
deleted
100644 → 0
View file @
33afd942
6.44 KB
library-common/src/main/res/mipmap-xhdpi/loadsir_empty.png
deleted
100644 → 0
View file @
33afd942
14.3 KB
library-common/src/main/res/mipmap-xxhdpi/loadsir_empty.png
deleted
100644 → 0
View file @
33afd942
21.9 KB
library-common/src/main/res/mipmap-xxxhdpi/loadsir_empty.png
deleted
100644 → 0
View file @
33afd942
38.7 KB
library-common/src/main/res/values/strings.xml
View file @
13ff529e
<resources>
<resources>
<string
name=
"base_app_name"
>
public-base
</string>
<string
name=
"base_app_name"
>
public-base
</string>
<string
name=
"str_zero"
>
0
</string>
<string
name=
"str_one"
>
1
</string>
<string
name=
"str_two"
>
2
</string>
<string
name=
"str_three"
>
3
</string>
<string
name=
"str_four"
>
4
</string>
<string
name=
"str_five"
>
5
</string>
<string
name=
"str_six"
>
6
</string>
<string
name=
"str_seven"
>
7
</string>
<string
name=
"str_eight"
>
8
</string>
<string
name=
"str_nine"
>
9
</string>
<string
name=
"Key_0"
>
0
</string>
<string
name=
"Key_0"
>
0
</string>
<string
name=
"Key_00"
>
00
</string>
<string
name=
"Key_00"
>
00
</string>
...
@@ -233,6 +243,8 @@
...
@@ -233,6 +243,8 @@
<string
name=
"str_determine"
>
確定
</string>
<string
name=
"str_determine"
>
確定
</string>
<string
name=
"str_remark"
>
備註
</string>
<string
name=
"str_remark"
>
備註
</string>
<string
name=
"str_remark_colon"
>
備註:
</string>
<string
name=
"str_remark_colon"
>
備註:
</string>
<string
name=
"str_format_remark_colon"
>
備註:%1$s
</string>
<string
name=
"str_save"
>
保存
</string>
<string
name=
"str_save"
>
保存
</string>
<string
name=
"str_inventory"
>
盤點
</string>
<string
name=
"str_inventory"
>
盤點
</string>
...
...
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/utils/AppDialog.java
View file @
13ff529e
...
@@ -16,6 +16,7 @@ import com.jess.arms.utils.ArmsUtils;
...
@@ -16,6 +16,7 @@ import com.jess.arms.utils.ArmsUtils;
import
com.lxj.xpopup.XPopup
;
import
com.lxj.xpopup.XPopup
;
import
com.lxj.xpopup.impl.InputConfirmPopupView
;
import
com.lxj.xpopup.impl.InputConfirmPopupView
;
import
com.lxj.xpopup.interfaces.OnCancelListener
;
import
com.lxj.xpopup.interfaces.OnCancelListener
;
import
com.lxj.xpopup.interfaces.OnConfirmListener
;
import
java.util.List
;
import
java.util.List
;
...
@@ -33,19 +34,19 @@ public class AppDialog {
...
@@ -33,19 +34,19 @@ public class AppDialog {
}
}
public
void
showWaringDialog
(
Context
context
,
String
title
,
DialogOnClickListen
t
er
sureOnclickListener
)
{
public
void
showWaringDialog
(
Context
context
,
String
title
,
DialogOnClickListener
sureOnclickListener
)
{
showWaringDialog
(
context
,
title
,
null
,
null
,
sureOnclickListener
,
null
,
true
);
showWaringDialog
(
context
,
title
,
null
,
null
,
sureOnclickListener
,
null
,
true
);
}
}
public
void
showWaringDialog
(
Context
context
,
String
title
,
boolean
isDismiss
,
DialogOnClickListen
t
er
sureOnclickListener
)
{
public
void
showWaringDialog
(
Context
context
,
String
title
,
boolean
isDismiss
,
DialogOnClickListener
sureOnclickListener
)
{
showWaringDialog
(
context
,
title
,
null
,
null
,
sureOnclickListener
,
null
,
isDismiss
);
showWaringDialog
(
context
,
title
,
null
,
null
,
sureOnclickListener
,
null
,
isDismiss
);
}
}
public
void
showWaringDialog
(
Context
context
,
String
title
,
boolean
isDismiss
,
DialogOnClickListen
ter
sureOnclickListener
,
DialogOnClickListent
er
cancelOnclickListener
)
{
public
void
showWaringDialog
(
Context
context
,
String
title
,
boolean
isDismiss
,
DialogOnClickListen
er
sureOnclickListener
,
DialogOnClickListen
er
cancelOnclickListener
)
{
showWaringDialog
(
context
,
title
,
null
,
null
,
sureOnclickListener
,
cancelOnclickListener
,
isDismiss
);
showWaringDialog
(
context
,
title
,
null
,
null
,
sureOnclickListener
,
cancelOnclickListener
,
isDismiss
);
}
}
private
void
showWaringDialog
(
Context
context
,
String
title
,
String
confimText
,
String
cancelText
,
DialogOnClickListen
ter
sureOnclickListener
,
DialogOnClickListent
er
cancelOnclickListener
,
boolean
isDismiss
)
{
private
void
showWaringDialog
(
Context
context
,
String
title
,
String
confimText
,
String
cancelText
,
DialogOnClickListen
er
sureOnclickListener
,
DialogOnClickListen
er
cancelOnclickListener
,
boolean
isDismiss
)
{
//DialogUtils內存洩漏,換Xpopup
//DialogUtils內存洩漏,換Xpopup
new
DialogUtils
(
context
,
R
.
layout
.
other_order_pause_orders
)
{
new
DialogUtils
(
context
,
R
.
layout
.
other_order_pause_orders
)
{
@Override
@Override
...
@@ -76,7 +77,7 @@ public class AppDialog {
...
@@ -76,7 +77,7 @@ public class AppDialog {
}.
show
();
}.
show
();
}
}
public
void
showSelectDialog
(
Context
context
,
String
title
,
int
spanCount
,
RecyclerView
.
Adapter
adapter
,
DialogOnClickListen
t
er
sureOnclickListenter
)
{
public
void
showSelectDialog
(
Context
context
,
String
title
,
int
spanCount
,
RecyclerView
.
Adapter
adapter
,
DialogOnClickListener
sureOnclickListenter
)
{
new
DialogUtils
(
context
,
R
.
layout
.
dialog_select_layout
)
{
new
DialogUtils
(
context
,
R
.
layout
.
dialog_select_layout
)
{
@Override
@Override
public
void
initLayout
(
ViewHepler
hepler
,
Dialog
dialog
)
{
public
void
initLayout
(
ViewHepler
hepler
,
Dialog
dialog
)
{
...
@@ -105,41 +106,42 @@ public class AppDialog {
...
@@ -105,41 +106,42 @@ public class AppDialog {
/**
/**
* 藍色的提示框
* 藍色的提示框
*/
*/
public
void
showTipDialog
(
Context
context
,
String
title
,
DialogOnClickListenter
sureOnclickListent
er
)
{
public
void
showTipDialog
(
Context
context
,
String
title
,
OnConfirmListener
sureOnclickListen
er
)
{
showTipDialog
(
context
,
title
,
context
.
getString
(
R
.
string
.
str_determine
),
context
.
getString
(
R
.
string
.
str_cancel
),
sureOnclickListen
t
er
,
null
);
showTipDialog
(
context
,
title
,
context
.
getString
(
R
.
string
.
str_determine
),
context
.
getString
(
R
.
string
.
str_cancel
),
sureOnclickListener
,
null
);
}
}
/**
/**
* 藍色的提示框
* 藍色的提示框
*/
*/
public
void
showTipDialog
(
Context
context
,
String
title
,
DialogOnClickListenter
sureOnclickListenter
,
DialogOnClickListenter
onCancelListener
)
{
public
void
showTipDialog
(
Context
context
,
String
title
,
OnConfirmListener
sureOnclickListener
,
OnCancelListener
onCancelListener
)
{
showTipDialog
(
context
,
title
,
context
.
getString
(
R
.
string
.
str_determine
),
context
.
getString
(
R
.
string
.
str_cancel
),
sureOnclickListenter
,
onCancelListener
);
showTipDialog
(
context
,
title
,
context
.
getString
(
R
.
string
.
str_determine
),
context
.
getString
(
R
.
string
.
str_cancel
),
sureOnclickListener
,
onCancelListener
);
}
}
public
void
showTipDialog
(
Context
context
,
String
title
,
String
sureBtnText
,
String
cancelBtnText
,
DialogOnClickListenter
sureOnclickListener
,
DialogOnClickListenter
onCancelListener
)
{
public
void
showTipDialog
(
Context
context
,
String
title
,
String
sureBtnText
,
String
cancelBtnText
,
OnConfirmListener
sureOnclickListener
,
OnCancelListener
onCancelListener
)
{
new
DialogUtils
(
context
,
R
.
layout
.
dialog_tip
)
{
new
XPopup
.
Builder
(
context
).
asConfirm
(
title
,
""
,
cancelBtnText
,
sureBtnText
,
sureOnclickListener
,
onCancelListener
,
false
,
R
.
layout
.
dialog_tip
).
show
();
@Override
// new DialogUtils(context, R.layout.dialog_tip) {
public
void
initLayout
(
ViewHepler
hepler
,
Dialog
dialog
)
{
// @Override
if
(
title
!=
null
)
{
// public void initLayout(ViewHepler hepler, Dialog dialog) {
hepler
.
setText
(
R
.
id
.
tv_warning_title
,
title
);
// if (title != null) {
}
// hepler.setText(R.id.tv_warning_title, title);
hepler
.
getView
(
R
.
id
.
tv_dialog_cancel
).
setOnClickListener
(
v
->
dialog
.
dismiss
());
// }
((
TextView
)
hepler
.
getView
(
R
.
id
.
tv_dialog_confirm
)).
setText
(
sureBtnText
);
// hepler.getView(R.id.tv_dialog_cancel).setOnClickListener(v -> dialog.dismiss());
((
TextView
)
hepler
.
getView
(
R
.
id
.
tv_dialog_cancel
)).
setText
(
cancelBtnText
);
// ((TextView) hepler.getView(R.id.tv_dialog_confirm)).setText(sureBtnText);
hepler
.
getView
(
R
.
id
.
tv_dialog_confirm
).
setOnClickListener
(
v
->
{
// ((TextView) hepler.getView(R.id.tv_dialog_cancel)).setText(cancelBtnText);
if
(
sureOnclickListener
!=
null
)
{
// hepler.getView(R.id.tv_dialog_confirm).setOnClickListener(v -> {
sureOnclickListener
.
onclick
(
v
,
dialog
);
// if (sureOnclickListener != null) {
}
// sureOnclickListener.onclick(v, dialog);
dialog
.
dismiss
();
// }
});
// dialog.dismiss();
hepler
.
getView
(
R
.
id
.
tv_dialog_cancel
).
setOnClickListener
(
v
->
{
// });
dismiss
();
// hepler.getView(R.id.tv_dialog_cancel).setOnClickListener(v -> {
if
(
onCancelListener
!=
null
)
{
// dismiss();
onCancelListener
.
onclick
(
v
,
dialog
);
// if (onCancelListener != null) {
}
// onCancelListener.onclick(v, dialog);
});
// }
}
// });
}.
show
();
// }
// }.show();
}
}
public
void
showListDialog
(
Context
context
,
String
[]
data
,
onDialogSelectListener
onSelectListener
)
{
public
void
showListDialog
(
Context
context
,
String
[]
data
,
onDialogSelectListener
onSelectListener
)
{
...
@@ -168,7 +170,7 @@ public class AppDialog {
...
@@ -168,7 +170,7 @@ public class AppDialog {
}
}
public
interface
DialogOnClickListen
t
er
{
public
interface
DialogOnClickListener
{
void
onclick
(
View
view
,
Dialog
dialog
);
void
onclick
(
View
view
,
Dialog
dialog
);
}
}
...
...
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/utils/BtnBuilder.kt
View file @
13ff529e
package
com.gingersoft.gsa.cloud.
common.
ui.utils
package
com.gingersoft.gsa.cloud.ui.utils
import
com.gingersoft.gsa.cloud.common.constans.
FunctionManagerConstants
import
com.gingersoft.gsa.cloud.common.constans.
Takeaway
import
com.gingersoft.gsa.cloud.database.bean.Function
import
com.gingersoft.gsa.cloud.database.bean.Function
import
com.gingersoft.gsa.cloud.ui.R
import
com.gingersoft.gsa.cloud.ui.R
/**
* 凍鏈外送都需要用到
*/
class
BtnBuilder
{
class
BtnBuilder
{
lateinit
var
functions
:
List
<
Function
>
lateinit
var
functions
:
List
<
Function
>
...
@@ -17,6 +20,14 @@ class BtnBuilder {
...
@@ -17,6 +20,14 @@ class BtnBuilder {
const
val
ProductionCompletedBtn
=
6
const
val
ProductionCompletedBtn
=
6
const
val
TransportationBtn
=
7
//選擇運輸工具
const
val
TransportationBtn
=
7
//選擇運輸工具
const
val
AdditionalServiceChargeBtn
=
8
//追加服務費
const
val
AdditionalServiceChargeBtn
=
8
//追加服務費
//強制
const
val
EnforceSureBtn
=
9
const
val
EnforceCancelBtn
=
10
const
val
EnforcePrintBtn
=
11
const
val
EnforceLogisticsBtn
=
12
const
val
EnforceAssignDeliveryBtn
=
13
const
val
EnforceClosingBtn
=
14
const
val
EnforceProductionCompletedBtn
=
15
@Volatile
@Volatile
private
var
instance
:
BtnBuilder
?
=
null
private
var
instance
:
BtnBuilder
?
=
null
...
@@ -37,54 +48,80 @@ class BtnBuilder {
...
@@ -37,54 +48,80 @@ class BtnBuilder {
class
BtnBean
(
val
type
:
Int
,
var
btnContent
:
String
,
val
btnColor
:
Int
,
val
btnImg
:
Int
)
class
BtnBean
(
val
type
:
Int
,
var
btnContent
:
String
,
val
btnColor
:
Int
,
val
btnImg
:
Int
)
fun
getSureBtn
():
BtnBean
?
{
fun
getSureBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
t
akeaway
.
CONFIRM_BTN_KEY
,
SureBtn
,
"確認訂單"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_sure
)
return
getBtn
(
T
akeaway
.
CONFIRM_BTN_KEY
,
SureBtn
,
"確認訂單"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_sure
)
}
}
fun
getProductionCompletedBtn
():
BtnBean
?
{
fun
getProductionCompletedBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
t
akeaway
.
PRODUCTION_COMPLETED_BTN_KEY
,
ProductionCompletedBtn
,
"製作完成"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_sure
)
return
getBtn
(
T
akeaway
.
PRODUCTION_COMPLETED_BTN_KEY
,
ProductionCompletedBtn
,
"製作完成"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_sure
)
}
}
fun
getCancelBtn
():
BtnBean
?
{
fun
getCancelBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
t
akeaway
.
CANCEL_ORDER_BTN_KEY
,
CancelBtn
,
"取消訂單"
,
R
.
color
.
other_order_details_cancel_btn_color
,
R
.
drawable
.
ic_cancel
)
return
getBtn
(
T
akeaway
.
CANCEL_ORDER_BTN_KEY
,
CancelBtn
,
"取消訂單"
,
R
.
color
.
other_order_details_cancel_btn_color
,
R
.
drawable
.
ic_cancel
)
}
}
fun
getPrintBtn
():
BtnBean
?
{
fun
getPrintBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
t
akeaway
.
PRINT_ORDER_BTN_KEY
,
PrintBtn
,
"打印訂單"
,
R
.
color
.
other_order_details_print_btn_color
,
R
.
drawable
.
ic_print
)
return
getBtn
(
T
akeaway
.
PRINT_ORDER_BTN_KEY
,
PrintBtn
,
"打印訂單"
,
R
.
color
.
other_order_details_print_btn_color
,
R
.
drawable
.
ic_print
)
}
}
fun
getLogisticsBtn
():
BtnBean
?
{
fun
getLogisticsBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
t
akeaway
.
LOGISTICS_BTN_KEY
,
LogisticsBtn
,
"取消物流"
,
R
.
color
.
other_order_details_cancel_logistics_btn_color
,
R
.
drawable
.
ic_logistics
)
return
getBtn
(
T
akeaway
.
LOGISTICS_BTN_KEY
,
LogisticsBtn
,
"取消物流"
,
R
.
color
.
other_order_details_cancel_logistics_btn_color
,
R
.
drawable
.
ic_logistics
)
}
}
fun
getAssignDeliveryBtn
():
BtnBean
?
{
fun
getAssignDeliveryBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
takeaway
.
ASSIGN
DELIVERY_BTN_KEY
,
AssignDeliveryBtn
,
"指派送貨"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_deliveryman
)
return
getBtn
(
Takeaway
.
ASSIGN_
DELIVERY_BTN_KEY
,
AssignDeliveryBtn
,
"指派送貨"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_deliveryman
)
}
}
fun
getClosingBtn
():
BtnBean
?
{
fun
getClosingBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
t
akeaway
.
CLOSING_BTN_KEY
,
ClosingBtn
,
"結賬"
,
R
.
color
.
other_order_details_cancel_btn_color
,
R
.
drawable
.
ic_closing
)
return
getBtn
(
T
akeaway
.
CLOSING_BTN_KEY
,
ClosingBtn
,
"結賬"
,
R
.
color
.
other_order_details_cancel_btn_color
,
R
.
drawable
.
ic_closing
)
}
}
fun
getTransportationBtn
():
BtnBean
?
{
fun
getTransportationBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
t
akeaway
.
TRANSPORTATION_BTN_KEY
,
TransportationBtn
,
"運輸工具"
,
R
.
color
.
other_order_details_cancel_logistics_btn_color
,
R
.
drawable
.
ic_logistics
)
return
getBtn
(
T
akeaway
.
TRANSPORTATION_BTN_KEY
,
TransportationBtn
,
"運輸工具"
,
R
.
color
.
other_order_details_cancel_logistics_btn_color
,
R
.
drawable
.
ic_logistics
)
}
}
fun
getAdditionalServiceChargeBtn
():
BtnBean
?
{
fun
getAdditionalServiceChargeBtn
():
BtnBean
?
{
return
getBtn
(
FunctionManagerConstants
.
takeaway
.
ADDITIONALSERVICE
CHARGE_BTN_KEY
,
AdditionalServiceChargeBtn
,
"追加貼士"
,
R
.
color
.
additional_service_charge_btn_color
,
R
.
drawable
.
ic_additional_service_charge
)
return
getBtn
(
Takeaway
.
ADDITIONAL_SERVICE_
CHARGE_BTN_KEY
,
AdditionalServiceChargeBtn
,
"追加貼士"
,
R
.
color
.
additional_service_charge_btn_color
,
R
.
drawable
.
ic_additional_service_charge
)
}
}
fun
getEnforceSureBtn
():
BtnBean
?
{
return
getBtn
(
Takeaway
.
CONFIRM_BTN_KEY
,
SureBtn
,
"確認訂單"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_sure
)
}
fun
getEnforceProductionCompletedBtn
():
BtnBean
?
{
return
getBtn
(
Takeaway
.
PRODUCTION_COMPLETED_BTN_KEY
,
ProductionCompletedBtn
,
"製作完成"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_sure
)
}
fun
getEnforceCancelBtn
():
BtnBean
?
{
return
getBtn
(
Takeaway
.
CANCEL_ORDER_BTN_KEY
,
CancelBtn
,
"取消訂單"
,
R
.
color
.
other_order_details_cancel_btn_color
,
R
.
drawable
.
ic_cancel
)
}
fun
getEnforcePrintBtn
():
BtnBean
?
{
return
getBtn
(
Takeaway
.
PRINT_ORDER_BTN_KEY
,
PrintBtn
,
"打印訂單"
,
R
.
color
.
other_order_details_print_btn_color
,
R
.
drawable
.
ic_print
)
}
fun
getEnforceLogisticsBtn
():
BtnBean
?
{
return
getBtn
(
Takeaway
.
LOGISTICS_BTN_KEY
,
LogisticsBtn
,
"取消物流"
,
R
.
color
.
other_order_details_cancel_logistics_btn_color
,
R
.
drawable
.
ic_logistics
)
}
fun
getEnforceAssignDeliveryBtn
():
BtnBean
?
{
return
getBtn
(
Takeaway
.
ASSIGN_DELIVERY_BTN_KEY
,
AssignDeliveryBtn
,
"指派送貨"
,
R
.
color
.
other_order_details_sure_btn_color
,
R
.
drawable
.
ic_deliveryman
)
}
fun
getEnforceClosingBtn
():
BtnBean
?
{
return
getBtn
(
Takeaway
.
CLOSING_BTN_KEY
,
ClosingBtn
,
"結賬"
,
R
.
color
.
other_order_details_cancel_btn_color
,
R
.
drawable
.
ic_closing
)
}
private
fun
getBtn
(
key
:
String
,
btnCode
:
Int
,
btnContent
:
String
,
btnColor
:
Int
,
btnImg
:
Int
):
BtnBean
?
{
private
fun
getBtn
(
key
:
String
,
btnCode
:
Int
,
btnContent
:
String
,
btnColor
:
Int
,
btnImg
:
Int
):
BtnBean
?
{
for
(
value
in
functions
)
{
for
(
value
in
functions
)
{
if
(
value
.
resUrl
==
key
)
{
if
(
value
.
resUrl
==
key
)
{
return
when
{
return
when
(
value
.
status
)
{
value
.
status
==
3
->
BtnBean
(
btnCode
,
btnContent
,
R
.
color
.
color_ccc
,
btnImg
)
3
->
BtnBean
(
btnCode
,
btnContent
,
R
.
color
.
color_ccc
,
btnImg
)
// value.status == 1 -> BtnBean(btnCode, btnContent, btnColor, btnImg)
else
->
BtnBean
(
btnCode
,
btnContent
,
btnColor
,
btnImg
)
else
->
BtnBean
(
btnCode
,
btnContent
,
btnColor
,
btnImg
)
}
}
}
}
}
}
return
null
return
null
// return BtnBean(btnCode, btnContent, btnColor, btnImg)
}
}
}
}
library-ui/src/main/res/layout/dialog_tip.xml
View file @
13ff529e
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/shape_white_eight_corners_bg"
android:background=
"@drawable/shape_white_eight_corners_bg"
...
@@ -16,13 +17,21 @@
...
@@ -16,13 +17,21 @@
android:src=
"@drawable/ic_question_prompt"
/>
android:src=
"@drawable/ic_question_prompt"
/>
<TextView
<TextView
android:id=
"@+id/tv_
warning_
title"
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_22"
android:layout_marginTop=
"@dimen/dp_22"
android:text=
"是否暫停接單?"
android:textColor=
"@color/color_3c"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_20"
/>
android:textSize=
"@dimen/dp_20"
tools:text=
"是否暫停接單?"
/>
<TextView
android:id=
"@+id/tv_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_20"
android:visibility=
"gone"
/>
<LinearLayout
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -31,7 +40,7 @@
...
@@ -31,7 +40,7 @@
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
<TextView
android:id=
"@+id/tv_
dialog_
confirm"
android:id=
"@+id/tv_confirm"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_theme_eight_corners_bg"
android:background=
"@drawable/shape_theme_eight_corners_bg"
...
@@ -44,7 +53,7 @@
...
@@ -44,7 +53,7 @@
android:textSize=
"@dimen/dp_15"
/>
android:textSize=
"@dimen/dp_15"
/>
<TextView
<TextView
android:id=
"@+id/tv_
dialog_
cancel"
android:id=
"@+id/tv_cancel"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_28"
android:layout_marginLeft=
"@dimen/dp_28"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment