修改 - 质检

master
wangh 11 months ago
parent 6c8659a0e1
commit a15ee5add7

1
.gitignore vendored

@ -9,6 +9,7 @@
/.idea/assetWizardSettings.xml /.idea/assetWizardSettings.xml
.DS_Store .DS_Store
/build /build
/release
/captures /captures
.externalNativeBuild .externalNativeBuild
.cxx .cxx

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

@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.example.aucma_mes",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 2,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}

@ -60,32 +60,36 @@ public class BindingActivity extends BaseActivity {
public void click1(View view) { public void click1(View view) {
if (boxCode.get() == null || innerCode.get() == null ||materialName.get()==null ) return; if (boxCode.get() == null || innerCode.get() == null || materialName.get() == null) return;
dialog.show(); dialog.show();
String s = title.equals("壳胆绑定") ? "/api/boxBanding" : "/api/barCodeBanding"; String s = title.equals("壳胆绑定") ? "/api/boxBanding" : "/api/barCodeBanding";
OkGo.<String>post(url + s).tag(this).headers("Authorization", SharedPreferencesUtils.getstring("token", "")).params("boxCode", boxCode.get()).params("innerCode", innerCode.get()).params("loginName", SharedPreferencesUtils.getstring("loginName", "")).execute(new StringCallback() { OkGo.<String>post(url + s).tag(this).headers("Authorization", SharedPreferencesUtils.getstring("token", ""))
@Override .params("boxCode", boxCode.get())
public void onSuccess(Response<String> response) { .params("innerCode", innerCode.get())
dialog.dismiss(); .params("loginName", SharedPreferencesUtils.getstring("loginName", ""))
.execute(new StringCallback() {
Result result = gson.fromJson(response.body(), Result.class); @Override
if (result.getCode() == 200) { public void onSuccess(Response<String> response) {
Toast.makeText(BindingActivity.this, "绑定成功", Toast.LENGTH_SHORT).show(); dialog.dismiss();
boxCode.set("");
innerCode.set(""); Result result = gson.fromJson(response.body(), Result.class);
materialName.set(""); if (result.getCode() == 200) {
} else { Toast.makeText(BindingActivity.this, "绑定成功", Toast.LENGTH_SHORT).show();
Toast.makeText(BindingActivity.this, result.getMsg(), Toast.LENGTH_SHORT).show(); boxCode.set("");
} innerCode.set("");
} materialName.set("");
} else {
@Override Toast.makeText(BindingActivity.this, result.getMsg(), Toast.LENGTH_SHORT).show();
public void onError(Response<String> response) { }
super.onError(response); }
Toast.makeText(BindingActivity.this, "网路连接错误", Toast.LENGTH_SHORT).show();
} @Override
}); public void onError(Response<String> response) {
super.onError(response);
Toast.makeText(BindingActivity.this, "网路连接错误", Toast.LENGTH_SHORT).show();
}
});
} }
public void click2(View view) { public void click2(View view) {

@ -73,7 +73,8 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte
@Override @Override
protected void sanInfo(String code) { protected void sanInfo(String code) {
checkViewModel.setCode(code); checkViewModel.setCode(code);
OkGo.<Result>post(url + "/api/check/select").tag(this).headers("Authorization", SharedPreferencesUtils.getstring("token", "")) OkGo.<Result>post(url + "/api/check/select").tag(this)
.headers("Authorization", SharedPreferencesUtils.getstring("token", ""))
.params("code", code).execute(new MyRecultCall(dialog, this) { .params("code", code).execute(new MyRecultCall(dialog, this) {
@Override @Override
public void onSuccess(Response<Result> response) { public void onSuccess(Response<Result> response) {
@ -110,6 +111,10 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte
tipDialog.show(); tipDialog.show();
} }
// 测试
public void checkSubmint1(View view) {
sanInfo("B24010181060283110001");
}
// 提交 // 提交
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;

@ -34,23 +34,21 @@ public class HomePageActivity extends AppCompatActivity {
roles = intent1.getStringArrayListExtra("role"); roles = intent1.getStringArrayListExtra("role");
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); // Log.e("TAG", "onCreate:" + infoBeen.getUserPermission());
InfoDialog infoDialog = new InfoDialog(this); InfoDialog infoDialog = new InfoDialog(this);
String stationCode = null;
try { try {
User user = infoBeen.getUser(); User user = infoBeen.getUser();
user.setUsername(SharedPreferencesUtils.getstring("loginName", ""));
user.setTeamName(SharedPreferencesUtils.getstring("teamName", null)); user.setTeamName(SharedPreferencesUtils.getstring("teamName", null));
user.setTeamCode(SharedPreferencesUtils.getstring("teamCode", null)); user.setTeamCode(SharedPreferencesUtils.getstring("teamCode", null));
stationCode = user.getStationCode();
infoDialog.setInfoData(infoBeen, user); infoDialog.setInfoData(infoBeen, user);
String finalStationCode = stationCode;
binding.homeButton1.setOnClickListener(v -> { binding.homeButton1.setOnClickListener(v -> {
if (!roles.contains("quality_inspection")) { if (!roles.contains("quality_inspection")) {
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
return; return;
} }
intent = new Intent(this, CheckActivity.class); intent = new Intent(this, CheckActivity.class);
intent.putExtra("stationCode", finalStationCode); intent.putExtra("stationCode", user.getStationCode());
startActivity(intent); startActivity(intent);
}); });
binding.homeButton2.setOnClickListener(v -> { binding.homeButton2.setOnClickListener(v -> {
@ -67,7 +65,10 @@ public class HomePageActivity extends AppCompatActivity {
Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "暂无权限", Toast.LENGTH_SHORT).show();
return; return;
} }
// 返修
intent = new Intent(this, RepairActivity.class); intent = new Intent(this, RepairActivity.class);
intent.putExtra("userPermission",infoBeen.getUserPermission());
intent.putExtra("stationName",user.getStationName());
startActivity(intent); startActivity(intent);
}); });
binding.homeButton4.setOnClickListener(v -> { binding.homeButton4.setOnClickListener(v -> {

@ -45,9 +45,10 @@ public class MainActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main); ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
String loginName = SharedPreferencesUtils.getstring("loginName", "");
user = new User(); user = new User();
// user.setUsername("pda02"); user.setUsername(loginName);
// user.setPassword("123456"); user.setPassword("123456");
getSupportActionBar().hide(); // 隐藏原生标题栏 getSupportActionBar().hide(); // 隐藏原生标题栏
binding.setUser(user); binding.setUser(user);
@ -71,7 +72,7 @@ public class MainActivity extends BaseActivity {
@Override @Override
protected void sanInfo(String code) { protected void sanInfo(String code) {
Log.e("TAG", "扫描测试结果:" + code);
} }
// 查询PDA Mac 地址列表 // 查询PDA Mac 地址列表
@ -85,7 +86,9 @@ public class MainActivity extends BaseActivity {
List<RegisterPda> pdaList = gson.fromJson(gson.toJson(result.getData()), new TypeToken<List<RegisterPda>>() { List<RegisterPda> pdaList = gson.fromJson(gson.toJson(result.getData()), new TypeToken<List<RegisterPda>>() {
}.getType()); }.getType());
RegisterPda registerPda = new RegisterPda(); RegisterPda registerPda = new RegisterPda();
registerPda.setSerialCode(getMacAddress()); String macAddress = getMacAddress();
Log.e("TAG", "本机MAC:" + macAddress);
registerPda.setSerialCode(macAddress);
int index = pdaList.indexOf(registerPda); int index = pdaList.indexOf(registerPda);
loginState = index > -1; loginState = index > -1;
if (loginState) { if (loginState) {
@ -128,10 +131,12 @@ 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();
if (teamCode==null||teamCode.isEmpty()) return;
dialog.show(); dialog.show();
MediaType JSON = MediaType.parse("application/json; charset=utf-8"); MediaType JSON = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, gson.toJson(user)); RequestBody body = RequestBody.create(JSON, gson.toJson(user));

@ -39,15 +39,18 @@ public class RepairActivity extends BaseActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().hide();
binding = DataBindingUtil.setContentView(this, R.layout.activity_repair); binding = DataBindingUtil.setContentView(this, R.layout.activity_repair);
adapter = new RepairAdapter(this); adapter = new RepairAdapter(this);
repairVm = new RepairVm(); repairVm = new RepairVm();
binding.setTitle("质量返修 — "+getIntent().getStringExtra("stationName"));
binding.setVm(repairVm); binding.setVm(repairVm);
submitList = new ArrayList<>(); submitList = new ArrayList<>();
binding.recyclerView.setAdapter(adapter); binding.recyclerView.setAdapter(adapter);
//查询返修措施 //查询返修措施
OkGo.<Result>get(url + "/report/repairMeasures/getRepairMeasures").tag(this) OkGo.<Result>get(url + "/report/repairMeasures/getRepairMeasures").tag(this)
.headers("Authorization", SharedPreferencesUtils.getstring("token", "")) .headers("Authorization", SharedPreferencesUtils.getstring("token", ""))
.params("userPermission",getIntent().getIntExtra("userPermission",-1))
.execute(new MyRecultCall(dialog, this) { .execute(new MyRecultCall(dialog, this) {
@Override @Override
public void onSuccess(Response<Result> response) { public void onSuccess(Response<Result> response) {

@ -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://172.20.10.2: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,8 +21,15 @@ 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 productLineName;//pda 工位名称
public String getProductLineName() {
return productLineName;
}
public void setProductLineName(String productLineName) {
this.productLineName = productLineName;
}
public void setIndex(int index) { public void setIndex(int index) {
this.index = index; this.index = index;

@ -12,6 +12,7 @@ public class LoginInfoBeen {
public String factoryCode; public String factoryCode;
public String companyName; public String companyName;
public String factoryName; public String factoryName;
public int userPermission;
public User user; public User user;
public String getCompanyCode() { public String getCompanyCode() {
@ -54,6 +55,14 @@ public class LoginInfoBeen {
this.user = user; this.user = user;
} }
public int getUserPermission() {
return userPermission;
}
public void setUserPermission(int userPermission) {
this.userPermission = userPermission;
}
@Override @Override
public String toString() { public String toString() {
return "LoginInfoBeen{" + return "LoginInfoBeen{" +

@ -117,4 +117,19 @@ public class User extends BaseObservable {
this.teamName = teamName; this.teamName = teamName;
notifyChange(); notifyChange();
} }
@Override
public String toString() {
return "User{" +
"username='" + username + '\'' +
", password='" + password + '\'' +
", list=" + list +
", teamBeens=" + teamBeens +
", nickName='" + nickName + '\'' +
", stationCode='" + stationCode + '\'' +
", stationName='" + stationName + '\'' +
", teamCode='" + teamCode + '\'' +
", teamName='" + teamName + '\'' +
'}';
}
} }

@ -122,5 +122,15 @@
android:layout_margin="10dp" android:layout_margin="10dp"
android:onClick="checkSubmint" android:onClick="checkSubmint"
android:text="提交" /> android:text="提交" />
<Button
style="@style/button_true_style"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_margin="10dp"
android:onClick="checkSubmint1"
android:text="测试" />
</LinearLayout> </LinearLayout>
</layout> </layout>

@ -8,6 +8,9 @@
<variable <variable
name="vm" name="vm"
type="com.example.aucma_mes.vm.RepairVm" /> type="com.example.aucma_mes.vm.RepairVm" />
<variable
name="title"
type="String" />
</data> </data>
<LinearLayout <LinearLayout
@ -17,6 +20,16 @@
tools:context=".RepairActivity" tools:context=".RepairActivity"
android:orientation="vertical"> android:orientation="vertical">
<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"

@ -30,24 +30,24 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp"/> android:textSize="20sp"/>
<LinearLayout <!-- <LinearLayout-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="45dp" <!-- android:layout_height="45dp"-->
android:layout_marginTop="5dp" <!-- android:layout_marginTop="5dp"-->
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="@{been.companyCode}" /> <!-- android:text="@{been.companyCode}" />-->
</LinearLayout> <!-- </LinearLayout>-->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -144,6 +144,42 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@{user.teamName}" /> android:text="@{user.teamName}" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_style1"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="用户编号:" />
<TextView
style="@style/text_style1_1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{user.username}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_style1"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="用户名称:" />
<TextView
style="@style/text_style1_1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{user.nickName}" />
</LinearLayout>
<Button <Button
android:id="@+id/dialog_button" android:id="@+id/dialog_button"

@ -10,7 +10,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="44dp" android:layout_height="wrap_content"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:background="#DEE3E6" android:background="#DEE3E6"
android:orientation="horizontal"> android:orientation="horizontal">
@ -18,7 +18,7 @@
<TextView <TextView
android:id="@+id/item_index" android:id="@+id/item_index"
style="@style/item_text_style" style="@style/item_text_style"
android:layout_width="35dp" android:layout_width="30dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text='@{item.index+""}' /> android:text='@{item.index+""}' />
@ -27,11 +27,18 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" /> android:background="@color/white" />
<!-- <TextView-->
<!-- style="@style/item_text_style"-->
<!-- android:layout_width="65dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:text="@{item.qualityDefectCode}" /> -->
<TextView <TextView
style="@style/item_text_style" style="@style/item_text_style"
android:layout_width="65dp" android:layout_width="105dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:text="@{item.qualityDefectCode}" /> android:minHeight="44dp"
android:layout_gravity="center"
android:text="@{item.productLineName}" />
<View <View
android:layout_width="2dp" android:layout_width="2dp"
@ -40,9 +47,12 @@
<TextView <TextView
style="@style/item_text_style" style="@style/item_text_style"
android:layout_width="145dp" android:layout_width="110dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:minHeight="44dp"
android:layout_gravity="center"
android:paddingStart="1dp"
android:paddingEnd="1dp"
android:text="@{item.qualityDefectName}" android:text="@{item.qualityDefectName}"
tools:ignore="InefficientWeight" /> tools:ignore="InefficientWeight" />
@ -54,9 +64,10 @@
<TextView <TextView
android:id="@+id/item_buttom" android:id="@+id/item_buttom"
style="@style/item_text_style" style="@style/item_text_style"
android:layout_width="60dp" android:layout_width="50dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="下返修" android:text="下返修"
android:textSize="15sp"
android:textColor="#E71717" /> android:textColor="#E71717" />

Loading…
Cancel
Save