|
|
@@ -72,6 +72,7 @@ import com.uas.hy_electronic.tools.VolleyUtil;
|
|
|
import com.uas.hy_electronic.util.CameraUtil;
|
|
|
import com.uas.hy_electronic.util.CommonUtil;
|
|
|
import com.uas.hy_electronic.util.Constants;
|
|
|
+import com.uas.hy_electronic.util.FastjsonUtil;
|
|
|
import com.uas.hy_electronic.util.FileUtils;
|
|
|
import com.uas.hy_electronic.util.FragmentUtils;
|
|
|
import com.uas.hy_electronic.util.HttpCallback;
|
|
|
@@ -1394,24 +1395,75 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
closeListPopupWindow();
|
|
|
- new AlertDialog.Builder(mActivity)
|
|
|
- .setMessage("确认将单据过账?")
|
|
|
- .setNegativeButton(R.string.cancel, null)
|
|
|
- .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
- dialogInterface.dismiss();
|
|
|
- progressDialog.show();
|
|
|
- VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
- new HttpParams.Builder()
|
|
|
- .url(GloableParams.ADDRESS_INMATERIAL_CONFIRMPOST)
|
|
|
- .method(Request.Method.POST)
|
|
|
- .addParam("piid", pi_id)
|
|
|
- .tag(TAG + "confirmpost")
|
|
|
- .flag(FLAG_CONFIRM_POST).build(),
|
|
|
- 30 * 1000, IOCOutMakeMaterialOper.this);
|
|
|
+ //调用先进先出接口
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_BARCODE_FIRST_IN_FIRST_OUT_VERIFICATION)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("piid", pi_id)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ try {
|
|
|
+ String result = o.toString();
|
|
|
+ if (FastjsonUtil.validate(result)) {
|
|
|
+ com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ if (special_check.isChecked()) {
|
|
|
+ new AlertDialog.Builder(mActivity)
|
|
|
+ .setMessage("是否确认过账?" + FastjsonUtil.getText(resultObject, "data"))
|
|
|
+ .setNegativeButton(R.string.no, null)
|
|
|
+ .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ dialogInterface.dismiss();
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
+ new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_INMATERIAL_CONFIRMPOST)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .addParam("piid", pi_id)
|
|
|
+ .tag(TAG + "confirmpost")
|
|
|
+ .flag(FLAG_CONFIRM_POST).build(),
|
|
|
+ 30 * 1000, IOCOutMakeMaterialOper.this);
|
|
|
+ }
|
|
|
+ }).create().show();
|
|
|
+ }else {
|
|
|
+ new AlertDialog.Builder(mActivity)
|
|
|
+ .setMessage("不允许过账!" + FastjsonUtil.getText(resultObject, "data"))
|
|
|
+ .setNegativeButton(R.string.text_btn_close, null)
|
|
|
+ .create().show();
|
|
|
+ }
|
|
|
+
|
|
|
+ }else {
|
|
|
+ new AlertDialog.Builder(mActivity)
|
|
|
+ .setMessage("确认将单据过账?")
|
|
|
+ .setNegativeButton(R.string.cancel, null)
|
|
|
+ .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ dialogInterface.dismiss();
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
+ new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_INMATERIAL_CONFIRMPOST)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .addParam("piid", pi_id)
|
|
|
+ .tag(TAG + "confirmpost")
|
|
|
+ .flag(FLAG_CONFIRM_POST).build(),
|
|
|
+ 30 * 1000, IOCOutMakeMaterialOper.this);
|
|
|
+ }
|
|
|
+ }).create().show();
|
|
|
}
|
|
|
- }).create().show();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
|