|
@@ -63,6 +63,7 @@ import com.uas.keg_storage.bean.SubmitNotParam;
|
|
|
import com.uas.keg_storage.bean.WHBreakingBatchBreakingBtnClickEvent;
|
|
import com.uas.keg_storage.bean.WHBreakingBatchBreakingBtnClickEvent;
|
|
|
import com.uas.keg_storage.database.DBManager;
|
|
import com.uas.keg_storage.database.DBManager;
|
|
|
import com.uas.keg_storage.global.GloableParams;
|
|
import com.uas.keg_storage.global.GloableParams;
|
|
|
|
|
+import com.uas.keg_storage.listener.MyEditorActionListener;
|
|
|
import com.uas.keg_storage.table.TableLBARCODEIO;
|
|
import com.uas.keg_storage.table.TableLBARCODEIO;
|
|
|
import com.uas.keg_storage.table.TableLPRODIONEEDGET;
|
|
import com.uas.keg_storage.table.TableLPRODIONEEDGET;
|
|
|
import com.uas.keg_storage.tools.SharedPreUtil;
|
|
import com.uas.keg_storage.tools.SharedPreUtil;
|
|
@@ -112,6 +113,7 @@ import okhttp3.RequestBody;
|
|
|
*/
|
|
*/
|
|
|
public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClickListener, RadioGroup.OnCheckedChangeListener, StorageInAddListFragment.OnListSelectListener, MaterialOutRevocationStockFragment.OnRevocationSuccessListener, HttpCallback {
|
|
public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClickListener, RadioGroup.OnCheckedChangeListener, StorageInAddListFragment.OnListSelectListener, MaterialOutRevocationStockFragment.OnRevocationSuccessListener, HttpCallback {
|
|
|
private static final int SCAN_BARCODE_CODE = 103;
|
|
private static final int SCAN_BARCODE_CODE = 103;
|
|
|
|
|
+ private static final int SCAN_BOX_CODE = 106;
|
|
|
private static final int SPLIT_BARCODE_SUCCESS = 104;
|
|
private static final int SPLIT_BARCODE_SUCCESS = 104;
|
|
|
private static final int SPLIT_BARCODE_FAIL = 105;
|
|
private static final int SPLIT_BARCODE_FAIL = 105;
|
|
|
private static final int FLAG_CONFIRM_POST = 0x08;
|
|
private static final int FLAG_CONFIRM_POST = 0x08;
|
|
@@ -165,8 +167,12 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
TextView mCollectResultTextView;
|
|
TextView mCollectResultTextView;
|
|
|
@Bind(R.id.iocout_make_material_oper_title_tv)
|
|
@Bind(R.id.iocout_make_material_oper_title_tv)
|
|
|
TextView mPiTitleTextView;
|
|
TextView mPiTitleTextView;
|
|
|
|
|
+ @Bind(R.id.iocout_material_oper_box_et)
|
|
|
|
|
+ ClearableEditText mBoxEditText;
|
|
|
|
|
+ @Bind(R.id.iocout_material_oper_box_scan_iv)
|
|
|
|
|
+ ImageView mBoxScanIv;
|
|
|
|
|
|
|
|
- private ImageView mScanImageView;
|
|
|
|
|
|
|
+ private ImageView mBarcodeScanIv;
|
|
|
|
|
|
|
|
private JsonObjectRequest jsonRequest;
|
|
private JsonObjectRequest jsonRequest;
|
|
|
private static final String TAG = "IOCOutMakeMaterialOper";
|
|
private static final String TAG = "IOCOutMakeMaterialOper";
|
|
@@ -455,7 +461,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(true);
|
|
((FunctionActivity) getActivity()).setMoreBtnVisible(true);
|
|
|
((FunctionActivity) getActivity()).setListIconIvVisible(false);
|
|
((FunctionActivity) getActivity()).setListIconIvVisible(false);
|
|
|
|
|
|
|
|
- mScanImageView = (ImageView) root.findViewById(R.id.iocout_material_oper_scan_iv);
|
|
|
|
|
|
|
+ mBarcodeScanIv = (ImageView) root.findViewById(R.id.iocout_material_oper_barcode_scan_iv);
|
|
|
btnActionbarRight = (Button) getActivity().findViewById(R.id.btn_actionbar_more);
|
|
btnActionbarRight = (Button) getActivity().findViewById(R.id.btn_actionbar_more);
|
|
|
|
|
|
|
|
mDbManager = new DBManager(getActivity().getApplicationContext());
|
|
mDbManager = new DBManager(getActivity().getApplicationContext());
|
|
@@ -512,7 +518,8 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
etBarCode.addTextChangedListener(watcher);
|
|
etBarCode.addTextChangedListener(watcher);
|
|
|
mCollectTypeRadioGroup.setOnCheckedChangeListener(this);
|
|
mCollectTypeRadioGroup.setOnCheckedChangeListener(this);
|
|
|
mCollectModelBtn.setOnClickListener(this);
|
|
mCollectModelBtn.setOnClickListener(this);
|
|
|
- mScanImageView.setOnClickListener(this);
|
|
|
|
|
|
|
+ mBarcodeScanIv.setOnClickListener(this);
|
|
|
|
|
+ mBoxScanIv.setOnClickListener(this);
|
|
|
|
|
|
|
|
etBarCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
etBarCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -527,6 +534,13 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ CommonUtil.setEditorActionListener(mBoxEditText, new MyEditorActionListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
|
|
+ etBarCode.requestFocus();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
if (false) {
|
|
if (false) {
|
|
|
mtypeNameTv.setOnClickListener(new View.OnClickListener() {
|
|
mtypeNameTv.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -661,9 +675,11 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
String materialInfo =
|
|
String materialInfo =
|
|
|
"下一采集货品\n物料:" + FastjsonUtil.getText(dataObject, "PD_PRODCODE")
|
|
"下一采集货品\n物料:" + FastjsonUtil.getText(dataObject, "PD_PRODCODE")
|
|
|
+ "; \n数量:" + FastjsonUtil.getText(dataObject, "NEEDREADY")
|
|
+ "; \n数量:" + FastjsonUtil.getText(dataObject, "NEEDREADY")
|
|
|
|
|
+ + "; \n来料供应商:" + FastjsonUtil.getText(dataObject, "VENDCODE")
|
|
|
+ "; \n序号:" + FastjsonUtil.getText(dataObject, "PD_PDNO")
|
|
+ "; \n序号:" + FastjsonUtil.getText(dataObject, "PD_PDNO")
|
|
|
+ "; \n品牌:" + FastjsonUtil.getText(dataObject, "PD_BRAND")
|
|
+ "; \n品牌:" + FastjsonUtil.getText(dataObject, "PD_BRAND")
|
|
|
- + "; \n仓库:" + FastjsonUtil.getText(dataObject, "PD_WHCODE");
|
|
|
|
|
|
|
+ + "; \n仓库:" + FastjsonUtil.getText(dataObject, "PD_WHCODE")
|
|
|
|
|
+ + "; \n库位:" + FastjsonUtil.getText(dataObject, "BI_LOCATION");
|
|
|
if (mMaterialInforTextView != null) {
|
|
if (mMaterialInforTextView != null) {
|
|
|
mMaterialInforTextView.setText(materialInfo);
|
|
mMaterialInforTextView.setText(materialInfo);
|
|
|
}
|
|
}
|
|
@@ -704,6 +720,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
progressDialog.show();
|
|
progressDialog.show();
|
|
|
etBarCode.setText(null);
|
|
etBarCode.setText(null);
|
|
|
mCollectTypeRadioGroup.setEnabled(false);
|
|
mCollectTypeRadioGroup.setEnabled(false);
|
|
|
|
|
+ String boxNum = mBoxEditText.getText().toString().trim();
|
|
|
|
|
|
|
|
VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
new HttpParams.Builder()
|
|
new HttpParams.Builder()
|
|
@@ -713,6 +730,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
.tag(TAG + "collectbarcode")
|
|
.tag(TAG + "collectbarcode")
|
|
|
.addParam("pi_id", pi_id)
|
|
.addParam("pi_id", pi_id)
|
|
|
.addParam("barcode", barcode)
|
|
.addParam("barcode", barcode)
|
|
|
|
|
+ .addParam("box", boxNum)
|
|
|
.build(), new HttpCallback() {
|
|
.build(), new HttpCallback() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
@@ -741,7 +759,8 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
+ ";数量:" + FastjsonUtil.getText(barcodeObject, "BI_OUTQTY")
|
|
+ ";数量:" + FastjsonUtil.getText(barcodeObject, "BI_OUTQTY")
|
|
|
+ ";lotno:" + FastjsonUtil.getText(barcodeObject, "BI_LOTNO")
|
|
+ ";lotno:" + FastjsonUtil.getText(barcodeObject, "BI_LOTNO")
|
|
|
+ ";Datecode:" + FastjsonUtil.getText(barcodeObject, "BI_DATECODE")
|
|
+ ";Datecode:" + FastjsonUtil.getText(barcodeObject, "BI_DATECODE")
|
|
|
- + ";PO:" + FastjsonUtil.getText(barcodeObject, "BI_ORDERCODE");
|
|
|
|
|
|
|
+// + ";PO:" + FastjsonUtil.getText(barcodeObject, "BI_ORDERCODE")
|
|
|
|
|
+ ;
|
|
|
|
|
|
|
|
mCollectResultTextView.setText(barcodeResult);
|
|
mCollectResultTextView.setText(barcodeResult);
|
|
|
mCollectResultTextView.setVisibility(View.VISIBLE);
|
|
mCollectResultTextView.setVisibility(View.VISIBLE);
|
|
@@ -759,9 +778,11 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
String materialInfo =
|
|
String materialInfo =
|
|
|
"下一采集货品\n物料:" + FastjsonUtil.getText(nextObject, "PD_PRODCODE")
|
|
"下一采集货品\n物料:" + FastjsonUtil.getText(nextObject, "PD_PRODCODE")
|
|
|
+ "; \n数量:" + FastjsonUtil.getText(nextObject, "NEEDREADY")
|
|
+ "; \n数量:" + FastjsonUtil.getText(nextObject, "NEEDREADY")
|
|
|
|
|
+ + "; \n来料供应商:" + FastjsonUtil.getText(dataObject, "VENDCODE")
|
|
|
+ "; \n序号:" + FastjsonUtil.getText(nextObject, "PD_PDNO")
|
|
+ "; \n序号:" + FastjsonUtil.getText(nextObject, "PD_PDNO")
|
|
|
+ "; \n品牌:" + FastjsonUtil.getText(nextObject, "PD_BRAND")
|
|
+ "; \n品牌:" + FastjsonUtil.getText(nextObject, "PD_BRAND")
|
|
|
- + "; \n仓库:" + FastjsonUtil.getText(nextObject, "PD_WHCODE");
|
|
|
|
|
|
|
+ + "; \n仓库:" + FastjsonUtil.getText(nextObject, "PD_WHCODE")
|
|
|
|
|
+ + "; \n库位:" + FastjsonUtil.getText(nextObject, "BI_LOCATION");
|
|
|
mMaterialInforTextView.setText(materialInfo);
|
|
mMaterialInforTextView.setText(materialInfo);
|
|
|
} else {
|
|
} else {
|
|
|
mMaterialInforTextView.setText("该出库单已经完成备料");
|
|
mMaterialInforTextView.setText("该出库单已经完成备料");
|
|
@@ -1052,14 +1073,22 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
- case R.id.iocout_material_oper_scan_iv:
|
|
|
|
|
|
|
+ case R.id.iocout_material_oper_barcode_scan_iv:
|
|
|
if (CameraUtil.hasCamera()) {
|
|
if (CameraUtil.hasCamera()) {
|
|
|
- if (root.findFocus() != null) {
|
|
|
|
|
- mFocusId = root.findFocus().getId();
|
|
|
|
|
- Intent intent = new Intent();
|
|
|
|
|
- intent.setClass(mActivity, CaptureActivity.class);
|
|
|
|
|
- startActivityForResult(intent, SCAN_BARCODE_CODE);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ mFocusId = root.findFocus().getId();
|
|
|
|
|
+ Intent intent = new Intent();
|
|
|
|
|
+ intent.setClass(mActivity, CaptureActivity.class);
|
|
|
|
|
+ startActivityForResult(intent, SCAN_BARCODE_CODE);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case R.id.iocout_material_oper_box_scan_iv:
|
|
|
|
|
+ if (CameraUtil.hasCamera()) {
|
|
|
|
|
+ mFocusId = root.findFocus().getId();
|
|
|
|
|
+ Intent intent = new Intent();
|
|
|
|
|
+ intent.setClass(mActivity, CaptureActivity.class);
|
|
|
|
|
+ startActivityForResult(intent, SCAN_BOX_CODE);
|
|
|
} else {
|
|
} else {
|
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
|
}
|
|
}
|
|
@@ -1233,15 +1262,21 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (requestCode == SCAN_BARCODE_CODE && data != null) {
|
|
|
|
|
|
|
+ if (data == null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (requestCode == SCAN_BARCODE_CODE) {
|
|
|
if (data.getExtras() != null) {
|
|
if (data.getExtras() != null) {
|
|
|
String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
- if (mFocusId == R.id.et_bar_code) {
|
|
|
|
|
- etBarCode.setText(result);
|
|
|
|
|
- etBarCode.setSelection(result.length());
|
|
|
|
|
- confirmEvent();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ etBarCode.setText(result);
|
|
|
|
|
+ etBarCode.setSelection(result.length());
|
|
|
|
|
+ confirmEvent();
|
|
|
}
|
|
}
|
|
|
|
|
+ } else if (requestCode == SCAN_BOX_CODE) {
|
|
|
|
|
+ String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
|
|
+ mBoxEditText.setText(result);
|
|
|
|
|
+ mBoxEditText.setSelection(result.length());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2000,7 +2035,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
|
|
|
if (tableLPRODIONEEDGET.getLPN_PIID() == deleteLbarcodeio.getLBI_PIID()
|
|
if (tableLPRODIONEEDGET.getLPN_PIID() == deleteLbarcodeio.getLBI_PIID()
|
|
|
&& tableLPRODIONEEDGET.getLPN_WHCODE().equals(deleteLbarcodeio.getLBI_WHCODE())
|
|
&& tableLPRODIONEEDGET.getLPN_WHCODE().equals(deleteLbarcodeio.getLBI_WHCODE())
|
|
|
// && tableLPRODIONEEDGET.getLPN_PRODCODE().equals(deleteLbarcodeio.getLBI_PRODCODE())
|
|
// && tableLPRODIONEEDGET.getLPN_PRODCODE().equals(deleteLbarcodeio.getLBI_PRODCODE())
|
|
|
- ) {
|
|
|
|
|
|
|
+ ) {
|
|
|
tableLPRODIONEEDGET.setLPN_RESTQTY(CommonUtil.doubleAddition(tableLPRODIONEEDGET.getLPN_RESTQTY(), deleteLbarcodeio.getLBI_INQTY()));
|
|
tableLPRODIONEEDGET.setLPN_RESTQTY(CommonUtil.doubleAddition(tableLPRODIONEEDGET.getLPN_RESTQTY(), deleteLbarcodeio.getLBI_INQTY()));
|
|
|
mDbManager.updateProductWaitCollect(tableLPRODIONEEDGET);
|
|
mDbManager.updateProductWaitCollect(tableLPRODIONEEDGET);
|
|
|
}
|
|
}
|