Selaa lähdekoodia

Merge branch 'master' of http://repos.ubtob.net/usoft-andriod/pdasmart

ChengJH 3 vuotta sitten
vanhempi
commit
a4613fb8e6

+ 1 - 1
app/src/main/java/com/uas/uaspda/fragment/SCSMTInFragment.java

@@ -190,7 +190,7 @@ public class SCSMTInFragment extends BaseFragment implements View.OnClickListene
                     feedLoading();
                 }
             } else {*/
-            mSmtDslBean.setDsl_fecode(collect);
+            mSmtDslBean.setDsl_barcode(collect);
             feedLoading();
 //            }
         }

+ 1 - 6
app/src/main/java/com/uas/uaspda/fragment/SCSMTIndexFragment.java

@@ -505,12 +505,7 @@ public class SCSMTIndexFragment extends BaseFragment implements AdapterView.OnIt
                     if (exceptionCode == 3001) {
                         new AlertDialog.Builder(mActivity).setTitle("提示")
                                 .setMessage(errorMsg.exceptionInfo + ",是否强制启动?")
-                                .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
-                                    @Override
-                                    public void onClick(DialogInterface dialog, int which) {
-                                        startMachine(true);
-                                    }
-                                }).setNegativeButton(R.string.cancel, null).create().show();
+                                .setPositiveButton(R.string.confirm, null).setNegativeButton(R.string.cancel, null).create().show();
                     } else {
                         CommonUtil.showErrorToast(volleyError, true);
                     }

+ 15 - 83
app/src/main/java/com/uas/uaspda/fragment/SCSMTJointFragment.java

@@ -31,11 +31,7 @@ import com.uas.uaspda.tools.SharedPreUtil;
 import com.uas.uaspda.tools.VolleyUtil;
 import com.uas.uaspda.util.CommonUtil;
 import com.uas.uaspda.util.Constants;
-import com.uas.uaspda.util.FastjsonUtil;
-import com.uas.uaspda.util.HttpCallback;
-import com.uas.uaspda.util.HttpParams;
 import com.uas.uaspda.util.JsonUtils;
-import com.uas.uaspda.util.VolleyRequest;
 import com.uas.uaspda.view.ClearableEditText;
 import com.uas.uaspda.view.TextViewWithButton;
 
@@ -51,12 +47,12 @@ import java.util.Map;
  * @note:SMTChild接料操作
  */
 public class SCSMTJointFragment extends BaseFragment implements View.OnClickListener, TextViewWithButton.TvHintHelper {
-    private static final String COLLECT_FEEDER = "请采集飞达编号";
-    private static final String COLLECT_PRODCODE = "请采集料卷编号/物料编号";
-    private static final String COLLECT_OLD_PRODCODE = "飞达采集成功,请采集原物料号";
+    private static final String COLLECT_LOCATION = "请录入站位编号";
+    private static final String COLLECT_PRODCODE = "请录入料卷编号/物料编号";
+    private static final String COLLECT_OLD_PRODCODE = "站位采集成功,请采集原物料号";
 
     JSONObject makeCraft;
-    TextViewWithButton tvLocation, tvBarcode, tvRemainqty, mLocationTextView, mFeederTextView;
+    TextViewWithButton tvLocation, tvBarcode, tvRemainqty, mLocationTextView;
     TextView tvMsgNotice, tvMsgLocation, tvMsgProdcode, tvMsgQuantity, tvMsgBarcode, tvMsgSpec;
     RelativeLayout rlCollect;
     int wrongColor, rightColor;
@@ -71,8 +67,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
     private String mSmtLocationCache;
     private SmtDslBean mSmtDslBean = new SmtDslBean();
     private StringRequest mStringRequest;
-    private TextViewWithButton.OnTextClearListener mLocationClearListener;
-    private TextViewWithButton.OnTextClearListener mFeederClearListener;
 
     @Override
     protected int getLayout() {
@@ -100,7 +94,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
         mTableTextView = (TextView) root.findViewById(R.id.smt_change_table_tv);
         mMacodeTextView = (TextView) root.findViewById(R.id.smt_change_macode_tv);
         mLocationTextView = (TextViewWithButton) root.findViewById(R.id.smt_change_location_tv);
-        mFeederTextView = root.findViewById(R.id.smt_change_feeder_tv);
         mCollectEditText = (ClearableEditText) root.findViewById(R.id.smt_change_collect_et);
 
         mCollectEditText.requestFocus();
@@ -155,38 +148,26 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
             }
         });
 
