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
50e28194
Commit
50e28194
authored
Aug 06, 2021
by
张建升
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜品完成,副單位支持小數點
parent
61e61931
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
15 deletions
+32
-15
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/DishDetailBean.java
+8
-5
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/SupplierInfoBean.java
+6
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/DeputyUnitAdapter.java
+5
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishDetailAdapter.java
+3
-3
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/DishesFragment.java
+9
-4
component-supply-chain/src/main/res/layout/item_deputy_unit.xml
+1
-1
No files found.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/DishDetailBean.java
View file @
50e28194
...
...
@@ -17,28 +17,31 @@ public class DishDetailBean {
private
int
restaurantId
;
// number 非必须
private
int
purchaseFoodId
;
// number 非必须 食材编号
private
String
foodName
;
// string 非必须 食材名称
private
double
consumeQuantity
;
// number 非必须 消耗个数
//
private double consumeQuantity;// number 非必须 消耗个数
private
String
basicUnitName
;
// string 非必须 配置单位
private
String
foodNo
;
// string 非必须 食材编号
private
int
type
;
// number 非必须 状态 0 食材 1 细项
private
boolean
deletes
;
// 非必须 删除 false 未删除 true 删除
private
String
foodBasicUnit
;
// string 非必须 食材基本单位
private
String
foodBasicUnit
;
// string 非必须 食材基本单位
主单位
private
List
<
DeputyUnitBean
>
foodUnits
;
private
double
conversionMultiple
;
//number 必须 換算倍數
private
double
foodNumber
;
//number 必须 份数
public
DishDetailBean
(
PurchaseFoodBean
foodBean
,
DishNode
dishNode
)
{
// this.id = foodBean.get; ///此时的 id 一定是null deletes必是f
this
.
deletes
=
false
;
this
.
foodBasicUnit
=
foodBean
.
getBasicUnitName
();
this
.
foodBasicUnit
=
foodBean
.
getBasicUnitName
();
//主单位
this
.
biFoodId
=
dishNode
.
getId
();
this
.
dishesName
=
dishNode
.
getFoodName
();
this
.
brandId
=
AppConstant
.
getBrandId
();
this
.
restaurantId
=
AppConstant
.
getRestaurantId
();
this
.
purchaseFoodId
=
foodBean
.
getId
();;
this
.
foodName
=
foodBean
.
getName
();
this
.
consumeQuantity
=
foodBean
.
getFoodQuantity
();
this
.
basicUnitName
=
foodBean
.
getBasicUnitName
();
this
.
foodNumber
=
foodBean
.
getFoodQuantity
();
this
.
basicUnitName
=
foodBean
.
getBasicUnitName
();
//配置单位
this
.
foodNo
=
foodBean
.
getFoodNo
();
this
.
type
=
0
;
this
.
foodUnits
=
foodBean
.
getFoodUnits
();
this
.
conversionMultiple
=
1.0
;
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/SupplierInfoBean.java
View file @
50e28194
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
import
com.gingersoft.supply_chain.R
;
import
java.io.Serializable
;
...
...
@@ -69,6 +70,11 @@ public class SupplierInfoBean implements Serializable {
supplierInfoBean
.
setMinimumAmount
(
purchaseFoodBean
.
getMinimumAmount
());
supplierInfoBean
.
setAddress
(
purchaseFoodBean
.
getAddress
());
supplierInfoBean
.
setId
(
purchaseFoodBean
.
getSupplierId
());
// supplierInfoBean.setDeliveryTime(purchaseFoodBean.getDeliveryTime());
// TODO: 2021/8/5
Float
deliveryTime
=
Float
.
parseFloat
(
purchaseFoodBean
.
getDeliveryTime
());
int
deliveryMinute
=
(
int
)
(
deliveryTime
*
60
);
supplierInfoBean
.
setDeliveryTime
(
TimeUtils
.
getCurrentDateByOffset
(
deliveryMinute
));
return
supplierInfoBean
;
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/DeputyUnitAdapter.java
View file @
50e28194
...
...
@@ -8,6 +8,7 @@ import android.widget.EditText;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.inputFilter.DecimalDigitsInputFilter
;
import
com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.supply_chain.R
;
...
...
@@ -38,6 +39,7 @@ public class DeputyUnitAdapter extends BaseQuickAdapter<DeputyUnitBean, BaseView
EditText
edConversionMultiple
=
viewHolder
.
getView
(
R
.
id
.
ed_deputy_unit_conversion_multiple
);
viewHolder
.
setText
(
R
.
id
.
tv_deputy_unit_title
,
"副單位"
+
(
viewHolder
.
getAdapterPosition
()
+
1
));
viewHolder
.
setText
(
R
.
id
.
ed_deputy_unit_name
,
item
.
getDeputyUnit
());
viewHolder
.
setText
(
R
.
id
.
ed_deputy_unit_conversion_multiple
,
MoneyUtil
.
formatDouble
(
item
.
getConversionMultiple
()));
//副單位換算倍數
TextWatcher
deputyUnitNameWatcher
=
new
TextWatcher
()
{
...
...
@@ -57,8 +59,9 @@ public class DeputyUnitAdapter extends BaseQuickAdapter<DeputyUnitBean, BaseView
deputyUnitBean
.
setDeputyUnit
(
s
+
""
);
}
};
//副單位名稱輸入框
edDeputyUnitName
.
setFilters
(
new
InputFilter
[]{
InputFilterUtils
.
getLengthFilter
(
getContext
(),
5
),
InputFilterUtils
.
getChAndEnAndNumInputFilter
(
getContext
())});
//副單位名稱輸入框 mod by zjs 填寫商品單位
edDeputyUnitName
.
setFilters
(
new
InputFilter
[]{
InputFilterUtils
.
getLengthFilter
(
getContext
(),
5
),
new
DecimalDigitsInputFilter
(
getContext
(),
3
)});
setFocusChangeListener
(
edDeputyUnitName
,
deputyUnitNameWatcher
);
TextWatcher
conversionMultipleWatcher
=
new
TextWatcher
()
{
@Override
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishDetailAdapter.java
View file @
50e28194
...
...
@@ -51,14 +51,14 @@ public class DishDetailAdapter extends BaseQuickAdapter<DishDetailBean, BaseView
DishDetailBean
tag
=
(
DishDetailBean
)
count
.
getTag
();
if
(
TextUtil
.
isEmptyOrNullOrUndefined
(
s
))
{
ToastUtils
.
show
(
getContext
(),
"數量不能為空"
);
count
.
setText
(
String
.
valueOf
(
tag
.
get
ConsumeQuantity
()));
count
.
setText
(
String
.
valueOf
(
tag
.
get
FoodNumber
()));
count
.
setSelection
(
count
.
getText
().
toString
().
length
());
}
else
{
tag
.
set
ConsumeQuantity
(
Double
.
valueOf
(
s
.
toString
()));
tag
.
set
FoodNumber
(
Double
.
valueOf
(
s
.
toString
()));
}
}
});
count
.
setText
(
String
.
valueOf
(
item
.
get
ConsumeQuantity
()));
//消耗數量
count
.
setText
(
String
.
valueOf
(
item
.
get
FoodNumber
()));
//消耗數量
}
public
void
addDel
(
DishDetailBean
del
){
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/DishesFragment.java
View file @
50e28194
...
...
@@ -124,11 +124,16 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
if
(
units
.
size
()
>
0
)
{
ChooseUnitPopup
popup
=
new
ChooseUnitPopup
(
requireContext
()).
setStringData
(
units
).
setOnSelectListener
((
pos
,
text
)
->
{
//將用戶之前輸入的值,修改到新選擇的單位匯中
String
unitName
=
detailBean
.
getBasicUnitName
();
String
mainUnit
=
detailBean
.
getFoodBasicUnit
();
DeputyUnitBean
deputyUnitBean
=
foodUnits
.
get
(
pos
);
String
selectUnitName
=
deputyUnitBean
.
getDeputyUnit
();
if
(!
unitName
.
equals
(
selectUnitName
))
{
if
(!
mainUnit
.
equals
(
selectUnitName
))
{
//选中的不是主单位那么需要切换倍率
detailBean
.
setBasicUnitName
(
selectUnitName
);
detailBean
.
setConversionMultiple
(
deputyUnitBean
.
getConversionMultiple
());
dishDetailAdapter
.
notifyItemChanged
(
position
);
}
else
{
detailBean
.
setBasicUnitName
(
mainUnit
);
detailBean
.
setConversionMultiple
(
1.0
);
dishDetailAdapter
.
notifyItemChanged
(
position
);
}
...
...
@@ -278,7 +283,7 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
DishDetailBean
oldBean
=
foodsOld
.
get
(
j
);
// LogUtil.i("zjs"," oldBean="+oldBean.toString()+" newBean="+newBean.toString());
if
(
newBean
.
getId
()==
oldBean
.
getPurchaseFoodId
())
{
//选择了同一个食材
oldBean
.
set
ConsumeQuantity
(
oldBean
.
getConsumeQuantity
()+
newBean
.
getFoodQuantity
());
oldBean
.
set
FoodNumber
(
oldBean
.
getFoodNumber
()+
newBean
.
getFoodQuantity
());
isNew
=
false
;
dishDetailAdapter
.
removeDel
(
oldBean
);
dishDetailAdapter
.
notifyItemChanged
(
j
);
...
...
@@ -290,7 +295,7 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
foodsNew
.
add
(
addNewBean
);
}
}
}
else
{
//全新
}
else
{
//全新
conversionMultiple 一定是1
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
PurchaseFoodBean
newBean
=
purchaseFood
.
get
(
i
);
// LogUtil.i("zjs"," 全新 newBean="+newBean.toString());
...
...
component-supply-chain/src/main/res/layout/item_deputy_unit.xml
View file @
50e28194
...
...
@@ -60,7 +60,7 @@
android:hint=
"請輸入"
android:minWidth=
"@dimen/dp_40"
android:paddingLeft=
"@dimen/dp_5"
android:inputType=
"number"
android:inputType=
"number
|numberDecimal
"
android:paddingRight=
"@dimen/dp_5"
android:textColor=
"@color/color_3c"
android:textColorHint=
"@color/color_c9"
...
...
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