From 981abffcfdbf311ef82dbdc1f303891528f3eb5a Mon Sep 17 00:00:00 2001 From: wanghao Date: Thu, 31 Oct 2024 15:58:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=A4=96=E5=8D=8F?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E4=B8=8A=E4=BC=A0=E3=80=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=95=85=E9=9A=9C=E7=B1=BB=E5=88=AB=E4=BC=A0=E5=8F=82=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jingyuan_mes/device/BxActivity.java | 25 +++++++++++++++++++ .../entity/device/BxSubmitBeen.java | 10 +++++--- app/src/main/res/layout/activity_bx.xml | 1 + 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/example/jingyuan_mes/device/BxActivity.java b/app/src/main/java/com/example/jingyuan_mes/device/BxActivity.java index c2f292f..6e3fba6 100644 --- a/app/src/main/java/com/example/jingyuan_mes/device/BxActivity.java +++ b/app/src/main/java/com/example/jingyuan_mes/device/BxActivity.java @@ -36,6 +36,7 @@ import com.example.jingyuan_mes.entity.device.BxSubmitBeen; import com.example.jingyuan_mes.entity.device.DeviceBeen; import com.example.jingyuan_mes.entity.device.Dict; import com.example.jingyuan_mes.entity.device.MaintainBeen; +import com.example.jingyuan_mes.entity.device.Outsourcing; import com.example.jingyuan_mes.entity.store.PdaRouters; import com.example.jingyuan_mes.uitls.SharedPreferencesUtils; import com.google.gson.reflect.TypeToken; @@ -52,6 +53,9 @@ import java.util.Date; import java.util.List; import java.util.Optional; +/** + * 故障报修 + */ public class BxActivity extends BaseActivity implements DisposalFileAdapter.ItemClickCall { private DisposalFileAdapter adapter; private List filesList; @@ -73,6 +77,7 @@ public class BxActivity extends BaseActivity implements DisposalFileAdapter.Item adapter.setList(filesList); binding.setAdapter1(adapter); been = new BxSubmitBeen(); + outStrRequest(); binding.setVm(been); initRequest("dms_fault_type"); lpw = new ListPopupWindow(this); @@ -98,6 +103,26 @@ public class BxActivity extends BaseActivity implements DisposalFileAdapter.Item }); imgDialog = new ImgDialog(this); } + // 查询外协 + private void outStrRequest() { + OkGo.get(url + "/dms/mobile/getOutsrcInfos").tag(this) + .headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")) + .execute(new MyRecultCall(dialog, this) { + @Override + public void onSuccess(Response response) { + super.onSuccess(response); + var body = response.body(); + if (body.getCode() == 200) { + List outsourcingList=gson.fromJson(body.getData().toString(),new TypeToken>() { + }.getType()); + been.setOutsourcingList(outsourcingList); + return; + } + // Toast.makeText(BxActivity.this, "", Toast.LENGTH_SHORT).show(); + } + }); + + } // 维修 private void initRequest(String uri) { diff --git a/app/src/main/java/com/example/jingyuan_mes/entity/device/BxSubmitBeen.java b/app/src/main/java/com/example/jingyuan_mes/entity/device/BxSubmitBeen.java index 297a086..30da2e5 100644 --- a/app/src/main/java/com/example/jingyuan_mes/entity/device/BxSubmitBeen.java +++ b/app/src/main/java/com/example/jingyuan_mes/entity/device/BxSubmitBeen.java @@ -16,7 +16,7 @@ import java.util.List; public class BxSubmitBeen extends BaseObservable { private int deviceld; - private int faultType; + private String faultType; private String faultDescription; private String designOperations; private int repairType; @@ -84,11 +84,11 @@ public class BxSubmitBeen extends BaseObservable { this.deviceld = deviceld; } - public int getFaultType() { + public String getFaultType() { return faultType; } - public void setFaultType(int faultType) { + public void setFaultType(String faultType) { this.faultType = faultType; } @@ -100,6 +100,10 @@ public class BxSubmitBeen extends BaseObservable { this.faultDescription = faultDescription; } + public void selectFaultDescription(AdapterView parent, View view, int position, long id) { + this.faultType = faultTypeList.get(position).getDictValue(); + } + public String getDesignOperations() { return designOperations; } diff --git a/app/src/main/res/layout/activity_bx.xml b/app/src/main/res/layout/activity_bx.xml index 945320f..fa78062 100644 --- a/app/src/main/res/layout/activity_bx.xml +++ b/app/src/main/res/layout/activity_bx.xml @@ -136,6 +136,7 @@ android:layout_height="match_parent" android:entries="@{vm.faultTypeS}" android:spinnerMode="dropdown" + android:onItemSelected="@{vm.selectFaultDescription}" android:textAlignment="center"/>