-
-        mFeederClearListener = new TextViewWithButton.OnTextClearListener() {
+        mLocationTextView.setOnTextClearListener(new TextViewWithButton.OnTextClearListener() {
             @Override
             public void onTextClear() {
-                mLocationTextView.setOnTextClearListener(null);
-                mLocationTextView.setText("");
-                mLocationTextView.setOnTextClearListener(mLocationClearListener);
-                mCollectEditText.setHint(COLLECT_FEEDER);
+                mCollectEditText.setHint(COLLECT_LOCATION);
                 mCollectEditText.setText("");
-            }
-        };
 
-        mLocationClearListener = new TextViewWithButton.OnTextClearListener() {
-            @Override
-            public void onTextClear() {
-                mFeederTextView.setOnTextClearListener(null);
-                mFeederTextView.setText("");
-                mFeederTextView.setOnTextClearListener(mFeederClearListener);
-                mCollectEditText.setHint(COLLECT_FEEDER);
-                mCollectEditText.setText("");
+//                tvMsgNotice.setText("");
+//                tvMsgProdcode.setText("");
+//                tvMsgLocation.setText("");
+//                tvMsgBarcode.setText("");
+//                tvMsgQuantity.setText("");
+//                tvMsgSpec.setText("");
             }
-        };
-
-        mLocationTextView.setOnTextClearListener(mLocationClearListener);
-
-        mFeederTextView.setOnTextClearListener(mFeederClearListener);
+        });
     }
 
     private void confirmEvent(String collect) {
         String location = mLocationTextView.getText().toString().trim();
         if (TextUtils.isEmpty(location)) {
-            feederGetLocation(collect);
+            locationCheck(collect);
         } else {
             mSmtDslBean.setDsl_barcode(collect);
 
@@ -199,50 +180,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
         }
     }
 
