Commit 52997db5 authored by 王海's avatar 王海

pos419

parent 9d1c7413
...@@ -149,7 +149,7 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi ...@@ -149,7 +149,7 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
@Override @Override
protected void onStop() { protected void onStop() {
C.SYSTEM.mStateEnable = false; // C.SYSTEM.mStateEnable = false;
super.onStop(); super.onStop();
} }
......
...@@ -16,7 +16,6 @@ import com.xingdata.zzdpos.R; ...@@ -16,7 +16,6 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSignInBinding; import com.xingdata.zzdpos.databinding.FragmentSignInBinding;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.dialog.PromptDialog; import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.login.LoginPresenter; import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
...@@ -87,18 +86,13 @@ public class SignInFragment extends BaseFragment<LoginPresenter, ...@@ -87,18 +86,13 @@ public class SignInFragment extends BaseFragment<LoginPresenter,
break; break;
case R.id.btn_login: { case R.id.btn_login: {
if (mViewBinding.etPwd.getText().toString().isEmpty() || if (mViewBinding.etPwd.getText().toString().isEmpty() ||
mViewBinding.etPhone mViewBinding.etPhone.getText().toString().isEmpty()) {
.getText().toString().isEmpty()) {
ToastUtils.showLong("账号密码不能为空"); ToastUtils.showLong("账号密码不能为空");
} else { } else {
promptDialog = new PromptDialog().setDialogType(PromptDialog promptDialog = new PromptDialog().setDialogType(PromptDialog.PROMPTDIALOG_ING, "正在登录");
.PROMPTDIALOG_ING, "正在登录");
mLoadingDialog.show((BaseActivity) getActivity()); mLoadingDialog.show((BaseActivity) getActivity());
mPresenter.signIn(mViewBinding.etPhone.getText().toString(), mPresenter.signIn(mViewBinding.etPhone.getText().toString(),
mViewBinding mViewBinding.etPwd.getText().toString(), promptDialog, mLoadingDialog);
.etPwd.getText().toString(), promptDialog,
mLoadingDialog);
} }
} }
......
...@@ -286,7 +286,7 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese ...@@ -286,7 +286,7 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
DialogInterface.OnClickListener() { DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
mPresenter.returnOrder(mSaleorder.getOrderNo() + ""); mPresenter.returnOrder(mSaleorder);
} }
}).create().show(); }).create().show();
......
...@@ -31,9 +31,9 @@ public interface StatisticsDetailContract { ...@@ -31,9 +31,9 @@ public interface StatisticsDetailContract {
/** /**
* 退货 * 退货
* *
* @param orderId 订单id * @param saleorder 订单
*/ */
public abstract void returnOrder(String orderId); public abstract void returnOrder(Saleorder saleorder);
} }
} }
package com.xingdata.zzdpos.ui.statistics; package com.xingdata.zzdpos.ui.statistics;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.pay.neptune.NeptuneCenter;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.api.ApiFactory; import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Saleorder;
/** /**
* Created by Administrator on 2017/12/27. * Created by Administrator on 2017/12/27.
...@@ -28,12 +31,25 @@ public class StatisticsDetailPresenter extends StatisticsDetailContract.Presente ...@@ -28,12 +31,25 @@ public class StatisticsDetailPresenter extends StatisticsDetailContract.Presente
@Override @Override
public void returnOrder(String orderId) { public void returnOrder(Saleorder saleorder) {
ApiFactory.Test.returnOrder(orderId ).subscribe(s -> {
ToastUtils.showLong("成功"); NeptuneCenter.getInstance().init(App.instance).refund(saleorder.getOrderNo(), saleorder.getPayType(), saleorder
mView.returnOrderSuss(); .getOrderPayAmt()).subscribe(response -> {
}, throwable -> { switch (response.getCode()) {
ToastUtils.showLong(throwable.getMessage()); case com.xingdata.zxpay.C.PAY_STATE.SUCCESS:
ApiFactory.Test.returnOrder(saleorder.getOrderNo()).subscribe(s -> {
ToastUtils.showLong("退货成功");
mView.returnOrderSuss();
}, throwable -> {
ToastUtils.showLong(throwable.getMessage());
});
break;
default: {
}
break;
}
}); });
} }
} }
...@@ -34,7 +34,8 @@ public class C { ...@@ -34,7 +34,8 @@ public class C {
/** /**
* 银联支付 * 银联支付
*/ */
final static String UNIONPAY = "CHANPAY"; // final static String UNIONPAY = "CHANPAY";
final static String UNIONPAY = "BANKCARD";
/** /**
* 微信支付 * 微信支付
*/ */
......
...@@ -162,35 +162,35 @@ public class Factory { ...@@ -162,35 +162,35 @@ public class Factory {
} }
break; break;
} }
new Thread(new Runnable() { // new Thread(new Runnable() {
@Override // @Override
public void run() { // public void run() {
while (mPayService == null) { // while (mPayService == null) {
LogUtils.e("PayService获取失败," + C.RETRY_DELAY_TIME + "ms后尝试重连"); // LogUtils.e("PayService获取失败," + C.RETRY_DELAY_TIME + "ms后尝试重连");
if (mRetry < C.RETRY_COUNT) { // if (mRetry < C.RETRY_COUNT) {
try { // try {
Thread.sleep(C.RETRY_DELAY_TIME); // Thread.sleep(C.RETRY_DELAY_TIME);
} catch (InterruptedException e) { // } catch (InterruptedException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
} // }
IResponse iResponse; // IResponse iResponse;
String str = null; // String str = null;
try { // try {
str = mPayService.doTrans(JSON.toJSONString(iRequest)); // str = mPayService.doTrans(JSON.toJSONString(iRequest));
} catch (RemoteException e) { // } catch (RemoteException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
try { // try {
iResponse = JSON.parseObject(str, IResponse.class); // iResponse = JSON.parseObject(str, IResponse.class);
} catch (Exception e) { // } catch (Exception e) {
iResponse = new IResponse(); // iResponse = new IResponse();
} // }
//
//
} // }
}).start(); // }).start();
return run(Observable.just(iRequest).flatMap(iRequest1 -> { return run(Observable.just(iRequest).flatMap(iRequest1 -> {
while (mPayService == null) { while (mPayService == null) {
......
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