From 3febefc900231f3fa386bf873cf147101c0a15ae Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Mon, 18 Mar 2024 11:27:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20-=20=E8=A7=A3=E7=BB=91?= =?UTF-8?q?=E3=80=81=E8=A1=A5=E6=89=93=E6=9D=A1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 +- app/release/output-metadata.json | 20 --- app/src/main/AndroidManifest.xml | 11 +- .../example/aucma_mes/BindingActivity.java | 2 +- .../com/example/aucma_mes/CheckActivity.java | 5 +- .../example/aucma_mes/HomePageActivity.java | 26 +++- .../com/example/aucma_mes/UnbindActivity.java | 70 ++++++++++ .../adapter/RepaitSubmintInfoAdapter.java | 8 +- app/src/main/res/layout/activity_check.xml | 33 +++-- .../main/res/layout/activity_home_page.xml | 124 ++++++++++-------- app/src/main/res/layout/activity_unbind.xml | 69 ++++++++++ app/src/main/res/layout/item_repair_info.xml | 2 +- app/src/main/res/mipmap-xhdpi/icon_bar.png | Bin 0 -> 2161 bytes app/src/main/res/mipmap-xhdpi/icon_change.png | Bin 0 -> 2560 bytes app/src/main/res/mipmap-xhdpi/icon_unbin.png | Bin 0 -> 2366 bytes 15 files changed, 275 insertions(+), 99 deletions(-) delete mode 100644 app/release/output-metadata.json create mode 100644 app/src/main/java/com/example/aucma_mes/UnbindActivity.java create mode 100644 app/src/main/res/layout/activity_unbind.xml create mode 100644 app/src/main/res/mipmap-xhdpi/icon_bar.png create mode 100644 app/src/main/res/mipmap-xhdpi/icon_change.png create mode 100644 app/src/main/res/mipmap-xhdpi/icon_unbin.png diff --git a/app/build.gradle b/app/build.gradle index 96b65ac..fa113b4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.example.aucma_mes" minSdk 24 targetSdk 33 - versionCode 8 - versionName "1.8" + versionCode 11 + versionName "1.11" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json deleted file mode 100644 index 9205a3a..0000000 --- a/app/release/output-metadata.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 3, - "artifactType": { - "type": "APK", - "kind": "Directory" - }, - "applicationId": "com.example.aucma_mes", - "variantName": "release", - "elements": [ - { - "type": "SINGLE", - "filters": [], - "attributes": [], - "versionCode": 5, - "versionName": "1.0", - "outputFile": "app-release.apk" - } - ], - "elementType": "File" -} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d601607..45f78a2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,7 +9,6 @@ + @@ -38,7 +41,7 @@ android:label="质量检测" /> + android:exported="true" /> diff --git a/app/src/main/java/com/example/aucma_mes/BindingActivity.java b/app/src/main/java/com/example/aucma_mes/BindingActivity.java index ade6c90..10e2146 100644 --- a/app/src/main/java/com/example/aucma_mes/BindingActivity.java +++ b/app/src/main/java/com/example/aucma_mes/BindingActivity.java @@ -51,7 +51,7 @@ public class BindingActivity extends BaseActivity { selectGoodsName(code); } else if (c == 'L' && title.equals("壳胆绑定")) { innerCode.set(code); - } else if (title.equals("条码绑定") && code.length() >= 21) { + } else if (title.equals("条码绑定") && code.length() > 19) { innerCode.set(code); } else { Toast.makeText(this, "条码格式不对", Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/java/com/example/aucma_mes/CheckActivity.java b/app/src/main/java/com/example/aucma_mes/CheckActivity.java index f17ae3d..f27fe65 100644 --- a/app/src/main/java/com/example/aucma_mes/CheckActivity.java +++ b/app/src/main/java/com/example/aucma_mes/CheckActivity.java @@ -146,7 +146,10 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte } - // 提交 + + public void checkSubmint1(View view) { + sanInfo("B24031383025017990002"); + } // 提交 public void checkSubmint(View view) { if (checkViewModel.getName() == null || checkViewModel.getName().isEmpty()) return; checkViewModel.setList(submitList); diff --git a/app/src/main/java/com/example/aucma_mes/HomePageActivity.java b/app/src/main/java/com/example/aucma_mes/HomePageActivity.java index 2c56bff..5379601 100644 --- a/app/src/main/java/com/example/aucma_mes/HomePageActivity.java +++ b/app/src/main/java/com/example/aucma_mes/HomePageActivity.java @@ -33,9 +33,9 @@ public class HomePageActivity extends AppCompatActivity { getSupportActionBar().hide(); Intent intent1 = getIntent(); roles = intent1.getStringArrayListExtra("role"); + Log.e("TAG", "onCreate:" + roles.toString()); String json = intent1.getStringExtra("info"); LoginInfoBeen infoBeen = new Gson().fromJson(json, LoginInfoBeen.class); - // Log.e("TAG", "onCreate:" + infoBeen.getUserPermission()); InfoDialog infoDialog = new InfoDialog(this); try { @@ -96,6 +96,26 @@ public class HomePageActivity extends AppCompatActivity { binding.homeButton5.setOnClickListener(v -> { infoDialog.show(); }); + binding.homeButton7.setOnClickListener(v -> { + // 补打条码 + if (!roles.contains("rebar_code")) { + Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show(); + return; + } + intent = new Intent(this, UnbindActivity.class); + intent.putExtra("type",false); + startActivity(intent); + }); + binding.homeButton8.setOnClickListener(v -> { + //sn解绑 + if (!roles.contains("unbinding_barCode")) { + Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show(); + return; + } + intent = new Intent(this, UnbindActivity.class); + intent.putExtra("type",true); + startActivity(intent); + }); } catch (Exception e) { Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show(); @@ -118,7 +138,7 @@ public class HomePageActivity extends AppCompatActivity { @Override protected void onDestroy() { super.onDestroy(); - SharedPreferencesUtils.putstring("stationName",null); - SharedPreferencesUtils.putstring("stationCode",null); + SharedPreferencesUtils.putstring("stationName", null); + SharedPreferencesUtils.putstring("stationCode", null); } } \ No newline at end of file diff --git a/app/src/main/java/com/example/aucma_mes/UnbindActivity.java b/app/src/main/java/com/example/aucma_mes/UnbindActivity.java new file mode 100644 index 0000000..86f2cc5 --- /dev/null +++ b/app/src/main/java/com/example/aucma_mes/UnbindActivity.java @@ -0,0 +1,70 @@ +package com.example.aucma_mes; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.databinding.DataBindingUtil; +import androidx.databinding.ViewDataBinding; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Toast; + +import com.example.aucma_mes.base.BaseActivity; +import com.example.aucma_mes.databinding.ActivityUnbindBinding; +import com.example.aucma_mes.entity.CheckSum; +import com.example.aucma_mes.entity.Result; +import com.example.aucma_mes.utils.MyRecultCall; +import com.example.aucma_mes.utils.SharedPreferencesUtils; +import com.lzy.okgo.OkGo; +import com.lzy.okgo.model.Response; + +public class UnbindActivity extends BaseActivity { + private ActivityUnbindBinding binding; + private boolean type; + private String uri; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + binding = DataBindingUtil.setContentView(this, R.layout.activity_unbind); + getSupportActionBar().hide(); + type = getIntent().getBooleanExtra("type", false); + if (type){ + uri="/api/unbindBarCode"; + binding.setTitle("条码解绑"); + } else{ + uri="/api/rebarCode"; + binding.setTitle("补打条码"); + } + + } + + @Override + protected void sanInfo(String code) { + binding.unbindBoxCode.setText(code); + } + + public void unBindSubmit(View view) { + + OkGo.post(url + uri).tag(this) + .headers("Authorization", SharedPreferencesUtils.getstring("token", "")) + .params("barCode", binding.unbindBoxCode.getText().toString().trim()).execute(new MyRecultCall(dialog, this) { + @Override + public void onSuccess(Response response) { + super.onSuccess(response); + Result result = response.body(); + Toast.makeText(UnbindActivity.this, result.getMsg(), Toast.LENGTH_SHORT).show(); + if (type&&result.getCode()==200) { + binding.unbindBoxCode.setText(null); + } + } + }); + + } + + public void unBindSubmit1(View view) { + sanInfo("123"); + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/aucma_mes/adapter/RepaitSubmintInfoAdapter.java b/app/src/main/java/com/example/aucma_mes/adapter/RepaitSubmintInfoAdapter.java index 6bd96d2..aeadd46 100644 --- a/app/src/main/java/com/example/aucma_mes/adapter/RepaitSubmintInfoAdapter.java +++ b/app/src/main/java/com/example/aucma_mes/adapter/RepaitSubmintInfoAdapter.java @@ -59,9 +59,11 @@ public class RepaitSubmintInfoAdapter extends RecyclerView.Adapter { - checkItemClickCall.submintRepair(position); - }); + if (!processResult.equals("未完成")){ + databing.itemButtom.setOnClickListener(t -> { + checkItemClickCall.submintRepair(position); + }); + } databing.executePendingBindings(); } diff --git a/app/src/main/res/layout/activity_check.xml b/app/src/main/res/layout/activity_check.xml index a78bbe0..e1282d0 100644 --- a/app/src/main/res/layout/activity_check.xml +++ b/app/src/main/res/layout/activity_check.xml @@ -19,9 +19,7 @@ type="com.example.aucma_mes.entity.CheckSum" /> - + @@ -128,8 +126,7 @@ @@ -175,7 +172,7 @@ @@ -184,14 +181,28 @@