Browse Source

产线条码生成增加领料数量显示,出库界面修改

ChengJH 1 year ago
parent
commit
3b36d06728

+ 7 - 3
app/src/main/java/com/uas/uas_mes_stw/fragment/IOCOutMakeMaterialOper.java

@@ -69,6 +69,7 @@ import com.uas.uas_mes_stw.tools.VolleyUtil;
 import com.uas.uas_mes_stw.util.CameraUtil;
 import com.uas.uas_mes_stw.util.CommonUtil;
 import com.uas.uas_mes_stw.util.Constants;
+import com.uas.uas_mes_stw.util.FastjsonUtil;
 import com.uas.uas_mes_stw.util.FileUtils;
 import com.uas.uas_mes_stw.util.FragmentUtils;
 import com.uas.uas_mes_stw.util.HttpCallback;
@@ -847,12 +848,15 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
             public void onResponse(JSONObject jsonObject) {
                 progressDialog.dismiss();
                 try {
-                    JSONObject dataObject = jsonObject.optJSONObject("data");
+                    Log.e("jsonObject",jsonObject.toString());
+//                    JSONObject dataObject = jsonObject.optJSONObject("data");
+                    String data = FastjsonUtil.getText(jsonObject.toString(), "data");
+
                     mCollectResultTextView.setVisibility(View.VISIBLE);
                     mCollectResultTextView.setTextColor(getResources().getColor(R.color.blue));
-                    mCollectResultTextView.setText(dataObject.toString());
+                    mCollectResultTextView.setText(data.toString());
 //                    JSONObject messageObject = dataObject.getJSONObject("barcode");
-                    CommonUtil.toastNoRepeat(mActivity, dataObject.toString());
+                    CommonUtil.toastNoRepeat(mActivity, data.toString());
                 } catch (Exception e) {
                     e.printStackTrace();
                 }

+ 36 - 13
app/src/main/java/com/uas/uas_mes_stw/fragment/ProductionLineBarcodeGenerationFragment.java

@@ -83,6 +83,8 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
     private String pi_xb_user;
     private TextView tv_xbcode;
     private TextView tv_gdhcode;
+    private TextView tv_lingqty;
+    private String lingqty;
 
     @Override
     protected int getLayout() {
@@ -101,6 +103,7 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
         bom_check_tiaomashulaing_cet = root.findViewById(R.id.bom_check_tiaomashulaing_cet);
         tv_xbcode = root.findViewById(R.id.tv_xbcode);
         tv_gdhcode = root.findViewById(R.id.tv_gdhcode);
+        tv_lingqty = root.findViewById(R.id.tv_lingqty);
         bom_check_tiaomashulaing_cet.setText("1");
         mBomIdEditText.requestFocus();
     }
@@ -385,6 +388,7 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
             bean.setPR_SPEC(data.getString("PR_SPEC") == null ? "-" : data.getString("PR_SPEC"));
             bean.setPI_INOUTNO(data.getString("PI_INOUTNO"));
             bean.setPI_XB_USER(data.getString("PI_XB_USER"));
+            bean.setV_SETQTY(data.getString("V_SETQTY"));
             ComDataBeanList.add(bean);
         }
         initresourcesPopupWindow();
@@ -468,6 +472,7 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
                             macode = ipAndPortBeans.get(position).getMA_CODE();
                             prcode = ipAndPortBeans.get(position).getPR_CODE();
                             prspec = ipAndPortBeans.get(position).getPR_SPEC();
+                            lingqty = ipAndPortBeans.get(position).getV_SETQTY();
                             for (int i = 0; i < ipAndPortBeans.size(); i++) {
                                 ipAndPortBeans.get(i).setChecked(false);
                             }
