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"/>