Commit 9df2778e by Wyh

1、供應鏈發送url去掉轉義字符 2、購物車和收貨按鈕狀態修改

parent dfe4f9a3
......@@ -204,6 +204,15 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
if (info.isSuccess()) {
//保存分類下食品
savFoodToCategory(info);
List<BuyIngredientsBean> buyIngredientsBeans = new ArrayList<>();
List<PurchaseFoodBean> foodBeans = info.getData();
if(foodBeans != null){
}
//
//這個接口是一級分類才調用,所以直接顯示所有食材,讓用戶可以滾動列表
//將食品和分類整合到一起,List<QMUISection<CategoryBean, PurchaseFoodBean>>
// val sections = foodToList(info.getData());
......
......@@ -564,6 +564,19 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
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() {
return imgs == null ? 0 : imgs.size();
}
......
......@@ -138,7 +138,7 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
public void onNext(@NonNull BaseResult info) {
if (info.isSuccess() && info.getData() != null) {
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) {
mRootView.shareThirdApp(qrCodeMap.get(purchaseMsgBean.orderId + ""), Whatsapp);
} else if (sendType == WeChat) {
......@@ -178,7 +178,7 @@ public class SendMsgPresenter extends BasePresenter<SendMsgContract.Model, SendM
public void onNext(@NonNull BaseResult info) {
if (info.isSuccess() && info.getData() != null) {
MsgConfigBean msgConfigBean = GsonUtils.GsonToBean(info.getData(), MsgConfigBean.class);
qrCodeMap.put(orderId + "", msgConfigBean.getConfigText());
qrCodeMap.put(orderId + "", msgConfigBean.getConfigText().replace("\\n", "\n"));
}
}
});
......
......@@ -116,10 +116,6 @@ public class ShoppingCatPresenter extends BasePresenter<ShoppingCatContract.Mode
shoppingCartBean.setAllSelect(false);
}
}
//不滿足最低採購金額,不可點擊創建訂單按鈕
if (MoneyUtil.compareTo(shoppingCartBean.getMinimumAmount(), supplierTotalAmount) == 1) {
createBtnCheckable = false;
}
//以購物車中的供應商信息為准,如果購物車拿出來的供應商信息為空,就用食材本身的供應商信息
SupplierInfoBean supplierInfoBean = null;
if (food.getSupplierId() != null) {
......@@ -140,6 +136,10 @@ public class ShoppingCatPresenter extends BasePresenter<ShoppingCatContract.Mode
shoppingCartBean.setSupplierName(food.getSupplierName());
shoppingCartBean.setShipping(shipping);
}
//不滿足最低採購金額,不可點擊創建訂單按鈕
if (MoneyUtil.compareTo(shoppingCartBean.getMinimumAmount(), supplierTotalAmount) == 1) {
createBtnCheckable = false;
}
//運費
// shoppingCartBean.setShipping(shipping);
shoppingCartBean.setInitialShippingTime(TimeUtils.getNextDay(1));
......
......@@ -311,22 +311,37 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
}
for (int i = currentFoodIndex; i < itemCount; i++) {
PurchaseOrderDetailsBean.PurchaseOrderDetailsInfoVosBean datum = orderDetailsFoodAdapter.getItem(i);
//如果是sn,判斷是否需要去查詢已經保存的sn碼。
// 如果是sn,判斷這個食品是否已選中,並且本次狀態要為選中
// 判斷不是已經全部收貨的食品
// 再判斷這個食品的sn數量和入庫數量是否一致,不一致則再次選擇
// 判斷是否需要去查詢已經保存的sn碼。
if (datum.getFoodMarkSn() == PurchaseFoodBean.HAS_SN && checkState && datum.getStatus() != PurchaseOrderDetailsBean.COMPLETE_RECEIVED) {
isNeedQuerySn(orderDetailsFoodAdapter.getItemPosition(datum), datum, false);
currentFoodIndex = i;
DeputyUnitBean showUnit = datum.getShowUnit();
int newSnCodeSize = mPresenter.getNewSnCodeSize(datum.getPurchaseFoodEncodeSns());
if(showUnit.getDeputyValue() != newSnCodeSize){
isNeedQuerySn(orderDetailsFoodAdapter.getItemPosition(datum), datum, false);
currentFoodIndex = i;
} else {
selectFood(datum);
//收貨數量等於sn數量,就不用再彈窗了
nextFood();
}
break;
} else {
datum.setChecked(checkState);
if (checkState) {
typesOfFood++;
DeputyUnitBean unit = datum.getShowUnit();
totalAmount = MoneyUtil.sum(totalAmount, MoneyUtil.priceCalculation(unit.getDeputyValue(), unit.getUnitPrice()));
}
selectFood(datum);
}
}
}
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
public void nextFood() {
currentFoodIndex++;
......@@ -534,7 +549,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
}
//本次收貨數量=新增掃sn碼數量
DeputyUnitBean showUnit = infoVosBean.getShowUnit();
if (newAddSize < showUnit.getDeputyValue()) {
if (newAddSize != showUnit.getDeputyValue()) {
showMessage("新增SN数量必须和入库数一致");
return;
}
......
package com.gingersoft.supply_chain.mvp.ui.fragment.order;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
......@@ -35,6 +36,7 @@ import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
import lombok.val;
import me.yokeyword.fragmentation.ISupportFragment;
import static com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean.SupplierContacts.Kakao_Talk;
......@@ -123,6 +125,11 @@ public class SendMsgFragment extends BaseSupplyChainFragment<SendMsgPresenter> i
@Override
public void shareThirdApp(String url, int type) {
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) {
//分享到WhatsApp
DeviceUtils.shareWhatsApp(mContext, url);
......
......@@ -38,6 +38,6 @@ public class TextPopup extends CenterPopupView {
tvTitle.setText(title);
TextView tvContent = findViewById(R.id.tv_content);
tvContent.setText(content.replace("\\n", "\n"));
tvContent.setText(content);
}
}
......@@ -35,10 +35,10 @@
android:layout_marginRight="@dimen/dp_4"
android:layout_weight="1"
android:background="@null"
android:imeOptions="actionDone"
android:digits="@string/str_en_num_digits"
android:gravity="center_vertical"
android:hint="@string/str_please_input"
android:inputType="number"
android:imeOptions="actionDone"
android:paddingLeft="@dimen/dp_8"
android:textColor="@color/theme_333_color"
android:textColorHint="@color/color_b8"
......@@ -78,6 +78,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent" />
......
......@@ -34,4 +34,5 @@
<string name="str_prepared">製單人:%1$s</string>
<string name="str_device_not_print">您的設備不支持打印</string>
<string name="str_sn_codes">SN嗎:%1$s</string>
<string name="str_en_num_digits">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment