修改 - 质检

master
wangh 11 months ago
parent 6c8659a0e1
commit a15ee5add7

1
.gitignore vendored

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

@ -10,7 +10,7 @@ android {
applicationId "com.example.aucma_mes"
minSdk 24
targetSdk 33
versionCode 1
versionCode 2
versionName "1.0"
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,11 +60,15 @@ public class BindingActivity extends BaseActivity {
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();
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", ""))
.params("boxCode", boxCode.get())
.params("innerCode", innerCode.get())
.params("loginName", SharedPreferencesUtils.getstring("loginName", ""))
.execute(new StringCallback() {
@Override
public void onSuccess(Response<String> response) {
dialog.dismiss();

@ -73,7 +73,8 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte
@Override
protected void sanInfo(String 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) {
@Override
public void onSuccess(Response<Result> response) {
@ -110,6 +111,10 @@ public class CheckActivity extends BaseActivity implements CheckAdapter.CheckIte
tipDialog.show();
}
// 测试
public void checkSubmint1(View view) {
sanInfo("B24010181060283110001");
}
// 提交
public void checkSubmint(View view) {
if (checkViewModel.getName() == null || checkViewModel.getName().isEmpty()) return;

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

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

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

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

@ -21,8 +21,15 @@ public class DefectBeen extends BaseObservable {
private String stationCode;
private String qualityDefectCode;
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) {
this.index = index;

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

@ -117,4 +117,19 @@ public class User extends BaseObservable {
this.teamName = teamName;
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:onClick="checkSubmint"
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>
</layout>

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

@ -30,24 +30,24 @@
android:textColor="@color/white"
android:textSize="20sp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="5dp"
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="@{been.companyCode}" />
</LinearLayout>
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_marginTop="5dp"-->
<!-- 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="@{been.companyCode}" />-->
<!-- </LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
@ -144,6 +144,42 @@
android:layout_height="match_parent"
android:text="@{user.teamName}" />
</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
android:id="@+id/dialog_button"

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

Loading…
Cancel
Save