|
|
@@ -60,8 +60,8 @@ public class StockChangeActivity extends BaseActivity {
|
|
|
private String boxCode;
|
|
|
private Button submit;
|
|
|
private String from;
|
|
|
-// private String srcArea;
|
|
|
- private BoxCodeModel srcBox;
|
|
|
+ private String srcArea;
|
|
|
+// private BoxCodeModel srcBox;
|
|
|
private BoxCodeModel tarBox;
|
|
|
|
|
|
@Override
|
|
|
@@ -153,7 +153,7 @@ public class StockChangeActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
String val = s.toString();
|
|
|
- if(val.startsWith(box_flag) && !XBK.equals(srcBox.getAreaCode())){
|
|
|
+ if(val.startsWith(box_flag)){
|
|
|
binding.llTargetArea.setVisibility(View.VISIBLE);
|
|
|
if(val.length() > 8){
|
|
|
loadBox(val, false);
|
|
|
@@ -212,7 +212,7 @@ public class StockChangeActivity extends BaseActivity {
|
|
|
loadErpTask(barcode);
|
|
|
}else if(StringUtils.isEmpty(tarCode)){
|
|
|
binding.tvTargetCode.setText(barcode);
|
|
|
- if(barcode.startsWith(box_flag) && !XBK.equals(srcBox.getAreaCode())){
|
|
|
+ if(barcode.startsWith(box_flag)){
|
|
|
binding.llTargetArea.setVisibility(View.VISIBLE);
|
|
|
loadBox(barcode, true);
|
|
|
}else{
|
|
|
@@ -254,10 +254,6 @@ public class StockChangeActivity extends BaseActivity {
|
|
|
}else{
|
|
|
ToastUtils.showToast(context, rs.getString("msg"));
|
|
|
}
|
|
|
- if(materialStockModels.size() == 1){
|
|
|
- String boxCode = materialStockModels.get(0).getAttr1();
|
|
|
- loadSrcBox(boxCode, 0);
|
|
|
- }
|
|
|
if(materialStockModels.size() == 0){
|
|
|
binding.lvProduct.setVisibility(View.GONE);
|
|
|
binding.tvEmpty.setVisibility(View.VISIBLE);
|
|
|
@@ -357,8 +353,8 @@ public class StockChangeActivity extends BaseActivity {
|
|
|
mylog.info(rs.toString());
|
|
|
try {
|
|
|
if (rs.getInt("code") == 200) {
|
|
|
- srcBox = new Gson().fromJson(rs.get("data").toString(), BoxCodeModel.class);
|
|
|
-// srcArea = srcBox.getAreaCode();
|
|
|
+ BoxCodeModel srcBox = new Gson().fromJson(rs.get("data").toString(), BoxCodeModel.class);
|
|
|
+ srcArea = srcBox.getAreaCode();
|
|
|
if(type == 1){
|
|
|
sendChange();
|
|
|
}
|
|
|
@@ -400,31 +396,16 @@ public class StockChangeActivity extends BaseActivity {
|
|
|
ToastUtils.showToast(context, "目标位置不能为空");
|
|
|
return;
|
|
|
}
|
|
|
-// if(!XBK.equals(srcBox.getAreaCode())) {
|
|
|
-// if (tarCode.startsWith(box_flag) && StringUtils.isEmpty(tarArea)) {
|
|
|
-// loadBox(tarCode, true);
|
|
|
-// ToastUtils.showToast(context, "目标库位不能为空");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// }
|
|
|
Optional<MaterialStockModel> optional = materialStockModels.stream().filter(item->"1".equals(item.getSel())).findFirst();
|
|
|
optional.ifPresent(stockModel -> materialStockModel = stockModel);
|
|
|
-// if(materialStockModel == null){
|
|
|
-// ToastUtils.showToast(context, "选择需要转移的物料");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// if(materialStockModel.getMaterialStockId()==null){
|
|
|
-// ToastUtils.showToast(context, "无效的库存ID");
|
|
|
-// return;
|
|
|
-// }
|
|
|
submit.setEnabled(false);
|
|
|
MyProgress myProgress = MyProgress.getInstance();
|
|
|
myProgress.show(context, "提示", "正在提交数据");
|
|
|
RequestParams params = httParams(Constant.CHANGE_BOX_AREA);
|
|
|
if(srcCode.startsWith(box_flag)){
|
|
|
params.addBodyParameter("boxCodeOld", srcCode);
|
|
|
- if(srcBox!=null){
|
|
|
- params.addBodyParameter("areaCodeOld", srcBox.getAreaCode());
|
|
|
+ if(!StringUtils.isEmpty(srcArea)){
|
|
|
+ params.addBodyParameter("areaCodeOld", srcArea);
|
|
|
}
|
|
|
}else{
|
|
|
params.addBodyParameter("areaCodeOld", srcCode);
|