|
@@ -39,6 +39,7 @@ import com.uas.yuejiahong.activity.FunctionActivity;
|
|
|
import com.uas.yuejiahong.adapter.FormAdapter;
|
|
|
import com.uas.yuejiahong.bean.FormBean;
|
|
|
import com.uas.yuejiahong.bean.JLTMaterialBean;
|
|
|
+import com.uas.yuejiahong.bean.OutboundScanningBean;
|
|
|
import com.uas.yuejiahong.global.GloableParams;
|
|
|
import com.uas.yuejiahong.listener.MyEditorActionListener;
|
|
|
import com.uas.yuejiahong.util.CameraUtil;
|
|
@@ -53,6 +54,9 @@ import com.uas.yuejiahong.view.ClearableEditText;
|
|
|
import com.uas.yuejiahong.view.RecyclerItemDecoration;
|
|
|
import com.uuzuche.lib_zxing.activity.CaptureActivity;
|
|
|
|
|
|
+import org.greenrobot.eventbus.EventBus;
|
|
|
+import org.greenrobot.eventbus.Subscribe;
|
|
|
+
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -85,7 +89,7 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
private RecyclerView mFormRecyclerView;
|
|
|
|
|
|
private List<JLTMaterialBean> mTableStorageInBeans;
|
|
|
- private Column<String> mLocationColumn, mBarcodeColumn, mDcColumn;
|
|
|
+ private Column<String> mLocationColumn, mperiodColumn, mlotnoColumn, mDcColumn;
|
|
|
private Column<Double> mQuantityColumn;
|
|
|
private TableData<JLTMaterialBean> mTableData;
|
|
|
|
|
@@ -98,6 +102,8 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
private RecyclerView mMenuRecyclerView;
|
|
|
private BaseQuickAdapter<String, BaseViewHolder> mMenuAdapter;
|
|
|
private List<String> mMenuList;
|
|
|
+ private ClearableEditText jlt_pick_material_out_scan_barcode_space;
|
|
|
+ private ImageView image_pick_material_out_scan_barcode_space;
|
|
|
|
|
|
@Override
|
|
|
public void onDestroyView() {
|
|
@@ -150,6 +156,8 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
mSpecTextView = root.findViewById(R.id.jlt_pick_material_out_scan_spec_tv);
|
|
|
mCustomerTextView = root.findViewById(R.id.jlt_pick_material_out_scan_customer_tv);
|
|
|
mSupplierEditText = root.findViewById(R.id.jlt_pick_material_out_scan_supplier_et);
|
|
|
+ jlt_pick_material_out_scan_barcode_space = root.findViewById(R.id.jlt_pick_material_out_scan_barcode_space);
|
|
|
+ image_pick_material_out_scan_barcode_space = root.findViewById(R.id.image_pick_material_out_scan_barcode_space);
|
|
|
|
|
|
mOperateLinearLayout = root.findViewById(R.id.pick_material_out_scan_operate_ll);
|
|
|
mPkgLinearLayout = root.findViewById(R.id.pick_material_out_scan_pkg_ll);
|
|
@@ -180,8 +188,9 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
// mMenuList.add("特殊出库");
|
|
|
|
|
|
mLocationColumn = new Column<String>("库位", "BAR_LOCATION");
|
|
|
- mBarcodeColumn = new Column<String>("条码号", "BARCODE");
|
|
|
- mDcColumn = new Column<String>("入库日期", "DC");
|
|
|
+ mperiodColumn = new Column<String>("周期", "MADE");
|
|
|
+ mlotnoColumn = new Column<String>("LOTNO", "LOTNO");
|
|
|
+ mDcColumn = new Column<String>("DC", "DC");
|
|
|
mQuantityColumn = new ArrayColumn<Double>("数量", "quantity", false,
|
|
|
new IFormat<Double>() {
|
|
|
@Override
|
|
@@ -306,6 +315,8 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
|
|
|
@Override
|
|
|
protected void initDatas() {
|
|
|
+ //注册
|
|
|
+ EventBus.getDefault().register(this);
|
|
|
getPickModel();
|
|
|
}
|
|
|
|
|
@@ -340,6 +351,8 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
materialBean.setBAR_TRAYNO(FastjsonUtil.getDouble(dataObject, "TRAYNO"));
|
|
|
materialBean.setBARCODE(FastjsonUtil.getText(dataObject, "BARCODE"));
|
|
|
materialBean.setDC(FastjsonUtil.getText(dataObject, "DC"));
|
|
|
+ materialBean.setMADE(FastjsonUtil.getText(dataObject, "MADE"));
|
|
|
+ materialBean.setLOTNO(FastjsonUtil.getText(dataObject, "LOTNO"));
|
|
|
|
|
|
mTableStorageInBeans.add(materialBean);
|
|
|
}
|
|
@@ -362,7 +375,7 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
|
|
|
private void setTableData() {
|
|
|
mTableData = new TableData<JLTMaterialBean>("库位提示", mTableStorageInBeans,
|
|
|
- mLocationColumn, mBarcodeColumn, mDcColumn, mQuantityColumn);
|
|
|
+ mLocationColumn, mperiodColumn, mlotnoColumn,mDcColumn, mQuantityColumn);
|
|
|
mSmartTable.setTableData(mTableData);
|
|
|
mSmartTable.postDelayed(new Runnable() {
|
|
|
@Override
|
|
@@ -510,7 +523,7 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
/**
|
|
|
* 设置页面数据
|
|
|
*/
|
|
|
- private void setEditData() {
|
|
|
+ private void setEditData() {
|
|
|
if (mMaterialBean != null) {
|
|
|
double restqty = mMaterialBean.getRESTQTY();
|
|
|
mInoutnoTextView.setText(TextUtils.isEmpty(mPiInoutno) ? mMaterialBean.getINOUTNO() : mPiInoutno);
|
|
@@ -531,11 +544,15 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
* 获取条码信息
|
|
|
*/
|
|
|
private void barcodeParse() {
|
|
|
+ String jlt_pick_material_out_scan_barcode_spacetrim = jlt_pick_material_out_scan_barcode_space.getText().toString().trim();
|
|
|
String barcode = mBarcodeEditText.getText().toString().trim();
|
|
|
if (TextUtils.isEmpty(barcode)) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+ if (TextUtils.isEmpty(jlt_pick_material_out_scan_barcode_spacetrim)){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请输入仓位");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (mMaterialBean == null) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "待备任务数据为空");
|
|
|
return;
|
|
@@ -554,33 +571,73 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
.method(Request.Method.POST)
|
|
|
.addParam("barcode", barcode)
|
|
|
.addParam("pdid", mPdId)
|
|
|
- .addParam("specialOut", "F")
|
|
|
+ .addParam("specialOut", jlt_pick_material_out_scan_barcode_spacetrim)//输入框中仓位值(改)(必填、不清空)
|
|
|
// .addParam("outdata", JSON.toJSONString(params))
|
|
|
.build(), new HttpCallback() {
|
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
+// try {
|
|
|
+// mModelEditText.requestFocus();
|
|
|
+// String result = o.toString();
|
|
|
+// JSONObject resultObject = JSON.parseObject(result);
|
|
|
+// JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
+// if (dataObject != null) {
|
|
|
+// JSONObject billInfoObject = dataObject.getJSONObject("billInfo");
|
|
|
+// JSONObject barcodeinfoObject = dataObject.getJSONObject("barcodeinfo");
|
|
|
+//
|
|
|
+// if (billInfoObject != null) {
|
|
|
+// mMaterialBean = new JLTMaterialBean();
|
|
|
+// setMaterial(billInfoObject);
|
|
|
+//
|
|
|
+// setEditData();
|
|
|
+//
|
|
|
+// mPN = FastjsonUtil.getText(billInfoObject, "PN");
|
|
|
+// mModelEditText.setText(mPN);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (barcodeinfoObject != null) {
|
|
|
+// setPageData(barcodeinfoObject);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// getPickModelCheck();
|
|
|
+
|
|
|
try {
|
|
|
- mModelEditText.requestFocus();
|
|
|
String result = o.toString();
|
|
|
JSONObject resultObject = JSON.parseObject(result);
|
|
|
JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
if (dataObject != null) {
|
|
|
- JSONObject billInfoObject = dataObject.getJSONObject("billInfo");
|
|
|
- JSONObject barcodeinfoObject = dataObject.getJSONObject("barcodeinfo");
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "拣货成功");
|
|
|
+ double restqty = FastjsonUtil.getDouble(dataObject, "NEEDREADY");
|
|
|
+ double pickqty = FastjsonUtil.getDouble(dataObject, "HAVEREADY");
|
|
|
+ double pickAll = FastjsonUtil.getDouble(dataObject, "HAVEREADY_ALL");
|
|
|
+ mMaterialBean.setRESTQTY(restqty);
|
|
|
+ mMaterialBean.setBAR_REMAIN(pickqty);
|
|
|
+ mMaterialBean.setHAVEREADY_ALL(pickAll);
|
|
|
|
|
|
- if (billInfoObject != null) {
|
|
|
- mMaterialBean = new JLTMaterialBean();
|
|
|
- setMaterial(billInfoObject);
|
|
|
+ mTodoTextView.setText(CommonUtil.doubleFormat(restqty));
|
|
|
+ mDoneTextView.setText(CommonUtil.doubleFormat(pickqty));
|
|
|
+ mDoneAllTextView.setText(CommonUtil.doubleFormat(pickAll));
|
|
|
|
|
|
- setEditData();
|
|
|
+// SharedPreUtil.saveFloat(mActivity, Constants.FLAG.JLT_PICK_MATERIAL_QUANTITY, (float) restqty);
|
|
|
+ resetState(true);
|
|
|
+ if (restqty <= 0) {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "当前型号已采集完成,自动切换至下一型号");
|
|
|
+ getPickModel();
|
|
|
+ } else {
|
|
|
+ if (mMenuRadioGroup.getCheckedRadioButtonId() == R.id.pick_material_out_scan_sign_rb) {
|
|
|
+ getLocpickList();
|
|
|
+ getPickModel();
|
|
|
|
|
|
- mPN = FastjsonUtil.getText(billInfoObject, "PN");
|
|
|
- mModelEditText.setText(mPN);
|
|
|
- }
|
|
|
|
|
|
- if (barcodeinfoObject != null) {
|
|
|
- setPageData(barcodeinfoObject);
|
|
|
+ } else {
|
|
|
+ mMenuRadioGroup.check(R.id.pick_material_out_scan_sign_rb);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -588,15 +645,15 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
}
|
|
|
|
|
|
|
|
|
- getPickModelCheck();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onFail(int flag, String failStr) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
+// CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+// mBarcodeEditText.setText("");
|
|
|
+// mBarcodeEditText.requestFocus();
|
|
|
CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
- mBarcodeEditText.setText("");
|
|
|
- mBarcodeEditText.requestFocus();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -1065,5 +1122,15 @@ public class JLTPickMaterialOutScanFragment extends BaseFragment implements View
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ @Subscribe
|
|
|
+ public void onPermissions(OutboundScanningBean bean){
|
|
|
+ getLocpickList();//库位提示
|
|
|
+ getPickModel();//第一条数据
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onDestroy() {
|
|
|
+ super.onDestroy();
|
|
|
+ //注销
|
|
|
+ EventBus.getDefault().unregister(this);
|
|
|
+ }
|
|
|
}
|