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
2d520f03
Commit
2d520f03
authored
Jul 07, 2021
by
张建升
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜品 boom 代码同步
parent
f0a91a2d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
216 additions
and
0 deletions
+216
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/di/component/OtherFunctionComponent.java
+37
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/di/module/OtherFunctionModule.java
+22
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/OtherFunctionContract.java
+73
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/model/OtherFunctionModel.java
+75
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/OtherFunctionPresenter.java
+0
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/FunctionListFragment.java
+9
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/OtherFunctionFragment.java
+0
-0
component-supply-chain/src/main/res/layout/fragment_other_function.xml
+0
-0
No files found.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/di/component/OtherFunctionComponent.java
0 → 100644
View file @
2d520f03
package
com
.
gingersoft
.
supply_chain
.
di
.
component
;
import
dagger.BindsInstance
;
import
dagger.Component
;
import
com.jess.arms.di.component.AppComponent
;
import
com.gingersoft.supply_chain.di.module.OtherFunctionModule
;
import
com.gingersoft.supply_chain.mvp.contract.OtherFunctionContract
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.food.OtherFunctionFragment
;
/**
* ================================================
* Created by zjs on 07/07/2021 21:11
* Description
* ================================================
*/
@FragmentScope
@Component
(
modules
=
OtherFunctionModule
.
class
,
dependencies
=
AppComponent
.
class
)
public
interface
OtherFunctionComponent
{
void
inject
(
OtherFunctionFragment
fragment
);
@Component
.
Builder
interface
Builder
{
@BindsInstance
OtherFunctionComponent
.
Builder
view
(
OtherFunctionContract
.
View
view
);
OtherFunctionComponent
.
Builder
appComponent
(
AppComponent
appComponent
);
OtherFunctionComponent
build
();
}
}
\ No newline at end of file
component-supply-chain/src/main/java/com/gingersoft/supply_chain/di/module/OtherFunctionModule.java
0 → 100644
View file @
2d520f03
package
com
.
gingersoft
.
supply_chain
.
di
.
module
;
import
com.gingersoft.supply_chain.mvp.contract.OtherFunctionContract
;
import
com.gingersoft.supply_chain.mvp.model.OtherFunctionModel
;
import
dagger.Binds
;
import
dagger.Module
;
/**
* ================================================
* Created by zjs on 07/07/2021 21:11
* Description
* ================================================
*/
@Module
public
abstract
class
OtherFunctionModule
{
@Binds
abstract
OtherFunctionContract
.
Model
bindOtherFunctionModel
(
OtherFunctionModel
model
);
}
\ No newline at end of file
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/OtherFunctionContract.java
0 → 100644
View file @
2d520f03
package
com
.
gingersoft
.
supply_chain
.
mvp
.
contract
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.supply_chain.mvp.bean.BuyIngredientsBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodListInfoBean
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
import
java.util.List
;
import
java.util.Map
;
import
io.reactivex.Observable
;
/**
* ================================================
* Created by zjs on 07/07/2021 21:11
* Description
* ================================================
*/
public
interface
OtherFunctionContract
{
interface
View
extends
IView
{
/**
* 加載分類
*
* @param foodCategoryTrees 所有分類層級信息
*/
void
initCategoryInfo
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
);
/**
* 加載失敗
*/
void
loadFail
();
/**
* 結束加載並且沒有更多數據了
*/
void
finishLoad
(
boolean
noData
);
/**
* 加載食品
*
* @param buyIngredientsBeans 顯示的食材
* @param addToHead 是否添加到頭部
* @param isReset 是否重新設置數據
*/
void
loadFood
(
List
<
BuyIngredientsBean
>
buyIngredientsBeans
,
boolean
addToHead
,
boolean
isReset
);
void
selectFirstCategoryByIndex
(
int
position
);
/**
* 食材列表滾動到指定位置
*
* @param index 指定位置
*/
void
scrollToPosition
(
int
index
);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
Observable
<
FoodListInfoBean
>
getFoodIngredientsData
(
Map
<
String
,
Object
>
map
);
Observable
<
BaseResult
>
getFoodBySupplierId
(
Map
<
String
,
Object
>
map
);
Observable
<
BaseResult
>
deleteFood
(
int
foodId
);
Observable
<
OrderCategoryBean
>
getCategoryTrees
(
Map
<
String
,
Object
>
map
);
Observable
<
FoodByCategoryResultBean
>
getFoodByCategory
(
Map
<
String
,
Object
>
map
);
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/model/OtherFunctionModel.java
0 → 100644
View file @
2d520f03
package
com
.
gingersoft
.
supply_chain
.
mvp
.
model
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodListInfoBean
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
com.gingersoft.supply_chain.mvp.server.SupplierServer
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
com.jess.arms.di.scope.FragmentScope
;
import
javax.inject.Inject
;
import
com.gingersoft.supply_chain.mvp.contract.OtherFunctionContract
;
import
java.util.Map
;
import
io.reactivex.Observable
;
/**
* ================================================
* Created by zjs on 07/07/2021 21:11
* Description
* ================================================
*/
@FragmentScope
public
class
OtherFunctionModel
extends
BaseModel
implements
OtherFunctionContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
@Inject
public
OtherFunctionModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
@Override
public
Observable
<
FoodListInfoBean
>
getFoodIngredientsData
(
Map
<
String
,
Object
>
map
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
getFoodIngredientsData
(
map
);
}
@Override
public
Observable
<
BaseResult
>
getFoodBySupplierId
(
Map
<
String
,
Object
>
map
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
getFoodBySupplierId
(
map
);
}
@Override
public
Observable
<
BaseResult
>
deleteFood
(
int
foodId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
deleteFood
(
foodId
);
}
@Override
public
Observable
<
OrderCategoryBean
>
getCategoryTrees
(
Map
<
String
,
Object
>
map
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
getCategoryTrees
(
map
);
}
@Override
public
Observable
<
FoodByCategoryResultBean
>
getFoodByCategory
(
Map
<
String
,
Object
>
map
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
getFoodByCategory
(
map
);
}
}
\ No newline at end of file
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/OtherFunctionPresenter.java
0 → 100644
View file @
2d520f03
This diff is collapsed.
Click to expand it.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/FunctionListFragment.java
View file @
2d520f03
...
...
@@ -23,6 +23,7 @@ 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.FoodManagementFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.food.MeasurementUnitFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.food.OtherFunctionFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.order.PurchaseListFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.supplier.SupplierListFragment
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.SnInOutboundRecordsFragment
;
...
...
@@ -104,6 +105,11 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
}
purchaseFunctionBeans
.
add
(
new
PurchaseFunctionBean
(
"庫存管理"
,
storage
));
List
<
Function
>
otherFunction
=
new
ArrayList
<>();
otherFunction
.
add
(
new
Function
(
"菜品Boom"
,
R
.
drawable
.
ic_inventory_inquiry
));
purchaseFunctionBeans
.
add
(
new
PurchaseFunctionBean
(
"其他功能"
,
otherFunction
));
PurchaseFunctionAdapter
purchaseFunctionAdapter
=
new
PurchaseFunctionAdapter
(
mContext
,
purchaseFunctionBeans
);
purchaseFunctionAdapter
.
setFunctionClickListener
((
adapter
,
view
,
position
)
->
{
FunctionChildAdapter
functionChildAdapter
=
(
FunctionChildAdapter
)
adapter
;
...
...
@@ -150,6 +156,9 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
case
"設置"
:
new
XPopup
.
Builder
(
requireContext
()).
asCustom
(
new
UpdateRestaurantInfoPop
(
requireContext
())).
show
();
break
;
case
"菜品Boom"
:
start
(
OtherFunctionFragment
.
newInstance
());
break
;
default
:
break
;
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/OtherFunctionFragment.java
0 → 100644
View file @
2d520f03
This diff is collapsed.
Click to expand it.
component-supply-chain/src/main/res/layout/fragment_other_function.xml
0 → 100644
View file @
2d520f03
This diff is collapsed.
Click to expand it.
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