增加 - 解绑、补打条码

master
wangh 8 months ago
parent ab0c066f18
commit 3febefc900

@ -10,8 +10,8 @@ android {
applicationId "com.example.aucma_mes" applicationId "com.example.aucma_mes"
minSdk 24 minSdk 24
targetSdk 33 targetSdk 33
versionCode 8 versionCode 11
versionName "1.8" versionName "1.11"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 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 <application
android:name=".base.MyApplication" android:name=".base.MyApplication"
android:allowBackup="true" android:allowBackup="true"
android:usesCleartextTraffic="true"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/logo2" android:icon="@mipmap/logo2"
@ -17,11 +16,15 @@
android:roundIcon="@mipmap/logo2" android:roundIcon="@mipmap/logo2"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.Aucmames" android:theme="@style/Theme.Aucmames"
android:usesCleartextTraffic="true"
tools:targetApi="31"> tools:targetApi="31">
<activity <activity
android:name=".ChangeActivity" android:name=".UnbindActivity"
android:label="工位切换"
android:exported="false" /> android:exported="false" />
<activity
android:name=".ChangeActivity"
android:exported="false"
android:label="工位切换" />
<activity <activity
android:name=".base.BaseActivity" android:name=".base.BaseActivity"
android:exported="false" /> android:exported="false" />
@ -38,7 +41,7 @@
android:label="质量检测" /> android:label="质量检测" />
<activity <activity
android:name=".HomePageActivity" android:name=".HomePageActivity"
android:exported="true"></activity> android:exported="true" />
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true"> android:exported="true">

@ -51,7 +51,7 @@ public class BindingActivity extends BaseActivity {
selectGoodsName(code); selectGoodsName(code);
} else if (c == 'L' && title.equals("壳胆绑定")) { } else if (c == 'L' && title.equals("壳胆绑定")) {
innerCode.set(code); innerCode.set(code);
} else if (title.equals("条码绑定") && code.length() >= 21) { } else if (title.equals("条码绑定") && code.length() > 19) {
innerCode.set(code); innerCode.set(code);
} else { } else {
Toast.makeText(this, "条码格式不对", Toast.LENGTH_SHORT).show(); 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) { public void checkSubmint(View view) {
if (checkViewModel.getName() == null || checkViewModel.getName().isEmpty()) return; if (checkViewModel.getName() == null || checkViewModel.getName().isEmpty()) return;
checkViewModel.setList(submitList); checkViewModel.setList(submitList);

@ -33,9 +33,9 @@ public class HomePageActivity extends AppCompatActivity {
getSupportActionBar().hide(); getSupportActionBar().hide();
Intent intent1 = getIntent(); Intent intent1 = getIntent();
roles = intent1.getStringArrayListExtra("role"); roles = intent1.getStringArrayListExtra("role");
Log.e("TAG", "onCreate:" + roles.toString());
String json = intent1.getStringExtra("info"); String json = intent1.getStringExtra("info");
LoginInfoBeen infoBeen = new Gson().fromJson(json, LoginInfoBeen.class); LoginInfoBeen infoBeen = new Gson().fromJson(json, LoginInfoBeen.class);
// Log.e("TAG", "onCreate:" + infoBeen.getUserPermission());
InfoDialog infoDialog = new InfoDialog(this); InfoDialog infoDialog = new InfoDialog(this);
try { try {
@ -96,6 +96,26 @@ public class HomePageActivity extends AppCompatActivity {
binding.homeButton5.setOnClickListener(v -> { binding.homeButton5.setOnClickListener(v -> {
infoDialog.show(); 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) { } catch (Exception e) {
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
@ -118,7 +138,7 @@ public class HomePageActivity extends AppCompatActivity {
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
SharedPreferencesUtils.putstring("stationName",null); SharedPreferencesUtils.putstring("stationName", null);
SharedPreferencesUtils.putstring("stationCode",null); SharedPreferencesUtils.putstring("stationCode", null);
} }
} }

@ -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 { }else {
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.item1)); databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.item1));
} }
databing.itemButtom.setOnClickListener(t -> { if (!processResult.equals("未完成")){
checkItemClickCall.submintRepair(position); databing.itemButtom.setOnClickListener(t -> {
}); checkItemClickCall.submintRepair(position);
});
}
databing.executePendingBindings(); databing.executePendingBindings();
} }

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

@ -22,66 +22,84 @@
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.gridlayout.widget.GridLayout <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="76dp" android:layout_marginTop="76dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
app:columnCount="2"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0" app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent">
app:rowCount="2">
<androidx.gridlayout.widget.GridLayout
<RadioButton android:layout_width="match_parent"
android:id="@+id/home_button1" android:layout_height="match_parent"
style="@style/radio_button_style" app:columnCount="2"
android:drawableTop="@mipmap/icon_check" app:rowCount="2">
android:text="质量检测"
app:layout_columnWeight="1" /> <RadioButton
android:id="@+id/home_button1"
<RadioButton style="@style/radio_button_style"
android:id="@+id/home_button2" android:drawableTop="@mipmap/icon_check"
style="@style/radio_button_style" android:text="质量检测"
android:drawableTop="@mipmap/icon_bd" app:layout_columnWeight="1" />
android:text="壳胆绑定"
app:layout_columnWeight="1" /> <RadioButton
android:id="@+id/home_button2"
style="@style/radio_button_style"
<RadioButton android:drawableTop="@mipmap/icon_bd"
android:id="@+id/home_button3" android:text="壳胆绑定"
style="@style/radio_button_style" app:layout_columnWeight="1" />
android:drawableTop="@mipmap/icon_fx"
android:text="质量返修"
app:layout_columnWeight="1" /> <RadioButton
android:id="@+id/home_button3"
<RadioButton style="@style/radio_button_style"
android:id="@+id/home_button4" android:drawableTop="@mipmap/icon_fx"
style="@style/radio_button_style" android:text="质量返修"
android:drawableTop="@mipmap/icon_bd2" app:layout_columnWeight="1" />
android:text="条码绑定"
app:layout_columnWeight="1" /> <RadioButton
android:id="@+id/home_button4"
<RadioButton style="@style/radio_button_style"
android:id="@+id/home_button5" android:drawableTop="@mipmap/icon_bd2"
style="@style/radio_button_style" android:text="条码绑定"
android:drawableTop="@mipmap/icon_info" app:layout_columnWeight="1" />
android:text="班组确认"
app:layout_columnWeight="1" /> <RadioButton
android:id="@+id/home_button7"
<RadioButton style="@style/radio_button_style"
android:id="@+id/home_button6" android:drawableTop="@mipmap/icon_bar"
style="@style/radio_button_style" android:text="补打条码"
android:drawableTop="@mipmap/icon_change" app:layout_columnWeight="1" />
android:text="切换工位"
app:layout_columnWeight="1" /> <RadioButton
android:id="@+id/home_button8"
style="@style/radio_button_style"
</androidx.gridlayout.widget.GridLayout> android:drawableTop="@mipmap/icon_unbin"
android:text="条码解绑"
app:layout_columnWeight="1" />
<RadioButton
android:id="@+id/home_button5"
style="@style/radio_button_style"
android:drawableTop="@mipmap/icon_info"
android:text="班组确认"
app:layout_columnWeight="1" />
<RadioButton
android:id="@+id/home_button6"
style="@style/radio_button_style"
android:drawableTop="@mipmap/icon_change"
android:text="切换工位"
app:layout_columnWeight="1" />
</androidx.gridlayout.widget.GridLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </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" style="@style/item_text_style"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="下返修" android:text='@{item.processResult.equals("未完成")?"未完成":"下返修"}'
android:textSize="15sp" android:textSize="15sp"
android:textColor="#E71717" /> 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