原材料出库详细

master
Administrator 9 months ago
parent 5b8a8a8b20
commit 6bfb029e5e

@ -0,0 +1,67 @@
package com.example.jingyuan_mes.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.example.jingyuan_mes.BR;
import com.example.jingyuan_mes.R;
import com.example.jingyuan_mes.databinding.ItemOutInfoBinding;
import com.example.jingyuan_mes.databinding.ItemReturnInfoBinding;
import com.example.jingyuan_mes.entity.OutstockDetail;
import com.example.jingyuan_mes.entity.RawReturnDetail;
import java.util.List;
/**
* @author wanghao
* @date 2024/1/31 15:18
*/
public class MaterialOutInfoAdapter extends RecyclerView.Adapter<MaterialOutInfoAdapter.MyViewHolder> {
private List<OutstockDetail> list;
private Context context;
private LayoutInflater inflater;
public MaterialOutInfoAdapter(Context context) {
this.context = context;
inflater = LayoutInflater.from(context);
}
public void setList(List<OutstockDetail> list) {
this.list = list;
}
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ItemOutInfoBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_out_info, parent, false);
return new MyViewHolder(binding);
}
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
var item = list.get(position);
item.setIndex(position+1);
var binding = holder.binding;
binding.setVariable(BR.vm,item);
}
@Override
public int getItemCount() {
return list==null?0:list.size();
}
class MyViewHolder extends RecyclerView.ViewHolder {
private ItemOutInfoBinding binding;
public MyViewHolder(ItemOutInfoBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
}
}