-
-    private void feederGetLocation(String collect) {
-        progressDialog.show();
-        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
-                .url(GloableParams.ADDRESS_SMT_GETFEEDERBARCODE)
-                .method(Request.Method.POST)
-                .addParam("fe_code", collect)
-                .build(), new HttpCallback() {
-            @Override
-            public void onSuccess(int flag, Object o) throws Exception {
-                try {
-                    progressDialog.dismiss();
-                    String result = o.toString();
-                    com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
-                    com.alibaba.fastjson.JSONObject dataObject = resultObject.getJSONObject("data");
-                    if (dataObject != null) {
-                        String fe_code = FastjsonUtil.getText(dataObject, "fe_code");
-                        String fe_location = FastjsonUtil.getText(dataObject, "fe_location");
-
-                        locationCheck(fe_location, fe_code);
-                    } else {
-                        tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
-                        tvMsgNotice.setText("数据为空");
-                        CommonUtil.makeNotice();
-                        mCollectEditText.setText("");
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-
-            @Override
-            public void onFail(int flag, String failStr) throws Exception {
-                progressDialog.dismiss();
-                tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
-                tvMsgNotice.setText(failStr);
-                CommonUtil.makeNotice();
-                mCollectEditText.setText("");
-            }
-        });
-    }
-
-
-    private void locationCheck(String collect, String feeder) {
+    private void locationCheck(String collect) {
         tvMsgProdcode.setText("");
         tvMsgLocation.setText("");
         tvMsgBarcode.setText("");
@@ -258,7 +196,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                     if (collect.equals(JsonUtils.optStringNotNull(locationObject, "PSL_LOCATION"))) {
                         isExist = true;
                         mLocationTextView.setText(collect);
-                        mFeederTextView.setText(feeder);
                         mCollectEditText.setText("");
 
                         String psl_prodcode = JsonUtils.optStringNotNull(locationObject, "PSL_PRODCODE");
@@ -347,9 +284,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                                 } else if ("barcode".equals(type)) {
                                     tvMsgNotice.setText("请采集原料卷号:" + code);
                                 }
-                                mCollectEditText.setText(code);
-                                String location = mLocationTextView.getText().toString().trim();
-                                joinDataCheck(code, location);
                             }
                         } catch (JSONException e) {
                             e.printStackTrace();
@@ -548,7 +482,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                                 tvMsgSpec.setText("飞达规格:" + JsonUtils.optStringNotNull(dataObject, "DSL_FESPEC"));
 
                                 mLocationTextView.setText("");
-                                mFeederTextView.setText("");
                                 mCollectEditText.setText("");
 
                                 mSmtDslBean = new SmtDslBean();
@@ -570,7 +503,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                             tvMsgNotice.setText(errorToast);
                             if (errorToast.contains("站位已经有在线料卷号")) {
                                 mLocationTextView.setText("");
-                                mFeederTextView.setText("");
                                 mCollectEditText.setText("");
                             } else {
                                 mCollectEditText.setText("");

+ 2 - 2
app/src/main/java/com/uas/uaspda/fragment/WHBreakingBatchFragment.java

@@ -514,7 +514,7 @@ public class WHBreakingBatchFragment extends BaseFragment implements View.OnClic
                 }
                 break;
             case R.id.btn_print:
-                /*if (!CommonUtil.appIsInstalled(getActivity(), Constants.CONSTANT.PRINT_SHARE_PACKAGE)) {
+                if (!CommonUtil.appIsInstalled(getActivity(), Constants.CONSTANT.PRINT_SHARE_PACKAGE)) {
                     new android.app.AlertDialog.Builder(getActivity()).setTitle("提示")
                             .setMessage("您还未安装打印程序,点击确认开始安装")
                             .setPositiveButton("确认", new DialogInterface.OnClickListener() {
@@ -537,7 +537,7 @@ public class WHBreakingBatchFragment extends BaseFragment implements View.OnClic
                             .setNegativeButton("取消", null).create().show();
                 } else {
                     getPrintData();
-                }*/
+                }
 
                 break;
             case R.id.btn_close:

+ 2 - 2
app/src/main/java/com/uas/uaspda/global/GloableParams.java

@@ -700,13 +700,13 @@ public class GloableParams {
     public static final String LISTNAME_FEEDER_UNBIND = "飞达料盘解绑";
     public static final String LISTNAME_FEEDER_CHECKINSPECTION = "复检校验";
 
-    public static final String[] feederListNames = {LISTNAME_FEEDER_IN, LISTNAME_FEEDER_JOIN, LISTNAME_FEEDER_CHANGE, LISTNAME_FEEDER_DOWN,
+    public static final String[] feederListNames = {LISTNAME_FEEDER_IN, LISTNAME_FEEDER_JOIN,  LISTNAME_FEEDER_DOWN,
             LISTNAME_FEEDER_DOWNALL, LISTNAME_FEEDER_QUERY, LISTNAME_FEEDER_SWITCH,
             LISTNAME_FEEDER_CHECK, LISTNAME_FEEDER_MACHINE, LISTNAME_REQUEST_MACHINE,
             LISTNAME_LOCATION_QUERY, LISTNAME_PREMATERIAL_QUERY, LISTNAME_FEEDER_BIND,
             LISTNAME_FEEDER_UNBIND,LISTNAME_FEEDER_CHECKINSPECTION};
     public static final int[] feederListImgs = {R.drawable.index_smt_up, R.drawable.index_smt_joint,
-            R.drawable.index_smt_change, R.drawable.index_smt_down,
+            R.drawable.index_smt_down,
             R.drawable.index_smt_downall, R.drawable.index_smt_query,
             R.drawable.index_smt_switch, R.drawable.index_smt_check,
             R.drawable.index_smt_machine, R.drawable.index_smt_request,

+ 2 - 1
app/src/main/res/layout/fragment_scmake_smtfeeder.xml

@@ -83,7 +83,8 @@
                         android:id="@+id/smt_feeder_order_cb"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="无工单" />
+                        android:text="无工单"
+                        android:visibility="gone" />
                 </LinearLayout>
 
 

+ 1 - 0
app/src/main/res/layout/popupwindow_whbreaking_batch.xml

@@ -38,6 +38,7 @@
             android:layout_width="wrap_content"
             android:layout_height="48dp"
             android:layout_alignParentLeft="true"
+            android:layout_marginLeft="6dp"
             android:text="打印"
             android:visibility="visible" />