提交 6d51d129 authored 作者: lgd's avatar lgd

1.修改bug

2.TODO 三个功能测试,下单新增唛头測試
上级 de195379
......@@ -23,6 +23,7 @@
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" />
<permission
android:name="com.wd.workoffice.permission.JPUSH_MESSAGE"
android:protectionLevel="signature" />
......@@ -40,8 +41,7 @@
android:configChanges="keyboardHidden|orientation"
android:launchMode="singleTask"
android:theme="@style/Work.Base.Main"
android:windowSoftInputMode="adjustPan">
</activity>
android:windowSoftInputMode="adjustPan"></activity>
<activity
android:name=".ui.activity.SplashActivity"
android:configChanges="keyboardHidden|orientation"
......@@ -2375,6 +2375,15 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.store.ChooseHeadActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="选择唛头"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider"
......@@ -2388,7 +2397,8 @@
android:name="design_width_in_dp"
android:value="375" />
<service android:name=".service.JPushService"
<service
android:name=".service.JPushService"
android:enabled="true"
android:exported="false"
android:process=":pushcore">
......@@ -2401,7 +2411,7 @@
<receiver
android:name=".service.JPushReceive"
android:enabled="true"
android:exported="false" >
android:exported="false">
<intent-filter>
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
<category android:name="com.wd.workoffice" />
......
package com.wd.workoffice.bean;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MarkBean {
/**
* createdBy : 137
* createdByName : null
* createdTime : 2020-08-04 15:20:56
* updatedBy : 137
* updatedByName : null
* updatedTime : 2020-08-05 17:01:53
* id : 1
* customerId : 238
* productId : 13552
* receiveCompany : 山东合旭材料科技有限公司
* customerBranchFactory : 1
* continuousCastingMachine : 2
* productName : 塞棒(高碱)加套B354-2
* productSimpleCode : B354-2
* productSpec : 1560
* shipCompany : 3
* materialCode : 44
* boxCode : 55
* materialCodeOther : 66
* foreignTradeContractNumber : 77
* domesticShipCompany : 88
* projectName : 1
* useLocation :
*/
private int createdBy;
private Object createdByName;
private String createdTime;
private int updatedBy;
private Object updatedByName;
private String updatedTime;
private int id;
private int customerId;
private int productId;
private String receiveCompany;
private String customerBranchFactory;
private String continuousCastingMachine;
private String productName;
private String productSimpleCode;
private String productSpec;
private String shipCompany;
private String materialCode;
private String boxCode;
private String materialCodeOther;
private String foreignTradeContractNumber;
private String domesticShipCompany;
private String projectName;
private String useLocation;
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public Object getCreatedByName() {
return createdByName;
}
public void setCreatedByName(Object createdByName) {
this.createdByName = createdByName;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public int getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(int updatedBy) {
this.updatedBy = updatedBy;
}
public Object getUpdatedByName() {
return updatedByName;
}
public void setUpdatedByName(Object updatedByName) {
this.updatedByName = updatedByName;
}
public String getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getCustomerId() {
return customerId;
}
public void setCustomerId(int customerId) {
this.customerId = customerId;
}
public int getProductId() {
return productId;
}
public void setProductId(int productId) {
this.productId = productId;
}
public String getReceiveCompany() {
return receiveCompany;
}
public void setReceiveCompany(String receiveCompany) {
this.receiveCompany = receiveCompany;
}
public String getCustomerBranchFactory() {
return customerBranchFactory;
}
public void setCustomerBranchFactory(String customerBranchFactory) {
this.customerBranchFactory = customerBranchFactory;
}
public String getContinuousCastingMachine() {
return continuousCastingMachine;
}
public void setContinuousCastingMachine(String continuousCastingMachine) {
this.continuousCastingMachine = continuousCastingMachine;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductSimpleCode() {
return productSimpleCode;
}
public void setProductSimpleCode(String productSimpleCode) {
this.productSimpleCode = productSimpleCode;
}
public String getProductSpec() {
return productSpec;
}
public void setProductSpec(String productSpec) {
this.productSpec = productSpec;
}
public String getShipCompany() {
return shipCompany;
}
public void setShipCompany(String shipCompany) {
this.shipCompany = shipCompany;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getBoxCode() {
return boxCode;
}
public void setBoxCode(String boxCode) {
this.boxCode = boxCode;
}
public String getMaterialCodeOther() {
return materialCodeOther;
}
public void setMaterialCodeOther(String materialCodeOther) {
this.materialCodeOther = materialCodeOther;
}
public String getForeignTradeContractNumber() {
return foreignTradeContractNumber;
}
public void setForeignTradeContractNumber(String foreignTradeContractNumber) {
this.foreignTradeContractNumber = foreignTradeContractNumber;
}
public String getDomesticShipCompany() {
return domesticShipCompany;
}
public void setDomesticShipCompany(String domesticShipCompany) {
this.domesticShipCompany = domesticShipCompany;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getUseLocation() {
return useLocation;
}
public void setUseLocation(String useLocation) {
this.useLocation = useLocation;
}
}
......@@ -171,6 +171,15 @@ public class ProductBean {
private double quantity;
private double innerPrice;
private int flag;// 0 未超出,1 超出预警值
private MarkBean markOrderRel;
public MarkBean getMarkOrderRel() {
return markOrderRel;
}
public void setMarkOrderRel(MarkBean markOrderRel) {
this.markOrderRel = markOrderRel;
}
public int getFlag() {
return flag;
......
......@@ -2174,5 +2174,11 @@ public interface ApiService {
Observable<BaseBean> returnApplyByTransitPart(@QueryMap Map<String,Object> param);
/**
* 获取唛头模板
*
* @return
*/
@GET("/mark/one")
Observable<BaseBean> getTemplate(@QueryMap Map<String,Object> param);
}
package com.wd.workoffice.ui.activity.bat.store;
import android.content.Intent;
import android.os.Bundle;
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.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ClientBean;
import com.wd.workoffice.bean.MarkBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
/**
* 选择唛头
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ChooseHeadActivity extends WorkToolBarActivity {
@BindView(R.id.et_company)
EditText etCompany;
@BindView(R.id.et_factory)
EditText etFactory;
@BindView(R.id.et_machine)
EditText etMachine;
@BindView(R.id.et_pro_name)
EditText etProName;
@BindView(R.id.et_img_code)
EditText etImgCode;
@BindView(R.id.et_spec)
EditText etSpec;
@BindView(R.id.et_send_company)
EditText etSendCompany;
@BindView(R.id.et_code)
EditText etCode;
@BindView(R.id.et_box)
EditText etBox;
@BindView(R.id.et_supplies_code)
EditText etSuppliesCode;
@BindView(R.id.et_contract)
EditText etContract;
@BindView(R.id.et_country_company)
EditText etCountryCompany;
@BindView(R.id.et_app_name)
EditText etAppName;
@BindView(R.id.et_use)
EditText etUse;
private MarkBean markBean;
private ProductBean.RecordsBean product;
@Override
protected void initView() {
ButterKnife.bind(this);
}
@Override
protected void initData() {
product = JSON.parseObject(getIntent().getStringExtra("product"), ProductBean.RecordsBean.class);
if (null==markBean){
markBean =new MarkBean();
}
markBean.setProductId(product.getId());
markBean.setCustomerId(Integer.valueOf(getIntent().getStringExtra("customerId")));
etSpec.setText(product.getSpec());
etProName.setText(product.getProductName());
etImgCode.setText(product.getSimpleCode());
getTemplate();
}
@Override
protected void initEvent() {
}
private void getTemplate() {
Map<String, Object> param = WorkUtils.simpleParam();
param.put("productId", product.getId());
param.put("customerId", getIntent().getStringExtra("customerId"));
RtfUtils.getRtf().getTemplate(param).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
markBean = JSON.parseObject(data.getData().toString(), MarkBean.class);
changeView();
}
});
}
private void changeView() {
etCompany.setText(markBean.getReceiveCompany());
etFactory.setText(markBean.getCustomerBranchFactory());
etMachine.setText(markBean.getContinuousCastingMachine());
etProName.setText(markBean.getProductName());
etImgCode.setText(markBean.getProductSimpleCode());
etSpec.setText(markBean.getProductSpec());
etSendCompany.setText(markBean.getShipCompany());
etCode.setText(markBean.getMaterialCode());
etBox.setText(markBean.getBoxCode());
etSuppliesCode.setText(markBean.getMaterialCodeOther());
etContract.setText(markBean.getForeignTradeContractNumber());
etCountryCompany.setText(markBean.getDomesticShipCompany());
etAppName.setText(markBean.getReceiveCompany());
etUse.setText(markBean.getProductName());
}
@Override
protected int layoutId() {
return R.layout.activity_choose_head;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_finish, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.finish:
// 收货单位 产品的名称,图号规格是必须填写项
String company = etCompany.getText().toString();
String proName = etProName.getText().toString();
String imgCode = etImgCode.getText().toString();
String spec = etSpec.getText().toString();
if (TextUtils.isEmpty(company)) {
toast("请输入收货单位");
return super.onOptionsItemSelected(item);
}
if (TextUtils.isEmpty(proName)) {
toast("请输入产品名称");
return super.onOptionsItemSelected(item);
}
if (TextUtils.isEmpty(imgCode)) {
toast("请输入图号");
return super.onOptionsItemSelected(item);
}
if (TextUtils.isEmpty(spec)) {
toast("请输入产品规格");
return super.onOptionsItemSelected(item);
}
markBean.setReceiveCompany(etCompany.getText().toString());
markBean.setCustomerBranchFactory(etFactory.getText().toString());
markBean.setContinuousCastingMachine(etMachine.getText().toString());
markBean.setProductName(etProName.getText().toString());
markBean.setProductSimpleCode(etImgCode.getText().toString());
markBean.setProductSpec(etSpec.getText().toString());
markBean.setShipCompany(etSendCompany.getText().toString());
markBean.setMaterialCode(etCode.getText().toString());
markBean.setBoxCode(etBox.getText().toString());
markBean.setMaterialCodeOther(etSuppliesCode.getText().toString());
markBean.setForeignTradeContractNumber(etContract.getText().toString());
markBean.setDomesticShipCompany(etCountryCompany.getText().toString());
markBean.setReceiveCompany(etAppName.getText().toString());
markBean.setProductName(etUse.getText().toString());
Intent intent = new Intent();
intent.putExtra("mark", JSON.toJSONString(markBean));
intent.putExtra("position", getIntent().getStringExtra("position"));
setResult(10003, intent);
finish();
break;
}
return super.onOptionsItemSelected(item);
}
}
......@@ -23,6 +23,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.MarkBean;
import com.wd.workoffice.bean.OrderBillBean;
import com.wd.workoffice.bean.ProcessBean;
import com.wd.workoffice.bean.ProductBean;
......@@ -244,6 +245,10 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
PermissionType.PROCESS_CRUCIBLE.getCode())) {
data.put("innerPrice", MathUtils.converData(recordsBean.getInternalPrice(), 3));
}
if (TextUtils.equals(getIntent().getStringExtra("code"),
PermissionType.PROCESS_SALE.getCode())) {
data.put("markOrderRel", recordsBean.getMarkOrderRel());
}
// data.put("tranFromStockId", recordsBean.getCarPrice());
data.put("customerBranchFactoryId", recordsBean.getFactoryId());//3.分厂客户ID
data.put("outerPrice", recordsBean.getCarPrice());
......@@ -274,6 +279,11 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
startActivityForResult(StoreClientFactoryActivity.class, 10001,
"customerId", getIntent().getStringExtra("customerId"), "position", position + "");
break;
case R.id.rl_mark:
startActivityForResult(ChooseHeadActivity.class, 10003,
"product", JSON.toJSONString(proList.get(position)),
"customerId", getIntent().getStringExtra("customerId"), "position", position + "");
break;
}
}
});
......@@ -444,7 +454,7 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
if (Matisse.obtainResult(data).size() != 0) {
showLoading();
File file = WorkUtils.uriToFile(Matisse.obtainResult(data).get(0), this);
HwObsUtil.getInstance().uploadObject(file,this, new HwUploadListener() {
HwObsUtil.getInstance().uploadObject(file, this, new HwUploadListener() {
@Override
public void uploadSuccess(String value) {
hideLoading();
......@@ -460,37 +470,12 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
toast("图片上传失败");
}
});
// RequestBody requestFile = RequestBody.create(MediaType.parse("image/png"), file);
// RtfHelper.getInstance().getApiService(ApiService.class).
// upload(MultipartBody.Part.createFormData("newUploadImgs", file.getName(), requestFile)).
// compose(Transformer.schedule()).subscribe(new WorkObserver<JSONObject>() {
// @Override
// public void doOnSubscribe(Disposable d) {
//
// }
//
// @Override
// public void onFail(String errorMsg) {
// hideLoading();
// toast(errorMsg);
// }
//
// @Override
// public void onSuccess(JSONObject jsonObject) {
// hideLoading();
// if (jsonObject.getInteger("code") != 0) {
// toast(jsonObject.getString("message"));
// return;
// }
// toast("上传成功");
// proList.get(choosePosition).setUrl(jsonObject.getString("data"));
// coverProInfo(proList);
// proAdapter.notifyDataSetChanged();
// }
// });
}
}else if (requestCode == 10003 && resultCode == 10003) {
String mark = data.getStringExtra("mark");
Integer position = Integer.valueOf(data.getStringExtra("position"));
proList.get(position).setMarkOrderRel(JSON.parseObject(mark, MarkBean.class));
proAdapter.notifyItemChanged(position);
}
}
......
......@@ -54,11 +54,15 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
if (type == 1) {
helper.addOnClickListener(R.id.rl_choose_dep);
helper.addOnClickListener(R.id.rl_upload);
helper.addOnClickListener(R.id.rl_mark);
helper.setText(R.id.tv_sale_price, item.getCarPrice());
helper.setText(R.id.tv_buy_count, item.getCarNum());
if (!TextUtils.isEmpty(item.getFactoryName())) {
helper.setText(R.id.tv_choose_dep, item.getFactoryName());
}
if (null != item.getMarkOrderRel()) {
helper.setText(R.id.tv_choose_mark, "已选择");
}
if (!TextUtils.isEmpty(item.getUrl())) {
helper.setText(R.id.tv_upload, item.getUrl().substring(1));
}
......@@ -71,7 +75,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
PermissionType.PROCESS_SUPPLY.getCode())) {
helper.setGone(R.id.rl_sale_price, false);
}
helper.setGone(R.id.rl_mark, TextUtils.equals(orderType, PermissionType.PROCESS_SALE.getCode()));
} else if (type == 2) {
helper.setGone(R.id.tv_desc, item.getFlag() == 1);
helper.addOnClickListener(R.id.tv_delete);
......
......@@ -243,7 +243,7 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="选择分厂"
android:text="选择客户分厂"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
......@@ -270,6 +270,43 @@
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_mark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="9mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="设置唛头"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_choose_mark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="3mm"
android:text="请填写"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<ImageView
android:layout_width="15mm"
android:layout_height="20mm"
android:src="@mipmap/arrow_right_gray" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/rl_upload"
android:layout_width="match_parent"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论