@ -29,7 +29,7 @@ public class BaseActivity extends AppCompatActivity {
public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private MyReceiver myReceiver;
public String handle = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjI3MWU3ZTc2LTJjNDctNGQ3MS04NDkyLWQ1ZWQ5MzNhMTMyOCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.6V0NfRNWJFTRrccqThRKmI15FL9l1gJqbdqOlLHx8gH-kr9C6brLyZgr1PY6X7fma3L3BPEcJDv2aRis0DUAnw";
public String handle = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6ImYzZDU3MWE5LWVhY2UtNGZlYi05OGIzLWI1YjlmNWI0ZmNlYyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.IXlAZ1Byx_Ou6Szul1vy6AEpgsIMGZ97OAdpZjCbwTLoCwQ6jt2tJmxFtdL-FVl35zrAFqNHMPe-oxr5kaGY8A";
public Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {

@ -1,5 +1,7 @@
package com.example.jingyuan_mes.entity;
import java.util.List;
public class Outstock {
@ -34,6 +36,15 @@ public class Outstock {
private String applyBy;
private String applyDate;
private String warehouseName;
private List<OutstockDetail> wmsRawOutstockDetailList;
public List<OutstockDetail> getWmsRawOutstockDetailList() {
return wmsRawOutstockDetailList;
}
public void setWmsRawOutstockDetailList(List<OutstockDetail> wmsRawOutstockDetailList) {
this.wmsRawOutstockDetailList = wmsRawOutstockDetailList;
}
public int getRawOutstockId() {
return rawOutstockId;

@ -141,6 +141,15 @@ public class OutstockDetail {
private String taskType;
private String taskCode;
private int index;
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public void setRawOutstockDetailId(Long rawOutstockDetailId) {
this.rawOutstockDetailId = rawOutstockDetailId;

@ -8,26 +8,36 @@ import android.view.View;
import android.widget.Toast;
import com.example.jingyuan_mes.R;
import com.example.jingyuan_mes.adapter.MaterialOutInfoAdapter;
import com.example.jingyuan_mes.adapter.RawReturnInfoAdapter;
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.ActivityMaterialOutBinding;
import com.example.jingyuan_mes.databinding.ActivityMaterialOutInfoBinding;
import com.example.jingyuan_mes.entity.OutStoreAudit;
import com.example.jingyuan_mes.entity.Outstock;
import com.example.jingyuan_mes.entity.RawReturn;
import com.example.jingyuan_mes.entity.RawReturnDetail;
import com.example.jingyuan_mes.uitls.SharedPreferencesUtils;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import java.util.List;
import okhttp3.RequestBody;
public class MaterialOutInfoActivity extends BaseActivity {
private OutStoreAudit auditStatus;
private ActivityMaterialOutInfoBinding binding;
private MaterialOutInfoAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_material_out_info);
binding.setTitle("出库审批");
adapter=new MaterialOutInfoAdapter(this);
binding.setAdapter(adapter);
}
@Override
@ -41,16 +51,22 @@ public class MaterialOutInfoActivity extends BaseActivity {
auditStatus=new OutStoreAudit();
var id = getIntent().getIntExtra("id", 0);
auditStatus.setRawOutstockId(id);
// OkGo.<MyResult>get(url+"/wms/mobile/getRawOutstockByOutstockId/"+id)
// .tag(this)
// .headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
// .execute(new MyRecultCall(dialog,this){
// @Override
// public void onSuccess(Response<MyResult> response) {
// super.onSuccess(response);
//
// }
// });
OkGo.<MyResult>get(url+"/wms/mobile/getRawOutstockByOutstockId/"+id)
.tag(this)
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.execute(new MyRecultCall(dialog,this){
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
var data = body.getData();
if (data !=null){
Outstock rawReturn=gson.fromJson(data.toString(),Outstock.class);
adapter.setList(rawReturn.getWmsRawOutstockDetailList());
adapter.notifyDataSetChanged();
}
}
});
}

@ -6,6 +6,7 @@ import androidx.databinding.ViewDataBinding;
import android.content.pm.LauncherApps;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.example.jingyuan_mes.R;
@ -23,11 +24,15 @@ import com.lzy.okgo.model.Response;
import java.util.List;
import okhttp3.RequestBody;
public class StockreturnConfirmInfoActivity extends BaseActivity {
private RawReturnInfoAdapter adapter;
private RawReturnDetail sub;
private List<RawReturnDetail> wmsRawReturnDetailList;
private ActivityStockreturnConfirmInfoBinding binding;
private long id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -36,7 +41,8 @@ public class StockreturnConfirmInfoActivity extends BaseActivity {
adapter = new RawReturnInfoAdapter(this);
binding.setAdapter(adapter);
sub = new RawReturnDetail();
var id = getIntent().getLongExtra("id", 0L);
id = getIntent().getLongExtra("id", 0L);
sub.setRawReturnId(id);
binding.setSub(sub);
@ -62,4 +68,21 @@ public class StockreturnConfirmInfoActivity extends BaseActivity {
}
});
}
public void returnConfirmSubmit(View view) {
OkGo.<MyResult>post(url + "/wms/mobile/confirmRawReturn")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.upRequestBody(RequestBody.create(JSON, gson.toJson(sub)))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
initRequest(id);
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
}

@ -9,7 +9,7 @@
type="String" />
<variable
name="adapter"
type="String" />
type="com.example.jingyuan_mes.adapter.MaterialOutInfoAdapter" />
</data>
<LinearLayout
@ -20,7 +20,7 @@
<include
layout="@layout/toolbar"
app:title="@{title}" />
app:title='@{title??"出库审批"}' />
<LinearLayout
android:layout_width="match_parent"

@ -195,7 +195,7 @@
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_margin="12dp"
android:onClick="outPassSubmit"
android:onClick="returnConfirmSubmit"
android:text="提交" />
</LinearLayout>
</layout>

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="vm"
type="com.example.jingyuan_mes.entity.OutstockDetail" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="2dp"
android:background="@color/item_bg"
android:paddingStart="10dp"
android:paddingEnd="10dp">
<TextView
style="@style/item_title"
android:layout_width="35dp"
android:layout_height="match_parent"
android:text="@{String.valueOf(vm.index)}" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/white"/>
<TextView
style="@style/item_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:text="@{vm.materialBarcode}" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/white"/>
<TextView
style="@style/item_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3"
android:text="@{vm.locationCode}" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/white"/>
<TextView
style="@style/item_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3"
android:text="@{String.valueOf(vm.planAmount)}" />
</LinearLayout>
</layout>

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_marginTop="2dp"
android:layout_width="match_parent"
android:layout_height="44dp"
android:background="#DEE3E6">
<TextView
android:id="@+id/item_index"
android:layout_width="71dp"
android:layout_height="match_parent"
android:text="01"
style="@style/item_text_style" />
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="01"
style="@style/item_text_style" />
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/item_buttom"
android:layout_width="76dp"
android:layout_height="match_parent"
android:text="删除"
android:textColor="#E71717"
style="@style/item_text_style" />
</LinearLayout>
Loading…
Cancel
Save