diff --git a/app/src/main/java/com/example/jingyuan_mes/check/CheckDisposalActivity.java b/app/src/main/java/com/example/jingyuan_mes/check/CheckDisposalActivity.java index dcf2120..5b79be2 100644 --- a/app/src/main/java/com/example/jingyuan_mes/check/CheckDisposalActivity.java +++ b/app/src/main/java/com/example/jingyuan_mes/check/CheckDisposalActivity.java @@ -67,35 +67,44 @@ public class CheckDisposalActivity extends BaseActivity implements DisposalFileA } private void initRequest() { - OkGo.get(url + "/qms/mobile/getCheckResult4Handle").tag(this).headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")).params("checkResultId", 2).params("materialBatch", "123").params("checkMode", 1).params("checkSample", "10").params("materialCode", "111").params("materialName", "物料测试").execute(new MyRecultCall(dialog, this) { - @Override - public void onSuccess(Response response) { - super.onSuccess(response); - var body = response.body(); - if (body.getCode() == 200) { - CheckDisposalBeen been = gson.fromJson(body.getData().toString(), CheckDisposalBeen.class); - binding.setVm(been); - - infoList = been.getQmsQualityInstanceActivities(); - infoAdapter.setList(infoList); - infoAdapter.notifyDataSetChanged(); - filesList = been.getQmsCheckInstanceFiles(); - if (filesList == null || filesList.isEmpty()) { - binding.disposalFileAdd.setVisibility(View.VISIBLE); - filesList = new ArrayList<>(); - files = new ArrayList<>(); - fileAdapter.setList(filesList); - } else { - binding.disposalFileAdd.setVisibility(View.GONE); - // files = new ArrayList<>(); - fileAdapter.setList(filesList); - fileAdapter.notifyDataSetChanged(); + var intent = getIntent(); + OkGo.get(url + "/qms/mobile/getCheckResult4Handle").tag(this) + .headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")) + .params("checkResultId", intent.getIntExtra("checkResultId",0)) + .params("materialBatch", intent.getStringExtra("materialBatch")) + .params("checkMode", intent.getStringExtra("checkMode")) + .params("checkSample", intent.getStringExtra("checkSample")) + .params("materialCode", intent.getStringExtra("materialCode")) + .params("materialName", intent.getStringExtra("materialName")) + .params("checkRuleType", intent.getStringExtra("checkRuleType")) + .execute(new MyRecultCall(dialog, this) { + @Override + public void onSuccess(Response response) { + super.onSuccess(response); + var body = response.body(); + if (body.getCode() == 200) { + CheckDisposalBeen been = gson.fromJson(body.getData().toString(), CheckDisposalBeen.class); + binding.setVm(been); + + infoList = been.getQmsQualityInstanceActivities(); + infoAdapter.setList(infoList); + infoAdapter.notifyDataSetChanged(); + filesList = been.getQmsCheckInstanceFiles(); + if (filesList == null || filesList.isEmpty()) { + binding.disposalFileAdd.setVisibility(View.VISIBLE); + filesList = new ArrayList<>(); + files = new ArrayList<>(); + fileAdapter.setList(filesList); + } else { + binding.disposalFileAdd.setVisibility(View.GONE); + fileAdapter.setList(filesList); + fileAdapter.notifyDataSetChanged(); + } + + } + Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show(); } - - } - Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show(); - } - }); + }); } // 图片的点击 @@ -189,7 +198,7 @@ public class CheckDisposalActivity extends BaseActivity implements DisposalFileA super.onSuccess(response); var body = response.body(); if (body.getCode() == 200) { - // finish(); + finish(); } Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/com/example/jingyuan_mes/check/CheckSelectActivity.java b/app/src/main/java/com/example/jingyuan_mes/check/CheckSelectActivity.java index 78644b2..d89d147 100644 --- a/app/src/main/java/com/example/jingyuan_mes/check/CheckSelectActivity.java +++ b/app/src/main/java/com/example/jingyuan_mes/check/CheckSelectActivity.java @@ -95,6 +95,7 @@ public class CheckSelectActivity extends BaseActivity implements ItemClickCall { intent1.putExtra("materialBatch", materialBatch); intent1.putExtra("materialCode",checkResult.getMaterialCode()); intent1.putExtra("materialName",checkResult.getMaterialName()); + intent1.putExtra("checkRuleType",checkResult.getCheckRuleType()); startActivity(intent1); } diff --git a/app/src/main/java/com/example/jingyuan_mes/entity/check/CheckDisposalBeen.java b/app/src/main/java/com/example/jingyuan_mes/entity/check/CheckDisposalBeen.java index 4571025..a4bdccb 100644 --- a/app/src/main/java/com/example/jingyuan_mes/entity/check/CheckDisposalBeen.java +++ b/app/src/main/java/com/example/jingyuan_mes/entity/check/CheckDisposalBeen.java @@ -34,19 +34,7 @@ public class CheckDisposalBeen { * @return */ public String getCheckRuleType() { - if (checkRuleType==null){ - return null; - } - switch (checkRuleType) { - case "1": - return "来料检验"; - case "2": - return "半成品检验"; - case "3": - return "成品检验"; - case "4": - return "工序检验"; - } + return checkRuleType; }