快递物流巡查
This commit is contained in:
parent
a27c14a311
commit
d9d97f97c8
@ -25,7 +25,7 @@ public class BaseUrlApi {
|
||||
|
||||
public static final String BASE_URL = BASE_MAIN_IP;//基础URL
|
||||
|
||||
public static final String SOCKET_IP = "http://192.168.0.103:8081/websocket";/*SocketIP*/
|
||||
public static final String SOCKET_IP = IP + "websocket";/*SocketIP*/
|
||||
|
||||
//地图页面展示类型
|
||||
|
||||
|
@ -7,6 +7,7 @@ import android.view.ViewGroup;
|
||||
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
import com.tengshisoft.commonmodule.beans.ExpressListBean;
|
||||
import com.tengshisoft.commonmodule.beans.KeyAreaListBean;
|
||||
import com.tengshisoft.commonmodule.beans.PenalListBean;
|
||||
import com.tengshisoft.commonmodule.holders.ExpressHolder;
|
||||
import com.tengshisoft.commonmodule.holders.PenalListHolder;
|
||||
@ -39,7 +40,20 @@ public class ExpressListAdapter extends BaseRecyclerAdapter<ExpressListBean.Rows
|
||||
holder.mTvUser.setText("负责人:" + bean.getEnterpriseLinkMan());
|
||||
holder.mTvPhone.setText("联系电话:" + bean.getEnterpriseLinkPhone());
|
||||
holder.mTvLocation.setText(bean.getEnterpriseLocationName());
|
||||
if (mPatrolListener != null) {
|
||||
holder.mTvPatrol.setOnClickListener(v -> mPatrolListener.onPatrol(bean));
|
||||
}
|
||||
}
|
||||
|
||||
private OnPatrolListener mPatrolListener;
|
||||
|
||||
public void addOnPatrolListener(OnPatrolListener listener) {
|
||||
this.mPatrolListener = listener;
|
||||
}
|
||||
|
||||
|
||||
public interface OnPatrolListener {
|
||||
void onPatrol(ExpressListBean.RowsBean bean);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.tengshisoft.commonmodule.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolExpressListBean;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolPenalListBean;
|
||||
import com.tengshisoft.commonmodule.holders.PatrolExpressHolder;
|
||||
import com.tengshisoft.commonmodule.holders.PatrolPenalHolder;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/9/26 - 3:01 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 快递巡查
|
||||
*/
|
||||
public class PatrolExpressListAdapter extends BaseRecyclerAdapter<PatrolExpressListBean.RowsBean, PatrolExpressHolder> {
|
||||
|
||||
public PatrolExpressListAdapter(Context ctx, List<PatrolExpressListBean.RowsBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PatrolExpressHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_patrol_key_area_list, parent, false);
|
||||
return new PatrolExpressHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(PatrolExpressHolder holder, int i) {
|
||||
PatrolExpressListBean.RowsBean bean = mData.get(i);
|
||||
holder.mTvContent.setText("巡查内容:" + Html.fromHtml(bean.getPatrolContent()));
|
||||
holder.mTvResult.setText("巡查结果:" + Html.fromHtml(bean.getPatrolResult()));
|
||||
holder.mTvTime.setText("巡查时间:" + bean.getPatrolTime());
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.tengshisoft.commonmodule.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/22 - 4:23 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 快递巡查
|
||||
*/
|
||||
public class PatrolExpressDetailBean {
|
||||
|
||||
private String creator;
|
||||
private String gmtCreate;
|
||||
private String gmtModified;
|
||||
private int isDelete;
|
||||
private String logisticsSafeId;
|
||||
private String logisticsSafePatrolId;
|
||||
private String modifier;
|
||||
private String patrolContent;
|
||||
private String patrolPhoto;
|
||||
private String patrolResult;
|
||||
private String patrolTime;
|
||||
private String patrolVideo;
|
||||
private String remake;
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate;
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getGmtModified() {
|
||||
return gmtModified;
|
||||
}
|
||||
|
||||
public void setGmtModified(String gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
public int getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(int isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getLogisticsSafeId() {
|
||||
return logisticsSafeId;
|
||||
}
|
||||
|
||||
public void setLogisticsSafeId(String logisticsSafeId) {
|
||||
this.logisticsSafeId = logisticsSafeId;
|
||||
}
|
||||
|
||||
public String getLogisticsSafePatrolId() {
|
||||
return logisticsSafePatrolId;
|
||||
}
|
||||
|
||||
public void setLogisticsSafePatrolId(String logisticsSafePatrolId) {
|
||||
this.logisticsSafePatrolId = logisticsSafePatrolId;
|
||||
}
|
||||
|
||||
public String getModifier() {
|
||||
return modifier;
|
||||
}
|
||||
|
||||
public void setModifier(String modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public String getPatrolContent() {
|
||||
return patrolContent;
|
||||
}
|
||||
|
||||
public void setPatrolContent(String patrolContent) {
|
||||
this.patrolContent = patrolContent;
|
||||
}
|
||||
|
||||
public String getPatrolPhoto() {
|
||||
return patrolPhoto;
|
||||
}
|
||||
|
||||
public void setPatrolPhoto(String patrolPhoto) {
|
||||
this.patrolPhoto = patrolPhoto;
|
||||
}
|
||||
|
||||
public String getPatrolResult() {
|
||||
return patrolResult;
|
||||
}
|
||||
|
||||
public void setPatrolResult(String patrolResult) {
|
||||
this.patrolResult = patrolResult;
|
||||
}
|
||||
|
||||
public String getPatrolTime() {
|
||||
return patrolTime;
|
||||
}
|
||||
|
||||
public void setPatrolTime(String patrolTime) {
|
||||
this.patrolTime = patrolTime;
|
||||
}
|
||||
|
||||
public String getPatrolVideo() {
|
||||
return patrolVideo;
|
||||
}
|
||||
|
||||
public void setPatrolVideo(String patrolVideo) {
|
||||
this.patrolVideo = patrolVideo;
|
||||
}
|
||||
|
||||
public String getRemake() {
|
||||
return remake;
|
||||
}
|
||||
|
||||
public void setRemake(String remake) {
|
||||
this.remake = remake;
|
||||
}
|
||||
}
|
@ -0,0 +1,160 @@
|
||||
package com.tengshisoft.commonmodule.beans;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/22 - 4:22 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 快递巡查
|
||||
*/
|
||||
public class PatrolExpressListBean {
|
||||
|
||||
private int page;
|
||||
private int total;
|
||||
private List<RowsBean> rows;
|
||||
|
||||
public int getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(int page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<RowsBean> getRows() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(List<RowsBean> rows) {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public static class RowsBean {
|
||||
private String creator;
|
||||
private String gmtCreate;
|
||||
private String gmtModified;
|
||||
private int isDelete;
|
||||
private String logisticsSafeId;
|
||||
private String logisticsSafePatrolId;
|
||||
private String modifier;
|
||||
private String patrolContent;
|
||||
private String patrolPhoto;
|
||||
private String patrolResult;
|
||||
private String patrolTime;
|
||||
private String patrolVideo;
|
||||
private String remake;
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate;
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getGmtModified() {
|
||||
return gmtModified;
|
||||
}
|
||||
|
||||
public void setGmtModified(String gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
public int getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(int isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getLogisticsSafeId() {
|
||||
return logisticsSafeId;
|
||||
}
|
||||
|
||||
public void setLogisticsSafeId(String logisticsSafeId) {
|
||||
this.logisticsSafeId = logisticsSafeId;
|
||||
}
|
||||
|
||||
public String getLogisticsSafePatrolId() {
|
||||
return logisticsSafePatrolId;
|
||||
}
|
||||
|
||||
public void setLogisticsSafePatrolId(String logisticsSafePatrolId) {
|
||||
this.logisticsSafePatrolId = logisticsSafePatrolId;
|
||||
}
|
||||
|
||||
public String getModifier() {
|
||||
return modifier;
|
||||
}
|
||||
|
||||
public void setModifier(String modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public String getPatrolContent() {
|
||||
return patrolContent;
|
||||
}
|
||||
|
||||
public void setPatrolContent(String patrolContent) {
|
||||
this.patrolContent = patrolContent;
|
||||
}
|
||||
|
||||
public String getPatrolPhoto() {
|
||||
return patrolPhoto;
|
||||
}
|
||||
|
||||
public void setPatrolPhoto(String patrolPhoto) {
|
||||
this.patrolPhoto = patrolPhoto;
|
||||
}
|
||||
|
||||
public String getPatrolResult() {
|
||||
return patrolResult;
|
||||
}
|
||||
|
||||
public void setPatrolResult(String patrolResult) {
|
||||
this.patrolResult = patrolResult;
|
||||
}
|
||||
|
||||
public String getPatrolTime() {
|
||||
return patrolTime;
|
||||
}
|
||||
|
||||
public void setPatrolTime(String patrolTime) {
|
||||
this.patrolTime = patrolTime;
|
||||
}
|
||||
|
||||
public String getPatrolVideo() {
|
||||
return patrolVideo;
|
||||
}
|
||||
|
||||
public void setPatrolVideo(String patrolVideo) {
|
||||
this.patrolVideo = patrolVideo;
|
||||
}
|
||||
|
||||
public String getRemake() {
|
||||
return remake;
|
||||
}
|
||||
|
||||
public void setRemake(String remake) {
|
||||
this.remake = remake;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.tengshisoft.commonmodule.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/22 - 4:49 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class SavePatrolExpressBean {
|
||||
|
||||
private String logisticsSafeId;
|
||||
private String patrolContent;
|
||||
private String patrolPhoto;
|
||||
private String patrolResult;
|
||||
private String patrolTime;
|
||||
private String patrolVideo;
|
||||
private String remake;
|
||||
|
||||
public String getLogisticsSafeId() {
|
||||
return logisticsSafeId;
|
||||
}
|
||||
|
||||
public void setLogisticsSafeId(String logisticsSafeId) {
|
||||
this.logisticsSafeId = logisticsSafeId;
|
||||
}
|
||||
|
||||
public String getPatrolContent() {
|
||||
return patrolContent;
|
||||
}
|
||||
|
||||
public void setPatrolContent(String patrolContent) {
|
||||
this.patrolContent = patrolContent;
|
||||
}
|
||||
|
||||
public String getPatrolPhoto() {
|
||||
return patrolPhoto;
|
||||
}
|
||||
|
||||
public void setPatrolPhoto(String patrolPhoto) {
|
||||
this.patrolPhoto = patrolPhoto;
|
||||
}
|
||||
|
||||
public String getPatrolResult() {
|
||||
return patrolResult;
|
||||
}
|
||||
|
||||
public void setPatrolResult(String patrolResult) {
|
||||
this.patrolResult = patrolResult;
|
||||
}
|
||||
|
||||
public String getPatrolTime() {
|
||||
return patrolTime;
|
||||
}
|
||||
|
||||
public void setPatrolTime(String patrolTime) {
|
||||
this.patrolTime = patrolTime;
|
||||
}
|
||||
|
||||
public String getPatrolVideo() {
|
||||
return patrolVideo;
|
||||
}
|
||||
|
||||
public void setPatrolVideo(String patrolVideo) {
|
||||
this.patrolVideo = patrolVideo;
|
||||
}
|
||||
|
||||
public String getRemake() {
|
||||
return remake;
|
||||
}
|
||||
|
||||
public void setRemake(String remake) {
|
||||
this.remake = remake;
|
||||
}
|
||||
}
|
@ -21,6 +21,7 @@ public class ExpressHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mTvUser;
|
||||
public TextView mTvPhone;
|
||||
public TextView mTvLocation;
|
||||
public TextView mTvPatrol;
|
||||
|
||||
public ExpressHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
@ -28,5 +29,6 @@ public class ExpressHolder extends RecyclerView.ViewHolder {
|
||||
mTvUser = itemView.findViewById(R.id.tv_user);
|
||||
mTvPhone = itemView.findViewById(R.id.tv_phone);
|
||||
mTvLocation = itemView.findViewById(R.id.tv_location);
|
||||
mTvPatrol = itemView.findViewById(R.id.tv_patrol_record);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.tengshisoft.commonmodule.holders;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021年10月18日17:57:07
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 命案发生地巡查记录
|
||||
*/
|
||||
public class PatrolExpressHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mTvContent;
|
||||
public TextView mTvResult;
|
||||
public TextView mTvTime;
|
||||
|
||||
public PatrolExpressHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
mTvContent = itemView.findViewById(R.id.tv_content);
|
||||
mTvResult = itemView.findViewById(R.id.tv_result);
|
||||
mTvTime = itemView.findViewById(R.id.tv_time);
|
||||
}
|
||||
}
|
@ -37,6 +37,8 @@ import com.tengshisoft.commonmodule.beans.MigrantDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.MigrantListBean;
|
||||
import com.tengshisoft.commonmodule.beans.OutboundDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.OutboundListBean;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolExpressDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolExpressListBean;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolKeyAreaDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolKeyAreaListBean;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolPenalDetailBean;
|
||||
@ -1133,4 +1135,43 @@ public interface Apis {
|
||||
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/homicidepatrol/get/{homicidePatrolId}")
|
||||
Observable<PatrolPenalDetailBean> getPenalPatrolDetailById(@Path("homicidePatrolId") String id, @Header("token") String token);
|
||||
|
||||
|
||||
|
||||
/*快递巡查*/
|
||||
|
||||
/**
|
||||
* 快递记录列表
|
||||
*/
|
||||
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/logisticssafepatrol/listpagelogisticssafepatrol")
|
||||
Observable<PatrolExpressListBean> getExpressPatrolList(@Query("logisticsSafeId") String id, @Query("keywords") String key, @Query("page") String page, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 保存快递巡查记录
|
||||
*/
|
||||
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||
@POST("app/logisticssafepatrol/save")
|
||||
Observable<SuccessBean> doSaveExpressPatrol(@Body RequestBody body, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 编辑快递巡查记录
|
||||
*/
|
||||
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||
@PUT("app/logisticssafepatrol/updatelogisticssafepatrol/{logisticsSafePatrolId}")
|
||||
Observable<SuccessBean> doEditExpressPatrol(@Path("logisticsSafePatrolId") String id, @Body RequestBody body, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 删除快递巡查记录
|
||||
*/
|
||||
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||
@DELETE("app/logisticssafepatrol/remove/{ids}")
|
||||
Observable<SuccessBean> doDelExpressPatrol(@Path("ids") String id, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 获取快递巡查记录
|
||||
*/
|
||||
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/logisticssafepatrol/get/{logisticsSafePatrolId}")
|
||||
Observable<PatrolExpressDetailBean> getExpressPatrolDetailById(@Path("logisticsSafePatrolId") String id, @Header("token") String token);
|
||||
}
|
||||
|
@ -8,34 +8,60 @@
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="#ff353535"
|
||||
android:textSize="18sp"
|
||||
tools:text="企业名称" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="负责人:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="联系电话" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="#ff353535"
|
||||
android:textSize="18sp"
|
||||
tools:text="企业名称" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="负责人:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="联系电话" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_patrol_record"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sel_btn_submit"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="巡查记录"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
|
@ -4,7 +4,11 @@
|
||||
package="com.tengshisoft.gridmodule">
|
||||
|
||||
<application>
|
||||
<activity android:name=".incident.activitys.patrols.PenalPatrolEditActivity"></activity>
|
||||
<activity android:name=".incident.activitys.patrols.ExpressPatrolEditActivity"></activity>
|
||||
<activity android:name=".incident.activitys.patrols.ExpressPatrolDetailActivity" />
|
||||
<activity android:name=".incident.activitys.patrols.ExpressPatrolAddActivity" />
|
||||
<activity android:name=".incident.activitys.patrols.ExpressPatrolListActivity" />
|
||||
<activity android:name=".incident.activitys.patrols.PenalPatrolEditActivity" />
|
||||
<activity android:name=".incident.activitys.patrols.PenalPatrolDetailActivity" />
|
||||
<activity android:name=".incident.activitys.patrols.PenalPatrolAddActivity" />
|
||||
<activity android:name=".incident.activitys.patrols.PenalPatrolListActivity" />
|
||||
|
@ -0,0 +1,519 @@
|
||||
package com.tengshisoft.gridmodule.incident.activitys.patrols;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||
import com.bigkoo.pickerview.view.TimePickerView;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tengshisoft.commonmodule.beans.SavePatrolExpressBean;
|
||||
import com.tengshisoft.commonmodule.beans.SuccessBean;
|
||||
import com.tengshisoft.commonmodule.nets.Apis;
|
||||
import com.tengshisoft.gridmodule.R;
|
||||
import com.tengshisoft.gridmodule.R2;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AddPhotoBean;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||
import com.tenlionsoft.baselib.core.widget.PhotoActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.base.AddPhotoAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ButtomDialogView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.TimeUtils;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2021年10月22日16:44:40
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 物流巡查记录添加
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_EXPRESS_ADD)
|
||||
public class ExpressPatrolAddActivity extends BaseActivity {
|
||||
@BindView(R2.id.tv_issue_base_info)
|
||||
TextView mTvIssueBaseInfo;
|
||||
@BindView(R2.id.tv_time)
|
||||
TextView mTvTime;
|
||||
@BindView(R2.id.et_content)
|
||||
EditText mEtContent;
|
||||
@BindView(R2.id.et_result)
|
||||
EditText mEtResult;
|
||||
@BindView(R2.id.rlv_photos)
|
||||
RecyclerView mRlvPhotos;
|
||||
@BindView(R2.id.iv_play_video)
|
||||
ImageView mIvPlayVideo;
|
||||
@BindView(R2.id.ll_video)
|
||||
LinearLayout mLlVideo;
|
||||
@BindView(R2.id.iv_del_video)
|
||||
ImageView mIvDelVideo;
|
||||
@BindView(R2.id.et_remark)
|
||||
EditText mEtRemark;
|
||||
@BindView(R2.id.btn_submit)
|
||||
Button mBtnSubmit;
|
||||
@BindView(R2.id.nsv_content)
|
||||
NestedScrollView mNsvContent;
|
||||
private Unbinder mBind;
|
||||
|
||||
private String mVideoPath;//视频文件路径
|
||||
private String mVideoId;//视频ID
|
||||
private List<AddPhotoBean> mPhotos = new ArrayList<>();
|
||||
private AddPhotoAdapter mAddPhotoAdapter;
|
||||
private AddPhotoBean mCurrentBean;
|
||||
private String mPhotoIds = "";//相片Id
|
||||
private String mPicPath;
|
||||
private String mPoiId;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_express_patrol_add;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mPoiId = getIntent().getStringExtra("poiId");
|
||||
mTvBaseTitle.setText("快递物流巡查记录上报");
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
initViews();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
mAddPhotoAdapter = new AddPhotoAdapter(mActivity, mPhotos);
|
||||
mRlvPhotos.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
||||
mRlvPhotos.setAdapter(mAddPhotoAdapter);
|
||||
mAddPhotoAdapter.addOnDeleteListener(((bean, i) -> {
|
||||
mAddPhotoAdapter.removeItem(bean);
|
||||
mPhotoIds = mPhotoIds.replace(bean.getId() + ",", "");
|
||||
}));
|
||||
mAddPhotoAdapter.addOnItemClickListener(bean -> {
|
||||
if (TextUtils.isEmpty(bean.getPath())) {
|
||||
//空数据
|
||||
showSelectPhoto(bean);
|
||||
} else {
|
||||
//预览
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add(bean.getPath());
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(PhotoActivity.TAG_IMGURL, list);
|
||||
intent.setClass(mActivity, PhotoActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
mIvDelVideo.setVisibility(View.GONE);
|
||||
mIvDelVideo.setOnClickListener(v -> {
|
||||
mVideoPath = "";
|
||||
mVideoId = "";
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.picture_icon_video);
|
||||
mIvDelVideo.setVisibility(View.GONE);
|
||||
});
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.picture_icon_video);
|
||||
mIvPlayVideo.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(mVideoPath)) {
|
||||
//选取视频
|
||||
showSelectVideo();
|
||||
} else {
|
||||
//播放视频
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("url", mVideoPath)
|
||||
.withString("title", "巡查视频")
|
||||
.navigation();
|
||||
}
|
||||
});
|
||||
mTvTime.setOnClickListener(v -> onShowTime());
|
||||
mBtnSubmit.setOnClickListener(v -> doSubmit());
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间选择
|
||||
*/
|
||||
private void onShowTime() {
|
||||
hideSoftKeyboard();
|
||||
TimePickerView mTimePickerView = new TimePickerBuilder(mActivity, (date, v) -> mTvTime.setText(TimeUtils.date2String(date)))
|
||||
.setTitleText("请选时间")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setType(new boolean[]{true, true, true, true, true, true})
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTimePickerView.show();
|
||||
}
|
||||
|
||||
private void doSubmit() {
|
||||
if (checkParams()) {
|
||||
RequestBody body = buildParams();
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(Apis.class)
|
||||
.doSaveExpressPatrol(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.show("巡查成功");
|
||||
setResult(13);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkParams() {
|
||||
String time = mTvTime.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(time)) {
|
||||
ToastUtils.show("请输入巡查时间");
|
||||
return false;
|
||||
}
|
||||
String content = mEtContent.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
ToastUtils.show("请输入巡查内容");
|
||||
return false;
|
||||
}
|
||||
String result = mEtResult.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(result)) {
|
||||
ToastUtils.show("请输入巡查结果");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private RequestBody buildParams() {
|
||||
SavePatrolExpressBean bean = new SavePatrolExpressBean();
|
||||
bean.setLogisticsSafeId(mPoiId);
|
||||
String time = mTvTime.getText().toString().trim();
|
||||
bean.setPatrolTime(time);
|
||||
String content = mEtContent.getText().toString().trim();
|
||||
String result = mEtResult.getText().toString().trim();
|
||||
bean.setPatrolContent(content);
|
||||
bean.setPatrolResult(result);
|
||||
if (!TextUtils.isEmpty(mPhotoIds)) {
|
||||
bean.setPatrolPhoto(mPhotoIds);
|
||||
}
|
||||
if (!TextUtils.isEmpty(mVideoId)) {
|
||||
bean.setPatrolVideo(mVideoId);
|
||||
}
|
||||
String remark = mEtRemark.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(remark)) {
|
||||
bean.setRemake(remark);
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bean);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示选择图片
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
private void showSelectPhoto(AddPhotoBean bean) {
|
||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||
@Override
|
||||
public void choseFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseAlbum() {
|
||||
mCurrentBean = bean;
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||
"image/*");
|
||||
startActivityForResult(intent, BaseUrlApi.PHOTO_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseShoot() {
|
||||
mCurrentBean = bean;
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "photo")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loginOut() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePwd() {
|
||||
|
||||
}
|
||||
});
|
||||
buttomDialogView.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示选择视频
|
||||
*/
|
||||
private void showSelectVideo() {
|
||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||
@Override
|
||||
public void choseFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseAlbum() {
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||
intent.setDataAndType(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
|
||||
"video/*");
|
||||
startActivityForResult(intent, BaseUrlApi.CAMERA_REQUEST_PHOTO);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseShoot() {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "video")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST_VIDEO);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loginOut() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePwd() {
|
||||
|
||||
}
|
||||
});
|
||||
buttomDialogView.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
switch (requestCode) {
|
||||
case BaseUrlApi.CAMERA_REQUEST://相机
|
||||
mPicPath = data.getStringExtra("name");
|
||||
uploadImg(mPicPath, 1);
|
||||
break;
|
||||
case BaseUrlApi.PHOTO_REQUEST://相册
|
||||
try {
|
||||
if (data == null) return;
|
||||
Uri uri = data.getData();
|
||||
String[] proj = {MediaStore.Images.Media.DATA};
|
||||
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
||||
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
String srcPath = cursor.getString(column_index);
|
||||
uploadImg(srcPath, 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
case BaseUrlApi.CAMERA_REQUEST_VIDEO://相机录像
|
||||
mVideoPath = data.getStringExtra("name");
|
||||
uploadVideo(mVideoPath);
|
||||
break;
|
||||
case BaseUrlApi.CAMERA_REQUEST_PHOTO://相册
|
||||
try {
|
||||
if (data == null) return;
|
||||
Uri uri = data.getData();
|
||||
String[] proj = {MediaStore.Images.Media.DATA};
|
||||
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
||||
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
String srcPath = cursor.getString(column_index);
|
||||
uploadVideo(srcPath);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传视频
|
||||
*
|
||||
* @param videoPath
|
||||
*/
|
||||
private void uploadVideo(String videoPath) {
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "视频上传中...");
|
||||
progressDialog.show();
|
||||
File file = new File(videoPath);
|
||||
if (file.exists()) {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("video", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadVideo(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mVideoPath = videoPath;
|
||||
mVideoId = baseUserBean.getData();
|
||||
mIvDelVideo.setVisibility(View.VISIBLE);
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.ic_play_white_icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.show("视频文件路径有误.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param picPath
|
||||
*/
|
||||
private void uploadImg(String picPath, int src) {
|
||||
File file = new File(picPath);
|
||||
if (!file.exists()) {
|
||||
showToast("图片路径错误.");
|
||||
return;
|
||||
}
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "正在上传...");
|
||||
progressDialog.show();
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadImage(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mPhotoIds += (baseUserBean.getData() + ",");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mPhotos.size() < 4) {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
}
|
||||
mAddPhotoAdapter.notifyDataSetChanged();
|
||||
mCurrentBean = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,245 @@
|
||||
package com.tengshisoft.gridmodule.incident.activitys.patrols;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolExpressDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.SuccessBean;
|
||||
import com.tengshisoft.commonmodule.nets.Apis;
|
||||
import com.tengshisoft.gridmodule.R;
|
||||
import com.tengshisoft.gridmodule.R2;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseShowPhotoAdapter;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2021年10月22日16:51:49
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 快递物流巡查记录详情
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_EXPRESS_DETAIL)
|
||||
public class ExpressPatrolDetailActivity extends BaseActivity {
|
||||
@BindView(R2.id.tv_time)
|
||||
TextView mTvTime;
|
||||
@BindView(R2.id.tv_content)
|
||||
TextView mTvContent;
|
||||
@BindView(R2.id.tv_result)
|
||||
TextView mTvResult;
|
||||
@BindView(R2.id.rlv_photos)
|
||||
RecyclerView mRlvPhotos;
|
||||
@BindView(R2.id.iv_play_video)
|
||||
ImageView mIvPlayVideo;
|
||||
@BindView(R2.id.ll_video)
|
||||
LinearLayout mLlVideo;
|
||||
@BindView(R2.id.iv_del_video)
|
||||
ImageView mIvDelVideo;
|
||||
@BindView(R2.id.tv_remark)
|
||||
TextView mTvRemark;
|
||||
@BindView(R2.id.nsv_content)
|
||||
NestedScrollView mNsvContent;
|
||||
@BindView(R2.id.tv_photo_hint)
|
||||
TextView mTvPhotoHint;
|
||||
@BindView(R2.id.tv_video_hint)
|
||||
TextView mTvVideoHint;
|
||||
@BindView(R2.id.btn_edit)
|
||||
Button mBtnEdit;
|
||||
@BindView(R2.id.btn_del)
|
||||
Button mBtnDel;
|
||||
private Unbinder mBind;
|
||||
private String mId;
|
||||
private String mPoiId;
|
||||
private PatrolExpressDetailBean mDetailBean;
|
||||
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_express_patrol_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("重点区域巡查记录详情");
|
||||
mId = getIntent().getStringExtra("id");
|
||||
mPoiId = getIntent().getStringExtra("poiId");
|
||||
mBtnDel.setOnClickListener(v -> doDel());
|
||||
mBtnEdit.setOnClickListener(v -> doEdit());
|
||||
getDetailData();
|
||||
}
|
||||
|
||||
private void doEdit() {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_EXPRESS_EDIT)
|
||||
.withString("id", mId)
|
||||
.withString("poiId", mPoiId)
|
||||
.navigation(mActivity, 12);
|
||||
}
|
||||
|
||||
private void doDel() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
||||
builder.setTitle("提示")
|
||||
.setMessage("确定要删除该条信息吗?")
|
||||
.setPositiveButton("确定", (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
ProgressDialog dialog1 = UIUtil.initDialog(mActivity, "删除中...");
|
||||
dialog1.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(Apis.class)
|
||||
.doDelExpressPatrol(mId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull SuccessBean successBean) {
|
||||
dialog1.dismiss();
|
||||
ToastUtils.show("删除成功");
|
||||
setResult(13);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog1.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12) {
|
||||
if (resultCode == 13) {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
getDetailData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
*/
|
||||
private void getDetailData() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(Apis.class)
|
||||
.getExpressPatrolDetailById(mId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<PatrolExpressDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull PatrolExpressDetailBean patrolKeyAreaDetailBean) {
|
||||
mDetailBean = patrolKeyAreaDetailBean;
|
||||
setDataToView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 回显数据
|
||||
*/
|
||||
private void setDataToView() {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvTime.setText(mDetailBean.getPatrolTime());
|
||||
mTvContent.setText(Html.fromHtml(mDetailBean.getPatrolContent()));
|
||||
mTvResult.setText(Html.fromHtml(mDetailBean.getPatrolResult()));
|
||||
mTvRemark.setText(Html.fromHtml(mDetailBean.getRemake()));
|
||||
if (!TextUtils.isEmpty(mDetailBean.getPatrolPhoto())) {
|
||||
mTvPhotoHint.setVisibility(View.GONE);
|
||||
mRlvPhotos.setVisibility(View.VISIBLE);
|
||||
String[] split = mDetailBean.getPatrolPhoto().split(",");
|
||||
ArrayList<String> paths = new ArrayList<>();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
paths.add(BaseUrlApi.BASE_IMG_URL + split[i]);
|
||||
}
|
||||
BaseShowPhotoAdapter adapter = new BaseShowPhotoAdapter(mActivity, paths);
|
||||
mRlvPhotos.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
||||
mRlvPhotos.setAdapter(adapter);
|
||||
adapter.setOnItemClickListener((data, pos) -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||
.withStringArrayList("imgUrls", paths)
|
||||
.withInt("curItem", pos)
|
||||
.navigation());
|
||||
} else {
|
||||
mTvPhotoHint.setVisibility(View.VISIBLE);
|
||||
mRlvPhotos.setVisibility(View.GONE);
|
||||
}
|
||||
if (!TextUtils.isEmpty(mDetailBean.getPatrolVideo())) {
|
||||
//有视频
|
||||
mLlVideo.setVisibility(View.VISIBLE);
|
||||
mTvVideoHint.setVisibility(View.GONE);
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.ic_play_white_icon);
|
||||
mLlVideo.setOnClickListener(v -> //播放视频
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("url", BaseUrlApi.BASE_IMG_URL + mDetailBean.getPatrolVideo())
|
||||
.withString("title", "巡查视频")
|
||||
.navigation());
|
||||
} else {
|
||||
//没有视频
|
||||
mLlVideo.setVisibility(View.GONE);
|
||||
mTvVideoHint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,582 @@
|
||||
package com.tengshisoft.gridmodule.incident.activitys.patrols;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolExpressDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolKeyAreaDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.SavePatrolExpressBean;
|
||||
import com.tengshisoft.commonmodule.beans.SavePatrolKeyAreaBean;
|
||||
import com.tengshisoft.commonmodule.beans.SuccessBean;
|
||||
import com.tengshisoft.commonmodule.nets.Apis;
|
||||
import com.tengshisoft.gridmodule.R;
|
||||
import com.tengshisoft.gridmodule.R2;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AddPhotoBean;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||
import com.tenlionsoft.baselib.core.widget.PhotoActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.base.AddPhotoAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ButtomDialogView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2021年10月22日16:53:08
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 快递物流巡查记录修改
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_EXPRESS_EDIT)
|
||||
public class ExpressPatrolEditActivity extends BaseActivity {
|
||||
@BindView(R2.id.tv_issue_base_info)
|
||||
TextView mTvIssueBaseInfo;
|
||||
@BindView(R2.id.tv_time)
|
||||
TextView mTvTime;
|
||||
@BindView(R2.id.et_content)
|
||||
EditText mEtContent;
|
||||
@BindView(R2.id.et_result)
|
||||
EditText mEtResult;
|
||||
@BindView(R2.id.rlv_photos)
|
||||
RecyclerView mRlvPhotos;
|
||||
@BindView(R2.id.iv_play_video)
|
||||
ImageView mIvPlayVideo;
|
||||
@BindView(R2.id.ll_video)
|
||||
LinearLayout mLlVideo;
|
||||
@BindView(R2.id.iv_del_video)
|
||||
ImageView mIvDelVideo;
|
||||
@BindView(R2.id.et_remark)
|
||||
EditText mEtRemark;
|
||||
@BindView(R2.id.btn_submit)
|
||||
Button mBtnSubmit;
|
||||
@BindView(R2.id.nsv_content)
|
||||
NestedScrollView mNsvContent;
|
||||
private Unbinder mBind;
|
||||
|
||||
private String mVideoPath;//视频文件路径
|
||||
private String mVideoId;//视频ID
|
||||
private List<AddPhotoBean> mPhotos = new ArrayList<>();
|
||||
private AddPhotoAdapter mAddPhotoAdapter;
|
||||
private AddPhotoBean mCurrentBean;
|
||||
private String mPhotoIds = "";//相片Id
|
||||
private String mPicPath;
|
||||
private String mPoiId;
|
||||
private String mId;
|
||||
private PatrolExpressDetailBean mDetailBean;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_express_patrol_edit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mId = getIntent().getStringExtra("id");
|
||||
mPoiId = getIntent().getStringExtra("poiId");
|
||||
mTvBaseTitle.setText("快递物流巡查记录编辑");
|
||||
initViews();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
*/
|
||||
private void getDetailData() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(Apis.class)
|
||||
.getExpressPatrolDetailById(mId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<PatrolExpressDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull PatrolExpressDetailBean patrolKeyAreaDetailBean) {
|
||||
mDetailBean = patrolKeyAreaDetailBean;
|
||||
setDataToView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 回显数据
|
||||
*/
|
||||
private void setDataToView() {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvTime.setText(mDetailBean.getPatrolTime());
|
||||
mEtContent.setText(mDetailBean.getPatrolContent());
|
||||
mEtResult.setText(mDetailBean.getPatrolResult());
|
||||
mEtRemark.setText(mDetailBean.getRemake());
|
||||
//图片
|
||||
if (!TextUtils.isEmpty(mDetailBean.getPatrolPhoto())) {
|
||||
mPhotos.clear();
|
||||
mPhotoIds = mDetailBean.getPatrolPhoto();
|
||||
String[] doorIds = mDetailBean.getPatrolPhoto().split(",");
|
||||
for (int j = 0; j < doorIds.length; j++) {
|
||||
if (!TextUtils.isEmpty(doorIds[j])) {
|
||||
AddPhotoBean bean = new AddPhotoBean();
|
||||
bean.setId(doorIds[j]);
|
||||
bean.setPath(BaseUrlApi.BASE_IMG_URL + doorIds[j]);
|
||||
mPhotos.add(bean);
|
||||
}
|
||||
}
|
||||
if (mPhotos.size() < 9) {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
}
|
||||
mAddPhotoAdapter.setData(mPhotos);
|
||||
}
|
||||
if (!TextUtils.isEmpty(mDetailBean.getPatrolVideo())) {
|
||||
mIvDelVideo.setVisibility(View.VISIBLE);
|
||||
mIvDelVideo.setOnClickListener(v -> {
|
||||
mVideoPath = "";
|
||||
mVideoId = "";
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.picture_icon_video);
|
||||
mIvDelVideo.setVisibility(View.GONE);
|
||||
});
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.ic_play_white_icon);
|
||||
mVideoPath = BaseUrlApi.BASE_IMG_URL + mDetailBean.getPatrolVideo();
|
||||
mVideoId = mDetailBean.getPatrolVideo();
|
||||
}
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
mPhotos = new ArrayList<>();
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
mAddPhotoAdapter = new AddPhotoAdapter(this, mPhotos);
|
||||
mRlvPhotos.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
||||
mRlvPhotos.setAdapter(mAddPhotoAdapter);
|
||||
mAddPhotoAdapter.addOnDeleteListener(((bean, i) -> {
|
||||
mAddPhotoAdapter.removeItem(bean);
|
||||
mPhotoIds = mPhotoIds.replace(bean.getId() + ",", "");
|
||||
}));
|
||||
mAddPhotoAdapter.addOnItemClickListener(bean -> {
|
||||
if (TextUtils.isEmpty(bean.getPath())) {
|
||||
//空数据
|
||||
showSelectPhoto(bean);
|
||||
} else {
|
||||
//预览
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add(bean.getPath());
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(PhotoActivity.TAG_IMGURL, list);
|
||||
intent.setClass(mActivity, PhotoActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
mIvDelVideo.setVisibility(View.GONE);
|
||||
mIvDelVideo.setOnClickListener(v -> {
|
||||
mVideoPath = "";
|
||||
mVideoId = "";
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.picture_icon_video);
|
||||
mIvDelVideo.setVisibility(View.GONE);
|
||||
});
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.picture_icon_video);
|
||||
mIvPlayVideo.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(mVideoPath)) {
|
||||
//选取视频
|
||||
showSelectVideo();
|
||||
} else {
|
||||
//播放视频
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("url", mVideoPath)
|
||||
.withString("title", "巡查视频")
|
||||
.navigation();
|
||||
}
|
||||
});
|
||||
mBtnSubmit.setOnClickListener(v -> doSubmit());
|
||||
getDetailData();
|
||||
}
|
||||
|
||||
private void doSubmit() {
|
||||
if (checkParams()) {
|
||||
RequestBody body = buildParams();
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(Apis.class)
|
||||
.doEditExpressPatrol(mId, body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.show("修改成功");
|
||||
setResult(13);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkParams() {
|
||||
String time = mTvTime.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(time)) {
|
||||
ToastUtils.show("请输入巡查时间");
|
||||
return false;
|
||||
}
|
||||
String content = mEtContent.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
ToastUtils.show("请输入巡查内容");
|
||||
return false;
|
||||
}
|
||||
String result = mEtResult.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(result)) {
|
||||
ToastUtils.show("请输入巡查结果");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private RequestBody buildParams() {
|
||||
SavePatrolExpressBean bean = new SavePatrolExpressBean();
|
||||
bean.setLogisticsSafeId(mPoiId);
|
||||
String time = mTvTime.getText().toString().trim();
|
||||
bean.setPatrolTime(time);
|
||||
String content = mEtContent.getText().toString().trim();
|
||||
String result = mEtResult.getText().toString().trim();
|
||||
bean.setPatrolContent(content);
|
||||
bean.setPatrolResult(result);
|
||||
if (!TextUtils.isEmpty(mPhotoIds)) {
|
||||
bean.setPatrolPhoto(mPhotoIds);
|
||||
}
|
||||
if (!TextUtils.isEmpty(mVideoId)) {
|
||||
bean.setPatrolVideo(mVideoId);
|
||||
}
|
||||
String remark = mEtRemark.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(remark)) {
|
||||
bean.setRemake(remark);
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bean);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示选择图片
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
private void showSelectPhoto(AddPhotoBean bean) {
|
||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||
@Override
|
||||
public void choseFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseAlbum() {
|
||||
mCurrentBean = bean;
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||
"image/*");
|
||||
startActivityForResult(intent, BaseUrlApi.PHOTO_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseShoot() {
|
||||
mCurrentBean = bean;
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "photo")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loginOut() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePwd() {
|
||||
|
||||
}
|
||||
});
|
||||
buttomDialogView.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示选择视频
|
||||
*/
|
||||
private void showSelectVideo() {
|
||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||
@Override
|
||||
public void choseFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseAlbum() {
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||
intent.setDataAndType(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
|
||||
"video/*");
|
||||
startActivityForResult(intent, BaseUrlApi.CAMERA_REQUEST_PHOTO);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseShoot() {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_TAKE_PHOTO)
|
||||
.withString("path", getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath())
|
||||
.withString("type", "video")
|
||||
.navigation(mActivity, BaseUrlApi.CAMERA_REQUEST_VIDEO);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loginOut() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePwd() {
|
||||
|
||||
}
|
||||
});
|
||||
buttomDialogView.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
switch (requestCode) {
|
||||
case BaseUrlApi.CAMERA_REQUEST://相机
|
||||
mPicPath = data.getStringExtra("name");
|
||||
uploadImg(mPicPath, 1);
|
||||
break;
|
||||
case BaseUrlApi.PHOTO_REQUEST://相册
|
||||
try {
|
||||
if (data == null) return;
|
||||
Uri uri = data.getData();
|
||||
String[] proj = {MediaStore.Images.Media.DATA};
|
||||
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
||||
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
String srcPath = cursor.getString(column_index);
|
||||
uploadImg(srcPath, 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
case BaseUrlApi.CAMERA_REQUEST_VIDEO://相机录像
|
||||
mVideoPath = data.getStringExtra("name");
|
||||
uploadVideo(mVideoPath);
|
||||
break;
|
||||
case BaseUrlApi.CAMERA_REQUEST_PHOTO://相册
|
||||
try {
|
||||
if (data == null) return;
|
||||
Uri uri = data.getData();
|
||||
String[] proj = {MediaStore.Images.Media.DATA};
|
||||
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
||||
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
String srcPath = cursor.getString(column_index);
|
||||
uploadVideo(srcPath);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传视频
|
||||
*
|
||||
* @param videoPath
|
||||
*/
|
||||
private void uploadVideo(String videoPath) {
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "视频上传中...");
|
||||
progressDialog.show();
|
||||
File file = new File(videoPath);
|
||||
if (file.exists()) {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("video", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadVideo(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mVideoPath = videoPath;
|
||||
mVideoId = baseUserBean.getData();
|
||||
mIvDelVideo.setVisibility(View.VISIBLE);
|
||||
mIvPlayVideo.setBackgroundResource(R.drawable.ic_play_white_icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.show("视频文件路径有误.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param picPath
|
||||
*/
|
||||
private void uploadImg(String picPath, int src) {
|
||||
File file = new File(picPath);
|
||||
if (!file.exists()) {
|
||||
showToast("图片路径错误.");
|
||||
return;
|
||||
}
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "正在上传...");
|
||||
progressDialog.show();
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadImage(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseUserBean) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传成功");
|
||||
mPhotoIds += (baseUserBean.getData() + ",");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mPhotos.size() < 4) {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
}
|
||||
mAddPhotoAdapter.notifyDataSetChanged();
|
||||
mCurrentBean = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,353 @@
|
||||
package com.tengshisoft.gridmodule.incident.activitys.patrols;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
import com.tengshisoft.commonmodule.adapters.PatrolExpressListAdapter;
|
||||
import com.tengshisoft.commonmodule.beans.ExpressDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.PatrolExpressListBean;
|
||||
import com.tengshisoft.commonmodule.nets.Apis;
|
||||
import com.tengshisoft.gridmodule.R;
|
||||
import com.tengshisoft.gridmodule.R2;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2021年10月22日16:32:15
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 物流快递点巡查
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_EXPRESS_LIST)
|
||||
public class ExpressPatrolListActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R2.id.et_base_search_content)
|
||||
EditText mEtBaseSearchContent;
|
||||
@BindView(R2.id.iv_base_clear)
|
||||
ImageView mIvBaseClear;
|
||||
@BindView(R2.id.btn_base_search)
|
||||
Button mBtnBaseSearch;
|
||||
@BindView(R2.id.ll_base_search_content)
|
||||
LinearLayout mLlBaseSearchContent;
|
||||
@BindView(R2.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R2.id.tv_area)
|
||||
TextView mTvArea;
|
||||
@BindView(R2.id.tv_address)
|
||||
TextView mTvAddress;
|
||||
@BindView(R2.id.tv_phone)
|
||||
TextView mTvPhone;
|
||||
@BindView(R2.id.tv_link)
|
||||
TextView mTvLink;
|
||||
@BindView(R2.id.tv_link_phone)
|
||||
TextView mTvLinkPhone;
|
||||
@BindView(R2.id.sw_is_seal)
|
||||
SwitchCompat mSwIsSeal;
|
||||
@BindView(R2.id.sw_is_real)
|
||||
SwitchCompat mSwIsReal;
|
||||
@BindView(R2.id.sw_is_security)
|
||||
SwitchCompat mSwIsSecurity;
|
||||
@BindView(R2.id.rlv_buildings)
|
||||
RecyclerView mRlvBuildings;
|
||||
@BindView(R2.id.pb_loading)
|
||||
ProgressBar mPbLoading;
|
||||
@BindView(R2.id.iv_empty_data)
|
||||
ImageView mIvEmptyData;
|
||||
@BindView(R2.id.tv_error_hint)
|
||||
TextView mTvErrorHint;
|
||||
@BindView(R2.id.srl_content)
|
||||
SmartRefreshLayout mSrlContent;
|
||||
private Unbinder mBind;
|
||||
private String mId;
|
||||
private int mCurrentPage = 1;//当前页数
|
||||
private List<PatrolExpressListBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private PatrolExpressListAdapter mAdapter;
|
||||
private String mKeywords = "";
|
||||
|
||||
private ExpressDetailBean mDetailBean;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_express_patrol_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mId = getIntent().getStringExtra("id");
|
||||
mTvBaseTitle.setText("巡查记录");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("巡查");
|
||||
mTvPublish.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_EXPRESS_ADD)
|
||||
.withString("poiId", mId)
|
||||
.navigation(mActivity, 12));
|
||||
mAdapter = new PatrolExpressListAdapter(mActivity, mDatas);
|
||||
mSrlContent.setOnLoadMoreListener(refreshLayout -> loadMore());
|
||||
mSrlContent.setOnRefreshListener(refreshLayout -> doRefresh());
|
||||
mRlvBuildings.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvBuildings.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::showDetail);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
setStateView(13);
|
||||
getPatrolList(1);
|
||||
mBtnBaseSearch.setOnClickListener(v -> doSearch());
|
||||
mIvBaseClear.setOnClickListener(v -> {
|
||||
mKeywords = "";
|
||||
mEtBaseSearchContent.setText("");
|
||||
doRefresh();
|
||||
});
|
||||
getDetailById();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
*/
|
||||
private void getDetailById() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(Apis.class)
|
||||
.getExpressDetailById(mId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ExpressDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull ExpressDetailBean expressDetailBean) {
|
||||
mDetailBean = expressDetailBean;
|
||||
setDataToView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 回显数据
|
||||
*/
|
||||
private void setDataToView() {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvName.setText(mDetailBean.getLogisticsEnterpriseName());
|
||||
mTvArea.setText(mDetailBean.getEnterpriseLocationName());
|
||||
mTvAddress.setText(mDetailBean.getEnterpriseAddress());
|
||||
mTvPhone.setText(mDetailBean.getEnterprisePhone());
|
||||
mTvLink.setText(mDetailBean.getEnterpriseLinkMan());
|
||||
mTvLinkPhone.setText(mDetailBean.getEnterpriseLinkPhone());
|
||||
mSwIsReal.setChecked(mDetailBean.getIsRealName() == 1);
|
||||
mSwIsSeal.setChecked(mDetailBean.getIsSealing() == 1);
|
||||
mSwIsSecurity.setChecked(mDetailBean.getIsXCheck() == 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示详情
|
||||
*/
|
||||
private void showDetail(PatrolExpressListBean.RowsBean b) {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_EXPRESS_DETAIL)
|
||||
.withString("id", b.getLogisticsSafePatrolId())
|
||||
.withString("poiId", b.getLogisticsSafeId())
|
||||
.navigation(mActivity, 12);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12) {
|
||||
if (resultCode == 13) {
|
||||
doRefresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @param currentPage
|
||||
*/
|
||||
private void getPatrolList(int currentPage) {
|
||||
mCurrentPage = currentPage;
|
||||
RetrofitManager.getInstance()
|
||||
.create(Apis.class)
|
||||
.getExpressPatrolList(mId, mKeywords, mCurrentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<PatrolExpressListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull PatrolExpressListBean communityListBean) {
|
||||
if (communityListBean != null && communityListBean.getRows() != null && communityListBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(communityListBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(communityListBean.getRows());
|
||||
}
|
||||
setStateView(14);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mSrlContent.finishRefresh();
|
||||
if (mDatas.size() >= communityListBean.getTotal()) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(false);
|
||||
}
|
||||
} else {
|
||||
mSrlContent.setNoMoreData(true);
|
||||
mSrlContent.finishLoadMore();
|
||||
if (currentPage > 1) {
|
||||
setStateView(14);
|
||||
} else {
|
||||
if (TextUtils.isEmpty(mKeywords)) {
|
||||
//无数据
|
||||
setStateView(15);
|
||||
} else {
|
||||
setStateView(15);
|
||||
ToastUtils.show("未查询到相关内容");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
ExceptionHandler.handleException(e);
|
||||
setStateView(16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void doSearch() {
|
||||
hideSoftKeyboard();
|
||||
String searchContent = mEtBaseSearchContent.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(searchContent)) {
|
||||
hideSoftKeyboard();
|
||||
setStateView(13);
|
||||
mKeywords = searchContent;
|
||||
mCurrentPage = 1;
|
||||
getPatrolList(mCurrentPage);
|
||||
|
||||
} else {
|
||||
ToastUtils.show("请输入要查询的内容");
|
||||
}
|
||||
}
|
||||
|
||||
//加载更多
|
||||
private void loadMore() {
|
||||
getPatrolList(mCurrentPage);
|
||||
}
|
||||
|
||||
//刷新
|
||||
private void doRefresh() {
|
||||
mDatas.clear();
|
||||
mAdapter.setData(mDatas);
|
||||
getPatrolList(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态显示
|
||||
* 12 默认
|
||||
* 13 搜索中
|
||||
* 14 搜索完成有数据
|
||||
* 15 搜索完成没有数据
|
||||
* 16 搜索失败
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
private void setStateView(int state) {
|
||||
switch (state) {
|
||||
case 12://默认
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mRlvBuildings.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("请输入查询的内容");
|
||||
break;
|
||||
case 13://搜索中
|
||||
mPbLoading.setVisibility(View.VISIBLE);
|
||||
mRlvBuildings.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.GONE);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("加载中...");
|
||||
break;
|
||||
case 14://搜索完成有数据
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mRlvBuildings.setVisibility(View.VISIBLE);
|
||||
mIvEmptyData.setVisibility(View.GONE);
|
||||
mTvErrorHint.setVisibility(View.GONE);
|
||||
break;
|
||||
case 15://搜索完成没有数据
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mRlvBuildings.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("没有搜索到数据");
|
||||
break;
|
||||
case 16://搜索失败
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mRlvBuildings.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("加载失败,请稍后重试");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -94,6 +94,7 @@ public class ExpressPoiListActivity extends BaseActivity {
|
||||
mRlvBuildings.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvBuildings.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::showDetail);
|
||||
mAdapter.addOnPatrolListener(this::doPatrol);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
setStateView(13);
|
||||
getExpressList(1);
|
||||
@ -105,6 +106,16 @@ public class ExpressPoiListActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 巡查记录
|
||||
*/
|
||||
private void doPatrol(ExpressListBean.RowsBean rowsBean) {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_EXPRESS_LIST)
|
||||
.withString("id", rowsBean.getLogisticsSafeId())
|
||||
.navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示详情
|
||||
*/
|
||||
|
187
gridmodule/src/main/res/layout/activity_express_patrol_add.xml
Normal file
187
gridmodule/src/main/res/layout/activity_express_patrol_add.xml
Normal file
@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/nsv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:cardUseCompatPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_issue_base_info"
|
||||
style="@style/issue_report_title"
|
||||
android:padding="8dp"
|
||||
android:text="基本信息"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="巡查时间" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
style="@style/sel_text_arrow"
|
||||
android:hint="请选择巡查时间" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:drawableLeft="@drawable/ic_start_hint"
|
||||
android:text="巡查内容" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_content"
|
||||
style="@style/item_content_edit"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:hint="请输入巡查内容"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:drawableLeft="@drawable/ic_start_hint"
|
||||
android:text="巡查结果" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_result"
|
||||
style="@style/item_content_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入巡查结果"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="巡查照片" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_photos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="巡查视频" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_video"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/shp_rectangle_black"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play_video"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@drawable/picture_icon_video" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_del_video"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic_delete" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="备注" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_remark"
|
||||
style="@style/item_content_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入备注"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:cardUseCompatPadding="false">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sel_btn_submit"
|
||||
android:text="上报"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</RelativeLayout>
|
@ -0,0 +1,219 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/nsv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:cardUseCompatPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/issue_report_title"
|
||||
android:padding="8dp"
|
||||
android:text="详情"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_edit"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sel_btn_blue_gray_re_5"
|
||||
android:minWidth="0dp"
|
||||
android:minHeight="0dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="编辑"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_del"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/sel_btn_red_gray_re_5"
|
||||
android:minWidth="0dp"
|
||||
android:minHeight="0dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="删除"
|
||||
android:textColor="@color/white" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="巡查时间" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
style="@style/item_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="巡查内容" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
style="@style/item_content_ver"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="巡查结果" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_result"
|
||||
style="@style/item_content_ver"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="巡查照片" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_photos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_photo_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="未上传照片" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="巡查视频" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_video"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/shp_rectangle_black"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play_video"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@drawable/picture_icon_video" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_del_video"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic_delete"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_video_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="未上传视频" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="备注" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_remark"
|
||||
style="@style/item_content_ver"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</RelativeLayout>
|
187
gridmodule/src/main/res/layout/activity_express_patrol_edit.xml
Normal file
187
gridmodule/src/main/res/layout/activity_express_patrol_edit.xml
Normal file
@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/nsv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:cardUseCompatPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_issue_base_info"
|
||||
style="@style/issue_report_title"
|
||||
android:padding="8dp"
|
||||
android:text="基本信息"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="巡查时间" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
style="@style/sel_text_arrow"
|
||||
android:hint="请选择巡查时间" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:drawableLeft="@drawable/ic_start_hint"
|
||||
android:text="巡查内容" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_content"
|
||||
style="@style/item_content_edit"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:hint="请输入巡查内容"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:drawableLeft="@drawable/ic_start_hint"
|
||||
android:text="巡查结果" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_result"
|
||||
style="@style/item_content_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入巡查结果"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="巡查照片" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_photos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="巡查视频" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_video"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/shp_rectangle_black"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play_video"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@drawable/picture_icon_video" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_del_video"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic_delete" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_vertical"
|
||||
android:text="备注" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_remark"
|
||||
style="@style/item_content_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入备注"
|
||||
android:minLines="3" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:cardUseCompatPadding="false">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sel_btn_submit"
|
||||
android:text="保存"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</RelativeLayout>
|
332
gridmodule/src/main/res/layout/activity_express_patrol_list.xml
Normal file
332
gridmodule/src/main/res/layout/activity_express_patrol_list.xml
Normal file
@ -0,0 +1,332 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_bg"
|
||||
android:orientation="vertical"
|
||||
tools:context=".incident.activitys.building.CommunityManageActivity">
|
||||
|
||||
<include layout="@layout/item_base_search" />
|
||||
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:cardUseCompatPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.ExpandableLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:defaultItemCount="3"
|
||||
app:expandText="点击展开"
|
||||
app:hideText="点击收起"
|
||||
app:useDefaultBottom="true">
|
||||
|
||||
<TextView
|
||||
style="@style/issue_report_title"
|
||||
android:padding="8dp"
|
||||
android:text="快递物流点详情"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="企业名称" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
style="@style/item_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="所在地" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area"
|
||||
style="@style/item_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="企业详址" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
style="@style/item_content" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="企业联系方式" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phone"
|
||||
style="@style/item_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="企业负责人" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_link"
|
||||
style="@style/item_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_gray">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:text="负责人联系方式" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_link_phone"
|
||||
style="@style/item_content" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
style="@style/item_gray"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:layout_weight="1"
|
||||
android:text="是否落实100%先验视后封箱" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/sw_is_seal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@drawable/switch_ios_track_selector"
|
||||
android:checked="true"
|
||||
android:enabled="false"
|
||||
android:switchMinWidth="40dp"
|
||||
android:switchPadding="0dp"
|
||||
android:textOff=""
|
||||
android:textOn=""
|
||||
app:showText="false"
|
||||
app:splitTrack="false"
|
||||
app:theme="@style/scstyle"
|
||||
app:thumbTint="#00000000"
|
||||
app:trackTint="#00000000" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
style="@style/item_gray"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:layout_weight="1"
|
||||
android:text="是否落实100%寄递实名制" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/sw_is_real"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@drawable/switch_ios_track_selector"
|
||||
android:checked="true"
|
||||
android:enabled="false"
|
||||
android:switchMinWidth="40dp"
|
||||
android:switchPadding="0dp"
|
||||
android:textOff=""
|
||||
android:textOn=""
|
||||
app:showText="false"
|
||||
app:splitTrack="false"
|
||||
app:theme="@style/scstyle"
|
||||
app:thumbTint="#00000000"
|
||||
app:trackTint="#00000000" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
style="@style/item_gray"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
style="@style/style_hint_star"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:layout_weight="1"
|
||||
android:text="是否落实100%X光机安检" />
|
||||
|
||||
<View style="@style/vertical_line" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/sw_is_security"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@drawable/switch_ios_track_selector"
|
||||
android:checked="true"
|
||||
android:enabled="false"
|
||||
android:switchMinWidth="40dp"
|
||||
android:switchPadding="0dp"
|
||||
android:textOff=""
|
||||
android:textOn=""
|
||||
app:showText="false"
|
||||
app:splitTrack="false"
|
||||
app:theme="@style/scstyle"
|
||||
app:thumbTint="#00000000"
|
||||
app:trackTint="#00000000" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</com.tenlionsoft.baselib.core.widget.views.ExpandableLinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_buildings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/item_express_list" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty_data"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/ic_empty_data" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_error_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:textColor="@color/black"
|
||||
tools:text="加载数据失败" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
</LinearLayout>
|
@ -14,7 +14,7 @@
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -14,7 +14,7 @@
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
|
Loading…
Reference in New Issue
Block a user