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
41b3a4c6
Commit
41b3a4c6
authored
Jun 30, 2021
by
张建升
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SN盤點 不可以手動輸入, 代碼同步
parent
1335ed97
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
12 deletions
+30
-12
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/BuyIngredientsPresenter.java
+14
-6
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/BuyIngredientsFragment.java
+9
-5
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/FoodIngredientsFragment.java
+3
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/SupplierFoodFragment.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingInventoryFragment.java
+2
-0
component-supply-chain/src/main/res/layout/fragment_buy_ingredients.xml
+1
-0
No files found.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/BuyIngredientsPresenter.java
View file @
41b3a4c6
package
com
.
gingersoft
.
supply_chain
.
mvp
.
presenter
;
import
android.app.Application
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.common.constans.AppConstant
;
import
com.gingersoft.gsa.cloud.common.utils.CollectionUtils
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.log.LogUtil
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.supply_chain.mvp.bean.BuyIngredientsBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean
;
...
...
@@ -430,10 +432,16 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
* @param position 供應商下標
* @param foodCategoryTrees 供應商轉換為分類後的信息
*/
public
void
getFoodsBySupplier
(
int
position
,
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTrees
,
boolean
addToHead
,
boolean
isReset
)
{
public
void
getFoodsBySupplier
(
String
name
,
int
position
,
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTrees
,
boolean
addToHead
,
boolean
isReset
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
5
);
map
.
put
(
"pageSize"
,
1000
);
map
.
put
(
"pageIndex"
,
0
);
LogUtil
.
e
(
" zjs getFoodsBySupplier foodCategoryTrees.getId()= "
+
foodCategoryTrees
.
getId
()
+
" name="
+
name
+
" position="
+
position
);
if
(!
TextUtils
.
isEmpty
(
name
))
{
map
.
put
(
"name"
,
name
);
}
AppConstant
.
addBrandId
(
map
);
AppConstant
.
addRestaurantId
(
map
);
if
(
foodCategoryTrees
!=
null
)
{
...
...
@@ -628,7 +636,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
* @param position 分類下標
* @param foodCategoryTrees 分類
*/
public
void
loadNextCategoryFood
(
boolean
isSupplier
,
int
position
,
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
)
{
public
void
loadNextCategoryFood
(
String
name
,
boolean
isSupplier
,
int
position
,
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
)
{
List
<
BuyIngredientsBean
>
buyIngredientsBeans
=
null
;
if
(
isSupplier
)
{
if
(
supplierFoods
.
get
(
position
)
!=
null
)
{
...
...
@@ -652,7 +660,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
}
if
(
position
<
size
)
{
Log
.
e
(
"eee"
,
"下一個"
);
loadNextCategoryFood
(
isSupplier
,
position
,
foodCategoryTrees
);
loadNextCategoryFood
(
name
,
isSupplier
,
position
,
foodCategoryTrees
);
}
else
{
mRootView
.
finishLoad
(
true
);
}
...
...
@@ -664,7 +672,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
loadCacheFood
(
isSupplier
,
position
,
false
,
false
);
}
else
{
if
(
isSupplier
)
{
getFoodsBySupplier
(
position
,
foodCategoryTrees
.
get
(
position
),
false
,
false
);
getFoodsBySupplier
(
name
,
position
,
foodCategoryTrees
.
get
(
position
),
false
,
false
);
}
else
{
getFoodByCategory
(
position
,
foodCategoryTrees
.
get
(
position
),
false
,
false
);
}
...
...
@@ -672,7 +680,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
}
}
else
{
if
(
isSupplier
)
{
getFoodsBySupplier
(
position
,
foodCategoryTrees
.
get
(
position
),
false
,
false
);
getFoodsBySupplier
(
name
,
position
,
foodCategoryTrees
.
get
(
position
),
false
,
false
);
}
else
{
Log
.
e
(
"eee"
,
"loadNextCategoryFood為空"
);
getFoodByCategory
(
position
,
foodCategoryTrees
.
get
(
position
),
false
,
false
);
...
...
@@ -742,7 +750,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
}
else
{
Log
.
e
(
"eee"
,
"没有供應商缓存"
+
position
);
//需要通过接口
getFoodsBySupplier
(
position
,
supplierTranCategoryCache
.
get
(
position
),
addToHead
,
isReset
);
getFoodsBySupplier
(
""
,
position
,
supplierTranCategoryCache
.
get
(
position
),
addToHead
,
isReset
);
}
}
else
{
List
<
BuyIngredientsBean
>
buyIngredientsBeans
=
categoryFoods
.
get
(
position
);
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/BuyIngredientsFragment.java
View file @
41b3a4c6
...
...
@@ -22,6 +22,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import
com.chad.library.adapter.base.listener.OnItemClickListener
;
import
com.gingersoft.gsa.cloud.common.loadsir.purchase.NotGoodsCallback
;
import
com.gingersoft.gsa.cloud.common.utils.CollectionUtils
;
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
;
...
...
@@ -205,7 +206,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
int
i
=
firstLevelCategoryAdapter
.
getSelectedIndex
()
+
1
;
if
(
i
<
firstLevelCategoryAdapter
.
getItemCount
())
{
//判斷是否有緩存,把緩存拿出來,看看有沒有加載到列表中,如果已經加載了,繼續獲取下一個分類,一直到沒有加載的那個
mPresenter
.
loadNextCategoryFood
(
isShowSupplier
,
i
,
firstLevelCategoryAdapter
.
getData
());
mPresenter
.
loadNextCategoryFood
(
edFoodIngredientsSearch
.
getText
().
toString
(),
isShowSupplier
,
i
,
firstLevelCategoryAdapter
.
getData
());
}
else
{
finishLoad
(
true
);
}
...
...
@@ -259,11 +260,11 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
@OnClick
({
R2
.
id
.
layout_food_ingredients_search
,
R2
.
id
.
tv_switch_food_ingredients_show_type
,
R2
.
id
.
btn_food_ingredients_confirm
,
R2
.
id
.
btn_food_ingredients_cancel
,
R2
.
id
.
btn_switch_row
,
R2
.
id
.
card_show_more_category
})
R2
.
id
.
btn_food_ingredients_cancel
,
R2
.
id
.
btn_switch_row
,
R2
.
id
.
card_show_more_category
,
R2
.
id
.
iv_food_search
})
@Override
public
void
onClick
(
View
v
)
{
int
viewId
=
v
.
getId
();
if
(
viewId
==
R
.
id
.
layout_food_ingredients_search
)
{
if
(
viewId
==
R
.
id
.
layout_food_ingredients_search
||
viewId
==
R
.
id
.
iv_food_search
)
{
//跳轉搜索頁面
jumpToSearch
();
}
else
if
(
viewId
==
R
.
id
.
btn_switch_row
)
{
...
...
@@ -288,7 +289,9 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
* 跳轉到搜索頁面
*/
private
void
jumpToSearch
()
{
int
position
=
firstLevelCategoryAdapter
.
getSelectedIndex
()
;
LogUtil
.
e
(
"zjs jumpToSearch 跳轉到搜索頁面 position"
+
position
);
mPresenter
.
getFoodsBySupplier
(
edFoodIngredientsSearch
.
getText
().
toString
(),
position
,
firstLevelCategoryAdapter
.
getItem
(
position
),
false
,
true
);
}
/**
...
...
@@ -461,6 +464,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
firstLevelCategoryAdapter
=
new
FirstLevelCategoryAdapter
(
foodCategoryTrees
,
requireContext
());
rvFirstCategory
.
setAdapter
(
firstLevelCategoryAdapter
);
firstLevelCategoryAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
LogUtil
.
e
(
"zjs initCategoryInfo ItemClick position "
+
position
);
firstCategoryClick
(
position
);
});
}
else
{
...
...
@@ -486,7 +490,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
//本地沒有緩衝才去查找
//獲取點擊的分類的所有食材
if
(
isShowSupplier
)
{
mPresenter
.
getFoodsBySupplier
(
position
,
firstLevelCategoryAdapter
.
getItem
(
position
),
addToHead
,
isReset
);
mPresenter
.
getFoodsBySupplier
(
edFoodIngredientsSearch
.
getText
().
toString
(),
position
,
firstLevelCategoryAdapter
.
getItem
(
position
),
addToHead
,
isReset
);
}
else
{
mPresenter
.
getFoodByCategory
(
position
,
firstLevelCategoryAdapter
.
getItem
(
position
),
addToHead
,
isReset
);
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/FoodIngredientsFragment.java
View file @
41b3a4c6
...
...
@@ -16,6 +16,7 @@ import androidx.recyclerview.widget.RecyclerView;
import
com.gingersoft.gsa.cloud.common.loadsir.EmptyCallback
;
import
com.gingersoft.gsa.cloud.common.loadsir.ErrorCallback
;
import
com.gingersoft.gsa.cloud.common.utils.log.LogUtil
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean
;
import
com.gingersoft.gsa.cloud.ui.utils.AppDialog
;
...
...
@@ -49,8 +50,10 @@ import butterknife.OnClick;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
food
.
NewFoodIngredientsFragment
.
EDIT_FOOD_RESULT_CODE
;
/**
* Deprecated
* Description: 食材管理
*/
public
class
FoodIngredientsFragment
extends
BaseSupplyChainFragment
<
FoodIngredientsPresenter
>
implements
FoodIngredientsContract
.
View
,
View
.
OnClickListener
{
@BindView
(
R2
.
id
.
topbar_food_ingredients
)
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/SupplierFoodFragment.java
View file @
41b3a4c6
...
...
@@ -73,7 +73,7 @@ public class SupplierFoodFragment extends BuyIngredientsFragment {
@Override
protected
void
refreshData
()
{
mPresenter
.
getFoodsBySupplier
(
0
,
firstLevelCategoryAdapter
.
getItem
(
0
),
false
,
true
);
mPresenter
.
getFoodsBySupplier
(
edFoodIngredientsSearch
.
getText
().
toString
(),
0
,
firstLevelCategoryAdapter
.
getItem
(
0
),
false
,
true
);
}
@Override
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingInventoryFragment.java
View file @
41b3a4c6
...
...
@@ -188,8 +188,10 @@ public class WarehousingInventoryFragment extends BaseSupplyChainFragment<Wareho
//添加保存按鈕
if
(
purchaseWarehousingOrderDetailsVo
.
getFoodMarkSn
()
!=
HAS_SN
)
{
addTopRightBtn
(
R
.
string
.
str_save
,
R
.
id
.
id_inventory_consumption
);
edWarehouseLoss
.
setEnabled
(
true
);
}
else
{
addTopRightBtn
(
R
.
string
.
str_inventory
,
R
.
id
.
id_inventory
);
edWarehouseLoss
.
setEnabled
(
false
);
}
}
...
...
component-supply-chain/src/main/res/layout/fragment_buy_ingredients.xml
View file @
41b3a4c6
...
...
@@ -58,6 +58,7 @@
<ImageView
android:id=
"@+id/iv_food_search"
android:paddingLeft=
"@dimen/dp_12"
android:paddingRight=
"@dimen/dp_10"
android:paddingTop=
"@dimen/dp_6"
...
...
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