From 7ab203ded42b563ec8de0e2b3b0f56adf8f8c6f6 Mon Sep 17 00:00:00 2001
From: wangh <123456>
Date: Tue, 20 Feb 2024 17:39:15 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E7=BB=84=E8=A3=85?=
=?UTF-8?q?=E5=87=BA=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/src/main/AndroidManifest.xml | 6 ++-
.../jingyuan_mes/entity/OutStoreSubmit.java | 7 ++-
.../jingyuan_mes/entity/OutstockDetail.java | 20 ++++++++
.../store/AssemblyOutActivity.java | 45 +++++++++++++++++
.../store/MaterialPassActivity.java | 11 +++++
.../main/res/layout/activity_assembly_out.xml | 48 +++++++++++++++++++
6 files changed, 131 insertions(+), 6 deletions(-)
create mode 100644 app/src/main/java/com/example/jingyuan_mes/store/AssemblyOutActivity.java
create mode 100644 app/src/main/res/layout/activity_assembly_out.xml
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 2815fa1..be3e5db 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -17,6 +17,9 @@
android:theme="@style/Theme.Jingyuanmes"
android:usesCleartextTraffic="true"
tools:targetApi="31">
+
@@ -34,8 +37,7 @@
android:exported="false" />
-
+ android:exported="true" />
diff --git a/app/src/main/java/com/example/jingyuan_mes/entity/OutStoreSubmit.java b/app/src/main/java/com/example/jingyuan_mes/entity/OutStoreSubmit.java
index b85a068..5a1a4ee 100644
--- a/app/src/main/java/com/example/jingyuan_mes/entity/OutStoreSubmit.java
+++ b/app/src/main/java/com/example/jingyuan_mes/entity/OutStoreSubmit.java
@@ -19,7 +19,7 @@ public class OutStoreSubmit extends BaseObservable {
private String searchText;
private int outstockAmount = 1;
private String instockBatch;
- private int rawOutstockDetailId;
+ private Long rawOutstockDetailId;
public String getLocationCode() {
return locationCode;
@@ -56,13 +56,12 @@ public class OutStoreSubmit extends BaseObservable {
notifyChange();
}
- public int getRawOutstockDetailId() {
+ public Long getRawOutstockDetailId() {
return rawOutstockDetailId;
}
- public void setRawOutstockDetailId(int rawOutstockDetailId) {
+ public void setRawOutstockDetailId(Long rawOutstockDetailId) {
this.rawOutstockDetailId = rawOutstockDetailId;
- notifyChange();
}
public void subClear() {
diff --git a/app/src/main/java/com/example/jingyuan_mes/entity/OutstockDetail.java b/app/src/main/java/com/example/jingyuan_mes/entity/OutstockDetail.java
index e4e336e..57fab7a 100644
--- a/app/src/main/java/com/example/jingyuan_mes/entity/OutstockDetail.java
+++ b/app/src/main/java/com/example/jingyuan_mes/entity/OutstockDetail.java
@@ -2,6 +2,7 @@ package com.example.jingyuan_mes.entity;
import java.math.BigDecimal;
import java.util.Date;
+import java.util.Objects;
/**
* 原材料出库记录明细对象 wms_raw_outstock_detail
@@ -341,4 +342,23 @@ public class OutstockDetail {
public void setApplyDate(String applyDate) {
this.applyDate = applyDate;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ OutstockDetail that = (OutstockDetail) o;
+
+ if (!Objects.equals(locationCode, that.locationCode))
+ return false;
+ return Objects.equals(materialBarcode, that.materialBarcode);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = locationCode != null ? locationCode.hashCode() : 0;
+ result = 31 * result + (materialBarcode != null ? materialBarcode.hashCode() : 0);
+ return result;
+ }
}
diff --git a/app/src/main/java/com/example/jingyuan_mes/store/AssemblyOutActivity.java b/app/src/main/java/com/example/jingyuan_mes/store/AssemblyOutActivity.java
new file mode 100644
index 0000000..7ce5762
--- /dev/null
+++ b/app/src/main/java/com/example/jingyuan_mes/store/AssemblyOutActivity.java
@@ -0,0 +1,45 @@
+package com.example.jingyuan_mes.store;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.databinding.DataBindingUtil;
+
+import android.os.Bundle;
+import android.text.Editable;
+import android.text.TextWatcher;
+
+import com.example.jingyuan_mes.R;
+import com.example.jingyuan_mes.base.BaseActivity;
+import com.example.jingyuan_mes.databinding.ActivityAssemblyOutBinding;
+
+public class AssemblyOutActivity extends BaseActivity {
+ private ActivityAssemblyOutBinding binding;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ binding = DataBindingUtil.setContentView(this,R.layout.activity_assembly_out);
+ binding.assemblyOutText.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ if (s.length()==13) {
+
+ }
+ }
+ });
+ binding.assemblyOutButton.setOnClickListener(v -> {
+ binding.assemblyOutText.getText().toString();
+ });
+ }
+ private void submint(String s){
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/jingyuan_mes/store/MaterialPassActivity.java b/app/src/main/java/com/example/jingyuan_mes/store/MaterialPassActivity.java
index d6d8a65..cb272c8 100644
--- a/app/src/main/java/com/example/jingyuan_mes/store/MaterialPassActivity.java
+++ b/app/src/main/java/com/example/jingyuan_mes/store/MaterialPassActivity.java
@@ -74,6 +74,17 @@ public class MaterialPassActivity extends BaseActivity {
}
public void outPassSubmit(View view) {
+ var instockBatch = vm.getInstockBatch();
+ var locationCode = vm.getLocationCode();
+ var tag=new OutstockDetail();
+ tag.setLocationCode(locationCode);
+ tag.setMaterialBarcode(instockBatch);
+ var index = list.indexOf(tag);
+ if (index==-1) {
+ Toast.makeText(this, "扫描错误", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ vm.setRawOutstockDetailId(list.get(index).getRawOutstockDetailId());
OkGo.post(url + "/wms/mobile/confirmRawOutstock")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.upRequestBody(RequestBody.create(JSON, gson.toJson(vm)))
diff --git a/app/src/main/res/layout/activity_assembly_out.xml b/app/src/main/res/layout/activity_assembly_out.xml
new file mode 100644
index 0000000..a91f16b
--- /dev/null
+++ b/app/src/main/res/layout/activity_assembly_out.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file