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
96d00b33
Commit
96d00b33
authored
Aug 07, 2021
by
张建升
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
可以切换主单位 再来一单 预计发货时间修复
parent
50e28194
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
15 deletions
+37
-15
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/SupplierInfoBean.java
+6
-6
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/OrderDetailsPresenter.java
+1
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/DishesFragment.java
+19
-9
library-common/src/main/java/com/gingersoft/gsa/cloud/common/utils/time/TimeUtils.java
+11
-0
No files found.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/SupplierInfoBean.java
View file @
96d00b33
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
import
com.gingersoft.gsa.cloud.common.utils.
time.TimeUtils
;
import
com.gingersoft.gsa.cloud.common.utils.
other.TextUtil
;
import
com.gingersoft.supply_chain.R
;
import
java.io.Serializable
;
...
...
@@ -70,11 +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
));
if
(
TextUtil
.
isEmptyOrNullOrUndefined
(
purchaseFoodBean
.
getDeliveryTime
()))
{
supplierInfoBean
.
setDeliveryTime
(
0
);
}
else
{
supplierInfoBean
.
setDeliveryTime
(
Float
.
parseFloat
(
purchaseFoodBean
.
getDeliveryTime
())
);
}
return
supplierInfoBean
;
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/OrderDetailsPresenter.java
View file @
96d00b33
...
...
@@ -315,6 +315,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
if
(
baseResult
.
isSuccess
())
{
List
<
PurchaseFoodBean
>
purchaseFoodBeans
=
GsonUtils
.
jsonToList
(
baseResult
.
getData
(),
PurchaseFoodBean
.
class
);
for
(
PurchaseFoodBean
purchaseFoodBean
:
purchaseFoodBeans
)
{
// LogUtil.e("zjs purchaseFoodBean=="+purchaseFoodBean.toString());
for
(
PurchaseOrderDetailsBean
.
PurchaseOrderDetailsInfoVosBean
item
:
data
)
{
if
(
purchaseFoodBean
.
getId
()
==
item
.
getPurchaseFoodId
())
{
purchaseFoodBean
.
setFoodQuantity
(
item
.
getFoodQuantity
());
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/DishesFragment.java
View file @
96d00b33
...
...
@@ -116,27 +116,37 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
}
else
if
(
id
==
R
.
id
.
tv_dishes_unit
)
{
List
<
DeputyUnitBean
>
foodUnits
=
detailBean
.
getFoodUnits
();
if
(
CollectionUtils
.
isNotNullOrEmpty
(
foodUnits
))
{
int
len
=
foodUnits
.
size
();
List
<
String
>
units
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
foodUnits
.
size
()
;
i
++)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
String
name
=
foodUnits
.
get
(
i
).
getDeputyUnit
();
units
.
add
(
name
);
}
units
.
add
(
detailBean
.
getFoodBasicUnit
());
if
(
units
.
size
()
>
0
)
{
ChooseUnitPopup
popup
=
new
ChooseUnitPopup
(
requireContext
()).
setStringData
(
units
).
setOnSelectListener
((
pos
,
text
)
->
{
//將用戶之前輸入的值,修改到新選擇的單位匯中
String
mainUnit
=
detailBean
.
getFoodBasicUnit
();
DeputyUnitBean
deputyUnitBean
=
foodUnits
.
get
(
pos
);
String
selectUnitName
=
deputyUnitBean
.
getDeputyUnit
();
if
(!
mainUnit
.
equals
(
selectUnitName
))
{
//选中的不是主单位那么需要切换倍率
detailBean
.
setBasicUnitName
(
selectUnitName
);
detailBean
.
setConversionMultiple
(
deputyUnitBean
.
getConversionMultiple
());
dishDetailAdapter
.
notifyItemChanged
(
position
);
}
else
{
// LogUtil.e("ZJS pos="+pos+" len"+len+" mainUnit="+mainUnit);
if
(
pos
>=
len
)
{
detailBean
.
setBasicUnitName
(
mainUnit
);
detailBean
.
setConversionMultiple
(
1.0
);
dishDetailAdapter
.
notifyItemChanged
(
position
);
}
else
{
DeputyUnitBean
deputyUnitBean
=
foodUnits
.
get
(
pos
);
String
selectUnitName
=
deputyUnitBean
.
getDeputyUnit
();
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
);
}
}
});
new
XPopup
.
Builder
(
getContext
())
.
hasShadowBg
(
false
)
...
...
@@ -298,8 +308,8 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
}
else
{
//全新 conversionMultiple 一定是1
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
PurchaseFoodBean
newBean
=
purchaseFood
.
get
(
i
);
// LogUtil.i("zjs"," 全新 newBean="+newBean.toString());
DishDetailBean
addNewBean
=
new
DishDetailBean
(
newBean
,
curSelectDishNode
);
// LogUtil.i("zjs"," 全新 newBean="+newBean.toString()+" addNewBean"+addNewBean.toString());
foodsNew
.
add
(
addNewBean
);
}
}
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/utils/time/TimeUtils.java
View file @
96d00b33
...
...
@@ -419,6 +419,17 @@ public class TimeUtils {
}
public
static
long
getCurrentDateByOffset
(
int
offset
)
{
try
{
Calendar
c
=
new
GregorianCalendar
();
c
.
add
(
Calendar
.
HOUR_OF_DAY
,
offset
);
return
c
.
getTime
().
getTime
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
System
.
currentTimeMillis
();
}
/**
* 描述:计算两个日期所差的天数.
*
...
...
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