Commit 7f69656f by Wyh

8.20 外送人員報表

Signed-off-by: Wyh <1239658231>
parent 1385fdee
...@@ -47,6 +47,7 @@ public class DeliveryPersonnelReportBean { ...@@ -47,6 +47,7 @@ public class DeliveryPersonnelReportBean {
private String senderName; private String senderName;
private int num; private int num;
private double amount; private double amount;
private long deliveredTime;
public String getSenderName() { public String getSenderName() {
return senderName; return senderName;
...@@ -71,5 +72,13 @@ public class DeliveryPersonnelReportBean { ...@@ -71,5 +72,13 @@ public class DeliveryPersonnelReportBean {
public void setAmount(double amount) { public void setAmount(double amount) {
this.amount = amount; this.amount = amount;
} }
public long getDeliveredTime() {
return deliveredTime;
}
public void setDeliveredTime(long deliveredTime) {
this.deliveredTime = deliveredTime;
}
} }
} }
...@@ -67,7 +67,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont ...@@ -67,7 +67,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont
this.mApplication = null; this.mApplication = null;
} }
public void getSalesReportInfo(String restaurantId, String startTime,String endTime) { public void getSalesReportInfo(String restaurantId, String startTime, String endTime) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("restaurantId", restaurantId); map.put("restaurantId", restaurantId);
map.put("startTime", startTime); map.put("startTime", startTime);
...@@ -96,6 +96,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont ...@@ -96,6 +96,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont
/** /**
* 獲取微信公眾號的報表數據 * 獲取微信公眾號的報表數據
*
* @param startTime * @param startTime
*/ */
public void getSalesReportInfo(String startTime) { public void getSalesReportInfo(String startTime) {
...@@ -127,7 +128,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont ...@@ -127,7 +128,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont
}); });
} }
public void getDeliveryOrderCurveInfo(String restaurantId, String startTime,String endTime){ public void getDeliveryOrderCurveInfo(String restaurantId, String startTime, String endTime) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("restaurantId", restaurantId); map.put("restaurantId", restaurantId);
map.put("startTime", startTime); map.put("startTime", startTime);
...@@ -143,7 +144,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont ...@@ -143,7 +144,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont
@Override @Override
public void onNext(@NonNull DeliveryLineChartBean info) { public void onNext(@NonNull DeliveryLineChartBean info) {
if(info != null && info.isSuccess()){ if (info != null && info.isSuccess()) {
mRootView.loadDeliveryLineChart(info.getData()); mRootView.loadDeliveryLineChart(info.getData());
} }
} }
...@@ -151,7 +152,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont ...@@ -151,7 +152,7 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont
} }
public void getDeliveryPersonnelReport(String restaurantId, String startTime,String endTime){ public void getDeliveryPersonnelReport(String restaurantId, String startTime, String endTime) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("restaurantId", restaurantId); map.put("restaurantId", restaurantId);
map.put("startTime", startTime); map.put("startTime", startTime);
...@@ -167,12 +168,12 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont ...@@ -167,12 +168,12 @@ public class SalesPresenter extends BasePresenter<SalesContract.Model, SalesCont
@Override @Override
public void onNext(@NonNull DeliveryPersonnelReportBean info) { public void onNext(@NonNull DeliveryPersonnelReportBean info) {
if(info != null && info.isSuccess()){ if (info != null && info.isSuccess()) {
if (info.getData() != null) { if (info.getData() != null) {
List<DailyReportBean> dailyReportBeans = new ArrayList<>(); List<DailyReportBean> dailyReportBeans = new ArrayList<>();
dailyReportBeans.add(new DailyReportBean("姓名", "總單量", "平均每單用時(min)", "金額")); dailyReportBeans.add(new DailyReportBean("姓名", "總單量", "平均每單用時(min)", "金額"));
for (DeliveryPersonnelReportBean.DataBean listBean : info.getData()) { for (DeliveryPersonnelReportBean.DataBean listBean : info.getData()) {
dailyReportBeans.add(new DailyReportBean(listBean.getSenderName(), listBean.getNum() + "", "用時", listBean.getAmount() + "")); dailyReportBeans.add(new DailyReportBean(listBean.getSenderName(), listBean.getNum() + "", "" + listBean.getDeliveredTime(), listBean.getAmount() + ""));
} }
// dailyReportBeans.add(new DailyReportBean("合計", info.getData().getBillNumSum() + "", "100", info.getData().getAmountSum() + "")); // dailyReportBeans.add(new DailyReportBean("合計", info.getData().getBillNumSum() + "", "100", info.getData().getAmountSum() + ""));
mRootView.loadDeliveryPersonnelReport(dailyReportBeans); mRootView.loadDeliveryPersonnelReport(dailyReportBeans);
......
...@@ -4,7 +4,6 @@ import android.content.Intent; ...@@ -4,7 +4,6 @@ import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.os.Message; import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -28,7 +27,6 @@ import com.gingersoft.gsa.cloud.main.di.component.DaggerSalesComponent; ...@@ -28,7 +27,6 @@ import com.gingersoft.gsa.cloud.main.di.component.DaggerSalesComponent;
import com.gingersoft.gsa.cloud.main.mvp.contract.SalesContract; import com.gingersoft.gsa.cloud.main.mvp.contract.SalesContract;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.DailyReportBean; import com.gingersoft.gsa.cloud.main.mvp.model.bean.DailyReportBean;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.DeliveryLineChartBean; import com.gingersoft.gsa.cloud.main.mvp.model.bean.DeliveryLineChartBean;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.MainBusinessBean;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.SalesFoodsBean; import com.gingersoft.gsa.cloud.main.mvp.model.bean.SalesFoodsBean;
import com.gingersoft.gsa.cloud.main.mvp.presenter.SalesPresenter; import com.gingersoft.gsa.cloud.main.mvp.presenter.SalesPresenter;
import com.gingersoft.gsa.cloud.main.mvp.ui.adapter.FoodRankingAdapter; import com.gingersoft.gsa.cloud.main.mvp.ui.adapter.FoodRankingAdapter;
...@@ -265,6 +263,8 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales ...@@ -265,6 +263,8 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
public void loadDeliveryPersonnelReport(List<DailyReportBean> dailyReportBeans) { public void loadDeliveryPersonnelReport(List<DailyReportBean> dailyReportBeans) {
if (netOperatingAmountView == null) { if (netOperatingAmountView == null) {
netOperatingAmountView = new OperatingReportView(mContext, false, "外送員分析", dailyReportBeans, 4); netOperatingAmountView = new OperatingReportView(mContext, false, "外送員分析", dailyReportBeans, 4);
netOperatingAmountView.init();
netOperatingAmountView.setOnReLoadListener(() -> getDeliveryReport());
layoutSales.addView(netOperatingAmountView); layoutSales.addView(netOperatingAmountView);
} else { } else {
netOperatingAmountView.notifyData(dailyReportBeans); netOperatingAmountView.notifyData(dailyReportBeans);
......
...@@ -82,7 +82,7 @@ class CoolWeatherNetwork { ...@@ -82,7 +82,7 @@ class CoolWeatherNetwork {
suspend fun noticePersonnel(requestBody: RequestBody) = appService.noticePersonnel(requestBody).await() suspend fun noticePersonnel(requestBody: RequestBody) = appService.noticePersonnel(requestBody).await()
// suspend fun getTransportationConfig(restaurantId: String) = systemService.getTransportationConfig(restaurantId).await() suspend fun getTransportationConfig(restaurantId: String) = systemService.getTransportationConfig(restaurantId).await()
private suspend fun <T> Call<T>.await(): T { private suspend fun <T> Call<T>.await(): T {
return suspendCoroutine { continuation -> return suspendCoroutine { continuation ->
......
...@@ -69,6 +69,6 @@ interface WeatherService { ...@@ -69,6 +69,6 @@ interface WeatherService {
@POST("printerRecording/add") @POST("printerRecording/add")
fun addPrj(@Body requestBody: RequestBody): Call<String> fun addPrj(@Body requestBody: RequestBody): Call<String>
// @GET("restaurantTransportationConfig/list") @GET("restaurantTransportationConfig/list")
// fun getTransportationConfig(@Query("restaurantId") restaurantId: String):Call<TransportationBean> fun getTransportationConfig(@Query("restaurantId") restaurantId: String):Call<TransportationBean>
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment