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