|
@@ -6,6 +6,7 @@ import android.content.ComponentName;
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
import android.content.DialogInterface;
|
|
import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
|
|
+import android.graphics.Color;
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.net.Uri;
|
|
import android.net.Uri;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
@@ -14,8 +15,11 @@ import android.os.Message;
|
|
|
import android.support.v4.app.Fragment;
|
|
import android.support.v4.app.Fragment;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
import android.support.v7.app.AlertDialog;
|
|
|
import android.text.Editable;
|
|
import android.text.Editable;
|
|
|
|
|
+import android.text.Spannable;
|
|
|
|
|
+import android.text.SpannableStringBuilder;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
import android.text.TextWatcher;
|
|
import android.text.TextWatcher;
|
|
|
|
|
+import android.text.style.ForegroundColorSpan;
|
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
import android.view.Gravity;
|
|
|
import android.view.KeyEvent;
|
|
import android.view.KeyEvent;
|
|
@@ -247,10 +251,12 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
mCollectResultTextView.setText(null);
|
|
mCollectResultTextView.setText(null);
|
|
|
JSONArray listArray = dataObject.optJSONArray("nolist");
|
|
JSONArray listArray = dataObject.optJSONArray("nolist");
|
|
|
if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
|
|
if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
|
|
|
- String barcodeResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String part1 = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
+ "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
|
|
+ "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
|
|
|
- + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
|
|
|
|
|
- + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
|
|
|
|
+ + ";数量:" ;
|
|
|
|
|
+ String part2 = CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"));
|
|
|
|
|
+ String part3 = ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
|
+ ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
+ ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
|
|
@@ -259,7 +265,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
if (listArray != null && listArray.length() > 0) {
|
|
if (listArray != null && listArray.length() > 0) {
|
|
|
for (int i = 0; i < listArray.length(); i++) {
|
|
for (int i = 0; i < listArray.length(); i++) {
|
|
|
JSONObject listObject = listArray.optJSONObject(i);
|
|
JSONObject listObject = listArray.optJSONObject(i);
|
|
|
- barcodeResult = barcodeResult
|
|
|
|
|
|
|
+ part3 = part3
|
|
|
+ "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
+ "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
|
+ ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
+ ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
|
+ ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
+ ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
@@ -269,8 +275,14 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
// initBreakPopupWindow(listArray);
|
|
// initBreakPopupWindow(listArray);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- mCollectResultTextView.setText(barcodeResult);
|
|
|
|
|
- mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
|
|
|
|
+ SpannableStringBuilder style1 = new SpannableStringBuilder(part1);
|
|
|
|
|
+ SpannableStringBuilder style2 = new SpannableStringBuilder(part2);
|
|
|
|
|
+ SpannableStringBuilder style3 = new SpannableStringBuilder(part3);
|
|
|
|
|
+ style1.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part1.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style2.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.red)),0,part2.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style3.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part3.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style1 = style1.append(style2).append(style3);
|
|
|
|
|
+ mCollectResultTextView.setText(style1);
|
|
|
|
|
|
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
@@ -292,27 +304,41 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
|
|
|
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
|
|
|
} else if (false) {
|
|
} else if (false) {
|
|
|
- String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
|
|
|
|
+ String part1 = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
+ "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
|
|
+ "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
|
|
|
- + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
|
|
|
|
|
- + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
|
|
|
|
+ + ";数量:" ;
|
|
|
|
|
+ String part2 = CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"));
|
|
|
|
|
+ String part3 = ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
|
- + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
|
|
|
|
|
|
|
+ + ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
|
|
|
|
|
|
|
|
|
|
+// String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
|
|
+// + "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
|
|
|
|
|
+// + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
|
|
|
|
|
+// + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
|
|
+// + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
|
|
|
+// + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
|
|
|
|
|
+// + " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
|
|
|
|
|
|
|
|
if (listArray != null && listArray.length() > 0) {
|
|
if (listArray != null && listArray.length() > 0) {
|
|
|
for (int i = 0; i < listArray.length(); i++) {
|
|
for (int i = 0; i < listArray.length(); i++) {
|
|
|
JSONObject listObject = listArray.optJSONObject(i);
|
|
JSONObject listObject = listArray.optJSONObject(i);
|
|
|
- boxResult = boxResult
|
|
|
|
|
|
|
+ part3 = part3
|
|
|
+ "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
+ "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
|
+ ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
+ ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
|
+ ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
+ ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- mCollectResultTextView.setText(boxResult);
|
|
|
|
|
- mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
|
|
|
|
+ SpannableStringBuilder style1 = new SpannableStringBuilder(part1);
|
|
|
|
|
+ SpannableStringBuilder style2 = new SpannableStringBuilder(part2);
|
|
|
|
|
+ SpannableStringBuilder style3 = new SpannableStringBuilder(part3);
|
|
|
|
|
+ style1.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part1.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style2.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.red)),0,part2.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style3.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part3.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style1 = style1.append(style2).append(style3);
|
|
|
|
|
+ mCollectResultTextView.setText(style1);
|
|
|
|
|
|
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
@@ -1113,31 +1139,37 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
mCollectResultTextView.setVisibility(View.VISIBLE);
|
|
mCollectResultTextView.setVisibility(View.VISIBLE);
|
|
|
- mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
|
|
|
|
+// mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
mCollectResultTextView.setText(null);
|
|
mCollectResultTextView.setText(null);
|
|
|
JSONArray listArray = dataObject.optJSONArray("nolist");
|
|
JSONArray listArray = dataObject.optJSONArray("nolist");
|
|
|
if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
|
|
if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
|
|
|
- String barcodeResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
|
|
|
|
+ String part1 = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
+ "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
|
|
+ "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
|
|
|
- + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
|
|
|
|
|
- + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
|
|
|
|
+ + ";数量:" ;
|
|
|
|
|
+ String part2 = CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"));
|
|
|
|
|
+ String part3 = ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
|
+ ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
+ ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
|
|
|
+ ";仓位:" + JsonUtils.optStringNotNull(messageObject, "BAR_LOCATION");
|
|
+ ";仓位:" + JsonUtils.optStringNotNull(messageObject, "BAR_LOCATION");
|
|
|
-
|
|
|
|
|
if (listArray != null && listArray.length() > 0) {
|
|
if (listArray != null && listArray.length() > 0) {
|
|
|
for (int i = 0; i < listArray.length(); i++) {
|
|
for (int i = 0; i < listArray.length(); i++) {
|
|
|
JSONObject listObject = listArray.optJSONObject(i);
|
|
JSONObject listObject = listArray.optJSONObject(i);
|
|
|
- barcodeResult = barcodeResult
|
|
|
|
|
- + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
|
|
|
- + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
|
|
|
- + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
|
|
|
|
|
+ part3 = part3 + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
|
|
|
+ + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
|
|
|
+ + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- mCollectResultTextView.setText(barcodeResult);
|
|
|
|
|
- mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
|
|
|
|
+ SpannableStringBuilder style1 = new SpannableStringBuilder(part1);
|
|
|
|
|
+ SpannableStringBuilder style2 = new SpannableStringBuilder(part2);
|
|
|
|
|
+ SpannableStringBuilder style3 = new SpannableStringBuilder(part3);
|
|
|
|
|
+ //style.setSpan(new BackgroundColorSpan(Color.RED),2,5, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置textview的背景颜色
|
|
|
|
|
+ style1.setSpan(new ForegroundColorSpan(Color.GREEN),0,part1.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style2.setSpan(new ForegroundColorSpan(Color.RED),0,part2.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style3.setSpan(new ForegroundColorSpan(Color.GREEN),0,part3.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style1 = style1.append(style2).append(style3);
|
|
|
|
|
+ mCollectResultTextView.setText(style1);
|
|
|
|
|
|
|
|
|
|
|
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
@@ -1160,28 +1192,32 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
|
|
|
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
|
|
|
} else if (false) {
|
|
} else if (false) {
|
|
|
- String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
|
|
|
|
+ String part1 = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
+ "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
|
|
+ "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
|
|
|
- + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
|
|
|
|
|
- + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
|
|
|
|
+ + ";数量:" ;
|
|
|
|
|
+ String part2 = CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"));
|
|
|
|
|
+ String part3 = ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
|
- + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
|
|
|
|
|
|
|
+ + ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
if (listArray != null && listArray.length() > 0) {
|
|
if (listArray != null && listArray.length() > 0) {
|
|
|
for (int i = 0; i < listArray.length(); i++) {
|
|
for (int i = 0; i < listArray.length(); i++) {
|
|
|
JSONObject listObject = listArray.optJSONObject(i);
|
|
JSONObject listObject = listArray.optJSONObject(i);
|
|
|
- boxResult = boxResult
|
|
|
|
|
|
|
+ part3 = part3
|
|
|
+ "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
+ "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
|
+ ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
+ ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
|
+ ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
+ ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- mCollectResultTextView.setText(boxResult);
|
|
|
|
|
- mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ SpannableStringBuilder style1 = new SpannableStringBuilder(part1);
|
|
|
|
|
+ SpannableStringBuilder style2 = new SpannableStringBuilder(part2);
|
|
|
|
|
+ SpannableStringBuilder style3 = new SpannableStringBuilder(part3);
|
|
|
|
|
+ style1.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part1.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style2.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.red)),0,part2.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style3.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part3.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style1 = style1.append(style2).append(style3);
|
|
|
|
|
+ mCollectResultTextView.setText(style1);
|
|
|
|
|
|
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
@@ -1231,7 +1267,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- } catch (JSONException e) {
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1247,7 +1283,6 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
mCollectResultTextView.setTextColor(getResources().getColor(R.color.red));
|
|
mCollectResultTextView.setTextColor(getResources().getColor(R.color.red));
|
|
|
mCollectResultTextView.setText(errorToast);
|
|
mCollectResultTextView.setText(errorToast);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}) {
|
|
}) {
|
|
|
@Override
|
|
@Override
|
|
@@ -1892,28 +1927,28 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
mCollectResultTextView.setVisibility(View.VISIBLE);
|
|
mCollectResultTextView.setVisibility(View.VISIBLE);
|
|
|
- mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
|
|
mCollectResultTextView.setText(null);
|
|
mCollectResultTextView.setText(null);
|
|
|
// listArray = dataObject.optJSONArray("nolist");
|
|
// listArray = dataObject.optJSONArray("nolist");
|
|
|
listArray = FastjsonUtil.getJSONArray(dataObject.toString(), "nolist");
|
|
listArray = FastjsonUtil.getJSONArray(dataObject.toString(), "nolist");
|
|
|
Log.e("listArraydata", listArray.toString());
|
|
Log.e("listArraydata", listArray.toString());
|
|
|
if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
|
|
if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
|
|
|
- String barcodeResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String part1 = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
+ "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
|
|
+ "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
|
|
|
- + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
|
|
|
|
|
- + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
|
|
|
|
+ + ";数量:" ;
|
|
|
|
|
+ String part2 = CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"));
|
|
|
|
|
+ String part3 = ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
|
+ ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
+ ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
|
|
|
+ ";仓位:" + JsonUtils.optStringNotNull(messageObject, "BAR_LOCATION");
|
|
+ ";仓位:" + JsonUtils.optStringNotNull(messageObject, "BAR_LOCATION");
|
|
|
-
|
|
|
|
|
if (listArray != null && listArray.size() > 0) {
|
|
if (listArray != null && listArray.size() > 0) {
|
|
|
for (int i = 0; i < listArray.size(); i++) {
|
|
for (int i = 0; i < listArray.size(); i++) {
|
|
|
com.alibaba.fastjson.JSONObject listObject = listArray.getJSONObject(i);
|
|
com.alibaba.fastjson.JSONObject listObject = listArray.getJSONObject(i);
|
|
|
//JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
//JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
|
//JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
//JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
|
//CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "RESTQTY"));
|
|
//CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "RESTQTY"));
|
|
|
- barcodeResult = barcodeResult
|
|
|
|
|
|
|
+ part3 = part3
|
|
|
+ "\n单号:" + listObject.getString("PI_INOUTNO")
|
|
+ "\n单号:" + listObject.getString("PI_INOUTNO")
|
|
|
+ ";条码号:" + listObject.getString("BAR_CODE")
|
|
+ ";条码号:" + listObject.getString("BAR_CODE")
|
|
|
+ ";数量:" + listObject.getString("RESTQTY");
|
|
+ ";数量:" + listObject.getString("RESTQTY");
|
|
@@ -1923,9 +1958,15 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
initBreakPopupWindow(listArray);
|
|
initBreakPopupWindow(listArray);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- mCollectResultTextView.setText(barcodeResult);
|
|
|
|
|
- mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ SpannableStringBuilder style1 = new SpannableStringBuilder(part1);
|
|
|
|
|
+ SpannableStringBuilder style2 = new SpannableStringBuilder(part2);
|
|
|
|
|
+ SpannableStringBuilder style3 = new SpannableStringBuilder(part3);
|
|
|
|
|
+ //style.setSpan(new BackgroundColorSpan(Color.RED),2,5, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置textview的背景颜色
|
|
|
|
|
+ style1.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part1.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style2.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.red)),0,part2.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style3.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part3.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style1 = style1.append(style2).append(style3);
|
|
|
|
|
+ mCollectResultTextView.setText(style1);
|
|
|
|
|
|
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
@@ -1947,14 +1988,22 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
|
|
|
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
|
|
PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
|
|
|
} else if (false) {
|
|
} else if (false) {
|
|
|
- String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
|
|
|
|
+ String part1 = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
+ "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
|
|
+ "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
|
|
|
- + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
|
|
|
|
|
- + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
|
|
|
|
+ + ";数量:" ;
|
|
|
|
|
+ String part2 = CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"));
|
|
|
|
|
+ String part3 = ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
+ ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
|
- + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
|
|
|
|
|
|
|
+ + ";名称规格:" + messageObject.optString("PR_DETAIL")
|
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
|
|
+ " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
|
|
|
|
|
|
|
|
|
|
+// String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
|
|
|
|
|
+// + "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
|
|
|
|
|
+// + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
|
|
|
|
|
+// + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
|
|
|
|
|
+// + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
|
|
|
|
|
+// + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
|
|
|
|
|
+// + " " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
|
|
|
|
|
|
|
|
if (listArray != null && listArray.size() > 0) {
|
|
if (listArray != null && listArray.size() > 0) {
|
|
|
for (int i = 0; i < listArray.size(); i++) {
|
|
for (int i = 0; i < listArray.size(); i++) {
|
|
@@ -1962,16 +2011,21 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
// + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
// + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
|
|
|
// + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
// + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
|
|
|
// + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
// + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
|
|
|
- boxResult = boxResult
|
|
|
|
|
|
|
+ part3 = part3
|
|
|
+ "\n单号:" + listObject.getString("PI_INOUTNO")
|
|
+ "\n单号:" + listObject.getString("PI_INOUTNO")
|
|
|
+ ";条码号:" + listObject.getString("BAR_CODE")
|
|
+ ";条码号:" + listObject.getString("BAR_CODE")
|
|
|
+ ";数量:" + listObject.getDouble("BAR_REMAIN");
|
|
+ ";数量:" + listObject.getDouble("BAR_REMAIN");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- mCollectResultTextView.setText(boxResult);
|
|
|
|
|
- mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ SpannableStringBuilder style1 = new SpannableStringBuilder(part1);
|
|
|
|
|
+ SpannableStringBuilder style2 = new SpannableStringBuilder(part2);
|
|
|
|
|
+ SpannableStringBuilder style3 = new SpannableStringBuilder(part3);
|
|
|
|
|
+ style1.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part1.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style2.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.red)),0,part2.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style3.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.green)),0,part3.length(),Spannable.SPAN_EXCLUSIVE_INCLUSIVE); //设置指定位置文字的颜色
|
|
|
|
|
+ style1 = style1.append(style2).append(style3);
|
|
|
|
|
+ mCollectResultTextView.setText(style1);
|
|
|
|
|
|
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
mBarcodeTableLayout.setVisibility(View.GONE);
|
|
|
mBoxTableLayout.setVisibility(View.GONE);
|
|
mBoxTableLayout.setVisibility(View.GONE);
|