提交 d1c55407 authored 作者: lgd's avatar lgd

1.入库详情显示

上级 ab84b50a
...@@ -147,6 +147,15 @@ public class AddStockBean { ...@@ -147,6 +147,15 @@ public class AddStockBean {
private Object qiAuditBy; private Object qiAuditBy;
private Object qiAuditTime; private Object qiAuditTime;
private Object qiAuditByName; private Object qiAuditByName;
private String image;
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public int getCreatedBy() { public int getCreatedBy() {
return createdBy; return createdBy;
......
...@@ -265,7 +265,7 @@ public class AddStockApplyAddActivity extends WorkToolBarActivity { ...@@ -265,7 +265,7 @@ public class AddStockApplyAddActivity extends WorkToolBarActivity {
for (int i = 0; i < imgList.size() - 1; i++) { for (int i = 0; i < imgList.size() - 1; i++) {
image.append(imgList.get(i).getPath()).append(","); image.append(imgList.get(i).getPath()).append(",");
} }
param.put("image", image.substring(0, image.length())); param.put("image", image.substring(0, image.length()-1));
observable = RtfUtils.getRtf().addPoStockApplyAdd(getIntent().getStringExtra("id"), WorkUtils.convertMapToBody(param)); observable = RtfUtils.getRtf().addPoStockApplyAdd(getIntent().getStringExtra("id"), WorkUtils.convertMapToBody(param));
} else if (TextUtils.equals(orderType, OrderType.SUPPLIER.getCode())) { } else if (TextUtils.equals(orderType, OrderType.SUPPLIER.getCode())) {
observable = RtfUtils.getRtf().addFoStockApplyAdd(getIntent().getStringExtra("id"), WorkUtils.convertMapToBody(param)); observable = RtfUtils.getRtf().addFoStockApplyAdd(getIntent().getStringExtra("id"), WorkUtils.convertMapToBody(param));
......
...@@ -6,20 +6,25 @@ import android.view.LayoutInflater; ...@@ -6,20 +6,25 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean; import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity; import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.AddStockBean; import com.wd.workoffice.bean.AddStockBean;
import com.wd.workoffice.bean.AddStockChooseBean; import com.wd.workoffice.bean.AddStockChooseBean;
import com.wd.workoffice.bean.event.CheckAddStockEvent; import com.wd.workoffice.bean.event.CheckAddStockEvent;
import com.wd.workoffice.bean.mesBean.ImageBean;
import com.wd.workoffice.bean.workEnum.OrderType; import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.retrofit.RtfUtils; import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver; import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.mes.ImageActivity;
import com.wd.workoffice.ui.adapter.AddStockCrucibleChooseAdapter; import com.wd.workoffice.ui.adapter.AddStockCrucibleChooseAdapter;
import com.wd.workoffice.ui.adapter.AddStockSendApplyAdapter; import com.wd.workoffice.ui.adapter.ImgAdapter;
import com.wd.workoffice.util.HwObsUtil;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -29,6 +34,7 @@ import java.util.List; ...@@ -29,6 +34,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView; import butterknife.BindView;
...@@ -75,25 +81,52 @@ public class AddStockApplyDetailActivity extends WorkToolBarActivity { ...@@ -75,25 +81,52 @@ public class AddStockApplyDetailActivity extends WorkToolBarActivity {
RecyclerView rvData; RecyclerView rvData;
@BindView(R.id.ll_stock) @BindView(R.id.ll_stock)
LinearLayout llStock; LinearLayout llStock;
@BindView(R.id.rl_box_num)
RelativeLayout rlBoxNum;
@BindView(R.id.rv_img)
RecyclerView rvImg;
private AddStockBean.RecordsBean info; private AddStockBean.RecordsBean info;
private String orderType; private String orderType;
private List<AddStockChooseBean.RecordsBean> productList; private List<AddStockChooseBean.RecordsBean> productList;
private AddStockCrucibleChooseAdapter productAdapter; private AddStockCrucibleChooseAdapter productAdapter;
private List<ImageBean> imgList;
private ImgAdapter imgAdapter;
@Override @Override
protected void initView() { protected void initView() {
ButterKnife.bind(this); ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this,RecyclerView.VERTICAL,false)); rvImg.setLayoutManager(new GridLayoutManager(this, 3, RecyclerView.VERTICAL, false));
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
} }
@Override @Override
protected void initData() { protected void initData() {
imgList = new ArrayList<>();
imgAdapter = new ImgAdapter(R.layout.item_mes_ticket_img, imgList);
imgAdapter.bindToRecyclerView(rvImg);
productList = new ArrayList<>(); productList = new ArrayList<>();
productAdapter = new AddStockCrucibleChooseAdapter(R.layout.item_add_stock_choose, productList, 2); productAdapter = new AddStockCrucibleChooseAdapter(R.layout.item_add_stock_choose, productList, 2);
productAdapter.bindToRecyclerView(rvData); productAdapter.bindToRecyclerView(rvData);
productAdapter.notifyDataSetChanged(); productAdapter.notifyDataSetChanged();
info = JSON.parseObject(getIntent().getStringExtra("info"), AddStockBean.RecordsBean.class); info = JSON.parseObject(getIntent().getStringExtra("info"), AddStockBean.RecordsBean.class);
orderType = getIntent().getStringExtra("orderType"); orderType = getIntent().getStringExtra("orderType");
if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
rlBoxNum.setVisibility(View.GONE);
String[] image = info.getImage().split(",");
List<ImageBean> imageList = new ArrayList<>();
for (String s : image) {
if (!TextUtils.isEmpty(s)) {
ImageBean imageBean = new ImageBean();
imageBean.setUrl(HwObsUtil.IMG_DOMAIN + s);
imageList.add(imageBean);
}
}
imgList.addAll(imageList);
imgAdapter.notifyDataSetChanged();
}
if (TextUtils.equals(orderType, OrderType.SUPPLIER.getCode())) {
rlBoxNum.setVisibility(View.GONE);
}
tvNum.setText(String.valueOf(info.getProductAmount())); tvNum.setText(String.valueOf(info.getProductAmount()));
tvBoxNum.setText(String.valueOf(info.getBoxCode())); tvBoxNum.setText(String.valueOf(info.getBoxCode()));
tvPerson.setText(String.valueOf(info.getCreatedByName())); tvPerson.setText(String.valueOf(info.getCreatedByName()));
...@@ -154,6 +187,13 @@ public class AddStockApplyDetailActivity extends WorkToolBarActivity { ...@@ -154,6 +187,13 @@ public class AddStockApplyDetailActivity extends WorkToolBarActivity {
@Override @Override
protected void initEvent() { protected void initEvent() {
imgAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
if (!TextUtils.isEmpty(imgList.get(position).getUrl()))
startActivity(ImageActivity.class, "url", HwObsUtil.IMG_DOMAIN + imgList.get(position).getUrl());
}
});
} }
@Override @Override
......
...@@ -53,7 +53,7 @@ public class HwObsUtil { ...@@ -53,7 +53,7 @@ public class HwObsUtil {
private String AK = "K2DV6W6VQ7VLVGHGCT0D"; private String AK = "K2DV6W6VQ7VLVGHGCT0D";
public static String END_POINT = "https://obs.cn-north-4.myhuaweicloud.com"; public static String END_POINT = "https://obs.cn-north-4.myhuaweicloud.com";
public static String IMG_DOMAIN = " https://bat-static.obs.cn-north-4.myhuaweicloud.com/"; public static String IMG_DOMAIN = "http://bat-static.obs.cn-north-4.myhuaweicloud.com/";
ObsClient obsClient = null; ObsClient obsClient = null;
private HwObsUtil() { private HwObsUtil() {
......
...@@ -129,6 +129,7 @@ ...@@ -129,6 +129,7 @@
<View style="@style/dividerX" /> <View style="@style/dividerX" />
<RelativeLayout <RelativeLayout
android:id="@+id/rl_box_num"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
...@@ -347,6 +348,12 @@ ...@@ -347,6 +348,12 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_img"
android:paddingHorizontal="10mm"
android:layout_marginTop="20mm"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</RelativeLayout> </RelativeLayout>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论