From faff705bd0b66d3a0f7fafa30f97e8a9b4792ead Mon Sep 17 00:00:00 2001
From: wangh <123456>
Date: Fri, 15 Mar 2024 17:02:06 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E4=BF=9D=E4=BF=AE?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/.gitignore | 3 +-
app/src/main/AndroidManifest.xml | 14 ++-
.../jingyuan_mes/HomePageActivity.java | 2 +
.../adapter/check/DisposalFileAdapter.java | 2 +-
.../adapter/store/MaterialOutPassAdapter.java | 30 ++++-
.../jingyuan_mes/base/BaseActivity.java | 7 +-
.../jingyuan_mes/device/BxActivity.java | 28 ++++-
.../device/DeviceCheckActivity.java | 17 +++
.../device/DeviceCheckInfoActivity.java | 16 +++
.../entity/check/CheckInstanceFiles.java | 9 ++
.../entity/store/OutstockDetail.java | 10 +-
.../store/AssemblyOutActivity.java | 1 +
.../store/MaterialPassActivity.java | 24 ++--
.../main/res/drawable/bg_item_selected.xml | 6 +
app/src/main/res/layout/activity_bx.xml | 3 +-
.../main/res/layout/activity_device_check.xml | 119 ++++++++++++++++++
.../res/layout/activity_device_check_info.xml | 61 +++++++++
app/src/main/res/layout/item_disposal_img.xml | 3 +-
app/src/main/res/layout/item_out_pass.xml | 9 +-
app/src/main/res/values/themes.xml | 31 ++++-
20 files changed, 359 insertions(+), 36 deletions(-)
create mode 100644 app/src/main/java/com/example/jingyuan_mes/device/DeviceCheckActivity.java
create mode 100644 app/src/main/java/com/example/jingyuan_mes/device/DeviceCheckInfoActivity.java
create mode 100644 app/src/main/res/drawable/bg_item_selected.xml
create mode 100644 app/src/main/res/layout/activity_device_check.xml
create mode 100644 app/src/main/res/layout/activity_device_check_info.xml
diff --git a/app/.gitignore b/app/.gitignore
index 42afabf..956c004 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -1 +1,2 @@
-/build
\ No newline at end of file
+/build
+/release
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8df2557..b5d7c20 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -5,6 +5,7 @@
+
+
+
+
-
@@ -98,6 +105,7 @@
android:exported="true">
+
@@ -109,9 +117,9 @@
android:exported="true" />
+ android:exported="true" />
+
-
\ No newline at end of file
diff --git a/app/src/main/java/com/example/jingyuan_mes/HomePageActivity.java b/app/src/main/java/com/example/jingyuan_mes/HomePageActivity.java
index af55194..a7efc1c 100644
--- a/app/src/main/java/com/example/jingyuan_mes/HomePageActivity.java
+++ b/app/src/main/java/com/example/jingyuan_mes/HomePageActivity.java
@@ -15,6 +15,7 @@ import com.example.jingyuan_mes.check.CheckActivity;
import com.example.jingyuan_mes.check.CheckSelectActivity;
import com.example.jingyuan_mes.databinding.ActivityHomePageBinding;
import com.example.jingyuan_mes.device.BxActivity;
+import com.example.jingyuan_mes.device.DeviceCheckActivity;
import com.example.jingyuan_mes.entity.MenuBeen;
import com.example.jingyuan_mes.entity.store.PdaRouters;
import com.example.jingyuan_mes.store.AssemblyOutActivity;
@@ -71,6 +72,7 @@ public class HomePageActivity extends BaseActivity implements ItemClickCall {
map.put("物料质检列表", CheckSelectActivity.class);
map.put("不合格处置", CheckSelectActivity.class);
map.put("故障报修", BxActivity.class);
+ map.put("设备巡检", DeviceCheckActivity.class);
}
private void initRequest() {
diff --git a/app/src/main/java/com/example/jingyuan_mes/adapter/check/DisposalFileAdapter.java b/app/src/main/java/com/example/jingyuan_mes/adapter/check/DisposalFileAdapter.java
index 79668b6..f07c761 100644
--- a/app/src/main/java/com/example/jingyuan_mes/adapter/check/DisposalFileAdapter.java
+++ b/app/src/main/java/com/example/jingyuan_mes/adapter/check/DisposalFileAdapter.java
@@ -52,7 +52,7 @@ public class DisposalFileAdapter extends RecyclerView.Adapter list;
private Context context;
private LayoutInflater inflater;
- public MaterialOutPassAdapter(Context context) {
+ private ItemClickCall clickCall;
+
+
+
+ public MaterialOutPassAdapter(Context context, ItemClickCall clickCall) {
this.context = context;
inflater = LayoutInflater.from(context);
+ this.clickCall=clickCall;
}
public void setList(List list) {
@@ -38,14 +45,28 @@ public class MaterialOutPassAdapter extends RecyclerView.Adapter{
+ try {
+ list.get(clickTag).setSelectedState(false);
+ }catch (Exception e){
+ }
+ clickCall.onClick(position);
+ outstock.setSelectedState(true);
+ clickTag=position;
+ notifyDataSetChanged();
+ });
+ }
+ private void clarView(){
+ list.get(clickTag).setSelectedState(false);
+ notifyDataSetChanged();
+ }
@Override
public int getItemCount() {
return list==null?0:list.size();
@@ -59,6 +80,5 @@ public class MaterialOutPassAdapter extends RecyclerView.Adapter filesList;
+ private List files;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- DataBindingUtil. setContentView(this,R.layout.activity_bx);
+ ActivityBxBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_bx);
+ adapter=new DisposalFileAdapter(this ,this);
+ filesList=new ArrayList<>();
+ files=new ArrayList<>();
+ adapter.setList(filesList);
+ binding.setAdapter1(adapter);
+ }
+
+ @Override
+ public void onClick(int position, boolean type) {
+
+ }
+ public void bxTackphoto(View view){
+
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/jingyuan_mes/device/DeviceCheckActivity.java b/app/src/main/java/com/example/jingyuan_mes/device/DeviceCheckActivity.java
new file mode 100644
index 0000000..bc7352c
--- /dev/null
+++ b/app/src/main/java/com/example/jingyuan_mes/device/DeviceCheckActivity.java
@@ -0,0 +1,17 @@
+package com.example.jingyuan_mes.device;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.databinding.DataBindingUtil;
+
+import android.os.Bundle;
+
+import com.example.jingyuan_mes.R;
+
+public class DeviceCheckActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ DataBindingUtil.setContentView(this,R.layout.activity_device_check);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/jingyuan_mes/device/DeviceCheckInfoActivity.java b/app/src/main/java/com/example/jingyuan_mes/device/DeviceCheckInfoActivity.java
new file mode 100644
index 0000000..4c24565
--- /dev/null
+++ b/app/src/main/java/com/example/jingyuan_mes/device/DeviceCheckInfoActivity.java
@@ -0,0 +1,16 @@
+package com.example.jingyuan_mes.device;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+
+import com.example.jingyuan_mes.R;
+
+public class DeviceCheckInfoActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_device_check_info);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/jingyuan_mes/entity/check/CheckInstanceFiles.java b/app/src/main/java/com/example/jingyuan_mes/entity/check/CheckInstanceFiles.java
index ebc2e88..f0876fc 100644
--- a/app/src/main/java/com/example/jingyuan_mes/entity/check/CheckInstanceFiles.java
+++ b/app/src/main/java/com/example/jingyuan_mes/entity/check/CheckInstanceFiles.java
@@ -8,6 +8,15 @@ import androidx.databinding.BaseObservable;
*/
public class CheckInstanceFiles extends BaseObservable {
private String faultFile;
+ private boolean state=false;
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
public String getFaultFile() {
return faultFile;
diff --git a/app/src/main/java/com/example/jingyuan_mes/entity/store/OutstockDetail.java b/app/src/main/java/com/example/jingyuan_mes/entity/store/OutstockDetail.java
index a77d57c..3d77e55 100644
--- a/app/src/main/java/com/example/jingyuan_mes/entity/store/OutstockDetail.java
+++ b/app/src/main/java/com/example/jingyuan_mes/entity/store/OutstockDetail.java
@@ -11,7 +11,7 @@ import java.util.Objects;
* @date 2023-12-20
*/
public class OutstockDetail {
-
+ private boolean selectedState=false;
/**
* 原材料出库记录明细ID
*/
@@ -204,6 +204,14 @@ private int index;
this.materialProductionDate = materialProductionDate;
}
+ public boolean isSelectedState() {
+ return selectedState;
+ }
+
+ public void setSelectedState(boolean selectedState) {
+ this.selectedState = selectedState;
+ }
+
public Date getMaterialProductionDate() {
return materialProductionDate;
}
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
index 1cdbac7..60dec4e 100644
--- a/app/src/main/java/com/example/jingyuan_mes/store/AssemblyOutActivity.java
+++ b/app/src/main/java/com/example/jingyuan_mes/store/AssemblyOutActivity.java
@@ -17,6 +17,7 @@ public class AssemblyOutActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ // 组装出库& 生产入库
binding = DataBindingUtil.setContentView(this,R.layout.activity_assembly_out);
binding.assemblyOutText.addTextChangedListener(new TextWatcher() {
@Override
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 cdc3864..46e5268 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
@@ -7,6 +7,7 @@ import android.view.View;
import android.widget.Toast;
import com.example.jingyuan_mes.R;
+import com.example.jingyuan_mes.adapter.ItemClickCall;
import com.example.jingyuan_mes.adapter.store.MaterialOutPassAdapter;
import com.example.jingyuan_mes.base.BaseActivity;
import com.example.jingyuan_mes.base.MyRecultCall;
@@ -23,7 +24,7 @@ import java.util.List;
import okhttp3.RequestBody;
-public class MaterialPassActivity extends BaseActivity {
+public class MaterialPassActivity extends BaseActivity implements ItemClickCall {
private OutStoreSubmit vm;
private List list;
private MaterialOutPassAdapter passAdapter;
@@ -34,13 +35,15 @@ public class MaterialPassActivity extends BaseActivity {
ActivityMaterialPassBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_material_pass);
vm = new OutStoreSubmit();
binding.setVm(vm);
- passAdapter = new MaterialOutPassAdapter(this);
+ passAdapter = new MaterialOutPassAdapter(this,this);
binding.setAdapter(passAdapter);
initRequest(null);
}
private void initRequest(String user) {
- OkGo.get(url + "/wms/mobile/getAuditPassRawOutstockDetails").tag(this).headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")).params("applyBy", user).execute(new MyRecultCall(dialog, this) {
+ OkGo.get(url + "/wms/mobile/getAuditPassRawOutstockDetails").tag(this)
+ .headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
+ .params("applyBy", user).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response response) {
super.onSuccess(response);
@@ -67,9 +70,9 @@ public class MaterialPassActivity extends BaseActivity {
initRequest(searchText);
vm.subClear();
}
-
+ // 提交
public void outPassSubmit(View view) {
- var instockBatch = vm.getInstockBatch();
+/* var instockBatch = vm.getInstockBatch();
var locationCode = vm.getLocationCode();
var tag = new OutstockDetail();
tag.setLocationCode(locationCode);
@@ -78,8 +81,8 @@ public class MaterialPassActivity extends BaseActivity {
if (index == -1) {
Toast.makeText(this, "扫描错误", Toast.LENGTH_SHORT).show();
return;
- }
- vm.setRawOutstockDetailId(list.get(index).getRawOutstockDetailId());
+ }*/
+ vm.setRawOutstockDetailId(rawOutstockDetailId);
OkGo.post(url + "/wms/mobile/confirmRawOutstock")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.upRequestBody(RequestBody.create(JSON, gson.toJson(vm)))
@@ -89,6 +92,8 @@ public class MaterialPassActivity extends BaseActivity {
var body = response.body();
if (body.getCode() == 200) {
vm.subClear();
+ rawOutstockDetailId=null;
+ initRequest(null);
}
Toast.makeText(MaterialPassActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
@@ -96,5 +101,10 @@ public class MaterialPassActivity extends BaseActivity {
});
}
+ private Long rawOutstockDetailId=null;
+ @Override
+ public void onClick(int position) {
+ rawOutstockDetailId=list.get(position).getRawOutstockDetailId();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/bg_item_selected.xml b/app/src/main/res/drawable/bg_item_selected.xml
new file mode 100644
index 0000000..ef88faf
--- /dev/null
+++ b/app/src/main/res/drawable/bg_item_selected.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_bx.xml b/app/src/main/res/layout/activity_bx.xml
index 6cf5af3..4efe690 100644
--- a/app/src/main/res/layout/activity_bx.xml
+++ b/app/src/main/res/layout/activity_bx.xml
@@ -246,8 +246,7 @@
android:id="@+id/disposal_file_add"
android:layout_width="50dp"
android:layout_height="match_parent"
- android:visibility="gone"
- android:onClick="dispisalTackphoto"
+ android:onClick="bxTackphoto"
android:src="@mipmap/ic_add_file"/>