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
f1f53df5
Commit
f1f53df5
authored
Mar 13, 2021
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、優化凍鏈、外送自取,自動接單 2、修復在線更新apk問題 3、供應鏈食材採購列表
parent
63c11ab4
Show whitespace changes
Inline
Side-by-side
Showing
88 changed files
with
1855 additions
and
414 deletions
+1855
-414
component-coldchain/src/main/java/com/gingersoft/coldchain_module/mvp/ui/activity/ColdChainMainActivity.java
+7
-8
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/WeatherRepository.kt
+17
-0
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/network/CoolWeatherNetwork.kt
+3
-0
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/network/api/WeatherService.kt
+3
-0
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
+33
-29
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
+83
-79
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliverySettingActivity.kt
+3
-0
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/fragment/DeliveryFragment.kt
+3
-1
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/fragment/PlaceholderFragment.kt
+13
-17
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/util/OtherOrderUtils.kt
+11
-5
component-login/build.gradle
+1
-1
component-supply-chain/src/main/AndroidManifest.xml
+1
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/InventoryRecordBean.java
+18
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/OrderCategoryBean.java
+5
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseFoodBean.java
+20
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WarehouseDetailsBean.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/content/SupplyShoppingCart.java
+26
-3
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/SendMsgContract.java
+5
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/WarehousingInventoryContract.java
+3
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/NewFoodIngredientsPresenter.java
+3
-19
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/SendMsgPresenter.java
+58
-23
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WarehousingInventoryPresenter.java
+5
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/BaseCategoryAdapter.java
+10
-17
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/BuyIngredientsAdapter.java
+177
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/CategoryAdapter.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/FirstLevelCategoryAdapter.java
+98
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/FoodListAdapter.java
+1
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/InventoryRecordAdapter.java
+49
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/PurchaseOrderAdapter.java
+1
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/SecondCategoryAdapter.java
+98
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/WareHousingDetailsAdapter.java
+27
-24
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/WarehousingQueryAdapter.java
+2
-9
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/FunctionListFragment.java
+3
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/category/CategoryFragment.java
+3
-4
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/FoodIngredientsFragment.java
+9
-5
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/PurchaseListFragment.java
+4
-16
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/SendMsgFragment.java
+35
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/ShoppingCatFragment.java
+4
-6
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WareHouseListFragment.java
+3
-12
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehouseDetailsFragment.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingInventoryFragment.java
+13
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/EditTextPopup.java
+0
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/NewAddCategoryPopup.java
+3
-7
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ShowSecondCategoryPopup.java
+93
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/TextPopup.java
+42
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/utils/ViewUtils.java
+49
-0
component-supply-chain/src/main/res/drawable-xxhdpi/ic_double_row.png
+0
-0
component-supply-chain/src/main/res/drawable-xxhdpi/ic_single_row.png
+0
-0
component-supply-chain/src/main/res/drawable/s_second_category.xml
+7
-0
component-supply-chain/src/main/res/layout/fragment_ware_house_list.xml
+2
-2
component-supply-chain/src/main/res/layout/fragment_warehousing_inventory.xml
+7
-44
component-supply-chain/src/main/res/layout/item_buy_food_ingredient.xml
+151
-0
component-supply-chain/src/main/res/layout/item_buy_food_ingredient_double_row.xml
+165
-0
component-supply-chain/src/main/res/layout/item_buy_food_ingredient_header.xml
+13
-0
component-supply-chain/src/main/res/layout/item_inventory_record.xml
+49
-0
component-supply-chain/src/main/res/layout/item_purchase_order.xml
+17
-4
component-supply-chain/src/main/res/layout/item_purchase_second_category.xml
+29
-0
component-supply-chain/src/main/res/layout/item_warehouse_details.xml
+25
-5
component-supply-chain/src/main/res/layout/item_warehousing_query.xml
+16
-3
component-supply-chain/src/main/res/layout/item_warehousing_title.xml
+2
-1
component-supply-chain/src/main/res/layout/layout_popup_category_recycler.xml
+12
-0
component-supply-chain/src/main/res/layout/popup_inventory_consumption.xml
+4
-1
component-supply-chain/src/main/res/layout/popup_text.xml
+34
-0
component-supply-chain/src/main/res/layout/supply_chain_top_bar.xml
+1
-0
component-supply-chain/src/main/res/layout/view_shopping_car.xml
+28
-0
component-supply-chain/src/main/res/values/ids.xml
+1
-0
component-supply-chain/src/main/res/values/strings.xml
+2
-0
component-supply-chain/src/main/res/values/styles.xml
+7
-1
component-supply-chain/src/main/res/xml/gsa_purchase_paths.xml
+60
-0
config.gradle
+2
-2
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/DataNotificationService.kt
+4
-8
library-common/src/main/java/com/gingersoft/gsa/cloud/common/utils/other/TextUtil.java
+5
-0
library-common/src/main/res/color/s_3c_to_white.xml
+2
-0
library-common/src/main/res/drawable-xhdpi/ic_search.png
+0
-0
library-common/src/main/res/drawable-xhdpi/ic_shopping_car.png
+0
-0
library-common/src/main/res/drawable/shape_light_small_app_btn.xml
+7
-0
library-common/src/main/res/drawable/shape_theme_twelve_corners_bg.xml
+8
-0
library-common/src/main/res/drawable/shape_white_twelve_corners_bg.xml
+8
-0
library-common/src/main/res/layout/item_base_category.xml
+23
-10
library-common/src/main/res/layout/item_first_level_category.xml
+52
-0
library-common/src/main/res/values/colors.xml
+2
-1
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/bean/view/CategoryBean.java
+25
-3
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/utils/AppDialog.java
+0
-1
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/utils/DialogUtils.java
+16
-22
library-ui/src/main/res/layout/layout_order_pay.xml
+1
-1
library-updateApk/src/main/AndroidManifest.xml
+12
-1
library-updateApk/src/main/java/util/UpdateAppReceiver.java
+4
-4
library-updateApk/src/main/res/xml/update_file_paths.xml
+4
-0
No files found.
component-coldchain/src/main/java/com/gingersoft/coldchain_module/mvp/ui/activity/ColdChainMainActivity.java
View file @
f1f53df5
...
...
@@ -144,7 +144,6 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
for
(
int
i
=
0
;
i
<
titles
.
size
();
i
++)
{
fragments
.
add
(
OrderListFragment
.
newInstance
(
status
.
get
(
i
),
ColdChainConstants
.
orderType
+
""
,
i
));
}
getNumByOrderTypeInvoke
(
"loadNumber"
);
initViewPager
(
titles
);
initService
();
initHearBroadcast
();
...
...
@@ -235,6 +234,13 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
//兩次推送時間需要間隔五秒以上
return
;
}
if
(
type
==
3
||
type
==
5
||
type
==
6
||
type
==
7
)
{
fragments
.
get
(
viewPager
.
getCurrentItem
()).
onRefreshData
();
mPresenter
.
getBalance
();
if
(
type
!=
5
)
{
getNumByOrderTypeInvoke
(
"loadNumber"
);
}
LoganManager
.
w_action
(
"eee"
,
"心跳通知"
+
type
);
lastMsgTime
=
nowTime
;
LoganManager
.
w_action
(
"eee"
,
"自動上菜紙:"
+
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
AutoPrinterPaper
,
true
));
...
...
@@ -245,13 +251,6 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
if
(
autoReceivingOrders
.
isChecked
())
{
mPresenter
.
startToBeConfirmedOrderList
();
}
if
(
type
==
3
||
type
==
5
||
type
==
6
||
type
==
7
)
{
fragments
.
get
(
viewPager
.
getCurrentItem
()).
onRefreshData
();
mPresenter
.
getBalance
();
if
(
type
!=
5
)
{
getNumByOrderTypeInvoke
(
"loadNumber"
);
}
}
});
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/WeatherRepository.kt
View file @
f1f53df5
...
...
@@ -31,6 +31,23 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
heWeather
}
/**
* 新的獲取訂單列表接口
*/
suspend
fun
getNewOrderList
(
restaurantId
:
Int
,
appointmentType
:
Int
,
page
:
Int
,
pageSize
:
Int
,
status
:
String
,
orderNo
:
String
,
phone
:
String
,
type
:
Int
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"restaurantId"
,
restaurantId
.
toString
())
.
add
(
"appointmentType"
,
appointmentType
.
toString
())
.
add
(
"page"
,
page
.
toString
())
.
add
(
"pageSize"
,
pageSize
.
toString
())
.
add
(
"status"
,
status
)
.
add
(
"orderNo"
,
orderNo
)
.
add
(
"phone"
,
phone
)
.
add
(
"type"
,
type
.
toString
())
.
build
()
network
.
fetchOrderList
(
requestBody
)
}
suspend
fun
getOrderGroup
(
restaurantId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"restId"
,
restaurantId
)
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/network/CoolWeatherNetwork.kt
View file @
f1f53df5
...
...
@@ -36,6 +36,9 @@ class CoolWeatherNetwork {
//獲取訂單列表
suspend
fun
fetchOrderList
(
requestBody
:
RequestBody
)
=
ricepon_WechatService
.
getOrderList
(
requestBody
).
await
()
//新的獲取訂單列表
suspend
fun
getOrderList
(
requestBody
:
RequestBody
)
=
ricepon_WechatService
.
getNewOrderList
(
requestBody
).
await
()
//修改餐廳營業狀態
suspend
fun
updateRestOpenStatus
(
requestBody
:
RequestBody
)
=
service
.
updateRestOpenStatus
(
requestBody
).
await
()
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/network/api/WeatherService.kt
View file @
f1f53df5
...
...
@@ -14,6 +14,9 @@ interface WeatherService {
@POST
(
"wechat/findOrderList"
)
fun
getOrderList
(
@Body
requestBody
:
RequestBody
):
Call
<
OrderList
>
@POST
(
"orderInfo/getOrderList"
)
fun
getNewOrderList
(
@Body
requestBody
:
RequestBody
):
Call
<
OrderList
>
@POST
(
"wx/updateRestOpenStatus"
)
fun
updateRestOpenStatus
(
@Body
requestBody
:
RequestBody
):
Call
<
MessageBean
>
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
View file @
f1f53df5
...
...
@@ -63,18 +63,23 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
val
ErrorCode
=
1011
//報錯提示
}
val
restaurantId
by
lazy
{
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
}
val
restaurantId
by
lazy
{
RestaurantInfoManager
.
newInstance
().
restaurantId
}
//用戶id
private
val
memberId
by
lazy
{
UserContext
.
newInstance
().
memberId
}
//订单數量數組,有五種狀態
var
mOrderNum
=
arrayListOf
<
MutableLiveData
<
Int
>>()
var
m
OrderList
=
arrayListOf
<
MutableLiveData
<
ArrayList
<
OrderList
.
DataBeanX
.
DataBean
>>>()
var
m
FragmentData
=
arrayListOf
<
MutableLiveData
<
ArrayList
<
OrderList
.
DataBeanX
.
DataBean
>>>()
var
orderList
=
MutableLiveData
<
OrderList
>()
//其他的所有數據
var
otherInfo
=
MutableLiveData
<
OrderList
.
DataBeanX
.
DataBean
>()
var
balanceBean
=
MutableLiveData
<
BalanceBean
>()
//是否顯示加載框
var
showLoading
=
MutableLiveData
<
Boolean
>(
false
)
//刷新狀態,值為當前頁面的下標
var
refreshState
=
MutableLiveData
(
0
)
...
...
@@ -90,7 +95,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//接單超時時間
var
timeOut
=
0
var
appointmentType
=
MutableLiveData
(
0
)
//0為即時單,1為預約單
var
appointmentType
=
MutableLiveData
<
Int
>(
)
//0為即時單,1為預約單
var
instantOrderNum
=
MutableLiveData
(
0
)
//即時單單數
var
bookingOrderNum
=
MutableLiveData
(
0
)
//預約單單數
var
bookingConfigTime
=
MutableLiveData
<
Int
>()
//預約單配置時間
...
...
@@ -156,38 +161,44 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/**
* 獲取訂單列表
*/
fun
getOrderList
(
restaurantId
:
String
,
position
:
Int
,
page
:
String
,
isLoadMore
:
Boolean
)
{
fun
getOrderList
(
position
:
Int
,
page
:
String
,
isLoadMore
:
Boolean
)
{
launch
({
var
orderType
=
appointmentType
.
value
if
(
position
>
1
)
{
orderType
=
0
}
repository
.
requestOrderList
(
restaurantId
,
fragmentStatus
[
position
],
fragmentType
[
position
],
page
,
orderNo
,
phone
,
orderType
repository
.
requestOrderList
(
restaurantId
.
toString
()
,
fragmentStatus
[
position
],
fragmentType
[
position
],
page
,
orderNo
,
phone
,
orderType
?:
0
).
apply
{
if
(
isSuccess
())
{
getOrderGroupNum
(
restaurantId
)
getOrderGroupNum
(
restaurantId
.
toString
()
)
loadInfo
(
isLoadMore
,
position
)
}
else
{
orderList
.
postValue
(
this
)
mOrderList
[
position
].
value
=
null
mFragmentData
[
position
].
postValue
(
null
)
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_ORDER_LIST_ERROR
,
"獲取訂單列表失敗"
)
}
}
},
{
//出錯
m
OrderList
[
position
].
value
=
null
m
FragmentData
[
position
].
postValue
(
null
)
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_ORDER_LIST_ERROR
,
"獲取訂單列表報錯"
+
it
.
message
)
OtherOrderUtils
.
initSoundPool
(
GsaCloudApplication
.
getAppContext
(),
R
.
raw
.
raw_get_order_list_error
)
})
}
private
var
autoPolling
:
Disposable
?
=
null
;
fun
getNewOrderList
(
appointmentType
:
Int
,
page
:
Int
,
status
:
String
,
type
:
Int
,
orderNo
:
String
=
""
,
phone
:
String
=
""
)
{
launch
({
repository
.
getNewOrderList
(
restaurantId
,
appointmentType
,
page
,
10
,
status
,
orderNo
,
phone
,
type
).
apply
{
}
},
{
})
}
/**
* 開始自動確認訂單
*/
fun
startAutoConfirmOrder
()
{
autoPolling
=
RxJavaUtils
.
polling
(
10
)
{
launch
({
//獲取即時單
repository
.
requestOrderList
(
restaurantId
.
toString
(),
fragmentStatus
[
1
]
+
",8"
,
fragmentType
[
0
],
"1"
,
orderNo
,
phone
,
0
).
apply
{
...
...
@@ -236,7 +247,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
}
else
{
}
}
//獲取預約單
...
...
@@ -265,12 +275,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
LoganManager
.
w_delivery
(
LoganManager
.
EVENT_QUERY
,
"自動接單"
+
it
.
message
)
})
}
}
fun
stopAutoConfirmOrder
()
{
autoPolling
?.
dispose
()
}
private
fun
OrderList
.
loadInfo
(
isLoadMore
:
Boolean
,
position
:
Int
)
{
getData
()
?.
statistics
?.
let
{
...
...
@@ -293,18 +297,18 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
myData
.
removeAt
(
myData
.
size
-
1
)
//如果是加載更多
if
(
isLoadMore
)
{
if
(
m
OrderList
[
position
].
value
!=
null
)
{
m
OrderList
[
position
].
value
!!
.
addAll
(
myData
)
m
OrderList
[
position
].
postValue
(
mOrderList
[
position
].
value
)
if
(
m
FragmentData
[
position
].
value
!=
null
)
{
m
FragmentData
[
position
].
value
!!
.
addAll
(
myData
)
m
FragmentData
[
position
].
postValue
(
mFragmentData
[
position
].
value
)
}
}
else
{
m
OrderList
[
position
].
value
=
myData
m
FragmentData
[
position
].
value
=
myData
}
}
else
{
m
OrderList
[
position
].
value
=
null
m
FragmentData
[
position
].
value
=
null
}
}
else
{
m
OrderList
[
position
].
value
=
null
m
FragmentData
[
position
].
value
=
null
}
}
...
...
@@ -315,9 +319,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
* 修改餐廳營業狀態
* 0=休息中, 1=營業中,2=繁忙中不可接單,3繁忙可接單
*/
fun
updateRestOpenStatus
(
state
:
Int
,
restaurantId
:
String
)
{
fun
updateRestOpenStatus
(
state
:
Int
)
{
launch
({
repository
.
updateRestOpenStatus
(
state
,
restaurantId
).
apply
{
repository
.
updateRestOpenStatus
(
state
,
restaurantId
.
toString
()
).
apply
{
if
(
success
)
{
restaurantState
.
value
=
state
}
...
...
@@ -905,9 +909,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/**
* 獲取配送員信息
*/
fun
getDeliveryInfo
(
restaurantId
:
String
,
memberId
:
String
)
{
fun
getDeliveryInfo
()
{
launch
({
repository
.
getDeliveryInfo
(
restaurantId
,
memberId
).
apply
{
repository
.
getDeliveryInfo
(
restaurantId
.
toString
(),
memberId
.
toString
()
).
apply
{
deliveryBean
=
this
}
},
{
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
View file @
f1f53df5
...
...
@@ -21,18 +21,17 @@ import androidx.lifecycle.Observer
import
androidx.lifecycle.ViewModelProvider
import
androidx.viewpager.widget.ViewPager
import
com.billy.cc.core.component.CC
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.restaurant.utils.RestaurantExpandInfoUtils
import
com.gingersoft.gsa.cloud.common.utils.other.SPUtils
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.common.constans.AppConstans
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.FunctionManagerConstants
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.function.FunctionManager
import
com.gingersoft.gsa.cloud.common.service.DataNotificationService
import
com.gingersoft.gsa.cloud.common.service.PostCallBack
import
com.gingersoft.gsa.cloud.common.utils.other.SPUtils
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.order.order.BaseOrder
import
com.gingersoft.gsa.cloud.ui.utils.AppDialog
import
com.gingersoft.gsa.cloud.ui.utils.DialogUtils
...
...
@@ -52,14 +51,12 @@ import com.qmuiteam.qmui.util.QMUIDisplayHelper
import
com.qmuiteam.qmui.widget.popup.QMUIPopup
import
com.qmuiteam.qmui.widget.popup.QMUIPopups
import
kotlinx.android.synthetic.main.activity_other_order.*
class
DeliveryOrderMainActivity
:
BaseActivity
<
IPresenter
>(),
View
.
OnClickListener
{
private
val
pageViewModel
by
lazy
{
ViewModelProvider
(
this
,
InjectorUtil
.
getWeatherModelFactory
())[
PageViewModel
::
class
.
java
]
}
private
val
instance
by
lazy
{
this
}
private
val
restaurantId
by
lazy
{
RestaurantInfoManager
.
newInstance
().
restaurantId
}
private
val
memberId
by
lazy
{
UserContext
.
newInstance
().
memberId
}
//標籤文字
private
val
ints
=
arrayOf
(
R
.
string
.
tab_text_1
,
R
.
string
.
tab_text_2
,
...
...
@@ -68,6 +65,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
R
.
string
.
tab_text_5
)
//標籤背景色
private
val
colors
=
arrayOf
(
R
.
color
.
other_order_num_color_first
,
R
.
color
.
other_order_num_color_second
,
...
...
@@ -76,48 +74,59 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
R
.
color
.
other_order_num_color_fifth
)
private
var
titles
:
ArrayList
<
TextView
>
=
ArrayList
()
private
var
layoutHeight
:
Float
=
0F
private
var
btnHeight
:
Float
=
0F
var
bind
:
DataNotificationService
.
MyBind
?
=
null
//最後一次長連接過來的消息類型
var
lastMsgType
:
Int
=
0
//是否展開餐廳營業信息
private
var
isOpen
:
Boolean
=
true
private
val
btnOpenBg
by
lazy
{
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_white_bottom_border
)
!!
}
private
val
btnCloseBg
by
lazy
{
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_dialog_bg
)
!!
}
//功能配置
private
val
functionByResModule
by
lazy
{
FunctionManager
.
getDefault
().
getFunctionByResModule
(
this
,
FunctionManagerConstants
.
takeaway
::
class
.
java
,
FunctionManagerConstants
.
takeaway
.
takeawayMain
,
"btn"
)
}
//關閉心跳的廣播
lateinit
var
mReceiver
:
ClearHeartBroadcastReceiver
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
val
mFilter
=
IntentFilter
(
AppConstans
.
CLEAR_ORDER_RECEIVING_HEART
)
mReceiver
=
ClearHeartBroadcastReceiver
()
registerReceiver
(
mReceiver
,
mFilter
)
//初始化廣播
initBroadcast
()
//綁定視圖
val
binding
:
ActivityOtherOrderBinding
=
DataBindingUtil
.
setContentView
(
this
,
R
.
layout
.
activity_other_order
)
//初始化超時時間
initOutTime
()
//初始化心跳長連接
initWeb
s
ocket
()
initWeb
S
ocket
()
//初始化標題欄
initAppTop
()
//初始化切換餐廳狀態
initSwitchRestStatus
()
initViewPager
()
searchMethod
(
view_pager
)
initTabs
()
initViewPager
()
//搜索
searchMethod
()
//餐廳營業信息
loadRestaurantInfo
(
binding
)
//獲取餐廳營業信息展示欄的高度
initInfoHeight
()
initOrderType
()
//是否自動接單
initOrderCheckedState
()
//初始化自動接單選中
cb_takeaway_auto_receiving_orders
.
isChecked
=
RestaurantExpandInfoUtils
.
getValue
<
Boolean
>(
ExpandConstant
.
TakeawayAutoOrder
,
false
)
//自動接單按鈕點擊事件
cb_takeaway_auto_receiving_orders
.
setOnCheckedChangeListener
{
_
,
isChecked
->
RestaurantExpandInfoUtils
.
setValue
(
ExpandConstant
.
TakeawayAutoOrder
,
isChecked
)
}
cb_takeaway_auto_receiving_orders
.
isChecked
=
RestaurantExpandInfoUtils
.
getValue
<
Boolean
>(
ExpandConstant
.
TakeawayAutoOrder
,
false
)
pageViewModel
.
apply
{
getDeliveryInfo
(
restaurantId
.
toString
(),
memberId
.
toString
())
//獲取配送員信息
getDeliveryInfo
()
//監聽餘額類
balanceBean
.
observe
(
this
@DeliveryOrderMainActivity
,
Observer
{
it
?.
data
?.
let
{
data
->
tv_balance
.
text
=
"餘額:${data.balance}"
+
"(保證金: ${data.bond} )"
...
...
@@ -129,14 +138,17 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
}
}
})
//監聽即時單單數
instantOrderNum
.
observe
(
this
@DeliveryOrderMainActivity
,
Observer
{
tv_immediate_order_num
.
visibility
=
View
.
VISIBLE
tv_immediate_order_num
.
text
=
it
.
toString
()
})
//監聽預約單單數
bookingOrderNum
.
observe
(
this
@DeliveryOrderMainActivity
,
Observer
{
tv_booking_order_num
.
visibility
=
View
.
VISIBLE
tv_booking_order_num
.
text
=
it
.
toString
()
})
//監聽預約單時間
bookingConfigTime
.
observe
(
this
@DeliveryOrderMainActivity
,
Observer
{
tv_booking_order
.
text
=
"預約單($it"
+
"分)"
})
...
...
@@ -144,6 +156,15 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
}
/**
* 初始化監聽心跳廣播
*/
private
fun
initBroadcast
()
{
val
mFilter
=
IntentFilter
(
AppConstans
.
CLEAR_ORDER_RECEIVING_HEART
)
mReceiver
=
ClearHeartBroadcastReceiver
()
registerReceiver
(
mReceiver
,
mFilter
)
}
/**
* 獲取高度用於收起展開
*/
private
fun
initInfoHeight
()
{
...
...
@@ -158,7 +179,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
/**
* 初始化即時單,預約單選中狀態
*/
private
fun
initOrder
Typ
e
()
{
private
fun
initOrder
CheckedStat
e
()
{
layout_immediate_order
.
setOnClickListener
{
it
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_left_themecolor_radius_btn
)
layout_booking_order
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_right_white_radius_btn
)
...
...
@@ -199,28 +220,13 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
})
}
private
var
colorAnimation
:
ValueAnimator
?
=
null
override
fun
onStart
()
{
super
.
onStart
()
pageViewModel
.
getBanlance
(
RestaurantInfoManager
.
newInstance
().
getBrandId
())
}
override
fun
onResume
()
{
super
.
onResume
()
colorAnimation
?.
let
{
it
.
resume
()
}
}
override
fun
onPause
()
{
super
.
onPause
()
colorAnimation
?.
let
{
it
.
pause
()
}
pageViewModel
.
getBanlance
(
RestaurantInfoManager
.
newInstance
().
brandId
)
}
private
fun
initOutTime
()
{
//初始化外送接單超時時間,如果超過這個時間未接單,這個訂單會顯示超時
pageViewModel
.
timeOut
=
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
OrderReceivingTimeout
,
0
)
}
...
...
@@ -255,21 +261,22 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
for
(
i
in
ints
.
indices
)
{
//获取每一个tab对象
val
tabAt
=
tabs
.
getTabAt
(
i
)
if
(
tabAt
!=
null
)
{
tabAt
?.
let
{
//将每一个条目设置我们自定义的视图
tabAt
.
setCustomView
(
R
.
layout
.
layout_table_count_item
)
//通过tab对象找到自定义视图的ID
val
mTvTitle
=
tabAt
.
customView
!!
.
findViewById
<
TextView
>(
R
.
id
.
tv_table_item_title
)
val
mNumber
=
tabAt
.
customView
!!
.
findViewById
<
TextView
>(
R
.
id
.
tv_table_item_num
)
titles
.
add
(
mNumber
)
mTvTitle
.
setText
(
ints
[
i
])
mNumber
.
text
=
"0"
mNumber
.
setTextColor
(
ContextCompat
.
getColor
(
this
@DeliveryOrderMainActivity
,
colors
[
i
]))
//設置不同的顏色
mNumber
.
setTextColor
(
getCustomColor
(
colors
[
i
]))
//添加觀察者
while
(
pageViewModel
.
mOrderNum
.
size
<=
i
)
{
pageViewModel
.
mOrderNum
.
add
(
MutableLiveData
())
}
pageViewModel
.
mOrderNum
[
i
].
observe
(
instance
,
Observer
{
//綁定監聽,數量發生變化時修改顯示數據
pageViewModel
.
mOrderNum
[
i
].
observe
(
this
,
Observer
{
mNumber
.
text
=
it
.
toString
()
})
}
...
...
@@ -279,13 +286,12 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
/**
* 搜索
*/
private
fun
searchMethod
(
viewPager
:
ViewPager
)
{
private
fun
searchMethod
()
{
iv_search_order
.
setOnClickListener
{
//搜索
if
(
ed_order_num_search
.
text
!=
null
&&
ed_order_num_search
.
text
.
isNotEmpty
())
{
pageViewModel
.
phone
=
ed_order_num_search
.
text
.
toString
()
pageViewModel
.
getOrderList
(
restaurantId
.
toString
(),
viewPager
.
currentItem
,
"0"
,
false
)
// ToastUtils.show(this@DeliveryOrderMainActivity, "搜索到$it" + "條數據")
pageViewModel
.
getOrderList
(
view_pager
.
currentItem
,
"0"
,
false
)
}
else
{
ToastUtils
.
show
(
this
@DeliveryOrderMainActivity
,
"請輸入手機號或訂單號"
)
}
...
...
@@ -293,14 +299,13 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
}
private
var
restaurantPopup
:
QMUIPopup
?
=
null
private
var
stateBg
=
GradientDrawable
()
/**
* 切換餐廳狀態按鈕
*/
private
fun
initSwitchRestStatus
()
{
val
stateBg
=
GradientDrawable
()
stateBg
.
cornerRadius
=
QMUIDisplayHelper
.
dp2px
(
this
,
4
).
toFloat
()
//切換營業狀態
tv_restaurant_state
.
setOnClickListener
{
if
(
restaurantPopup
==
null
)
{
...
...
@@ -336,7 +341,6 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
restaurantPopup
?.
show
(
it
)
}
}
//綁定營業按鈕狀態
pageViewModel
.
restaurantState
.
observe
(
this
,
Observer
{
when
(
it
)
{
...
...
@@ -359,21 +363,25 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
}
tv_restaurant_state
.
background
=
stateBg
})
//顯示或收起餐廳營業信息
btn_open_or_close_info
.
setOnClickListener
{
setOrderInfoOpenOrClose
()
}
}
/**
* 更新餐廳營業狀態
*/
private
fun
updateRestaurantState
(
state
:
Int
)
{
if
(
state
!=
0
&&
state
!=
2
)
{
pageViewModel
.
updateRestOpenStatus
(
state
,
restaurantId
.
toString
()
)
pageViewModel
.
updateRestOpenStatus
(
state
)
}
else
{
//暫停接單,彈窗向用戶確認是否關閉
object
:
DialogUtils
(
this
,
R
.
layout
.
other_order_pause_orders
)
{
override
fun
initLayout
(
hepler
:
ViewHepler
,
dialog
:
Dialog
)
{
hepler
.
getView
<
TextView
>(
R
.
id
.
tv_dialog_confirm
).
setOnClickListener
{
it
.
isClickable
=
false
pageViewModel
.
updateRestOpenStatus
(
state
,
restaurantId
.
toString
()
)
pageViewModel
.
updateRestOpenStatus
(
state
)
dialog
.
dismiss
()
}
hepler
.
getView
<
TextView
>(
R
.
id
.
tv_dialog_cancel
).
setOnClickListener
{
...
...
@@ -385,8 +393,11 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
restaurantPopup
?.
dismiss
()
}
private
fun
initWebsocket
()
{
//開啟websocket
/**
* 初始化長連接
*/
private
fun
initWebSocket
()
{
//開啟webSocket
val
service
=
Intent
(
applicationContext
,
DataNotificationService
::
class
.
java
)
val
notification
:
NotificationManagerCompat
=
NotificationManagerCompat
.
from
(
this
)
if
(!
notification
.
areNotificationsEnabled
())
{
...
...
@@ -437,9 +448,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
unbindService
(
serviceConnection
)
}
var
bind
:
DataNotificationService
.
MyBind
?
=
null
var
lastRefreshTime
:
Long
=
0
private
var
serviceConnection
=
object
:
ServiceConnection
{
override
fun
onServiceConnected
(
name
:
ComponentName
,
service
:
IBinder
)
{
bind
=
service
as
DataNotificationService
.
MyBind
...
...
@@ -448,20 +457,20 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
override
fun
callBack
(
type
:
Int
)
{
//-1斷開連接,\n-2:消息傳輸錯誤,\n0:連接消息,\n1:登錄通知,\n2:登出通知,\n3:外賣送單通知,\n4:自取送單通知,\n5:歷史訂單通知,\n6:修改訂單狀態通知,\n7:支付成功通知"
if
(
type
==
3
||
type
==
4
||
type
==
5
||
type
==
6
||
type
==
7
||
type
==
0
)
{
val
currentTime
=
System
.
currentTimeMillis
()
if
(
currentTime
-
lastRefreshTime
>
1000
)
{
lastRefreshTime
=
currentTime
||
type
==
6
||
type
==
7
)
{
//上次是未確認訂單,本次的提示還是未確認訂單,就不刷新本地頁面
if
(!(
lastMsgType
==
5
&&
type
==
5
))
{
pageViewModel
.
refreshState
.
postValue
(
view_pager
.
currentItem
)
// 刷新餘額
pageViewModel
.
getBanlance
(
RestaurantInfoManager
.
newInstance
().
brandId
)
}
}
//刷新餘額
pageViewModel
.
getBanlance
(
RestaurantInfoManager
.
newInstance
().
getBrandId
())
//選擇了自動接單
if
(
cb_takeaway_auto_receiving_orders
.
isChecked
){
lastMsgType
=
type
// 選擇了自動接單,有訂單來就接單
if
(
cb_takeaway_auto_receiving_orders
.
isChecked
)
{
pageViewModel
.
startAutoConfirmOrder
()
}
}
}
})
it
.
execute
{
if
(
it
)
{
...
...
@@ -478,10 +487,6 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
}
}
private
var
isOpen
:
Boolean
=
true
private
val
btnOpenBg
by
lazy
{
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_white_bottom_border
)
!!
}
private
val
btnCloseBg
by
lazy
{
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_dialog_bg
)
!!
}
/**
* 顯示或收起餐廳營業信息
*/
...
...
@@ -534,20 +539,19 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
* 初始化標題欄
*/
private
fun
initAppTop
()
{
//獲取功能權限
val
newOrderFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
FunctionManagerConstants
.
takeaway
.
TAKEAWAY_NEW_ORDER
)
val
historyOrderFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
FunctionManagerConstants
.
takeaway
.
TAKEAWAY_HISTORY_ORDER
)
val
openCashBoxFunction
=
FunctionManager
.
getFunctionByKey
(
functionByResModule
,
FunctionManagerConstants
.
takeaway
.
TAKEAWAY_OPEN_CASH_BOX
)
qm_other_order_bar
.
setTitle
(
RestaurantInfoManager
.
newInstance
().
getRestaurantName
())
//顯示餐廳名
qm_other_order_bar
.
setTitle
(
RestaurantInfoManager
.
newInstance
().
restaurantName
)
qm_other_order_bar
.
addLeftImageButton
(
R
.
drawable
.
icon_return
,
R
.
id
.
iv_left_back
).
setOnClickListener
{
finish
()
}
//至少要有一個按鈕的權限,才添加右側按鈕
if
(
newOrderFunction
!=
null
||
historyOrderFunction
!=
null
||
openCashBoxFunction
!=
null
)
{
qm_other_order_bar
.
addRightImageButton
(
R
.
drawable
.
icon_topbar_overflow
,
R
.
id
.
topbar_right_change_button
).
setOnClickListener
{
//彈出彈窗
if
(
pop
==
null
)
{
val
view
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
layout_more_popup
,
null
)
pop
=
QMUIPopups
.
popup
(
this
)
.
preferredDirection
(
QMUIPopup
.
DIRECTION_BOTTOM
)
.
view
(
view
)
...
...
@@ -573,7 +577,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
tvNewOrder
.
setState
(
newOrderFunction
!=
null
)
tvNewOrder
.
setOnClickListener
(
this
)
}
else
{
pop
!!
.
show
(
it
)
pop
?
.
show
(
it
)
}
}
}
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliverySettingActivity.kt
View file @
f1f53df5
...
...
@@ -10,6 +10,9 @@ import com.gingersoft.gsa.delivery_pick_mode.ui.fragment.UpdateDeliveryFragment
import
com.jess.arms.mvp.IPresenter
import
kotlinx.android.synthetic.main.activity_delivery.*
/**
* 外送配置頁面,沒用了
*/
class
DeliverySettingActivity
:
BaseActivity
<
IPresenter
>()
{
lateinit
var
deliverylist_fragment
:
DeliveryFragment
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/fragment/DeliveryFragment.kt
View file @
f1f53df5
...
...
@@ -20,6 +20,9 @@ import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import
com.gingersoft.gsa.delivery_pick_mode.util.setState
import
kotlinx.android.synthetic.main.fragment_delivery_list.*
/**
* 外送配置頁面,沒用了
*/
class
DeliveryFragment
:
BaseFragment
()
{
var
deliveryListAdapter
:
DeliveryListAdapter
?
=
null
...
...
@@ -37,7 +40,6 @@ class DeliveryFragment : BaseFragment() {
override
fun
onActivityCreated
(
savedInstanceState
:
Bundle
?)
{
super
.
onActivityCreated
(
savedInstanceState
)
// childFragmentManager.beginTransaction().remove(this).add(null, "").addToBackStack(null).commit()
addBtn
.
text
=
"+添加配送方式"
addBtn
.
setOnClickListener
{
(
activity
as
DeliverySettingActivity
).
editDelivery
(
null
)
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/fragment/PlaceholderFragment.kt
View file @
f1f53df5
...
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.delivery_pick_mode.ui.fragment
import
android.content.Intent
import
android.os.Bundle
import
android.util.Log
import
androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.Observer
import
androidx.lifecycle.ViewModelProvider
...
...
@@ -17,40 +18,40 @@ import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.OtherOrdersAdapter
import
com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseFragment
import
com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import
com.gingersoft.gsa.delivery_pick_mode.util.setState
import
com.jess.arms.utils.LogUtils
import
kotlinx.android.synthetic.main.fragment_other_order.*
/**
* A placeholder fragment containing a simple view.
*/
class
PlaceholderFragment
:
BaseFragment
(
R
.
layout
.
fragment_other_order
)
{
private
val
pageViewModel
by
lazy
{
ViewModelProvider
(
activity
?.
viewModelStore
!!
,
InjectorUtil
.
getWeatherModelFactory
())[
PageViewModel
::
class
.
java
]
}
//請求數據頁數
private
var
page
=
1
private
val
restaurantId
by
lazy
{
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
}
private
val
memberId
by
lazy
{
UserContext
.
newInstance
().
getMemberId
()
}
private
lateinit
var
adapter
:
OtherOrdersAdapter
//當前fragment是第幾頁
private
var
position
=
0
private
lateinit
var
adapter
:
OtherOrdersAdapter
override
fun
onActivityCreated
(
savedInstanceState
:
Bundle
?)
{
super
.
onActivityCreated
(
savedInstanceState
)
//獲取頁數
position
=
arguments
?.
getInt
(
INDEX
)
?:
0
pageViewModel
.
apply
{
// 綁定狀態,如果這個值發生變化
// 綁定狀態,如果這個值發生變化
,並且是當前頁,就去獲取訂單列表
refreshState
.
observe
(
viewLifecycleOwner
,
Observer
{
if
(
position
==
it
)
{
page
=
1
getOrderList
(
false
)
}
})
//有多少個Fragment就添加多少個監聽
while
(
m
OrderList
.
size
<=
position
)
{
m
OrderList
.
add
(
MutableLiveData
())
while
(
m
FragmentData
.
size
<=
position
)
{
m
FragmentData
.
add
(
MutableLiveData
())
}
// 綁定監聽當前fragment的數據項
m
OrderList
[
position
].
observe
(
viewLifecycleOwner
,
Observer
{
m
FragmentData
[
position
].
observe
(
viewLifecycleOwner
,
Observer
{
cancelDialogForLoading
()
refresh_layout
.
finishRefresh
()
refresh_layout
.
finishLoadMore
()
...
...
@@ -88,11 +89,6 @@ class PlaceholderFragment : BaseFragment(R.layout.fragment_other_order) {
initRefresh
()
}
override
fun
onResume
()
{
super
.
onResume
()
refresh
()
}
private
fun
initRefresh
()
{
// 设置 Header 顏色
refresh_layout
.
setPrimaryColorsId
(
R
.
color
.
color_f0
,
R
.
color
.
color_66
)
...
...
@@ -100,7 +96,7 @@ class PlaceholderFragment : BaseFragment(R.layout.fragment_other_order) {
refresh_layout
.
setOnRefreshListener
{
refresh
()
//重新拉取一遍送貨員信息
pageViewModel
.
getDeliveryInfo
(
restaurantId
.
toString
(),
memberId
.
toString
()
)
pageViewModel
.
getDeliveryInfo
()
}
refresh_layout
.
setOnLoadMoreListener
{
page
++
...
...
@@ -153,7 +149,7 @@ class PlaceholderFragment : BaseFragment(R.layout.fragment_other_order) {
}
private
fun
getOrderList
(
isLoadMore
:
Boolean
)
{
pageViewModel
.
getOrderList
(
restaurantId
.
toString
(),
arguments
?.
getInt
(
INDEX
)
pageViewModel
.
getOrderList
(
arguments
?.
getInt
(
INDEX
)
?:
0
,
page
.
toString
(),
isLoadMore
)
}
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/util/OtherOrderUtils.kt
View file @
f1f53df5
...
...
@@ -32,7 +32,7 @@ import java.lang.Double.parseDouble
object
OtherOrderUtils
{
fun
showOrderDetailsDialog
(
context
:
Context
,
data
:
OrderDetails
,
orderStuats
:
Int
,
orderType
:
Int
,
orderPayType
:
Int
,
payType
:
Int
,
refundStatus
:
Int
,
reasonDesc
:
String
?
=
""
,
isHistory
:
Boolean
=
false
,
listenter
:
((
view
:
View
,
data
:
OrderDetails
.
DataBean
,
dialog
:
Dialog
)
->
Unit
)?)
{
fun
showOrderDetailsDialog
(
context
:
Context
,
data
:
OrderDetails
,
orderStuats
:
Int
,
orderType
:
Int
,
orderPayType
:
Int
,
payType
:
Int
,
refundStatus
:
Int
,
reasonDesc
:
String
?
=
""
,
isHistory
:
Boolean
=
false
,
listenter
:
((
view
:
View
,
data
:
OrderDetails
.
DataBean
,
dialog
:
Dialog
)
->
Unit
)?)
{
object
:
DialogUtils
(
context
,
R
.
layout
.
layout_order_info_dialog_new
)
{
override
fun
initLayout
(
hepler
:
ViewHepler
,
dialog
:
Dialog
)
{
if
(
data
.
data
!=
null
)
{
...
...
@@ -118,7 +118,7 @@ object OtherOrderUtils {
6
->
{
//已取消訂單
ivOrderState
.
setImageResource
(
R
.
drawable
.
img_cancelled
)
setOrderReason
(
hepler
,
orderStuats
,
refundStatus
,
orderPayType
,
payType
,
reasonDesc
)
setOrderReason
(
hepler
,
orderStuats
,
refundStatus
,
orderPayType
,
payType
,
reasonDesc
)
}
}
// val payName = StringBuffer()
...
...
@@ -211,14 +211,14 @@ object OtherOrderUtils {
.
show
()
}
private
fun
setOrderReason
(
holder
:
DialogUtils
.
ViewHepler
,
orderStatus
:
Int
,
refundStatus
:
Int
,
orderPayType
:
Int
,
payType
:
Int
,
reasonDesc
:
String
?)
{
private
fun
setOrderReason
(
holder
:
DialogUtils
.
ViewHepler
,
orderStatus
:
Int
,
refundStatus
:
Int
,
orderPayType
:
Int
,
payType
:
Int
,
reasonDesc
:
String
?)
{
var
tv_address_text
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_receive_address_text
)
var
tv_address
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_receive_address
)
var
tv_cancel_reason_text
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_cancel_reason_text
)
var
tv_cancel_reason
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_cancel_reason
)
var
tv_refund_reason_text
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_refund_reason_text
)
var
tv_refund_reason
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_refund_reason
)
var
refundReason
=
getRefundReasonByStatus
(
refundStatus
,
orderPayType
,
payType
);
var
refundReason
=
getRefundReasonByStatus
(
refundStatus
,
orderPayType
,
payType
);
if
(!
TextUtils
.
isEmpty
(
refundReason
))
{
if
(
refundStatus
==
5
)
{
tv_refund_reason
.
setTextColor
(
getColor
(
R
.
color
.
green_400
))
...
...
@@ -253,7 +253,7 @@ object OtherOrderUtils {
/**
* 獲取退款說明
*/
private
fun
getRefundReasonByStatus
(
refundStatus
:
Int
,
orderPayType
:
Int
,
payType
:
Int
):
String
{
private
fun
getRefundReasonByStatus
(
refundStatus
:
Int
,
orderPayType
:
Int
,
payType
:
Int
):
String
{
when
(
refundStatus
)
{
5
->
{
return
"退款完成"
...
...
@@ -285,7 +285,13 @@ object OtherOrderUtils {
private
var
soundPool
:
SoundPool
?
=
null
var
lastTime
:
Long
=
0
fun
initSoundPool
(
context
:
Context
,
resId
:
Int
)
{
//限制10秒提示一次
if
(
System
.
currentTimeMillis
()
-
lastTime
<
10
*
1000
)
{
return
}
lastTime
=
System
.
currentTimeMillis
()
//实例化SoundPool
//sdk版本21是SoundPool 的一个分水岭
if
(
soundPool
==
null
)
{
...
...
component-login/build.gradle
View file @
f1f53df5
...
...
@@ -126,7 +126,7 @@ dependencies {
addComponent
'component-delivery-pick'
addComponent
'component-manager'
addComponent
'component-coldchain'
//
addComponent 'component-supply-chain'
addComponent
'component-supply-chain'
addComponent
'component-webview'
addComponent
'component-scan'
addComponent
'component-pay'
...
...
component-supply-chain/src/main/AndroidManifest.xml
View file @
f1f53df5
...
...
@@ -24,7 +24,6 @@
android:name=
"com.yalantis.ucrop.UCropActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<!-- 哪個模塊用到,哪個模塊的androidmanifest裡面就要加這個 file_paths 要唯一-->
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"${applicationId}.fileprovider"
...
...
@@ -32,7 +31,7 @@
android:grantUriPermissions=
"true"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/
fil
e_paths"
/>
android:resource=
"@xml/
gsa_purchas
e_paths"
/>
</provider>
</application>
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/InventoryRecordBean.java
0 → 100644
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
import
lombok.Data
;
/**
* @author 宇航.
* User: admin
* Date: 2021/3/13
* Time: 9:54
* Use:庫存盤點記錄
*/
@Data
public
class
InventoryRecordBean
{
private
String
userName
;
private
int
uid
;
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/OrderCategoryBean.java
View file @
f1f53df5
...
...
@@ -26,6 +26,11 @@ public class OrderCategoryBean implements Serializable {
private
String
name
;
private
int
parentId
;
private
List
<
FoodCategoryTrees
>
foodCategoryTrees
;
/**
* 該分類下的食材信息,需要從接口獲取
*/
private
List
<
PurchaseFoodBean
>
foodInfo
;
public
FoodCategoryTrees
()
{
}
public
FoodCategoryTrees
(
int
id
)
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseFoodBean.java
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
import
com.gingersoft.supply_chain.mvp.content.Constant
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
...
...
@@ -20,7 +21,7 @@ import lombok.Data;
* Use:食材信息
*/
@Data
public
class
PurchaseFoodBean
implements
Serializable
{
public
class
PurchaseFoodBean
implements
Serializable
,
QMUISection
.
Model
<
PurchaseFoodBean
>
{
private
static
final
long
serialVersionUID
=
7084280906070243339L
;
public
static
final
String
CATEGORY_DIVIDER
=
"-"
;
private
Integer
id
;
...
...
@@ -155,4 +156,22 @@ public class PurchaseFoodBean implements Serializable {
}
return
clazz
;
}
@Override
public
PurchaseFoodBean
cloneForDiff
()
{
return
null
;
}
@Override
public
boolean
isSameItem
(
PurchaseFoodBean
other
)
{
return
false
;
}
@Override
public
boolean
isSameContent
(
PurchaseFoodBean
other
)
{
return
false
;
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WarehouseDetailsBean.java
View file @
f1f53df5
...
...
@@ -28,7 +28,7 @@ public class WarehouseDetailsBean {
private
String
orderNo
;
private
double
foodQuantity
;
private
double
totalPrice
;
// private String createTime;
// private String createTime;
private
String
supplierName
;
/**
* 單位
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/content/SupplyShoppingCart.java
View file @
f1f53df5
...
...
@@ -48,8 +48,8 @@ public class SupplyShoppingCart {
return
cartFoods
;
}
public
Map
<
Integer
,
SupplierInfoBean
>
getSupplierInfoBeanMap
(){
if
(
supplierInfoBeanMap
==
null
)
{
public
Map
<
Integer
,
SupplierInfoBean
>
getSupplierInfoBeanMap
()
{
if
(
supplierInfoBeanMap
==
null
)
{
supplierInfoBeanMap
=
new
HashMap
<>();
}
return
supplierInfoBeanMap
;
...
...
@@ -59,7 +59,7 @@ public class SupplyShoppingCart {
return
getSupplierInfoBeanMap
().
get
(
supplierId
);
}
public
void
updateSupplier
(
SupplierInfoBean
supplierInfoBean
){
public
void
updateSupplier
(
SupplierInfoBean
supplierInfoBean
)
{
getSupplierInfoBeanMap
().
put
(
supplierInfoBean
.
getId
(),
supplierInfoBean
);
}
...
...
@@ -85,6 +85,29 @@ public class SupplyShoppingCart {
}
}
public
void
replaceFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
RxJavaUtils
.
doInIOThread
(
new
RxIOTask
<
Object
>(
1
)
{
@Override
public
Void
doInIOThread
(
Object
o
)
{
for
(
int
i
=
0
;
i
<
getCartFoods
().
size
();
i
++)
{
PurchaseFoodBean
cartFood
=
getCartFoods
().
get
(
i
);
//找到這個食品
if
(
purchaseFoodBean
.
getId
().
equals
(
cartFood
.
getId
()))
{
int
foodNum
=
cartFood
.
getFoodQuantity
();
purchaseFoodBean
.
setFoodQuantity
(
foodNum
);
if
(
getSupplierInfoBeanMap
().
get
(
purchaseFoodBean
.
getSupplierId
())
!=
null
)
{
//可能用戶修改了食品的供應商信息,但是這裡是沒有供應商的詳細,直接移除食品
getCartFoods
().
add
(
i
,
purchaseFoodBean
);
}
cartFoods
.
remove
(
cartFood
);
break
;
}
}
return
null
;
}
});
}
public
void
clear
()
{
if
(
cartFoods
==
null
)
{
return
;
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/SendMsgContract.java
View file @
f1f53df5
...
...
@@ -35,6 +35,11 @@ public interface SendMsgContract {
* 發送成功,切換到下一個供應商並選中默認發送方式
*/
void
sendSuccess
();
/**
* 回退到採購單列表
*/
void
backToOrderList
();
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/WarehousingInventoryContract.java
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
contract
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.supply_chain.mvp.bean.InventoryRecordBean
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
import
java.util.List
;
import
java.util.Map
;
import
io.reactivex.Observable
;
...
...
@@ -27,7 +29,7 @@ public interface WarehousingInventoryContract {
interface
View
extends
IView
{
void
updateSuccess
();
void
loadRecord
();
void
loadRecord
(
List
<
InventoryRecordBean
>
inventoryRecordBeans
);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/NewFoodIngredientsPresenter.java
View file @
f1f53df5
...
...
@@ -401,6 +401,7 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
*/
public
void
updateFood
(
PurchaseFoodBean
purchaseFoodBean
)
{
//後台不要,不然修改供應商不成功
int
supplierId
=
purchaseFoodBean
.
getSupplierId
();
purchaseFoodBean
.
setSupplierId
(
null
);
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
purchaseFoodBean
));
mModel
.
updateFood
(
requestBody
)
...
...
@@ -416,25 +417,8 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
if
(
baseResult
.
isSuccess
())
{
mRootView
.
showMessage
(
Constant
.
UPDATE_SUCCESS
);
mRootView
.
updateFoodInfoSuccess
(
purchaseFoodBean
.
getSupplierName
(),
purchaseFoodBean
.
getFoodCategoryName
());
RxJavaUtils
.
doInIOThread
(
new
RxIOTask
<
Object
>(
1
)
{
@Override
public
Void
doInIOThread
(
Object
o
)
{
//修改完食品後,需要查看購物車中的這個食品,也要進行修改
List
<
PurchaseFoodBean
>
cartFoods
=
SupplyShoppingCart
.
getInstance
().
getCartFoods
();
for
(
int
i
=
0
;
i
<
cartFoods
.
size
();
i
++)
{
PurchaseFoodBean
cartFood
=
cartFoods
.
get
(
i
);
if
(
purchaseFoodBean
.
getId
().
equals
(
cartFood
.
getId
()))
{
//找到這個食品
int
foodNum
=
cartFood
.
getFoodQuantity
();
cartFoods
.
remove
(
cartFood
);
purchaseFoodBean
.
setFoodQuantity
(
foodNum
);
SupplyShoppingCart
.
getInstance
().
addFood
(
i
,
purchaseFoodBean
);
return
null
;
}
}
return
null
;
}
});
purchaseFoodBean
.
setSupplierId
(
supplierId
);
SupplyShoppingCart
.
getInstance
().
replaceFood
(
purchaseFoodBean
);
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
baseResult
.
getErrMsg
()))
{
mRootView
.
showMessage
(
baseResult
.
getErrMsg
());
}
else
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/SendMsgPresenter.java
View file @
f1f53df5
...
...
@@ -79,35 +79,15 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
this
.
mApplication
=
null
;
}
public
void
getPurchaseOrderQrCode
(
String
orderId
)
{
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
qrCodeMap
.
get
(
orderId
)))
{
// mRootView.loadQrCode(qrCodeMap.get(orderId));
return
;
}
mModel
.
getPurchaseOrderQrCode
(
orderId
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"獲取訂單內容..."
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
.
isSuccess
()
&&
info
.
getData
()
!=
null
)
{
qrCodeMap
.
put
(
orderId
,
info
.
getData
().
toString
());
// mRootView.loadQrCode(qrCodeMap.get(orderId));
}
}
});
}
static
class
PurchaseMsgBean
{
private
int
orderId
;
private
int
type
;
private
String
configText
;
}
/**
* 發送採購信息
*/
public
void
sendMsg
()
{
if
(
sendSupplierMsgBeans
==
null
)
{
mRootView
.
showMessage
(
"供應商信息獲取失敗,請退出重試"
);
...
...
@@ -140,6 +120,11 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
}
}
/**
* 跟進訂單id和發送類型發送消息
* @param purchaseMsgBean 發送消息類
* @param sendType 發送類型
*/
public
void
sendMsgByOrderIdAndType
(
PurchaseMsgBean
purchaseMsgBean
,
int
sendType
)
{
mModel
.
senMsg
(
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
purchaseMsgBean
)))
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -173,6 +158,37 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
});
}
/**
* 獲取發送到供應商的消息內容並保存
* @param orderId 訂單id
*/
public
void
getSendMsgAndSave
(
int
orderId
)
{
PurchaseMsgBean
purchaseMsgBean
=
new
PurchaseMsgBean
();
purchaseMsgBean
.
orderId
=
orderId
;
purchaseMsgBean
.
type
=
SupplierInfoBean
.
SupplierContacts
.
Whatsapp
;
mModel
.
senMsg
(
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
purchaseMsgBean
)))
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"正在獲取發送內容..."
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
.
isSuccess
()
&&
info
.
getData
()
!=
null
)
{
MsgConfigBean
msgConfigBean
=
GsonUtils
.
GsonToBean
(
info
.
getData
(),
MsgConfigBean
.
class
);
qrCodeMap
.
put
(
orderId
+
""
,
msgConfigBean
.
getConfigText
());
}
}
});
}
/**
* 根據不同的類型發送消息
* @param sendType 發送類型
* @param purchaseMsgBean 發送類
*/
private
void
sendMsgByType
(
int
sendType
,
PurchaseMsgBean
purchaseMsgBean
)
{
if
(
sendType
==
Whatsapp
)
{
mRootView
.
shareThirdApp
(
qrCodeMap
.
get
(
purchaseMsgBean
.
orderId
+
""
),
Whatsapp
);
...
...
@@ -191,6 +207,16 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
}
}
/**
* 獲取發送url
*
* @return
*/
public
String
getSendUrl
()
{
SendSupplierMsgBean
sendSupplierMsgBean
=
sendSupplierMsgBeans
.
get
(
currentSelectedSupplier
);
return
qrCodeMap
.
get
(
sendSupplierMsgBean
.
getOrderId
()
+
""
);
}
public
void
getSupplierListByOrders
(
List
<
ConfirmOrderBean
.
PurchaseOrder
>
purchaseOrders
)
{
//將訂單信息轉為用於顯示的供應商信息
if
(
purchaseOrders
!=
null
)
{
...
...
@@ -234,8 +260,11 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
public
void
getContactsBySupplier
(
int
supplierIndex
)
{
String
supplierId
;
if
(
sendSupplierMsgBeans
!=
null
&&
sendSupplierMsgBeans
.
size
()
>
supplierIndex
)
{
//切換當前選中
currentSelectedSupplier
=
supplierIndex
;
//拿到供應商id
supplierId
=
sendSupplierMsgBeans
.
get
(
supplierIndex
).
getId
()
+
""
;
//從緩存中取出供應商聯繫方式
List
<
SupplierInfoBean
.
SupplierContacts
>
supplierContacts
=
sendSupplierMsgBeans
.
get
(
supplierIndex
).
getSupplierContacts
();
//把所有的供應鏈聯繫方式關閉
for
(
SendSupplierMsgBean
sendSupplierMsgBean
:
sendSupplierMsgBeans
)
{
...
...
@@ -251,9 +280,12 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
return
;
}
else
{
mRootView
.
loadSupplierList
(
sendSupplierMsgBeans
);
//通過聯繫方式獲取發送內容,然後保存
getSendMsgAndSave
(
sendSupplierMsgBeans
.
get
(
supplierIndex
).
getOrderId
());
}
}
}
else
{
mRootView
.
backToOrderList
();
return
;
}
getSupplierContactById
(
supplierIndex
,
supplierId
);
...
...
@@ -261,6 +293,7 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
/**
* 跟進供應商id 獲取供應商聯繫方式
*
* @param supplierIndex 供應商下標,獲取到聯繫方式之後刷新
* @param supplierId 供應商id
*/
...
...
@@ -289,6 +322,8 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
SendSupplierMsgBean
sendSupplierMsgBean
=
sendSupplierMsgBeans
.
get
(
supplierIndex
);
sendSupplierMsgBean
.
setSupplierContacts
(
supplierContacts
);
mRootView
.
loadSupplierList
(
sendSupplierMsgBeans
);
//通過聯繫方式獲取發送內容,然後保存
getSendMsgAndSave
(
sendSupplierMsgBeans
.
get
(
supplierIndex
).
getOrderId
());
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
info
.
getErrMsg
()))
{
mRootView
.
showMessage
(
info
.
getErrMsg
());
}
else
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WarehousingInventoryPresenter.java
View file @
f1f53df5
...
...
@@ -3,7 +3,9 @@ package com.gingersoft.supply_chain.mvp.presenter;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.supply_chain.mvp.bean.InventoryRecordBean
;
import
com.gingersoft.supply_chain.mvp.content.Constant
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.di.scope.FragmentScope
;
...
...
@@ -22,6 +24,7 @@ import com.gingersoft.supply_chain.mvp.contract.WarehousingInventoryContract;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -118,7 +121,8 @@ public class WarehousingInventoryPresenter extends BasePresenter<WarehousingInve
@Override
public
void
onNext
(
BaseResult
baseResult
)
{
if
(
baseResult
!=
null
&&
baseResult
.
isSuccess
())
{
List
<
InventoryRecordBean
>
inventoryRecordBeans
=
GsonUtils
.
jsonToList
(
baseResult
.
getData
(),
InventoryRecordBean
.
class
);
mRootView
.
loadRecord
(
inventoryRecordBeans
);
}
else
if
(
baseResult
!=
null
&&
TextUtil
.
isNotEmptyOrNullOrUndefined
(
baseResult
.
getErrMsg
()))
{
mRootView
.
showMessage
(
baseResult
.
getErrMsg
());
}
else
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/BaseCategoryAdapter.java
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.widget.TextView
;
import
androidx.cardview.widget.CardView
;
...
...
@@ -11,7 +9,6 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.common.R
;
import
com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
...
...
@@ -28,18 +25,18 @@ import java.util.List;
public
class
BaseCategoryAdapter
extends
BaseQuickAdapter
<
CategoryBean
,
BaseViewHolder
>
{
private
int
selectedIndex
=
0
;
private
Drawable
selectedBg
;
private
Drawable
unSelectedBg
;
private
int
selectedBg
;
private
int
unSelectedBg
;
private
int
selectColor
=
-
1
;
private
int
unSelectColor
=
-
1
;
private
boolean
showDelete
=
false
;
public
BaseCategoryAdapter
(
@Nullable
List
<
CategoryBean
>
data
,
Context
context
)
{
super
(
R
.
layout
.
item_category
,
data
);
public
BaseCategoryAdapter
(
@Nullable
List
<
CategoryBean
>
data
)
{
super
(
R
.
layout
.
item_
base_
category
,
data
);
addChildClickViewIds
(
R
.
id
.
iv_category_delete
);
selectedBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
shape_left_radio_shadow
)
;
unSelectedBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
color
.
trans
)
;
selectedBg
=
R
.
drawable
.
shape_left_radio_shadow
;
unSelectedBg
=
R
.
color
.
trans
;
}
@Override
...
...
@@ -48,18 +45,14 @@ public class BaseCategoryAdapter extends BaseQuickAdapter<CategoryBean, BaseView
tvCategoryName
.
setText
(
categoryBean
.
getCategoryName
());
CardView
view
=
viewHolder
.
getView
(
R
.
id
.
layout_category
);
if
(
viewHolder
.
getAdapterPosition
()
==
selectedIndex
)
{
if
(
selectedBg
!=
null
)
{
view
.
setBackground
(
selectedBg
);
}
view
.
setBackground
(
ContextCompat
.
getDrawable
(
getContext
(),
selectedBg
));
if
(
selectColor
!=
-
1
)
{
tvCategoryName
.
setTextColor
(
selectColor
);
}
tvCategoryName
.
setSelected
(
true
);
}
else
{
tvCategoryName
.
setSelected
(
false
);
if
(
unSelectedBg
!=
null
)
{
view
.
setBackground
(
unSelectedBg
);
}
view
.
setBackground
(
ContextCompat
.
getDrawable
(
getContext
(),
unSelectedBg
));
if
(
unSelectColor
!=
-
1
)
{
tvCategoryName
.
setTextColor
(
unSelectColor
);
}
...
...
@@ -72,12 +65,12 @@ public class BaseCategoryAdapter extends BaseQuickAdapter<CategoryBean, BaseView
notifyDataSetChanged
();
}
public
BaseCategoryAdapter
setSelectedBg
(
Drawable
selectedBg
)
{
public
BaseCategoryAdapter
setSelectedBg
(
int
selectedBg
)
{
this
.
selectedBg
=
selectedBg
;
return
this
;
}
public
BaseCategoryAdapter
setUnSelectedBg
(
Drawable
unSelectedBg
)
{
public
BaseCategoryAdapter
setUnSelectedBg
(
int
unSelectedBg
)
{
this
.
unSelectedBg
=
unSelectedBg
;
return
this
;
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/BuyIngredientsAdapter.java
0 → 100644
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.text.Editable
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
com.gingersoft.gsa.cloud.common.utils.glide.GlideUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean
;
import
com.gingersoft.gsa.cloud.ui.view.section.QDSectionHeaderView
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodBean
;
import
com.google.android.material.textfield.TextInputEditText
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.layout.QMUIButton
;
import
com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
/**
* @author 宇航.
* User: admin
* Date: 2021/3/11
* Time: 16:18
* Use: 食材列表
*/
public
class
BuyIngredientsAdapter
extends
QMUIDefaultStickySectionAdapter
<
CategoryBean
,
PurchaseFoodBean
>
{
private
Context
context
;
private
boolean
isShowDouble
=
false
;
public
BuyIngredientsAdapter
(
Context
context
,
List
<
QMUISection
<
CategoryBean
,
PurchaseFoodBean
>>
food
)
{
this
.
context
=
context
;
setData
(
food
);
}
@NonNull
@Override
protected
HeadViewHolder
onCreateSectionHeaderViewHolder
(
@NonNull
ViewGroup
viewGroup
)
{
return
new
HeadViewHolder
(
LayoutInflater
.
from
(
viewGroup
.
getContext
()).
inflate
(
R
.
layout
.
item_buy_food_ingredient_header
,
viewGroup
,
false
));
}
public
int
getLayoutId
()
{
if
(
isShowDouble
)
{
return
R
.
layout
.
item_buy_food_ingredient_double_row
;
}
return
R
.
layout
.
item_buy_food_ingredient
;
}
public
void
setShowDoubleRow
(
boolean
showType
)
{
isShowDouble
=
showType
;
}
@NonNull
@Override
protected
ItemViewHolder
onCreateSectionItemViewHolder
(
@NonNull
ViewGroup
viewGroup
)
{
return
new
ItemViewHolder
(
LayoutInflater
.
from
(
viewGroup
.
getContext
()).
inflate
(
getLayoutId
(),
viewGroup
,
false
));
}
@Override
protected
void
onBindSectionHeader
(
QMUIStickySectionAdapter
.
ViewHolder
holder
,
int
position
,
QMUISection
<
CategoryBean
,
PurchaseFoodBean
>
section
)
{
super
.
onBindSectionHeader
(
holder
,
position
,
section
);
HeadViewHolder
headViewHolder
=
(
HeadViewHolder
)
holder
;
headViewHolder
.
tvHeader
.
setText
(
section
.
getHeader
().
getCategoryName
());
}
@Override
protected
void
onBindSectionItem
(
QMUIStickySectionAdapter
.
ViewHolder
holder
,
int
position
,
QMUISection
<
CategoryBean
,
PurchaseFoodBean
>
section
,
int
itemIndex
)
{
super
.
onBindSectionItem
(
holder
,
position
,
section
,
itemIndex
);
ItemViewHolder
itemViewHolder
=
(
ItemViewHolder
)
holder
;
PurchaseFoodBean
purchaseFoodBean
=
section
.
getItemList
().
get
(
itemIndex
);
itemViewHolder
.
tvSupplierName
.
setText
(
purchaseFoodBean
.
getSupplierName
());
itemViewHolder
.
ivFoodIngredientImg
.
setImageResource
(
R
.
drawable
.
img_small_default
);
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
purchaseFoodBean
.
getImages
()))
{
GlideUtils
.
display
(
itemViewHolder
.
ivFoodIngredientImg
.
getContext
(),
itemViewHolder
.
ivFoodIngredientImg
,
purchaseFoodBean
.
getImages
());
}
itemViewHolder
.
tvFoodItemNo
.
setText
(
purchaseFoodBean
.
getFoodNo
());
itemViewHolder
.
tvFoodItemName
.
setText
(
purchaseFoodBean
.
getName
());
//如果有包裝描述就顯示包裝描述,沒有包裝描述顯示基本單位
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
purchaseFoodBean
.
getPackingDescription
()))
{
itemViewHolder
.
tvFoodItemUnit
.
setText
(
purchaseFoodBean
.
getPackingDescription
());
}
else
{
itemViewHolder
.
tvFoodItemUnit
.
setText
(
purchaseFoodBean
.
getBasicUnitName
());
}
itemViewHolder
.
tvFoodItemPrice
.
setText
(
String
.
format
(
context
.
getString
(
R
.
string
.
amount_string
),
purchaseFoodBean
.
getUnitPrice
()));
itemViewHolder
.
edFoodIngredientNumber
.
setText
(
String
.
valueOf
(
purchaseFoodBean
.
getFoodQuantity
()),
TextView
.
BufferType
.
EDITABLE
);
//如果數量小於等於0,就不顯示減號和數量
setSubAndNumShow
(
itemViewHolder
,
purchaseFoodBean
.
getFoodQuantity
()
<=
0
);
//編輯數量
itemViewHolder
.
btnFoodOperationSub
.
setOnClickListener
(
v
->
{
//食材數量減少
if
(
purchaseFoodBean
.
getFoodQuantity
()
>
0
)
{
purchaseFoodBean
.
setFoodQuantity
(
purchaseFoodBean
.
getFoodQuantity
()
-
1
);
itemViewHolder
.
edFoodIngredientNumber
.
setText
(
String
.
valueOf
(
purchaseFoodBean
.
getFoodQuantity
()));
}
setSubAndNumShow
(
itemViewHolder
,
purchaseFoodBean
.
getFoodQuantity
()
<=
0
);
});
itemViewHolder
.
btnFoodOperationAdd
.
setOnClickListener
(
v
->
{
//食材數量增加
purchaseFoodBean
.
setFoodQuantity
(
purchaseFoodBean
.
getFoodQuantity
()
+
1
);
itemViewHolder
.
edFoodIngredientNumber
.
setText
(
String
.
valueOf
(
purchaseFoodBean
.
getFoodQuantity
()));
setSubAndNumShow
(
itemViewHolder
,
true
);
});
//輸入框焦點監聽
itemViewHolder
.
edFoodIngredientNumber
.
setOnFocusChangeListener
((
v
,
hasFocus
)
->
{
Editable
text
=
itemViewHolder
.
edFoodIngredientNumber
.
getText
();
if
(!
hasFocus
)
{
//當失去焦點時,如果沒有食品數量了,就隱藏減號和輸入框
if
(
TextUtil
.
isEmptyOrNullOrUndefined
(
text
)
||
Integer
.
parseInt
(
text
.
toString
())
==
0
)
{
setSubAndNumShow
(
itemViewHolder
,
false
);
}
}
});
}
/**
* 設置減少按鈕和輸入框的顯示或隱藏
*
* @param showOrHide 顯示或隱藏
*/
private
void
setSubAndNumShow
(
ItemViewHolder
itemViewHolder
,
boolean
showOrHide
)
{
itemViewHolder
.
btnFoodOperationSub
.
setVisibility
(
showOrHide
?
View
.
GONE
:
View
.
VISIBLE
);
itemViewHolder
.
edFoodIngredientNumber
.
setVisibility
(
showOrHide
?
View
.
INVISIBLE
:
View
.
VISIBLE
);
}
public
static
class
HeadViewHolder
extends
QMUIStickySectionAdapter
.
ViewHolder
{
@BindView
(
R2
.
id
.
tv_buy_food_header
)
QMUIAlphaTextView
tvHeader
;
public
HeadViewHolder
(
View
itemView
)
{
super
(
itemView
);
ButterKnife
.
bind
(
this
,
itemView
);
}
}
public
static
class
ItemViewHolder
extends
QMUIStickySectionAdapter
.
ViewHolder
{
@BindView
(
R2
.
id
.
iv_food_ingredient_img
)
ImageView
ivFoodIngredientImg
;
@BindView
(
R2
.
id
.
tv_food_item_no
)
TextView
tvFoodItemNo
;
@BindView
(
R2
.
id
.
tv_food_item_supplier_name
)
TextView
tvSupplierName
;
@BindView
(
R2
.
id
.
tv_food_item_name
)
TextView
tvFoodItemName
;
@BindView
(
R2
.
id
.
tv_food_item_unit
)
TextView
tvFoodItemUnit
;
@BindView
(
R2
.
id
.
tv_food_item_price
)
TextView
tvFoodItemPrice
;
@BindView
(
R2
.
id
.
btn_food_operation_sub
)
QMUIButton
btnFoodOperationSub
;
@BindView
(
R2
.
id
.
ed_food_ingredient_number
)
TextInputEditText
edFoodIngredientNumber
;
@BindView
(
R2
.
id
.
btn_food_operation_add
)
QMUIButton
btnFoodOperationAdd
;
public
ItemViewHolder
(
View
itemView
)
{
super
(
itemView
);
ButterKnife
.
bind
(
this
,
itemView
);
}
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/CategoryAdapter.java
View file @
f1f53df5
...
...
@@ -35,7 +35,7 @@ public class CategoryAdapter extends BaseQuickAdapter<OrderCategoryBean.FoodCate
private
boolean
showDelete
=
false
;
public
CategoryAdapter
(
@Nullable
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
data
,
Context
context
)
{
super
(
R
.
layout
.
item_category
,
data
);
super
(
R
.
layout
.
item_
base_
category
,
data
);
addChildClickViewIds
(
R
.
id
.
iv_category_delete
);
selectedBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
shape_left_radio_shadow
);
unSelectedBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
color
.
trans
);
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/FirstLevelCategoryAdapter.java
0 → 100644
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.widget.TextView
;
import
androidx.cardview.widget.CardView
;
import
androidx.core.content.ContextCompat
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.common.R
;
import
com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.List
;
/**
* @author 宇航.
* User: admin
* Date: 2020/11/28
* Time: 11:45
* Use: 一級分類
*/
public
class
FirstLevelCategoryAdapter
extends
BaseQuickAdapter
<
OrderCategoryBean
.
FoodCategoryTrees
,
BaseViewHolder
>
{
private
int
selectedIndex
=
0
;
private
Drawable
selectedBg
;
private
Drawable
unSelectedBg
;
private
int
selectColor
=
-
1
;
private
int
unSelectColor
=
-
1
;
public
FirstLevelCategoryAdapter
(
@Nullable
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
data
,
Context
context
)
{
super
(
R
.
layout
.
item_first_level_category
,
data
);
selectedBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
shape_left_radio_shadow
);
unSelectedBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
color
.
trans
);
selectColor
=
ContextCompat
.
getColor
(
context
,
R
.
color
.
other_order_details_sure_btn_color
);
unSelectColor
=
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_3c
);
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
OrderCategoryBean
.
FoodCategoryTrees
categoryBean
)
{
TextView
tvCategoryName
=
viewHolder
.
getView
(
R
.
id
.
tv_category_name
);
tvCategoryName
.
setText
(
categoryBean
.
getName
());
CardView
view
=
viewHolder
.
getView
(
R
.
id
.
layout_category
);
//選中時的背景和文字顏色
if
(
viewHolder
.
getAdapterPosition
()
==
selectedIndex
)
{
if
(
selectedBg
!=
null
)
{
view
.
setBackground
(
selectedBg
);
}
if
(
selectColor
!=
-
1
)
{
tvCategoryName
.
setTextColor
(
selectColor
);
}
tvCategoryName
.
setSelected
(
true
);
}
else
{
tvCategoryName
.
setSelected
(
false
);
if
(
unSelectedBg
!=
null
)
{
view
.
setBackground
(
unSelectedBg
);
}
if
(
unSelectColor
!=
-
1
)
{
tvCategoryName
.
setTextColor
(
unSelectColor
);
}
}
}
public
FirstLevelCategoryAdapter
setSelectedBg
(
Drawable
selectedBg
)
{
this
.
selectedBg
=
selectedBg
;
return
this
;
}
public
FirstLevelCategoryAdapter
setUnSelectedBg
(
Drawable
unSelectedBg
)
{
this
.
unSelectedBg
=
unSelectedBg
;
return
this
;
}
public
FirstLevelCategoryAdapter
setSelectColor
(
int
selectColor
)
{
this
.
selectColor
=
selectColor
;
return
this
;
}
public
FirstLevelCategoryAdapter
setUnSelectColor
(
int
unSelectColor
)
{
this
.
unSelectColor
=
unSelectColor
;
return
this
;
}
public
void
setSelectedIndex
(
int
selectedIndex
)
{
this
.
selectedIndex
=
selectedIndex
;
notifyDataSetChanged
();
}
public
int
getSelectedIndex
()
{
return
selectedIndex
;
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/FoodListAdapter.java
View file @
f1f53df5
...
...
@@ -82,10 +82,9 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodBean, BaseView
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
PurchaseFoodBean
foodInfoBean
)
{
viewHolder
.
setText
(
R
.
id
.
tv_food_item_supplier_name
,
foodInfoBean
.
getSupplierName
());
ImageView
foodImg
=
viewHolder
.
getView
(
R
.
id
.
iv_food_ingredient_img
);
foodImg
.
setImageResource
(
R
.
drawable
.
img_small_default
);
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
foodInfoBean
.
getImages
()))
{
GlideUtils
.
display
(
context
,
foodImg
,
foodInfoBean
.
getImages
());
}
else
{
foodImg
.
setImageResource
(
R
.
drawable
.
img_small_default
);
}
viewHolder
.
setText
(
R
.
id
.
tv_food_item_no
,
foodInfoBean
.
getFoodNo
());
viewHolder
.
setText
(
R
.
id
.
tv_food_item_name
,
foodInfoBean
.
getName
());
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/InventoryRecordAdapter.java
0 → 100644
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
androidx.core.content.ContextCompat
;
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.InventoryRecordBean
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.List
;
import
cn.bingoogolapple.baseadapter.BGABaseAdapterUtil
;
/**
* @author 宇航.
* User: admin
* Date: 2021/3/13
* Time: 10:02
* Use:
*/
public
class
InventoryRecordAdapter
extends
BaseQuickAdapter
<
InventoryRecordBean
,
BaseViewHolder
>
{
private
int
[]
colors
=
new
int
[]{
R
.
color
.
color_f9
,
R
.
color
.
white
};
public
InventoryRecordAdapter
(
@Nullable
List
<
InventoryRecordBean
>
data
)
{
super
(
R
.
layout
.
item_inventory_record
,
data
);
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
InventoryRecordBean
inventoryRecordBean
)
{
viewHolder
.
setText
(
R
.
id
.
tv_inventory_record_username
,
inventoryRecordBean
.
getUserName
());
viewHolder
.
setText
(
R
.
id
.
tv_inventory_record_number
,
inventoryRecordBean
.
getUserName
());
viewHolder
.
setText
(
R
.
id
.
tv_inventory_record_difference
,
inventoryRecordBean
.
getUserName
());
viewHolder
.
setText
(
R
.
id
.
tv_inventory_record_operating_data
,
inventoryRecordBean
.
getUserName
());
viewHolder
.
setTextColor
(
R
.
id
.
tv_inventory_record_username
,
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_3c
));
viewHolder
.
setTextColor
(
R
.
id
.
tv_inventory_record_number
,
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_3c
));
viewHolder
.
setTextColor
(
R
.
id
.
tv_inventory_record_difference
,
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_3c
));
viewHolder
.
setTextColor
(
R
.
id
.
tv_inventory_record_operating_data
,
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
color_3c
));
viewHolder
.
setBackgroundColor
(
R
.
id
.
layout_inventory_record
,
BGABaseAdapterUtil
.
getColor
(
colors
[
viewHolder
.
getAdapterPosition
()
%
2
]));
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/PurchaseOrderAdapter.java
View file @
f1f53df5
...
...
@@ -41,5 +41,6 @@ public class PurchaseOrderAdapter extends BaseQuickAdapter<OrderBean, BaseViewHo
viewHolder
.
setText
(
R
.
id
.
tv_purchase_order_total_price
,
String
.
format
(
getContext
().
getString
(
R
.
string
.
amount_string_s
),
MoneyUtil
.
formatDouble
(
purchaseOrderBean
.
getTotalAmount
())));
viewHolder
.
setText
(
R
.
id
.
btn_receiver_goods
,
PurchaseOrderDetailsBean
.
getStringByOrderState
(
purchaseOrderBean
.
getStatus
()));
viewHolder
.
setTextColor
(
R
.
id
.
btn_receiver_goods
,
ContextCompat
.
getColor
(
getContext
(),
PurchaseOrderDetailsBean
.
getColorByOrderState
(
purchaseOrderBean
.
getStatus
())));
viewHolder
.
setGone
(
R
.
id
.
iv_viewed
,
!
purchaseOrderBean
.
isVisibleState
());
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/SecondCategoryAdapter.java
0 → 100644
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.view.View
;
import
android.widget.FrameLayout
;
import
android.widget.TextView
;
import
androidx.cardview.widget.CardView
;
import
androidx.core.content.ContextCompat
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.List
;
/**
* @author 宇航.
* User: admin
* Date: 2020/11/28
* Time: 15:41
* Use: 採購食材頁面二級分類
*/
public
class
SecondCategoryAdapter
extends
BaseQuickAdapter
<
OrderCategoryBean
.
FoodCategoryTrees
,
BaseViewHolder
>
{
private
int
selectIndex
=
0
;
private
int
checkedBg
;
private
int
unCheckedBg
;
private
int
checkedTextColor
;
private
int
unCheckedTextColor
;
public
SecondCategoryAdapter
(
Context
context
,
@Nullable
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
data
)
{
super
(
R
.
layout
.
item_purchase_second_category
,
data
);
checkedBg
=
R
.
drawable
.
shape_theme_twelve_corners_bg
;
unCheckedBg
=
R
.
drawable
.
shape_white_twelve_corners_bg
;
checkedTextColor
=
ContextCompat
.
getColor
(
context
,
R
.
color
.
white
);
unCheckedTextColor
=
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_3c
);
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
OrderCategoryBean
.
FoodCategoryTrees
categoryBean
)
{
viewHolder
.
setText
(
R
.
id
.
tv_second_category_title
,
categoryBean
.
getName
());
TextView
tvName
=
viewHolder
.
getView
(
R
.
id
.
tv_second_category_title
);
CardView
cardView
=
viewHolder
.
getView
(
R
.
id
.
card_purchase_category
);
viewHolder
.
setVisible
(
R
.
id
.
tv_second_category_title
,
TextUtil
.
isNotEmptyOrNullOrUndefined
(
categoryBean
.
getName
()));
if
(
viewHolder
.
getAdapterPosition
()
==
selectIndex
)
{
cardView
.
setBackground
(
ContextCompat
.
getDrawable
(
getContext
(),
checkedBg
));
tvName
.
setTextColor
(
checkedTextColor
);
}
else
{
cardView
.
setBackground
(
ContextCompat
.
getDrawable
(
getContext
(),
unCheckedBg
));
tvName
.
setTextColor
(
unCheckedTextColor
);
}
}
public
SecondCategoryAdapter
setCheckedBg
(
int
checkedBg
)
{
this
.
checkedBg
=
checkedBg
;
return
this
;
}
public
SecondCategoryAdapter
setUnCheckedBg
(
int
unCheckedBg
)
{
this
.
unCheckedBg
=
unCheckedBg
;
return
this
;
}
public
SecondCategoryAdapter
setSelectIndex
(
int
selectIndex
)
{
int
lastIndex
=
this
.
selectIndex
;
this
.
selectIndex
=
selectIndex
;
if
(
lastIndex
>=
0
&&
lastIndex
<
getItemCount
())
{
notifyItemChanged
(
lastIndex
);
}
if
(
this
.
selectIndex
>=
0
&&
this
.
selectIndex
<
getItemCount
())
{
notifyItemChanged
(
this
.
selectIndex
);
}
return
this
;
}
public
SecondCategoryAdapter
setCheckedTextColor
(
int
checkedTextColor
)
{
this
.
checkedTextColor
=
checkedTextColor
;
return
this
;
}
public
SecondCategoryAdapter
setUnCheckedTextColor
(
int
unCheckedTextColor
)
{
this
.
unCheckedTextColor
=
unCheckedTextColor
;
return
this
;
}
public
int
getSelectIndex
()
{
return
selectIndex
;
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/WareHousingDetailsAdapter.java
View file @
f1f53df5
...
...
@@ -32,25 +32,14 @@ public class WareHousingDetailsAdapter extends BaseQuickAdapter<WarehouseDetails
* 入庫顯示+,出庫顯示-
*/
private
int
type
;
/**
* 已消耗的背景色
*/
private
Drawable
allConsumeBg
;
/**
* 已過期的背景
*/
private
Drawable
expiredBg
;
/**
* 即將過期背景
*/
private
Drawable
willExpireSoonBg
;
public
WareHousingDetailsAdapter
(
Context
context
,
@Nullable
List
<
WarehouseDetailsBean
>
data
,
int
type
)
{
//已消耗的背景色 shape_oval_48
//已過期的背景 shape_oval_red_wine
//即將過期背景 shape_oval_bright_orange
public
WareHousingDetailsAdapter
(
@Nullable
List
<
WarehouseDetailsBean
>
data
,
int
type
)
{
super
(
R
.
layout
.
item_warehouse_details
,
data
);
this
.
type
=
type
;
allConsumeBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
shape_oval_48
);
expiredBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
shape_oval_red_wine
);
willExpireSoonBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
shape_oval_bright_orange
);
}
@Override
...
...
@@ -98,29 +87,43 @@ public class WareHousingDetailsAdapter extends BaseQuickAdapter<WarehouseDetails
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_details_reason
,
purchaseWarehousingOrderDetailsContentsBean
.
getPurchase
());
//設置狀態
TextView
tvState
=
viewHolder
.
getView
(
R
.
id
.
tv_warehouse_state
);
tvState
.
setVisibility
(
View
.
VISIBLE
);
TextView
tvExpiresTime
=
viewHolder
.
getView
(
R
.
id
.
tv_warehouse_expires_time
);
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getConsumeStatus
()
==
WarehouseDetailsBean
.
WAREHOUSE_STATE_ALL_CONSUMED
)
{
//全部消耗了
tvState
.
setBackground
(
allConsumeBg
);
tvState
.
setText
(
"庫存已使用"
);
tvState
.
setTextColor
(
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
required_color
));
tvState
.
setVisibility
(
View
.
VISIBLE
);
//全部消耗的就不顯示過期時間
tvExpiresTime
.
setVisibility
(
View
.
GONE
);
}
else
{
//部分消耗
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getConsumeStatus
()
==
WarehouseDetailsBean
.
WAREHOUSE_STATE_PART_CONSUMED
){
tvState
.
setText
(
"部分使用"
);
tvState
.
setTextColor
(
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
bright_orange
));
tvState
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
//未消耗或消耗部分的
tvState
.
setVisibility
(
View
.
INVISIBLE
);
}
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
()
>=
0
)
{
//即將過期天數大於等於0
if
(
purchaseWarehousingOrderDetailsContentsBean
.
getWarningDays
()
>
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
())
{
//在預警天數內
//顯示即將過期
tvState
.
setBackground
(
willExpireSoonBg
);
tvState
.
setText
(
"即将過期:"
+
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
()
+
"日"
);
setExpiresTime
(
tvExpiresTime
,
R
.
drawable
.
shape_oval_bright_orange
,
"即将過期:"
,
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
());
}
else
{
tv
Stat
e
.
setVisibility
(
View
.
GONE
);
tv
ExpiresTim
e
.
setVisibility
(
View
.
GONE
);
}
}
else
{
//天數為負,則是已過期
tvState
.
setBackground
(
expiredBg
);
tvState
.
setText
(
"已過期:"
+
Math
.
abs
(
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
())
+
"日"
);
setExpiresTime
(
tvExpiresTime
,
R
.
drawable
.
shape_oval_red_wine
,
"已過期:"
,
Math
.
abs
(
purchaseWarehousingOrderDetailsContentsBean
.
getDistanceExpiresTime
())
);
}
}
}
private
void
setExpiresTime
(
TextView
tvExpiresTime
,
int
p
,
String
s
,
int
distanceExpiresTime
)
{
tvExpiresTime
.
setBackground
(
ContextCompat
.
getDrawable
(
getContext
(),
p
));
tvExpiresTime
.
setText
(
s
+
distanceExpiresTime
+
"日"
);
tvExpiresTime
.
setVisibility
(
View
.
VISIBLE
);
}
public
void
setType
(
int
type
)
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/WarehousingQueryAdapter.java
View file @
f1f53df5
...
...
@@ -35,22 +35,15 @@ public class WarehousingQueryAdapter extends BaseQuickAdapter<WareHouseListBean.
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
WareHouseListBean
.
WareHousingDataBean
.
PurchaseWarehousingOrderDetailsVOSBean
item
)
{
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_item_ingredients_name
,
item
.
getName
());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_item_ingredients_species
,
item
.
getFoodCategoryName
());
// viewHolder.setText(R.id.tv_warehouse_item_supplier, item.getSupplierName());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_item_unit
,
item
.
getUnitName
());
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_item_unit_price
,
item
.
getFoodPrice
()
+
""
);
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_item_inventory_quantity
,
item
.
getFoodNum
()
+
""
);
viewHolder
.
setText
(
R
.
id
.
tv_warehouse_item_total_amount
,
item
.
getFoodAmount
()
+
""
);
// if (viewHolder.getAdapterPosition() == 0) {
// int textColorRes = getColor(R.color.white);
// setTextColor(viewHolder, textColorRes);
// int bgColorRes = getColor(R.color.theme_color);
// setBgColor(viewHolder, bgColorRes);
// } else {
int
textColorRes
=
getColor
(
R
.
color
.
color_3c
);
setTextColor
(
viewHolder
,
textColorRes
);
int
colorRes
=
getColor
(
colors
[
viewHolder
.
getAdapterPosition
()
%
2
]);
setBgColor
(
viewHolder
,
colorRes
);
//
}
viewHolder
.
setBackgroundColor
(
R
.
id
.
layout_warehousing
,
colorRes
);
//
setBgColor(viewHolder, colorRes);
}
private
void
setBgColor
(
@NotNull
BaseViewHolder
viewHolder
,
int
bgColorRes
)
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/FunctionListFragment.java
View file @
f1f53df5
...
...
@@ -23,6 +23,7 @@ import com.gingersoft.supply_chain.mvp.presenter.FunctionListPresenter;
import
com.gingersoft.supply_chain.mvp.ui.adapter.FunctionChildAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.PurchaseFunctionAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.category.CategoryFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.food.BuyIngredientsFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.inventory.StorageListFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.order.OrderDetailsFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.order.PurchaseListFragment
;
...
...
@@ -112,7 +113,8 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
start
(
SupplierListFragment
.
newInstance
(
false
,
null
));
break
;
case
"食材"
:
start
(
FoodIngredientsFragment
.
newInstance
(
FOOD_INGREDIENTS
));
// start(FoodIngredientsFragment.newInstance(FOOD_INGREDIENTS));
start
(
BuyIngredientsFragment
.
newInstance
());
break
;
case
"種類"
:
start
(
CategoryFragment
.
newInstance
());
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/category/CategoryFragment.java
View file @
f1f53df5
...
...
@@ -25,10 +25,9 @@ import com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean;
import
com.gingersoft.supply_chain.mvp.content.Constant
;
import
com.gingersoft.supply_chain.mvp.contract.CategoryContract
;
import
com.gingersoft.supply_chain.mvp.presenter.CategoryPresenter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.CategoryAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.FoodCategoryAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment
;
import
com.gingersoft.supply_chain.mvp.ui.widget.CategoryPopup
;
import
com.gingersoft.supply_chain.mvp.ui.widget.
NewAdd
CategoryPopup
;
import
com.jess.arms.di.component.AppComponent
;
import
com.lxj.xpopup.XPopup
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
...
...
@@ -149,7 +148,7 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
* @param position 編輯的分類下標,編輯之後用於刷新
*/
private
void
showEditCategoryPop
(
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTrees
,
int
position
)
{
CategoryPopup
categoryPopup
=
new
CategoryPopup
(
mContext
,
"修改"
,
"類別名稱"
,
"请修改當前類別名稱"
,
foodCategoryTrees
.
getName
(),
true
);
NewAddCategoryPopup
categoryPopup
=
new
NewAdd
CategoryPopup
(
mContext
,
"修改"
,
"類別名稱"
,
"请修改當前類別名稱"
,
foodCategoryTrees
.
getName
(),
true
);
categoryPopup
.
setOnDeleteListener
(
v
->
{
//刪除分類
AppDialog
.
getInstance
().
showWaringDialog
(
mContext
,
String
.
format
(
getString
(
R
.
string
.
str_delete_category_tip
),
foodCategoryTrees
.
getName
()),
(
view
,
dialog
)
->
{
...
...
@@ -228,7 +227,7 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
*/
private
void
showAddCategory
(
String
parentCategoryName
,
int
parentId
,
int
level
)
{
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
parentCategoryName
))
{
CategoryPopup
categoryPopup
=
new
CategoryPopup
(
mContext
,
parentCategoryName
,
"類別名稱"
,
"请輸入類別名稱"
,
null
,
false
);
NewAddCategoryPopup
categoryPopup
=
new
NewAdd
CategoryPopup
(
mContext
,
parentCategoryName
,
"類別名稱"
,
"请輸入類別名稱"
,
null
,
false
);
new
XPopup
.
Builder
(
getContext
())
.
asCustom
(
categoryPopup
.
setListener
(()
->
{
//創建分類
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/FoodIngredientsFragment.java
View file @
f1f53df5
...
...
@@ -49,8 +49,7 @@ import butterknife.OnClick;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
food
.
NewFoodIngredientsFragment
.
EDIT_FOOD_RESULT_CODE
;
/**
* ================================================
* Description: 食材管理,採購選食材
* Description: 食材管理
*/
public
class
FoodIngredientsFragment
extends
BaseSupplyChainFragment
<
FoodIngredientsPresenter
>
implements
FoodIngredientsContract
.
View
,
View
.
OnClickListener
{
...
...
@@ -137,7 +136,10 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
* 編輯食材 request_code
*/
private
final
int
EDIT_FOOD_REQUEST_CODE
=
1050
;
/**
* 在回到這個頁面時,購物車食材數量可能發生了變化,需要刷新當前頁面的食材數量
*/
private
boolean
refreshList
=
false
;
/**
* 當前顯示的是第幾級的分類
* 現用於切換供應商再切換回來之後,顯示哪一級的分類
...
...
@@ -199,9 +201,10 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
@Override
public
void
onSupportVisible
()
{
super
.
onSupportVisible
();
if
(
foodListAdapter
!=
null
)
{
if
(
refreshList
&&
foodListAdapter
!=
null
)
{
//在回到這個頁面時,購物車食材數量可能發生了變化,需要刷新當前頁面的食材數量
mPresenter
.
refreshPageData
(
foodListAdapter
.
getData
(),
foodListAdapter
.
getIntegerMap
());
refreshList
=
false
;
}
}
...
...
@@ -334,6 +337,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
}
//需要先判斷是否有食品
if
(
SupplyShoppingCart
.
getInstance
().
getCartFoods
().
size
()
>
0
)
{
refreshList
=
true
;
start
(
ShoppingCatFragment
.
newInstance
());
}
else
{
showMessage
(
"請選擇食品"
);
...
...
@@ -354,7 +358,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
supplierId
=
categoryBeans
.
get
(
0
).
getId
();
}
if
(
listSelectAdapter
==
null
)
{
listSelectAdapter
=
new
BaseCategoryAdapter
(
categoryBeans
,
mContext
);
listSelectAdapter
=
new
BaseCategoryAdapter
(
categoryBeans
);
listSelectAdapter
.
setUnSelectColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_3c
))
.
setSelectColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_color
));
listSelectAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/PurchaseListFragment.java
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
order
;
import
android.app.Dialog
;
import
android.os.Bundle
;
import
android.text.InputFilter
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.EditText
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
...
...
@@ -17,7 +14,6 @@ import androidx.viewpager2.widget.ViewPager2;
import
com.gingersoft.gsa.cloud.common.loadsir.EmptyCallback
;
import
com.gingersoft.gsa.cloud.common.loadsir.ErrorCallback
;
import
com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils
;
import
com.gingersoft.gsa.cloud.ui.utils.AppDialog
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
...
...
@@ -37,13 +33,10 @@ import com.gingersoft.supply_chain.mvp.ui.widget.ScreenView;
import
com.jess.arms.di.component.AppComponent
;
import
com.kingja.loadsir.callback.Callback
;
import
com.kingja.loadsir.callback.SuccessCallback
;
import
com.kingja.loadsir.core.LoadService
;
import
com.kingja.loadsir.core.LoadSir
;
import
com.lxj.xpopup.XPopup
;
import
com.lxj.xpopup.enums.PopupPosition
;
import
com.lxj.xpopup.interfaces.OnSelectListener
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.tab.QMUIBasicTabSegment
;
import
com.qmuiteam.qmui.widget.tab.QMUITabBuilder
;
...
...
@@ -51,9 +44,6 @@ import com.qmuiteam.qmui.widget.tab.QMUITabIndicator;
import
com.qmuiteam.qmui.widget.tab.QMUITabSegment
;
import
com.qmuiteam.qmui.widget.tab.QMUITabSegment2
;
import
com.scwang.smartrefresh.layout.SmartRefreshLayout
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
;
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -125,10 +115,6 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
refreshPurchaseList
.
setPrimaryColorsId
(
R
.
color
.
trans
,
R
.
color
.
black
);
btnNewOrder
.
setText
(
"+新增訂單"
);
// edSearch.setFilters(new InputFilter[]{InputFilterUtils.getChAndEnAndNumInputFilter(mContext), InputFilterUtils.getLengthFilter(mContext, 20)});
btnNewOrder
.
setOnClickListener
(
v
->
{
//跳轉到下單頁面
startForResult
(
FoodIngredientsFragment
.
newInstance
(
ADD_ORDER
),
REQUEST_ORDER_DETAILS_CODE
);
});
loadService
=
LoadSir
.
getDefault
().
register
(
loadBg
,
(
Callback
.
OnReloadListener
)
v
->
getOrderList
());
refreshPurchaseList
.
setOnRefreshListener
(
refreshLayout
->
{
pageIndex
=
0
;
...
...
@@ -172,7 +158,6 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
start
(
ShoppingCatFragment
.
newInstance
());
}
else
{
//跳轉到下單頁面
showMessage
(
"請先選擇食品"
);
startForResult
(
FoodIngredientsFragment
.
newInstance
(
ADD_ORDER
),
REQUEST_ORDER_DETAILS_CODE
);
}
});
...
...
@@ -258,7 +243,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
start
(
SendMsgFragment
.
newInstance
(
Collections
.
singletonList
(
purchaseOrder
)));
}
@OnClick
({
R2
.
id
.
iv_purchase_list_screen
,
R2
.
id
.
iv_purchase_list_search
})
@OnClick
({
R2
.
id
.
iv_purchase_list_screen
,
R2
.
id
.
iv_purchase_list_search
,
R2
.
id
.
btn_save
})
@Override
public
void
onClick
(
View
v
)
{
int
viewId
=
v
.
getId
();
...
...
@@ -267,6 +252,9 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
screenView
.
setVisibility
(
screenView
.
getVisibility
()
==
View
.
VISIBLE
?
View
.
GONE
:
View
.
VISIBLE
);
}
else
if
(
viewId
==
R
.
id
.
iv_purchase_list_search
)
{
getOrderList
();
}
else
if
(
viewId
==
R
.
id
.
btn_save
){
//跳轉到下單頁面
startForResult
(
FoodIngredientsFragment
.
newInstance
(
ADD_ORDER
),
REQUEST_ORDER_DETAILS_CODE
);
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/SendMsgFragment.java
View file @
f1f53df5
...
...
@@ -7,9 +7,11 @@ import android.view.ViewGroup;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.fragment.app.Fragment
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.common.utils.ClipboardUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
...
...
@@ -20,8 +22,11 @@ import com.gingersoft.supply_chain.mvp.contract.SendMsgContract;
import
com.gingersoft.supply_chain.mvp.presenter.SendMsgPresenter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.SendSupplierMsgAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment
;
import
com.gingersoft.supply_chain.mvp.ui.widget.TextPopup
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.DeviceUtils
;
import
com.lxj.xpopup.XPopup
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
...
...
@@ -30,6 +35,7 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
me.yokeyword.fragmentation.ISupportFragment
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
.
SupplierInfoBean
.
SupplierContacts
.
Kakao_Talk
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
.
SupplierInfoBean
.
SupplierContacts
.
Line
;
...
...
@@ -82,6 +88,7 @@ public class SendMsgFragment extends BaseSupplyChainFragment<SendMsgPresenter> i
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
initTopBar
(
supplyTopBar
,
"發送"
);
supplyTopBar
.
addRightTextButton
(
R
.
string
.
str_preview
,
R
.
id
.
qmui_preview
).
setOnClickListener
(
this
::
onClick
);
Bundle
arguments
=
getArguments
();
if
(
arguments
!=
null
)
{
purchaseOrders
=
(
List
<
ConfirmOrderBean
.
PurchaseOrder
>)
arguments
.
getSerializable
(
KEY_PURCHASE_ORDER_INFO
);
...
...
@@ -99,7 +106,18 @@ public class SendMsgFragment extends BaseSupplyChainFragment<SendMsgPresenter> i
//發送
mPresenter
.
sendMsg
();
}
else
if
(
viewId
==
R
.
id
.
btn_supplier_cancel
)
{
popTo
(
PurchaseListFragment
.
class
,
true
);
// popTo(PurchaseListFragment.class, true);
killMyself
();
}
else
if
(
viewId
==
R
.
id
.
qmui_preview
)
{
//預覽
String
sendUrl
=
mPresenter
.
getSendUrl
();
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
sendUrl
))
{
new
XPopup
.
Builder
(
requireContext
())
.
asCustom
(
new
TextPopup
(
requireContext
(),
"發送鏈接預覽"
,
mPresenter
.
getSendUrl
()))
.
show
();
}
else
{
showMessage
(
"未獲取到採購單信息,請退出重試"
);
}
}
}
...
...
@@ -143,6 +161,16 @@ public class SendMsgFragment extends BaseSupplyChainFragment<SendMsgPresenter> i
mPresenter
.
setSendSuccess
();
}
@Override
public
void
backToOrderList
()
{
startWithPopTo
(
PurchaseListFragment
.
newInstance
(),
PurchaseListFragment
.
class
,
true
);
}
@Override
public
void
killMyself
()
{
backToOrderList
();
}
private
boolean
isSend
=
false
;
@Override
...
...
@@ -153,4 +181,10 @@ public class SendMsgFragment extends BaseSupplyChainFragment<SendMsgPresenter> i
mPresenter
.
getContactsBySupplier
(
mPresenter
.
getCurrentSelectedSupplier
()
+
1
);
}
}
@Override
public
boolean
onBackPressedSupport
()
{
backToOrderList
();
return
true
;
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/ShoppingCatFragment.java
View file @
f1f53df5
...
...
@@ -12,9 +12,11 @@ import android.widget.TextView;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.content.ContextCompat
;
import
androidx.fragment.app.Fragment
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.log.LogUtil
;
import
com.gingersoft.gsa.cloud.ui.utils.AppDialog
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
...
...
@@ -34,6 +36,7 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
me.yokeyword.fragmentation.ISupportFragment
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
food
.
FoodIngredientsFragment
.
ADD_ORDER
;
...
...
@@ -77,8 +80,7 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
public
static
ShoppingCatFragment
newInstance
()
{
ShoppingCatFragment
fragment
=
new
ShoppingCatFragment
();
return
fragment
;
return
new
ShoppingCatFragment
();
}
@Override
...
...
@@ -192,10 +194,6 @@ public class ShoppingCatFragment extends BaseSupplyChainFragment<ShoppingCatPres
@Override
public
void
addOrderSuccess
(
List
<
ConfirmOrderBean
.
PurchaseOrder
>
purchaseOrders
)
{
ShoppingCatFragment
childFragment
=
findChildFragment
(
ShoppingCatFragment
.
class
);
if
(
childFragment
!=
null
)
{
childFragment
.
killMyself
();
}
startWithPop
(
SendMsgFragment
.
newInstance
(
purchaseOrders
));
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WareHouseListFragment.java
View file @
f1f53df5
...
...
@@ -6,7 +6,6 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.EditText
;
import
android.widget.HorizontalScrollView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
...
...
@@ -15,9 +14,6 @@ import androidx.annotation.Nullable;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.listener.OnItemChildClickListener
;
import
com.chad.library.adapter.base.listener.OnItemClickListener
;
import
com.gingersoft.gsa.cloud.common.loadsir.EmptyCallback
;
import
com.gingersoft.gsa.cloud.common.loadsir.ErrorCallback
;
import
com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils
;
...
...
@@ -30,14 +26,9 @@ import com.gingersoft.supply_chain.mvp.presenter.WareHouseListPresenter;
import
com.gingersoft.supply_chain.mvp.ui.adapter.WarehousingQueryAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment
;
import
com.jess.arms.di.component.AppComponent
;
import
com.kingja.loadsir.callback.Callback
;
import
com.kingja.loadsir.callback.SuccessCallback
;
import
com.kingja.loadsir.core.LoadSir
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.scwang.smartrefresh.layout.SmartRefreshLayout
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
;
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
;
import
java.util.List
;
...
...
@@ -68,8 +59,8 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList
RecyclerView
rvWarehouseList
;
@BindView
(
R2
.
id
.
sl_warehousing_list
)
SmartRefreshLayout
smartRefreshLayout
;
@BindView
(
R2
.
id
.
hs_warehousing_list
)
HorizontalScrollView
hsWarehousingList
;
//
@BindView(R2.id.hs_warehousing_list)
//
HorizontalScrollView hsWarehousingList;
@BindView
(
R2
.
id
.
tv_warehouse_item_unit_price
)
TextView
tvUnitPrice
;
@BindView
(
R2
.
id
.
tv_warehouse_item_inventory_quantity
)
...
...
@@ -189,7 +180,7 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList
}
if
(
warehousingQueryAdapter
==
null
)
{
warehousingQueryAdapter
=
new
WarehousingQueryAdapter
(
mContext
,
purchaseWarehousingOrderDetailsVos
);
rvWarehouseList
.
setLayoutManager
(
new
LinearLayoutManager
(
mContext
));
rvWarehouseList
.
setLayoutManager
(
new
LinearLayoutManager
(
requireContext
()
));
rvWarehouseList
.
setAdapter
(
warehousingQueryAdapter
);
warehousingQueryAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehouseDetailsFragment.java
View file @
f1f53df5
...
...
@@ -236,7 +236,7 @@ public class WarehouseDetailsFragment extends BaseSupplyChainFragment<WarehouseD
}
else
{
loadService
.
showSuccess
();
if
(
wareHousingDetailsAdapter
==
null
)
{
wareHousingDetailsAdapter
=
new
WareHousingDetailsAdapter
(
requireContext
(),
warehouseDetailsBeans
,
vpWarehouseViewpager
.
getCurrentItem
());
wareHousingDetailsAdapter
=
new
WareHousingDetailsAdapter
(
warehouseDetailsBeans
,
vpWarehouseViewpager
.
getCurrentItem
());
if
(
adapter
==
null
)
{
adapter
=
new
PurchasePageAdapter
(
wareHousingDetailsAdapter
,
2
);
vpWarehouseViewpager
.
setAdapter
(
adapter
);
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingInventoryFragment.java
View file @
f1f53df5
...
...
@@ -21,9 +21,11 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerWarehousingInventoryComponent
;
import
com.gingersoft.supply_chain.mvp.bean.InventoryRecordBean
;
import
com.gingersoft.supply_chain.mvp.bean.WareHouseListBean
;
import
com.gingersoft.supply_chain.mvp.contract.WarehousingInventoryContract
;
import
com.gingersoft.supply_chain.mvp.presenter.WarehousingInventoryPresenter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.InventoryRecordAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment
;
import
com.jess.arms.di.component.AppComponent
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
...
...
@@ -32,6 +34,8 @@ import com.zhy.autolayout.utils.ScreenUtils;
import
org.w3c.dom.Text
;
import
java.util.List
;
import
butterknife.BindView
;
...
...
@@ -52,6 +56,7 @@ public class WarehousingInventoryFragment extends BaseSupplyChainFragment<Wareho
EditText
edWarehouseLoss
;
@BindView
(
R2
.
id
.
rv_warehouse_inventory_record
)
RecyclerView
rvRecord
;
private
InventoryRecordAdapter
adapter
;
/**
* 食品總庫存
*/
...
...
@@ -200,7 +205,13 @@ public class WarehousingInventoryFragment extends BaseSupplyChainFragment<Wareho
}
@Override
public
void
loadRecord
()
{
public
void
loadRecord
(
List
<
InventoryRecordBean
>
inventoryRecordBeans
)
{
//加載盤點記錄
if
(
adapter
==
null
)
{
adapter
=
new
InventoryRecordAdapter
(
inventoryRecordBeans
);
rvRecord
.
setAdapter
(
adapter
);
}
else
{
adapter
.
setList
(
inventoryRecordBeans
);
}
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/EditTextPopup.java
View file @
f1f53df5
...
...
@@ -28,7 +28,6 @@ public class EditTextPopup extends InputConfirmPopupView {
@Override
protected
void
onCreate
()
{
super
.
onCreate
();
getEditText
().
setFilters
(
inputFilters
);
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/CategoryPopup.java
→
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/
NewAdd
CategoryPopup.java
View file @
f1f53df5
...
...
@@ -4,16 +4,12 @@ import android.content.Context;
import
android.text.InputFilter
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.ui.utils.AppDialog
;
import
com.gingersoft.supply_chain.R
;
import
com.lxj.xpopup.impl.ConfirmPopupView
;
import
com.lxj.xpopup.impl.InputConfirmPopupView
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
/**
...
...
@@ -23,14 +19,14 @@ import com.qmuiteam.qmui.alpha.QMUIAlphaTextView;
* Time: 9:45
* Use: 新增分類的彈窗
*/
public
class
CategoryPopup
extends
ConfirmPopupView
{
public
class
NewAdd
CategoryPopup
extends
ConfirmPopupView
{
private
boolean
showDelete
;
private
EditText
et_input
;
private
OnClickListener
onDeleteListener
;
private
String
inputText
;
private
final
int
nameMaxLength
=
100
;
public
CategoryPopup
(
@NonNull
Context
context
,
CharSequence
title
,
CharSequence
content
,
CharSequence
hint
,
String
inputText
,
boolean
showDelete
)
{
public
NewAdd
CategoryPopup
(
@NonNull
Context
context
,
CharSequence
title
,
CharSequence
content
,
CharSequence
hint
,
String
inputText
,
boolean
showDelete
)
{
super
(
context
,
R
.
layout
.
dialog_new_category
);
setTitleContent
(
title
,
content
,
hint
);
this
.
showDelete
=
showDelete
;
...
...
@@ -60,7 +56,7 @@ public class CategoryPopup extends ConfirmPopupView {
return
et_input
;
}
public
CategoryPopup
setOnDeleteListener
(
OnClickListener
onDeleteListener
)
{
public
NewAdd
CategoryPopup
setOnDeleteListener
(
OnClickListener
onDeleteListener
)
{
this
.
onDeleteListener
=
onDeleteListener
;
return
this
;
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ShowSecondCategoryPopup.java
0 → 100644
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
widget
;
import
android.content.Context
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.chad.library.adapter.base.listener.OnItemClickListener
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.SecondCategoryAdapter
;
import
com.google.android.flexbox.FlexWrap
;
import
com.google.android.flexbox.FlexboxLayoutManager
;
import
com.lxj.xpopup.core.AttachPopupView
;
import
java.util.List
;
import
lombok.val
;
/**
* @author 宇航.
* User: admin
* Date: 2021/3/11
* Time: 11:37
* Use:
*/
public
class
ShowSecondCategoryPopup
extends
AttachPopupView
{
private
final
int
width
;
private
final
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTreesList
;
private
final
OnItemClickListener
onItemClickListener
;
private
final
int
defaultSelect
;
/**
* 當前是否是顯示三級分類
*/
private
boolean
showThirdCategory
=
false
;
public
ShowSecondCategoryPopup
(
@NonNull
Context
context
,
int
width
,
int
defaultSelect
,
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTreesList
,
OnItemClickListener
onItemClickListener
)
{
super
(
context
);
this
.
width
=
width
;
this
.
defaultSelect
=
defaultSelect
;
this
.
foodCategoryTreesList
=
foodCategoryTreesList
;
this
.
onItemClickListener
=
onItemClickListener
;
}
@Override
protected
int
getPopupLayoutId
()
{
return
R
.
layout
.
layout_popup_category_recycler
;
}
@Override
protected
void
onCreate
()
{
super
.
onCreate
();
RecyclerView
recyclerView
=
findViewById
(
R
.
id
.
rv_purchase_list_content
);
FlexboxLayoutManager
flexboxLayoutManager
=
new
FlexboxLayoutManager
(
getContext
());
flexboxLayoutManager
.
setFlexWrap
(
FlexWrap
.
WRAP
);
recyclerView
.
setLayoutManager
(
flexboxLayoutManager
);
SecondCategoryAdapter
secondCategoryAdapter
=
new
SecondCategoryAdapter
(
getContext
(),
foodCategoryTreesList
);
secondCategoryAdapter
.
setSelectIndex
(
defaultSelect
);
secondCategoryAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
if
(!
showThirdCategory
)
{
//三級分類就不回調
onItemClickListener
.
onItemClick
(
adapter
,
view
,
position
);
val
foodCategoryTrees
=
foodCategoryTreesList
.
get
(
position
).
getFoodCategoryTrees
();
//有三級分類就顯示三級分類,沒有三級分類,關閉彈窗,食材列表定位到所選中的二級分類
if
(
foodCategoryTrees
!=
null
&&
foodCategoryTrees
.
size
()
>
0
)
{
//顯示三級分類
showThirdCategory
=
true
;
secondCategoryAdapter
.
setNewInstance
(
foodCategoryTreesList
.
get
(
position
).
getFoodCategoryTrees
());
}
else
{
//關閉彈窗,食材列表清空,第一條顯示當前分類
}
}
else
{
//當前是三級分類點擊,彈窗關閉,食材列表清空,第一條顯示當前分類
}
});
recyclerView
.
setAdapter
(
secondCategoryAdapter
);
}
@Override
public
int
getMinimumWidth
()
{
return
width
;
}
@Override
protected
int
getMaxWidth
()
{
return
width
;
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/TextPopup.java
0 → 100644
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
widget
;
import
android.content.Context
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
com.gingersoft.supply_chain.R
;
import
com.lxj.xpopup.core.CenterPopupView
;
/**
* @author 宇航.
* User: admin
* Date: 2021/3/9
* Time: 17:39
* Use:
*/
public
class
TextPopup
extends
CenterPopupView
{
private
String
title
;
private
String
content
;
public
TextPopup
(
@NonNull
Context
context
,
String
title
,
String
content
)
{
super
(
context
);
this
.
title
=
title
;
this
.
content
=
content
;
}
@Override
protected
int
getPopupLayoutId
()
{
return
R
.
layout
.
popup_text
;
}
@Override
protected
void
onCreate
()
{
super
.
onCreate
();
TextView
tvTitle
=
findViewById
(
R
.
id
.
tv_title
);
tvTitle
.
setText
(
title
);
TextView
tvContent
=
findViewById
(
R
.
id
.
tv_content
);
tvContent
.
setText
(
content
);
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/utils/ViewUtils.java
0 → 100644
View file @
f1f53df5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
utils
;
import
android.view.View
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
/**
* @author 宇航.
* User: admin
* Date: 2021/3/11
* Time: 14:59
* Use:
*/
public
class
ViewUtils
{
public
static
void
moveToCenterByVertical
(
RecyclerView
recyclerView
,
int
sectionPosition
)
{
LinearLayoutManager
layoutManager
=
(
LinearLayoutManager
)
recyclerView
.
getLayoutManager
();
if
(
layoutManager
==
null
)
{
return
;
}
//取得中間位置的item
View
childAt
=
recyclerView
.
getChildAt
(
sectionPosition
-
layoutManager
.
findFirstVisibleItemPosition
());
//拿到列表一半的高度
int
halfLeftRvHeight
=
recyclerView
.
getHeight
()
/
2
;
if
(
childAt
!=
null
)
{
//中間位置那個item減去一半的高度等於中間item一半顯示在列表中間
int
y
=
(
int
)
(
childAt
.
getTop
()
-
halfLeftRvHeight
);
recyclerView
.
smoothScrollBy
(
0
,
y
);
}
}
public
static
void
moveToCenterByHorizontal
(
RecyclerView
recyclerView
,
int
sectionPosition
)
{
LinearLayoutManager
layoutManager
=
(
LinearLayoutManager
)
recyclerView
.
getLayoutManager
();
if
(
layoutManager
==
null
)
{
return
;
}
//取得中間位置的item
View
childAt
=
recyclerView
.
getChildAt
(
sectionPosition
-
layoutManager
.
findFirstVisibleItemPosition
());
//拿到列表一半的寬度
int
halfLeftRvHeight
=
recyclerView
.
getWidth
()
/
2
;
if
(
childAt
!=
null
)
{
//中間位置那個item減去一半的高度等於中間item一半顯示在列表中間
int
x
=
(
int
)
(
childAt
.
getLeft
()
-
halfLeftRvHeight
);
recyclerView
.
smoothScrollBy
(
x
,
0
);
}
}
}
component-supply-chain/src/main/res/drawable-xxhdpi/ic_double_row.png
0 → 100644
View file @
f1f53df5
2.35 KB
component-supply-chain/src/main/res/drawable-xxhdpi/ic_single_row.png
0 → 100644
View file @
f1f53df5
2.37 KB
component-supply-chain/src/main/res/drawable/s_second_category.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:drawable=
"@drawable/shape_theme_twelve_corners_bg"
android:state_checked=
"true"
/>
<item
android:drawable=
"@drawable/shape_theme_twelve_corners_bg"
android:state_selected=
"true"
/>
<item
android:drawable=
"@drawable/shape_white_twelve_corners_bg"
/>
</selector>
\ No newline at end of file
component-supply-chain/src/main/res/layout/fragment_ware_house_list.xml
View file @
f1f53df5
...
...
@@ -174,8 +174,8 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_warehouse_list"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"
match_par
ent"
/>
android:layout_width=
"
match_par
ent"
android:layout_height=
"
wrap_cont
ent"
/>
</LinearLayout>
</HorizontalScrollView>
...
...
component-supply-chain/src/main/res/layout/fragment_warehousing_inventory.xml
View file @
f1f53df5
<?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"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:background=
"@color/color_f0"
android:orientation=
"vertical"
>
...
...
@@ -109,11 +109,10 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_square_edit_border_aa"
android:gravity=
"
center
"
android:gravity=
"
end
"
android:hint=
"請輸入"
android:inputType=
"number"
android:paddingTop=
"@dimen/dp_5"
android:paddingBottom=
"@dimen/dp_5"
android:padding=
"@dimen/dp_5"
android:text=
"0"
android:textColor=
"@color/theme_333_color"
android:textCursorDrawable=
"@drawable/cursor_theme"
...
...
@@ -123,50 +122,13 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_38"
android:layout_marginTop=
"@dimen/dp_10"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"0.25"
android:background=
"@color/theme_color"
android:gravity=
"center"
android:text=
"用戶名"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_12"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/dp_1"
android:layout_weight=
"0.3"
android:background=
"@color/theme_color"
android:gravity=
"center"
android:text=
"盤點"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_12"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/dp_1"
android:layout_weight=
"0.55"
android:background=
"@color/theme_color"
android:gravity=
"center"
android:text=
"操作日期"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_12"
/>
</LinearLayout>
<include
layout=
"@layout/item_inventory_record"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_warehouse_inventory_record"
android:layout_width=
"match_parent"
a
pp:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager
"
a
ndroid:layout_height=
"match_parent
"
/>
a
ndroid:layout_height=
"match_parent
"
a
pp:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager
"
/>
</LinearLayout>
\ No newline at end of file
component-supply-chain/src/main/res/layout/item_buy_food_ingredient.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_marginBottom=
"@dimen/dp_1"
android:layout_height=
"wrap_content"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"horizontal"
android:paddingTop=
"@dimen/dp_8"
android:paddingBottom=
"@dimen/dp_8"
>
<ImageView
android:id=
"@+id/iv_food_ingredient_img"
android:layout_width=
"@dimen/dp_77"
android:layout_height=
"@dimen/dp_77"
android:layout_marginLeft=
"@dimen/dp_6"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:layout_marginRight=
"@dimen/dp_5"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_food_item_no"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/dp_10"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:maxLines=
"1"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_12"
tools:text=
"SP001"
/>
<TextView
android:id=
"@+id/tv_food_item_supplier_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:maxLines=
"2"
android:gravity=
"right"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_13"
android:textStyle=
"bold"
tools:text=
"海鮮天地"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_food_item_name"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textStyle=
"bold"
tools:text=
"巴西肥牛"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_food_item_unit"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textSize=
"@dimen/dp_12"
tools:text=
"3KG/盒"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"15/30"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_12"
android:textStyle=
"bold"
android:visibility=
"gone"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<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:textColor=
"@color/required_color"
android:textStyle=
"bold"
tools:text=
"$100.00"
/>
<LinearLayout
android:id=
"@+id/layout_operation_food_num"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:divider=
"@color/color_3c"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<com.qmuiteam.qmui.layout.QMUIButton
android:id=
"@+id/btn_food_operation_sub"
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:background=
"@drawable/ic_circle_gray_sub"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/ed_food_ingredient_number"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_4"
android:layout_marginRight=
"@dimen/dp_4"
android:background=
"@null"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:gravity=
"center"
android:inputType=
"number"
android:maxLength=
"4"
android:maxLines=
"1"
android:minWidth=
"@dimen/dp_30"
android:textColor=
"@color/black"
android:textCursorDrawable=
"@drawable/cursor_theme"
android:textSize=
"@dimen/dp_22"
tools:text=
"10"
/>
<com.qmuiteam.qmui.layout.QMUIButton
android:id=
"@+id/btn_food_operation_add"
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:background=
"@drawable/ic_circle_theme_add"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
component-supply-chain/src/main/res/layout/item_buy_food_ingredient_double_row.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_2"
app:cardCornerRadius=
"@dimen/dp_5"
app:cardElevation=
"@dimen/dp_5"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"vertical"
android:paddingLeft=
"@dimen/dp_4"
android:paddingTop=
"@dimen/dp_8"
android:paddingRight=
"@dimen/dp_4"
android:paddingBottom=
"@dimen/dp_8"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/iv_food_ingredient_img"
android:layout_width=
"@dimen/dp_67"
android:layout_height=
"@dimen/dp_67"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/dp_4"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_food_item_no"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/dp_10"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:maxLines=
"1"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_12"
tools:text=
"SP001"
/>
<TextView
android:id=
"@+id/tv_food_item_supplier_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:gravity=
"right"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_13"
android:textStyle=
"bold"
tools:text=
"海鮮天地"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_food_item_name"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:textStyle=
"bold"
tools:text=
"巴西肥牛"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_food_item_unit"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textSize=
"@dimen/dp_12"
tools:text=
"3KG/盒"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"15/30"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_12"
android:textStyle=
"bold"
android:visibility=
"gone"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_4"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<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:textColor=
"@color/required_color"
android:textStyle=
"bold"
tools:text=
"$100.00"
/>
<!-- <LinearLayout-->
<!-- android:id="@+id/layout_operation_food_num"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:divider="@color/color_3c"-->
<!-- android:gravity="center_vertical"-->
<!-- android:orientation="horizontal">-->
<com.qmuiteam.qmui.layout.QMUIButton
android:id=
"@+id/btn_food_operation_sub"
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:layout_marginLeft=
"@dimen/dp_2"
android:background=
"@drawable/ic_circle_gray_sub"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/ed_food_ingredient_number"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@null"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:gravity=
"center"
android:inputType=
"number"
android:maxLength=
"5"
android:maxLines=
"1"
android:paddingLeft=
"@dimen/dp_4"
android:paddingRight=
"@dimen/dp_4"
android:textColor=
"@color/black"
android:textCursorDrawable=
"@drawable/cursor_theme"
android:textSize=
"@dimen/dp_20"
tools:text=
"10"
/>
<com.qmuiteam.qmui.layout.QMUIButton
android:id=
"@+id/btn_food_operation_add"
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:background=
"@drawable/ic_circle_theme_add"
/>
<!-- </LinearLayout>-->
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
component-supply-chain/src/main/res/layout/item_buy_food_ingredient_header.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/tv_buy_food_header"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/theme_color"
android:gravity=
"center"
android:paddingLeft=
"@dimen/dp_4"
android:paddingTop=
"@dimen/dp_4"
android:paddingRight=
"@dimen/dp_4"
android:paddingBottom=
"@dimen/dp_4"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_14"
/>
component-supply-chain/src/main/res/layout/item_inventory_record.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/layout_inventory_record"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/theme_color"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_inventory_record_username"
style=
"@style/WareHouse_item_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"20"
android:text=
"用戶名"
/>
<include
layout=
"@layout/include_vertical_color_white_dividing_line"
/>
<TextView
android:id=
"@+id/tv_inventory_record_number"
style=
"@style/WareHouse_item_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"17"
android:text=
"盤點"
/>
<include
layout=
"@layout/include_vertical_color_white_dividing_line"
/>
<TextView
android:id=
"@+id/tv_inventory_record_difference"
style=
"@style/WareHouse_item_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"23"
android:text=
"差異數"
/>
<include
layout=
"@layout/include_vertical_color_white_dividing_line"
/>
<TextView
android:id=
"@+id/tv_inventory_record_operating_data"
style=
"@style/WareHouse_item_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"39"
android:text=
"操作日期"
/>
</LinearLayout>
\ No newline at end of file
component-supply-chain/src/main/res/layout/item_purchase_order.xml
View file @
f1f53df5
...
...
@@ -23,9 +23,9 @@
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:gravity=
"center_vertical"
android:maxLines=
"1"
android:ellipsize=
"end"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_17"
android:textStyle=
"bold"
...
...
@@ -43,9 +43,9 @@
android:id=
"@+id/iv_purchase_order_more"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginRight=
"@dimen/dp_5"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_5"
android:layout_marginRight=
"@dimen/dp_5"
android:src=
"@drawable/ic_more"
/>
</LinearLayout>
...
...
@@ -136,16 +136,29 @@
tools:text=
"$100.00"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_purchase_order_goods"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent
"
android:layout_width=
"0dp
"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5
"
android:layout_weight=
"1
"
android:ellipsize=
"end"
android:singleLine=
"true"
tools:text=
"巴西肥牛、澳洲牛排"
/>
<ImageView
android:id=
"@+id/iv_viewed"
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:src=
"@drawable/ic_viewed"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
component-supply-chain/src/main/res/layout/item_purchase_second_category.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/card_purchase_category"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_6"
android:layout_marginTop=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_2"
android:layout_marginBottom=
"@dimen/dp_7"
app:cardCornerRadius=
"@dimen/dp_12"
app:cardElevation=
"@dimen/dp_3"
>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/tv_second_category_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_18"
android:layout_marginTop=
"@dimen/dp_5"
android:layout_marginRight=
"@dimen/dp_18"
android:layout_marginBottom=
"@dimen/dp_5"
android:gravity=
"center"
android:textColor=
"@color/s_3c_to_white"
android:textSize=
"@dimen/dp_12"
tools:text=
"瓜果類"
/>
</androidx.cardview.widget.CardView>
\ No newline at end of file
component-supply-chain/src/main/res/layout/item_warehouse_details.xml
View file @
f1f53df5
...
...
@@ -87,10 +87,10 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/dp_6"
android:orientation=
"horizontal"
android:paddingLeft=
"@dimen/dp_9"
android:paddingTop=
"@dimen/dp_9"
android:layout_marginBottom=
"@dimen/dp_6"
android:paddingRight=
"@dimen/dp_9"
>
<TextView
...
...
@@ -121,20 +121,39 @@
tools:text=
"採購入庫"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_warehouse_state"
android:layout_width=
"wrap_content"
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginRight=
"@dimen/dp_4"
android:paddingLeft=
"@dimen/dp_10"
android:paddingTop=
"@dimen/dp_4"
android:paddingRight=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_4"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_14"
tools:text=
"即將過期:3日"
/>
<TextView
android:id=
"@+id/tv_warehouse_expires_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/dp_4"
android:paddingLeft=
"@dimen/dp_10"
android:paddingTop=
"@dimen/dp_4"
android:paddingRight=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_4"
android:privateImeOptions=
"@dimen/dp_10"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_14"
android:visibility=
"gone"
tools:text=
"即將過期:3日"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
component-supply-chain/src/main/res/layout/item_warehousing_query.xml
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/layout_warehousing"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/theme_color"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
...
...
@@ -12,6 +14,8 @@
android:layout_height=
"wrap_content"
android:text=
"食材名"
/>
<include
layout=
"@layout/include_vertical_color_white_dividing_line"
/>
<TextView
android:id=
"@+id/tv_warehouse_item_ingredients_species"
style=
"@style/WareHouse_item_TextStyle"
...
...
@@ -19,13 +23,15 @@
android:layout_height=
"wrap_content"
android:text=
"食材種類"
/>
<include
layout=
"@layout/include_vertical_color_white_dividing_line"
/>
<TextView
android:id=
"@+id/tv_warehouse_item_supplier"
style=
"@style/WareHouse_item_TextStyle"
android:layout_width=
"@dimen/dp_62"
android:visibility=
"gone"
android:layout_height=
"wrap_content"
android:text=
"供應商"
/>
android:text=
"供應商"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_warehouse_item_unit"
...
...
@@ -34,6 +40,8 @@
android:layout_height=
"wrap_content"
android:text=
"單位"
/>
<include
layout=
"@layout/include_vertical_color_white_dividing_line"
/>
<TextView
android:id=
"@+id/tv_warehouse_item_unit_price"
style=
"@style/WareHouse_item_TextStyle"
...
...
@@ -41,6 +49,8 @@
android:layout_height=
"wrap_content"
android:text=
"單價"
/>
<include
layout=
"@layout/include_vertical_color_white_dividing_line"
/>
<TextView
android:id=
"@+id/tv_warehouse_item_inventory_quantity"
style=
"@style/WareHouse_item_TextStyle"
...
...
@@ -48,12 +58,14 @@
android:layout_height=
"wrap_content"
android:text=
"庫存數量"
/>
<include
layout=
"@layout/include_vertical_color_white_dividing_line"
/>
<TextView
android:id=
"@+id/tv_warehouse_item_total_amount"
style=
"@style/WareHouse_item_TextStyle"
android:layout_width=
"wrap_content"
android:minWidth=
"@dimen/dp_55"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/dp_0"
android:minWidth=
"@dimen/dp_55"
android:text=
"總價"
/>
</LinearLayout>
\ No newline at end of file
component-supply-chain/src/main/res/layout/item_warehousing_title.xml
View file @
f1f53df5
...
...
@@ -3,6 +3,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:background=
"@color/theme_color"
android:orientation=
"horizontal"
>
<TextView
...
...
@@ -15,7 +16,7 @@
<TextView
android:id=
"@+id/tv_warehouse_item_ingredients_species"
style=
"@style/WareHouse_item_TextStyle"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
@dimen/dp_68
"
android:layout_height=
"wrap_content"
android:text=
"食材種類"
/>
...
...
component-supply-chain/src/main/res/layout/layout_popup_category_recycler.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<com.lxj.xpopup.widget.PartShadowContainer
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/attachPopupContainer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
"
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_purchase_list_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
</com.lxj.xpopup.widget.PartShadowContainer>
component-supply-chain/src/main/res/layout/popup_inventory_consumption.xml
View file @
f1f53df5
...
...
@@ -24,7 +24,8 @@
<EditText
android:id=
"@+id/et_input"
android:layout_width=
"@dimen/dp_70"
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:paddingTop=
"@dimen/dp_2"
...
...
@@ -37,6 +38,8 @@
android:text=
""
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/sp_16"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
...
...
component-supply-chain/src/main/res/layout/popup_text.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/centerPopupContainer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_white_eight_corners_bg"
android:orientation=
"vertical"
android:padding=
"@dimen/dp_20"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"標題"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_16"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"標題"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_14"
/>
</LinearLayout>
</FrameLayout>
component-supply-chain/src/main/res/layout/supply_chain_top_bar.xml
View file @
f1f53df5
...
...
@@ -5,6 +5,7 @@
app:qmui_topbar_title_color=
"@color/theme_white_color"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/head_height"
app:qmui_topbar_text_btn_color_state_list=
"@color/white"
android:background=
"@color/theme_color"
android:fitsSystemWindows=
"true"
/>
...
...
component-supply-chain/src/main/res/layout/view_shopping_car.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.alpha.QMUIAlphaConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/layout_shopping_cart"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/iv_shopping_cart"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_shopping_car"
/>
<TextView
android:id=
"@+id/tv_purchase_cart_number"
android:layout_width=
"@dimen/dp_12"
android:layout_height=
"@dimen/dp_12"
android:autoSizeMaxTextSize=
"@dimen/dp_8"
android:autoSizeMinTextSize=
"@dimen/dp_4"
android:background=
"@drawable/ui_shape_red_oval"
android:gravity=
"center"
android:text=
"3"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_6"
app:layout_constraintRight_toRightOf=
"@id/iv_shopping_cart"
app:layout_constraintTop_toTopOf=
"@id/iv_shopping_cart"
/>
</com.qmuiteam.qmui.alpha.QMUIAlphaConstraintLayout>
\ No newline at end of file
component-supply-chain/src/main/res/values/ids.xml
View file @
f1f53df5
...
...
@@ -3,6 +3,7 @@
<item
name=
"qmui_shopping_cart"
type=
"id"
/>
<item
name=
"qmui_add_new_food_ingredients"
type=
"id"
/>
<item
name=
"qmui_delete_order"
type=
"id"
/>
<item
name=
"qmui_preview"
type=
"id"
/>
<item
name=
"id_inventory_consumption"
type=
"id"
/>
<item
name=
"id_save"
type=
"id"
/>
<item
name=
"id_take_pictures"
type=
"id"
/>
...
...
component-supply-chain/src/main/res/values/strings.xml
View file @
f1f53df5
...
...
@@ -32,4 +32,5 @@
<string
name=
"str_cancel"
>
取消
</string>
<string
name=
"str_determine"
>
確定
</string>
<string
name=
"str_delete_category_tip"
>
是否確認刪除該類別【%1$s】,子類和食材將一同刪除?
</string>
<string
name=
"str_preview"
>
預覽
</string>
</resources>
\ No newline at end of file
component-supply-chain/src/main/res/values/styles.xml
View file @
f1f53df5
...
...
@@ -39,7 +39,6 @@
<item
name=
"android:textSize"
>
@dimen/dp_14
</item>
<item
name=
"android:textColor"
>
@color/white
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:background"
>
@color/theme_color
</item>
<item
name=
"android:maxLength"
>
8
</item>
<item
name=
"android:maxLines"
>
1
</item>
<item
name=
"android:paddingTop"
>
@dimen/dp_10
</item>
...
...
@@ -72,4 +71,10 @@
<item
name=
"android:textStyle"
>
bold
</item>
<item
name=
"android:textColor"
>
@color/required_color
</item>
</style>
<style
name=
"supplier_search_style"
>
<item
name=
"android:textColor"
>
@color/theme_333_color
</item>
<item
name=
"android:textColorHint"
>
@color/color_b8
</item>
<item
name=
"android:textSize"
>
@dimen/dp_16
</item>
</style>
</resources>
\ No newline at end of file
component-supply-chain/src/main/res/xml/gsa_purchase_paths.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<!-- <root-path/> :代表设备的根目录new File("/")
<files-path/> : 代表context.getFilesDir()
<cache-path/> : 代表context.getCacheDir()
<external-path/> : 代表Environment.getExternalStorageDirectory()
<external-files-path/> : 代表context.getExternalFilesDirs()
<external-cache-path/> : 代表getExternalCacheDirs() -->
<!--代表外部存储区域的根目录下的文件 Environment.getExternalStorageDirectory()/DCIM/camerademo目录-->
<!--/storage/emulated/0/DCIM/camerademo-->
<!--<external-path-->
<!-- name="hm_DCIM"-->
<!-- path="DCIM/camerademo" />-->
<!--代表app 私有的存储区域 Context.getFilesDir()目录下的images目录-->
<!--/data/user/0/com.hm.camerademo/files/images-->
<!--<files-path-->
<!--name="hm_private_files"-->
<!--path="images" />-->
<!-- 代表app 私有的存储区域 Context.getCacheDir()目录下的images目录 -->
<!--/data/user/0/com.hm.camerademo/cache/images-->
<!--<cache-path-->
<!--name="hm_private_cache"-->
<!--path="images" />-->
<!--代表app外部存储区域根目录下的文件 Context.getExternalFilesDir(Environment.DIRECTORY_PICTURES)目录下的Pictures目录-->
<!--/storage/emulated/0/Android/data/com.hm.camerademo/files/Pictures-->
<!--<external-files-path-->
<!--name="hm_external_files"-->
<!--path="Pictures" />-->
<!--代表app 外部存储区域根目录下的文件 Context.getExternalCacheDir目录下的images目录-->
<!--/storage/emulated/0/Android/data/com.hm.camerademo/cache/images-->
<!--<external-cache-path-->
<!--name="hm_external_cache"-->
<!--path="images" />-->
<paths
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<root-path
name=
"root"
path=
""
/>
<files-path
name=
"files"
path=
"images"
/>
<cache-path
name=
"cache"
path=
""
/>
<external-path
name=
"external"
path=
"image"
/>
<external-files-path
name=
"external_file_path"
path=
""
/>
<external-cache-path
name=
"external_cache_path"
path=
""
/>
</paths>
config.gradle
View file @
f1f53df5
...
...
@@ -7,8 +7,8 @@ ext {
targetSdkVersion
:
29
,
//正式版: 1.0.3 3
//內部測試版:1.2.0 20
versionCode
:
2
6
,
versionName
:
"1.2.
6
"
versionCode
:
2
9
,
versionName
:
"1.2.
9
"
]
version
=
[
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/DataNotificationService.kt
View file @
f1f53df5
...
...
@@ -47,7 +47,7 @@ class DataNotificationService : Service() {
/**
* 心跳检测时间
*/
private
val
HEART_BEAT_RATE
=
(
30
*
1000
).
toLong
()
//每隔
15
秒进行一次对长连接的心跳检测
private
val
HEART_BEAT_RATE
=
(
30
*
1000
).
toLong
()
//每隔
30
秒进行一次对长连接的心跳检测
private
val
WEBSOCKET_HOST_AND_PORT
=
"${HttpsConstans.ROOT_URL}/ricepon-websocket/js/webSocketServer"
//可替换为自己的主机名和端口号
private
var
mWebSocket
:
WebSocket
?
=
null
...
...
@@ -262,9 +262,10 @@ class DataNotificationService : Service() {
putTimeLog
(
"取消心跳"
)
cancelInterval
()
interval
({
//保持設備喚醒
newWakeLock
?.
acquire
(
10
*
60
*
1000L
/*10 minutes*/
)
putTimeLog
(
"開啟心跳"
)
//先斷開之前的
client
?.
let
{
it
->
mWebSocket
?.
let
{
it
.
cancel
()
...
...
@@ -287,9 +288,6 @@ class DataNotificationService : Service() {
putTimeLog
(
"連接成功"
)
cancelTimerDisposable
()
myBind
?.
block
?.
invoke
(
false
)
if
(
postCallBack
!=
null
)
{
postCallBack
!!
.
callBack
(
0
)
}
}
}
...
...
@@ -332,7 +330,7 @@ class DataNotificationService : Service() {
override
fun
onMessage
(
webSocket
:
WebSocket
,
bytes
:
ByteString
)
{
super
.
onMessage
(
webSocket
,
bytes
)
val
json
=
JSONObject
(
bytes
.
toString
())
putTimeLog
(
"onMessage2
22
:$bytes"
)
putTimeLog
(
"onMessage2:$bytes"
)
if
(
postCallBack
!=
null
)
{
postCallBack
!!
.
callBack
(
json
.
optInt
(
"type"
))
}
...
...
@@ -353,7 +351,6 @@ class DataNotificationService : Service() {
override
fun
onFailure
(
webSocket
:
WebSocket
,
t
:
Throwable
,
response
:
Response
?)
{
//长连接连接失败的回调
super
.
onFailure
(
webSocket
,
t
,
response
)
Log
.
e
(
TAG
,
"onFailure "
+
t
.
message
)
if
(!
this
@DataNotificationService
.
isDestroy
)
{
//連接斷開,定時五秒,如果未重連,播放提示音
delayFun
({
...
...
@@ -477,7 +474,6 @@ class DataNotificationService : Service() {
var
mIntervalDisposable
:
Disposable
?
=
null
var
timerDisposable
:
Disposable
?
=
null
/**
* 执行定时任务
*/
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/utils/other/TextUtil.java
View file @
f1f53df5
...
...
@@ -20,6 +20,11 @@ public class TextUtil {
str
.
equals
(
"null"
)
||
str
.
equals
(
"undefined"
);
}
public
static
boolean
isEmptyOrNullOrUndefined
(
CharSequence
str
)
{
return
str
==
null
||
str
.
length
()
==
0
||
str
.
equals
(
"null"
)
||
str
.
equals
(
"undefined"
);
}
public
static
boolean
isEmptyOrNullOrUndefined
(
EditText
editText
)
{
if
(
editText
==
null
||
editText
.
getText
()
==
null
)
{
return
true
;
...
...
library-common/src/main/res/color/s_3c_to_white.xml
View file @
f1f53df5
...
...
@@ -2,5 +2,6 @@
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:color=
"@color/white"
android:state_checked=
"true"
/>
<item
android:color=
"@color/white"
android:state_pressed=
"true"
/>
<item
android:color=
"@color/white"
android:state_selected=
"true"
/>
<item
android:color=
"@color/color_3c"
/>
</selector>
\ No newline at end of file
library-common/src/main/res/drawable-xhdpi/ic_search.png
View file @
f1f53df5
7.79 KB
|
W:
|
H:
4.54 KB
|
W:
|
H:
2-up
Swipe
Onion skin
library-common/src/main/res/drawable-xhdpi/ic_shoping_car.png
→
library-common/src/main/res/drawable-xhdpi/ic_shop
p
ing_car.png
View file @
f1f53df5
File moved
library-common/src/main/res/drawable/shape_light_small_app_btn.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"@dimen/dp_5"
/>
<solid
android:color=
"@color/color_light_blue_50"
/>
</shape>
\ No newline at end of file
library-common/src/main/res/drawable/shape_theme_twelve_corners_bg.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/theme_color"
/>
<corners
android:radius=
"@dimen/dp_12"
/>
</shape>
\ No newline at end of file
library-common/src/main/res/drawable/shape_white_twelve_corners_bg.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/white"
/>
<corners
android:radius=
"@dimen/dp_12"
/>
</shape>
\ No newline at end of file
library-common/src/main/res/layout/item_category.xml
→
library-common/src/main/res/layout/item_
base_
category.xml
View file @
f1f53df5
...
...
@@ -5,13 +5,11 @@
android:id=
"@+id/layout_category"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:layout_marginTop=
"@dimen/dp_15"
android:elevation=
"@dimen/dp_5"
android:orientation=
"horizontal"
app:cardElevation=
"@dimen/dp_10"
>
<
Relative
Layout
<
Linear
Layout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
...
...
@@ -20,14 +18,13 @@
<TextView
android:id=
"@+id/tv_category_name"
android:layout_width=
"
match_parent
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:button=
"@null"
android:paddingLeft=
"@dimen/dp_10"
android:ellipsize=
"marquee"
android:layout_toLeftOf=
"@id/iv_category_delete"
android:gravity=
"center_vertical"
android:paddingLeft=
"@dimen/dp_5"
android:paddingRight=
"@dimen/dp_2"
android:textColor=
"@color/s_btn_blue_3c_text"
android:textSize=
"@dimen/dp_14"
android:textStyle=
"bold"
...
...
@@ -37,11 +34,26 @@
android:id=
"@+id/iv_category_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_alignParentRight=
"true"
android:paddingLeft=
"@dimen/dp_5"
android:paddingRight=
"@dimen/dp_5"
android:src=
"@drawable/ic_red_circular_delete"
/>
</RelativeLayout>
android:src=
"@drawable/ic_red_circular_delete"
android:visibility=
"gone"
/>
<TextView
android:layout_width=
"@dimen/dp_14"
android:layout_height=
"@dimen/dp_14"
android:layout_gravity=
"center_vertical"
android:autoSizeMaxTextSize=
"@dimen/dp_12"
android:autoSizeMinTextSize=
"@dimen/dp_6"
android:layout_marginLeft=
"@dimen/dp_5"
android:visibility=
"gone"
android:background=
"@drawable/ui_shape_theme_oval"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_12"
tools:text=
"6"
/>
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
library-common/src/main/res/layout/item_first_level_category.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/layout_category"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:background=
"@color/white"
android:orientation=
"horizontal"
app:cardElevation=
"@dimen/dp_10"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:paddingTop=
"@dimen/dp_8"
android:paddingBottom=
"@dimen/dp_8"
>
<TextView
android:id=
"@+id/tv_category_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:button=
"@null"
android:ellipsize=
"marquee"
android:gravity=
"center_vertical"
android:paddingLeft=
"@dimen/dp_10"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_14"
android:textStyle=
"bold"
tools:text=
"果蔬類看書福利卡駕駛的垃圾死了阿斯蘭大家啦款手機愛上了的框架拉三季度阿薩德科技拉屎"
/>
<TextView
android:layout_width=
"@dimen/dp_14"
android:layout_height=
"@dimen/dp_14"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"@dimen/dp_5"
android:autoSizeMaxTextSize=
"@dimen/dp_12"
android:autoSizeMinTextSize=
"@dimen/dp_6"
android:background=
"@drawable/ui_shape_theme_oval"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_12"
android:visibility=
"gone"
tools:text=
"6"
/>
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
library-common/src/main/res/values/colors.xml
View file @
f1f53df5
...
...
@@ -478,7 +478,7 @@
<color
name=
"color_53"
>
#535353
</color>
<color
name=
"color_48"
>
#484848
</color>
<color
name=
"color_75"
>
#757575
</color>
<color
name=
"color_b8"
>
#B8B8B8
</color>
<color
name=
"tran_twenty_send_order_btn_bg_color"
>
#331196DB
</color>
<color
name=
"tran_fifty_order_state0_color"
>
#7F009788
</color>
<!-- 待確認背景色-->
...
...
@@ -530,6 +530,7 @@
<color
name=
"supply_chain_bg_color"
>
@color/color_f3
</color>
<color
name=
"supply_chain_category_title_bg"
>
#2CA0EA
</color>
<color
name=
"color_light_blue_50"
>
#802CA0EA
</color>
<color
name=
"purchase_total_price_text_color"
>
#EC2D2D
</color>
...
...
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/bean/view/CategoryBean.java
View file @
f1f53df5
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
bean
.
view
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
java.util.Objects
;
import
lombok.Data
;
/**
...
...
@@ -10,12 +14,15 @@ import lombok.Data;
* Use: 共用的分類型左側分類數據
*/
@Data
public
class
CategoryBean
{
private
int
id
;
public
class
CategoryBean
implements
QMUISection
.
Model
<
CategoryBean
>
{
private
Integer
id
;
private
String
categoryName
;
//數量
/**
* 數量
*/
private
int
count
;
public
CategoryBean
()
{
}
...
...
@@ -29,4 +36,19 @@ public class CategoryBean {
this
.
categoryName
=
categoryName
;
this
.
count
=
count
;
}
@Override
public
CategoryBean
cloneForDiff
()
{
return
new
CategoryBean
(
getId
(),
getCategoryName
(),
getCount
());
}
@Override
public
boolean
isSameItem
(
CategoryBean
other
)
{
return
Objects
.
equals
(
categoryName
,
other
.
getCategoryName
());
}
@Override
public
boolean
isSameContent
(
CategoryBean
other
)
{
return
true
;
}
}
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/utils/AppDialog.java
View file @
f1f53df5
...
...
@@ -140,7 +140,6 @@ public class AppDialog {
}
},
cancelListener
,
layoutId
);
inputConfirmPopupView
.
show
();
// inputConfirmPopupView.getEditText().setFilters(new InputFilter[]{InputFilterUtils.getChAndEnAndNumInputFilter(context)});
}
...
...
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/utils/DialogUtils.java
View file @
f1f53df5
...
...
@@ -205,7 +205,7 @@ public abstract class DialogUtils implements LifecycleObserver {
public
abstract
void
initLayout
(
ViewHepler
hepler
,
Dialog
dialog
);
private
ViewHepler
getViewHepler
(
Context
context
)
{
return
ViewHepler
.
get
(
context
,
view
);
return
new
ViewHepler
(
context
,
view
);
}
...
...
@@ -217,39 +217,33 @@ public abstract class DialogUtils implements LifecycleObserver {
public
static
class
ViewHepler
{
private
final
SparseArray
<
View
>
mViews
;
private
View
mConvertView
;
private
static
ViewHepler
viewHepler
=
null
;
private
Context
context
;
private
ViewHepler
(
Context
context
,
int
layoutId
)
{
this
.
mViews
=
new
SparseArray
<>();
this
.
context
=
context
;
mConvertView
=
LayoutInflater
.
from
(
context
).
inflate
(
layoutId
,
null
);
}
private
ViewHepler
(
Context
context
,
View
view
)
{
this
.
mViews
=
new
SparseArray
<>();
this
.
context
=
context
;
mConvertView
=
view
;
}
public
void
clearAll
()
{
context
=
null
;
if
(
mViews
!=
null
)
{
mViews
.
clear
();
}
mConvertView
=
null
;
viewHepler
=
null
;
}
public
stat
ic
ViewHepler
get
(
Context
context
,
int
layoutId
)
{
viewHepler
=
new
ViewHepler
(
context
,
layoutId
);
return
viewHepler
;
}
public
stat
ic
ViewHepler
get
(
Context
context
,
View
view
)
{
viewHepler
=
new
ViewHepler
(
context
,
view
);
return
viewHepler
;
}
// publ
ic ViewHepler get(Context context, int layoutId) {
//
viewHepler = new ViewHepler(context, layoutId);
//
return viewHepler;
//
}
//
// publ
ic ViewHepler get(Context context, View view) {
//
viewHepler = new ViewHepler(context, view);
//
return viewHepler;
//
}
public
View
getContentView
()
{
return
mConvertView
;
...
...
@@ -282,6 +276,7 @@ public abstract class DialogUtils implements LifecycleObserver {
getView
(
viewId
).
setOnClickListener
(
onClickListener
);
return
this
;
}
public
ViewHepler
setVisibility
(
int
viewId
,
int
visible
)
{
getView
(
viewId
).
setVisibility
(
visible
);
return
this
;
...
...
@@ -290,8 +285,8 @@ public abstract class DialogUtils implements LifecycleObserver {
/**
* 为TextView设置字符串
*
* @param viewId
* @param text
* @param viewId
textview的id
* @param text
文本內容
* @return
*/
public
ViewHepler
setText
(
int
viewId
,
String
text
)
{
...
...
@@ -304,8 +299,6 @@ public abstract class DialogUtils implements LifecycleObserver {
}
/**
* 为ImageView设置图片
*
...
...
@@ -345,7 +338,7 @@ public abstract class DialogUtils implements LifecycleObserver {
public
ViewHepler
setImageByUrl
(
int
viewId
,
String
url
,
int
roundedCorners
,
int
defaultImg
)
{
ImageView
view
=
(
ImageView
)
isHaveView
(
viewId
);
Glide
.
with
(
context
).
load
(
url
)
Glide
.
with
(
view
.
getContext
()
).
load
(
url
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
roundedCorners
)))
.
error
(
defaultImg
)
...
...
@@ -437,8 +430,9 @@ public abstract class DialogUtils implements LifecycleObserver {
hepler
.
getView
(
R
.
id
.
btn_cancel
).
setOnClickListener
(
v
->
dialog
.
dismiss
());
hepler
.
getView
(
R
.
id
.
btn_confirm
).
setOnClickListener
(
v
->
{
dialog
.
dismiss
();
if
(
onClickListener
!=
null
)
if
(
onClickListener
!=
null
)
{
onClickListener
.
onClick
(
adapter
.
getChecked
());
}
});
}
}
...
...
library-ui/src/main/res/layout/layout_order_pay.xml
View file @
f1f53df5
...
...
@@ -28,7 +28,7 @@
android:id=
"@+id/iv_shop_car"
android:layout_width=
"@dimen/dp_32"
android:layout_height=
"@dimen/dp_32"
android:src=
"@drawable/ic_shoping_car"
/>
android:src=
"@drawable/ic_shop
p
ing_car"
/>
<Button
android:id=
"@+id/btn_order_count"
...
...
library-updateApk/src/main/AndroidManifest.xml
View file @
f1f53df5
...
...
@@ -18,6 +18,16 @@
android:theme=
"@style/DialogActivityTheme"
/>
<service
android:name=
"service.UpdateAppService"
/>
</application>
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"${applicationId}.fileprovider"
android:exported=
"false"
android:grantUriPermissions=
"true"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/update_file_paths"
/>
</provider>
</application>
</manifest>
\ No newline at end of file
library-updateApk/src/main/java/util/UpdateAppReceiver.java
View file @
f1f53df5
...
...
@@ -8,9 +8,11 @@ import android.content.Context;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Build
;
import
java.io.File
;
import
androidx.core.content.FileProvider
;
import
java.io.File
;
import
teprinciple.updateapputils.R
;
/**
...
...
@@ -112,12 +114,9 @@ public class UpdateAppReceiver extends BroadcastReceiver {
* 跳转安装
*/
private
void
toInstall
(
Context
context
)
{
Intent
i
=
new
Intent
(
Intent
.
ACTION_VIEW
);
File
apkFile
=
new
File
(
DownloadAppUtils
.
downloadUpdateApkFilePath
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
i
.
setFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
);
Uri
contentUri
=
FileProvider
.
getUriForFile
(
context
,
context
.
getPackageName
()
+
".fileprovider"
,
apkFile
);
i
.
setDataAndType
(
contentUri
,
"application/vnd.android.package-archive"
);
...
...
@@ -125,6 +124,7 @@ public class UpdateAppReceiver extends BroadcastReceiver {
}
else
{
i
.
setDataAndType
(
Uri
.
fromFile
(
apkFile
),
"application/vnd.android.package-archive"
);
}
i
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
);
//添加这一句表示对目标应用临时授权该Uri所代表的文件
i
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
context
.
startActivity
(
i
);
}
...
...
library-updateApk/src/main/res/xml/update_file_paths.xml
0 → 100644
View file @
f1f53df5
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path
path=
""
name=
"files_root"
/>
</paths>
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