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

1.六小件新增

2.//TODO erp用户是否选择新部门为空,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,坩埚下单,mes,刷新token,编辑任务担当无法修改,
上级 13411fbb
package com.wd.workoffice.bean.event;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class AddMachineAddChildEvent {
int type;
String data;
public AddMachineAddChildEvent(int type, String data) {
this.type = type;
this.data = data;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
package com.wd.workoffice.bean.event;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class AddMachineModifyChildEvent {
int type;// 1 2 3 4 5 6
String data;
int position;
public AddMachineModifyChildEvent(int type, String data, int position) {
this.type = type;
this.data = data;
this.position = position;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
}
......@@ -58,6 +58,7 @@ public class MesChooseMachineActivity extends WorkToolBarActivity {
private List<MachineBean> clientList;
private UserDataChooseMachineAdapter clientAdapter;
private UserDataBean.ListBean data;
@Override
protected void initView() {
ButterKnife.bind(this);
......@@ -72,7 +73,7 @@ public class MesChooseMachineActivity extends WorkToolBarActivity {
clientAdapter.bindToRecyclerView(rvClient);
clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient);
param = WorkUtils.simpleParam();
param.put("steelmakingWorksCode",data.getSteelmakingWorksCode());
param.put("steelmakingWorksCode", data.getSteelmakingWorksCode());
getData();
}
......@@ -112,7 +113,7 @@ public class MesChooseMachineActivity extends WorkToolBarActivity {
data.setContinuousCasterName(clientList.get(position).getContinuousCasterName());
data.setContinuousCasterType(clientList.get(position).getContinuousCasterType());
data.setContinuousCasterCode(clientList.get(position).getContinuousCasterCode());
startActivity(MesChooseMachineDetailActivity.class,"data",JSON.toJSONString(data));
startActivity(MesChooseMachineDetailActivity.class, "data", JSON.toJSONString(data));
}
});
}
......@@ -139,7 +140,7 @@ public class MesChooseMachineActivity extends WorkToolBarActivity {
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.add:
startActivity(MesChooseMachineAddActivity.class);
startActivity(MesChooseMachineAddActivity.class, "data", JSON.toJSONString(data));
break;
}
return super.onOptionsItemSelected(item);
......
......@@ -146,7 +146,6 @@ public class MesChooseMachineDetailActivity extends WorkToolBarActivity {
rvData4.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
rvData5.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
rvData6.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
......@@ -439,5 +438,4 @@ public class MesChooseMachineDetailActivity extends WorkToolBarActivity {
}
});
}
}
package com.wd.workoffice.ui.activity.mes.user;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineAddChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
......@@ -36,6 +39,8 @@ public class MesMiddleAddActivity extends WorkToolBarActivity {
@BindView(R.id.et_type)
EditText etType;
private Map<String, Object> param;
private String from;
@Override
protected void initView() {
ButterKnife.bind(this);
......@@ -43,6 +48,7 @@ public class MesMiddleAddActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", getIntent().getStringExtra("continuousCasterCode"));
}
......@@ -81,29 +87,34 @@ public class MesMiddleAddActivity extends WorkToolBarActivity {
param.put("ladleContractSituation", middleStatus);
param.put("continuousCastingContractSituation", threeStatus);
param.put("settlementMethod", type);
RtfUtils.getMesRtf().middleAdd("1", "1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseMesBean data) {
hideLoading();
if (!data.isSuccess()) {
toast(data.getMsg());
return;
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineAddChildEvent(6, JSON.toJSONString(param)));
finish();
} else {
RtfUtils.getMesRtf().middleAdd("1", "1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
finish();
toast("添加成功");
EventBus.getDefault().post(new RefreshMachineEvent());
}
});
@Override
public void onSuccess(BaseMesBean data) {
hideLoading();
if (!data.isSuccess()) {
toast(data.getMsg());
return;
}
finish();
toast("添加成功");
EventBus.getDefault().post(new RefreshMachineEvent());
}
});
}
}
......
package com.wd.workoffice.ui.activity.mes.user;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
......@@ -8,6 +9,7 @@ import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineModifyChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.MachineDetailBean;
import com.wd.workoffice.retrofit.RtfUtils;
......@@ -38,6 +40,7 @@ public class MesMiddleModifyActivity extends WorkToolBarActivity {
EditText etType;
private Map<String, Object> param;
private MachineDetailBean.SettleListBean dataBean;
private String from;
@Override
protected void initView() {
......@@ -53,6 +56,7 @@ public class MesMiddleModifyActivity extends WorkToolBarActivity {
etMiddleStatus.setText(dataBean.getLadleContractSituation());
etThreeStatus.setText(dataBean.getContinuousCastingContractSituation());
etType.setText(dataBean.getSettlementMethod());
from = getIntent().getStringExtra("from");
}
......@@ -89,6 +93,12 @@ public class MesMiddleModifyActivity extends WorkToolBarActivity {
param.put("ladleContractSituation", middleStatus);
param.put("continuousCastingContractSituation", threeStatus);
param.put("settlementMethod", type);
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineModifyChildEvent(5, JSON.toJSONString(param)
, Integer.valueOf(getIntent().getStringExtra("position"))));
finish();
return;
}
RtfUtils.getMesRtf().middleAdd("1", "2", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
......
......@@ -5,6 +5,7 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
......@@ -16,6 +17,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineAddChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.ImageBean;
import com.wd.workoffice.bean.mesBean.MesProBean;
......@@ -74,6 +76,7 @@ public class MesOtherSupplierAddActivity extends WorkToolBarActivity {
EditText etRemark;
private Map<String, Object> param;
private Map<Integer, Object> annexMap = new HashMap<>();
private String from;
@Override
protected void initView() {
......@@ -82,6 +85,7 @@ public class MesOtherSupplierAddActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", getIntent().getStringExtra("continuousCasterCode"));
}
......@@ -100,6 +104,10 @@ public class MesOtherSupplierAddActivity extends WorkToolBarActivity {
param.put("otherSituationDescription", content);
param.put("remark", remark);
param.put("attachments", getUploadImg());
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineAddChildEvent(3, JSON.toJSONString(param)));
finish();
} else {
RtfUtils.getMesRtf().otherSupplierAdd("1", "1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
......@@ -122,7 +130,7 @@ public class MesOtherSupplierAddActivity extends WorkToolBarActivity {
toast("添加成功");
EventBus.getDefault().post(new RefreshMachineEvent());
}
});
});}
}
@Override
......
......@@ -17,6 +17,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineModifyChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.ImageBean;
import com.wd.workoffice.bean.mesBean.MachineDetailBean;
......@@ -77,6 +78,7 @@ public class MesOtherSupplierModifyActivity extends WorkToolBarActivity {
private Map<String, Object> param;
private Map<Integer, Object> annexMap = new HashMap<>();
private MachineDetailBean.OtherSupListBean dataBean;
private String from;
@Override
protected void initView() {
......@@ -85,6 +87,7 @@ public class MesOtherSupplierModifyActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
dataBean = JSON.parseObject(getIntent().getStringExtra("data"), MachineDetailBean.OtherSupListBean.class);
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", dataBean.getContinuousCasterCode());
......@@ -95,7 +98,25 @@ public class MesOtherSupplierModifyActivity extends WorkToolBarActivity {
etYears.setText(dataBean.getUseLife());
etContent.setText(dataBean.getOtherSituationDescription());
etRemark.setText(dataBean.getRemark());
getData();
if (dataBean.getAttachments() != null) {
for (int i = 0; i < dataBean.getAttachments().size(); i++) {
annexMap.put(i + 1, dataBean.getAttachments().get(i));
switch (i + 1) {
case 1:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg1);
break;
case 2:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg2);
break;
case 3:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg3);
break;
}
}
}
if (!TextUtils.equals(from, "1")) {
getData();
}
}
private void getData() {
......@@ -152,6 +173,12 @@ public class MesOtherSupplierModifyActivity extends WorkToolBarActivity {
param.put("otherSituationDescription", content);
param.put("remark", remark);
param.put("attachments", getUploadImg());
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineModifyChildEvent(3, JSON.toJSONString(param)
, Integer.valueOf(getIntent().getStringExtra("position"))));
finish();
return;
}
RtfUtils.getMesRtf().otherSupplierAdd("1", "2", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
......
......@@ -5,6 +5,7 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
......@@ -18,6 +19,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineAddChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.ImageBean;
import com.wd.workoffice.bean.mesBean.MesProBean;
......@@ -81,6 +83,7 @@ public class MesPackageAddActivity extends WorkToolBarActivity {
private Map<String, Object> param;
private MesProBean.ListBean choosePro;
private Map<Integer, Object> annexMap = new HashMap<>();
private String from;
@Override
protected void initView() {
......@@ -89,6 +92,7 @@ public class MesPackageAddActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", getIntent().getStringExtra("continuousCasterCode"));
}
......@@ -112,30 +116,34 @@ public class MesPackageAddActivity extends WorkToolBarActivity {
param.put("useProblemFeedback", content);
param.put("remark", remark);
param.put("attachments", getUploadImg());
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineAddChildEvent(4, JSON.toJSONString(param)));
finish();
} else {
RtfUtils.getMesRtf().packageAdd("1", "1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
RtfUtils.getMesRtf().packageAdd("1", "1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseMesBean data) {
hideLoading();
if (!data.isSuccess()) {
toast(data.getMsg());
return;
@Override
public void onSuccess(BaseMesBean data) {
hideLoading();
if (!data.isSuccess()) {
toast(data.getMsg());
return;
}
finish();
toast("添加成功");
EventBus.getDefault().post(new RefreshMachineEvent());
}
finish();
toast("添加成功");
EventBus.getDefault().post(new RefreshMachineEvent());
}
});
});
}
}
@Override
......
......@@ -19,6 +19,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineModifyChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.ImageBean;
import com.wd.workoffice.bean.mesBean.MachineDetailBean;
......@@ -84,6 +85,7 @@ public class MesPackageModifyActivity extends WorkToolBarActivity {
private MesProBean.ListBean choosePro;
private Map<Integer, Object> annexMap = new HashMap<>();
private MachineDetailBean.OtherLadleListBean dataBean;
private String from;
@Override
protected void initView() {
......@@ -92,6 +94,7 @@ public class MesPackageModifyActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
dataBean = JSON.parseObject(getIntent().getStringExtra("data"), MachineDetailBean.OtherLadleListBean.class);
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", dataBean.getContinuousCasterCode());
......@@ -103,12 +106,30 @@ public class MesPackageModifyActivity extends WorkToolBarActivity {
tvPro.setText(dataBean.getRefractoryName());
etImgCode.setText(dataBean.getFigureNumber());
}
if (dataBean.getAttachments() != null) {
for (int i = 0; i < dataBean.getAttachments().size(); i++) {
annexMap.put(i + 1, dataBean.getAttachments().get(i));
switch (i + 1) {
case 1:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg1);
break;
case 2:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg2);
break;
case 3:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg3);
break;
}
}
}
etMaterials.setText(dataBean.getMaterialsUsed());
etRequirements.setText(dataBean.getUseRequirement());
etYears.setText(dataBean.getUseLife());
etContent.setText(dataBean.getUseProblemFeedback());
etRemark.setText(dataBean.getRemark());
getData();
if (!TextUtils.equals(from, "1")) {
getData();
}
}
private void getData() {
......@@ -130,7 +151,6 @@ public class MesPackageModifyActivity extends WorkToolBarActivity {
toast(data.getMsg());
return;
}
dataBean = JSON.parseObject(data.getData().toString(), MachineDetailBean.OtherLadleListBean.class);
if (dataBean.getAttachments() != null) {
for (int i = 0; i < dataBean.getAttachments().size(); i++) {
......@@ -172,6 +192,12 @@ public class MesPackageModifyActivity extends WorkToolBarActivity {
param.put("remark", remark);
param.put("attachments", getUploadImg());
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineModifyChildEvent(4, JSON.toJSONString(param)
, Integer.valueOf(getIntent().getStringExtra("position"))));
finish();
return;
}
RtfUtils.getMesRtf().packageAdd("1", "2", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
......
......@@ -2,6 +2,7 @@ package com.wd.workoffice.ui.activity.mes.user;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
......@@ -12,6 +13,7 @@ import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineAddChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.MesProBean;
import com.wd.workoffice.retrofit.RtfUtils;
......@@ -48,6 +50,8 @@ public class MesStockAddActivity extends WorkToolBarActivity {
EditText etContent;
private Map<String, Object> param;
private MesProBean.ListBean choosePro;
private String from;
@Override
protected void initView() {
ButterKnife.bind(this);
......@@ -55,6 +59,7 @@ public class MesStockAddActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", getIntent().getStringExtra("continuousCasterCode"));
}
......@@ -96,6 +101,10 @@ public class MesStockAddActivity extends WorkToolBarActivity {
param.put("productsName", choosePro.getProductName());
param.put("figureNumber", choosePro.getDrawingNumber());
// param.put("stockNumber", choosePro.gets);
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineAddChildEvent(5, JSON.toJSONString(param)));
finish();
} else {
RtfUtils.getMesRtf().stockAdd("1", "1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
......@@ -118,7 +127,7 @@ public class MesStockAddActivity extends WorkToolBarActivity {
toast("添加成功");
EventBus.getDefault().post(new RefreshMachineEvent());
}
});
});}
}
@Override
......
......@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineModifyChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.MachineDetailBean;
import com.wd.workoffice.bean.mesBean.MesProBean;
......@@ -51,6 +52,7 @@ public class MesStockModifyActivity extends WorkToolBarActivity {
private Map<String, Object> param;
private MesProBean.ListBean choosePro;
private MachineDetailBean.StockListBean dataBean;
private String from;
@Override
protected void initView() {
......@@ -59,6 +61,7 @@ public class MesStockModifyActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
dataBean = JSON.parseObject(getIntent().getStringExtra("data"), MachineDetailBean.StockListBean.class);
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", dataBean.getContinuousCasterCode());
......@@ -113,6 +116,13 @@ public class MesStockModifyActivity extends WorkToolBarActivity {
param.put("productsName", choosePro.getProductName());
param.put("figureNumber", choosePro.getDrawingNumber());
// param.put("stockNumber", choosePro.gets);
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineModifyChildEvent(5, JSON.toJSONString(param)
, Integer.valueOf(getIntent().getStringExtra("position"))));
finish();
return;
}
RtfUtils.getMesRtf().stockAdd("1", "2", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
......
......@@ -5,6 +5,7 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
......@@ -19,6 +20,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineAddChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.ImageBean;
import com.wd.workoffice.bean.mesBean.MesProBean;
......@@ -98,6 +100,7 @@ public class MesThreeAddActivity extends WorkToolBarActivity {
private Map<String, Object> param;
private MesProBean.ListBean choosePro;
private Map<Integer, Object> annexMap = new HashMap<>();
private String from;//1 新增连铸机跳转
@Override
protected void initView() {
......@@ -106,6 +109,7 @@ public class MesThreeAddActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", getIntent().getStringExtra("continuousCasterCode"));
}
......@@ -142,30 +146,35 @@ public class MesThreeAddActivity extends WorkToolBarActivity {
param.put("useProblemFeedback", content);
param.put("remark", remark);
param.put("attachments", getUploadImg());
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineAddChildEvent(1, JSON.toJSONString(param)));
finish();
} else {
RtfUtils.getMesRtf().threeAdd("1", "1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
RtfUtils.getMesRtf().threeAdd("1", "1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseMesBean data) {
hideLoading();
if (!data.isSuccess()) {
toast(data.getMsg());
return;
@Override
public void onSuccess(BaseMesBean data) {
hideLoading();
if (!data.isSuccess()) {
toast(data.getMsg());
return;
}
finish();
toast("添加成功");
EventBus.getDefault().post(new RefreshMachineEvent());
}
finish();
toast("添加成功");
EventBus.getDefault().post(new RefreshMachineEvent());
}
});
});
}
}
@Override
......
......@@ -20,6 +20,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.AddMachineModifyChildEvent;
import com.wd.workoffice.bean.event.RefreshMachineEvent;
import com.wd.workoffice.bean.mesBean.ImageBean;
import com.wd.workoffice.bean.mesBean.MachineDetailBean;
......@@ -101,6 +102,7 @@ public class MesThreeModifyActivity extends WorkToolBarActivity {
private MesProBean.ListBean choosePro;
private Map<Integer, Object> annexMap = new HashMap<>();
private MachineDetailBean.ProductListBean dataBean;
private String from;
@Override
protected void initView() {
......@@ -109,6 +111,7 @@ public class MesThreeModifyActivity extends WorkToolBarActivity {
@Override
protected void initData() {
from = getIntent().getStringExtra("from");
dataBean = JSON.parseObject(getIntent().getStringExtra("data"), MachineDetailBean.ProductListBean.class);
param = WorkUtils.simpleParam();
param.put("continuousCasterCode", dataBean.getContinuousCasterCode());
......@@ -125,6 +128,22 @@ public class MesThreeModifyActivity extends WorkToolBarActivity {
etSpec.setText(choosePro.getSpecification());
etType.setText(choosePro.getProductType());
}
if (dataBean.getAttachments() != null) {
for (int i = 0; i < dataBean.getAttachments().size(); i++) {
annexMap.put(i + 1, dataBean.getAttachments().get(i));
switch (i + 1) {
case 1:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg1);
break;
case 2:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg2);
break;
case 3:
GlideUtils.getRequest().load(dataBean.getAttachments().get(i).getUrl()).into(ivImg3);
break;
}
}
}
etMaterial.setText(dataBean.getMaterialsUsed());
etRequirements.setText(dataBean.getUseRequirement());
etPosition.setText(dataBean.getSlagLineLocation());
......@@ -134,7 +153,9 @@ public class MesThreeModifyActivity extends WorkToolBarActivity {
tvBakingTime.setText(dataBean.getBakingDateTime() + "");
etContent.setText(dataBean.getUseProblemFeedback());
etRemark.setText(dataBean.getRemark());
getData();
if (!TextUtils.equals(from, "1")) {
getData();
}
}
private void getData() {
......@@ -156,7 +177,6 @@ public class MesThreeModifyActivity extends WorkToolBarActivity {
toast(data.getMsg());
return;
}
dataBean = JSON.parseObject(data.getData().toString(), MachineDetailBean.ProductListBean.class);
if (dataBean.getAttachments() != null) {
for (int i = 0; i < dataBean.getAttachments().size(); i++) {
......@@ -210,6 +230,12 @@ public class MesThreeModifyActivity extends WorkToolBarActivity {
param.put("useProblemFeedback", content);
param.put("remark", remark);
param.put("attachments", getUploadImg());
if (TextUtils.equals(from, "1")) {
EventBus.getDefault().post(new AddMachineModifyChildEvent(1, JSON.toJSONString(param)
, Integer.valueOf(getIntent().getStringExtra("position"))));
finish();
return;
}
RtfUtils.getMesRtf().threeAdd("1", "2", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
......
......@@ -859,7 +859,8 @@
android:layout_marginBottom="30mm"
android:background="@android:color/white"
android:paddingHorizontal="20mm"
android:paddingVertical="9mm">
android:paddingVertical="9mm"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论