修改 - 质检

master
wangh 10 months ago
parent a15ee5add7
commit f12b4c9cd8

@ -10,7 +10,7 @@ android {
applicationId "com.example.aucma_mes" applicationId "com.example.aucma_mes"
minSdk 24 minSdk 24
targetSdk 33 targetSdk 33
versionCode 2 versionCode 5
versionName "1.0" versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

@ -11,7 +11,7 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 2, "versionCode": 5,
"versionName": "1.0", "versionName": "1.0",
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }

@ -3,6 +3,7 @@ package com.example.aucma_mes;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil; import androidx.databinding.DataBindingUtil;
import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
@ -57,13 +58,16 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_check); binding = DataBindingUtil.setContentView(this, R.layout.activity_check);
checkViewModel = new CheckViewModel(); checkViewModel = new CheckViewModel();
getSupportActionBar().hide();
binding.setVm(checkViewModel); binding.setVm(checkViewModel);
checkAdapter = new CheckAdapter(this, this); checkAdapter = new CheckAdapter(this, this);
submitList = new ArrayList<>(); submitList = new ArrayList<>();
checkAdapter.setList(submitList); checkAdapter.setList(submitList);
binding.recyclerView.setAdapter(checkAdapter); binding.recyclerView.setAdapter(checkAdapter);
String stationCode = getIntent().getStringExtra("stationCode"); Intent intent = getIntent();
String stationCode = intent.getStringExtra("stationCode");
checkViewModel.setStationCode(stationCode); checkViewModel.setStationCode(stationCode);
binding.setTitle("质量检测 - "+ intent.getStringExtra("stationName"));
// 三联 // 三联
initOptionpb(stationCode); initOptionpb(stationCode);
tipDialog = new RepairSubmintInfoDialog(this, this); tipDialog = new RepairSubmintInfoDialog(this, this);
@ -113,7 +117,7 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte
// 测试 // 测试
public void checkSubmint1(View view) { public void checkSubmint1(View view) {
sanInfo("B24010181060283110001"); sanInfo("B24010181060282920007");
} }
// 提交 // 提交
public void checkSubmint(View view) { public void checkSubmint(View view) {

@ -49,6 +49,7 @@ public class HomePageActivity extends AppCompatActivity {
} }
intent = new Intent(this, CheckActivity.class); intent = new Intent(this, CheckActivity.class);
intent.putExtra("stationCode", user.getStationCode()); intent.putExtra("stationCode", user.getStationCode());
intent.putExtra("stationName",user.getStationName());
startActivity(intent); startActivity(intent);
}); });
binding.homeButton2.setOnClickListener(v -> { binding.homeButton2.setOnClickListener(v -> {

@ -53,7 +53,6 @@ public class MainActivity extends BaseActivity {
binding.setUser(user); binding.setUser(user);
OkGo.<Result>get(url + "/base/teamMembers/getTeamMemberList").tag(this) OkGo.<Result>get(url + "/base/teamMembers/getTeamMemberList").tag(this)
// .headers("Authorization", SharedPreferencesUtils.getstring("token", ""))
.execute(new MyRecultCall(dialog, this) { .execute(new MyRecultCall(dialog, this) {
@Override @Override
public void onSuccess(Response<Result> response) { public void onSuccess(Response<Result> response) {
@ -131,10 +130,10 @@ public class MainActivity extends BaseActivity {
// 登录 // 登录
public void login(View view) { public void login(View view) {
// if (!loginState) { if (!loginState) {
// Toast.makeText(this, "设备未注册,不允许登录", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "设备未注册,不允许登录", Toast.LENGTH_SHORT).show();
// return; return;
// } }
String teamCode = user.getTeamCode(); String teamCode = user.getTeamCode();
if (teamCode==null||teamCode.isEmpty()) return; if (teamCode==null||teamCode.isEmpty()) return;
dialog.show(); dialog.show();

@ -1,5 +1,7 @@
package com.example.aucma_mes.adapter; package com.example.aucma_mes.adapter;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -49,6 +51,14 @@ public class RepaitSubmintInfoAdapter extends RecyclerView.Adapter<RepaitSubmint
defectBeen.setIndex(position + 1); defectBeen.setIndex(position + 1);
ItemRepairInfoBinding databing = holder.getInflate1(); ItemRepairInfoBinding databing = holder.getInflate1();
databing.setVariable(BR.item, defectBeen); databing.setVariable(BR.item, defectBeen);
String processResult = defectBeen.getProcessResult();
if (processResult.equals("放行")){
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.yellow));
}else if (processResult.equals("KA")){
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.red));
}else {
databing.itemLinear.setBackgroundColor(context.getResources().getColor(R.color.item1));
}
databing.itemButtom.setOnClickListener(t -> { databing.itemButtom.setOnClickListener(t -> {
checkItemClickCall.submintRepair(position); checkItemClickCall.submintRepair(position);
}); });

@ -26,8 +26,8 @@ import okhttp3.MediaType;
public abstract class BaseActivity extends AppCompatActivity { public abstract class BaseActivity extends AppCompatActivity {
private MyBroad receiver; private MyBroad receiver;
public static String url="http://192.168.0.102:8080"; // public static String url="http://192.168.0.102:8080";
// public static String url="http://10.100.72.10:8080"; public static String url="http://10.100.72.10:8080";
public ProgressDialog dialog; public ProgressDialog dialog;
public Gson gson; public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8"); public MediaType JSON = MediaType.parse("application/json; charset=utf-8");

@ -21,6 +21,7 @@ public class DefectBeen extends BaseObservable {
private String stationCode; private String stationCode;
private String qualityDefectCode; private String qualityDefectCode;
private String qualityDefectName; private String qualityDefectName;
private String processResult;//返修结果
private String productLineName;//pda 工位名称 private String productLineName;//pda 工位名称
public String getProductLineName() { public String getProductLineName() {
@ -43,6 +44,14 @@ public class DefectBeen extends BaseObservable {
this.stationCode = stationCode; this.stationCode = stationCode;
} }
public String getProcessResult() {
return processResult;
}
public void setProcessResult(String processResult) {
this.processResult = processResult;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;

@ -4,10 +4,14 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<variable
name="title"
type="String" />
<variable <variable
name="vm" name="vm"
type="com.example.aucma_mes.vm.CheckViewModel" /> type="com.example.aucma_mes.vm.CheckViewModel" />
<import type="android.view.View" /> <import type="android.view.View" />
</data> </data>
<LinearLayout <LinearLayout
@ -16,7 +20,15 @@
android:background="@color/grey" android:background="@color/grey"
android:orientation="vertical" android:orientation="vertical"
tools:context=".CheckActivity"> tools:context=".CheckActivity">
<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 <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="43dp" android:layout_height="43dp"
@ -129,8 +141,9 @@
android:layout_height="45dp" android:layout_height="45dp"
android:layout_margin="10dp" android:layout_margin="10dp"
android:onClick="checkSubmint1" android:onClick="checkSubmint1"
android:visibility="gone"
android:text="测试" /> android:text="测试" />
<!-- -->
</LinearLayout> </LinearLayout>
</layout> </layout>

@ -144,24 +144,24 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@{user.teamName}" /> android:text="@{user.teamName}" />
</LinearLayout> </LinearLayout>
<LinearLayout <!-- <LinearLayout-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="45dp" <!-- android:layout_height="45dp"-->
android:layout_marginTop="8dp" <!-- android:layout_marginTop="8dp"-->
android:layout_marginEnd="4dp"> <!-- android:layout_marginEnd="4dp">-->
<TextView <!-- <TextView-->
style="@style/text_style1" <!-- style="@style/text_style1"-->
android:layout_width="100dp" <!-- android:layout_width="100dp"-->
android:layout_height="match_parent" <!-- android:layout_height="match_parent"-->
android:text="用户编号:" /> <!-- android:text="用户编号:" />-->
<TextView <!-- <TextView-->
style="@style/text_style1_1" <!-- style="@style/text_style1_1"-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="match_parent" <!-- android:layout_height="match_parent"-->
android:text="@{user.username}" /> <!-- android:text="@{user.username}" />-->
</LinearLayout> <!-- </LinearLayout>-->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_height="45dp"

@ -9,6 +9,7 @@
</data> </data>
<LinearLayout <LinearLayout
android:id="@+id/item_linear"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"

@ -11,4 +11,7 @@
<color name="grey">#F2F3F5</color> <color name="grey">#F2F3F5</color>
<color name="blue">#377CF9</color> <color name="blue">#377CF9</color>
<color name="item1">#DEE3E6</color>
<color name="red">#6AFF5722</color>
<color name="yellow">#FFEB3B</color>
</resources> </resources>
Loading…
Cancel
Save