Commit baf60316 by mReturn

工单优化

parent 374aaf3c
......@@ -117,8 +117,9 @@ public class MyApplication extends BaseApplication {
private void initUM() {
MobclickAgent.setCatchUncaughtExceptions(!Constants.IS_DEBUG);
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
UMConfigure.init(this,"599a41697f2c743210000990","UmengPush",
UMConfigure.DEVICE_TYPE_PHONE,"78d43fa94358512f9d00acf9b50f7474");
// UMConfigure.init(this,"599a41697f2c743210000990","Channel ID",
// UMConfigure.DEVICE_TYPE_PHONE,"78d43fa94358512f9d00acf9b50f7474");
UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE,"78d43fa94358512f9d00acf9b50f7474");
UMConfigure.setLogEnabled(true);
UMConfigure.setEncryptEnabled(true);
MobclickAgent.setScenarioType(mContext, EScenarioType.E_UM_NORMAL);
......@@ -130,18 +131,18 @@ public class MyApplication extends BaseApplication {
//友盟推送
private void initPush() {
//获取消息推送代理示例
PushAgent mPushAgent = PushAgent.getInstance(mContext);
PushAgent mPushAgent = PushAgent.getInstance(this);
//自定义推送通知栏点击事件处理
UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler() {
@Override
public void dealWithCustomAction(Context context, UMessage msg) {
if (msg.extra!= null && msg.extra.containsKey("order_id")){
LogUtils.e("Upush click0: "+ msg.extra.get("order_id"));
}
LogUtils.e("Upush click: "+ msg.custom);
}
};
// UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler() {
//
// @Override
// public void dealWithCustomAction(Context context, UMessage msg) {
// if (msg.extra!= null && msg.extra.containsKey("order_id")){
// LogUtils.e("Upush click0: "+ msg.extra.get("order_id"));
// }
// LogUtils.e("Upush click: "+ msg.custom);
// }
// };
// mPushAgent.setNotificationClickHandler(notificationClickHandler);
//注册推送服务,每次调用register方法都会回调该接口
......
package com.dayu.base.ui.adapter;
import android.app.Activity;
import android.content.Intent;
import android.os.Environment;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.dayu.base.ui.activity.PreviewActivty;
import com.dayu.baselibrary.R;
import com.dayu.common.Constants;
import com.dayu.utils.GlideImageLoader;
import com.dayu.utils.UtilsScreen;
import com.dayu.widgets.listener.OnItemClickListener;
import com.luck.picture.lib.PictureSelectionModel;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.config.PictureMimeType;
import java.io.File;
import java.util.ArrayList;
public class MediaChooseAdapter extends RecyclerView.Adapter<MediaChooseAdapter.Holder> {
private final int mIvSize;
private Activity context;
private ArrayList<String> list;
private int maxCount = 1;
private int mimeType = PictureMimeType.ofVideo();
private int videoLength = 30;
private OnItemClickListener<MediaChooseAdapter.Holder, Integer> listener;
public MediaChooseAdapter( Activity context,ArrayList<String> list) {
mIvSize = (UtilsScreen.getScreenWidth(context) - UtilsScreen.dip2px(context, 20)) / 5;
this.context = context;
this.list = list;
}
public void setMaxCount(int maxCount) {
this.maxCount = maxCount;
}
public void setMimeType(int mimeType) {
this.mimeType = mimeType;
}
public void setData(ArrayList<String> list) {
this.list = list;
notifyDataSetChanged();
}
@NonNull
@Override
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.item_picture_select, parent, false);
view.setLayoutParams(new RelativeLayout.LayoutParams(mIvSize, mIvSize));
view.setPadding(0, 0, 10, 10);
return new Holder(view);
}
@Override
public void onBindViewHolder(@NonNull Holder holder, int position) {
if (list.get(position).equals("add")) {
holder.picture.setImageResource(R.drawable.icon_submit_photo);
holder.delete.setVisibility(View.GONE);
holder.picture.setOnClickListener(v -> showPicDialog());
} else {
GlideImageLoader.load(context, list.get(position), holder.picture);
holder.delete.setVisibility(View.VISIBLE);
holder.delete.setOnClickListener(v -> removeItem(position));
holder.picture.setOnClickListener(v -> {
ArrayList temp = new ArrayList();
temp.addAll(list);
temp.remove("add");
dumpPic(temp);
});
}
}
@Override
public int getItemCount() {
return list.size();
}
private void removeItem(int position) {
if (list.size() == maxCount && !list.contains("add")) {
list.remove(position);
list.add("add");
} else {
list.remove(position);
}
notifyDataSetChanged();
}
class Holder extends RecyclerView.ViewHolder {
private final ImageView picture;
private final ImageView delete;
Holder(View itemView) {
super(itemView);
picture = itemView.findViewById(R.id.iv_picture);
delete = itemView.findViewById(R.id.iv_picture_delete);
}
}
public void setOnItemClickListener(OnItemClickListener<MediaChooseAdapter.Holder, Integer> listener) {
this.listener = listener;
}
public void showPicDialog() {
int size;
size = maxCount+1 - list.size();
PictureSelectionModel selector = PictureSelector.create(context)
.openGallery(mimeType)//全部.PictureMimeType.ofAll()、图片.ofImage()、视频.ofVideo()
.maxSelectNum(size)// 最大图片选择数量 int
.imageSpanCount(4)// 每行显示个数 int
.selectionMode(PictureConfig.MULTIPLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
.previewImage(true)// 是否可预览图片 true or false
.isCamera(true)// 是否显示拍照按钮 true or false
.recordVideoSecond(videoLength)
.videoMaxSecond(videoLength)
.isZoomAnim(true)// 图片列表点击 缩放效果 默认true
.sizeMultiplier(0.1f)// glide 加载图片大小 0~1之间 如设置 .glideOverride()无效
.setOutputCameraPath("/CustomPath")// 自定义拍、照保存路径,可不填
.compress(true)// 是否压缩 true or false
.glideOverride(300, 500)// int glide 加载宽高,越小图片列表越流畅,但会影响列表图片浏览的清晰度
.hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
.compressSavePath(getPath())//压缩图片保存地址
.previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
// .minimumCompressSize(100)// 小于100kb的图片不压缩
.synOrAsy(true);//同步true或异步false 压缩 默认同步、
// .enableCrop(true)//是否裁剪
// .freeStyleCropEnabled(true)
selector.forResult(PictureConfig.CHOOSE_REQUEST);
}
private String getPath() {
String path = Environment.getExternalStorageDirectory() + "/dayu/image/";
File file = new File(path);
if (file.mkdirs()) {
return path;
}
return path;
}
private void dumpPic(ArrayList<String> list) {
Intent intent = new Intent(context, PreviewActivty.class);
intent.putStringArrayListExtra(Constants.BUNDLE_KEY_ID, list);
int DELETECODE = 0;
context.startActivityForResult(intent, DELETECODE);
}
}
......@@ -3,7 +3,7 @@
<!-- 边框颜色值 -->
<item>
<shape>
<solid android:color="#999" />
<solid android:color="@color/pickerview_wheelview_textcolor_divider" />
</shape>
</item>
......
......@@ -768,6 +768,7 @@ C) 在甲方使用大鱼平å°æœåŠ¡è¿‡ç¨‹ä¸­äº§ç”Ÿçš„业务数æ®ï¼Œå®¢æˆ·æ•°æ
<string name="str_phone">手机号</string>
<string name="str_pwd">登录密码</string>
<string name="str_confirm_pwd">确认密码</string>
<string name="str_invate_code">邀请码</string>
<string name="upload_avatar_fail">上传头像失败</string>
<string name="register_success">注册成功</string>
<string name="register_fail">注册失败</string>
......
......@@ -425,4 +425,10 @@ public interface OrderService {
*/
@GET(Constants.API_7200+"/ordersRelationSpuItemSop/sop/{itemId}")
Observable<BaseResponse<List<SopItemBean>>> getSopItems(@Path("itemId") int itemId);
/**
* 待接单
*/
@GET(Constants.API_7500+"/ordersStatistics/satisfiedOrders")
Observable<BaseResponse<List<Order>>> getReceivingOrders(@Query("accountId") int accountId);
}
......@@ -17,6 +17,16 @@ public class Tab {
private int reservation;
private int error;
private int waits;
private int complete;
public int getComplete() {
return complete;
}
public void setComplete(int complete) {
this.complete = complete;
}
public int getWaits() {
return waits;
......
......@@ -43,6 +43,7 @@ public class HomeOrderPresenter extends HomeOrderContract.Presenter {
tab.setError(0);
tab.setPendingservice(0);
tab.setReservation(0);
tab.setComplete(0);
mView.setTabNum(tab, mIndex);
}));
}
......
......@@ -3,12 +3,14 @@ package com.dayu.order.presenter.receivingorder;
import android.databinding.ObservableField;
import android.os.Bundle;
import com.dayu.base.api.Api;
import com.dayu.base.api.protocol.BasePageBean;
import com.dayu.common.BaseApplication;
import com.dayu.common.Constants;
import com.dayu.event.UserInfo;
import com.dayu.order.R;
import com.dayu.order.api.OrderApiFactory;
import com.dayu.order.api.OrderService;
import com.dayu.order.api.protocol.Order;
import com.dayu.order.ui.activity.OrderDetailsActivity;
import com.dayu.provider.event.RefreshApoiment;
......@@ -17,6 +19,7 @@ import com.dayu.provider.event.RefreshTab;
import com.dayu.provider.event.SwtichFragment;
import com.dayu.utils.ToastUtils;
import com.dayu.utils.UserManager;
import com.megvii.idcardlib.util.Constant;
import com.umeng.analytics.MobclickAgent;
import org.greenrobot.eventbus.EventBus;
......@@ -88,13 +91,25 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
@Override
public void refresh() {
mPage = 1;
getOrders(Constants.WATING_ORDER, mUserId, mSiteId, mPage, Constants.PAGESIZE);
// getOrders(Constants.WATING_ORDER, mUserId, mSiteId, mPage, Constants.PAGESIZE);
getReceivingData();
EventBus.getDefault().post(new RefreshTab(-1));
}
@Override
public void loadMore() {
getOrders(Constants.WATING_ORDER, mUserId, mSiteId, mPage, Constants.PAGESIZE);
// getOrders(Constants.WATING_ORDER, mUserId, mSiteId, mPage, Constants.PAGESIZE);
getReceivingData();
}
public void getReceivingData() {
Api.getService(OrderService.class).getReceivingOrders(mUserId).compose(Api.applySchedulers())
.subscribe(baseObserver(orders ->{
datas.set(orders);
mTotalRows = orders.size();
EventBus.getDefault().post(new RefreshReceivingNum(mTotalRows));
},
responeThrowable -> datas.set(Constants.FAILED)));
}
@Override
......
......@@ -3,6 +3,7 @@ package com.dayu.order.ui.activity;
import android.content.Intent;
import android.os.Environment;
import android.support.v7.widget.GridLayoutManager;
import android.text.TextUtils;
import android.view.View;
import com.dayu.base.ui.activity.BaseActivity;
......@@ -170,7 +171,12 @@ public class MultiProcessOrderActivity extends BaseActivity<MultiProcessOrderPre
if (mPhotoState == 0) {
mImages.remove("add");
for (int a = 0; a < selectList.size(); a++) {
mImages.add(selectList.get(a).getCompressPath());
// mImages.add(selectList.get(a).getCompressPath());
if (!TextUtils.isEmpty(selectList.get(a).getCompressPath())){
mImages.add(selectList.get(a).getCompressPath());
}else{
mImages.add(selectList.get(a).getPath());
}
}
if (mImages.size() < 10) {
mImages.add("add");
......@@ -178,7 +184,12 @@ public class MultiProcessOrderActivity extends BaseActivity<MultiProcessOrderPre
mAdapter.setData(mImages);
} else {
for (int a = 0; a < selectList.size(); a++) {
mSnImages.add(selectList.get(a).getCompressPath());
// mSnImages.add(selectList.get(a).getCompressPath());
if (!TextUtils.isEmpty(selectList.get(a).getCompressPath())){
mSnImages.add(selectList.get(a).getCompressPath());
}else{
mSnImages.add(selectList.get(a).getPath());
}
}
GlideImageLoader.load(mActivity, mSnImages.get(0), mBind.ivSn);
mBind.ivDelete.setVisibility(View.VISIBLE);
......
......@@ -13,6 +13,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayu.base.api.Api;
import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.base.ui.adapter.MediaChooseAdapter;
import com.dayu.base.ui.adapter.PhotoViewAdapter;
import com.dayu.base.ui.adapter.SpacesItemDecoration;
import com.dayu.base.ui.presenter.SImplePresenter;
......@@ -21,6 +22,7 @@ import com.dayu.order.R;
import com.dayu.order.api.OrderService;
import com.dayu.order.api.protocol.SopItemBean;
import com.dayu.order.databinding.ActivitySopLocalBinding;
import com.dayu.utils.LogUtils;
import com.dayu.utils.ToastUtils;
import java.util.ArrayList;
......@@ -28,8 +30,8 @@ import java.util.List;
public class SopLocalActivity extends BaseActivity<SImplePresenter,ActivitySopLocalBinding> {
int mItemId;
private ArrayList<String> mImages = new ArrayList<>();
private PhotoViewAdapter mAdapter;
// private ArrayList<String> mImages = new ArrayList<>();
// private PhotoViewAdapter mImageAdapter;
@Override
public void setPresenter() {
......@@ -77,12 +79,20 @@ public class SopLocalActivity extends BaseActivity<SImplePresenter,ActivitySopLo
rvImg.setVisibility(item.getType() == 3?View.VISIBLE:View.GONE);
helper.getView(R.id.tv_add_remark).setOnClickListener(v->{
item.setShowRemark(!item.isShowRemark());
notifyDataSetChanged();
edtRemak.setVisibility(item.isShowRemark()?View.VISIBLE:View.GONE);
// notifyDataSetChanged();
});
helper.setText(R.id.tv_sort,item.getSortNum()+".");
helper.setText(R.id.tv_desc,item.getDescription());
switch (item.getType()){
case 1:
break;
case 2:
break;
case 3:
initPhotoView(rvImg,new ArrayList<>());
break;
}
}
};
......@@ -93,17 +103,17 @@ public class SopLocalActivity extends BaseActivity<SImplePresenter,ActivitySopLo
}
private void initPhotoView(RecyclerView recyclerView,ArrayList<String> list) {
if (mAdapter == null) {
ArrayList<String> mImages = list;
// if (mImageAdapter == null) {
recyclerView.addItemDecoration(new SpacesItemDecoration(10));
recyclerView.setLayoutManager(new GridLayoutManager(this, 4));
mAdapter = new PhotoViewAdapter(mImages, this);
recyclerView.setAdapter(mAdapter);
mAdapter.setData(mImages);
}
mImages = list;
MediaChooseAdapter mImageAdapter = new MediaChooseAdapter(this,mImages);
recyclerView.setAdapter(mImageAdapter);
mImageAdapter.setData(mImages);
// }
if (mImages.size() < 10) {
mImages.add("add");
}
mAdapter.setData(mImages);
mImageAdapter.setData(mImages);
}
}
......@@ -146,7 +146,7 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
// String[] tabNum = new String[]{"tab.getReservation() + "", tab.getPendingservice() + "",
// tab.getError() + "", tab.getCanceled() + ""};
String[] tabNum = new String[]{tab.getWaits() + "",tab.getReservation() + "", tab.getPendingservice() + "",
tab.getError() + ""};
tab.getComplete() + ""};
EventBus.getDefault().post(new TabNumEvent(tab.getPendingservice()+tab.getWaits()+tab.getReservation()));
if (isFirstAddTab) {
mBind.tbHome.removeAllTabs();
......
......@@ -45,6 +45,7 @@ public class OrderReceivingFragment extends BaseFragment<ReceivingPresenter, Fra
public void initView() {
mAdapter = new OrderAdapter(true);
mAdapter.setViewType(R.layout.fragment_orderdoing_item);
mAdapter.setLoadMore(false);
mBind.recyclerView.setAdapter(mAdapter);
initListener();
mBind.recyclerView.setOnItemClickListener(new OnItemClickListener<Order, FragmentOrderdoingItemBinding>() {
......
......@@ -5,12 +5,8 @@
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@drawable/bg_sop_item"
>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/pickerview_wheelview_textcolor_divider"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -85,9 +81,10 @@
android:id="@+id/edt_remark"
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="60dp"
android:background="@drawable/bg_input_register_react"
android:layout_marginBottom="15dp"
android:gravity="left|top"
/>
</LinearLayout>
......@@ -8,6 +8,7 @@ import com.dayu.usercenter.model.SaveSceneData;
import com.dayu.usercenter.model.bean.AddressInfoBean;
import com.dayu.usercenter.model.bean.BusinessSceneBean;
import com.dayu.usercenter.model.EditBankData;
import com.dayu.usercenter.model.bean.CommonRecordListBean;
import com.dayu.usercenter.model.bean.GlobelRateBean;
import com.dayu.usercenter.model.bean.SaleArriveListBean;
import com.dayu.usercenter.model.bean.SaleRecordBean;
......@@ -37,170 +38,203 @@ public interface UserService2 {
* @param accountId
* @return
*/
@GET(Constants.API_7100+"/account/queryAccountInfo/{accountId}")
@GET(Constants.API_7100 + "/account/queryAccountInfo/{accountId}")
Observable<BaseResponse<UserInfoBean>> getUserInfo(@Path("accountId") int accountId);
/**
* 获取银行信息.
* sourceType 1工程师账号 2小程序用户ID
*
* @return
*/
@GET(Constants.API_7800+"/payAccountBank/accountId/{accountId}/sourceType/1")
@GET(Constants.API_7800 + "/payAccountBank/accountId/{accountId}/sourceType/1")
Observable<BaseResponse<UserBankInfoBean>> getUserBankInfo(@Path("accountId") int accountId);
/**
* 设置银行信息
*
* @param data
* @return
*/
@POST(Constants.API_7800+"/payAccountBank")
@POST(Constants.API_7800 + "/payAccountBank")
Observable<BaseResponse<Boolean>> setBankInfo(@Body EditBankData data);
/**
* 更新银行信息
*/
@PUT(Constants.API_7800+"/payAccountBank")
@PUT(Constants.API_7800 + "/payAccountBank")
Observable<BaseResponse<Boolean>> updateBankInfo(@Body EditBankData data);
/**
* 获取地址信息.
*
* @return
*/
@GET(Constants.API_7100+"/engineerAddress/default/accountId/{accountId}")
@GET(Constants.API_7100 + "/engineerAddress/default/accountId/{accountId}")
Observable<BaseResponse<AddressInfoBean>> getAddressInfo(@Path("accountId") int accountId);
/**
* 设置地址信息
*
* @param data
* @return
*/
@POST(Constants.API_7100+"/engineerAddress")
@POST(Constants.API_7100 + "/engineerAddress")
Observable<BaseResponse<Boolean>> setAddressInfo(@Body AddressInfoBean data);
/**
* 更新地址信息
*/
@PUT(Constants.API_7100+"/engineerAddress")
@PUT(Constants.API_7100 + "/engineerAddress")
Observable<BaseResponse<Boolean>> updateAddressInfo(@Body AddressInfoBean data);
/**
* 销售业务场景
*
* @return
*/
@GET(Constants.API_8600+"/category/levelOne")
@GET(Constants.API_8600 + "/category/levelOne")
Observable<BaseResponse<List<BusinessSceneBean>>> getBusinessScene();
/**
* 已保存业务场景
*
* @return
*/
@GET(Constants.API_7900+"/accountGoodsCategory/accountId/{accountId}")
@GET(Constants.API_7900 + "/accountGoodsCategory/accountId/{accountId}")
Observable<BaseResponse<List<SaveSceneData>>> getSavedSecne(@Path("accountId") int accountId);
/**
* 选择业务场景
*
* @param datas
* @return
*/
@POST(Constants.API_7900+"/accountGoodsCategory/batch")
@POST(Constants.API_7900 + "/accountGoodsCategory/batch")
Observable<BaseResponse<Boolean>> saveBusinessScene(@Body List<SaveSceneData> datas);
/**
* 服务产品类型
*
* @return
*/
@GET(Constants.API_7300+"/label/list")
@GET(Constants.API_7300 + "/label/list")
Observable<BaseResponse<List<ServiceTypeBean>>> getServiceType();
/**
* 服务产品类型
*
* @return
*/
@GET(Constants.API_7100+"/engineerRelationCategory/accountId/{accountId}")
@GET(Constants.API_7100 + "/engineerRelationCategory/accountId/{accountId}")
Observable<BaseResponse<List<ServiceTypeBean>>> getSavedServiceType(@Path("accountId") int accountId);
/**
* 批量保存产品类型
*
* @param ids
* @param accountId
* @return
*/
@POST(Constants.API_7100+"/engineerRelationCategory/batch/accountId/{accountId}")
Observable<BaseResponse<Boolean>> saveServiceType(@Body List<Long> ids,@Path("accountId") int accountId);
@POST(Constants.API_7100 + "/engineerRelationCategory/batch/accountId/{accountId}")
Observable<BaseResponse<Boolean>> saveServiceType(@Body List<Long> ids, @Path("accountId") int accountId);
/**
* 全部认证资质
*
* @return
*/
@GET(Constants.API_7100+"/licenceInfo")
Observable<BaseResponse<BasePageBean<UserLicenceBean>>> getAllLicence(@Query("status") int status,@Query("page") int page,
@GET(Constants.API_7100 + "/licenceInfo")
Observable<BaseResponse<BasePageBean<UserLicenceBean>>> getAllLicence(@Query("status") int status, @Query("page") int page,
@Query("pageSize") int pageSize);
/**
*已获认证资质
* 已获认证资质
*
* @return
*/
@GET(Constants.API_7100+"/licenceInfo/accountId/{accountId}")
@GET(Constants.API_7100 + "/licenceInfo/accountId/{accountId}")
Observable<BaseResponse<List<UserLicenceBean>>> gethasedLicence(@Path("accountId") int accountId);
/**
* 申请认证
*
* @param data
* @return
*/
@POST(Constants.API_7100+"/licenceRelationEngineer/apply")
@POST(Constants.API_7100 + "/licenceRelationEngineer/apply")
Observable<BaseResponse<Boolean>> applyLicence(@Body ApplyLicenceData data);
/**
* 星级比例
*
* @return
*/
@GET(Constants.API_7300+"/engineerStarRatio/list")
@GET(Constants.API_7300 + "/engineerStarRatio/list")
Observable<BaseResponse<List<StarRatioBean>>> getStarRatios();
/**
* 佣金比例
*
* @return
*/
@GET(Constants.API_7800+"/globelRateConfig/{id}")
@GET(Constants.API_7800 + "/globelRateConfig/{id}")
Observable<BaseResponse<GlobelRateBean>> getGlobelRate(@Path("id") int id);
/**
* 所有佣金比例
*
* @return
*/
@GET(Constants.API_7800+"/globelRateConfig?page=1&pageSize=10")
@GET(Constants.API_7800 + "/globelRateConfig?page=1&pageSize=10")
Observable<BaseResponse<BasePageBean<GlobelRateBean>>> getGlobelRateAll();
/**
* 销售业绩-完成销售订单量&奖金总额
* @param accountId
* @param type 1工程师 2小程序用户
* 业绩&奖励
*
* @param accountId type 1工程师 2小程序用户
* @param rewardType 1:销售 2:服务 3:邀请 4:平台
* @return
*/
@GET(Constants.API_7800+"/payAccountRewardItem/totalRewardPriceAndOrderNum/accountId/{accountId}/type/{type}")
@GET(Constants.API_7800 + "/payAccountRewardItem/totalRewardPriceAndOrderNum/accountId/{accountId}/type/1/rewardType/{rewardType}")
Observable<BaseResponse<SaleRecordBean>> getSaleRecordInfo(@Path("accountId") int accountId,
@Path("type") int type);
@Path("rewardType") int rewardType);
/**
*销售业绩-奖励明细
* 销售业绩-奖励明细
*
* @return
*/
@GET(Constants.API_7800+"/payAccountRewardItem")
@GET(Constants.API_7800 + "/payAccountRewardItem")
Observable<BaseResponse<BasePageBean<SaleRecordListBean>>> getSaleRecordList(@Query("accountId") int accountId,
@Query("page") int page,
@Query("pageSize") int pageSize);
@Query("page") int page,
@Query("pageSize") int pageSize);
/**
*销售业绩-到账记录
* 销售业绩-到账记录
*
* @return
*/
@GET(Constants.API_7800+"/payAccountWithdrawRecord/accountId/{accountId}/type/{type}")
@GET(Constants.API_7800 + "/payAccountWithdrawRecord/accountId/{accountId}/type/{type}")
Observable<BaseResponse<BasePageBean<SaleArriveListBean>>> getSaleArriveList(@Path("accountId") int accountId,
@Path("type") int type,
@Query("page") int page,
@Query("pageSize") int pageSize);
/**
* 奖励明细
** @param type 1工程师 2小程序用户
* @param rewardType 1:销售 2:服务 3:邀请 4:平台
* @return
*/
@GET(Constants.API_7800 + "/payAccountRewardItem")
Observable<BaseResponse<BasePageBean<CommonRecordListBean>>> getCommonRecordList(@Query("accountId") int accountId,
@Query("type") int type,
@Query("rewardType") int rewardType,
@Query("page") int page,
@Query("pageSize") int pageSize);
}
package com.dayu.usercenter.model.bean;
public class CommonRecordListBean {
/**
* accountId : 0
* businessId : 0
* createTime : 2020-03-30T08:35:44.573Z
* id : 0
* payAccountWithdrawId : 0
* providerId : 0
* providerName : string
* rewardItem : string
* rewardPrice : 0
* rewardTime : 2020-03-30T08:35:44.574Z
* rewardType : 0
* status : 0
* type : 0
*/
private int accountId;
private int businessId;
private String createTime;
private int id;
private int payAccountWithdrawId;
private int providerId;
private String providerName;
private String rewardItem;
private int rewardPrice;
private String rewardTime;
private int rewardType;
private int status;
private int type;
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public int getBusinessId() {
return businessId;
}
public void setBusinessId(int businessId) {
this.businessId = businessId;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPayAccountWithdrawId() {
return payAccountWithdrawId;
}
public void setPayAccountWithdrawId(int payAccountWithdrawId) {
this.payAccountWithdrawId = payAccountWithdrawId;
}
public int getProviderId() {
return providerId;
}
public void setProviderId(int providerId) {
this.providerId = providerId;
}
public String getProviderName() {
return providerName;
}
public void setProviderName(String providerName) {
this.providerName = providerName;
}
public String getRewardItem() {
return rewardItem;
}
public void setRewardItem(String rewardItem) {
this.rewardItem = rewardItem;
}
public int getRewardPrice() {
return rewardPrice;
}
public void setRewardPrice(int rewardPrice) {
this.rewardPrice = rewardPrice;
}
public String getRewardTime() {
return rewardTime;
}
public void setRewardTime(String rewardTime) {
this.rewardTime = rewardTime;
}
public int getRewardType() {
return rewardType;
}
public void setRewardType(int rewardType) {
this.rewardType = rewardType;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
......@@ -6,10 +6,19 @@ import android.support.v7.widget.LinearLayoutManager;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayu.base.api.Api;
import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.base.ui.presenter.SImplePresenter;
import com.dayu.common.Constants;
import com.dayu.usercenter.R;
import com.dayu.usercenter.api.UserService2;
import com.dayu.usercenter.databinding.ActivityCommonRecordBinding;
import com.dayu.usercenter.event.RefreshSaleRecordEvent;
import com.dayu.usercenter.model.bean.CommonRecordListBean;
import com.dayu.usercenter.model.bean.SaleArriveListBean;
import com.dayu.usercenter.model.bean.SaleRecordListBean;
import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.List;
......@@ -19,7 +28,10 @@ import java.util.List;
* on 2020/2/15
**/
public class CommonRecordActivity extends BaseActivity<SImplePresenter,ActivityCommonRecordBinding> {
int mType; // 1.服务业绩 2.邀请奖励 3.平台奖励
int mType; // 2.服务业绩 3.邀请奖励 4.平台奖励
int page = 1;
BaseQuickAdapter<CommonRecordListBean, BaseViewHolder> mAdapter;
List<CommonRecordListBean> mDatas = new ArrayList<>();
@Override
public int getLayoutId() {
......@@ -38,22 +50,35 @@ public class CommonRecordActivity extends BaseActivity<SImplePresenter,ActivityC
@Override
public void initView() {
initUser();
mType = getIntent().getIntExtra("type",0);
mBind.receivingBack.setOnClickListener(v->dumpBack());
initTopView();
setAdapter();
initData();
mBind.refreshLayout.setEnableLoadMore(false);
mBind.refreshLayout.setOnRefreshListener(refreshLayout -> {
page = 1;
initData();
getDetailData();
});
mBind.refreshLayout.setOnLoadMoreListener(refreshLayout -> {
EventBus.getDefault().post(new RefreshSaleRecordEvent());
getDetailData();
});
showDialog();
getDetailData();
}
private void initTopView() {
switch (mType){
case 2:
case 3:
mBind.tvTitle.setText(R.string.user_invate_reward);
mBind.tvIncomeDesc.setText(R.string.reward_total_money);
mBind.tvCountDesc.setText(R.string.invate_person_count);
mBind.tvTableTitle1.setText(R.string.share_reward_money);
mBind.tvTableTitle2.setText(R.string.be_invated_person);
break;
case 3:
case 4:
mBind.tvTitle.setText(R.string.user_platform_reward);
mBind.tvIncomeDesc.setText(R.string.reward_total_money);
mBind.tvCountDesc.setText(R.string.be_rewarded_count);
......@@ -63,22 +88,50 @@ public class CommonRecordActivity extends BaseActivity<SImplePresenter,ActivityC
}
}
private void setAdapter() {
List<String> testList = new ArrayList<>();
for (int i = 0; i < 30; i++) {
testList.add("test data" + i);
}
//奖励总额
private void initData() {
Api.getService(UserService2.class).getSaleRecordInfo(mUserId, mType).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(data -> {
mBind.tvIncome.setText(data.getTotalRewardPrice() + "");
mBind.tvCount.setText(data.getOrderNum() + "");
}));
}
BaseQuickAdapter<String, BaseViewHolder> adapter =
new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_record_common, testList) {
@Override
protected void convert(BaseViewHolder helper, String item) {
helper.setText(R.id.tv_item1, item);
helper.setText(R.id.tv_item2, item);
helper.setText(R.id.tv_item3, item);
//奖励明细
private void getDetailData() {
Api.getService(UserService2.class).getCommonRecordList(mUserId,1,mType, page, Constants.PAGESIZE).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(data ->{
mBind.refreshLayout.finishRefresh();
mBind.refreshLayout.finishLoadMore();
if (page == 1) {
mDatas.clear();
}
};
mBind.rvRecord.setLayoutManager(new LinearLayoutManager(this));
mBind.rvRecord.setAdapter(adapter);
mDatas.addAll(data.getData());
setAdapter();
mBind.refreshLayout.setEnableLoadMore(page < data.getTotalPages());
page += 1;
}, responeThrowable -> {
mBind.refreshLayout.finishRefresh();
mBind.refreshLayout.finishLoadMore();
}));
}
private void setAdapter() {
if (mAdapter != null){
mAdapter.notifyDataSetChanged();
}else{
mAdapter = new BaseQuickAdapter<CommonRecordListBean, BaseViewHolder>(R.layout.item_record_common, mDatas) {
@Override
protected void convert(BaseViewHolder helper, CommonRecordListBean item) {
helper.setText(R.id.tv_item1, item.getRewardPrice()+"");
helper.setText(R.id.tv_item2, item.getProviderName());
helper.setText(R.id.tv_item3, item.getCreateTime());
}
};
mBind.rvRecord.setLayoutManager(new LinearLayoutManager(mActivity));
mBind.rvRecord.setAdapter(mAdapter);
}
}
}
......@@ -269,7 +269,7 @@
<LinearLayout
style="@style/ll_user_bottom2"
android:layout_marginLeft="10dp"
android:onClick="@{()->presenter.toCommonRecord(1)}">
android:onClick="@{()->presenter.toCommonRecord(2)}">
<TextView
style="@style/tv_user_bottom1"
......@@ -289,7 +289,7 @@
<LinearLayout
style="@style/ll_user_bottom2"
android:onClick="@{()->presenter.toCommonRecord(2)}"
android:onClick="@{()->presenter.toCommonRecord(3)}"
>
<TextView
......@@ -306,7 +306,7 @@
<LinearLayout
style="@style/ll_user_bottom2"
android:layout_marginLeft="10dp"
android:onClick="@{()->presenter.toCommonRecord(3)}"
android:onClick="@{()->presenter.toCommonRecord(4)}"
>
<TextView
......
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 sign in to comment