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 @@ + + + + + + + + + + + + + + + + + +