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
3044f4f2
Commit
3044f4f2
authored
Aug 01, 2021
by
张建升
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小数点支持
parent
361399f1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
42 additions
and
25 deletions
+42
-25
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/ConsumeWareHousingBean.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/InventoryRecordBean.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseConsumeSnBean.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseWarehousingOrderDetailsVO.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WarehouseDetailsBean.java
+3
-3
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/WarehouseDetailsContract.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/WarehousingInventoryContract.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WareHouseListPresenter.java
+17
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WarehousingInventoryPresenter.java
+3
-3
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehouseDetailsFragment.java
+3
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingInventoryFragment.java
+4
-3
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/InventoryConsumptionView.java
+2
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ScanSnView.java
+2
-2
component-supply-chain/src/main/res/values/strings.xml
+2
-2
No files found.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/ConsumeWareHousingBean.java
View file @
3044f4f2
...
...
@@ -31,6 +31,6 @@ public class ConsumeWareHousingBean {
private
String
remarks
;
/***消耗数量*/
private
int
consumeQuantity
;
private
double
consumeQuantity
;
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/InventoryRecordBean.java
View file @
3044f4f2
...
...
@@ -15,7 +15,7 @@ public class InventoryRecordBean {
private
String
userName
;
private
int
uid
;
private
int
consumeQuantity
;
private
int
remainingQuantity
;
private
double
remainingQuantity
;
private
long
createTime
;
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseConsumeSnBean.java
View file @
3044f4f2
...
...
@@ -17,7 +17,7 @@ public class PurchaseConsumeSnBean {
//食材編號
public
String
foodNo
;
//消耗數量
public
int
consumeQuantity
;
public
double
consumeQuantity
;
//原因id
public
int
purchaseConsumeReasonId
;
public
String
remarks
;
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseWarehousingOrderDetailsVO.java
View file @
3044f4f2
...
...
@@ -30,7 +30,7 @@ public class PurchaseWarehousingOrderDetailsVO implements Serializable {
// private String supplierName;
private
String
unitName
;
private
double
foodPrice
;
private
int
foodNum
;
private
double
foodNum
;
private
double
foodAmount
;
private
String
images
;
/**
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/bean/WarehouseDetailsBean.java
View file @
3044f4f2
...
...
@@ -27,7 +27,7 @@ public class WarehouseDetailsBean implements Serializable {
private
String
name
;
private
String
purchase
;
private
String
orderNo
;
private
int
foodQuantity
;
private
double
foodQuantity
;
/**
* true:查詢過數量了。可以顯示數量
*/
...
...
@@ -78,7 +78,7 @@ public class WarehouseDetailsBean implements Serializable {
*/
private
String
purchaseConsumeNoId
;
private
int
consumeQuantity
;
private
double
consumeQuantity
;
//出庫
public
static
final
int
TYPE_DELIVERY_HOUSE_TYPE
=
1
;
...
...
@@ -89,7 +89,7 @@ public class WarehouseDetailsBean implements Serializable {
public
WarehouseDetailsBean
()
{
}
public
WarehouseDetailsBean
(
String
name
,
int
foodQuantity
,
String
warehousingOrderDetailsIds
)
{
public
WarehouseDetailsBean
(
String
name
,
double
foodQuantity
,
String
warehousingOrderDetailsIds
)
{
this
.
name
=
name
;
this
.
foodQuantity
=
foodQuantity
;
this
.
warehousingOrderDetailsIds
=
warehousingOrderDetailsIds
;
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/WarehouseDetailsContract.java
View file @
3044f4f2
...
...
@@ -52,7 +52,7 @@ public interface WarehouseDetailsContract {
/**
* 修改庫存數量
*/
void
setWarehousingNum
(
int
num
);
void
setWarehousingNum
(
double
num
);
/**
* 如果消耗成功了,需要移除消耗视图,显示流水
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/contract/WarehousingInventoryContract.java
View file @
3044f4f2
...
...
@@ -27,7 +27,7 @@ import okhttp3.RequestBody;
public
interface
WarehousingInventoryContract
{
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
void
updateSuccess
(
int
consumeQuantity
);
void
updateSuccess
(
double
consumeQuantity
);
void
loadRecord
(
List
<
InventoryRecordBean
>
inventoryRecordBeans
);
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WareHouseListPresenter.java
View file @
3044f4f2
...
...
@@ -90,10 +90,23 @@ public class WareHouseListPresenter extends BasePresenter<WareHouseListContract.
}
else
if
(
type
==
SORT_WAREHOUSING_NUM
)
{
//庫存數量
Collections
.
sort
(
purchaseWarehousingOrderDetailsVOS
,
(
o1
,
o2
)
->
{
double
res
=
o1
.
getFoodNum
()
-
o2
.
getFoodNum
();
if
(
isAscending
)
{
return
o1
.
getFoodNum
()
-
o2
.
getFoodNum
();
if
(
res
==
0
)
{
return
0
;
}
else
if
(
res
>
0
)
{
return
1
;
}
else
{
return
-
1
;
}
}
else
{
return
o2
.
getFoodNum
()
-
o1
.
getFoodNum
();
if
(
res
==
0
)
{
return
0
;
}
else
if
(
res
>
0
)
{
return
-
1
;
}
else
{
return
1
;
}
}
});
}
else
if
(
type
==
SORT_TOTAL_AMOUNT
)
{
...
...
@@ -150,4 +163,6 @@ public class WareHouseListPresenter extends BasePresenter<WareHouseListContract.
}
});
}
}
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/WarehousingInventoryPresenter.java
View file @
3044f4f2
...
...
@@ -74,15 +74,15 @@ public class WarehousingInventoryPresenter extends BasePresenter<WarehousingInve
}
public
void
consumeWareHousing
(
String
foodNo
,
int
purchaseFoodId
,
int
consumeQuantity
)
{
public
void
consumeWareHousing
(
String
foodNo
,
int
purchaseFoodId
,
double
consumeQuantity
)
{
consumeWareHousing
(
getPurchaseConsumeSnBean
(
foodNo
,
consumeQuantity
,
purchaseFoodId
,
null
));
}
public
void
consumeWareHousing
(
String
foodNo
,
int
purchaseFoodId
,
int
consumeQuantity
,
List
<
PurchaseFoodEncodeSn
>
snCodes
)
{
public
void
consumeWareHousing
(
String
foodNo
,
int
purchaseFoodId
,
double
consumeQuantity
,
List
<
PurchaseFoodEncodeSn
>
snCodes
)
{
consumeWareHousing
(
getPurchaseConsumeSnBean
(
foodNo
,
consumeQuantity
,
purchaseFoodId
,
snCodes
));
}
public
PurchaseConsumeSnBean
getPurchaseConsumeSnBean
(
String
foodNo
,
int
consumeQuantity
,
int
purchaseFoodId
,
List
<
PurchaseFoodEncodeSn
>
snCodes
)
{
public
PurchaseConsumeSnBean
getPurchaseConsumeSnBean
(
String
foodNo
,
double
consumeQuantity
,
int
purchaseFoodId
,
List
<
PurchaseFoodEncodeSn
>
snCodes
)
{
PurchaseConsumeSnBean
purchaseConsumeSnBean
=
new
PurchaseConsumeSnBean
();
purchaseConsumeSnBean
.
brandId
=
AppConstant
.
getBrandId
();
purchaseConsumeSnBean
.
restaurantId
=
AppConstant
.
getRestaurantId
();
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehouseDetailsFragment.java
View file @
3044f4f2
...
...
@@ -300,7 +300,8 @@ public class WarehouseDetailsFragment extends BaseSupplyChainFragment<WarehouseD
snCodes
.
add
(
purchaseFoodEncodeSn
.
getEncodeSnNo
());
}
inventory
(
consumeReasonBeans
,
snCodes
,
inventoryConsumptionView
.
getIsPrint
());
}).
setMaxCodeSize
(
purchaseWarehousingOrderDetailsVO
.
getFoodNum
()).
setOnCancelListener
(()
->
{
// TODO: 2021/7/31 最大掃碼數量
}).
setMaxCodeSize
((
int
)
purchaseWarehousingOrderDetailsVO
.
getFoodNum
()).
setOnCancelListener
(()
->
{
//取消
showList
(
View
.
VISIBLE
);
}).
init
();
...
...
@@ -502,7 +503,7 @@ public class WarehouseDetailsFragment extends BaseSupplyChainFragment<WarehouseD
}
@Override
public
void
setWarehousingNum
(
int
num
)
{
public
void
setWarehousingNum
(
double
num
)
{
purchaseWarehousingOrderDetailsVO
.
setFoodNum
(
num
);
tvWarehouseInventoryNumber
.
setText
(
String
.
valueOf
(
num
));
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/warehouse/WarehousingInventoryFragment.java
View file @
3044f4f2
...
...
@@ -211,7 +211,7 @@ public class WarehousingInventoryFragment extends BaseSupplyChainFragment<Wareho
}
@Override
public
void
updateSuccess
(
int
consumeQuantity
)
{
public
void
updateSuccess
(
double
consumeQuantity
)
{
setFragmentResult
(
RESULT_OK
,
null
);
edWarehouseLoss
.
setText
(
"0"
);
purchaseWarehousingOrderDetailsVo
.
setFoodNum
(
purchaseWarehousingOrderDetailsVo
.
getFoodNum
()
-
consumeQuantity
);
...
...
@@ -259,12 +259,13 @@ public class WarehousingInventoryFragment extends BaseSupplyChainFragment<Wareho
edWarehouseLoss
.
requestFocus
();
}
else
{
//盤點數量
int
inventoryNum
=
Integer
.
parseInt
(
edWarehouseLoss
.
getText
().
toString
());
double
inventoryNum
=
Double
.
parseDouble
(
edWarehouseLoss
.
getText
().
toString
());
if
(
inventoryNum
<=
0
)
{
showMessage
(
"請輸入盤點庫存數量"
);
edWarehouseLoss
.
requestFocus
();
}
else
{
int
remainingAmount
=
purchaseWarehousingOrderDetailsVo
.
getFoodNum
()
-
inventoryNum
;
// TODO: 2021/7/31 zjs 可能需要保留小數點3位
double
remainingAmount
=
purchaseWarehousingOrderDetailsVo
.
getFoodNum
()
-
inventoryNum
;
mPresenter
.
consumeWareHousing
(
purchaseWarehousingOrderDetailsVo
.
getFoodNo
(),
purchaseWarehousingOrderDetailsVo
.
getId
(),
remainingAmount
);
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/InventoryConsumptionView.java
View file @
3044f4f2
...
...
@@ -42,7 +42,7 @@ import butterknife.ButterKnife;
*/
public
class
InventoryConsumptionView
extends
FrameLayout
{
private
final
int
maxConsumption
;
private
final
double
maxConsumption
;
@BindView
(
R2
.
id
.
et_input
)
EditText
edInput
;
@BindView
(
R2
.
id
.
switch_multi_boolean_state
)
...
...
@@ -63,7 +63,7 @@ public class InventoryConsumptionView extends FrameLayout {
private
OnNumberChangeListener
onNumberChangeListener
;
public
InventoryConsumptionView
(
@NonNull
Context
context
,
List
<
ConsumeReasonBean
>
consumeReasonBeans
,
int
maxConsumption
)
{
public
InventoryConsumptionView
(
@NonNull
Context
context
,
List
<
ConsumeReasonBean
>
consumeReasonBeans
,
double
maxConsumption
)
{
super
(
context
);
View
rootView
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
layout_inventory_consumption
,
null
,
false
);
ButterKnife
.
bind
(
this
,
rootView
);
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ScanSnView.java
View file @
3044f4f2
...
...
@@ -96,7 +96,7 @@ public class ScanSnView extends FrameLayout {
/**
* 最大掃碼數量
*/
public
int
maxCodeSize
=
-
1
;
public
double
maxCodeSize
=
-
1
;
/**
* 最少掃碼數量
*/
...
...
@@ -338,7 +338,7 @@ public class ScanSnView extends FrameLayout {
return
this
;
}
public
ScanSnView
setMaxCodeSize
(
int
maxCodeSize
)
{
public
ScanSnView
setMaxCodeSize
(
double
maxCodeSize
)
{
this
.
maxCodeSize
=
maxCodeSize
;
return
this
;
}
...
...
component-supply-chain/src/main/res/values/strings.xml
View file @
3044f4f2
...
...
@@ -24,7 +24,7 @@
<string
name=
"str_format_warehouse_no"
>
入庫單號:%1$s
</string>
<string
name=
"str_format_remark"
>
備註:%1$s
</string>
<string
name=
"str_format_positive"
>
+%1$s
</string>
<string
name=
"str_format_positive_int"
>
+%1$
d
</string>
<string
name=
"str_format_positive_int"
>
+%1$
.3f
</string>
<string
name=
"str_format_less"
>
-%1$s
</string>
<string
name=
"str_unit_price_colon"
>
單價:$%1$.2f
</string>
<string
name=
"str_unit_price_colon_s"
>
單價:$%1$s
</string>
...
...
@@ -91,7 +91,7 @@
<string
name=
"str_already_warehousing_dont_delete"
>
已入庫的SN碼不可刪除
</string>
<string
name=
"str_scan_dont_use"
>
掃碼功能無法啟用,請聯繫開發人員
</string>
<string
name=
"str_food_existed_dont_add"
>
商品已存在,不能重複添加
</string>
<string
name=
"str_format_can_not_exceed_inventory_quantity"
>
不能超過當前庫存數量:%1$
d
</string>
<string
name=
"str_format_can_not_exceed_inventory_quantity"
>
不能超過當前庫存數量:%1$
.3f
</string>
<string
name=
"str_please_input_consume_quantity"
>
請輸入消耗庫存數
</string>
<string
name=
"str_format_sn_already_existed"
>
%1$s已存在列表中
</string>
<string
name=
"str_sn_quantity_consume_must_equla"
>
SN碼數量和消耗庫存數必須保持一致
</string>
...
...
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