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
9df2778e
Commit
9df2778e
authored
Apr 01, 2021
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、供應鏈發送url去掉轉義字符 2、購物車和收貨按鈕狀態修改
parent
dfe4f9a3
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
19 deletions
+66
-19
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/BuyIngredientsPresenter.java
+9
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/OrderDetailsPresenter.java
+13
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/SendMsgPresenter.java
+2
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/ShoppingCatPresenter.java
+4
-4
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/OrderDetailsFragment.java
+25
-10
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/SendMsgFragment.java
+7
-0
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/TextPopup.java
+1
-1
component-supply-chain/src/main/res/layout/layout_scan_sn.xml
+3
-2
component-supply-chain/src/main/res/values/strings.xml
+2
-0
No files found.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/BuyIngredientsPresenter.java
View file @
9df2778e
...
@@ -204,6 +204,15 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
...
@@ -204,6 +204,15 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
if
(
info
.
isSuccess
())
{
if
(
info
.
isSuccess
())
{
//保存分類下食品
//保存分類下食品
savFoodToCategory
(
info
);
savFoodToCategory
(
info
);
List
<
BuyIngredientsBean
>
buyIngredientsBeans
=
new
ArrayList
<>();
List
<
PurchaseFoodBean
>
foodBeans
=
info
.
getData
();
if
(
foodBeans
!=
null
){
}
//
//這個接口是一級分類才調用,所以直接顯示所有食材,讓用戶可以滾動列表
//這個接口是一級分類才調用,所以直接顯示所有食材,讓用戶可以滾動列表
//將食品和分類整合到一起,List<QMUISection<CategoryBean, PurchaseFoodBean>>
//將食品和分類整合到一起,List<QMUISection<CategoryBean, PurchaseFoodBean>>
// val sections = foodToList(info.getData());
// val sections = foodToList(info.getData());
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/OrderDetailsPresenter.java
View file @
9df2778e
...
@@ -564,6 +564,19 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
...
@@ -564,6 +564,19 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
return
null
;
return
null
;
}
}
public
int
getNewSnCodeSize
(
List
<
PurchaseFoodEncodeSn
>
purchaseFoodEncodeSns
)
{
if
(
purchaseFoodEncodeSns
==
null
)
{
return
0
;
}
int
size
=
0
;
for
(
PurchaseFoodEncodeSn
purchaseFoodEncodeSn
:
purchaseFoodEncodeSns
)
{
if
(
purchaseFoodEncodeSn
.
newAdd
)
{
size
++;
}
}
return
size
;
}
public
int
getPicSize
()
{
public
int
getPicSize
()
{
return
imgs
==
null
?
0
:
imgs
.
size
();
return
imgs
==
null
?
0
:
imgs
.
size
();
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/SendMsgPresenter.java
View file @
9df2778e
...
@@ -138,7 +138,7 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
...
@@ -138,7 +138,7 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
public
void
onNext
(
@NonNull
BaseResult
info
)
{
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
.
isSuccess
()
&&
info
.
getData
()
!=
null
)
{
if
(
info
.
isSuccess
()
&&
info
.
getData
()
!=
null
)
{
MsgConfigBean
msgConfigBean
=
GsonUtils
.
GsonToBean
(
info
.
getData
(),
MsgConfigBean
.
class
);
MsgConfigBean
msgConfigBean
=
GsonUtils
.
GsonToBean
(
info
.
getData
(),
MsgConfigBean
.
class
);
qrCodeMap
.
put
(
purchaseMsgBean
.
orderId
+
""
,
msgConfigBean
.
getConfigText
());
qrCodeMap
.
put
(
purchaseMsgBean
.
orderId
+
""
,
msgConfigBean
.
getConfigText
()
.
replace
(
"\\n"
,
"\n"
)
);
if
(
sendType
==
Whatsapp
)
{
if
(
sendType
==
Whatsapp
)
{
mRootView
.
shareThirdApp
(
qrCodeMap
.
get
(
purchaseMsgBean
.
orderId
+
""
),
Whatsapp
);
mRootView
.
shareThirdApp
(
qrCodeMap
.
get
(
purchaseMsgBean
.
orderId
+
""
),
Whatsapp
);
}
else
if
(
sendType
==
WeChat
)
{
}
else
if
(
sendType
==
WeChat
)
{
...
@@ -178,7 +178,7 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
...
@@ -178,7 +178,7 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
public
void
onNext
(
@NonNull
BaseResult
info
)
{
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
.
isSuccess
()
&&
info
.
getData
()
!=
null
)
{
if
(
info
.
isSuccess
()
&&
info
.
getData
()
!=
null
)
{
MsgConfigBean
msgConfigBean
=
GsonUtils
.
GsonToBean
(
info
.
getData
(),
MsgConfigBean
.
class
);
MsgConfigBean
msgConfigBean
=
GsonUtils
.
GsonToBean
(
info
.
getData
(),
MsgConfigBean
.
class
);
qrCodeMap
.
put
(
orderId
+
""
,
msgConfigBean
.
getConfigText
());
qrCodeMap
.
put
(
orderId
+
""
,
msgConfigBean
.
getConfigText
()
.
replace
(
"\\n"
,
"\n"
)
);
}
}
}
}
});
});
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/ShoppingCatPresenter.java
View file @
9df2778e
...
@@ -116,10 +116,6 @@ public class ShoppingCatPresenter extends BasePresenter<ShoppingCatContract.Mode
...
@@ -116,10 +116,6 @@ public class ShoppingCatPresenter extends BasePresenter<ShoppingCatContract.Mode
shoppingCartBean
.
setAllSelect
(
false
);
shoppingCartBean
.
setAllSelect
(
false
);
}
}
}
}
//不滿足最低採購金額,不可點擊創建訂單按鈕
if
(
MoneyUtil
.
compareTo
(
shoppingCartBean
.
getMinimumAmount
(),
supplierTotalAmount
)
==
1
)
{
createBtnCheckable
=
false
;
}
//以購物車中的供應商信息為准,如果購物車拿出來的供應商信息為空,就用食材本身的供應商信息
//以購物車中的供應商信息為准,如果購物車拿出來的供應商信息為空,就用食材本身的供應商信息
SupplierInfoBean
supplierInfoBean
=
null
;
SupplierInfoBean
supplierInfoBean
=
null
;
if
(
food
.
getSupplierId
()
!=
null
)
{
if
(
food
.
getSupplierId
()
!=
null
)
{
...
@@ -140,6 +136,10 @@ public class ShoppingCatPresenter extends BasePresenter<ShoppingCatContract.Mode
...
@@ -140,6 +136,10 @@ public class ShoppingCatPresenter extends BasePresenter<ShoppingCatContract.Mode
shoppingCartBean
.
setSupplierName
(
food
.
getSupplierName
());
shoppingCartBean
.
setSupplierName
(
food
.
getSupplierName
());
shoppingCartBean
.
setShipping
(
shipping
);
shoppingCartBean
.
setShipping
(
shipping
);
}
}
//不滿足最低採購金額,不可點擊創建訂單按鈕
if
(
MoneyUtil
.
compareTo
(
shoppingCartBean
.
getMinimumAmount
(),
supplierTotalAmount
)
==
1
)
{
createBtnCheckable
=
false
;
}
//運費
//運費
// shoppingCartBean.setShipping(shipping);
// shoppingCartBean.setShipping(shipping);
shoppingCartBean
.
setInitialShippingTime
(
TimeUtils
.
getNextDay
(
1
));
shoppingCartBean
.
setInitialShippingTime
(
TimeUtils
.
getNextDay
(
1
));
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/OrderDetailsFragment.java
View file @
9df2778e
...
@@ -311,22 +311,37 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
...
@@ -311,22 +311,37 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
}
}
for
(
int
i
=
currentFoodIndex
;
i
<
itemCount
;
i
++)
{
for
(
int
i
=
currentFoodIndex
;
i
<
itemCount
;
i
++)
{
PurchaseOrderDetailsBean
.
PurchaseOrderDetailsInfoVosBean
datum
=
orderDetailsFoodAdapter
.
getItem
(
i
);
PurchaseOrderDetailsBean
.
PurchaseOrderDetailsInfoVosBean
datum
=
orderDetailsFoodAdapter
.
getItem
(
i
);
//如果是sn,判斷是否需要去查詢已經保存的sn碼。
// 如果是sn,判斷這個食品是否已選中,並且本次狀態要為選中
// 判斷不是已經全部收貨的食品
// 再判斷這個食品的sn數量和入庫數量是否一致,不一致則再次選擇
// 判斷是否需要去查詢已經保存的sn碼。
if
(
datum
.
getFoodMarkSn
()
==
PurchaseFoodBean
.
HAS_SN
&&
checkState
&&
datum
.
getStatus
()
!=
PurchaseOrderDetailsBean
.
COMPLETE_RECEIVED
)
{
if
(
datum
.
getFoodMarkSn
()
==
PurchaseFoodBean
.
HAS_SN
&&
checkState
&&
datum
.
getStatus
()
!=
PurchaseOrderDetailsBean
.
COMPLETE_RECEIVED
)
{
isNeedQuerySn
(
orderDetailsFoodAdapter
.
getItemPosition
(
datum
),
datum
,
false
);
DeputyUnitBean
showUnit
=
datum
.
getShowUnit
();
currentFoodIndex
=
i
;
int
newSnCodeSize
=
mPresenter
.
getNewSnCodeSize
(
datum
.
getPurchaseFoodEncodeSns
());
if
(
showUnit
.
getDeputyValue
()
!=
newSnCodeSize
){
isNeedQuerySn
(
orderDetailsFoodAdapter
.
getItemPosition
(
datum
),
datum
,
false
);
currentFoodIndex
=
i
;
}
else
{
selectFood
(
datum
);
//收貨數量等於sn數量,就不用再彈窗了
nextFood
();
}
break
;
break
;
}
else
{
}
else
{
datum
.
setChecked
(
checkState
);
selectFood
(
datum
);
if
(
checkState
)
{
typesOfFood
++;
DeputyUnitBean
unit
=
datum
.
getShowUnit
();
totalAmount
=
MoneyUtil
.
sum
(
totalAmount
,
MoneyUtil
.
priceCalculation
(
unit
.
getDeputyValue
(),
unit
.
getUnitPrice
()));
}
}
}
}
}
}
}
private
void
selectFood
(
PurchaseOrderDetailsBean
.
PurchaseOrderDetailsInfoVosBean
datum
)
{
datum
.
setChecked
(
checkState
);
if
(
checkState
)
{
typesOfFood
++;
DeputyUnitBean
unit
=
datum
.
getShowUnit
();
totalAmount
=
MoneyUtil
.
sum
(
totalAmount
,
MoneyUtil
.
priceCalculation
(
unit
.
getDeputyValue
(),
unit
.
getUnitPrice
()));
}
}
@Override
@Override
public
void
nextFood
()
{
public
void
nextFood
()
{
currentFoodIndex
++;
currentFoodIndex
++;
...
@@ -534,7 +549,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
...
@@ -534,7 +549,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
}
}
//本次收貨數量=新增掃sn碼數量
//本次收貨數量=新增掃sn碼數量
DeputyUnitBean
showUnit
=
infoVosBean
.
getShowUnit
();
DeputyUnitBean
showUnit
=
infoVosBean
.
getShowUnit
();
if
(
newAddSize
<
showUnit
.
getDeputyValue
())
{
if
(
newAddSize
!=
showUnit
.
getDeputyValue
())
{
showMessage
(
"新增SN数量必须和入库数一致"
);
showMessage
(
"新增SN数量必须和入库数一致"
);
return
;
return
;
}
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/order/SendMsgFragment.java
View file @
9df2778e
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
order
;
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
order
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
...
@@ -35,6 +36,7 @@ import java.util.List;
...
@@ -35,6 +36,7 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
butterknife.OnClick
;
import
lombok.val
;
import
me.yokeyword.fragmentation.ISupportFragment
;
import
me.yokeyword.fragmentation.ISupportFragment
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
.
SupplierInfoBean
.
SupplierContacts
.
Kakao_Talk
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
.
SupplierInfoBean
.
SupplierContacts
.
Kakao_Talk
;
...
@@ -123,6 +125,11 @@ public class SendMsgFragment extends BaseSupplyChainFragment<SendMsgPresenter> i
...
@@ -123,6 +125,11 @@ public class SendMsgFragment extends BaseSupplyChainFragment<SendMsgPresenter> i
@Override
@Override
public
void
shareThirdApp
(
String
url
,
int
type
)
{
public
void
shareThirdApp
(
String
url
,
int
type
)
{
ClipboardUtils
.
copyText
(
url
);
ClipboardUtils
.
copyText
(
url
);
// Intent intent = new Intent(Intent.ACTION_SEND);
// intent.putExtra(Intent.EXTRA_SUBJECT, "");
// intent.putExtra(Intent.EXTRA_TEXT, url);
// intent.setType("text/*");
// startActivity(intent);
if
(
type
==
Whatsapp
)
{
if
(
type
==
Whatsapp
)
{
//分享到WhatsApp
//分享到WhatsApp
DeviceUtils
.
shareWhatsApp
(
mContext
,
url
);
DeviceUtils
.
shareWhatsApp
(
mContext
,
url
);
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/TextPopup.java
View file @
9df2778e
...
@@ -38,6 +38,6 @@ public class TextPopup extends CenterPopupView {
...
@@ -38,6 +38,6 @@ public class TextPopup extends CenterPopupView {
tvTitle
.
setText
(
title
);
tvTitle
.
setText
(
title
);
TextView
tvContent
=
findViewById
(
R
.
id
.
tv_content
);
TextView
tvContent
=
findViewById
(
R
.
id
.
tv_content
);
tvContent
.
setText
(
content
.
replace
(
"\\n"
,
"\n"
)
);
tvContent
.
setText
(
content
);
}
}
}
}
component-supply-chain/src/main/res/layout/layout_scan_sn.xml
View file @
9df2778e
...
@@ -35,10 +35,10 @@
...
@@ -35,10 +35,10 @@
android:layout_marginRight=
"@dimen/dp_4"
android:layout_marginRight=
"@dimen/dp_4"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@null"
android:background=
"@null"
android:
imeOptions=
"actionDone
"
android:
digits=
"@string/str_en_num_digits
"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:hint=
"@string/str_please_input"
android:hint=
"@string/str_please_input"
android:i
nputType=
"number
"
android:i
meOptions=
"actionDone
"
android:paddingLeft=
"@dimen/dp_8"
android:paddingLeft=
"@dimen/dp_8"
android:textColor=
"@color/theme_333_color"
android:textColor=
"@color/theme_333_color"
android:textColorHint=
"@color/color_b8"
android:textColorHint=
"@color/color_b8"
...
@@ -78,6 +78,7 @@
...
@@ -78,6 +78,7 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
...
...
component-supply-chain/src/main/res/values/strings.xml
View file @
9df2778e
...
@@ -34,4 +34,5 @@
...
@@ -34,4 +34,5 @@
<string
name=
"str_prepared"
>
製單人:%1$s
</string>
<string
name=
"str_prepared"
>
製單人:%1$s
</string>
<string
name=
"str_device_not_print"
>
您的設備不支持打印
</string>
<string
name=
"str_device_not_print"
>
您的設備不支持打印
</string>
<string
name=
"str_sn_codes"
>
SN嗎:%1$s
</string>
<string
name=
"str_sn_codes"
>
SN嗎:%1$s
</string>
<string
name=
"str_en_num_digits"
>
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
</string>
</resources>
</resources>
\ 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