From 2dfe874e55c2b595e6dcf612eaed59d888ad5999 Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Tue, 2 Apr 2024 09:09:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E7=A7=BB=E5=BA=93?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/store/RelocationApplyBeen.java | 50 +++++++++++-------- .../store/RelocationApplyActivity.java | 26 ++++++++++ .../res/layout/activity_relocation_apply.xml | 1 + 3 files changed, 56 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/example/jingyuan_mes/entity/store/RelocationApplyBeen.java b/app/src/main/java/com/example/jingyuan_mes/entity/store/RelocationApplyBeen.java index b76a303..0711bf6 100644 --- a/app/src/main/java/com/example/jingyuan_mes/entity/store/RelocationApplyBeen.java +++ b/app/src/main/java/com/example/jingyuan_mes/entity/store/RelocationApplyBeen.java @@ -7,31 +7,39 @@ import androidx.databinding.BaseObservable; * @date 2024/4/1 16:54 */ public class RelocationApplyBeen extends BaseObservable { - private String targetLocationCode; - private String oriLocationCode; - private String moveType; + private String targetLocationCode; + private String oriLocationCode; + private String moveType; - public String getTargetLocationCode() { - return targetLocationCode; - } + public String getTargetLocationCode() { + return targetLocationCode; + } - public void setTargetLocationCode(String targetLocationCode) { - this.targetLocationCode = targetLocationCode; - } + public void setTargetLocationCode(String targetLocationCode) { + this.targetLocationCode = targetLocationCode; + } - public String getOriLocationCode() { - return oriLocationCode; - } + public String getOriLocationCode() { + return oriLocationCode; + } - public void setOriLocationCode(String oriLocationCode) { - this.oriLocationCode = oriLocationCode; - } + public void setOriLocationCode(String oriLocationCode) { + this.oriLocationCode = oriLocationCode; + } - public String getMoveType() { - return moveType; - } + public String getMoveType() { + return moveType; + } + + public void setMoveType(String moveType) { + this.moveType = moveType; + } + + + public void clear() { + this.targetLocationCode = null; + this.oriLocationCode = null; + notifyChange(); + } - public void setMoveType(String moveType) { - this.moveType = moveType; - } } diff --git a/app/src/main/java/com/example/jingyuan_mes/store/RelocationApplyActivity.java b/app/src/main/java/com/example/jingyuan_mes/store/RelocationApplyActivity.java index 0f9e0e7..f47c6a7 100644 --- a/app/src/main/java/com/example/jingyuan_mes/store/RelocationApplyActivity.java +++ b/app/src/main/java/com/example/jingyuan_mes/store/RelocationApplyActivity.java @@ -4,11 +4,20 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import android.os.Bundle; +import android.view.View; +import android.widget.Toast; import com.example.jingyuan_mes.R; import com.example.jingyuan_mes.base.BaseActivity; +import com.example.jingyuan_mes.base.MyRecultCall; +import com.example.jingyuan_mes.base.MyResult; import com.example.jingyuan_mes.databinding.ActivityRelocationApplyBinding; import com.example.jingyuan_mes.entity.store.RelocationApplyBeen; +import com.example.jingyuan_mes.uitls.SharedPreferencesUtils; +import com.lzy.okgo.OkGo; +import com.lzy.okgo.model.Response; + +import okhttp3.RequestBody; public class RelocationApplyActivity extends BaseActivity { private RelocationApplyBeen relocationApplyBeen; @@ -23,4 +32,21 @@ public class RelocationApplyActivity extends BaseActivity { binding.setTitle(moveType.equals("1")?"移库申请":"合库申请"); binding.setVm(relocationApplyBeen); } + + public void relocationApplySubmit(View view){ + OkGo.post(url+"/wms/mobile/applyMove") + .headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")) + .upRequestBody(RequestBody.create(JSON,gson.toJson(relocationApplyBeen))) + .execute(new MyRecultCall(dialog,this){ + @Override + public void onSuccess(Response response) { + super.onSuccess(response); + var body = response.body(); + if (body.getCode()==200){ + relocationApplyBeen.clear(); + } + Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show(); + } + }); + } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_relocation_apply.xml b/app/src/main/res/layout/activity_relocation_apply.xml index db57d61..d81033d 100644 --- a/app/src/main/res/layout/activity_relocation_apply.xml +++ b/app/src/main/res/layout/activity_relocation_apply.xml @@ -62,6 +62,7 @@ android:layout_height="50dp" android:layout_marginTop="200dp" android:layout_gravity="center" + android:onClick="relocationApplySubmit" android:text="提交申请"/> \ No newline at end of file