增加 - 解绑、补打条码

master
wangh 8 months ago
parent ab0c066f18
commit 3febefc900

@ -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"
}

@ -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"
}

@ -9,7 +9,6 @@
<application
android:name=".base.MyApplication"
android:allowBackup="true"
android:usesCleartextTraffic="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/logo2"
@ -17,11 +16,15 @@
android:roundIcon="@mipmap/logo2"
android:supportsRtl="true"
android:theme="@style/Theme.Aucmames"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".ChangeActivity"
android:label="工位切换"
android:name=".UnbindActivity"
android:exported="false" />
<activity
android:name=".ChangeActivity"
android:exported="false"
android:label="工位切换" />
<activity
android:name=".base.BaseActivity"
android:exported="false" />
@ -38,7 +41,7 @@
android:label="质量检测" />
<activity
android:name=".HomePageActivity"
android:exported="true"></activity>
android:exported="true" />
<activity
android:name=".MainActivity"
android:exported="true">

@ -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();

@ -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);

@ -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();

@ -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.<Result>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<Result> 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");
}
}

@ -59,9 +59,11 @@ public class RepaitSubmintInfoAdapter extends RecyclerView.Adapter<RepaitSubmint
}else {
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.item1));
}
if (!processResult.equals("未完成")){
databing.itemButtom.setOnClickListener(t -> {
checkItemClickCall.submintRepair(position);
});
}
databing.executePendingBindings();
}

@ -19,9 +19,7 @@
type="com.example.aucma_mes.entity.CheckSum" />
</data>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
@ -62,7 +60,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_height="46dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="4dp"
android:background="@color/white"
@ -87,7 +85,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="4dp">
@ -128,8 +126,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_marginTop="5dp"
android:layout_height="40dp"
android:layout_marginEnd="4dp"
android:background="@color/white"
android:orientation="horizontal">
@ -175,7 +172,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="224dp"
android:layout_height="190dp"
android:background="@color/white"
android:padding="5dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
@ -184,14 +181,28 @@
<Button
style="@style/button_true_style"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_margin="10dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:onClick="checkSubmint"
android:text="提交" />
<Button
style="@style/button_true_style"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:onClick="checkSubmint1"
android:visibility="gone"
android:text="test" />
<!-- 查询数据 -->
</LinearLayout>
</ScrollView>
</layout>

@ -22,18 +22,22 @@
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent" />
<androidx.gridlayout.widget.GridLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginTop="76dp"
android:layout_marginEnd="10dp"
app:columnCount="2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.gridlayout.widget.GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:columnCount="2"
app:rowCount="2">
<RadioButton
@ -65,6 +69,20 @@
android:text="条码绑定"
app:layout_columnWeight="1" />
<RadioButton
android:id="@+id/home_button7"
style="@style/radio_button_style"
android:drawableTop="@mipmap/icon_bar"
android:text="补打条码"
app:layout_columnWeight="1" />
<RadioButton
android:id="@+id/home_button8"
style="@style/radio_button_style"
android:drawableTop="@mipmap/icon_unbin"
android:text="条码解绑"
app:layout_columnWeight="1" />
<RadioButton
android:id="@+id/home_button5"
style="@style/radio_button_style"
@ -82,6 +100,6 @@
</androidx.gridlayout.widget.GridLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="title"
type="String" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".UnbindActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@color/blue"
android:gravity="center|left"
android:paddingStart="12dp"
android:text="@{title}"
android:textColor="@color/white"
android:textSize="20sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="12dp"
android:focusableInTouchMode="true"
android:focusable="true"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_style1"
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="箱壳条码:" />
<EditText
android:id="@+id/unbind_boxCode"
style="@style/san_text_style"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<Button
style="@style/button_true_style"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="20dp"
android:onClick="unBindSubmit"
android:text="提交" />
<Button
style="@style/button_true_style"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="20dp"
android:onClick="unBindSubmit1"
android:visibility="gone"
android:text="test" />
</LinearLayout>
</layout>

@ -67,7 +67,7 @@
style="@style/item_text_style"
android:layout_width="50dp"
android:layout_height="match_parent"
android:text="下返修"
android:text='@{item.processResult.equals("未完成")?"未完成":"下返修"}'
android:textSize="15sp"
android:textColor="#E71717" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Loading…
Cancel
Save