Browse Source

产成品入库增加生产耗用确认(暂时不用)

master
FoxV 2 years ago
parent
commit
c51ff22e0f
  1. 2
      app/build.gradle
  2. 89
      app/src/main/java/com/icssoft/icspda/activity/MOStockINActivity.java

2
app/build.gradle

@ -9,7 +9,7 @@ android {compileSdkVersion 30
applicationId "com.icssoft.icspda" applicationId "com.icssoft.icspda"
minSdkVersion 18 minSdkVersion 18
targetSdkVersion 28 targetSdkVersion 28
versionCode 19
versionCode 20
versionName "1.0" versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

89
app/src/main/java/com/icssoft/icspda/activity/MOStockINActivity.java

@ -1,6 +1,8 @@
package com.icssoft.icspda.activity; package com.icssoft.icspda.activity;
import android.content.DialogInterface;
import android.graphics.Color; import android.graphics.Color;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
@ -15,6 +17,7 @@ import android.widget.EditText;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.bin.david.form.core.SmartTable; import com.bin.david.form.core.SmartTable;
@ -39,6 +42,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
public class MOStockINActivity extends AppCompatActivity { public class MOStockINActivity extends AppCompatActivity {
//region 变量初始化 //region 变量初始化
@ -97,6 +101,11 @@ public class MOStockINActivity extends AppCompatActivity {
barCode.requestFocus(); barCode.requestFocus();
HelpUtil.SetMsg(tvMsg, Color.BLUE, "产品条码扫描成功!"); HelpUtil.SetMsg(tvMsg, Color.BLUE, "产品条码扫描成功!");
break; break;
case 96:
HelpUtil.SetMsg(tvMsg, Color.BLUE, ErrorMsg);
barCode.setText("");
barCode.requestFocus();
break;
case 97: case 97:
barCode.requestFocus(); barCode.requestFocus();
HelpUtil.SetMsg(tvMsg,Color.YELLOW,ErrorMsg); HelpUtil.SetMsg(tvMsg,Color.YELLOW,ErrorMsg);
@ -240,9 +249,13 @@ public class MOStockINActivity extends AppCompatActivity {
return; return;
} }
new Thread(new Runnable() { new Thread(new Runnable() {
@RequiresApi(api = Build.VERSION_CODES.N)
@Override @Override
public void run() { public void run() {
storageINForMONew();
Looper.prepare();
// showAlert();
storageINForMO();
Looper.loop();
if (IsFinish==true){ if (IsFinish==true){
Looper.prepare(); Looper.prepare();
barWithNumber.setProgress(100); barWithNumber.setProgress(100);
@ -536,46 +549,40 @@ public class MOStockINActivity extends AppCompatActivity {
} }
} }
public void storageINForMONew() {
// String BarCodeList = "";//物料条码
// String BinCodeList = "";//库位
// String POCode="";//单据
// String PORow="";//行号
// String POQty="";//已入库数量
// List<apiMOStockInData> apiList = new ArrayList<>();
// SubmitData list=new SubmitData();
// List<PdaListData> pdaListData=new ArrayList<>();
// List<PdaListDetailData> pdaListDetailData=new ArrayList<>();
//
// for (PdaListData moStockINData:dataList){
// if (moStockINData.getBinCode()!=null||moStockINData.getBinCode().equals("")){
// pdaListData.add(moStockINData);
// } else {
// ErrorMsg = "存在未扫描库位的条码,请确认后再提交";
// handler.sendEmptyMessage(99);
// return;
// }
// }
//
//// Map params = new HashMap();
//// params.put("barStr", BarCodeList);
//// params.put("stack", BinCodeList);
//// params.put("POCode", POCode);
//// params.put("PORow", PORow);
//// params.put("POQty", POQty);
//// params.put("userCode", "demo");
//// params.put("userName", "开发者");
//// params.put("workPoint", workPoint) ;
//// params.put("Type","收");
//
// list.setDataList(pdaListData);
// list.setDataDetailList(pdaListDetailData);
// list.setUserCode(LoginActivity.user.getUserCode());
// list.setUserName(LoginActivity.user.getUserName());
// list.setWorkPoint(LoginActivity.user.getWorkPointCode());
// list.setType("收");
// Map content = new HashMap();
// content.put("params", new Gson().toJson(list));
@RequiresApi(api = Build.VERSION_CODES.N)
private void showAlert(){
//若存在费用型料号且未发货完成给出提醒弹窗
List tempMateArr = dataList.stream().filter(a -> new BigDecimal(a.getQuantity()).compareTo(new BigDecimal(a.getIssueQuantity())) > 0).collect(Collectors.toList());
if (tempMateArr != null && tempMateArr.size() > 0){
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(this);
android.app.AlertDialog alertDialog = builder.setTitle("生产耗用提醒")
.setCancelable(false)
.setMessage("存在非生产耗用料品,是否继续入库?")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public void onClick(DialogInterface dialog, int which) {
Log.e("提醒框选择:","继续入库");
storageINForMO();
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public void onClick(DialogInterface dialog, int which) {
Log.e("提醒框选择:","不入库");
ErrorMsg = "放弃入库";
handler.sendEmptyMessage(96);
}
}).create();
alertDialog.show();
}else {
storageINForMO();
}
}
public void storageINForMO() {
Map params = new HashMap(); Map params = new HashMap();
List tempArr = new ArrayList(); List tempArr = new ArrayList();

Loading…
Cancel
Save