@@ -490,21 +495,27 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
                 if (!mSearchStr.isEmpty()) {
                     List<ComDataBean> thisList = new ArrayList<>();
                     for(int i=0;i<ComDataBeanList.size();i++){
-                        if(ComDataBeanList.get(i).getMA_CODE().contains(mSearchStr)||ComDataBeanList.get(i).getPR_CODE().contains(mSearchStr)
-                                ||ComDataBeanList.get(i).getPR_SPEC().contains(mSearchStr)||ComDataBeanList.get(i).getPI_INOUTNO().contains(mSearchStr)){
-                            thisList.add(ComDataBeanList.get(i));
-                        }
-                        if(i == ComDataBeanList.size() -1){
-                            ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
-                            rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
-                            LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
+                        if (StringUtil.isEmpty(ComDataBeanList.get(i).getMA_CODE())||StringUtil.isEmpty(ComDataBeanList.get(i).getPR_CODE())
+                        ||StringUtil.isEmpty(ComDataBeanList.get(i).getPR_SPEC())||StringUtil.isEmpty(ComDataBeanList.get(i).getPI_INOUTNO())){
 
+                        }else {
+                            if(ComDataBeanList.get(i).getMA_CODE().contains(mSearchStr)||ComDataBeanList.get(i).getPR_CODE().contains(mSearchStr)
+                                    ||ComDataBeanList.get(i).getPR_SPEC().contains(mSearchStr)||ComDataBeanList.get(i).getPI_INOUTNO().contains(mSearchStr)){
+                                thisList.add(ComDataBeanList.get(i));
+                            }
+                            if(i == ComDataBeanList.size() -1){
+                                ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
+                                rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                                LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
+
+                            }
+                            List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                            for (int j = 0; j < lineCodeEntities.size(); j++) {
+                                lineCodeEntities.get(j).setChecked(false);
+                            }
+                            ipAndResourcesPortAdapter.notifyDataSetChanged();
                         }
-                        List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
-                        for (int j = 0; j < lineCodeEntities.size(); j++) {
-                            lineCodeEntities.get(j).setChecked(false);
-                        }
-                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+
                     }
 
 
@@ -528,6 +539,7 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
                         macode = ipAndPortBeans.get(position).getMA_CODE();
                         prcode = ipAndPortBeans.get(position).getPR_CODE();
                         prspec = ipAndPortBeans.get(position).getPR_SPEC();
+                        lingqty = ipAndPortBeans.get(position).getV_SETQTY();
                         for (int i = 0; i < ipAndPortBeans.size(); i++) {
                             ipAndPortBeans.get(i).setChecked(false);
                         }
@@ -553,6 +565,7 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
                 tv_gdhcode.setText(macode);
                 tv_prcode.setText(prcode);
                 tv_space.setText(prspec);
+                tv_lingqty.setText(lingqty);
                 bom_check_qty_cet.requestFocus();
                 closeListPopupWindow();
             }
@@ -587,6 +600,7 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
                     macode = ipAndPortBeans.get(position).getMA_CODE();
                     prcode = ipAndPortBeans.get(position).getPR_CODE();
                     prspec = ipAndPortBeans.get(position).getPR_SPEC();
+                    lingqty = ipAndPortBeans.get(position).getV_SETQTY();
                     for (int i = 0; i < ipAndPortBeans.size(); i++) {
                         ipAndPortBeans.get(i).setChecked(false);
                     }
@@ -660,6 +674,7 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
         String BAR_REMAIN = null;
         String PI_INOUTNO = null;
         String PI_XB_USER = null;
+        String V_SETQTY = null;
         boolean Checked;
 
         public ComDataBean(String MA_CODE, String PR_CODE, String PR_SPEC, String BAR_CODE, String BAR_REMAIN) {
@@ -672,6 +687,14 @@ public class ProductionLineBarcodeGenerationFragment extends BaseFragment {
 
         public ComDataBean(){}
 
+        public String getV_SETQTY() {
+            return V_SETQTY;
+        }
+
+        public void setV_SETQTY(String v_SETQTY) {
+            V_SETQTY = v_SETQTY;
+        }
+
         public String getPI_INOUTNO() {
             return PI_INOUTNO;
         }

+ 2 - 2
build.gradle

@@ -50,8 +50,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 16,
-            versionName      : "v1.0.6"
+            versionCode      : 17,
+            versionName      : "v1.0.7"
     ]
 
     depsVersion = [