重点区域巡检记录
This commit is contained in:
parent
63e224d31b
commit
e2129a484b
@ -421,6 +421,12 @@ public class PathConfig {
|
|||||||
|
|
||||||
public static final String PATH_MODULE_GRID_ACTIVITY_DIC_SEL = "/modulegrid/activity/dicSel";//字典多选、单选
|
public static final String PATH_MODULE_GRID_ACTIVITY_DIC_SEL = "/modulegrid/activity/dicSel";//字典多选、单选
|
||||||
|
|
||||||
|
//巡查巡检
|
||||||
|
public static final String PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_LIST = "/modulegrid/activity/patrolKeyAreaList";//重点区域巡查列表
|
||||||
|
public static final String PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_ADD = "/modulegrid/activity/patrolKeyAreaAdd";//重点区域巡查上报
|
||||||
|
public static final String PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_DETAIL = "/modulegrid/activity/patrolKeyAreaDetail";//重点区域巡查详情
|
||||||
|
public static final String PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_EDIT = "/modulegrid/activity/patrolKeyAreaEdit";//重点区域巡查编辑
|
||||||
|
|
||||||
//部件
|
//部件
|
||||||
public static final String PATH_MODULE_GRID_ACTIVITY_COMPONENT_LIST = "/modulegrid/activity/componentList";//部件列表
|
public static final String PATH_MODULE_GRID_ACTIVITY_COMPONENT_LIST = "/modulegrid/activity/componentList";//部件列表
|
||||||
public static final String PATH_MODULE_GRID_ACTIVITY_COMPONENT_ADD = "/modulegrid/activity/componentAdd";//部件采集
|
public static final String PATH_MODULE_GRID_ACTIVITY_COMPONENT_ADD = "/modulegrid/activity/componentAdd";//部件采集
|
||||||
|
@ -144,7 +144,6 @@ public interface BaseApiService {
|
|||||||
* @param token
|
* @param token
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Headers({"base_url_name:case"})
|
|
||||||
@Multipart
|
@Multipart
|
||||||
@POST("app/file/uploadvideo")
|
@POST("app/file/uploadvideo")
|
||||||
Observable<BaseSuccessBean> uploadVideo(@Part MultipartBody.Part file, @Header("token") String token);
|
Observable<BaseSuccessBean> uploadVideo(@Part MultipartBody.Part file, @Header("token") String token);
|
||||||
@ -158,7 +157,6 @@ public interface BaseApiService {
|
|||||||
* @param token
|
* @param token
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Headers({"base_url_name:case"})
|
|
||||||
@Multipart
|
@Multipart
|
||||||
@POST("app/file/uploadaudio")
|
@POST("app/file/uploadaudio")
|
||||||
Observable<BaseSuccessBean> uploadAudio(@Part MultipartBody.Part file, @Header("token") String token);
|
Observable<BaseSuccessBean> uploadAudio(@Part MultipartBody.Part file, @Header("token") String token);
|
||||||
|
@ -51,7 +51,7 @@ public class TakeVideoActivity extends BaseActivity {
|
|||||||
public void initData() {
|
public void initData() {
|
||||||
mBind = ButterKnife.bind(this);
|
mBind = ButterKnife.bind(this);
|
||||||
refreshView(STATE_LOAD_SUCCESS);
|
refreshView(STATE_LOAD_SUCCESS);
|
||||||
mTvBaseTitle.setText("视频录制");
|
mTvBaseTitle.setText("拍摄");
|
||||||
initView();
|
initView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,19 @@ public class KeyAreaAdapter extends BaseRecyclerAdapter<KeyAreaListBean.RowsBean
|
|||||||
holder.mTvExtrude.setText("治安突出问题:" + bean.getSecurityQuestionName());
|
holder.mTvExtrude.setText("治安突出问题:" + bean.getSecurityQuestionName());
|
||||||
holder.mTvArea.setText("涉及区域类型:" + bean.getInvolveAreaTypeName());
|
holder.mTvArea.setText("涉及区域类型:" + bean.getInvolveAreaTypeName());
|
||||||
holder.mTvTime.setText("整改时限:" + bean.getRectificationTime());
|
holder.mTvTime.setText("整改时限:" + bean.getRectificationTime());
|
||||||
|
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(KeyAreaListBean.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.BuildingListBean;
|
||||||
|
import com.tengshisoft.commonmodule.beans.PatrolKeyAreaListBean;
|
||||||
|
import com.tengshisoft.commonmodule.holders.BuildingListHolder;
|
||||||
|
import com.tengshisoft.commonmodule.holders.PatrolKeyAreaHolder;
|
||||||
|
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者: adam
|
||||||
|
* 日期: 2021/9/26 - 3:01 下午
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述:重点区域巡查
|
||||||
|
*/
|
||||||
|
public class PatrolKeyAreaListAdapter extends BaseRecyclerAdapter<PatrolKeyAreaListBean.RowsBean, PatrolKeyAreaHolder> {
|
||||||
|
|
||||||
|
public PatrolKeyAreaListAdapter(Context ctx, List<PatrolKeyAreaListBean.RowsBean> list) {
|
||||||
|
super(ctx, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PatrolKeyAreaHolder createHolder(ViewGroup parent, int viewType) {
|
||||||
|
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_patrol_key_area_list, parent, false);
|
||||||
|
return new PatrolKeyAreaHolder(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindHolder(PatrolKeyAreaHolder holder, int i) {
|
||||||
|
PatrolKeyAreaListBean.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,83 @@
|
|||||||
|
package com.tengshisoft.commonmodule.beans;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者: adam
|
||||||
|
* 日期: 2021/10/22 - 1:54 下午
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述:
|
||||||
|
*/
|
||||||
|
public class PatrolKeyAreaDetailBean {
|
||||||
|
|
||||||
|
private String keyAreaCheckRenovationId;
|
||||||
|
private String keyAreaCheckRenovationPatrolId;
|
||||||
|
private String patrolContent;
|
||||||
|
private String patrolPhoto;
|
||||||
|
private String patrolResult;
|
||||||
|
private String patrolTime;
|
||||||
|
private String patrolVideo;
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
public String getKeyAreaCheckRenovationId() {
|
||||||
|
return keyAreaCheckRenovationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyAreaCheckRenovationId(String keyAreaCheckRenovationId) {
|
||||||
|
this.keyAreaCheckRenovationId = keyAreaCheckRenovationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeyAreaCheckRenovationPatrolId() {
|
||||||
|
return keyAreaCheckRenovationPatrolId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyAreaCheckRenovationPatrolId(String keyAreaCheckRenovationPatrolId) {
|
||||||
|
this.keyAreaCheckRenovationPatrolId = keyAreaCheckRenovationPatrolId;
|
||||||
|
}
|
||||||
|
|
||||||
|
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,115 @@
|
|||||||
|
package com.tengshisoft.commonmodule.beans;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者: adam
|
||||||
|
* 日期: 2021/10/22 - 11:29 上午
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述:重点区域巡查
|
||||||
|
*/
|
||||||
|
public class PatrolKeyAreaListBean {
|
||||||
|
|
||||||
|
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 keyAreaCheckRenovationId;
|
||||||
|
private String keyAreaCheckRenovationPatrolId;
|
||||||
|
private String patrolContent;
|
||||||
|
private String patrolPhoto;
|
||||||
|
private String patrolResult;
|
||||||
|
private String patrolTime;
|
||||||
|
private String patrolVideo;
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
public String getKeyAreaCheckRenovationId() {
|
||||||
|
return keyAreaCheckRenovationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyAreaCheckRenovationId(String keyAreaCheckRenovationId) {
|
||||||
|
this.keyAreaCheckRenovationId = keyAreaCheckRenovationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeyAreaCheckRenovationPatrolId() {
|
||||||
|
return keyAreaCheckRenovationPatrolId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyAreaCheckRenovationPatrolId(String keyAreaCheckRenovationPatrolId) {
|
||||||
|
this.keyAreaCheckRenovationPatrolId = keyAreaCheckRenovationPatrolId;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 - 1:41 下午
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述:
|
||||||
|
*/
|
||||||
|
public class SavePatrolKeyAreaBean {
|
||||||
|
|
||||||
|
private String keyAreaCheckRenovationId;
|
||||||
|
private String patrolContent;
|
||||||
|
private String patrolPhoto;
|
||||||
|
private String patrolResult;
|
||||||
|
private String patrolTime;
|
||||||
|
private String patrolVideo;
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
public String getKeyAreaCheckRenovationId() {
|
||||||
|
return keyAreaCheckRenovationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyAreaCheckRenovationId(String keyAreaCheckRenovationId) {
|
||||||
|
this.keyAreaCheckRenovationId = keyAreaCheckRenovationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 KeyAreaListHolder extends RecyclerView.ViewHolder {
|
|||||||
public TextView mTvExtrude;
|
public TextView mTvExtrude;
|
||||||
public TextView mTvArea;
|
public TextView mTvArea;
|
||||||
public TextView mTvTime;
|
public TextView mTvTime;
|
||||||
|
public TextView mTvPatrol;
|
||||||
|
|
||||||
public KeyAreaListHolder(@NonNull @NotNull View itemView) {
|
public KeyAreaListHolder(@NonNull @NotNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@ -28,5 +29,6 @@ public class KeyAreaListHolder extends RecyclerView.ViewHolder {
|
|||||||
mTvExtrude = itemView.findViewById(R.id.tv_extrude);
|
mTvExtrude = itemView.findViewById(R.id.tv_extrude);
|
||||||
mTvArea = itemView.findViewById(R.id.tv_area);
|
mTvArea = itemView.findViewById(R.id.tv_area);
|
||||||
mTvTime = itemView.findViewById(R.id.tv_time);
|
mTvTime = itemView.findViewById(R.id.tv_time);
|
||||||
|
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 PatrolKeyAreaHolder extends RecyclerView.ViewHolder {
|
||||||
|
public TextView mTvContent;
|
||||||
|
public TextView mTvResult;
|
||||||
|
public TextView mTvTime;
|
||||||
|
|
||||||
|
public PatrolKeyAreaHolder(@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.MigrantListBean;
|
||||||
import com.tengshisoft.commonmodule.beans.OutboundDetailBean;
|
import com.tengshisoft.commonmodule.beans.OutboundDetailBean;
|
||||||
import com.tengshisoft.commonmodule.beans.OutboundListBean;
|
import com.tengshisoft.commonmodule.beans.OutboundListBean;
|
||||||
|
import com.tengshisoft.commonmodule.beans.PatrolKeyAreaDetailBean;
|
||||||
|
import com.tengshisoft.commonmodule.beans.PatrolKeyAreaListBean;
|
||||||
import com.tengshisoft.commonmodule.beans.PenalDetailBean;
|
import com.tengshisoft.commonmodule.beans.PenalDetailBean;
|
||||||
import com.tengshisoft.commonmodule.beans.PenalListBean;
|
import com.tengshisoft.commonmodule.beans.PenalListBean;
|
||||||
import com.tengshisoft.commonmodule.beans.PenalSuspicionDetailBean;
|
import com.tengshisoft.commonmodule.beans.PenalSuspicionDetailBean;
|
||||||
@ -1055,5 +1057,41 @@ public interface Apis {
|
|||||||
@GET("app/logisticssafe/get/{logisticsSafeId}")
|
@GET("app/logisticssafe/get/{logisticsSafeId}")
|
||||||
Observable<ExpressDetailBean> getExpressDetailById(@Path("logisticsSafeId") String id, @Header("token") String token);
|
Observable<ExpressDetailBean> getExpressDetailById(@Path("logisticsSafeId") String id, @Header("token") String token);
|
||||||
|
|
||||||
|
/*================================================================= 巡检巡查 ========================================*/
|
||||||
|
/*重点区域巡查*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重点区域巡查记录列表
|
||||||
|
*/
|
||||||
|
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||||
|
@GET("app/keyareacheckrenovationpatrol/listpagekeyareacheckrenovationpatrol")
|
||||||
|
Observable<PatrolKeyAreaListBean> getPatrolKeyAreaList(@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/keyareacheckrenovationpatrol/save")
|
||||||
|
Observable<SuccessBean> doSaveKeyAreaPatrol(@Body RequestBody body, @Header("token") String token);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑重点区域巡查记录
|
||||||
|
*/
|
||||||
|
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||||
|
@PUT("app/keyareacheckrenovationpatrol/updatekeyareacheckrenovationpatrol/{keyAreaCheckRenovationPatrolId}")
|
||||||
|
Observable<SuccessBean> doEditKeyAreaPatrol(@Path("keyAreaCheckRenovationPatrolId") String id, @Body RequestBody body, @Header("token") String token);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除重点区域巡查记录
|
||||||
|
*/
|
||||||
|
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||||
|
@DELETE("app/keyareacheckrenovationpatrol/remove/{ids}")
|
||||||
|
Observable<SuccessBean> doDelKeyAreaPatrol(@Path("ids") String id, @Header("token") String token);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取重点区域巡查记录
|
||||||
|
*/
|
||||||
|
@Headers({"base_url_name:security", "Content-Type: application/json", "Accept: application/json"})
|
||||||
|
@GET("app/keyareacheckrenovationpatrol/get/{keyAreaCheckRenovationPatrolId}")
|
||||||
|
Observable<PatrolKeyAreaDetailBean> getKeyAreaPatrolDetailById(@Path("keyAreaCheckRenovationPatrolId") String id, @Header("token") String token);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,17 @@
|
|||||||
android:padding="10dp">
|
android:padding="10dp">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -35,6 +46,21 @@
|
|||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tools:text="涉及区域类型" />
|
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
|
<View
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:background="@drawable/shape_rectangle_white"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textColor="#ff353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="巡查内容:巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容巡查内容" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_result"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="巡查结果" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="@drawable/shp_line_dotted"
|
||||||
|
android:layerType="software" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_time"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:drawableLeft="@drawable/ic_clock_blue"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textColor="#ff1189ff"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:text="巡查时间" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -4,7 +4,11 @@
|
|||||||
package="com.tengshisoft.gridmodule">
|
package="com.tengshisoft.gridmodule">
|
||||||
|
|
||||||
<application>
|
<application>
|
||||||
<activity android:name=".incident.activitys.security.PenalVictimEditActivity"></activity>
|
<activity android:name=".incident.activitys.patrols.KeyAreaPatrolDetailActivity"></activity>
|
||||||
|
<activity android:name=".incident.activitys.patrols.KeyAreaPatrolEditActivity" />
|
||||||
|
<activity android:name=".incident.activitys.patrols.KeyAreaPatrolAddActivity" />
|
||||||
|
<activity android:name=".incident.activitys.patrols.KeyAreaPatrolListActivity" />
|
||||||
|
<activity android:name=".incident.activitys.security.PenalVictimEditActivity" />
|
||||||
<activity android:name=".incident.activitys.security.PenalVictimDetailActivity" />
|
<activity android:name=".incident.activitys.security.PenalVictimDetailActivity" />
|
||||||
<activity android:name=".incident.activitys.security.PenalVictimAddActivity" />
|
<activity android:name=".incident.activitys.security.PenalVictimAddActivity" />
|
||||||
<activity android:name=".incident.activitys.security.PenalVictimListActivity" />
|
<activity android:name=".incident.activitys.security.PenalVictimListActivity" />
|
||||||
|
@ -0,0 +1,522 @@
|
|||||||
|
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.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.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日11:46:13
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述: 重点区域巡查上报
|
||||||
|
*/
|
||||||
|
@Route(path = PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_ADD)
|
||||||
|
public class KeyAreaPatrolAddActivity 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 mAreaId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutId() {
|
||||||
|
return R.layout.activity_key_area_patrol_add;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
mBind = ButterKnife.bind(this);
|
||||||
|
mAreaId = getIntent().getStringExtra("areaId");
|
||||||
|
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)
|
||||||
|
.doSaveKeyAreaPatrol(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() {
|
||||||
|
SavePatrolKeyAreaBean bean = new SavePatrolKeyAreaBean();
|
||||||
|
bean.setKeyAreaCheckRenovationId(mAreaId);
|
||||||
|
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,244 @@
|
|||||||
|
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.PatrolKeyAreaDetailBean;
|
||||||
|
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日14:00:47
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述: 重点区域巡查记录详情
|
||||||
|
*/
|
||||||
|
@Route(path = PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_DETAIL)
|
||||||
|
public class KeyAreaPatrolDetailActivity 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 mAreaId;
|
||||||
|
private PatrolKeyAreaDetailBean mDetailBean;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutId() {
|
||||||
|
return R.layout.activity_key_area_patrol_detail;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
mBind = ButterKnife.bind(this);
|
||||||
|
mTvBaseTitle.setText("重点区域巡查记录详情");
|
||||||
|
mId = getIntent().getStringExtra("id");
|
||||||
|
mAreaId = getIntent().getStringExtra("areaId");
|
||||||
|
mBtnDel.setOnClickListener(v -> doDel());
|
||||||
|
mBtnEdit.setOnClickListener(v -> doEdit());
|
||||||
|
getDetailData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doEdit() {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_EDIT)
|
||||||
|
.withString("id", mId)
|
||||||
|
.withString("areaId", mAreaId)
|
||||||
|
.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)
|
||||||
|
.doDelKeyAreaPatrol(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)
|
||||||
|
.getKeyAreaPatrolDetailById(mId, UserLgUtils.getToken())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<PatrolKeyAreaDetailBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull PatrolKeyAreaDetailBean 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,581 @@
|
|||||||
|
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.PatrolKeyAreaDetailBean;
|
||||||
|
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.base.BaseShowPhotoAdapter;
|
||||||
|
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日13:59:32
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述:重点区域巡查记录编辑
|
||||||
|
*/
|
||||||
|
@Route(path = PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_EDIT)
|
||||||
|
public class KeyAreaPatrolEditActivity 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 mAreaId;
|
||||||
|
private String mId;
|
||||||
|
private PatrolKeyAreaDetailBean mDetailBean;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutId() {
|
||||||
|
return R.layout.activity_key_area_patrol_edit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
mBind = ButterKnife.bind(this);
|
||||||
|
mId = getIntent().getStringExtra("id");
|
||||||
|
mAreaId = getIntent().getStringExtra("areaId");
|
||||||
|
mTvBaseTitle.setText("重点区域巡查记录编辑");
|
||||||
|
initViews();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取详情
|
||||||
|
*/
|
||||||
|
private void getDetailData() {
|
||||||
|
RetrofitManager.getInstance()
|
||||||
|
.create(Apis.class)
|
||||||
|
.getKeyAreaPatrolDetailById(mId, UserLgUtils.getToken())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<PatrolKeyAreaDetailBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull PatrolKeyAreaDetailBean 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
.doEditKeyAreaPatrol(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() {
|
||||||
|
SavePatrolKeyAreaBean bean = new SavePatrolKeyAreaBean();
|
||||||
|
bean.setKeyAreaCheckRenovationId(mAreaId);
|
||||||
|
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,348 @@
|
|||||||
|
package com.tengshisoft.gridmodule.incident.activitys.patrols;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.text.Html;
|
||||||
|
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.PatrolKeyAreaListAdapter;
|
||||||
|
import com.tengshisoft.commonmodule.beans.KeyAreaDetailBean;
|
||||||
|
import com.tengshisoft.commonmodule.beans.PatrolKeyAreaListBean;
|
||||||
|
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.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日11:22:09
|
||||||
|
* 邮箱: itgaojian@163.com
|
||||||
|
* 描述: 重点区域巡查记录
|
||||||
|
*/
|
||||||
|
@Route(path = PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_LIST)
|
||||||
|
public class KeyAreaPatrolListActivity extends BaseActivity {
|
||||||
|
|
||||||
|
|
||||||
|
@BindView(R2.id.srl_content)
|
||||||
|
SmartRefreshLayout mSrlContent;
|
||||||
|
@BindView(R2.id.rlv_buildings)
|
||||||
|
RecyclerView mRlvBuildings;
|
||||||
|
@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.pb_loading)
|
||||||
|
ProgressBar mPbLoading;
|
||||||
|
@BindView(R2.id.iv_empty_data)
|
||||||
|
ImageView mIvEmptyData;
|
||||||
|
@BindView(R2.id.tv_error_hint)
|
||||||
|
TextView mTvErrorHint;
|
||||||
|
@BindView(R2.id.tv_name)
|
||||||
|
TextView mTvName;
|
||||||
|
@BindView(R2.id.tv_extrude)
|
||||||
|
TextView mTvExtrude;
|
||||||
|
@BindView(R2.id.tv_area_type)
|
||||||
|
TextView mTvAreaType;
|
||||||
|
@BindView(R2.id.tv_area_scope)
|
||||||
|
TextView mTvAreaScope;
|
||||||
|
@BindView(R2.id.tv_leader_dept)
|
||||||
|
TextView mTvLeaderDept;
|
||||||
|
@BindView(R2.id.tv_leader)
|
||||||
|
TextView mTvLeader;
|
||||||
|
@BindView(R2.id.tv_leader_phone)
|
||||||
|
TextView mTvLeaderPhone;
|
||||||
|
@BindView(R2.id.tv_into_dept)
|
||||||
|
TextView mTvIntoDept;
|
||||||
|
|
||||||
|
private Unbinder mBind;
|
||||||
|
private int mCurrentPage = 1;//当前页数
|
||||||
|
private List<PatrolKeyAreaListBean.RowsBean> mDatas = new ArrayList<>();
|
||||||
|
private PatrolKeyAreaListAdapter mAdapter;
|
||||||
|
private String mKeywords = "";
|
||||||
|
private String mAreaId;
|
||||||
|
private KeyAreaDetailBean mAreaDetailBean;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutId() {
|
||||||
|
return R.layout.activity_key_area_patrol_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
mBind = ButterKnife.bind(this);
|
||||||
|
mAreaId = getIntent().getStringExtra("areaId");
|
||||||
|
mTvBaseTitle.setText("巡查记录");
|
||||||
|
mTvPublish.setVisibility(View.VISIBLE);
|
||||||
|
mTvPublish.setText("巡查");
|
||||||
|
mTvPublish.setOnClickListener(v -> ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_ADD)
|
||||||
|
.withString("areaId", mAreaId)
|
||||||
|
.navigation(mActivity, 12));
|
||||||
|
mAdapter = new PatrolKeyAreaListAdapter(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);
|
||||||
|
getKeyAreaDetail();
|
||||||
|
mBtnBaseSearch.setOnClickListener(v -> doSearch());
|
||||||
|
mIvBaseClear.setOnClickListener(v -> {
|
||||||
|
mKeywords = "";
|
||||||
|
mEtBaseSearchContent.setText("");
|
||||||
|
doRefresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取重点区域详情
|
||||||
|
*/
|
||||||
|
private void getKeyAreaDetail() {
|
||||||
|
RetrofitManager.getInstance()
|
||||||
|
.create(Apis.class)
|
||||||
|
.getKeyAreaDetailById(mAreaId, UserLgUtils.getToken())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<KeyAreaDetailBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull KeyAreaDetailBean keyAreaDetailBean) {
|
||||||
|
mAreaDetailBean = keyAreaDetailBean;
|
||||||
|
setAreaDataToView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回显重点区域数据
|
||||||
|
*/
|
||||||
|
private void setAreaDataToView() {
|
||||||
|
mTvName.setText(mAreaDetailBean.getSecurityArea());
|
||||||
|
mTvExtrude.setText(mAreaDetailBean.getSecurityQuestionName());
|
||||||
|
mTvAreaType.setText(mAreaDetailBean.getInvolveAreaTypeName());
|
||||||
|
mTvAreaScope.setText(Html.fromHtml(mAreaDetailBean.getInvolveAreaRange()));
|
||||||
|
mTvLeaderDept.setText(Html.fromHtml(mAreaDetailBean.getRenovationLeadDept()));
|
||||||
|
mTvLeader.setText(mAreaDetailBean.getLeadDeptMan());
|
||||||
|
mTvLeaderPhone.setText(mAreaDetailBean.getLeadDeptPhone());
|
||||||
|
mTvIntoDept.setText(Html.fromHtml(mAreaDetailBean.getRenovationJoinDept()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示详情
|
||||||
|
*/
|
||||||
|
private void showDetail(PatrolKeyAreaListBean.RowsBean b) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_DETAIL)
|
||||||
|
.withString("id", b.getKeyAreaCheckRenovationPatrolId())
|
||||||
|
.withString("areaId", b.getKeyAreaCheckRenovationId())
|
||||||
|
.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)
|
||||||
|
.getPatrolKeyAreaList(mKeywords, mCurrentPage + "", UserLgUtils.getToken())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<PatrolKeyAreaListBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull PatrolKeyAreaListBean 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ package com.tengshisoft.gridmodule.incident.activitys.security;
|
|||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.text.Html;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@ -203,15 +204,15 @@ public class KeyAreaDetailActivity extends BaseActivity {
|
|||||||
mTvName.setText(mDetailBean.getSecurityArea());
|
mTvName.setText(mDetailBean.getSecurityArea());
|
||||||
mTvExtrude.setText(mDetailBean.getSecurityQuestionName());
|
mTvExtrude.setText(mDetailBean.getSecurityQuestionName());
|
||||||
mTvAreaType.setText(mDetailBean.getInvolveAreaTypeName());
|
mTvAreaType.setText(mDetailBean.getInvolveAreaTypeName());
|
||||||
mTvAreaScope.setText(mDetailBean.getInvolveAreaRange());
|
mTvAreaScope.setText(Html.fromHtml(mDetailBean.getInvolveAreaRange()));
|
||||||
mTvLeaderDept.setText(mDetailBean.getRenovationLeadDept());
|
mTvLeaderDept.setText(Html.fromHtml(mDetailBean.getRenovationLeadDept()));
|
||||||
mTvLeader.setText(mDetailBean.getLeadDeptMan());
|
mTvLeader.setText(mDetailBean.getLeadDeptMan());
|
||||||
mTvLeaderPhone.setText(mDetailBean.getLeadDeptPhone());
|
mTvLeaderPhone.setText(mDetailBean.getLeadDeptPhone());
|
||||||
mTvIntoDept.setText(mDetailBean.getRenovationJoinDept());
|
mTvIntoDept.setText(Html.fromHtml(mDetailBean.getRenovationJoinDept()));
|
||||||
mTvDate.setText(mDetailBean.getRectificationTime());
|
mTvDate.setText(mDetailBean.getRectificationTime());
|
||||||
mTvPenalNum.setText(mDetailBean.getRenovationCriminalCount() + "");
|
mTvPenalNum.setText(mDetailBean.getRenovationCriminalCount() + "");
|
||||||
mTvOrderNum.setText(mDetailBean.getRenovationSecurityCount() + "");
|
mTvOrderNum.setText(mDetailBean.getRenovationSecurityCount() + "");
|
||||||
mTvAssess.setText(mDetailBean.getEffectEvaluationName());
|
mTvAssess.setText(mDetailBean.getEffectEvaluationName());
|
||||||
mTvDesc.setText(mDetailBean.getRenovationSituationw());
|
mTvDesc.setText(Html.fromHtml(mDetailBean.getRenovationSituationw()));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -97,6 +97,7 @@ public class KeyAreaListActivity extends BaseActivity {
|
|||||||
mRlvBuildings.setLayoutManager(new LinearLayoutManager(mActivity));
|
mRlvBuildings.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvBuildings.setAdapter(mAdapter);
|
mRlvBuildings.setAdapter(mAdapter);
|
||||||
mAdapter.addOnItemClickListener(this::showDetail);
|
mAdapter.addOnItemClickListener(this::showDetail);
|
||||||
|
mAdapter.addOnPatrolListener(this::doPatrol);
|
||||||
refreshView(STATE_LOAD_SUCCESS);
|
refreshView(STATE_LOAD_SUCCESS);
|
||||||
setStateView(13);
|
setStateView(13);
|
||||||
getKeyAreaList(1);
|
getKeyAreaList(1);
|
||||||
@ -108,6 +109,18 @@ public class KeyAreaListActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡查记录
|
||||||
|
*
|
||||||
|
* @param bean
|
||||||
|
*/
|
||||||
|
private void doPatrol(KeyAreaListBean.RowsBean bean) {
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_GRID_ACTIVITY_PATROL_KEY_AREA_LIST)
|
||||||
|
.withString("areaId", bean.getKeyAreaCheckRenovationId())
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示详情
|
* 显示详情
|
||||||
|
187
gridmodule/src/main/res/layout/activity_key_area_patrol_add.xml
Normal file
187
gridmodule/src/main/res/layout/activity_key_area_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_key_area_patrol_edit.xml
Normal file
187
gridmodule/src/main/res/layout/activity_key_area_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>
|
241
gridmodule/src/main/res/layout/activity_key_area_patrol_list.xml
Normal file
241
gridmodule/src/main/res/layout/activity_key_area_patrol_list.xml
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
<?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="wrap_content">
|
||||||
|
|
||||||
|
<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_extrude"
|
||||||
|
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_type"
|
||||||
|
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_scope"
|
||||||
|
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_leader_dept"
|
||||||
|
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_leader"
|
||||||
|
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_leader_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_into_dept"
|
||||||
|
style="@style/item_content" />
|
||||||
|
</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>
|
Loading…
Reference in New Issue
Block a user