diff --git a/.idea/misc.xml b/.idea/misc.xml
index 1fce2ca..447200d 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -26,11 +26,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/build.gradle b/app/build.gradle
index 0b0f230..ff37ba3 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,5 +1,8 @@
plugins {
id 'com.android.application'
+ id 'kotlin-android'
+ id 'kotlin-kapt'
+ id 'kotlin-android-extensions'
}
android {
@@ -90,6 +93,8 @@ dependencies {
//加载
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1'
implementation 'com.scwang.smart:refresh-header-material:2.0.1'
+ implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' //球脉冲加载
+ implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载
implementation 'com.alibaba:fastjson:1.2.61'
//更新版本
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.1.0'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 46b8022..ba8ee79 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -100,6 +100,13 @@
+
+
putInfo;
+ private String receiverAddress;
+ private String receiverDeadline;
+ private String receiverName;
+ private String receiverPhone;
+ private String receiverProvinceCityArea;
+ private String report;
+ private String requirement;
+ private List sendInfo;
+ private String sendPutString;
+ private String shipperId;
+ private long status;
+ private String statusOver;
+ private String totalFreight;
+ private int vehicleLength;
+ private String vehicleLengthName;
+ private int vehicleType;
+ private String vehicleTypeName;
+ private long waybillId;
+
+ public int getAlctGoodsType() {
+ return alctGoodsType;
+ }
+
+ public void setAlctGoodsType(int alctGoodsType) {
+ this.alctGoodsType = alctGoodsType;
+ }
+
+ public String getAllowSplitting() {
+ return allowSplitting;
+ }
+
+ public void setAllowSplitting(String allowSplitting) {
+ this.allowSplitting = allowSplitting;
+ }
+
+ public int getBusinessType() {
+ return businessType;
+ }
+
+ public void setBusinessType(int businessType) {
+ this.businessType = businessType;
+ }
+
+ public String getCarId() {
+ return carId;
+ }
+
+ public void setCarId(String carId) {
+ this.carId = carId;
+ }
+
+ public String getCarNumber() {
+ return carNumber;
+ }
+
+ public void setCarNumber(String carNumber) {
+ this.carNumber = carNumber;
+ }
+
+ public String getContactName() {
+ return contactName;
+ }
+
+ public void setContactName(String contactName) {
+ this.contactName = contactName;
+ }
+
+ public String getContactPhone() {
+ return contactPhone;
+ }
+
+ public void setContactPhone(String contactPhone) {
+ this.contactPhone = contactPhone;
+ }
+
+ public String getContractTemplateUrl() {
+ return contractTemplateUrl;
+ }
+
+ public void setContractTemplateUrl(String contractTemplateUrl) {
+ this.contractTemplateUrl = contractTemplateUrl;
+ }
+
+ public String getDistance() {
+ return distance;
+ }
+
+ public void setDistance(String distance) {
+ this.distance = distance;
+ }
+
+ public String getDriverTax() {
+ return driverTax;
+ }
+
+ public void setDriverTax(String driverTax) {
+ this.driverTax = driverTax;
+ }
+
+ public String getEffectiveTime() {
+ return effectiveTime;
+ }
+
+ public void setEffectiveTime(String effectiveTime) {
+ this.effectiveTime = effectiveTime;
+ }
+
+ public String getEtcCost() {
+ return etcCost;
+ }
+
+ public void setEtcCost(String etcCost) {
+ this.etcCost = etcCost;
+ }
+
+ public String getFailedReason() {
+ return failedReason;
+ }
+
+ public void setFailedReason(String failedReason) {
+ this.failedReason = failedReason;
+ }
+
+ public int getGoodsBigCate() {
+ return goodsBigCate;
+ }
+
+ public void setGoodsBigCate(int goodsBigCate) {
+ this.goodsBigCate = goodsBigCate;
+ }
+
+ public String getGoodsValue() {
+ return goodsValue;
+ }
+
+ public void setGoodsValue(String goodsValue) {
+ this.goodsValue = goodsValue;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public String getInsureAmount() {
+ return insureAmount;
+ }
+
+ public void setInsureAmount(String insureAmount) {
+ this.insureAmount = insureAmount;
+ }
+
+ public String getIsInsure() {
+ return isInsure;
+ }
+
+ public void setIsInsure(String isInsure) {
+ this.isInsure = isInsure;
+ }
+
+ public String getLoadingAddress() {
+ return loadingAddress;
+ }
+
+ public void setLoadingAddress(String loadingAddress) {
+ this.loadingAddress = loadingAddress;
+ }
+
+ public String getLoadingDeadline() {
+ return loadingDeadline;
+ }
+
+ public void setLoadingDeadline(String loadingDeadline) {
+ this.loadingDeadline = loadingDeadline;
+ }
+
+ public String getLoadingName() {
+ return loadingName;
+ }
+
+ public void setLoadingName(String loadingName) {
+ this.loadingName = loadingName;
+ }
+
+ public String getLoadingPhone() {
+ return loadingPhone;
+ }
+
+ public void setLoadingPhone(String loadingPhone) {
+ this.loadingPhone = loadingPhone;
+ }
+
+ public String getLoadingProvinceCityArea() {
+ return loadingProvinceCityArea;
+ }
+
+ public void setLoadingProvinceCityArea(String loadingProvinceCityArea) {
+ this.loadingProvinceCityArea = loadingProvinceCityArea;
+ }
+
+ public String getNamedDrivers() {
+ return namedDrivers;
+ }
+
+ public void setNamedDrivers(String namedDrivers) {
+ this.namedDrivers = namedDrivers;
+ }
+
+ public String getOliCost() {
+ return oliCost;
+ }
+
+ public void setOliCost(String oliCost) {
+ this.oliCost = oliCost;
+ }
+
+ public String getOrderNum() {
+ return orderNum;
+ }
+
+ public void setOrderNum(String orderNum) {
+ this.orderNum = orderNum;
+ }
+
+ public String getOtherCost() {
+ return otherCost;
+ }
+
+ public void setOtherCost(String otherCost) {
+ this.otherCost = otherCost;
+ }
+
+ public String getPlatformTotalFreight() {
+ return platformTotalFreight;
+ }
+
+ public void setPlatformTotalFreight(String platformTotalFreight) {
+ this.platformTotalFreight = platformTotalFreight;
+ }
+
+ public List getPutInfo() {
+ return putInfo;
+ }
+
+ public void setPutInfo(List putInfo) {
+ this.putInfo = putInfo;
+ }
+
+ public String getReceiverAddress() {
+ return receiverAddress;
+ }
+
+ public void setReceiverAddress(String receiverAddress) {
+ this.receiverAddress = receiverAddress;
+ }
+
+ public String getReceiverDeadline() {
+ return receiverDeadline;
+ }
+
+ public void setReceiverDeadline(String receiverDeadline) {
+ this.receiverDeadline = receiverDeadline;
+ }
+
+ public String getReceiverName() {
+ return receiverName;
+ }
+
+ public void setReceiverName(String receiverName) {
+ this.receiverName = receiverName;
+ }
+
+ public String getReceiverPhone() {
+ return receiverPhone;
+ }
+
+ public void setReceiverPhone(String receiverPhone) {
+ this.receiverPhone = receiverPhone;
+ }
+
+ public String getReceiverProvinceCityArea() {
+ return receiverProvinceCityArea;
+ }
+
+ public void setReceiverProvinceCityArea(String receiverProvinceCityArea) {
+ this.receiverProvinceCityArea = receiverProvinceCityArea;
+ }
+
+ public String getReport() {
+ return report;
+ }
+
+ public void setReport(String report) {
+ this.report = report;
+ }
+
+ public String getRequirement() {
+ return requirement;
+ }
+
+ public void setRequirement(String requirement) {
+ this.requirement = requirement;
+ }
+
+ public List getSendInfo() {
+ return sendInfo;
+ }
+
+ public void setSendInfo(List sendInfo) {
+ this.sendInfo = sendInfo;
+ }
+
+ public String getSendPutString() {
+ return sendPutString;
+ }
+
+ public void setSendPutString(String sendPutString) {
+ this.sendPutString = sendPutString;
+ }
+
+ public String getShipperId() {
+ return shipperId;
+ }
+
+ public void setShipperId(String shipperId) {
+ this.shipperId = shipperId;
+ }
+
+ public long getStatus() {
+ return status;
+ }
+
+ public void setStatus(long status) {
+ this.status = status;
+ }
+
+ public String getStatusOver() {
+ return statusOver;
+ }
+
+ public void setStatusOver(String statusOver) {
+ this.statusOver = statusOver;
+ }
+
+ public String getTotalFreight() {
+ return totalFreight;
+ }
+
+ public void setTotalFreight(String totalFreight) {
+ this.totalFreight = totalFreight;
+ }
+
+ public int getVehicleLength() {
+ return vehicleLength;
+ }
+
+ public void setVehicleLength(int vehicleLength) {
+ this.vehicleLength = vehicleLength;
+ }
+
+ public String getVehicleLengthName() {
+ return vehicleLengthName;
+ }
+
+ public void setVehicleLengthName(String vehicleLengthName) {
+ this.vehicleLengthName = vehicleLengthName;
+ }
+
+ public int getVehicleType() {
+ return vehicleType;
+ }
+
+ public void setVehicleType(int vehicleType) {
+ this.vehicleType = vehicleType;
+ }
+
+ public String getVehicleTypeName() {
+ return vehicleTypeName;
+ }
+
+ public void setVehicleTypeName(String vehicleTypeName) {
+ this.vehicleTypeName = vehicleTypeName;
+ }
+
+ public long getWaybillId() {
+ return waybillId;
+ }
+
+ public void setWaybillId(long waybillId) {
+ this.waybillId = waybillId;
+ }
+
+ public static class PutInfoDTO {
+ private String address;
+ private long area;
+ private String businessCode;
+ private String businessName;
+ private Long childNumber;
+ private long city;
+ private String createTime;
+ private String deadline;
+ private long displayOrder;
+ private List goods;
+ private String latitude;
+ private String longitude;
+ private String name;
+ private String phone;
+ private long pid;
+ private long province;
+ private String provinceCityArea;
+ private long status;
+ private String totalAmount;
+ private long type;
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public long getArea() {
+ return area;
+ }
+
+ public void setArea(long area) {
+ this.area = area;
+ }
+
+ public String getBusinessCode() {
+ return businessCode;
+ }
+
+ public void setBusinessCode(String businessCode) {
+ this.businessCode = businessCode;
+ }
+
+ public String getBusinessName() {
+ return businessName;
+ }
+
+ public void setBusinessName(String businessName) {
+ this.businessName = businessName;
+ }
+
+ public Long getChildNumber() {
+ return childNumber;
+ }
+
+ public void setChildNumber(Long childNumber) {
+ this.childNumber = childNumber;
+ }
+
+ public long getCity() {
+ return city;
+ }
+
+ public void setCity(long city) {
+ this.city = city;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getDeadline() {
+ return deadline;
+ }
+
+ public void setDeadline(String deadline) {
+ this.deadline = deadline;
+ }
+
+ public long getDisplayOrder() {
+ return displayOrder;
+ }
+
+ public void setDisplayOrder(long displayOrder) {
+ this.displayOrder = displayOrder;
+ }
+
+ public List getGoods() {
+ return goods;
+ }
+
+ public void setGoods(List goods) {
+ this.goods = goods;
+ }
+
+ public String getLatitude() {
+ return latitude;
+ }
+
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+
+ public String getLongitude() {
+ return longitude;
+ }
+
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public long getPid() {
+ return pid;
+ }
+
+ public void setPid(long pid) {
+ this.pid = pid;
+ }
+
+ public long getProvince() {
+ return province;
+ }
+
+ public void setProvince(long province) {
+ this.province = province;
+ }
+
+ public String getProvinceCityArea() {
+ return provinceCityArea;
+ }
+
+ public void setProvinceCityArea(String provinceCityArea) {
+ this.provinceCityArea = provinceCityArea;
+ }
+
+ public long getStatus() {
+ return status;
+ }
+
+ public void setStatus(long status) {
+ this.status = status;
+ }
+
+ public String getTotalAmount() {
+ return totalAmount;
+ }
+
+ public void setTotalAmount(String totalAmount) {
+ this.totalAmount = totalAmount;
+ }
+
+ public long getType() {
+ return type;
+ }
+
+ public void setType(long type) {
+ this.type = type;
+ }
+
+ public static class GoodsDTO {
+ private Long childrenId;
+ private String createTime;
+ private String goodName;
+ private String goodNum;
+ private String goodPrice;
+ private String goodUnit;
+ private Long id;
+ private String packName;
+
+ public Long getChildrenId() {
+ return childrenId;
+ }
+
+ public void setChildrenId(Long childrenId) {
+ this.childrenId = childrenId;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getGoodName() {
+ return goodName;
+ }
+
+ public void setGoodName(String goodName) {
+ this.goodName = goodName;
+ }
+
+ public String getGoodNum() {
+ return goodNum;
+ }
+
+ public void setGoodNum(String goodNum) {
+ this.goodNum = goodNum;
+ }
+
+ public String getGoodPrice() {
+ return goodPrice;
+ }
+
+ public void setGoodPrice(String goodPrice) {
+ this.goodPrice = goodPrice;
+ }
+
+ public String getGoodUnit() {
+ return goodUnit;
+ }
+
+ public void setGoodUnit(String goodUnit) {
+ this.goodUnit = goodUnit;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getPackName() {
+ return packName;
+ }
+
+ public void setPackName(String packName) {
+ this.packName = packName;
+ }
+ }
+ }
+
+ public static class SendInfoDTO {
+ private String address;
+ private long area;
+ private String businessCode;
+ private String businessName;
+ private Long childNumber;
+ private long city;
+ private String createTime;
+ private String deadline;
+ private long displayOrder;
+ private List goods;
+ private String latitude;
+ private String longitude;
+ private String name;
+ private String phone;
+ private long pid;
+ private long province;
+ private String provinceCityArea;
+ private long status;
+ private String totalAmount;
+ private long type;
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public long getArea() {
+ return area;
+ }
+
+ public void setArea(long area) {
+ this.area = area;
+ }
+
+ public String getBusinessCode() {
+ return businessCode;
+ }
+
+ public void setBusinessCode(String businessCode) {
+ this.businessCode = businessCode;
+ }
+
+ public String getBusinessName() {
+ return businessName;
+ }
+
+ public void setBusinessName(String businessName) {
+ this.businessName = businessName;
+ }
+
+ public Long getChildNumber() {
+ return childNumber;
+ }
+
+ public void setChildNumber(Long childNumber) {
+ this.childNumber = childNumber;
+ }
+
+ public long getCity() {
+ return city;
+ }
+
+ public void setCity(long city) {
+ this.city = city;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getDeadline() {
+ return deadline;
+ }
+
+ public void setDeadline(String deadline) {
+ this.deadline = deadline;
+ }
+
+ public long getDisplayOrder() {
+ return displayOrder;
+ }
+
+ public void setDisplayOrder(long displayOrder) {
+ this.displayOrder = displayOrder;
+ }
+
+ public List getGoods() {
+ return goods;
+ }
+
+ public void setGoods(List goods) {
+ this.goods = goods;
+ }
+
+ public String getLatitude() {
+ return latitude;
+ }
+
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+
+ public String getLongitude() {
+ return longitude;
+ }
+
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public long getPid() {
+ return pid;
+ }
+
+ public void setPid(long pid) {
+ this.pid = pid;
+ }
+
+ public long getProvince() {
+ return province;
+ }
+
+ public void setProvince(long province) {
+ this.province = province;
+ }
+
+ public String getProvinceCityArea() {
+ return provinceCityArea;
+ }
+
+ public void setProvinceCityArea(String provinceCityArea) {
+ this.provinceCityArea = provinceCityArea;
+ }
+
+ public long getStatus() {
+ return status;
+ }
+
+ public void setStatus(long status) {
+ this.status = status;
+ }
+
+ public String getTotalAmount() {
+ return totalAmount;
+ }
+
+ public void setTotalAmount(String totalAmount) {
+ this.totalAmount = totalAmount;
+ }
+
+ public long getType() {
+ return type;
+ }
+
+ public void setType(long type) {
+ this.type = type;
+ }
+
+ public static class GoodsDTO {
+ private Long childrenId;
+ private String createTime;
+ private String goodName;
+ private String goodNum;
+ private String goodPrice;
+ private String goodUnit;
+ private Long id;
+ private String packName;
+
+ public Long getChildrenId() {
+ return childrenId;
+ }
+
+ public void setChildrenId(Long childrenId) {
+ this.childrenId = childrenId;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getGoodName() {
+ return goodName;
+ }
+
+ public void setGoodName(String goodName) {
+ this.goodName = goodName;
+ }
+
+ public String getGoodNum() {
+ return goodNum;
+ }
+
+ public void setGoodNum(String goodNum) {
+ this.goodNum = goodNum;
+ }
+
+ public String getGoodPrice() {
+ return goodPrice;
+ }
+
+ public void setGoodPrice(String goodPrice) {
+ this.goodPrice = goodPrice;
+ }
+
+ public String getGoodUnit() {
+ return goodUnit;
+ }
+
+ public void setGoodUnit(String goodUnit) {
+ this.goodUnit = goodUnit;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getPackName() {
+ return packName;
+ }
+
+ public void setPackName(String packName) {
+ this.packName = packName;
+ }
+ }
+ }
+}
+
+
diff --git a/app/src/main/java/com/oneclouds/cargo/request/WaybillRequest.java b/app/src/main/java/com/oneclouds/cargo/request/WaybillRequest.java
index 536ca07..64467f5 100644
--- a/app/src/main/java/com/oneclouds/cargo/request/WaybillRequest.java
+++ b/app/src/main/java/com/oneclouds/cargo/request/WaybillRequest.java
@@ -73,7 +73,7 @@ public class WaybillRequest {
map.put("orderStatus",orderStatus);
}
Request re = OkHttpUtil.posts(new OkDate(UrlManager.getWaybillListV2(), "post", MapUtil.mapJson(map)),getToken(con),con);
- RequestTest.test(1,WAYBILL_LIST_V2,re,con,hd);
+ RequestTest.test(1,WAYBILL_LIST_V2+orderStatus,re,con,hd);
}
//运单详情
public void orderDetail(int waybillId){
diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/CommonBodyBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/CommonBodyBean.java
new file mode 100644
index 0000000..6016b5a
--- /dev/null
+++ b/app/src/main/java/com/oneclouds/cargo/request/bean/CommonBodyBean.java
@@ -0,0 +1,19 @@
+package com.oneclouds.cargo.request.bean;
+
+/**
+ * @ClassName CommonBodyBean
+ * @Author 用户
+ * @Date 2022/9/1 11:42
+ * @Description TODO
+ */
+public class CommonBodyBean {
+ private String id;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+}
diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/OrderInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/OrderInputBean.java
index f004380..ecfcf97 100644
--- a/app/src/main/java/com/oneclouds/cargo/request/bean/OrderInputBean.java
+++ b/app/src/main/java/com/oneclouds/cargo/request/bean/OrderInputBean.java
@@ -16,6 +16,15 @@ public class OrderInputBean {
private List putTableData;
private List sendTableData;
+ public OrderInputBean() {
+ }
+
+ public OrderInputBean(FormDataDTO formData, List putTableData, List sendTableData) {
+ this.formData = formData;
+ this.putTableData = putTableData;
+ this.sendTableData = sendTableData;
+ }
+
public FormDataDTO getFormData() {
return formData;
}
diff --git a/app/src/main/java/com/oneclouds/cargo/request/net/Api.java b/app/src/main/java/com/oneclouds/cargo/request/net/Api.java
index 9b39ae0..510c18c 100644
--- a/app/src/main/java/com/oneclouds/cargo/request/net/Api.java
+++ b/app/src/main/java/com/oneclouds/cargo/request/net/Api.java
@@ -2,11 +2,14 @@ package com.oneclouds.cargo.request.net;
import com.dahe.mylibrary.net.CommonResponseBean;
-import com.oneclouds.cargo.request.bean.LoginRegInputBean;
+import com.oneclouds.cargo.bean.OrderBean2;
+import com.oneclouds.cargo.request.bean.CommonBodyBean;
+import com.oneclouds.cargo.request.bean.OrderInputBean;
import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;
+import retrofit2.http.Query;
/**
* Created by Administrator on 2018/8/8 0008.
@@ -20,8 +23,16 @@ public interface Api {
//获取版本
String VERSION = BASE_URL + "app/version";
+ //运单详情
+// @HTTP(method = "post",path = BASE_URL+"app/shipper/waybill/getExecuteWaybill", hasBody = true) waybillId
+// Observable waybillDetail(@Field("waybillId") String bean);
+ @POST(BASE_URL+"app/shipper/waybill/getOrderDetail")
+ Observable> waybillDetail(@Body CommonBodyBean bean);
- @POST(BASE_URL+"app/bank/getContracts")
- Observable log(@Body String bean);
+ @POST(BASE_URL+"/app/shipper/waybill/app/getOrderDetail")
+ Observable> waybillDetail2(@Body CommonBodyBean bean);
+
+ @POST(BASE_URL+"app/shipper/order/publishOrder")
+ Observable againOrder(@Body OrderInputBean bean);
}
diff --git a/app/src/main/java/com/oneclouds/cargo/request/net/DataManager.java b/app/src/main/java/com/oneclouds/cargo/request/net/DataManager.java
index 350a537..ab3f50a 100644
--- a/app/src/main/java/com/oneclouds/cargo/request/net/DataManager.java
+++ b/app/src/main/java/com/oneclouds/cargo/request/net/DataManager.java
@@ -51,8 +51,8 @@ public class DataManager {
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
- .addInterceptor(new JsonInterceptor())
.addInterceptor(new RequestHeadInterceptor())
+ .addInterceptor(new JsonInterceptor())
.build())
// .addNetworkInterceptor(new TokenInterceptor())
.build().create(Api.class);
diff --git a/app/src/main/java/com/oneclouds/cargo/request/net/RequestHeadInterceptor.java b/app/src/main/java/com/oneclouds/cargo/request/net/RequestHeadInterceptor.java
index 2029bf6..3a78f9a 100644
--- a/app/src/main/java/com/oneclouds/cargo/request/net/RequestHeadInterceptor.java
+++ b/app/src/main/java/com/oneclouds/cargo/request/net/RequestHeadInterceptor.java
@@ -5,9 +5,11 @@ import android.util.Log;
import com.dahe.mylibrary.utils.AppUtils;
import com.dahe.mylibrary.utils.BaseUtils;
+import com.oneclouds.cargo.constant.SPConstant;
import com.oneclouds.cargo.ui.App;
import com.oneclouds.cargo.ui.LoginActivity;
import com.oneclouds.cargo.util.SPUtil;
+import com.oneclouds.cargo.util.http.GetUtil;
import java.io.IOException;
@@ -25,16 +27,18 @@ public class RequestHeadInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request.Builder builder = chain.request().newBuilder();
- if (!TextUtils.isEmpty(SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN))) {
+ if (!TextUtils.isEmpty(SPUtil.getSP(App.getApp(), SPConstant.DATA,SPConstant.DATA_TOKEN))) {
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
- builder.addHeader("Authorization", SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN));
+ builder.addHeader("Authorization", SPUtil.getSP(App.getApp(), SPConstant.DATA,SPConstant.DATA_TOKEN));
}
Request request = builder
+ .addHeader("Content-Type", "application/json")
.addHeader("versionCode", AppUtils.getAppVersionCode() + "")
.addHeader("versionValue", AppUtils.getAppVersionName() + "")
.addHeader("deviceType", "ANDROID")
.addHeader("language", BaseUtils.getLanguage(App.getApp())+"")
.build();
+// .addHeader("Content-Type", "application/json")
Log.i(TAG, "intercept: " + request.headers());
return chain.proceed(request);
}
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/MainActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/MainActivity.java
index 2f616c2..df0be8a 100644
--- a/app/src/main/java/com/oneclouds/cargo/ui/MainActivity.java
+++ b/app/src/main/java/com/oneclouds/cargo/ui/MainActivity.java
@@ -15,8 +15,8 @@ import com.oneclouds.cargo.R;
import com.oneclouds.cargo.constant.SPConstant;
import com.oneclouds.cargo.ui.home.HomeFragment;
import com.oneclouds.cargo.ui.my.MyFragment;
-import com.oneclouds.cargo.ui.news.NewsFragment;
import com.oneclouds.cargo.ui.wallet.WalletFragment;
+import com.oneclouds.cargo.ui.waybill.WayBillsFragment;
import com.oneclouds.cargo.util.SPUtil;
import com.oneclouds.cargo.util.titleutil.StateStyleUtil;
import com.oneclouds.cargo.util.view.BaseAppCompatActivity;
@@ -41,7 +41,7 @@ public class MainActivity extends BaseAppCompatActivity {
act=this;
fs[0]=new HomeFragment();
fs[1]=new WalletFragment();
- fs[2]=new NewsFragment();
+ fs[2]=new WayBillsFragment();
fs[3]=new MyFragment();
initfindId();
initswitch();
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsDischargeActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsDischargeActivity.java
index f579ea4..bdeec2c 100644
--- a/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsDischargeActivity.java
+++ b/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsDischargeActivity.java
@@ -188,9 +188,13 @@ public class GoodsDischargeActivity extends BaseActivity {
price.setText(o.getPrice() + "");
if (o.getUnit().equals("吨")) {
num1.setText(o.getNum());
+ num2.setText("");
num2.setEnabled(false);
+ num1.setEnabled(true);
} else {
num2.setText(o.getNum());
+ num1.setText("");
+ num2.setEnabled(true);
num1.setEnabled(false);
key = false;
}
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList1Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList1Fragment.java
index 2eda30f..dd8caf2 100644
--- a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList1Fragment.java
+++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList1Fragment.java
@@ -23,10 +23,12 @@ import com.oneclouds.cargo.bean.BaseBean;
import com.oneclouds.cargo.bean.WaybillListBean;
import com.oneclouds.cargo.request.OrderRequest;
import com.oneclouds.cargo.request.WaybillRequest;
+import com.oneclouds.cargo.ui.home.NodeInfoActivity;
import com.oneclouds.cargo.ui.home.OrderDetailsActivity;
import com.oneclouds.cargo.ui.home.OrderDetailsAllActivity;
import com.oneclouds.cargo.ui.my.invoice.InvoiceCreateActivity;
import com.oneclouds.cargo.ui.parts.TypeParts;
+import com.oneclouds.cargo.ui.waybill.activity.AnotherOrderActivity;
import com.oneclouds.cargo.util.ToastUtil;
import com.oneclouds.cargo.util.adapter.AdapterAlls;
import com.oneclouds.cargo.util.adapter.ManyBean;
@@ -74,9 +76,9 @@ public class OrderList1Fragment extends BaseFragment {
sr.finishRefresh();
sr.finishLoadMore();
//获取数据
- if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) {
- Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2));
- olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class);
+ if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type)!=null) {
+ Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type));
+ olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type),WaybillListBean.class);
if(olb.getCode()==200){
if(index==1){
initData();
@@ -86,7 +88,7 @@ public class OrderList1Fragment extends BaseFragment {
}else{
ToastUtil.show(con,"加载失败");
}
- CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2);
+ CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2+type);
}
//撤销
if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) {
@@ -121,7 +123,7 @@ public class OrderList1Fragment extends BaseFragment {
}
}
- private Button submit;
+// private Button submit;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -132,19 +134,6 @@ public class OrderList1Fragment extends BaseFragment {
wr=new WaybillRequest(con,hd);
or=new OrderRequest(con,hd);
order_brv=root.findViewById(R.id.order_brv);
- submit=root.findViewById(R.id.submit);
- submit.setOnClickListener(v -> {
- if(submit_map.size()>0){
- Intent in=new Intent(con, InvoiceCreateActivity.class);
- in.putExtra("list",gson.toJson(submit_map));
- startActivity(in);
- }else{
- Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
- }
- });
- if(type==0 || type==102005){
- submit.setVisibility(View.VISIBLE);
- }
initRefreshLoad();
initView(null);
return root;
@@ -162,6 +151,7 @@ public class OrderList1Fragment extends BaseFragment {
case R.layout.order_item:
WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o;
Button btn=v.findViewById(R.id.btn);
+ Button btnAgain=v.findViewById(R.id.btnAgain);
ImageView state_img=v.findViewById(R.id.state_img);
ImageButton xuan=v.findViewById(R.id.xuan);
v.setOnClickListener(v12 -> {
@@ -187,27 +177,33 @@ public class OrderList1Fragment extends BaseFragment {
}
}
+ btnAgain.setOnClickListener(v1->{
+// Intent in=new Intent(con, NodeInfoActivity.class);
+ Intent in=new Intent(con, AnotherOrderActivity.class);
+ in.putExtra("id",ld.getOrderId());
+ startActivity(in);
+ });
xuan.setOnClickListener(v1 -> {
if(ld.getStatus()==102005){
if (keys.get(position)) {
xuan.setImageResource(R.mipmap.no_xuan);
keys.set(position,false);
num--;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.remove(position);
}else{
xuan.setImageResource(R.mipmap.xuan);
keys.set(position,true);
num++;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.put(position,gson.toJson(o));
}
}else{
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList2Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList2Fragment.java
index 29928d0..466869b 100644
--- a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList2Fragment.java
+++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList2Fragment.java
@@ -76,9 +76,9 @@ public class OrderList2Fragment extends BaseFragment {
sr.finishRefresh();
sr.finishLoadMore();
//获取数据
- if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) {
- Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2));
- olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class);
+ if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type)!=null) {
+ Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type));
+ olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type),WaybillListBean.class);
if(olb.getCode()==200){
if(index==1){
initData();
@@ -88,7 +88,7 @@ public class OrderList2Fragment extends BaseFragment {
}else{
ToastUtil.show(con,"加载失败");
}
- CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2);
+ CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2+type);
}
//撤销
if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) {
@@ -123,7 +123,7 @@ public class OrderList2Fragment extends BaseFragment {
}
}
- private Button submit;
+// private Button submit;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -134,19 +134,19 @@ public class OrderList2Fragment extends BaseFragment {
wr=new WaybillRequest(con,hd);
or=new OrderRequest(con,hd);
order_brv=root.findViewById(R.id.order_brv);
- submit=root.findViewById(R.id.submit);
- submit.setOnClickListener(v -> {
- if(submit_map.size()>0){
- Intent in=new Intent(con, InvoiceCreateActivity.class);
- in.putExtra("list",gson.toJson(submit_map));
- startActivity(in);
- }else{
- Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
- }
- });
- if(type==0 || type==102005){
- submit.setVisibility(View.VISIBLE);
- }
+// submit=root.findViewById(R.id.submit);
+// submit.setOnClickListener(v -> {
+// if(submit_map.size()>0){
+// Intent in=new Intent(con, InvoiceCreateActivity.class);
+// in.putExtra("list",gson.toJson(submit_map));
+// startActivity(in);
+// }else{
+// Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
+// }
+// });
+// if(type==0 || type==102005){
+// submit.setVisibility(View.VISIBLE);
+// }
initRefreshLoad();
initView(null);
return root;
@@ -195,21 +195,21 @@ public class OrderList2Fragment extends BaseFragment {
xuan.setImageResource(R.mipmap.no_xuan);
keys.set(position,false);
num--;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.remove(position);
}else{
xuan.setImageResource(R.mipmap.xuan);
keys.set(position,true);
num++;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.put(position,gson.toJson(o));
}
}else{
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList3Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList3Fragment.java
index e2bb966..b845c53 100644
--- a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList3Fragment.java
+++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList3Fragment.java
@@ -76,9 +76,9 @@ public class OrderList3Fragment extends BaseFragment {
sr.finishRefresh();
sr.finishLoadMore();
//获取数据
- if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) {
- Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2));
- olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class);
+ if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type)!=null) {
+ Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type));
+ olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type),WaybillListBean.class);
if(olb.getCode()==200){
if(index==1){
initData();
@@ -88,7 +88,7 @@ public class OrderList3Fragment extends BaseFragment {
}else{
ToastUtil.show(con,"加载失败");
}
- CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2);
+ CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2+type);
}
//撤销
if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) {
@@ -123,7 +123,7 @@ public class OrderList3Fragment extends BaseFragment {
}
}
- private Button submit;
+// private Button submit;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -134,19 +134,19 @@ public class OrderList3Fragment extends BaseFragment {
wr=new WaybillRequest(con,hd);
or=new OrderRequest(con,hd);
order_brv=root.findViewById(R.id.order_brv);
- submit=root.findViewById(R.id.submit);
- submit.setOnClickListener(v -> {
- if(submit_map.size()>0){
- Intent in=new Intent(con, InvoiceCreateActivity.class);
- in.putExtra("list",gson.toJson(submit_map));
- startActivity(in);
- }else{
- Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
- }
- });
- if(type==0 || type==102005){
- submit.setVisibility(View.VISIBLE);
- }
+// submit=root.findViewById(R.id.submit);
+// submit.setOnClickListener(v -> {
+// if(submit_map.size()>0){
+// Intent in=new Intent(con, InvoiceCreateActivity.class);
+// in.putExtra("list",gson.toJson(submit_map));
+// startActivity(in);
+// }else{
+// Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
+// }
+// });
+// if(type==0 || type==102005){
+// submit.setVisibility(View.VISIBLE);
+// }
initRefreshLoad();
initView(null);
return root;
@@ -195,21 +195,21 @@ public class OrderList3Fragment extends BaseFragment {
xuan.setImageResource(R.mipmap.no_xuan);
keys.set(position,false);
num--;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.remove(position);
}else{
xuan.setImageResource(R.mipmap.xuan);
keys.set(position,true);
num++;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.put(position,gson.toJson(o));
}
}else{
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList4Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList4Fragment.java
index 44152cf..ebf58ed 100644
--- a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList4Fragment.java
+++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList4Fragment.java
@@ -76,9 +76,9 @@ public class OrderList4Fragment extends BaseFragment {
sr.finishRefresh();
sr.finishLoadMore();
//获取数据
- if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) {
- Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2));
- olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class);
+ if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type)!=null) {
+ Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type));
+ olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type),WaybillListBean.class);
if(olb.getCode()==200){
if(index==1){
initData();
@@ -88,7 +88,7 @@ public class OrderList4Fragment extends BaseFragment {
}else{
ToastUtil.show(con,"加载失败");
}
- CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2);
+ CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2+type);
}
//撤销
if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) {
@@ -123,7 +123,7 @@ public class OrderList4Fragment extends BaseFragment {
}
}
- private Button submit;
+// private Button submit;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -134,19 +134,19 @@ public class OrderList4Fragment extends BaseFragment {
wr=new WaybillRequest(con,hd);
or=new OrderRequest(con,hd);
order_brv=root.findViewById(R.id.order_brv);
- submit=root.findViewById(R.id.submit);
- submit.setOnClickListener(v -> {
- if(submit_map.size()>0){
- Intent in=new Intent(con, InvoiceCreateActivity.class);
- in.putExtra("list",gson.toJson(submit_map));
- startActivity(in);
- }else{
- Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
- }
- });
- if(type==0 || type==102005){
- submit.setVisibility(View.VISIBLE);
- }
+// submit=root.findViewById(R.id.submit);
+// submit.setOnClickListener(v -> {
+// if(submit_map.size()>0){
+// Intent in=new Intent(con, InvoiceCreateActivity.class);
+// in.putExtra("list",gson.toJson(submit_map));
+// startActivity(in);
+// }else{
+// Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
+// }
+// });
+// if(type==0 || type==102005){
+// submit.setVisibility(View.VISIBLE);
+// }
initRefreshLoad();
initView(null);
return root;
@@ -195,21 +195,21 @@ public class OrderList4Fragment extends BaseFragment {
xuan.setImageResource(R.mipmap.no_xuan);
keys.set(position,false);
num--;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.remove(position);
}else{
xuan.setImageResource(R.mipmap.xuan);
keys.set(position,true);
num++;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.put(position,gson.toJson(o));
}
}else{
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList5Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList5Fragment.java
index 1ab67e8..abdfd1f 100644
--- a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList5Fragment.java
+++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList5Fragment.java
@@ -74,9 +74,9 @@ public class OrderList5Fragment extends BaseFragment {
sr.finishRefresh();
sr.finishLoadMore();
//获取数据
- if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) {
- Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2));
- olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class);
+ if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type)!=null) {
+ Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type));
+ olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type),WaybillListBean.class);
if(olb.getCode()==200){
if(index==1){
initData();
@@ -86,7 +86,7 @@ public class OrderList5Fragment extends BaseFragment {
}else{
ToastUtil.show(con,"加载失败");
}
- CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2);
+ CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2+type);
}
//撤销
if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) {
@@ -121,7 +121,7 @@ public class OrderList5Fragment extends BaseFragment {
}
}
- private Button submit;
+// private Button submit;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -132,19 +132,19 @@ public class OrderList5Fragment extends BaseFragment {
wr=new WaybillRequest(con,hd);
or=new OrderRequest(con,hd);
order_brv=root.findViewById(R.id.order_brv);
- submit=root.findViewById(R.id.submit);
- submit.setOnClickListener(v -> {
- if(submit_map.size()>0){
- Intent in=new Intent(con, InvoiceCreateActivity.class);
- in.putExtra("list",gson.toJson(submit_map));
- startActivity(in);
- }else{
- Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
- }
- });
- if(type==0 || type==102005){
- submit.setVisibility(View.VISIBLE);
- }
+// submit=root.findViewById(R.id.submit);
+// submit.setOnClickListener(v -> {
+// if(submit_map.size()>0){
+// Intent in=new Intent(con, InvoiceCreateActivity.class);
+// in.putExtra("list",gson.toJson(submit_map));
+// startActivity(in);
+// }else{
+// Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
+// }
+// });
+// if(type==0 || type==102005){
+// submit.setVisibility(View.VISIBLE);
+// }
initRefreshLoad();
initView(null);
return root;
@@ -193,21 +193,21 @@ public class OrderList5Fragment extends BaseFragment {
xuan.setImageResource(R.mipmap.no_xuan);
keys.set(position,false);
num--;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.remove(position);
}else{
xuan.setImageResource(R.mipmap.xuan);
keys.set(position,true);
num++;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.put(position,gson.toJson(o));
}
}else{
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList6Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList6Fragment.java
index bbb5a12..732dba9 100644
--- a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList6Fragment.java
+++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList6Fragment.java
@@ -76,9 +76,9 @@ public class OrderList6Fragment extends BaseFragment {
sr.finishRefresh();
sr.finishLoadMore();
//获取数据
- if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) {
- Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2));
- olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class);
+ if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type)!=null) {
+ Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type));
+ olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2+type),WaybillListBean.class);
if(olb.getCode()==200){
if(index==1){
initData();
@@ -88,7 +88,7 @@ public class OrderList6Fragment extends BaseFragment {
}else{
ToastUtil.show(con,"加载失败");
}
- CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2);
+ CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2+type);
}
//撤销
if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) {
@@ -123,7 +123,7 @@ public class OrderList6Fragment extends BaseFragment {
}
}
- private Button submit;
+// private Button submit;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -134,19 +134,19 @@ public class OrderList6Fragment extends BaseFragment {
wr=new WaybillRequest(con,hd);
or=new OrderRequest(con,hd);
order_brv=root.findViewById(R.id.order_brv);
- submit=root.findViewById(R.id.submit);
- submit.setOnClickListener(v -> {
- if(submit_map.size()>0){
- Intent in=new Intent(con, InvoiceCreateActivity.class);
- in.putExtra("list",gson.toJson(submit_map));
- startActivity(in);
- }else{
- Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
- }
- });
- if(type==0 || type==102005){
- submit.setVisibility(View.VISIBLE);
- }
+// submit=root.findViewById(R.id.submit);
+// submit.setOnClickListener(v -> {
+// if(submit_map.size()>0){
+// Intent in=new Intent(con, InvoiceCreateActivity.class);
+// in.putExtra("list",gson.toJson(submit_map));
+// startActivity(in);
+// }else{
+// Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show();
+// }
+// });
+// if(type==0 || type==102005){
+// submit.setVisibility(View.VISIBLE);
+// }
initRefreshLoad();
initView(null);
return root;
@@ -195,21 +195,21 @@ public class OrderList6Fragment extends BaseFragment {
xuan.setImageResource(R.mipmap.no_xuan);
keys.set(position,false);
num--;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.remove(position);
}else{
xuan.setImageResource(R.mipmap.xuan);
keys.set(position,true);
num++;
- if(num>0){
- submit.setText("提交开票申请("+num+")");
- }else{
- submit.setText("提交开票申请");
- }
+// if(num>0){
+// submit.setText("提交开票申请("+num+")");
+// }else{
+// submit.setText("提交开票申请");
+// }
submit_map.put(position,gson.toJson(o));
}
}else{
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/waybill/WayBillsFragment.kt b/app/src/main/java/com/oneclouds/cargo/ui/waybill/WayBillsFragment.kt
new file mode 100644
index 0000000..08cc6e5
--- /dev/null
+++ b/app/src/main/java/com/oneclouds/cargo/ui/waybill/WayBillsFragment.kt
@@ -0,0 +1,67 @@
+package com.oneclouds.cargo.ui.waybill
+
+import androidx.fragment.app.Fragment
+import androidx.fragment.app.FragmentManager
+import androidx.fragment.app.FragmentPagerAdapter
+import com.dahe.mylibrary.base.BaseFragment
+import com.oneclouds.cargo.R
+import com.oneclouds.cargo.ui.home.OrderListActivity
+import com.oneclouds.cargo.ui.home.typelist.*
+import com.oneclouds.cargo.ui.parts.UserParts
+import com.xuexiang.xui.widget.tabbar.TabSegment
+import kotlinx.android.synthetic.main.fragment_waybill_list.*
+import kotlinx.android.synthetic.main.order_list_top.*
+
+/**
+ * @ClassName WayBillsFragment
+ * @Author 用户
+ * @Date 2022/9/1 9:26
+ * @Description TODO
+ */
+class WayBillsFragment : BaseFragment() {
+ var list = mutableListOf()
+ private val titles = arrayOf("全部", "待调度", "已装货", "已卸货", "已结算")
+
+ override fun getContentViewLayoutID() = R.layout.fragment_waybill_list
+
+ override fun onFragmentVisibleChange(isVisible: Boolean) {
+
+ }
+
+ override fun onFragmentFirstVisible() {
+ val user = UserParts.getUser(activity)
+ waybillNum.text = user.data.waybillNum.toString()
+ distance.text = user.data.distance.toString()
+ freight.text = user.data.freight.toString()
+
+
+ list.add(OrderList1Fragment())
+ list.add(OrderList2Fragment())
+ list.add(OrderList3Fragment())
+ list.add(OrderList4Fragment())
+ list.add(OrderList5Fragment())
+ for (page in titles) {
+ tabSegment.addTab(TabSegment.Tab(page))
+ }
+
+ vp.adapter = MyAdapter(this.fragmentManager)
+ tabSegment.setupWithViewPager(vp, false)
+ tabSegment.setMode(TabSegment.MODE_FIXED)
+ }
+
+ inner class MyAdapter(fm: FragmentManager?) :
+ FragmentPagerAdapter(fm!!) {
+ override fun getItem(position: Int): Fragment {
+ return list.get(position)
+ }
+
+ override fun getCount(): Int {
+ return list.size
+ }
+
+ //重写这个方法,将设置每个Tab的标题
+ override fun getPageTitle(position: Int): CharSequence? {
+ return titles.get(position)
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/oneclouds/cargo/ui/waybill/activity/AnotherOrderActivity.kt b/app/src/main/java/com/oneclouds/cargo/ui/waybill/activity/AnotherOrderActivity.kt
new file mode 100644
index 0000000..ddeb6f7
--- /dev/null
+++ b/app/src/main/java/com/oneclouds/cargo/ui/waybill/activity/AnotherOrderActivity.kt
@@ -0,0 +1,632 @@
+package com.oneclouds.cargo.ui.waybill.activity
+
+import android.content.Intent
+import android.os.Bundle
+import android.text.TextUtils
+import android.util.Log
+import android.view.View
+import android.widget.EditText
+import android.widget.RelativeLayout
+import android.widget.TextView
+import android.widget.Toast
+import com.dahe.mylibrary.base.BaseActivity
+import com.dahe.mylibrary.net.CommonResponseBean
+import com.github.gzuliyujiang.wheelpicker.DatimePicker
+import com.github.gzuliyujiang.wheelpicker.OptionPicker
+import com.github.gzuliyujiang.wheelpicker.annotation.DateMode
+import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode
+import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity
+import com.google.gson.Gson
+import com.lxj.xpopup.XPopup
+import com.oneclouds.cargo.R
+import com.oneclouds.cargo.base.AppConfig
+import com.oneclouds.cargo.bean.*
+import com.oneclouds.cargo.event.AddressEvent
+import com.oneclouds.cargo.event.BaseEvent
+import com.oneclouds.cargo.event.GoodsEvent
+import com.oneclouds.cargo.request.bean.CommonBodyBean
+import com.oneclouds.cargo.request.bean.OrderInputBean
+import com.oneclouds.cargo.request.bean.OrderInputBean.PutTableDataDTO
+import com.oneclouds.cargo.request.bean.OrderInputBean.SendTableDataDTO
+import com.oneclouds.cargo.request.net.BaseObserver
+import com.oneclouds.cargo.request.net.DataManager
+import com.oneclouds.cargo.request.net.RxHttpCallBack
+import com.oneclouds.cargo.ui.LoginActivity
+import com.oneclouds.cargo.ui.UiAuxiliary
+import com.oneclouds.cargo.ui.home.DisCarActivity
+import com.oneclouds.cargo.ui.home.GoodsActivity
+import com.oneclouds.cargo.ui.home.GoodsDischargeActivity
+import com.oneclouds.cargo.ui.my.AddressActivity
+import com.oneclouds.cargo.ui.parts.TypeParts
+import com.oneclouds.cargo.ui.parts.UserParts
+import com.oneclouds.cargo.util.StringUtil
+import com.oneclouds.cargo.util.adapter.AdapterAll
+import com.oneclouds.cargo.util.adapter.AdapterAlls
+import com.oneclouds.cargo.util.adapter.ManyBean
+import com.oneclouds.cargo.util.view.BaseRecyclerView
+import com.oneclouds.cargo.weight.RecyclerViewDecoration
+import kotlinx.android.synthetic.main.activity_anohter_order.*
+import kotlinx.android.synthetic.main.item_node_pretend.*
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+
+/**
+ * @ClassName AnotherOrderActivity
+ * @Author 用户
+ * @Date 2022/9/1 10:34
+ * @Description TODO
+ */
+class AnotherOrderActivity : BaseActivity() {
+ lateinit var tvName: TextView
+ lateinit var tvNameDis: TextView
+ lateinit var tvPhone: TextView
+ lateinit var tvPhoneDis: TextView
+ lateinit var tvAddress: TextView
+ lateinit var tvAddressDis: TextView
+ lateinit var tvStartTime: TextView
+ lateinit var etMoney: EditText
+ lateinit var tvEndTimeDis: TextView
+ lateinit var ryPretend: BaseRecyclerView
+ lateinit var ryDis: BaseRecyclerView
+
+ private var goodsType = 0 //0装 1卸
+ private var updatePosGoods = -1
+ private var updatePosGoodsDis = -1
+ var gson = Gson()
+
+
+ private var oib = OrderInputBean(OrderInputBean.FormDataDTO(),
+ mutableListOf(),
+ mutableListOf())
+
+
+
+ override fun getLayout() = R.layout.activity_anohter_order
+
+ override fun initView(savedInstanceState: Bundle?) {
+ setStatusBarColor(R.color.color_theme)
+ setTitleBar("再来一单") { finish() }
+ EventBus.getDefault().register(this)
+ initRe()
+ initListener()
+ }
+
+ override fun initDate() {
+ val waybillId = getIntent().getExtras()?.getInt("id")
+ waybillId?.let {
+ DataManager.getInstance()
+ .waybillDetail2(CommonBodyBean().apply { id = waybillId.toString() })
+ .compose(DataManager.setThread())
+ .subscribe(BaseObserver(mContext, object : RxHttpCallBack() {
+ override fun onSuccess(t: CommonResponseBean) {
+ super.onSuccess(t)
+ oib = t.data
+ initRe()
+ }
+ }))
+ }
+ }
+
+ fun initRe() {
+ val list: MutableList = ArrayList()
+ list.add(ManyBean(AddressBean(), R.layout.item_node_pretend))
+ list.add(ManyBean(AddressBean(), R.layout.item_node_dis))
+ rv.creates(this, list)
+ .setOnItemViewListener(AdapterAlls.onItemViewListenter { position: Int, o: Any, v: View, layout: Int ->
+ when (layout) {
+ R.layout.item_node_pretend -> initPretend(position, v)
+ R.layout.item_node_dis -> initDis(position, v)
+ }
+ })
+ if (!TextUtils.isEmpty(oib.formData.effectiveTime)) {
+ val ctb = TypeParts.getCarTypeLong(this)//车辆类型
+ val bb = TypeParts.getBusType(this)//车长
+ val nb = TypeParts.getNpType(this)//货物大类-交通厅
+ val ab = TypeParts.getAlType(this)//货物大类-安联
+ vehicle_type.text = ctb.data.type.find { it.value == oib.formData.vehicleType }?.name
+ vehicle_length.text =
+ ctb.data.length.find { it.value == oib.formData.vehicleLength }?.name
+ businessType.text = bb.data.find { it.value == oib.formData.businessType }?.name
+ tvHwdlJt.text = nb.data.find { it.id == oib.formData.goodsBigCate }?.cateName
+ tvHwdlAl.text = ab.data.find { it.id == oib.formData.alctGoodsType }?.name
+ effectiveTime.text = oib.formData.effectiveTime
+ }
+
+ }
+
+ /**
+ * 初始化卸货
+ *
+ * @param position
+ * @param o
+ * @param v
+ * @param layout
+ */
+ private fun initDis(position: Int, v: View) {
+ if (oib.putTableData.size == 0) {
+ return
+ }
+ val rlTopDis = v.findViewById(R.id.rlTopDis)
+ tvNameDis = v.findViewById(R.id.tvName)
+ tvPhoneDis = v.findViewById(R.id.tvPhone)
+ tvAddressDis = v.findViewById(R.id.tvAddress)
+ val tvAddDis = v.findViewById(R.id.tvAddDis)
+ tvEndTimeDis = v.findViewById(R.id.tvEndTime)
+ ryDis = v.findViewById(R.id.ryDis)
+ ryDis.addItemDecoration(RecyclerViewDecoration(this, RecyclerViewDecoration.VERTICAL_LIST))
+ ryDis.createV(this,
+ ArrayList(),
+ R.layout.item_cargo)
+ .setOnItemViewListener(
+ AdapterAll.onItemViewListenter { position1: Int, o1: Any?, v1: View ->
+ val tvHWName = v1.findViewById(R.id.tvHWName)
+ val tvCount = v1.findViewById(R.id.tvCount)
+ val tvDw = v1.findViewById(R.id.tvDw)
+ val tvBzfs = v1.findViewById(R.id.tvBzfs)
+ val tvDel = v1.findViewById(R.id.tvDel)
+// OrderInputBean.PutTableDataDTO.GoodsDTO osg1 = (OrderInputBean.PutTableDataDTO.GoodsDTO) o1;
+ val osg1: OrderInputBean.PutTableDataDTO.GoodsDTO =
+ oib.putTableData.get(0).getGoods().get(position1)
+ tvHWName.text = osg1.name
+ tvCount.text = osg1.num
+ tvDw.text = osg1.unit
+ tvBzfs.text = osg1.packName
+ v1.setOnClickListener { v2: View? ->
+ goodsType = 1
+ updatePosGoodsDis = position1
+ val `in` = Intent(this, GoodsDischargeActivity::class.java)
+ `in`.putExtra("goodData", gson.toJson(oib))
+ `in`.putExtra("choiceData", gson.toJson(oib.putTableData.get(0).goods.get(position1)))
+ startActivity(`in`)
+ }
+ tvDel.setOnClickListener { v22: View? ->
+ oib.putTableData.get(0).goods.remove(osg1)
+ ryDis.delItemV(position1)
+ }
+ })
+
+ val putTableDataDTO = oib.putTableData.get(0)
+ tvNameDis.text = putTableDataDTO.loadingName
+ tvPhoneDis.text = putTableDataDTO.loadingPhone
+ tvAddressDis.text = putTableDataDTO.detailAddress
+ tvEndTimeDis.text = putTableDataDTO.loadingDeadline
+ ryDis.notifyDatas(putTableDataDTO.getGoods())
+
+ rlTopDis.setOnClickListener { v12: View? ->
+ val `in` = Intent(this, AddressActivity::class.java)
+ `in`.putExtra("type", 1)
+ startActivity(`in`)
+ }
+ tvAddDis.setOnClickListener { V: View? ->
+ if (oib.getSendTableData().get(0).getGoods() != null && oib.getSendTableData().get(0)
+ .getGoods().size > 0
+ ) {
+ goodsType = 1
+ val `in` = Intent(this, GoodsDischargeActivity::class.java)
+ `in`.putExtra("goodData", gson.toJson(oib))
+ startActivity(`in`)
+ } else {
+ Toast.makeText(this, "请先添加装货信息", Toast.LENGTH_LONG).show()
+ }
+ }
+ tvEndTimeDis.setOnClickListener(View.OnClickListener { V: View? ->
+ val ap = DatimePicker(this)
+ val wheelLayout = ap.wheelLayout
+ ap.setOnDatimePickedListener { year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int ->
+ val text =
+ year.toString() + "-" + getRead(month) + "-" + getRead(day) + " " + getRead(hour) + ":" + getRead(
+ minute)
+ oib.putTableData.get(0).setLoadingDeadline(text)
+ tvEndTimeDis.setText(text)
+ }
+ wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY)
+ wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND)
+ wheelLayout.setRange(DatimeEntity.now(), DatimeEntity.yearOnFuture(10))
+ wheelLayout.setDateLabel("年", "月", "日")
+ wheelLayout.setTimeLabel("时", "分", "")
+ ap.show()
+ })
+ }
+
+ /**
+ * 装货初始化
+ *
+ * @param position
+ * @param o
+ * @param v
+ * @param layout
+ */
+ private fun initPretend(position: Int, v: View) {
+ if (oib.sendTableData.size == 0) {
+ return
+ }
+
+ tvName = v.findViewById(R.id.tvName)
+ tvPhone = v.findViewById(R.id.tvPhone)
+ tvAddress = v.findViewById(R.id.tvAddress)
+ etMoney = v.findViewById(R.id.etMoney)
+ tvStartTime = v.findViewById(R.id.tvStartTime)
+ val tvAddPre = v.findViewById(R.id.tvAddPre)
+ val rlTop = v.findViewById(R.id.rlTop)
+ ryPretend = v.findViewById(R.id.ryPretend)
+
+
+ val sendTableDataDTO = oib.sendTableData.get(0)
+ tvName.text = sendTableDataDTO.loadingName
+ tvPhone.text = sendTableDataDTO.loadingPhone
+ tvAddress.text = sendTableDataDTO.detailAddress
+ tvStartTime.text = sendTableDataDTO.loadingDeadline
+// etMoney.setText(sendTableDataDTO.totalFreight)
+
+
+ rlTop.setOnClickListener { v12: View? ->
+ val `in` = Intent(this, AddressActivity::class.java)
+ `in`.putExtra("type", 0)
+ startActivity(`in`)
+ }
+ tvAddPre.setOnClickListener { V: View? ->
+ goodsType = 0
+ val `in` = Intent(this, GoodsActivity::class.java)
+ startActivity(`in`)
+ }
+ tvStartTime.setOnClickListener(View.OnClickListener { V: View? ->
+ val ap = DatimePicker(this)
+ val wheelLayout = ap.wheelLayout
+ ap.setOnDatimePickedListener { year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int ->
+ val text =
+ year.toString() + "-" + getRead(month) + "-" + getRead(day) + " " + getRead(hour) + ":" + getRead(
+ minute)
+ oib.sendTableData.get(0).setLoadingDeadline(text)
+ tvStartTime.setText(text)
+ }
+ wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY)
+ wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND)
+ wheelLayout.setRange(DatimeEntity.now(), DatimeEntity.yearOnFuture(10))
+ wheelLayout.setDateLabel("年", "月", "日")
+ wheelLayout.setTimeLabel("时", "分", "")
+ ap.show()
+ })
+ ryPretend.addItemDecoration(RecyclerViewDecoration(this,
+ RecyclerViewDecoration.VERTICAL_LIST))
+ ryPretend.createV(this, oib.sendTableData.get(0).goods, R.layout.item_cargo)
+ .setOnItemViewListener(AdapterAll.onItemViewListenter { position1: Int, o1: Any, v1: View ->
+ val tvHWName = v1.findViewById(R.id.tvHWName)
+ val tvCount = v1.findViewById(R.id.tvCount)
+ val tvDw = v1.findViewById(R.id.tvDw)
+ val tvBzfs = v1.findViewById(R.id.tvBzfs)
+ val tvDel = v1.findViewById(R.id.tvDel)
+ if (oib.sendTableData.size > 0) {
+ val osg1 = o1 as OrderInputBean.SendTableDataDTO.GoodsDTO
+ tvHWName.text = osg1.name
+ tvCount.text = osg1.num
+ tvDw.text = osg1.unit
+ tvBzfs.text = osg1.packName
+ v1.setOnClickListener { v2: View? ->
+ goodsType = 0
+ updatePosGoods = position1
+ val `in` = Intent(this, GoodsActivity::class.java)
+ `in`.putExtra("goodData", Gson().toJson(osg1))
+ startActivity(`in`)
+ }
+ tvDel.setOnClickListener { v22: View? ->
+ if (oib.sendTableData.get(0).getGoods().size > 0) {
+ XPopup.Builder(this) // .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
+ .asConfirm("请确认", "删除装货货物,需重新添加卸货地址货物?",
+ "取消", "确认",
+ {
+
+ ryPretend.delItemV(position1)
+ oib.putTableData.get(0).goods = oib.putTableData.get(0).getGoods().filter { it.name!= osg1.name }
+ ryDis.delAllDatas()
+ ryDis.notifyDatas(oib.putTableData.get(0).goods)
+// ryDis.notifyDatas(oib.putTableData.get(0).goods)
+// oib.putTableData.get(0).getGoods().clear()
+// ryDis.delAllDatas()
+ }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
+ .show()
+ } else {
+ ryPretend.delItemV(position1)
+ }
+ }
+ }
+ })
+ }
+
+ private fun initListener() {
+ //车型
+ r3.setOnClickListener {
+ if (isLogin()) {
+ etMoney.clearFocus()
+ val ctb = TypeParts.getCarTypeLong(this)
+ val data: MutableList = java.util.ArrayList()
+ for (typeDTO in ctb.data.type) {
+ data.add(OptionBaseBean(typeDTO.value, typeDTO.name))
+ }
+ val picker = OptionPicker(this)
+ picker.setBodyWidth(140)
+ picker.setOnOptionPickedListener { position: Int, item: Any ->
+ val obb = item as OptionBaseBean
+ vehicle_type.text = obb.name
+ oib.formData.vehicleType = obb.id
+ }
+ picker.setData(data)
+ picker.setDefaultPosition(2)
+ picker.show()
+ }
+ }
+ //车长
+ r31.setOnClickListener {
+ if (isLogin()) {
+ etMoney.clearFocus()
+ val ctb = TypeParts.getCarTypeLong(this)
+ val data: MutableList = java.util.ArrayList()
+ for (lengthDTO in ctb.data.length) {
+ data.add(OptionBaseBean(lengthDTO.value, lengthDTO.name))
+ }
+ val picker = OptionPicker(this)
+ picker.setBodyWidth(140)
+ picker.setOnOptionPickedListener { position: Int, item: Any ->
+ val obb = item as OptionBaseBean
+ vehicle_length.text = obb.name
+ oib.formData.vehicleLength = obb.id
+ }
+ picker.setData(data)
+ picker.setDefaultPosition(2)
+ picker.show()
+ }
+ }
+ //业务类型
+ r4.setOnClickListener {
+ if (isLogin()) {
+ etMoney.clearFocus()
+ val btb = TypeParts.getBusType(this)
+ val data: MutableList = java.util.ArrayList()
+ for (datum in btb.data) {
+ data.add(OptionBaseBean(datum.value, datum.name))
+ }
+ val picker = OptionPicker(this)
+ picker.setBodyWidth(140)
+ picker.setOnOptionPickedListener { position: Int, item: Any ->
+ val obb = item as OptionBaseBean
+ businessType.text = obb.name
+ oib.formData.businessType = obb.id
+ }
+ picker.setData(data)
+ picker.setDefaultPosition(2)
+ picker.show()
+ }
+ }
+ //货物大类(交通厅)
+ r7.setOnClickListener {
+ if (isLogin()) {
+ etMoney.clearFocus()
+ val al = TypeParts.getNpType(this)
+ val data: MutableList = java.util.ArrayList()
+ for (datum in al.data) {
+ data.add(OptionBaseBean(datum.id, datum.cateName))
+ }
+ val picker = OptionPicker(this)
+ picker.setBodyWidth(140)
+ picker.setOnOptionPickedListener { position: Int, item: Any ->
+ val obb = item as OptionBaseBean
+ tvHwdlJt.text = obb.name
+ oib.formData.goodsBigCate = obb.id
+ }
+ picker.setData(data)
+ picker.setDefaultPosition(2)
+ picker.show()
+ }
+ }
+ //货物大类(安联)
+ r8.setOnClickListener {
+ if (isLogin()) {
+ etMoney.clearFocus()
+ val al = TypeParts.getAlType(this)
+ val data: MutableList = java.util.ArrayList()
+ for (datum in al.data) {
+ data.add(OptionBaseBean(datum.id, datum.name))
+ }
+ val picker = OptionPicker(this)
+ picker.setBodyWidth(140)
+ picker.setOnOptionPickedListener { position: Int, item: Any ->
+ val obb = item as OptionBaseBean
+ tvHwdlAl.text = obb.name
+ oib.formData.alctGoodsType = obb.id
+ }
+ picker.setData(data)
+ picker.setDefaultPosition(14)
+ picker.show()
+ }
+ }
+ //订单有效期
+ r5.setOnClickListener {
+ if (isLogin()) {
+ etMoney.clearFocus()
+ val ap = DatimePicker(this)
+ val wheelLayout = ap.wheelLayout
+ ap.setOnDatimePickedListener { year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int ->
+ val text =
+ year.toString() + "-" + getRead(month) + "-" + getRead(day) + " " + getRead(
+ hour) + ":" + getRead(
+ minute)
+ effectiveTime.text = text
+ oib.formData.effectiveTime = text
+ }
+ wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY)
+ wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND)
+ wheelLayout.setRange(DatimeEntity.now(), DatimeEntity.yearOnFuture(10))
+ wheelLayout.setDateLabel("年", "月", "日")
+ wheelLayout.setTimeLabel("时", "分", "")
+ ap.show()
+ }
+ }
+
+ //分配车辆
+ etCar.setOnClickListener { V: View? ->
+ val intent = Intent(this, DisCarActivity::class.java)
+ intent.putExtra(AppConfig.STRING, etCar.text.toString())
+ startActivity(intent)
+ }
+
+ submit.setOnClickListener {
+ if (isLogin()) {
+ if (!TypeParts.isEntrust(this)) {
+ for (sendTableDatum in oib.sendTableData) {
+ var ub = UserParts.getUser(this)
+ if (ub != null) {
+ if (StringUtil.isNull(ub.getData().getCompanyName(), "") == "") {
+ sendTableDatum.businessName =
+ StringUtil.isNull(ub.getData().getRname(), "")
+ } else {
+ sendTableDatum.businessName = ub.getData().getCompanyName()
+ }
+ }
+ }
+ if (etMoney.text.toString().isEmpty()){
+ showToast("请输入运费信息")
+ return@setOnClickListener
+ }
+ if (oib.sendTableData[0].goods.size>0 &&oib.putTableData[0].goods.size>0 && !TextUtils.isEmpty(
+ oib.formData.shipperCarId)
+ ) {
+ XPopup.Builder(this)
+ .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
+ .asConfirm("请确认", "是否确定提交此订单?",
+ "取消", "确认",
+ {
+ oib.isSubmit = 1
+ oib.formData.isSubmit = 1
+ oib.sendTableData[0].totalPrice = etMoney.text.toString().toDouble()
+ Log.e("货源信息", Gson().toJson(oib))
+ DataManager.getInstance().againOrder(oib)
+ .compose(DataManager.setThread())
+ .subscribe(BaseObserver(mContext,object : RxHttpCallBack(){
+ override fun onSuccess(t: CommonResponseBean?) {
+ super.onSuccess(t)
+ showToast("订单创建成功")
+ }
+ }))
+
+
+ }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
+ .show()
+ } else {
+ Toast.makeText(this, "提交订单信息不完整", Toast.LENGTH_LONG).show()
+ }
+ } else {
+ Toast.makeText(this, "此账户不能进行发货操作", Toast.LENGTH_LONG).show()
+ }
+ } else {
+ Toast.makeText(this, "请先登录", Toast.LENGTH_LONG).show()
+ }
+ }
+ }
+
+ //选择分配车辆回调
+ @Subscribe
+ fun disCarEvent(baseEvent: BaseEvent<*>) {
+ if (baseEvent.data is CarBean) {
+ val data = baseEvent.data as CarBean
+ etCar.text = data.carNum + " " + data.driverPhone
+ oib.formData.shipperCarId = data.carId.toString() + ""
+ oib.formData.shipperDriverId = data.driverId.toString() + ""
+ }
+ }
+
+
+ @Subscribe
+ fun addressResult(event: AddressEvent) {
+ Log.e("返回结果", event.message + "--")
+ var ad = Gson().fromJson(event.message,
+ AddressListBean.DataDTO.RecordsDTO::class.java)
+ val list: MutableList = java.util.ArrayList()
+ list.add(ad.getProvince())
+ list.add(ad.getCity())
+ list.add(ad.getArea())
+ if (event.type == 0) {
+ oib.sendTableData.get(0).setDetailAddress(ad.getAddressDetail())
+ oib.sendTableData.get(0).setLoadingName(ad.getContactPerson())
+ oib.sendTableData.get(0).setLoadingPhone(ad.getContactNumber())
+ oib.sendTableData.get(0).setCompanyCode(ad.getCompanyCode())
+ oib.sendTableData.get(0).setCompanyName(ad.getCompanyName())
+ oib.sendTableData.get(0).setLoadingAddress(list)
+ tvName.setText(ad.getContactPerson())
+ tvPhone.setText(ad.getContactNumber())
+ tvAddress.setText(ad.getAddressDetail())
+ // GetObjectName.ZIModel(address_box,os,con);
+ } else {
+ oib.putTableData.get(0).setDetailAddress(ad.getAddressDetail())
+ oib.putTableData.get(0).setLoadingName(ad.getContactPerson())
+ oib.putTableData.get(0).setLoadingPhone(ad.getContactNumber())
+ oib.putTableData.get(0).setCompanyCode(ad.getCompanyCode())
+ oib.putTableData.get(0).setCompanyName(ad.getCompanyName())
+ oib.putTableData.get(0).setLoadingAddress(list)
+ tvNameDis.setText(ad.getContactPerson())
+ tvPhoneDis.setText(ad.getContactNumber())
+ tvAddressDis.setText(ad.getAddressDetail())
+ // GetObjectName.ZIModel(address_box,op,con);
+ }
+ }
+
+ @Subscribe
+ fun goodsResult(event: GoodsEvent) {
+ Log.e("返回结果", event.message + "--")
+ if (goodsType == 0) {
+ val osg1 = Gson().fromJson(event.message,
+ SendTableDataDTO.GoodsDTO::class.java)
+ if (-1 != updatePosGoods) {
+ oib.sendTableData.get(0).goods.set(updatePosGoods, osg1)
+// os.getGoods().set(updatePosGoods, osg1)
+ ryPretend.updateItemV(updatePosGoods, osg1)
+
+ //删除卸货货物信息
+// oib.putTableData.get(0).getGoods().clear()
+// ryDis.delAllDatas()
+ updatePosGoods = -1
+ } else {
+// os.getGoods().add(osg1);
+ ryPretend.addItemV(osg1)
+
+// 同步卸货货物
+ val goodsDTO = Gson().fromJson(event.message,
+ PutTableDataDTO.GoodsDTO::class.java)
+// op.getGoods().add(goodsDTO)
+ oib.putTableData.get(0).getGoods().add(goodsDTO)
+ ryDis.addItemV(goodsDTO)
+ }
+ } else {
+ val osg2 = Gson().fromJson(event.message,
+ PutTableDataDTO.GoodsDTO::class.java)
+ if (-1 != updatePosGoodsDis) {
+ oib.putTableData.get(0).getGoods().set(updatePosGoodsDis, osg2)
+ ryDis.updateItemV(updatePosGoodsDis, osg2)
+ updatePosGoodsDis = -1
+ } else {
+ oib.putTableData.get(0).getGoods().add(osg2)
+ ryDis.addItemV(osg2)
+ }
+
+ }
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ EventBus.getDefault().unregister(this)
+ }
+
+ fun isLogin(): Boolean {
+ return if (UiAuxiliary.isLogin(this)) {
+ true
+ } else {
+ val `in` = Intent(this, LoginActivity::class.java)
+ startActivity(`in`)
+ false
+ }
+ }
+
+ fun getRead(num: Int): String? {
+ return if (num < 10) {
+ "0$num"
+ } else num.toString() + ""
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_anohter_order.xml b/app/src/main/res/layout/activity_anohter_order.xml
new file mode 100644
index 0000000..fd71c34
--- /dev/null
+++ b/app/src/main/res/layout/activity_anohter_order.xml
@@ -0,0 +1,446 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 7a40b85..48f203a 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -76,6 +76,7 @@
android:layout_gravity="center"
/>
+
+ >
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_waybill_list.xml b/app/src/main/res/layout/fragment_waybill_list.xml
new file mode 100644
index 0000000..5d325a9
--- /dev/null
+++ b/app/src/main/res/layout/fragment_waybill_list.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/order_item.xml b/app/src/main/res/layout/order_item.xml
index 14618d2..fc3df8c 100644
--- a/app/src/main/res/layout/order_item.xml
+++ b/app/src/main/res/layout/order_item.xml
@@ -1,91 +1,101 @@
-
+
+
+
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/dp_8">
+
+
+ android:layout_gravity="center"
+ android:background="@color/color_theme" />
+
+ android:textSize="@dimen/sp_13" />
+
+ android:textSize="@dimen/sp_13" />
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_marginRight="@dimen/dp_10">
+
+ android:src="@mipmap/no_xuan" />
+
+ android:layout_marginTop="@dimen/dp_5"
+ android:background="#EFEFEF" />
+
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/dp_11">
+
+
+
+ android:src="@mipmap/icon_loading" />
+
+
+ android:src="@mipmap/icon_discharge" />
+
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:layout_marginRight="@dimen/dp_10"
+ android:orientation="horizontal">
+
+
+
+ android:layout_marginLeft="@dimen/dp_10"
+ android:layout_marginTop="@dimen/dp_7"
+ android:layout_marginBottom="@dimen/dp_7"
+ android:orientation="horizontal">
+
+
+ android:textSize="@dimen/sp_13" />
+
-
+
+
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+
+
+
+
+
+
+ android:visibility="gone" />
\ No newline at end of file
diff --git a/mylibrary/src/main/res/values/colors.xml b/mylibrary/src/main/res/values/colors.xml
index 2a87706..7cf8a3a 100644
--- a/mylibrary/src/main/res/values/colors.xml
+++ b/mylibrary/src/main/res/values/colors.xml
@@ -8,7 +8,7 @@
#333333
#666666
#FE0606
- #ff007aff
+ #8AA5E1
#3C6FC6
#88888888