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
d58cbe4d
Commit
d58cbe4d
authored
Jul 22, 2021
by
张建升
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码同步
parent
098f219a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
7 deletions
+36
-7
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/DishesContract.java
+2
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/DishesPresenter.java
+8
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishNode.java
+10
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishesGroupNode.java
+10
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/DishesFragment.java
+4
-4
component-supply-chain/src/main/res/layout/item_dish_group.xml
+2
-0
No files found.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/DishesContract.java
View file @
d58cbe4d
...
...
@@ -3,6 +3,7 @@ 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.DishesResultBean
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.dishes.DishesGroupNode
;
import
com.jess.arms.mvp.IModel
;
import
com.jess.arms.mvp.IView
;
...
...
@@ -19,7 +20,7 @@ public interface DishesContract {
/**
* 加載菜品組數據
*/
void
loadDishGroupInfo
(
DishesResultBean
dishGroup
);
void
loadDishGroupInfo
(
List
<
DishesGroupNode
>
dishGroup
);
void
loadDishesInfo
(
DishesResultBean
dishes
);
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/DishesPresenter.java
View file @
d58cbe4d
...
...
@@ -2,6 +2,7 @@ package com.gingersoft.supply_chain.mvp.presenter;
import
android.app.Application
;
import
com.chad.library.adapter.base.entity.node.BaseNode
;
import
com.gingersoft.gsa.cloud.common.constans.AppConstant
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.supply_chain.mvp.bean.DishesBean
;
...
...
@@ -82,6 +83,7 @@ public class DishesPresenter extends BasePresenter<DishesContract.Model, DishesC
//將分類食品的list容量設置為一級分類的數量,這樣就不用擔心之後加載不同position的分類數據時,計算位置了
LogUtils
.
warnInfo
(
" zjs ="
+
data
.
getCount
());
List
<
BaseNode
>
myData
=
new
ArrayList
<>();
List
<
DishesBean
>
list
=
data
.
getList
();
List
<
DishesBean
>
plist
=
new
ArrayList
<>();
List
<
DishesBean
>
clist
=
new
ArrayList
<>();
...
...
@@ -101,6 +103,7 @@ public class DishesPresenter extends BasePresenter<DishesContract.Model, DishesC
plist
.
add
(
dishesBean
);
//父菜单
DishesGroupNode
groupNode
=
new
DishesGroupNode
(
dishesBean
);
pNodes
.
add
(
groupNode
);
myData
.
add
(
groupNode
);
}
LogUtils
.
warnInfo
(
" zjs ="
+
list
.
get
(
i
).
toString
());
}
...
...
@@ -108,17 +111,21 @@ public class DishesPresenter extends BasePresenter<DishesContract.Model, DishesC
for
(
int
i
=
0
;
i
<
pNodes
.
size
();
i
++)
{
DishesGroupNode
groupNode
=
pNodes
.
get
(
i
);
List
<
DishNode
>
subNode
=
new
ArrayList
<>();
// List<BaseNode> bNodeList= new ArrayList<>();
for
(
int
j
=
0
;
j
<
len
;
j
++)
{
DishesBean
dishesBean
=
clist
.
get
(
i
);
if
(
groupNode
.
getId
()
==
dishesBean
.
getParentId
())
{
DishNode
cNode
=
new
DishNode
(
dishesBean
);
subNode
.
add
(
cNode
);
groupNode
.
addChildNode
(
cNode
);
LogUtils
.
warnInfo
(
" zjs"
,
" groupNode 组"
+
groupNode
.
getFoodName
()
+
" 彩民"
+
cNode
.
getFoodName
());
}
}
LogUtils
.
warnInfo
(
" zjs"
,
" groupNode "
+
groupNode
.
getFoodName
()
+
" 数量"
+
subNode
.
size
());
groupNode
.
setDishNodes
(
subNode
);
}
mRootView
.
loadDishGroupInfo
(
pNodes
);
LogUtils
.
warnInfo
(
" zjs end="
+(
System
.
currentTimeMillis
()-
start
));
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishNode.java
View file @
d58cbe4d
...
...
@@ -6,6 +6,7 @@ import com.chad.library.adapter.base.entity.node.BaseExpandNode;
import
com.chad.library.adapter.base.entity.node.BaseNode
;
import
com.gingersoft.supply_chain.mvp.bean.DishesBean
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
DishNode
extends
BaseExpandNode
{
...
...
@@ -26,7 +27,15 @@ public class DishNode extends BaseExpandNode {
this
.
seqNo
=
dishesBean
.
getSeqNo
();
this
.
foodName
=
dishesBean
.
getFoodName
();
}
public
void
addChildNode
(
BaseNode
baseNode
)
{
if
(
baseNode
==
null
)
{
return
;
}
if
(
childNode
==
null
)
{
childNode
=
new
ArrayList
<>();
}
childNode
.
add
(
baseNode
);
}
public
int
getId
()
{
return
id
;
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishesGroupNode.java
View file @
d58cbe4d
...
...
@@ -6,6 +6,7 @@ import com.gingersoft.supply_chain.mvp.bean.DishesBean;
import
org.jetbrains.annotations.Nullable
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
DishesGroupNode
extends
BaseExpandNode
{
...
...
@@ -102,6 +103,15 @@ public class DishesGroupNode extends BaseExpandNode{
this
.
childNode
=
childNode
;
setExpanded
(
false
);
}
public
void
addChildNode
(
BaseNode
baseNode
)
{
if
(
baseNode
==
null
)
{
return
;
}
if
(
childNode
==
null
)
{
childNode
=
new
ArrayList
<>();
}
childNode
.
add
(
baseNode
);
}
public
String
getTitle
()
{
return
foodName
;
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/DishesFragment.java
View file @
d58cbe4d
...
...
@@ -73,9 +73,9 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
mPresenter
.
getDishesData
();
}
private
void
initDishes
(){
private
void
initDishes
(
List
<
DishesGroupNode
>
dishesGroupNodes
){
DishesTreeAdapter
dishesTreeAdapter
=
new
DishesTreeAdapter
();
dishesTreeAdapter
.
setList
(
getEntity
()
);
dishesTreeAdapter
.
setList
(
dishesGroupNodes
);
rvDishes
.
setLayoutManager
(
new
CenterLayoutManager
(
requireContext
(),
LinearLayoutManager
.
HORIZONTAL
,
false
));
rvDishes
.
setAdapter
(
dishesTreeAdapter
);
}
...
...
@@ -102,8 +102,8 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
@Override
public
void
loadDishGroupInfo
(
DishesResultBean
dishGroup
)
{
public
void
loadDishGroupInfo
(
List
<
DishesGroupNode
>
dishGroup
)
{
initDishes
(
dishGroup
);
}
@Override
...
...
component-supply-chain/src/main/res/layout/item_dish_group.xml
View file @
d58cbe4d
...
...
@@ -16,6 +16,7 @@
<ImageView
android:id=
"@+id/iv_dishes_group_icon"
android:layout_width=
"wrap_content"
android:visibility=
"gone"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
\ No newline at end of file
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