|
@@ -3,6 +3,7 @@ package com.uas.ruiziuasmes.fragment;
|
|
|
import android.annotation.SuppressLint;
|
|
|
import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
+import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
@@ -10,7 +11,9 @@ import android.widget.Button;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.android.volley.Request;
|
|
|
import com.android.volley.toolbox.StringRequest;
|
|
|
import com.uas.ruiziuasmes.R;
|
|
@@ -24,6 +27,7 @@ import com.uas.ruiziuasmes.util.FragmentUtils;
|
|
|
import com.uas.ruiziuasmes.util.HttpCallback;
|
|
|
import com.uas.ruiziuasmes.util.HttpParams;
|
|
|
import com.uas.ruiziuasmes.util.PrintUtils;
|
|
|
+import com.uas.ruiziuasmes.util.VolleyRequest;
|
|
|
import com.uas.ruiziuasmes.util.VollyRequest;
|
|
|
import com.uas.ruiziuasmes.view.ClearableEditText;
|
|
|
|
|
@@ -65,7 +69,7 @@ public class LabeLreprintingFragment extends BaseFragment implements View.OnClic
|
|
|
|
|
|
@Override
|
|
|
protected void initEvents() {
|
|
|
-
|
|
|
+ getPrintTemplate();
|
|
|
storage_recharge_collect_ets.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
@Override
|
|
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
@@ -88,7 +92,39 @@ public class LabeLreprintingFragment extends BaseFragment implements View.OnClic
|
|
|
|
|
|
|
|
|
}
|
|
|
+ private void getPrintTemplate() {
|
|
|
+ VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
+ new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_BARINFO_PRINTMODEL)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .flag(0)
|
|
|
+ .tag("barinfoPrint")
|
|
|
+ .addParam("caller", "Lotno!PDAPrint")//Barcode!PDAPrint仓库
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ try {
|
|
|
+ String result = o.toString();
|
|
|
+ Log.e("prints", result);
|
|
|
+ if (FastjsonUtil.validate(result)) {
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONArray dataArray = resultObject.getJSONArray("data");
|
|
|
+ if (dataArray != null && dataArray.size() > 0) {
|
|
|
+ SharedPreUtil.saveString(mActivity, Constants.FLAG.PRINT_TEMPLATE_CACHE, dataArray.toJSONString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ Log.e("printf", failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
@Override
|
|
|
protected void initDatas() {
|
|
|
|